<!--

  function IsNumeric( strString )
  {
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;
   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
  }


  function formatDecimal(argvalue, addzero, decimaln) 
  {
    var numOfDecimal = (decimaln == null) ? 2 : decimaln;
    var number = 1;

    number = Math.pow(10, numOfDecimal);

    argvalue = Math.round(parseFloat(argvalue) * number) / number;
    // If you're using IE3.x, you will get error with the following line.
    // argvalue = argvalue.toString();
    // It works fine in IE4.
    argvalue = "" + argvalue;

    if (argvalue.indexOf(".") == 0)
      argvalue = "0" + argvalue;

    if (addzero == true) {
      if (argvalue.indexOf(".") == -1)
        argvalue = argvalue + ".";

      while ((argvalue.indexOf(".") + 1) > (argvalue.length - numOfDecimal))
        argvalue = argvalue + "0";
    }
    return argvalue;
  }
  

  function getRadioValue( radio )
  {
   for (var i = 0; i < radio.length; i++)
    {   
      if (radio[i].checked) { break }
    }
    if( i == radio.length )
      return -1;
    else
      return radio[i].value;
  }
  


  function CheckEstimateReplication( )
  {
    if( document.contact.strFname.value == "" ) 
    {
      alert("You must enter a first name."); 
      return false;
    }
    if( document.contact.strLname.value == "" ) 
    {
      alert("You must enter a last name."); 
      return false;
    }
    if( document.contact.strAddress1.value == "" ) 
    {
      alert("You must enter your address."); 
      return false;
    }    
    if( document.contact.strCity.value == "" ) 
    {
      alert("You must enter your city."); 
      return false;
    } 
    if( document.contact.strState.value == "" ) 
    {
      alert("You must enter your state/province."); 
      return false;
    }      
    if( document.contact.strZip.value == "" ) 
    {
      alert("You must enter your postal code."); 
      return false;
    }                  
    if( document.contact.strPhone.value == "" ) 
    {
      alert("You must enter a phone number."); 
      return false;
    }
    if( document.contact.strEmail.value == "" || document.contact.strEmail.value.search("@") == -1  || document.contact.strEmail.value.indexOf(".") == -1 ) 
    {
      alert("You must enter a complete, valid e-mail address."); 
      return false;
    }        
    if( document.contact.strBusType[0].selected )
    {
      alert("You must select your business type.");
      return false;
    }
   
    if( document.contact.strMediaType[0].selected )
    {
      alert("You must select your media type.");
      return false;
    }
    if( document.contact.strQty.value == "" ) 
    {
      alert("You must enter a quantity."); 
      return false;
    }    
    if( document.contact.strPrintColors[0].selected )
    {
      alert("You must choose the type of print colors on disc.");
      return false;
    }    
    
    if( document.contact.strStdPackaging[0].selected )
    {
      alert("You must select a standard packaging option.");
      return false;
    }        
    if( document.contact.strInsert[0].selected )
    {
      alert("You must select an insert/traycard option.");
      return false;
    }     
    if( document.contact.strTurnTime.value == "" ) 
    {
      alert("You must specify your required turn-time."); 
      return false;
    }       
    return true;
  }




  function CheckEstimateDuplication( )
  {
    if( document.contact.strFname.value == "" ) 
    {
      alert("You must enter a first name."); 
      return false;
    }
    if( document.contact.strLname.value == "" ) 
    {
      alert("You must enter a last name."); 
      return false;
    }
    if( document.contact.strAddress1.value == "" ) 
    {
      alert("You must enter your address."); 
      return false;
    }    
    if( document.contact.strCity.value == "" ) 
    {
      alert("You must enter your city."); 
      return false;
    } 
    if( document.contact.strState.value == "" ) 
    {
      alert("You must enter your state/province."); 
      return false;
    }      
    if( document.contact.strZip.value == "" ) 
    {
      alert("You must enter your postal code."); 
      return false;
    }                  
    if( document.contact.strPhone.value == "" ) 
    {
      alert("You must enter a phone number."); 
      return false;
    }
    if( document.contact.strEmail.value == "" || document.contact.strEmail.value.search("@") == -1  || document.contact.strEmail.value.indexOf(".") == -1 ) 
    {
      alert("You must enter a complete, valid e-mail address."); 
      return false;
    }        
    if( document.contact.strBusType[0].selected )
    {
      alert("You must select your business type.");
      return false;
    }
    
    if( document.contact.strMediaType[0].selected )
    {
      alert("You must select your media type.");
      return false;
    }    
    if( document.contact.strQty.value == "" ) 
    {
      alert("You must enter a quantity."); 
      return false;
    }    
    if( document.contact.strPrintColors[0].selected )
    {
      alert("You must choose the type of print colors on disc.");
      return false;
    }

    if( document.contact.strStdPackaging[0].selected )
    {
      alert("You must select a standard packaging option.");
      return false;
    }        
    if( document.contact.strInsert[0].selected )
    {
      alert("You must select an insert/traycard option.");
      return false;
    }     
    if( document.contact.strTurnTime.value == "" ) 
    {
      alert("You must specify your required turn-time."); 
      return false;
    }       
    return true;
  }





  function CheckEstimateCDRDVDR( )
  {
    if( document.contact.strFname.value == "" ) 
    {
      alert("You must enter a first name."); 
      return false;
    }
    if( document.contact.strLname.value == "" ) 
    {
      alert("You must enter a last name."); 
      return false;
    }
    if( document.contact.strAddress1.value == "" ) 
    {
      alert("You must enter your address."); 
      return false;
    }    
    if( document.contact.strCity.value == "" ) 
    {
      alert("You must enter your city."); 
      return false;
    } 
    if( document.contact.strState.value == "" ) 
    {
      alert("You must enter your state/province."); 
      return false;
    }      
    if( document.contact.strZip.value == "" ) 
    {
      alert("You must enter your postal code."); 
      return false;
    }                  
    if( document.contact.strPhone.value == "" ) 
    {
      alert("You must enter a phone number."); 
      return false;
    }
    if( document.contact.strEmail.value == "" || document.contact.strEmail.value.search("@") == -1  || document.contact.strEmail.value.indexOf(".") == -1 ) 
    {
      alert("You must enter a complete, valid e-mail address."); 
      return false;
    }        
    if( document.contact.strBusType[0].selected )
    {
      alert("You must select your business type.");
      return false;
    }
    
    if( document.contact.strMediaType[0].selected )
    {
      alert("You must select your media type.");
      return false;
    }    
    if( document.contact.strQty.value == "" ) 
    {
      alert("You must enter a quantity."); 
      return false;
    }    


    if( document.contact.strPrintColors[0].selected )
    {
      alert("You must choose the type of print colors on disc.");
      return false;
    }
    if( document.contact.strStdPackaging[0].selected )
    {
      alert("You must select a standard packaging option.");
      return false;
    }        
    if( document.contact.strInsert[0].selected )
    {
      alert("You must select an insert/traycard option.");
      return false;
    }     
    if( document.contact.strTurnTime.value == "" ) 
    {
      alert("You must specify your required turn-time."); 
      return false;
    }       
    return true;
  }





  function CheckEstimateCutCDs( )
  {
    if( document.contact.strFname.value == "" ) 
    {
      alert("You must enter a first name."); 
      return false;
    }
    if( document.contact.strLname.value == "" ) 
    {
      alert("You must enter a last name."); 
      return false;
    }
    if( document.contact.strAddress1.value == "" ) 
    {
      alert("You must enter your address."); 
      return false;
    }    
    if( document.contact.strCity.value == "" ) 
    {
      alert("You must enter your city."); 
      return false;
    } 
    if( document.contact.strState.value == "" ) 
    {
      alert("You must enter your state/province."); 
      return false;
    }      
    if( document.contact.strZip.value == "" ) 
    {
      alert("You must enter your postal code."); 
      return false;
    }                  
    if( document.contact.strPhone.value == "" ) 
    {
      alert("You must enter a phone number."); 
      return false;
    }
    if( document.contact.strEmail.value == "" || document.contact.strEmail.value.search("@") == -1  || document.contact.strEmail.value.indexOf(".") == -1 ) 
    {
      alert("You must enter a complete, valid e-mail address."); 
      return false;
    }        
    if( document.contact.strBusType[0].selected )
    {
      alert("You must select your business type.");
      return false;
    }
    
    
    if( document.contact.strQty.value == "" ) 
    {
      alert("You must enter a quantity."); 
      return false;
    }    
    if( document.contact.strShape[0].selected )
    {
      alert("You must choose a shape.");
      return false;
    }
    if( document.contact.strDCard[0].selected )
    {
      alert("You must choose the number of print colors on DCard.");
      return false;
    }
    if( document.contact.strDCardPackaging[0].selected )
    {
      alert("You must select a  packaging option.");
      return false;
    }        
    if( document.contact.strTurnTime.value == "" ) 
    {
      alert("You must specify your required turn-time."); 
      return false;
    }       
    return true;
  }







  function CheckEstimateCShells( )
  {
    if( document.contact.strFname.value == "" ) 
    {
      alert("You must enter a first name."); 
      return false;
    }
    if( document.contact.strLname.value == "" ) 
    {
      alert("You must enter a last name."); 
      return false;
    }
    if( document.contact.strAddress1.value == "" ) 
    {
      alert("You must enter your address."); 
      return false;
    }    
    if( document.contact.strCity.value == "" ) 
    {
      alert("You must enter your city."); 
      return false;
    } 
    if( document.contact.strState.value == "" ) 
    {
      alert("You must enter your state/province."); 
      return false;
    }      
    if( document.contact.strZip.value == "" ) 
    {
      alert("You must enter your postal code."); 
      return false;
    }                  
    if( document.contact.strPhone.value == "" ) 
    {
      alert("You must enter a phone number."); 
      return false;
    }
    if( document.contact.strEmail.value == "" || document.contact.strEmail.value.search("@") == -1  || document.contact.strEmail.value.indexOf(".") == -1 ) 
    {
      alert("You must enter a complete, valid e-mail address."); 
      return false;
    }        
    if( document.contact.strBusType[0].selected )
    {
      alert("You must select your business type.");
      return false;
    }
    
    
    if( document.contact.strQty.value == "" ) 
    {
      alert("You must enter a quantity."); 
      return false;
    }    
    if( document.contact.strStyle[0].selected )
    {
      alert("You must choose a style.");
      return false;
    }
    if( document.contact.strPrintColors[0].selected )
    {
      alert("You must make a selection for print colors on disc.");
      return false;
    }
    if( document.contact.strPrintMatter[0].selected )
    {
      alert("You must select an option for printer materials.");
      return false;
    }            
    if( document.contact.strTurnTime[0].selected ) 
    {
      alert("You must specify your required turn-time."); 
      return false;
    }       
    return true;
  }



/*

  function CheckEstimate( )
  {
    if( document.contact.strFname.value == "" ) 
    {
      alert("You must enter a first name."); 
      return false;
    }
    if( document.contact.strLname.value == "" ) 
    {
      alert("You must enter a last name."); 
      return false;
    }
    if( document.contact.strCompany.value == "" ) 
    {
      alert("You must enter a company name."); 
      return false;
    }    
    if( document.contact.strPhone.value == "" ) 
    {
      alert("You must enter a phone number."); 
      return false;
    }
    if( document.contact.strEmail.value == "" || document.contact.strEmail.value.search("@") == -1  || document.contact.strEmail.value.indexOf(".") == -1 ) 
    {
      alert("You must enter a complete, valid e-mail address."); 
      return false;
    }    
    return true;
  } */


  function CheckCreditApp( )
  {
    if( document.contact.strFname.value == "" ) 
    {
      alert("You must enter a first name."); 
      return false;
    }
    if( document.contact.strLname.value == "" ) 
    {
      alert("You must enter a last name."); 
      return false;
    }
    if( document.contact.strTitle.value == "" ) 
    {
      alert("You must enter a title."); 
      return false;
    }     
    if( document.contact.strCompany.value == "" ) 
    {
      alert("You must enter a company name."); 
      return false;
    }    

  
    if( document.contact.strAddress1.value == "" ) 
    {
      alert("You must enter your address."); 
      return false;
    }
    if( document.contact.strCity.value == "" ) 
    {
      alert("You must enter your city."); 
      return false;
    }
    if( document.contact.strState.value == "" ) 
    {
      alert("You must enter your state/province."); 
      return false;
    }     
    if( document.contact.strZip.value == "" ) 
    {
      alert("You must enter your postal code."); 
      return false;
    }      
    if( document.contact.strPhone.value == "" ) 
    {
      alert("You must enter a phone number."); 
      return false;
    }    
    if( document.contact.strEmail.value == "" || document.contact.strEmail.value.search("@") == -1  || document.contact.strEmail.value.indexOf(".") == -1 ) 
    {
      alert("You must enter a complete, valid e-mail address."); 
      return false;
    }      
    
    if( document.forms[0].strTaxID )
    {
      if( document.forms[0].strTaxID.value == "" )
      {
        alert("You must enter your Federal Tax ID number.");
        return false;
      }
    }
    if( document.forms[0].strEstDate )
    {
      if( document.forms[0].strEstDate.value == "" )
      {
        alert("You must enter the date your business was established.");
        return false;
      }
    }
    if( document.forms[0].strBusProperty )
    {
      if( document.forms[0].strBusProperty.selectedIndex == 0 ) 
      {
        alert("You must specify your type of business property.");
        return false;
      }
    }

    if( document.forms[0].strResaleCert )
    {
      if( document.forms[0].strResaleCert.value == "" )
      {
        alert("You must enter your Resale Certificate number.");
        return false;
      }
    }
    if( document.forms[0].strOwnerType )
    {
     if( document.forms[0].strOwnerType.selectedIndex == 0 ) 
      {
        alert("You must specify your ownership type.");
        return false;
      }
    }

    if( document.forms[0].strDUN )
    {
      if( document.forms[0].strDUN.value == "" )
      {
        alert("You must enter your Dun number.");
        return false;
      }
    }
    if( document.forms[0].strDUNRating )
    {
      if( document.forms[0].strDUNRating.value == "" )
      {
        alert("You must enter your Dun rating.");
        return false;
      }
    }

    if( document.forms[0].strSupplier1 )
    {
      if( document.forms[0].strSupplier1.value == "" )
      {
        alert("You must enter your first major supplier's name.");
        return false;
      }
    }
    if( document.forms[0].strSuppAdd1 )
    {
      if( document.forms[0].strSuppAdd1.value == "" )
      {
        alert("You must enter the address of your first major supplier.");
        return false;
      }
    }
    if( document.forms[0].strSuppPhone1 )
    {
      if( document.forms[0].strSuppPhone1.value == "" )
      {
        alert("You must enter your first major supplier's telephone number.");
        return false;
      }
    }
    if( document.forms[0].strSuppFax1 )
    {
      if( document.forms[0].strSuppFax1.value == "" )
      {
        alert("You must enter your first major supplier's fax number.");
        return false;
      }
    }


    if( document.forms[0].strSupplier2 )
    {
      if( document.forms[0].strSupplier2.value == "" )
      {
        alert("You must enter your second major supplier's name.");
        return false;
      }
    }
    if( document.forms[0].strSuppAdd2 )
    {
      if( document.forms[0].strSuppAdd2.value == "" )
      {
        alert("You must enter the address of your second major supplier.");
        return false;
      }
    }
    if( document.forms[0].strSuppPhone2 )
    {
      if( document.forms[0].strSuppPhone2.value == "" )
      {
        alert("You must enter your second major supplier's telephone number.");
        return false;
      }
    }
    if( document.forms[0].strSuppFax2 )
    {
      if( document.forms[0].strSuppFax2.value == "" )
      {
        alert("You must enter your second major supplier's fax number.");
        return false;
      }
    }

    if( document.forms[0].strSupplier3 )
    {
      if( document.forms[0].strSupplier3.value == "" )
      {
        alert("You must enter your third major supplier's name.");
        return false;
      }
    }
    if( document.forms[0].strSuppAdd3 )
    {
      if( document.forms[0].strSuppAdd3.value == "" )
      {
        alert("You must enter the address of your third major supplier.");
        return false;
      }
    }
    if( document.forms[0].strSuppPhone3 )
    {
      if( document.forms[0].strSuppPhone3.value == "" )
      {
        alert("You must enter your third major supplier's telephone number.");
        return false;
      }
    }

    if( document.forms[0].strSuppFax3 )
    {
      if( document.forms[0].strSuppFax3.value == "" )
      {
        alert("You must enter your third major supplier's fax number.");
        return false;
      }
    }

    if( document.forms[0].strBank )
    {
      if( document.forms[0].strBank.value == "" )
      {
        alert("You must enter the name of your bank.");
        return false;
      }
    }
    if( document.forms[0].strBankContact )
    {
      if( document.forms[0].strBankContact.value == "" )
      {
        alert("You must bank's contact person.");
        return false;
      }
    }
    if( document.forms[0].strBankAcct )
    {
      if( document.forms[0].strBankAcct.value == "" )
      {
        alert("You must bank account number.");
        return false;
      }
    }
    if( document.forms[0].strBankAddress )
    {
      if( document.forms[0].strBankAddress.value == "" )
      {
        alert("You must your bank's address.");
        return false;
      }
    }
    if( document.forms[0].strBankCity )
    {
      if( document.forms[0].strBankCity.value == "" )
      {
        alert("You must enter your bank's city.");
        return false;
      }
    }
    if( document.forms[0].strBankState )
    {
      if( document.forms[0].strBankState.value == "" )
      {
        alert("You must bank's state.");
        return false;
      }
    }

    if( document.forms[0].strBankZIP )
    {
      if( document.forms[0].strBankZIP.value == "" )
      {
        alert("You must bank's postal code.");
        return false;
      }
    }
    if( document.forms[0].strBankPhone )
    {
      if( document.forms[0].strBankPhone.value == "" )
      {
        alert("You must enter your bank's telephone number.");
        return false;
      }
    }
    if( document.forms[0].strBankFax )
    {
      if( document.forms[0].strBankFax.value == "" )
      {
        alert("You must enter your bank's fax number.");
        return false;
      }
    }
    if( document.forms[0].strAnnualPurchase )
    {
      if( document.forms[0].strAnnualPurchase.value == "$" )
      {
        alert("You must enter your anticipated annual purchases, from Dering.");
        return false;
      }
    }
    if( document.forms[0].strCreditLimit )
    {
      if( document.forms[0].strCreditLimit.value == "$" )
      {
        alert("You must enter your requested credit limit.");
        return false;
      }
    }    
    
    
    return true;  
  }
  
  
  function CheckAdminLogin( )
  {
    if (document.loginform.strUser.value == "") 
    {
      alert("You must enter your username.");
      return false;
    }
    if (document.loginform.strPass.value == "")
    {
      alert("You must enter a password.");
      return false;
    }
    return true;
  } 
  
  
  

  function CheckDateFilter( )
  {
    if( document.filter.mm1.value == "" || document.filter.dd1.value == "" || document.filter.yy1.value == "" ) 
    {
      alert("You must enter a complete beginning date.");
      return false;
    }
    if( document.filter.mm2.value == "" || document.filter.dd2.value == "" || document.filter.yy2.value == "" ) 
    {
      alert("You must enter a complete ending date.");
      return false;
    }
    return true;
  }
  
  
  function ConfirmDelete( )
  {
    if( confirm("Are you sure you wish to delete this item?") ) 
      return true;
    else
      return false;
  }  


  

//****************************************************************************************  
// -->
