var photo=new Image();
var openPic=false;
var timer="";

function stop()
{

if (F2.document.images[0].complete == false){
       timer=setTimeout("stop()",10);
	   }
   else{
       clearTimeout(timer);
	   }
F2.resizeTo((photo.width+10),(photo.height+30));
}

function big(URL)
{
photo.src=URL;
if (openPic==false){
   F2=open ("foto.htm","Foto","width=100, height=100");
   txt="<head><title>Foto</title></head><body bgcolor= #d3d3d3 leftmargin=0 topmargin=0 marginheight=0 marginwidth=0 onLoad=setTimeout(stop(),100)><img src="+URL+"></body></html>";
   F2.document.write(txt);
   stop();
   openPic=true;
   }
else
{
	F2.close();
	openPic=false;
	big (URL);
}
}