function PopupCentrer(page,largeur,hauteur,options) {
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  var PopupCentrer=window.open(page,"PopupCentrer","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);PopupCentrer.focus();
}
ready=false;
function start()
{
	Tdiv = new Array;
	for(i=1; i<9; i++){
		eval ("Tdiv["+i+"]=(document.all)?document.all.subNavbar"+i+".style:(document.layers)?document.subNavbar"+i+":document.getElementById(\"subNavbar"+i+"\").style;");
	}
	Tobjima = new Array("",(document.layers)?document.subNavbar1.document:document,(document.layers)?document.subNavbar2.document:document,(document.layers)?document.subNavbar3.document:document,(document.layers)?document.subNavbar4.document:document,(document.layers)?document.subNavbar5.document:document,(document.layers)?document.subNavbar6.document:document,(document.layers)?document.subNavbar7.document:document,(document.layers)?document.subNavbar8.document:document);
	cpt=8;
	xor=false;
	encour=false;
	etat=false;
	posdiv();
	ready=true;
}
function posdiv(){
	maxX  = (document.all)?window.document.body.clientWidth:window.innerWidth;
   maxH  = (document.all)?window.document.body.clientHeight:window.innerHeight;
	if (document.layers)   maxX-=18;
   Left=(maxX-980)/2;
   Left=(Left<=1)?1:Left;
	Tdiv[1].left=(Left)+10;
	Tdiv[2].left=(Left)+90;
	Tdiv[3].left=(Left)+10;
	Tdiv[4].left=(Left)+120;
	Tdiv[5].left=(Left)+240;
	Tdiv[6].left=(Left)+345;
	Tdiv[7].left=(Left)+90;
	Tdiv[8].left=(Left)+162;
   Top=maxH/2-380;
   Top=(Top<=215)?135:Top;
 	Tdiv[1].top=(Top);
 	Tdiv[2].top=(Top);
 	Tdiv[3].top=(Top);
 	Tdiv[4].top=(Top);
 	Tdiv[5].top=(Top);
 	Tdiv[6].top=(Top);
 	Tdiv[7].top=(Top);
 	Tdiv[8].top=(Top);
}

function IS(m,n,o) {
	if (o=='on') etat=true;
	else etat=false;
	fix();
	eval("Tobjima["+m+"].tt"+m+n+".src = titre"+m+o+n+".src");
}
function show(n,o){
	if (ready){
		fix();
		for(i=1; i<9; i++){
			Tdiv[i].visibility='hidden';
		}
		if (n){
			etat=true;
			Tdiv[n].visibility='visible';
			decpt();
		}
	}
}
function funcoff(){
etat=false
}
function fix(){
	cpt=9;
}
function decpt(xor){
	if (!encour || xor){
		encour=true;
		cpt--;
		if (cpt<=0 && !etat){
			show();
			encour=false;
		}
		else if (etat) {
			fix();
			setTimeout('decpt(1)',100);
		}
		else setTimeout('decpt(1)',100);
	}
}

//window.onresize = function (e) {history.go(0);};
onresize=posdiv
function hope(){
	chemform =document.frmsites.sites[document.frmsites.sites.selectedIndex];
	aff=chemform.value;
	if (aff){
	//alert (aff);
	window.open(aff);
	}
}
function isEmail(elm) {
        if (elm.value.indexOf(" ") + "" == "-1"
         && elm.value.indexOf("@") + "" != "-1"
         && (elm.value.lastIndexOf(".") > elm.value.indexOf("@"))
         && elm.value != "")
            return true;
        else
            return false;
}

function isEmpty(elm) {
           var elmstr = elm.value + "";
           if (elmstr.length == 0) return true;
           return false;
}

function popnav(x,y,z,a,b){ 
	eval("document."+b+"=window.open('"+x+"','"+b+"','width="+y+",height="+z+",top=10,left=10,resizable=0,toolbar=0,scrollbars="+a+",status=0,menubar=0')");
	//this.blur();
	eval("document."+b+".focus()");
}
