var newwindow = '';

function popitup(url,url_name) {
	


	
if (newwindow.location && !newwindow.closed) {
	newwindow.close();
 	newwindow=window.open('','htmlname','width=1,height=1,resizable=0');
	newwindow.document.write ('<html><head><title>'+url_name+'</title><SCRIPT LANGUAGE="JavaScript">');
	newwindow.document.write ('function resizer() {');
	newwindow.document.write ('windowWidth=pix.width+10;');
	newwindow.document.write ('windowHeight=pix.height+30;');
	newwindow.document.write ('windowLeft = (screen.availWidth / 2) - (windowWidth / 2);');
	newwindow.document.write ('windowTop = (screen.availHeight / 2) - (windowHeight / 2);');
	newwindow.document.write ('window.resizeTo(windowWidth,windowHeight+30);');
	newwindow.document.write ('window.moveTo(windowLeft,windowTop);}');
	newwindow.document.write ('</SCRIPT>');
	newwindow.document.write ('<script type="text/javascript">');
	newwindow.document.write ('function onTop() {');
	newwindow.document.write ('self.focus();');
	newwindow.document.write ('window.setTimeout("onTop()",1000); }');
	newwindow.document.write ('</script></head>');
	newwindow.document.write ('<body topmargin="0" leftmargin="0" bgcolor="#000000" onload="onTop()">');
	newwindow.document.write ('<table border="0" width="100%" height="100%" cellspacing="0" cellpadding="0"><tr><td width="100%" valign="middle" align="center" height="100%"><a title="close" href="javascript:self.close();"><img id="pix" name="pix" border="0" src="'+url+'"  onLoad="setTimeout(\'resizer()\',500)"></td></tr><td align="right"><font color="#FFFFFF"></a></font></td>');
	newwindow.document.write ('</tr></table></body></html>');
	newwindow.focus();

} 

else { 
    newwindow=window.open('','htmlname','width=1,height=1,resizable=0');
	newwindow.document.write ('<html><head><title>'+url_name+'</title><SCRIPT LANGUAGE="JavaScript">');
	newwindow.document.write ('function resizer() {');
	newwindow.document.write ('windowWidth=pix.width+10;');
	newwindow.document.write ('windowHeight=pix.height+30;');
	newwindow.document.write ('windowLeft = (screen.availWidth / 2) - (windowWidth / 2);');
	newwindow.document.write ('windowTop = (screen.availHeight / 2) - (windowHeight / 2);');
	newwindow.document.write ('window.resizeTo(windowWidth,windowHeight+30);');
	newwindow.document.write ('window.moveTo(windowLeft,windowTop);}');
	newwindow.document.write ('</SCRIPT>');
	newwindow.document.write ('<script type="text/javascript">');
	newwindow.document.write ('function onTop() {');
	newwindow.document.write ('self.focus();');
	newwindow.document.write ('window.setTimeout("onTop()",1000); }');
	newwindow.document.write ('</script></head>');
	newwindow.document.write ('<body topmargin="0" leftmargin="0" bgcolor="#000000" onload="onTop()">');
	newwindow.document.write ('<table border="0" width="100%" height="100%" cellspacing="0" cellpadding="0"><tr><td width="100%" valign="middle" align="center" height="100%"><a title="close" href="javascript:self.close();"><img id="pix" name="pix" border="0" src="'+url+'"  onLoad="setTimeout(\'resizer()\',500)"></td></tr><td align="right"><font color="#FFFFFF"></a></font></td>');
	newwindow.document.write ('</tr></table></body></html>');
	newwindow.focus();
	
	
}
}



