var popup="";

function openDocPopup(theURL,winName,features) { 
 window.open("docDownloader.jsp?url="+escape(theURL), winName, features);
//  window.open(theURL,winName,features);
}

function apriPOPUP(url,width,height)
{ 
 if (popup!="")
 {
 popup.close();
 } 
  popup=window.open(url,"popup","resizable=no,scrollbars=no,height="+height+",width="+width+",location=no,menubar=no,screenX=10,screenY=10,status=no,toolbar=no"); 
  popup.document.write('<html>\n<head>\n<title>Galleria - Dettaglio</title>\n</head>\n<body topmargin=0 leftmargin=0 bgcolor="#000000" text="#000000" link="#000000" vlink="#000000" alink="#000000" onload="preloadImages()">\n<a href="javascript:close()"><img src="'+url+'" border="0" alt=""></a><br>\n</body>\n</html>\n');
  popup.focus();
}

function apriNewPOPUP(url,width,height,src)
{ 
 if (popup!="")
 {
 popup.close();
 } 
  popup=window.open(url,"popup","resizable=no,scrollbars="+src+",height="+height+",width="+width+",location=no,menubar=no,screenX=10,screenY=10,status=no,toolbar=no");  
  popup.focus();
}

function apriCRLessPOPUP(url,x,y,w,h)
{ 
 if (popup!="")
 {
 popup.close();
 } 
 var page = '<html><head><title></title></head>\
<script language="JavaScript">\
<!--\
function chiudi()\
{\
 top.close();\
}\
//-->\
</script>\
<style type="text/css">\
body \
{ \
  border: 0px solid #000000;\
  overflow: hidden;\
  margin: 0pt;\
}\
.winmove \
{ \
  behavior: url("../../js/winmove.htc"); \
}\
</style>\
<body alink="Navy" bottommargin=0 leftmargin=0 marginheight=0 marginwidth=0 rightmargin=0 topmargin=0 vlink="#000000" text="#000000" link="#000000" bgcolor="#000000">\
<table border=0 cellpadding=0 cellspacing=0 align="center" width="400" height="420"><tr><td align="center" valign="middle">\
<img src="../../images/marchi/topbar_sx.gif" alt="" height="20" width="380" border="0" class="winmove"><a href="javascript:window.close();"><img src="../../images/marchi/topbar_dx.gif" alt="" border="0" height="20" width="20"></a><br><a href="javascript:window.close();"><img src="../../images/marchi/'+url+'" alt="" border="0"></a>\
</td></tr></table>\
</body>\
</html>';
  popup=window.open("","popup","fullscreen=1,resizable=no,scrollbars=no,location=no,menubar=no,screenX=10,screenY=10,status=no,toolbar=no,height="+h+",width="+w);
  popup.moveTo( x,y-1 );
  popup.resizeTo( w,h );
  popup.document.write(page);
  popup.document.close();
  popup.moveTo( x,y );
  popup.focus();
}
