
<!-- Begin
var finestra;

function CaricaFoto(img){
//img="imageskW9y1aWg/"+race+"/"+folder+"/"+img;
//if (race!='') race="/"+race;
//if (folder!='') folder="/"+folder;
  foto1= new Image();
  foto1.src=(img);
  Controlla(img);
}
function Controlla(img){
  if((foto1.width!=0)&&(foto1.height!=0)){
    viewFoto(img);
  }
  else{
    funzione="Controlla('"+img+"')";
    intervallo=setTimeout(funzione,20);
  }
}

function closePopup() {
if (finestra != null && !finestra.closed) finestra.close();
}
function viewFoto(img){
  largh=foto1.width;
  altez=foto1.height;
  if (largh>750) {
	largh=750;
  	if (altez>600) altez=600;
	bar="yes";
	resize="yes";
  }
  else if (altez>600) {
	altez=600;
	bar="yes";
	resize="yes";
  }
  else { 
	bar="no";
	resize="no";
  }
  stringa="width="+largh+",height="+altez+",resizable="+resize+",scrollbars="+bar+",top=0,left=0";
  closePopup();
  finestra=window.open("","",stringa);
  finestra.document.writeln('<title>View Images</title>');
  finestra.document.writeln('<head><SCRIPT LANGUAGE="Javascript">');
  finestra.document.writeln('var isNS = (navigator.appName == "Netscape") ? 1 : 0;');
  finestra.document.writeln('var EnableRightClick = 0;');
  finestra.document.writeln('if(isNS) ');
  finestra.document.writeln('document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP);');
  finestra.document.writeln('function mischandler(){');
  finestra.document.writeln('if(EnableRightClick==1){ return true; }');
  finestra.document.writeln('else {return false; }');
  finestra.document.writeln('}');
  finestra.document.writeln('function mousehandler(e){');
  finestra.document.writeln('if(EnableRightClick==1){ return true; }');
  finestra.document.writeln('var myevent = (isNS) ? e : event;');
  finestra.document.writeln('var eventbutton = (isNS) ? myevent.which : myevent.button;');
  finestra.document.writeln('if((eventbutton==2)||(eventbutton==3)) return false;');
  finestra.document.writeln('}	');
  finestra.document.writeln('function keyhandler(e) {');
  finestra.document.writeln('var myevent = (isNS) ? e : window.event;');
  finestra.document.writeln('if (myevent.keyCode==96)');
  finestra.document.writeln('EnableRightClick = 1;');
  finestra.document.writeln('return;');
  finestra.document.writeln('}');
  finestra.document.writeln('document.oncontextmenu = mischandler;');
  finestra.document.writeln('document.onkeypress = keyhandler;');
  finestra.document.writeln('document.onmousedown = mousehandler;');
  finestra.document.writeln('document.onmouseup = mousehandler;');
  finestra.document.writeln('</script></head>');
  finestra.document.writeln('<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0"><a href="JavaScript:window.close()"><img src="', img, '" alt="Click to close" border=0></a></body>');
  finestra.focus();
}
//  End -->


