var bName = navigator.appName;
var bVer = parseInt(navigator.appVersion);

var NS6 = (bName == "Netscape" && bVer >=5 && bVer < 7); //alternativa check su getElementById
var NS4= document.layers;
var IE4=  document.all;

//LAYER SWITCHING CODE

     if (NS4) {
       layerStyleRef="layer.";
       layerRef="document.layers[";
       styleSwitch="]"; layerDoc=".document."
     }
	 else if (IE4) {
        layerStyleRef="layer.style.";
        layerRef="document.all[";
        styleSwitch="].style"; layerDoc=".";
     }
	 else if (NS6) { 
       layerStyleRef="style.";
       layerRef="document.getElementById(";
       styleSwitch=").style"; layerDoc=".";
     }	
     else {
		//
     }




function setVariables(){
if (navigator.appName == "Netscape") {
if (parseInt(navigator.appVersion) >= 5){v=".top=";h=".left=";dS="document.getElementById(\"";sD="\").style";
y="window.pageYOffset";x="window.pageXOffset";}
else {v=".top=";h=".left=";dS="document.";sD="";
y="window.pageYOffset";x="window.pageXOffset";}
}
else {h=".pixelLeft=";v=".pixelTop=";dS="";sD=".style";
y="document.body.scrollTop";x="document.body.scrollLeft";}checkLocationA()}



function checkLocation(){
object="menulat";yy=eval(y);xx=eval(x);ydiff=ystart-yy;xdiff=xstart-xx;
if ((ydiff<(-1))||(ydiff>(1))) movey=Math.round(ydiff/10),ystart-=movey
if ((ystart>=172)&&(ystart<10000)){eval(dS+object+sD+v+(ystart+0));
} else if (ystart<10000){eval(dS+object+sD+v+172);}
setTimeout("checkLocation()",10);
}



function checkLocationA(){ystart=eval(y);xstart=eval(x);}

function checkBrowser(){
        this.ver=navigator.appVersion
        this.dom=document.getElementById?1:0
        this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
        this.ie4=(document.all && !this.dom)?1:0;
        this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
        this.ns4=(document.layers && !this.dom)?1:0;
        this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
        return this
}

bw=new checkBrowser()

function checklocation(){
        indirizzo=document.location.href;
		alert (indirizzo);
		
		ultimo=indirizzo.lastIndexOf(".htm");
		alert(ultimo);
		indirizzo=indirizzo.substring(0,ultimo);
		alert (indirizzo);
		indirizzo=indirizzo+"-eng.htm"
		self.location=indirizzo;
}

function vaiinglese(){
        indirizzo=document.location.href;
		ultimo=indirizzo.lastIndexOf(".htm");
		indirizzo=indirizzo.substring(0,ultimo)+"-eng.htm";
		self.location=indirizzo;
}

function vaiitaliano(){
        indirizzo=document.location.href;
		ultimo=indirizzo.lastIndexOf("-eng.htm");
		indirizzo=indirizzo.substring(0,ultimo)+".htm";
		self.location=indirizzo;
}




