var tabCache=new Array()
tabCache[0]=new Array('ssmenu1','128','0','158','73','389','0')
tabCache[1]=new Array('ssmenu2','320','0','343','73','580','0')
tabCache[2]=new Array('ssmenu3','702','0','640','73','963','0')

function getElement(nom) {
	if (document.getElementById) {return document.getElementById(nom);}
	if (document.layers) {return document.layers[nom];}
	if (document.all) {return document.all[nom];}
}
function popupWindow(sUrl,sName,iWidth,iHeight) 
{
	var top=(screen.height-iHeight)/2;
	var left=(screen.width-iWidth)/2;
	var winhdl=window.open(	"",sName,"top=" + top + ","+"left="+left+","+"scrollbars=yes,"+"toolbar=no,"+"location=no,"+"directories=no,"+"status=no,"+"menubar=no,"+"resizable=yes,"+"width="+iWidth+","+"height="+iHeight);
	winhdl.document.location.href=sUrl;
	winhdl.focus();
}
function taille() {
	alert ('Largeur='+document.body.clientWidth);
	alert ('Hauteur='+document.body.clientHeight);
}
function erreur() {
	alert ("Fonction non implémentée.");
}
function setCombo(idCombo,valeur) {
	for(var i=0;i<idCombo.options.length;i++) {
		if(idCombo.options[i].value==valeur) idCombo.selectedIndex=i;
	}
}
function hideAll() {
	//alert("hide");
    for(i=1;i<=3;i++) {
    	if(document.getElementById("ssmenu"+i)) {
	  		with(document.getElementById("ssmenu"+i).style) {
        		visibility = "hidden";
      		}
	  	}
    }
	for(i=1;i<=5;i++) {
    	if(getElement("menu"+i)) {
	  		getElement("menu"+i).className="menu";
	  	}
    }
	document.getElementById("cache1").style.visibility="hidden";
	document.getElementById("cache2").style.visibility="hidden";
	document.getElementById("cache3").style.visibility="hidden";
}
function mover(nom) {
	hideAll();
	if (getElement(nom)) {
		getElement(nom).className = "sousmenu";
	}
}
function moverMenu(nom,menu) {
	hideAll();
	if (getElement(nom)) {
		getElement(nom).className = "sousmenu";
	}
	if (getElement(menu)) {
		getElement(menu).style.visibility = "visible";
	}
	
	// On positionne les 3 caches suivant le menu affiche
	for(i=0;i<tabCache.length;i++) {
		if(tabCache[i][0]==menu) {
			getElement("cache1").style.left = tabCache[i][1] + 'px';
			getElement("cache1").style.top = tabCache[i][2] + 'px';
			getElement("cache1").style.visibility="visible";
			getElement("cache2").style.left = tabCache[i][3] + 'px';
			getElement("cache2").style.top = tabCache[i][4] + 'px';
			getElement("cache2").style.visibility="visible";
			getElement("cache3").style.left = tabCache[i][5] + 'px';
			getElement("cache3").style.top = tabCache[i][6] + 'px';
			getElement("cache3").style.visibility="visible";
		}			
	}
}
function mout(nom) {
	if (getElement(nom)) {
		getElement(nom).className = "menu";
	}
}
function go(page,num) {
	document.formMenu.paramValue.value = num;
	document.formMenu.action = page;
	document.formMenu.submit();
}
var montharray=new Array("Janv","Fev","Mar","Avr","Mai","Juin","Juil","Aout","Sept","Oct","Nov","Dec")
function countdown(yr,m,d){
	theyear=yr;themonth=m;theday=d
	var today=new Date()
	var todayy=today.getYear()
	if (todayy < 1000)
	todayy+=1900
	var todaym=today.getMonth()
	var todayd=today.getDate()
	var todayh=today.getHours()
	var todaymin=today.getMinutes()
	var todaysec=today.getSeconds()
	var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
	futurestring=montharray[m-1]+" "+d+", "+yr
	dd=Date.parse(futurestring)-Date.parse(todaystring)
	dday=Math.floor(dd/(60*60*1000*24)*1)
	dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
	dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
	dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
	if(dday==0&&dhour==0&&dmin==0&&dsec==1){
	document.forms.count.count2.value=current
	return
	}
	else
	document.forms.count.count2.value="Only "+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds left until "+before
	setTimeout("countdown(theyear,themonth,theday)",1000)
}
function EstVide(nom) {
	if (getElement(nom)) {
		if (getElement(nom).value=="") {return true;}
		else {return false;}
	}
	else {
		alert(nom+" : objet inconnu!");
		return false;
	}
}
function estNumerique(nom) {
	if ( getElement(nom).value*0 !=0) {
		return false;
	}
	else return true;
}
	