

function checkFields() {
  reStock = /^\d+$/
  msgError = "";
  var found = 0;
  for (var i=0;i<document.frmsrch.Stock.length;i++){
    if (document.frmsrch.Stock[i].value != ""){
         found =1;
         //TEST STOCK QTY FIELD TO MAKE SURE THERE IS A QUANTITY
         if(!reStock.test(document.frmsrch.Qty[i].value)){
             msgError = msgError + "Qty for Stock Line " + (i +1) + " must be a number.\n";
          }
     }
   }
   if(found == 0){
       msgError = "You must enter at least one Stock number and an associated quantity!";
       alert(msgError);
       return false;
   }else if(msgError != ""){
       alert(msgError);
       return false;
   }else{
       return true;
   }
 }


  //Dennise 6/28/2004 10:45AM jscript to validate SiteHelp.jsp page
   function checkSiteHelp() {
                var missinginfo = "";
                var frm = "document.Request"

                if (document.Request.fname.value == "") {
                        missinginfo += "\n     - First Name";
                }
                if (document.Request.lname.value == "") {
                        missinginfo += "\n     - Last Name";
                }
                if (document.Request.company.value == "") {
                        missinginfo += "\n     - Company/School";
                }
                if (document.Request.profession.value == "" || document.Request.profession.value == "Please Select One") {
                        missinginfo += "\n     - Profession";
                }
                if (document.Request.city.value == "" || document.Request.city.value == "Please Select One") {
                        missinginfo += "\n     - City";
                }
                if (document.Request.state.value == "" || document.Request.state.value == "Please Select One") {
                        missinginfo += "\n     - State";
                }
                if (document.Request.phone.value == "") {
                        missinginfo += "\n     - Phone";
                }
                if ((document.Request.email.value == "") ||
                        (document.Request.email.value.indexOf('@') == -1) || (document.Request.email.value.indexOf('.') == -1)) {
                        missinginfo += "\n     - Email";
                }
                var topic = false;
                for (i=0;i<document.Request.topic.length;i++){
                    if (document.Request.topic[i].checked==true)
                    topic = true;
                }
                if(!topic)
                   missinginfo += "\n     - Topic";

                if (document.Request.description.value == "") {
                        missinginfo += "\n     - Help Message";
                }

                if (missinginfo != "") {
                        missinginfo ="_____________________________\n" +
                        "You failed to correctly fill in your:\n" +
                        missinginfo + "\n_____________________________" +
                        "\nPlease re-enter and submit again!";
                        alert(missinginfo);
                        return false;
                }
                else return true;
        }

  //Dennise 6/28/2004 10:45AM jscript to validate SiteHelp.jsp page
   function checkSiteHelp() {
                var missinginfo = "";
                var frm = "document.Request"

                if (document.Request.fname.value == "") {
                        missinginfo += "\n     - First Name";
                }
                if (document.Request.lname.value == "") {
                        missinginfo += "\n     - Last Name";
                }
                if (document.Request.company.value == "") {
                        missinginfo += "\n     - Company/School";
                }
                if (document.Request.profession.value == "" || document.Request.profession.value == "Please Select One") {
                        missinginfo += "\n     - Profession";
                }
                if (document.Request.city.value == "" || document.Request.city.value == "Please Select One") {
                        missinginfo += "\n     - City";
                }
                if (document.Request.state.value == "" || document.Request.state.value == "Please Select One") {
                        missinginfo += "\n     - State";
                }
                if (document.Request.phone.value == "") {
                        missinginfo += "\n     - Phone";
                }
                if ((document.Request.email.value == "") ||
                        (document.Request.email.value.indexOf('@') == -1) || (document.Request.email.value.indexOf('.') == -1)) {
                        missinginfo += "\n     - Email";
                }
                var topic = false;
                for (i=0;i<document.Request.topic.length;i++){
                    if (document.Request.topic[i].checked==true)
                    topic = true;
                }
                if(!topic)
                   missinginfo += "\n     - Topic";

                if (document.Request.description.value == "") {
                        missinginfo += "\n     - Help Message";
                }

                if (missinginfo != "") {
                        missinginfo ="_____________________________\n" +
                        "You failed to correctly fill in your:\n" +
                        missinginfo + "\n_____________________________" +
                        "\nPlease re-enter and submit again!";
                        alert(missinginfo);
                        return false;
                }
                else return true;
        }

        //11/9/2004 4:29PM Dennis for translite lit request

   function checkLitRequest() {
                var missinginfo = "";
                var frm = "document.Request"

                if (document.Request.fname.value == "") {
                        missinginfo += "\n     - First Name";
                }
                if (document.Request.lname.value == "") {
                        missinginfo += "\n     - Last Name";
                }
                if (document.Request.company.value == "") {
                        missinginfo += "\n     - Company";
                }
                if (document.Request.address.value == "") {
                        missinginfo += "\n     - Address";
                }
                if (document.Request.city.value == "") {
                        missinginfo += "\n     - City";
                }
                if (document.Request.state.value == "") {
                        missinginfo += "\n     - State";
                }
		if (document.Request.zip.value == "") {
                        missinginfo += "\n     - Zip";
                }
                if (document.Request.country.value == "") {
                        missinginfo += "\n     - Country";
                }
                if ((document.Request.email.value == "") ||
                        (document.Request.email.value.indexOf('@') == -1) || (document.Request.email.value.indexOf('.') == -1)) {
                        missinginfo += "\n     - Email";
                }

                if (document.Request.phone.value == "") {
                        missinginfo += "\n     - Telephone";
                }


                if (missinginfo != "") {
                        missinginfo ="_____________________________\n" +
                        "You failed to correctly fill in your:\n" +
                        missinginfo + "\n_____________________________" +
                        "\nPlease re-enter and submit again!";
                        alert(missinginfo);
                        return false;
                }
                else return true;
        }



function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}