var isNS = false;
var isIE = false;
var isW3C = false;
if (navigator.appName.indexOf('Netscape')>-1) {isNS=true; isIE=false; isW3C=false;}
if (document.getElementById) {isNS=false; isIE=false; isW3C=true;}
if (document.all) {isNS=false; isIE=true; isW3C=false;}


function popUp(src,name,x,y,w,h)
	{
	window.open(src,name,"left="+x+",top="+y+",height="+h+",width="+w+",scrollbars=0,status=0,location=0,menubar=0,resizable=0");
	}

function popUpSc(src,name,x,y,w,h)
	{
	window.open(src,name,"left="+x+",top="+y+",height="+h+",width="+w+",scrollbars=1,status=0,location=0,menubar=0,resizable=0");
	}

function displayLayer(l) { zl_hd(l,(isNS)?'show':'visible'); }

function hideLayer(l) { zl_hd(l,(isNS)?'hide':'hidden'); }

function zl_hd(l,s) {
if (isNS) zl_lref(l).visibility = s;
else zl_lref(l).style.visibility=s;
}

function zl_lref(l) {
if (isNS) return document.layers[l];
if (isIE) return document.all[l];
if (isW3C) return document.getElementById(l);
}

function moveLayer(l,x,y) {
if (isNS) {
zl_lref(l).x = x;
zl_lref(l).y = y;
} else {
zl_lref(l).style.left = x;
zl_lref(l).style.top = y;
}
}

function scrollY() {
	if (isNS) return window.pageYOffset;
	else return document.body.scrollTop;
}

function followScrollY(l) {
	y=calcPos(zl_lref(l));
	newPos=scrollY()-Math.floor((scrollY()-y)/2);
	moveLayer(l,0,newPos);
	window.timeOut=setTimeout("followScrollY('"+l+"')",10);
}

function calcPos(obj){
	y=obj.offsetTop;
	while(obj.offsetParent!=null) {
		obj=obj.offsetParent;
		y+=obj.offsetTop;
	}
	return y;
}

function showImage(image,legend) {
	zl_lref("imageZoom").innerHTML="<img src=\"../dyn/etapes/photos/photo_zoom_"+image+".jpg\" border=\"1\" onClick=\"hideLayer('imagesG');\">";
	zl_lref("imageLegende").innerHTML="<span class=\"texte\">"+legend+"</span><br><br>";
	moveLayer("imagesG",0,scrollY());
	displayLayer("imagesG");
	followScrollY("imagesG");
}

function showImgMatos(image,posY) {
	zl_lref("imageZoom").innerHTML="<img src=\""+image+"\" border=\"0\">";
	moveLayer("imagesG",180,posY);
	displayLayer("imagesG");
}
