// JavaScript Document

var IdTimer = 0;
var IdTimer3 = 0;

	window.status = '{STATUS}';
	function openwin(url,w,h)
	{
		w=window.open(url,'dimswin','width='+w+', height='+h+', status=no, menubar=no, toolbar=no, scrollbars=yes, resizable=yes, screenY=20, screenX=20');
		w.moveTo((screen.width-w)/2,(screen.height-(h+60))/2);
		w.focus();
	}
	function getelem(field) { return (document.getElementById) ? document.getElementById(field):eval("document.all[field]"); }

	function MM_jumpMenu(targ,selObj,restore)//v3.0
	{
		eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
		if (restore) selObj.selectedIndex=0;
	}
	//-->

	/* ***********************************
	FONCTION POUR CORRIGER BUG D'AFFICHAGE AVEC LES MENUS DEROULANT SOUS IE !!!
	***********************************  */
	function fDomOffset( oObj, sProp )
	{
		  /*  oObj : [Object] - Objet dont on désire le positionnement  */
		  /*  sProp : [String] - Propriété désirée : offsetLeft - offsetTop  */
		var iVal = 0;
		  /*  On boucle tant que l'on n'est pas a la racine du document  */
		while (oObj && oObj.tagName != 'BODY') {
			eval('iVal += oObj.' + sProp + ';');
			oObj = oObj.offsetParent;
		}
		return iVal;
	}

	function fSwapSelect( sId )
	{
	oObj = document.getElementById(sId);
	Top_Element  = fDomOffset(oObj, 'offsetTop');
	Left_Element  = fDomOffset(oObj, 'offsetLeft');
	Largeur_Element  = oObj.offsetWidth;
	Hauteur_Element  = oObj.offsetHeight;
	oSelects = document.getElementsByTagName('SELECT');
	if (oSelects.length > 0) {
		for (i = 0; i < oSelects.length; i++) {
			oSlt = oSelects[i];
			Top_Select = fDomOffset(oSlt, 'offsetTop');
			Left_Select = fDomOffset(oSlt, 'offsetLeft');
			Largeur_Select = oSlt.offsetWidth;
			Hauteur_Select = oSlt.offsetHeight;
			isLeft = false;
			if ((Left_Element > (Left_Select - Largeur_Element)) && (Left_Element < (Left_Select + Largeur_Select))) {
				isLeft = true;
			}
			isTop = false;
			if ((Top_Element > (Top_Select - Hauteur_Element)) && (Top_Element < (Top_Select + Hauteur_Select))) {
				isTop = true;
			}
			if (isLeft && isTop) {
				sVis = (oObj.style.visibility == 'hidden') ? 'visible' : 'hidden';
				if (oSlt.style.visibility != sVis) {oSlt.style.visibility = sVis;}
				} else {
					if (oSlt.style.visibility != 'visible') {oSlt.style.visibility = 'visible';}
				}
			}
		}
	}
	/* **************************************  */

	function findPosX(obj)
	{
		var curleft = 0;
		if (obj.offsetParent)
		{
			while (obj.offsetParent)
			{
				curleft += obj.offsetLeft
				obj = obj.offsetParent;
			}
		}
		else if (obj.x)
			curleft += obj.x;
		return curleft;
	}

	function findPosY(obj)
	{
		var curtop = 0;
		if (obj.offsetParent)
		{
			while (obj.offsetParent)
			{
				curtop += obj.offsetTop
				obj = obj.offsetParent;
			}
		}
		else if (obj.y)
			curtop += obj.y;
		return curtop;
	}

	function hidetime()
	{
		if(IdTimer) clearTimeout(IdTimer);
		IdTimer = setTimeout("hideall()",250);
	}
	function hidetime3()
	{
		if(IdTimer3) clearTimeout(IdTimer3);
		IdTimer3 = setTimeout("hideall3()",250);
	}
	function killtime()
	{
		if(IdTimer) clearTimeout(IdTimer);
	}
	function killtime3()
	{
		if(IdTimer3) clearTimeout(IdTimer3);
	}
	function hideit(action, nom_layer, src)
	{
		if (document.layers)
		{
			// Netscape 4 stuff
			var cible = document.layers[nom_layer];
		}
		else if (document.getElementById)
		{
			// IE 5 and Netscape 6
			var cible = document.getElementById(nom_layer);
		}
		else if (document.all)
		{
			// IE 4 ??
			var cible = document.all(nom_layer);
		}
		else
		{
			alert("Probl&egrave;me avec votre navigateur");
		}

		x = 0;
		y = 0;
		if (!action && src)
		{
			x = findPosX(src);
			y = findPosY(src);
		}		
		if (cible.style)
		{
			// IE4 ??, IE5, Netscape 6
			if (action)
			{
				cible.style.visibility = "hidden";
			}
			else
			{
				if (cible.innerHTML.length > 40)
				{
					if (x!=0) cible.style.left = x + "px";
					if (y==0) cible.style.top = y + 30 + "px";
					cible.style.visibility = "visible";
				}
			}
		}
		else
		{
			// Netscape 4
			if (x!=0) cible.left = x;
			if (y!=0) cible.top = y;

			if (action)
			{
				cible.visibility = "hide";
			}
			else
			{
				cible.visibility = "show";
			}
		}
		//fSwapSelect(nom_layer,false);
	}

function hideit3(action, nom_layer, src)
	{
		if (document.layers)
		{
			// Netscape 4 stuff
			var cible = document.layers[nom_layer];
		}
		else if (document.getElementById)
		{
			// IE 5 and Netscape 6
			var cible = document.getElementById(nom_layer);
		}
		else if (document.all)
		{
			// IE 4 ??
			var cible = document.all(nom_layer);
		}
		else
		{
			alert("Probl&egrave;me avec votre navigateur");
		}

		x = 0;
		y = 0;
		if (!action && src)
		{
			x = findPosX(src);
			y = findPosY(src);
		}		
		if (cible.style)
		{
			// IE4 ??, IE5, Netscape 6
			if (action)
			{
				cible.style.visibility = "hidden";
			}
			else
			{
				if (cible.innerHTML.length > 40)
				{
					if (x!=0) cible.style.left = x + "px";
					if (y!=0) cible.style.top = y + 20 + "px";
					cible.style.visibility = "visible";
				}
			}
		}
		else
		{
			// Netscape 4
			if (x!=0) cible.left = x;
			if (y!=0) cible.top = y;

			if (action)
			{
				cible.visibility = "hide";
			}
			else
			{
				cible.visibility = "show";
			}
		}
		//fSwapSelect(nom_layer,false);
	}

function montre(id) {
var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenuH'+i)) {document.getElementById('smenuH'+i).style.display='none';}
	}
if (d) {d.style.display='block';}
}

	function hidetimeV()
	{
		if(IdTimer) clearTimeout(IdTimer);
		IdTimer = setTimeout("montre()",75);
	}
