function openWindowAndWrite(iname,icap,wsize,hsize,cssfile) {
  wname = '_blank';
  wsize = Math.min(screen.width,(parseInt(wsize, 10) + 20));
  hsize = Math.min(screen.height-70,parseInt(hsize, 10));
  var bldArg = 'width=' + wsize + ',height=' + hsize + ',left=0,top=0,screenX=0,screenY=0';
  bldArg = bldArg + ',channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0';
 if(!(iname=="")) {
  popupWin=window.open('',wname,bldArg);
  if (!popupWin.opener) { popupWin.opener = self;}
  popupWin.document.open();
  popupWin.document.writeln("<html><head>");
  popupWin.document.writeln("<meta http-equiv='content-type' content='text/html; charset=iso-8859-1'>");
  popupWin.document.writeln("<link rel='stylesheet' type='text/css' href='" + cssfile + ".css'>");
  popupWin.document.writeln("<title>" + icap + "</title>");
  popupWin.document.writeln("<SCRIPT language='JavaScript'>");
  popupWin.document.writeln("if (window.focus) {");
  popupWin.document.writeln(" self.focus();");
  popupWin.document.writeln("}");
  popupWin.document.writeln("</SCRIPT>");
  popupWin.document.writeln("</head>");
  popupWin.document.writeln("<body class='popupImage'>");
  popupWin.document.writeln("<center>");
  popupWin.document.writeln("<a href='#' onClick='self.close()'><img src='" + iname + "' border=0></a><br>");
  popupWin.document.writeln("<p><div class='plainText'><table border='0' cellspacing='0' cellpadding='0'><tr>");
  popupWin.document.writeln("<td width='" + wsize + "' height='40' valign='middle' align='center' class='contentColumn'><b>");
  popupWin.document.writeln(icap);
  popupWin.document.writeln("</b></td></tr></table></div>");
  popupWin.document.writeln("</center></body></html>");
  popupWin.document.close();
 } else {
  popupWin=window.open('http://www.tetsi.com',wname,bldArg);
  if (!popupWin.opener) { popupWin.opener = self;}
 }
}

function printVersionPopUp(prms) {
   var url = "print.php?"+prms;
   hsize = screen.height-200;
   param = "toolbar=yes,menubar=yes,location=no,status=no,scrollbars=yes,resizable=yes,width=" + 650 + ",height=" + hsize;
   compose_window=window.open(url, '_blank', param);
   if (!compose_window.opener) compose_window.opener=self;
}