function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}





function openPage(page,name,w,h){
	if(h==null || w==null){
		h=575;
		w=580;
	}
	props='scrollbars=1,toolbar=0,status=1,resizable=0,width='+ w +',height='+ h +', left =20, top =20'
	window.open(page,name,props)
}


function setHeight(){
	window.defaultStatus='Pixel Overdrive srl';
	var myDetect=navigator.userAgent.indexOf("Firefox")
	var menuHeight=document.getElementById("column_a").offsetHeight;
	var txtHeight=document.getElementById("contentContainer").offsetHeight-35;
			if(myDetect==-1){		
			document.getElementById("contentContainer").style.height =menuHeight		
		}else{
			document.getElementById("contentContainer").style.height =menuHeight+"px";
		}
	/*if(menuHeight>txtHeight){
		if(myDetect==-1){		
			document.getElementById("contentContainer").style.height =menuHeight		
		}else{
			document.getElementById("contentContainer").style.height =menuHeight+"px";
		}
	}
	if(myDetect==-1){		
		document.getElementById("contentContainer").style.minHeight =menuHeight		
	}else{
		document.getElementById("contentContainer").style.minHeight =menuHeight+"px";
	}*/
	document.getElementById("footer").style.visibility="visible";		

}

function hideShowLayer(idList){
	var hideArray=idList.split(",");

	for(i=0;i< hideArray.length ;i++) {
		if(document.getElementById(hideArray[i]).className=="hidden"){
			document.getElementById(hideArray[i]).className="visible";
		}else{
			document.getElementById(hideArray[i]).className="hidden";
		}
	}
}

function hideShowCache(anchorTarget){
	if(anchorTarget!=null){
		if(document.getElementById("cache").className=="hidden"){
			document.getElementById("cache").className="visible";
		}
		window.location.href='#'+anchorTarget;
	}else{
		window.location.href='#top';
		document.getElementById("cache").className="hidden";
		
	}
}

function zoomMap(image) {
	props='scrollbars=no,toolbar=no, status=0,resizable=no,width=200, height=100, left =20, top =20'
	window.open("zoom.htm?image="+image,'zoom',props);
};


function showPlayer(status){
	if(status==true){
		hideShowLayer("player");
		hideShowLayer("header");
		var areaHeight=document.html.offsetHeight;
		//var fo = new FlashObject("playerImmagini.swf", "movie", "100%", areaHeight, "8", "#ffffff");
		var fo = new FlashObject("playerImmagini.swf", "movie", "100%", "100%", "8", "#ffffff");
		fo.addParam("wmode", "transparent");
		fo.addParam("quality", "high");
		fo.write("player");
		
	}else{
		hideShowLayer("player");
		hideShowLayer("header");
	}

}

function showPlayerFull(id) {

	var fileName="imageBrowser.php"

	if(id!=null){
		fileName+="?id="+id;
	}
	
	
	var wName="3dportfolio";
	var browserName=navigator.appName;
	var operatingSystem=navigator.platform;
	var version = parseFloat(navigator.appVersion);

	// Netscape check version 4.0+ on Win
	if (browserName.indexOf("Netscape")!=-1 && version>=4.0 && operatingSystem.indexOf("Mac")!=-1)
	 {
	 window.open(fileName,wName,'titlebar=no,top=0,left=0,width=' + window.screen.availWidth+',height='+window.screen.availWidth+',screenX=0,screenY=0,top=0,left=0')
	 }

	// MSIE Mac check
	else if (browserName.indexOf("Microsoft Internet Explorer")!=-1 && operatingSystem.indexOf("Mac")!=-1)
	 {
	 window.open(fileName,wName,'titlebar=no,top=0,left=0,width=' + window.screen.availWidth+',height='+window.screen.availWidth+',screenX=0,screenY=0,top=0,left=0')
	 }

	// Netscape Mac check
	else if (browserName.indexOf("Netscape")!=-1 && operatingSystem.indexOf("Mac")!=-1)
	 {
	 window.open(fileName,wName,'width='+screen.width+',height='+screen.height+',top=0,left=0');
	 }

	// MSIE Windows
	else if (browserName.indexOf("Microsoft Internet Explorer")!=-1 && operatingSystem.indexOf("Win")!=-1)
	 {
	 //window.open(fileName,wName,'fullscreen=yes')
	var win = window.open(fileName,wName,'titlebar=no,toolbar=no,location=no,directories=no,statusbar=no,menubar=no,scrollbars=no,resizable=yes,top=0,left=0,width=' + window.screen.availWidth+',height='+window.screen.availHeight+',screenX=0,screenY=0,top=0,left=0')
		win.resizeTo(screen.width, screen.height);
	 }

	// Netscape Windows
	else if (browserName.indexOf("Netscape")!=-1 && operatingSystem.indexOf("Win")!=-1)
	 {
	 window.open(fileName,wName,'width='+screen.width+',height='+screen.height+',top=0,left=0');
	 }

	else
	 {
	 window.open(fileName,wName);
	 }

}



