/*gestion du menu*/
function gstMenu()
{
	menuImg = document.getElementById('menu').getElementsByTagName('IMG'); 
	if (menuImg.length > 0) 
	{
		for (i = 0; i < menuImg.length; i++)
		{ 
			menuImg[i].onmouseover	=	function()
			{
				if(document.getElementById('sm_'+this.id))
					showObj('sm_'+this.id, 2500);
				
				menuImgHide = document.getElementById('menu').getElementsByTagName('IMG'); 
				for (j = 0; j < menuImgHide.length; j++)
				{
					if(document.getElementById('sm_'+menuImgHide[j].id) && this.id != menuImgHide[j].id)
						document.getElementById('sm_'+menuImgHide[j].id).style.visibility = 'hidden';
				}
			}
		}
	}
}

//Timer OBJ
var T = '';
function showObj(nomObj, duration)
{
	if(document.getElementById(nomObj))
	{
		document.getElementById(nomObj).style.visibility='visible';
		if(navigator.appName=="Microsoft Internet Explorer" && navigator.appVersion.indexOf('MSIE 6') != -1 && nomObj == 'sm_veille-et-etudes')
		{
			document.getElementById('mois').style.visibility = 'hidden';
			document.getElementById('annee').style.visibility = 'hidden';
		}
	}
	if(duration!='inf')
	{
		clearTimeout(T);
		var href = document.getElementById(nomObj).getElementsByTagName('A');
		for (var i = 0; i < href.length; i++)
		{
			href[i].onmouseover= function (){ showObj(nomObj,duration); }
		}
		T = setTimeout('hideObj("'+nomObj+'");',duration);
	}
}
function hideObj(nomObj)
{
	document.getElementById(nomObj).style.visibility = 'hidden';
	if(navigator.appName=="Microsoft Internet Explorer" && navigator.appVersion.indexOf('MSIE 6') != -1 && nomObj == 'sm_veille-et-etudes')
	{
		document.getElementById('mois').style.visibility = 'visible';
		document.getElementById('annee').style.visibility = 'visible';
	}
}

//roll Fields
function init()
{
	//EFFETS CHAMPS INPUT
	inputs = document.getElementsByTagName('INPUT'); 
	if (inputs.length > 0) 
	{
		for (i = 0; i < inputs.length; i++)
		{ 
			inputs[i].onfocus	=	function(){
					this.style.backgroundColor		=	'#efefff';
			}
			inputs[i].onblur	=	function(){
				blurInput();
			}
		}
		function blurInput(){
			for (i = 0; i < inputs.length; i++)
				inputs[i].style.backgroundColor	=	'#fff';
		}
	}
	
	if( document.getElementById('btObs') )
	{
		$('#btObs').hover(
			function () { $(this).attr('src','../images/model/bt-observatoireOver.gif'); },
			function () { $(this).attr('src','../images/model/bt-observatoire.gif');}					
		);
		
		$('#btObs').click(function () {
			openShadowbox('../index.php?p=obsacces&mode=acces','Acces Observatoire',657,347);
		});
		
		
	}
	   
	   
	
	
}
//ancre
function goAnchor(name)
{
	document.location = '#'+name;
}


//Gst Compte
function zoneCompte(etat)
{
	switch (etat)
	{
		case 'O' :		document.getElementById('zoneO1').style.display = 'block';
						document.getElementById('zoneO2').style.display = 'block';
						document.getElementById('formContact').style.display = 'none';
						document.getElementById('zoneN2').style.display = 'none';
						break;
		case 'N' :		document.getElementById('zoneO1').style.display = 'none';
						document.getElementById('zoneO2').style.display = 'none';
						document.getElementById('formContact').style.display = 'block';
						document.getElementById('zoneN2').style.display = 'block';
						break;						
	}
	
}

//ICOS
function adnPrint()
{
	explode						=	location.href.split('/');
	lastEl						=	explode[explode.length-1];
	explode[explode.length-1]	=	'';
	current						=	explode.join('/');
	window.open(current+'_print_'+lastEl, '_blank');
}

//afficher synthese veille
function showSynthese()
{
	document.getElementById('synth').style.display = 'block';
	document.getElementById('accesDet').style.display = 'none';
}
function hideSynthese()
{
	document.getElementById('synth').style.display = 'none';
	document.getElementById('accesDet').style.display = 'block';
}

//Oubli mdp
function oubliMdp()
{
	document.getElementById('oubli').style.display = 'block';
	showObj('oubli', 'inf');
	document.getElementById('emailOubli').value = '';
	document.getElementById('errorOubli').innerHTML = '';
}
function oubliMdpHide()
{
	document.getElementById('oubli').style.display = 'none';
}

