isNS4 = (document.layers) ? 1 : 0;
var visits = false;
var reasons = false;
var valuable = false;
function cgiPopup(poptitle, popwidth, popheight, frmName, myForm, formAction)
{
   var parmString = get_parameters(myForm);
   var redirectStr =  "<script>location.href=\"" + formAction + parmString + "\";</script>";
   var controls = "status=0,scrollbars=yes,personalbar=0,addressbar=0,title=0";
   controls += ",width=" + popwidth + ",height=" + popheight;
   if (isNS4)
   {
      controls += ",screenX=" + window.screenX + ",screenY=" + window.screenY;
   }
   controls += "\"";
   popwin = window.open('', poptitle, controls);
   popwin.document.writeln('<html><body>');
   popwin.document.writeln(redirectStr);
   popwin.document.writeln("<\/body><\/html>");
}
function get_parameters(myForm)
{
   var parmString = "";
   for (count=0; count < myForm.length; count++)
   {
      if (myForm.elements[count].type != "submit")
      {
         var fieldName = myForm.elements[count].name;
         var fieldValue = escape(myForm.elements[count].value);
         var andCh = "";
         if (count == 0)
         {
            andCh = "?"; 
         }
         else
         {
            andCh = "&"; 
         }
         parmString += andCh + fieldName + "=" + fieldValue;
      }
   }
   return parmString;
}

