var timer;

function AjoutFavoris(theURL, theTITLE) {
	if ( navigator.appName != 'Microsoft Internet Explorer' )
		{ window.sidebar.addPanel(theTITLE, theURL, ""); }
	else { window.external.AddFavorite(theURL, theTITLE); }
}

function cacher(id) {
	var elem = document.getElementById(id);
	elem.style.display = 'none';
}

function montrer(id) {
	var elem = document.getElementById(id);
	elem.style.display = 'block';
}

function timerCacher(id) {
	timer = setTimeout('cacher(\''+id+'\');',1000);	
}

function timerAnnuler() {
	clearTimeout(timer);	
}

function emploiDeploy(num) {
	var emploiElem = document.getElementById('emploiDetail' + num);
	if (emploiElem) {
		if (emploiElem.style.display == "none" || emploiElem.style.display == "") {
			cacher('emploiPlus' + num);
			montrer('emploiDetail' + num);
			montrer('emploiMoins' + num);
		} else {
			cacher('emploiDetail' + num);
			cacher('emploiMoins' + num);
			montrer('emploiPlus' + num);
		}
	}
}

function changeGalerie() {
	var galerieElem = document.getElementById('formEtablissementGalerie');
	galerieElem.submit();
}

function AfficheMenu(baseId, etatMenu) {
	if (document.getElementById && document.getElementById(baseId) != null) {
		if (etatMenu == 'over') {
			document.getElementById(baseId).className = 'HMniv1Elem ' + baseId + 'Hover';
			//document.getElementById(menuId).style.visibility='visible';
			document.getElementById(baseId + 'Sub').style.display='block';
		} else {
			//document.getElementById(menuId).style.visibility='hidden';
			document.getElementById(baseId + 'Sub').style.display='none';
			document.getElementById(baseId).className = 'HMniv1Elem';
		}
	}
}

function ouvrirPopup(page,nom,option) {
  window.open(page,nom,option);
}