function popupimage(url, ptitle, alttext, IdLang) {
  if ((ptitle=='')) {wintitle = 'Bianchi Verniciatura &middot;:&middot; Immagini';} else {wintitle = 'Bianchi Verniciatura &middot;:&middot; ' + ptitle;}
  if ((IdLang=='italian')) {TxtCloseWin = 'Chiudi finestra';TxtPrintWin = 'Stampa immagine';} else if ((IdLang=='english')) {TxtCloseWin = 'Close window';TxtPrintWin = 'Print image';} else if ((IdLang=='spanish')) {TxtCloseWin = 'Cerrar ventana'; TxtPrintWin = 'Imprimir la imagen';}
  w=open("",'image','width=400,height=400,toolbar=no,scrollbars=no,resizable=no,status=0,location=0');
  w.document.writeln("<html>");
  w.document.writeln("  <head>");
  w.document.writeln("    <title>"+wintitle+"</title>");
  w.document.writeln("    <link rel=\"stylesheet\" type=\"text/css\" href=\"/stile/stile_common.css\" media=\"all\" />");
  w.document.writeln("    <script language=\"javascript\" type=\"text/javascript\">function checksize() { if (document.images[0].complete) { window.resizeTo(document.images[0].width+18,document.images[0].height+140); window.focus();} else { setTimeout('checksize()',250) } }</"+"script>");
  w.document.writeln("  </head>");
  if (document.all) {
      //IE4 = true;
    w.document.writeln("  <body id=\"popup\" onload=\"checksize();\">");
  }
  else {
      //IE4 = false;
    w.document.writeln("  <body id=\"popup\" onload=\"checksize();\" onblur=\"window.close();\">");
  }
  w.document.writeln("    <div>");
  w.document.writeln("      <div id=\"popupimg\"><img src=\""+url+"\" alt=\""+alttext+"\" onClick=\"top.close()\" /></div>");
  w.document.writeln("      <h3>"+alttext+"</h3>");
  w.document.writeln("      <div id=\"pubuttons\">");
  w.document.writeln("        <form>");
  w.document.writeln("          <span><input type=\"button\" name=\"close\" id=\"close\" value=\""+TxtCloseWin+"\" onClick=\"top.close()\" /></span>");

    if (document.all) {
      //IE4 = true;
    w.document.writeln("          <span><input type=\"button\" name=\"print\" id=\"print\" value=\""+TxtPrintWin+"\" onClick=\"javascript:self.print();return false;\" /></span>");
      }
  else {
      //IE4 = false;
    w.document.writeln("          <span><input type=\"button\" name=\"print\" id=\"print\" value=\""+TxtPrintWin+"\" onClick=\"javascript:document.getElementById(\"btprint\").style.visibility=\"hidden\";document.getElementById(\"btclose\").style.visibility=\"hidden\";window.print();return false;\">");

            ///if (document.layers) {
      //  //NS4 = true;
    //}
    //else {
      //  //NS4 = false;
    //}
  }
  w.document.writeln("        </form>");
  w.document.writeln("      </div>");
  w.document.writeln("    </div>");
  w.document.writeln("  </body>");
  w.document.write("</html>");
  w.document.close();
}

//Function to open pop up window
function winOpener(theURL, winName, scrollbars, resizable, width, height) {
	
	winFeatures = 'left=' + (screen.availWidth-10-width)/2 + ',top=' + (screen.availHeight-30-height)/2 + ',scrollbars=' + scrollbars + ',resizable=' + resizable + ',width=' + width + ',height=' + height + ',toolbar=0,location=0,status=1,menubar=0'
  	window.open(theURL, winName, winFeatures);
}

function popuppano(url, ptitle, alttext, IdLang) {
  if ((ptitle=='')) {wintitle = 'Bianchi Verniciatura &middot;:&middot; Immagini';} else {wintitle = 'Bianchi Verniciatura &middot;:&middot; ' + ptitle;}
  if ((IdLang=='italian')) {TxtCloseWin = 'Chiudi finestra';TxtPrintWin = 'Stampa immagine';TxtPano = 'foto panoramica, agisci sulla barra per la visione totale';} else if ((IdLang=='english')) {TxtCloseWin = 'Close window';TxtPrintWin = 'Print image';TxtPano = 'panoramic image, use the scroll bar for a complete view';} else if ((IdLang=='spanish')) {TxtCloseWin = 'Cerrar ventana'; TxtPrintWin = 'Imprimir la imagen';TxtPano = 'panorama, actuar sobre la barra para ver total';}
  w=open("",'image','width=400,height=400,toolbar=no,scrollbars=no,resizable=no,status=0,location=0');
  w.document.writeln("<html>");
  w.document.writeln("  <head>");
  w.document.writeln("    <title>"+wintitle+"</title>");
  w.document.writeln("    <link rel=\"stylesheet\" type=\"text/css\" href=\"/stile/stile_common.css\" media=\"all\" />");
  w.document.writeln("    <script language=\"javascript\" type=\"text/javascript\">function checksize() { if (document.images[0].complete) { window.resizeTo(640,document.images[0].height+160); window.focus();} else { setTimeout('checksize()',250) } }</"+"script>");
  w.document.writeln("  </head>");
  if (document.all) {
      //IE4 = true;
    w.document.writeln("  <body id=\"popup\" onload=\"checksize();\">");
  }
  else {
      //IE4 = false;
    w.document.writeln("  <body id=\"popup\" onload=\"checksize();\" onblur=\"window.close();\">");
  }
  w.document.writeln("    <div>");
  w.document.writeln("      <div id=\"popuppano\"><img src=\""+url+"\" alt=\""+alttext+" "+TxtPano+"\" onClick=\"top.close()\" /></div>");
  w.document.writeln("      <h3>"+alttext+"</h3>");
  w.document.writeln("      <p>"+TxtPano+"</p>");
  w.document.writeln("      <div id=\"pubuttons\">");
  w.document.writeln("        <form>");
  w.document.writeln("          <span><input type=\"button\" name=\"close\" id=\"close\" value=\""+TxtCloseWin+"\" onClick=\"top.close()\" /></span>");

    if (document.all) {
      //IE4 = true;
    w.document.writeln("          <span><input type=\"button\" name=\"print\" id=\"print\" value=\""+TxtPrintWin+"\" onClick=\"javascript:self.print();return false;\" /></span>");
      }
  else {
      //IE4 = false;
    w.document.writeln("          <span><input type=\"button\" name=\"print\" id=\"print\" value=\""+TxtPrintWin+"\" onClick=\"javascript:document.getElementById(\"btprint\").style.visibility=\"hidden\";document.getElementById(\"btclose\").style.visibility=\"hidden\";window.print();return false;\">");

            ///if (document.layers) {
      //  //NS4 = true;
    //}
    //else {
      //  //NS4 = false;
    //}
  }
  w.document.writeln("        </form>");
  w.document.writeln("      </div>");
  w.document.writeln("    </div>");
  w.document.writeln("  </body>");
  w.document.write("</html>");
  w.document.close();
}
