	function goIndex(valor)
    {
        if(valor.idLang.value != null && valor.idLang.value != '')
        {
            valor.submit();
        }
    }
    
    function soumettre(obj, path, msg)
	{
		if(ValiderFormulaire(obj,'D2E9FF',msg)==true)//  BGCOLOR="#"
		{
			obj.action = "" + path;
			obj.submit();
		}
	}

	/***************************************************************
	  * Fonction générale qui valide le contenu d'un formulaire.                                            *
	  * Il est important d'ajouter l'attribut REQUIED="TRUE" pour champ obligatoire.        *
	  **************************************************************/
	function ValiderFormulaire(formulaire,colorAlert,msg)
	{
		var bOK=true;
		var tmpobj;	
		for(noElement=0;noElement<formulaire.length;noElement++)
		{
			var objForm = formulaire.elements[noElement];
            
			if(objForm.getAttribute("REQUIED") == "TRUE")
			{
				if(((objForm.type=="text" || objForm.type=="textarea" || objForm.type=="radio") && objForm.value=='') || (objForm.type.toString().substr(0,6)=="select" && objForm.selectedIndex==0))
				{
					objForm.style.backgroundColor = colorAlert;
					bOK=false;
				} else objForm.style.backgroundColor = "#FFFFFF";
			}
		}
				
		if(!bOK){
			alert(msg);
			return false;
		}
		else{
			return true;
		}
	}

	function getCenterTop(longeur)
	{
		var w=window.screen.width;
		return (w/2)-(longeur/2);
	}

	function getCenterLeft(haut)
	{
		var h=window.screen.height-20;
		return (h/2)-(haut/2);
	}

	/*function goPage(defaultLang)
	{
			document.choixLang.lang.value=defaultLang;
			document.choixLang.submit();
	}*/

	
	function closeAndReloadPage()
	{
		//window.opener.reload();
		window.close();
		window.opener.history.go(0);
	}
	
	function confirmToDelete(msg, page)
	{
		if (confirm(msg)) { // Clic sur OK
			document.location.href=page;
		}

	}
	
	function openWindows(page, ww, hh)
	{
		var h = getCenterLeft(hh);
		var w = getCenterTop(ww);
		//alert(page);
		var win = window.open(page,"_blank", "left=" + w + ", top=" + h + ", width=" + ww + ", height=" + hh + ", toolbar=no, location=no, directories=no, status=no, scrollbars=yes, resizable=no,menubar=no");
	}
	
	function changeColor(leBgColor, leFont, leDiv, valor)
	{
		//eval("document.getElementById('menu" + leDiv + "').style.backgroundColor='" + leBgColor + "';")
		eval("document.getElementById('menu"  + leDiv + "').style.color='" + leFont + "';");
		if(valor=='TRUE')
			eval("document.boton" + leDiv + ".src='images/buttonOn.gif'");
		else
			eval("document.boton" + leDiv + ".src='images/buttonOff.gif'");
	}
	
	function changeFond(id, leBgColor, leFont)
	{
			eval("document.getElementById('TD" + id + "').style.backgroundColor='" + leBgColor + "';");
			eval("document.getElementById('menu"  + id + "').style.color='" + leFont + "';");
	}
	
	function changeMenu(id, leBgColor, etat)
	{
		var img1=eval("document.getElementById('img" + id + "')");
		//alert(img1);
		eval("document.getElementById('titre" + id + "').style.color='" + leBgColor + "';");
		if(etat)
			img1.src="images/common/shape.jpg";
		else
			img1.src="images/common/trans.gif";
			//eval("document.getElementById('menu"  + id + "').style.color='" + leFont + "';");
	}
	
	function changeFond2(leBgColor, leFont, leDiv)
	{		
		eval("document.getElementById('trSubMenu" + leDiv + "').style.backgroundColor='" + leBgColor + "';");
		eval("document.getElementById('subMenu"  + leDiv + "').style.color='" + leFont + "';");
	}
	
	function hideDiv(num, etat)
	{
		var objTR = eval("document.getElementById('tr" + num + "')");
		var img1=eval("document.img" + num);
		var img2=eval("document.folder" + num);
		if(objTR.style.display == "none")
		{
			objTR.style.display="";
			if(etat)
				 img1.src="images/mlastnode.gif";
			else
				img1.src="images/mnode.gif";
			img2.src="images/folder_open.gif";
		}
		else
		{
			if(etat)
				img1.src="images/plastnode.gif";
			else
				img1.src="images/pnode.gif";
				
			objTR.style.display="none";
			img2.src="images/folder_close.gif";	//folder_close
		}
	}
	
	function submitPage(form)
	{
		alert(form.name);
		form.submit();
	}
	
	function getImage(obj, val)
	{	
		var img1=eval("document.getElementById('" + obj+ "')");
		//img1.src="/nyan/images/iconAvatar/"+ val + ".gif";
		img1.src=val;
	}
	
	function hideObje(num, etat)
	{
		var objTR = eval("document.getElementById('tr" + num + "')");
		if(etat == "true")
		{
			objTR.style.display="";
		}
		else
		{
			objTR.style.display="none";
		}
	}
	
	function hideDivObj(value)
	{
		//var objTR1 = eval("document.getElementById('tr_" + value + "')");
		//var objTR2 = eval("document.getElementById('tr_" + value + "')");
		var objTR1 = document.getElementById("tr_en");
		var objTR2 = document.getElementById("tr_fr");
		//alert(objTR1 + " ** " + objTR2);
		
		if(value== 'en')
		{
			objTR1.style.display="";
			objTR2.style.display="none";
		}else if(value=='fr')
		{
			objTR1.style.display="none";
			objTR2.style.display="";
		}else{
			objTR1.style.display="";
			objTR2.style.display="";
		}
	}
	
	function putData(nameForm, champTable, valueTable)
	{
		var objChampTable = eval(nameForm + "." + champTable);
		objChampTable.value = valueTable;
	}
	
	var interval = "";
	var i = 5;

	function startInterval()
	{
	    interval = window.setInterval("goPage()",8000);
	}
	
	function goPage()
	{
		document.location.href="Load.do?section=5&sub=1";
	}
	/*function stopInterval()
	{
	    window.clearInterval (interval);
	    interval="";
	}
	function tTimer()
	{
	    document.f.display.value = i--;
	    if (i == -1)
	    {
	        stopInterval();
	        alert ("TIME'S UP");
	    }
	}*/

	