isIE=document.all;
isNN=!document.all&&document.getElementById;
isN4=document.layers;
isHot=false;
var step=30
imgstr="<p align='center'><img id='Zswf'><br>"
fl="<p align='center'><object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='50' height='50' id='load' align='middle' style='z-index:2'>"
fl+="<param name='allowScriptAccess' value='sameDomain' />"
fl+="<param name='movie' value='swf/load.swf' /><param name='quality' value='high' /><param name='wmode' value='transparent' /><param name='bgcolor' value='#000000' />"
fl+="<embed src='swf/load.swf' quality='high' wmode='transparent' bgcolor='#000000' width='50' height='50' name='load' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"
fl+="</object>"

dx1=100
dy1=100

var carica

function centra(dx,dy){
centroX=Math.ceil(screen.width/2);
centroY=Math.ceil(screen.height/2);

cx=centroX-Math.ceil(dx/2)
cy=centroY-Math.ceil(dy/2)-100
	
 if (isIE||isNN) {
	 document.getElementById("LayerZoom").style.left=cx
	 document.getElementById("LayerZoom").style.top=cy
  
	 }else if (isN4){ 
	 document.layers["LayerZoom"].style.left=cx
	 document.layers["LayerZoom"].style.top=cy
	 }	

}

function trace(str){
	
if (isIE){
document.getElementById("trace").innerText+=unescape("\r")+str
}else if(isNN){
document.getElementById("trace").textContent+=unescape("\r")+str
}  
document.getElementById("trace").scrollTop=document.getElementById("trace").scrollHeight	
}	

function loadSWF(swfFILE,_w,_h){
fl1="<p align='center'><object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='"+_w+"' height='"+_h+"' id='Zswf' align='middle'>"
fl1+="<param name='allowScriptAccess' value='sameDomain' />"
fl1+="<param name='movie' value='"+swfFILE+"' /><param name='quality' value='high' /><param name='wmode' value='transparent' /><param name='bgcolor' value='#000000' />"
fl1+="<embed src='"+swfFILE+"' quality='high' wmode='transparent' bgcolor='#000000' width='"+_w+"' height='"+_h+"' name='Zswf' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"
fl1+="</object>"
	
if (isIE||isNN){ 
     document.getElementById("contenuto").innerHTML=fl1
	 document.getElementById("x").style.visibility="visible";
	 document.getElementById("Zswf").style.visibility="visible";
	} else if (isN4){
	 
	 document.layers["contenuto"].innerHTML=fl1
	 document.layers["x"].visibility="show";
	 document.layers["Zswf"].visibility="show";
	
	 	 }		
}

function load() {
 
 	
if(pic.complete!=false){
	if (isIE||isNN){ 
 	 document.getElementById("contenuto").innerHTML =imgstr 
	 document.getElementById("Zswf").src =pic.src
	 document.getElementById("x").style.visibility="visible";
	 document.getElementById("Zswf").style.visibility="visible";
	 if (isIE){ 
     document.getElementById("Zswf").style.filter="alpha(opacity=1)"
    }else if(isNN){
	 document.getElementById("Zswf").style.MozOpacity=0.1
	}
	} else if (isN4){
	 document.layers["x"].visibility="show";	
	 document.layers["contenuto"].innerHTML=imgstr
	 document.layers["Zswf"].src =pic.src
	 document.layers["Zswf"].visibility="show";
		 }
  f_IMG=setInterval("fadeJPG()",50)
  clearInterval(LoadIMG)  
  }
}
function fadeJPG(){

if(opac3 <100){

 opac3+=20
 v=opac3/100
   if (isIE) 
    document.getElementById("Zswf").style.filter="alpha(opacity="+opac3+")"
   else if(isNN){
	 document.getElementById("Zswf").style.MozOpacity=v
 	
   }else if(isN4){}
 
  }else{
     
	clearInterval(f_IMG)	
 }
		
}


function loadPIC(){
if(carica!=undefined)
clearInterval(carica)	

if(String(pic.complete)=="false"){
  carica=setInterval("loadPIC()",50)
}else{
  dx=pic.width
  dy=pic.height 
 
  centra(dx,dy)	
  if(dx<dx1){
	 ldx=setInterval("dimxMeno('"+dx+"')", 50);
	}else{
     ldx=setInterval("dimxPiu('"+dx+"')", 50);
		}	
	
	
	}

}
function EvidenziaSWF(){
opac2=60
v2=opac2/100	
if (isIE) {
	 document.getElementById("l").style.filter="alpha(opacity="+opac2+")";
 } else if(isNN){
	
	 document.getElementById("l").style.MozOpacity=v2	 
 }

clearInterval(a)	
	

}
function fadeOut(img) {
opac2=80
v2=opac2/100
 if (isIE) {
	 document.getElementById("l").style.filter="alpha(opacity="+opac2+")";
 } else if(isNN){
	
	 document.getElementById("l").style.MozOpacity=v2	 
 }	

clearInterval(a)
 
pic=new Image()
pic.src =img 
loadPIC()
    	

	
}	
var ldy=0
var ldx=0
function dimyMeno(y){
	
 if (isIE||isNN){
	 var var_uno=document.getElementById("LayerZoom").style.height
	 var var_due=var_uno.split("px")
	 var _height=parseInt(var_due[0])
	  
	 if(_height>y){
	   CostrY=_height-step
		    document.getElementById("LayerZoom").style.height=CostrY       
	   }else{
	      dy1=y
	      diff=CostrY-y 
	      document.getElementById("LayerZoom").style.height=CostrY-diff 
	       
	     clearInterval(ldy)
	      document.getElementById("load").style.visibility="visible";
            
	     LoadIMG=setInterval("load()", 50);
	     }
	 }else if (isN4){
    var var_uno=document.layers["LayerZoom"].height
	var var_due=var_uno.split("px")
	var _height=parseInt(var_due[0])
	  if(_height>y){
		  document.layers["LayerZoom"].height=_height-step
       }else{
	      
	       dy1=y
	      document.layers["load"].visibility="show";
	
	      clearInterval(ldy)
	      LoadIMG=setInterval("load()", 50);
	     
	      }
		}		
}	
function dimyPiu(y){
 if (isIE||isNN ){
	 
	var var_uno=document.getElementById("LayerZoom").style.height
	var var_due=var_uno.split("px")
	var _height=parseInt(var_due[0])
	
	  CostrY=_height+step
	if(_height<y){
		
	       document.getElementById("LayerZoom").style.height=CostrY   
	       
       }else{
	        diff=CostrY-y 
		    document.getElementById("LayerZoom").style.height=CostrY-diff    
		    
	      dy1=y
	      document.getElementById("load").style.visibility="visible";
            
	      clearInterval(ldy)
	      LoadIMG=setInterval("load()", 50);
	     
	      }
	 }else if (isN4){
    var var_uno=document.layers["LayerZoom"].height
	var var_due=var_uno.split("px")
	var _height=parseInt(var_due[0])
	  if(_height<y){
		  document.layers["LayerZoom"].height=_height+step
       }else{
	      
	       dy1=y
	      document.layers["load"].visibility="show";
	
	      clearInterval(ldy)
	      LoadIMG=setInterval("load()", 50);
	     
	      }
		 
		 
		 }	
}
function dimxMeno(x){
	
 if (isIE||isNN){
	var var_uno=document.getElementById("LayerZoom").style.width
	var var_due=var_uno.split("px")
	 var _width=parseInt(var_due[0])
	  if(_width>x){
		 CostrX=_width-step
        document.getElementById("LayerZoom").style.width=CostrX   
	       
       }else{
	     dx1=x
	     diff=CostrX-x  
		 document.getElementById("LayerZoom").style.width=CostrX-diff
	     clearInterval(ldx)
	     
	      if(dy<dy1){
	         ldy=setInterval("dimyMeno('"+dy+"')", 50);
	       }else{
	         ldy=setInterval("dimyPiu('"+dy+"')", 50);
		   }
	    }
	 }else if (isN4){
    var var_uno=document.layers["LayerZoom"].width
	var var_due=var_uno.split("px")
	var _width=parseInt(var_due[0])
	  if(_width<x){
		  document.layers["LayerZoom"].width=_width-step
       }else{
	      
	       dx1=x
	      document.layers["load"].visibility="show";
	
	      clearInterval(ldy)
	      LoadIMG=setInterval("load()", 50);
	     
	      }
		 
		 
		 }	
}
function dimxPiu(x){
 if (isIE||isNN){
	 
	  var var_uno=document.getElementById("LayerZoom").style.width
      var var_due=var_uno.split("px")
	  var _width=parseInt(var_due[0])
	  CostrX=_width+step
	  if(CostrX<x){
		
        document.getElementById("LayerZoom").style.width=CostrX   
	    
      }else{
	        diff=CostrX-x 
	       	        	   	 
		    document.getElementById("LayerZoom").style.width=CostrX-diff    
		    
		    dx1=x
	     clearInterval(ldx)
	     if(dy<dy1){
	       ldy=setInterval("dimyMeno('"+dy+"')", 50);
	     }else{
		  ldy=setInterval("dimyPiu('"+dy+"')", 50);
		 }
	   }
	 }else if (isN4 ){
		 
    var var_uno=document.layers["LayerZoom"].width
	var var_due=var_uno.split("px")
	var _width=parseInt(var_due[0])
	  if(_width<x){
		  document.layers["LayerZoom"].width=_width+step
		         }else{
	      
	       dx1=x
	      document.layers["load"].visibility="show";
	
	      clearInterval(ldy)
	      LoadIMG=setInterval("load()", 50);
	     
	      }
		 
		 
		 }	
}
	
function usato(){
//	opac2=0;
//opac3=0
//if (isIE||isNN){
	//document.getElementById("Programma").innerHTML=pr;
//	if(document.getElementById("usato").style.display=="none")
//     document.getElementById("usato").style.display = "block";
//	document.getElementById("usato").style.visibility="visible";
	
//}else if (isN4){
		
		
		
		
//		}
//if (isIE||isNN){
	
//   document.getElementById("l").style.visibility="visible"
//   document.getElementById("l").style.width=screen.width
//   document.getElementById("l").style.height=screen.height
  
//   if(isIE){
//	   document.getElementById("l").style.filter="alpha(opacity=0)"
//	   }else if(isNN){
//	   document.getElementById("l").style.MozOpacity=0
//	   }
// } else if(isN4){
   
//   document.layers["l"].visibility="show"; 
// }		

window.open("Usato.php",'usato','screeny=0,screenx=150,scrollbars=yes,scroll=yes,resizable=no,width=780,height=400,status=no,location=no,toolbar=no');

}
function Zjpg(file,scelta,sez,w_,h_){
opac2=0;
opac3=0
if(scelta=="jpg"){
pic = new Image();
		
}else{
loadSWF(file,w_,h_)	
	
	}

	
if (isIE||isNN){
	
	if(document.getElementById("LayerZoom").style.display=="none")
     document.getElementById("LayerZoom").style.display = "block";
	document.getElementById("LayerZoom").style.visibility="visible";
	document.getElementById("Tit").style.color="#FFFFFF"
	document.getElementById("Tit").innerHTML =sez	
	if(scelta=="swf"){
		
	
	document.getElementById("LayerZoom").style.height=10
	document.getElementById("LayerZoom").style.width=10
	document.getElementById("Zswf").style.zIndex='11';
	
	dy=document.getElementById("Zswf").height
    dx=document.getElementById("Zswf").width 
    
    }else{
	document.getElementById("x").style.visibility="hidden";
	document.getElementById("x").style.zIndex='12'; 
	document.getElementById("contenuto").innerHTML =fl 
 
	    }
    } else if (isN4){
	if(document.layers["LayerZoom"].style.display=="none")
	document.layers["LayerZoom"].style.display = "block";	
	document.layers["Tit"].style.color="#FFFFFF"
	document.layers["Tit"].innerHTML =sez		
	document.layers["LayerZoom"].visibility="show";	
	document.layers["x"].visibility="hide";
	document.layers["x"].zIndex='12'
	if(scelta=="swf"){
	
	document.layers["LayerZoom"].height=10
	document.layers["LayerZoom"].width=10
	dy=document.layers["Zswf"].height
    dx=document.layers["Zswf"].width 
    }else{
	  document.layers["contenuto"].innerHTML=fl  
	    
	    }
}
if (isIE||isNN){
	if(scelta=="jpg") document.getElementById("load").style.visibility="hidden"
   document.getElementById("l").style.visibility="visible"
 
   if(isIE){
	   document.getElementById("l").style.filter="alpha(opacity=0)"
	   }else if(isNN){
	   document.getElementById("l").style.MozOpacity=0
	   }
 } else if(isN4){
   if(scelta=="jpg") document.layers["load"].visibility="hide";
   document.layers["l"].visibility="show"; 
 }
 sc=scelta
if(scelta=="swf"){ 
	
centra(dx,dy)
a=setInterval("EvidenziaSWF()",50);
}else{ 	
			 	
a=setInterval("fadeOut('"+file+"')",50); 	
}
document.onmousemove=PosXY
}

function Visibility(id){
		
if(isIE||isNN){
	   document.getElementById(id).style.visibility="hidden"
	   document.getElementById("LayerZoom").style.display = "none";
 }else if(isN4){
   document.layers[id].visibility="hide";
   document.layers["LayerZoom"].display = "none";
 }				
		
}
function Visibility2(id){
		
if(isIE||isNN){
	   document.getElementById(id).style.visibility="hidden"
	   document.getElementById(id).style.display = "none";
 }else if(isN4){
   document.layers[id].visibility="hide";
   document.layers[id].display = "none";
 }				
		
}



var str_2="";


function txt(t){
	
alert(t)	
	
	}
//--------------------------------------------------------------
function STOP(){
 var flashMovie=GetIDFlash("Zswf");
 flashMovie.SetVariable("_root.Command.Stop","");
}


 function GetIDFlash(ID)
{
  if (window.document[ID]){
    return window.document[ID];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1){
    if (document.embeds && document.embeds[ID])
      return document.embeds[ID]; 
  }
  else{
    return document.getElementById(ID);
  }
}


Object.prototype.getPosXY=function(element) { 
	if(element){
		this.x += element.offsetLeft; 
		this.y += element.offsetTop; 
		element= element.offsetParent; 
	    this.getPosXY(element)
		}
	return this; 
}



function PosXY(){
	
 var	Coords={x: 0, y: 0}
 var XY=Coords.getPosXY(document.getElementById("xy"))
 if(isIE||isNN){
 if(sc!="swf"){
	   var var_uno=document.getElementById("LayerZoom").style.width
   }else{ 
    var var_uno=document.getElementById("Zswf").width 	   
	   }
       var var_due=var_uno.split("px")
	   document.getElementById("LayerZoom").style.left=XY.x+435-parseInt(var_due[0])/2
	   
  if(sc!="swf"){
	   var var_uno=document.getElementById("LayerZoom").style.height
   }else{
        var var_uno=document.getElementById("Zswf").height
	   }
       var_due=var_uno.split("px")
	   document.getElementById("LayerZoom").style.top=XY.y-10
	    }


}
function chiudiJPG(){
	
if(isIE||isNN){
	if(document.getElementById("Zswf")!=undefined && String(document.getElementById("Zswf"))=="[object HTMLObjectElement]"){
		STOP()	
		}
	   
 }else if(isN4){
   if(document.layers["Zswf"]!=undefined && String(document.layers["Zswf"])=="[object HTMLObjectElement]"){
	   STOP()	
	   }
   
 }				
 clearInterval(ldy)
 clearInterval(ldx)
 Visibility("LayerZoom")
 Visibility("l")
 
}