/* 

DW 2008 | © DELTA WEB http://www.delta-web.com



*/
/* _____________________________________________________________
   
   |
   | IMPORT
   |
   ______________________________________________________________
*/
document.write("<script type='text/javascript' src='"+traceur+"includes/Menu.js'></script>");

/* _____________________________________________________________
   
   |
   | ACTIONS
   |
   ______________________________________________________________
*/

function ow(url)
{
	window.open(url);
}

function Fieldsearch(ele,pLib) {
	
	ele.value = pLib;
	var lib;
		
	ele.onfocus = function()
	{
		lib = this.value;
		this.value = "";
	}
	
	ele.onblur = function()
	{
		if(this.value == "")
		{
			this.value = pLib;
		}
	}
}

/* ______________________________________________________________
   
   Show / Hide
   
*/

function show(id)
{
    document.getElementById(id).style.display = "block";
}

function hide(id)
{
    document.getElementById(id).style.display = "none";
}

/* ______________________________________________________________
   
   HideShow
   
*/

function Hideshowbt(pEle,pTarget)
{
	ele = document.getElementById(pEle);
	etarget = document.getElementById(pTarget);
	
	ele.onclick = function()
	{
		if(etarget.style.display == "none")
		{
			etarget.style.display = "block";
		} else {
			etarget.style.display = "none";
		}
	}
}

/* ______________________________________________________________
   
   Auto scroll
   
*/

acScroller = false;
depY = 0;

function getCurrentPos ()
{
	if(navigator.appName == 'Microsoft Internet Explorer' )
	{
		curPosY = document.documentElement.scrollTop;
	} else {
		curPosY = window.pageYOffset;
	}
}

function getTargetPos (ele)
{
	var Y = document.getElementById(ele).offsetTop;
	destY = Y;
}

function scrollerAction ()
{
	getCurrentPos();
	
	if(Math.round(curPosY) != destY)
	{
		depY += (destY-curPosY)/6;
		window.scrollTo(0,depY);
		setTimeout(scrollerAction,10);
	} else {
		window.scrollTo(0,destY);
		hide('endblank');
		//alert("end DEP");
	}
}

function scroller (ele)
{
	endPage();
	show('endblank');
	getCurrentPos();
	depY = curPosY;
	getTargetPos(ele);
	scrollerAction();
}

function endPage()
{
	document.getElementById('endblank').style.height = document.body.scrollHeight*2+"px";
	hide('endblank');
}

/* _____________________________________________________________
   
   |
   | DISPLAY
   |
   ______________________________________________________________
*/
/* ______________________________________________________________
   
   Main menu
   
*/

function mainnav (plot, selected)
{
	var nb_bt = lib_ary.length;
	var navlist = "";
	for(i=0;i<nb_bt;i++)
	{
		if(i!=selected)
		{
			navlist = navlist+"<li><a href="+plot+nav_ary[i]+">"+lib_ary[i]+"</a></li>";
		} else {
			navlist = navlist+"<li class='selected'><a href="+plot+nav_ary[i]+">"+lib_ary[i]+"</a></li>";
		}
	}
	document.write("<ul id='navmenu'>"+navlist+"</ul>");
}

/* ______________________________________________________________
   
   Footer
   
*/

function footer ()
{
	var listemenufooter = "";
	
	for(i=0;i<nav_ary.length;i++)
	{
		listemenufooter = listemenufooter+"<dd><a href='"+traceur+""+nav_ary[i]+"'>"+lib_ary[i]+"</a></dd>";
	}
	
	
	document.write("<div id='footer'>"
				   
				   +"<div id='cartouchefooter'>"
				   
				   +"<dl>"
				   +"<dt>Menu.</dt>"
				   +listemenufooter
				   +"</dl>"
				   
				   +"<dl>"
				   +"<dt>Aspaé.</dt>"
				   +"<dd><a href='#'>Publicité</a></dd>"
				   +"<dd><a href='#'>Figurer dans l'aspaé</a></dd>"
				   +"</dl>"
				   
				   +"<div class='clearboth'></div>"
				   
				   +"</div>"
				   
				   +"<dl>"
				   +"<dt>Utile.</dt>"
				   +"<dd><a href='#'>Informations légales</a></dd>"
				   +"<dd><a href='#'>La CNIL</a></dd>"
				   +"<dd><a href='#'>Conditions générales</a></dd>"
				   +"<dd><a href='#'>Plan du site</a></dd>"
				   +"</dl>"
				   
				   +"<dl>"
				   +"<dt>Feedback.</dt>"
				   +"<dd><a href='#'>Information érronée</a></dd>"
				   +"<dd><a href='"+traceur+"contact.php?T=2'>Suggestions</a></dd>"
				   +"</dl>"
				   
				   +"<p class='dw'>"
				   +"<a href=\"http://www.delta-web.com\" onclick=\"ow(this.href);return false;\"><img src='"+traceur+"images/logo_dw_footer.gif' alt='' /></a>"
				   +"<a href=\"http://www.delta-web.com\" onclick=\"ow(this.href);return false;\">Propuls&eacute; par DW</a>"
				   +"</p>"
				   
				   +"<div class='clearboth'></div>"
				   
				   +"</div>"
				   
				   );
}

/* ______________________________________________________________
   
   Flash
   
*/
function flashobj (id,src,W,H,WM)
{
	document.write("<object id='"+id+"' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,19,0' width='"+W+"' height='"+H+"' align='middle'>");
	document.write("<param name='allowScriptAccess' value='always'>");
	document.write("<param name='wmode' value='"+WM+"'>");
	document.write("<param name='movie' value="+src+">");
	document.write("<param name='quality' value='high'>");
	document.write("<param name='allowFullScreen' value='true'>");
	document.write("<embed name='"+id+"' src="+src+" allowScriptAccess='always' allowFullScreen='true' width='"+W+"' height='"+H+"' wmode='"+WM+"' align='middle' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash'></embed>");
	document.write("</object>");
}
