var file=new Array('pi','prestation','techno','objets','panos','references','partenaires','contacts');
function Is()
{
			var agent = navigator.userAgent.toLowerCase();
			this.major = parseInt(navigator.appVersion);
			this.minor = parseFloat(navigator.appVersion);
			this.ns = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
			this.ns2 = (this.ns && (this.major == 3));
			this.ns3 = (this.ns && (this.major == 3));
			this.ns4b = (this.ns && (this.minor < 4.04));
			this.ns4 = (this.ns && (this.major >= 4));
			this.ie = (agent.indexOf("msie") != -1);
			this.ie3 = (this.ie && (this.major == 2));
			this.ie4 = (this.ie && (this.major >= 4));
			this.op3 = (agent.indexOf("opera") != -1);
			this.win = (agent.indexOf("win")!=-1);
			this.mac = (agent.indexOf("mac")!=-1);
			this.unix = (agent.indexOf("x11")!=-1);
}
var is = new Is();	
function rollOver(pos){
	if(pos!=position){
		if(is.ns)
			document.layers["MENU"].document.images[file[pos-1]].src='../images/'+file[pos-1]+'On.gif';
		else
			document.images[file[pos-1]].src='../images/'+file[pos-1]+'On.gif';
	}
}


function rollOut(pos){
	if (pos!=position){
		if(is.ns)
	 		document.layers["MENU"].document.images[file[pos-1]].src='../images/'+file[pos-1]+'Off.gif';
		else
			document.images[file[pos-1]].src='../images/'+file[pos-1]+'Off.gif';	 		
	}
}

var sRepeat=null
first=true

function doScroller(dir, contenant,src, amount) {
				if (first){
					adjusteEvent();
					first=false;
				}
				layerScrollable=window.document.layers[contenant].layers[src]
				layerScrollableParent=window.document.layers[contenant]
				haut=parseInt(layerScrollable.top)
				if (amount==null) amount=10
        if (dir=="down") {
                layerScrollable.top=parseInt(haut-amount)
                if (-parseInt(layerScrollable.top)>=layerScrollable.clip.height-layerScrollableParent.clip.height)
                        layerScrollable.top=-layerScrollable.clip.height+layerScrollableParent.clip.height  
        }
        else {
                layerScrollable.top=parseInt(haut+amount)
                if (parseInt(layerScrollable.top)>0)
                        layerScrollable.top = 0
        }
        if (sRepeat==null)
                sRepeat = setInterval("doScroller('" + dir + "','" + contenant+ "','" + src + "'," + amount + ")",100)
        return false
}

function adjusteEvent(){
	for(j=0;j<window.document.layers.length;j++){
		window.document.layers[j].document.onMouseUp = new Function("clearInterval(sRepeat);sRepeat=null")
		window.document.layers[j].document.ondragstart = new Function("return false")
		for (i=0;i<window.document.layers[j].document.layers.length;i++){
			window.document.layers[j].document.layers[i].onMouseUp = new Function("clearInterval(sRepeat);sRepeat=null")
			window.document.layers[j].document.layers[i].ondragstart = new Function("return false")
		}
	}
}
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 lienShowRoomPano(dest){
				 showroom=window.open("v5/exemples/panos/"+dest+"/html/index.html","showroom","directories=no,height=500,width=500,menubar=no,location=no,resizeable=no,scrollbars=no,satus=no,toolbar=no");
				 showroom.focus();
}
function lienShowRoomPanoHD(dest,width,height){
				 showroom=window.open("v5/exemples/panos/"+dest+"/html/index.html","showroom","directories=no,height="+height+",width="+width+",menubar=no,location=no,resizeable=no,scrollbars=no,satus=no,toolbar=no");
				 showroom.focus();
}
function lienShowRoomObjet(dest){
				 showroom=window.open("v5/exemples/objets/"+dest+"/html/index.html","showroom","directories=no,height=500,width=500,menubar=no,location=no,resizeable=no,scrollbars=no,satus=no,toolbar=no");
				 showroom.focus();
}
