var newWindow
function makeNewWindow(content,img,name) {    
	foto1=new Image();    
	foto1.src=(img);    
	if((foto1.width!=0)&&(foto1.height!=0)){    
	CreateWindow(content,img,name);}    
	else {    
	funzione="makeNewWindow('"+content+"','"+img+"','"+name+"')";    
	intervallo=setTimeout(funzione,20);}
}
function CreateWindow(content,img,name){    
	largeh=foto1.width+30;    
	altez=foto1.height+70;    
	newWindow = window.open("","sub","status=no,screenx=5,screeny=5,resizable=yes,titlebar=no,alwaysraised=yes,height=" + altez + ",width=" + largeh + ",scrollbars=no")    
	if(!newWindow.opener) {        
		newWindow.opener = window    
	}    
//    		setTimeout("writeToWindow()", 200)    
	writeToWindow(content,name)        

	newWindow.focus()
}
function writeToWindow(wincontent,name) {    
	content = "<html><body onblur='window.close();' bgcolor=#ffffff leftmargin=0 topmargin=10 offset=0 marginheight=0 marginwidth=0><div align=center>"    
	content = content + wincontent    
	content = content + "<BR><BR><font face=arial size=2><a href=javascript:close() style=color:white;>Close Window</a></font></div><br></body></html>"    
	newWindow.document.write(content)    
	newWindow.document.close()
}    

