// JavaScript Document

function openIT(url,w,h,x,y,wname,titre,color,newwin,strFeatures)
{
	// ouvre une fenetre sans barre d'etat, ni d'ascenceur  
	if ((strFeatures == "") || (typeof(strFeatures) == "undefined"))
		strFeatures = "toolbar=0,scrollbars=1,resizable=1";
	
	if ((titre == "")|| (typeof(titre) == "undefined"))
		titre = "win";
	if (newwin==1){
		
		win2 = open(url,titre,'width='+w+',height='+h+','+strFeatures);
	}
	else{
		mywindow = open(url,titre,'width='+w+',height='+h+','+strFeatures);	
		mywindow.focus();
	}
}

function openWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}

// gestion sous niveaux du menu

	onload = function()
	{
		setHover(); 
	}	
	
	function hover(obj)
	{
		UL = obj.getElementsByTagName('ul');
		if(UL.length > 0)
		{
			subLevelStyle = UL[0].style;
			subLevel = UL[0];
			str = parseInt(UL[0].id.substr(4),10);
			
			if(subLevel.getElementsByTagName('li'.toUpperCase()).length > 0)
			{
				if(subLevelStyle.visibility == 'hidden' || subLevelStyle.visibility == '')
				{
					for(i=1;i<7;i++)
					{
						if(str != i) document.getElementById(eval('"menu'+i+'"')).style.visibility = "hidden";
					}
					if(str != 2) subLevelStyle.visibility = 'visible';
				}
				else
				{
					for(i=1;i<7;i++) document.getElementById(eval('"menu'+i+'"')).style.visibility = "hidden";
					subLevelStyle.visibility = 'hidden';
				}
			}
		}
	}
	
	function setHover(){setTimeout("setHover_action()",250)}

	function setHover_action()
	{
		LI = document.getElementById('main-menu').getElementsByTagName('li');
		nLI = LI.length;
		for(i=0;i<nLI;i++)
		{
				LI[i].onmouseover = function()
				{
					hover(this);
				}
				LI[i].onmouseout = function()
				{
					hover(this);
				}
		}
	}
