var ns4=document.layers
var ie4=document.all
var ns6=document.getElementById&&!document.all

// Longueur du tableau général
var WidthTable = 762;
// Déclaration des calques et de leurs positions par rapport au bord gauche du tableau général

var TabLayers = new Array();
TabLayers[0] = new Array("VID1",0);
TabLayers[1] = new Array("VID2",0);
TabLayers[2] = new Array("ORD",162);
TabLayers[3] = new Array("ACT",219);
TabLayers[4] = new Array("PUB",287);
TabLayers[5] = new Array("MED",365);
TabLayers[6] = new Array("DEO",516);


function Deplace() {
	ie4 ? X = document.body.scrollWidth : ns4 ? X = window.innerWidth : X = document.width;

	for(i=0; i<TabLayers.length; i++) {
		PosCalqueX = ((X-WidthTable)/2+TabLayers[i][1]);

		if(PosCalqueX < TabLayers[i][1]) {
			if(ie4 && navigator.appVersion.indexOf("Mac")!=-1)
				PosCalqueX = TabLayers[i][1]-2;
			else
				ns4 ? PosCalqueX = TabLayers[i][1]+9 : ie4 ? PosCalqueX = TabLayers[i][1]+8 : PosCalqueX = TabLayers[i][1];
		}

		if(ns4) {
			layer = TabLayers[i][0];
			document.layers[layer].left = (PosCalqueX-8);
		} else if(ns6) {
			document.getElementById(TabLayers[i][0]).style.left = (PosCalqueX-1);
		} else {
			document.getElementById(TabLayers[i][0]).style.left = (PosCalqueX);
			//window.alert('id:'+TabLayers[i][0]+', x:'+document.getElementById(TabLayers[i][0]).style.left+', y:'+document.getElementById(TabLayers[i][0]).style.top);
		}
	}

}

function Deplace2() {
	if(ie4 && navigator.appVersion.indexOf("Mac")!=-1)
		document.location.reload();
}

function EffaceToutSauf(layers) {
	Layer = layers.split(',');
	EffaceTout();
	for(i=0; i<Layer.length; i++) {
		Affiche(Layer[i]);
	}
}

function EffaceTout() {
	for(i=0; i<TabLayers.length; i++) {
		Cache(TabLayers[i][0]);
	}
}

function Affiche(nom) {
	if(ie4) {
		var divie4 = document.getElementsByTagName("div")
		divie4[nom].style.visibility = 'visible';
	} else if(ns4) {
		document.eval(nom).visibility = 'show';
	} else if(ns6) {
		var divns6 = document.getElementsByTagName("div")
		document.getElementsByTagName("div")[nom].style.visibility = 'visible';
	}
}

function Cache(nom) {
	if(ie4) {
		var divie4 = document.getElementsByTagName("div")
		divie4[nom].style.visibility = 'hidden';
	} else if(ns4) {
		document.eval(nom).visibility = 'hidden';
	} else if(ns6) {
		var divns6 = document.getElementsByTagName("div")
		document.getElementsByTagName("div")[nom].style.visibility = 'hidden';
	}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function RollOver(img,lien) {
	document.images[img].src=lien;
}

function champ_onfocus(nomchamp,valeur) {
    if(nomchamp.value==valeur)
		nomchamp.value="";
	return true;
}

function champ_onblur(nomchamp,valeur) {
	if(nomchamp.value=="")
		nomchamp.value=valeur;
	return true;
}
function rollover_cell_on(cellule){
document.getElementById(cellule).bgColor = '#074B5F';
}
function rollover_cell_off(cellule){
document.getElementById(cellule).bgColor = '#206E85';
}
