function CaricaFoto(img,name){
  foto1=new Image();
  foto1.src=(img);
  Controlla(img,name);
}
function Controlla(img,name){
  if((foto1.width!=0)&&(foto1.height!=0)){
    viewFoto(img,name);
  }
  else{
    funzione="Controlla('"+img+"','"+name+"')";
    intervallo=setTimeout(funzione,5);
  }
}
function viewFoto(img, name){
  thewidth=foto1.width+35;
  theheight=foto1.height+125;
 features = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=' + thewidth + ',height=' + theheight ;
 dlg = window.open ("","Dialog",features) ;
dlg.document.write('<html>');
dlg.document.write('<head>');
dlg.document.write('<title>Untitled Document</title>');
dlg.document.write('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">');
dlg.document.write('<style type="text/css">');
dlg.document.write('<!--');
dlg.document.write('.popup-header {  font-family: Arial, Helvetica, sans-serif; font-size: 16pt; font-style: normal; line-height: normal; font-weight: normal; font-variant: normal; text-transform: none; color: B22722; text-decoration: none}');
dlg.document.write('-->');
dlg.document.write('</style>');
dlg.document.write('</head>');
dlg.document.write('');
dlg.document.write('<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');
dlg.document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');
dlg.document.write('  <tr> ');
dlg.document.write('    <td> ');
dlg.document.write('      <table width="100%" border="0" cellspacing="0" cellpadding="0">');
dlg.document.write('        <tr> ');
dlg.document.write('          <td width="95%"><img src="/lib/cblfineart/cblfineart-logo.gif" width="241" height="48"></td>');
dlg.document.write('          <td align="right" width="5%" valign="top"><a href=# onClick=window.close();><img src="/lib/cblfineart/closepopup.gif" width="16" height="14" vspace="11" hspace="8" border="0"></a></td>');
dlg.document.write('        </tr>');
dlg.document.write('      </table>');
dlg.document.write('    </td>');
dlg.document.write('  </tr>');
dlg.document.write('  <tr align="left" valign="top" bgcolor="#000000"> ');
dlg.document.write('    <td><img src="/lib/cblfineart/tpixel.gif" width="1" height="1"></td>');
dlg.document.write('  </tr>');
dlg.document.write('  <tr> ');
dlg.document.write('    <td height="20"><img src="/lib/cblfineart/tpixel.gif" width="1" height="1"></td>');
dlg.document.write('  </tr>');
dlg.document.write('  <tr align="left"> ');
dlg.document.write('    <td>');
dlg.document.write('      <table width="100%" border="0" cellspacing="0" cellpadding="0">');
dlg.document.write('        <tr>');
dlg.document.write('          <td width="20" align="left"><img src="/lib/cblfineart/tpixel.gif" width="1" height="1"></td>');
dlg.document.write('          <td><font color="B22722" class="popup-header">' + name + '</font></td>');
dlg.document.write('        </tr>');
dlg.document.write('      </table>');
dlg.document.write('      <font face="Arial, Helvetica, sans-serif" size="3"><b><img src="/lib/cblfineart/tpixel.gif" width="1" height="1"></b></font></td>');
dlg.document.write('  </tr>');
dlg.document.write('  <tr align="center"> ');
dlg.document.write('    <td height="10"><img src="/lib/cblfineart/tpixel.gif" width="1" height="1"></td>');
dlg.document.write('  </tr>');
dlg.document.write('  <tr align="center">');
dlg.document.write('    <td>');
dlg.document.write('      <table width="100%" border="0" cellspacing="0" cellpadding="0">');
dlg.document.write('        <tr> ');
dlg.document.write('          <td width="20" align="left"><img src="/lib/cblfineart/tpixel.gif" width="1" height="1"></td>');
dlg.document.write('          <td align="left"><img src="' + img + '"></td>');
dlg.document.write('        </tr>');
dlg.document.write('      </table>');
dlg.document.write('    </td>');
dlg.document.write('  </tr>');
dlg.document.write('</table>');
dlg.document.write('</body>');
dlg.document.write('</html>');

}




