// Funzioni Javascript
//<!--

//Check navigator type
var IE = false;
var NS = false;
var NS6 = false;

if(navigator.userAgent.indexOf("MSIE") != -1) {
	IE = true;
} else if(navigator.userAgent.indexOf("Netscape6") != -1) {
	NS6 = true;
} else {
	NS = true;
}
//End Check navigator type


//Open new window
function apriFinestra(url,w,h) 
{ 
t = (screen.height-h)/2 
l = (screen.width-w)/2 
win = window. open(url,'','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,top=10,left=10,width='+w+',height='+h+', left='+l+', top='+t); 
win.document.title = url.substring(url.lastIndexOf("/")+1,url.lastIndexOf("."))
}


function Show_foto(newpic) {
  if(isDOM)document.getElementById("_foto").src = PicVal[newpic];
  else if(isIE) document._foto.src = PicVal[newpic];
  current = newpic;
}
function Previous_foto() {
  current--;
  if(current<0) current = TotalImages - 1;
  Show_foto(current);
}
function Next_foto() {
  current++;
  if (current>=TotalImages) current = 0;
  Show_foto(current);
}
//End Open SlideShow Images  

//Netscape ver < 6 resize fix
function NGN_netscapeCssFix() {
	if (document.win.win_netscapeCssFix.initWindowWidth != window.innerWidth || document.win.win_netscapeCssFix.initWindowHeight != window.innerHeight) {
		document.location = document.location;
	}
}
function NGN_netscapeCssFixCheckIn() {
	if((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4) && (navigator.appName.indexOf("Netscape6") == -1)) {
		if(typeof document.win == "undefined") {
			document.win = new Object;
		}
		if(typeof document.win.win_scaleFont == "undefined") {
			document.win.win_netscapeCssFix = new Object;
			document.win.win_netscapeCssFix.initWindowWidth = window.innerWidth;
			document.win.win_netscapeCssFix.initWindowHeight = window.innerHeight;
		}
		window.onresize = NGN_netscapeCssFix;
	}
}
NGN_netscapeCssFixCheckIn()
//End Netscape ver < 6 resize fix

//-->
