
/*
funzione apertura popup,
copyrights: Erik Henchoz - info@webnetstudio.it
vietato l'uso non autorizzato dello script
*/


function PrevFoto(img){
foto1= new Image();
foto1.src=(img);
Controllafoto(img);
}

function Controllafoto(img){
if((foto1.width!=0)&&(foto1.height!=0)){
vediFoto(img);
}
else{
funzione="Controllafoto('"+img+"')";
intervallo=setTimeout(funzione,20);
}
}

function vediFoto(img){
largh=foto1.width;
altez=foto1.height;
LeftPosition = (screen.width) ? (screen.width-largh)/2 : 0; 
TopPosition = (screen.height) ? (screen.height-altez)/2 : 0; 


	newWindow = window.open("","newWindow","width="+largh+",height="+altez+",left="+LeftPosition+",top="+TopPosition);
	newWindow.document.open();
	newWindow.document.write('<html><head><meta http-equiv="content-type" content="text/html;charset=iso-8859-1"><title>Guide della Valpelline</title>'); 
	
	newWindow.document.write('<style type="text/css" media="screen"><!--.opacity25{ filter:alpha(opacity=75); -moz-opacity:.75; opacity:.25;}}--></style></head>'); 
	newWindow.document.write('<style type="text/css" media="screen"><!--#livello { position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; visibility: visible; display: block }--></style></head>'); 
	newWindow.document.write('<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF" tracingopacity="47" tracingsrc="<http://www.guidevalpelline.com/js/wm.gif" tracingx="16" tracingy="8" onBlur="self.close()" onClick="self.close()">');  
	newWindow.document.write('<div id="livello"><table width='+largh+' border="0" cellspacing="0" cellpadding="0" align="center" height='+altez+' ><tr><td valign="bottom" background="'+img+'">');
	newWindow.document.write('<img class="opacity25" src="http://www.guidevalpelline.com/js/wm.gif" alt="" height="88" width="95" align="right alt=\"Clic per chiudere la finestra\" />'); 
	newWindow.document.write('</td></tr></table></div></body></html>');
	newWindow.document.close();
	newWindow.focus();




}

