<!--

  function chk_payment()
  { if (document.docform.payamount2.value == 0) { alert('Payment cannot be $0'); return (false); } }

  function chk_scoring()
  { 
    if (!document.scoringform.addrchk.checked)      { alert('Please check all address fields');         document.scoringform.vsuite.focus();    return (false); }
    if (document.scoringform.acctnum.value   == "") { alert('Userid is a required field');              document.scoringform.acctnum.focus();   return (false); }
    if (document.scoringform.password.value  == "") { alert('Password is a required field');            document.scoringform.password.focus();  return (false); }
    if (document.scoringform.assetcode.value == "") { alert('Asset Code is a required field');          document.scoringform.assetcode.focus(); return (false); }
    if (document.scoringform.naics.value     == "") { alert('NAICS is a required field');               document.scoringform.naics.focus();     return (false); }
    if (document.scoringform.naicsdesc.value == "") { alert('NAICS Description is a required field');   document.scoringform.naicsdesc.focus(); return (false); }
    if (!document.scoringform.vprov.value    == "") { if (document.scoringform.vprov.value.length   > 2) { alert('Province/State must be 2 character code'); document.scoringform.vprov.focus();   return (false); } }
    if (!document.scoringform.cprov.value    == "") { if (document.scoringform.cprov.value.length   > 2) { alert('Province/State must be 2 character code'); document.scoringform.cprov.focus();   return (false); } }
    if (!document.scoringform.cp1prov.value  == "") { if (document.scoringform.cp1prov.value.length > 2) { alert('Province/State must be 2 character code'); document.scoringform.cp1prov.focus(); return (false); } }
    if (!document.scoringform.cp2prov.value  == "") { if (document.scoringform.cp2prov.value.length > 2) { alert('Province/State must be 2 character code'); document.scoringform.cp2prov.focus(); return (false); } }
  }

  function showlli()
  { document.getElementById("landlordinfo").style.display = "block"; document.getElementById("showllifields").style.display = "none"; document.getElementById("hidellifields").style.display = "block"; }

  function hidelli()
  { document.getElementById("landlordinfo").style.display = "none"; document.getElementById("showllifields").style.display = "block"; document.getElementById("hidellifields").style.display = "none"; }

  function showini()
  { document.getElementById("insuranceinfo").style.display = "block"; document.getElementById("showinifields").style.display = "none"; document.getElementById("hideinifields").style.display = "block"; }

  function hideini()
  { document.getElementById("insuranceinfo").style.display = "none"; document.getElementById("showinifields").style.display = "block"; document.getElementById("hideinifields").style.display = "none"; }

  function showcwu()
  { document.getElementById("cwuresults").style.display = "block"; document.getElementById("showcwuresults").style.display = "none"; document.getElementById("hidecwuresults").style.display = "block"; }

  function hidecwu()
  { document.getElementById("cwuresults").style.display = "none"; document.getElementById("showcwuresults").style.display = "block"; document.getElementById("hidecwuresults").style.display = "none"; }

  function showpcc()
  { document.getElementById("commissioncalc").style.display = "block"; document.getElementById("showpccfields").style.display = "none"; document.getElementById("hidepccfields").style.display = "block"; }

  function hidepcc()
  { document.getElementById("commissioncalc").style.display = "none"; document.getElementById("showpccfields").style.display = "block"; document.getElementById("hidepccfields").style.display = "none"; }

  function SelectAll()
  {
  var maxLIDs = parseFloat(document.EOLLeases.maxitems.value)
  for (var i = 1; i <= maxLIDs; i++)
    {
    lid = eval("document.EOLLeases.LID" + i); 
    if (lid.checked == false) lid.checked = true;
    }
  }

  function DSelectAll()
  {
  var maxLIDs = parseFloat(document.EOLLeases.maxitems.value)
  for (var i = 1; i <= maxLIDs; i++)
    {
    lid = eval("document.EOLLeases.LID" + i); 
    if (lid.checked == true) lid.checked = false;
    }
  }

  function pFCurrency(str)
  {
  var eedecreg=new RegExp("\\.","g");
  var eethreg=new RegExp(",","g");
  var eecurrencyreg=new RegExp("[$]","g");
  str=String(str).replace(eethreg,"");
  str=String(str).replace(eedecreg,".");
  str=String(str).replace(eecurrencyreg,"");
  var res=parseFloat(str);
  if(isNaN(res))
    {return 0;}
  else
    {return res;}
  }

  function commcalc()
  {
    var totalcomm = pFCurrency(document.docform.totalcomm.value);
    var docfee    = pFCurrency(document.docform.docfee.value);
    var fundfee   = pFCurrency(document.docform.fundfee.value);

    var agentcomm = ((parseFloat(totalcomm)+parseFloat(docfee)-parseFloat(fundfee))*0.6);

    calcresult = totalcomm.toString().replace(/\\$|\\,/g,'');
    cents = Math.floor( ( calcresult * 100 + 0.5 ) % 100 );
    calcresult = Math.floor( ( calcresult * 100 + 0.5 ) / 100 ).toString();
    if ( cents < 10 ) { cents = "0" + cents; }
    for ( i = 0; i < Math.floor( ( calcresult.length - ( 1 + i ) ) / 3 ); i++) { calcresult = calcresult.substring( 0 ,calcresult.length - (4 * 1 + 3 ) ) + calcresult.substring( calcresult.length - ( 4 * 1 + 3 ) ); }
    document.docform.totalcomm.value = '$' + calcresult + '.' + cents;

    calcresult = agentcomm.toString().replace(/\\$|\\,/g,'');
    cents = Math.floor( ( calcresult * 100 + 0.5 ) % 100 );
    calcresult = Math.floor( ( calcresult * 100 + 0.5 ) / 100 ).toString();
    if ( cents < 10 ) { cents = "0" + cents; }
    for ( i = 0; i < Math.floor( ( calcresult.length - ( 1 + i ) ) / 3 ); i++) { calcresult = calcresult.substring( 0 ,calcresult.length - (4 * 1 + 3 ) ) + calcresult.substring( calcresult.length - ( 4 * 1 + 3 ) ); }
    document.docform.agentcomm.value = '$' + calcresult + '.' + cents;

    calcresult = docfee.toString().replace(/\\$|\\,/g,'');
    cents = Math.floor( ( calcresult * 100 + 0.5 ) % 100 );
    calcresult = Math.floor( ( calcresult * 100 + 0.5 ) / 100 ).toString();
    if ( cents < 10 ) { cents = "0" + cents; }
    for ( i = 0; i < Math.floor( ( calcresult.length - ( 1 + i ) ) / 3 ); i++) { calcresult = calcresult.substring( 0 ,calcresult.length - (4 * 1 + 3 ) ) + calcresult.substring( calcresult.length - ( 4 * 1 + 3 ) ); }
    document.docform.docfee.value = '$' + calcresult + '.' + cents;

    calcresult = fundfee.toString().replace(/\\$|\\,/g,'');
    cents = Math.floor( ( calcresult * 100 + 0.5 ) % 100 );
    calcresult = Math.floor( ( calcresult * 100 + 0.5 ) / 100 ).toString();
    if ( cents < 10 ) { cents = "0" + cents; }
    for ( i = 0; i < Math.floor( ( calcresult.length - ( 1 + i ) ) / 3 ); i++) { calcresult = calcresult.substring( 0 ,calcresult.length - (4 * 1 + 3 ) ) + calcresult.substring( calcresult.length - ( 4 * 1 + 3 ) ); }
    document.docform.fundfee.value = '$' + calcresult + '.' + cents;
  }


  function mulvendorinvcalc()
  {
    document.docform.totalinvamount.value=eedisplayFloatNDTh(eeparseFloatTh(document.docform.invAmtV0.value)+eeparseFloatTh(document.docform.invAmtV1.value)+eeparseFloatTh(document.docform.invAmtV2.value)+eeparseFloatTh(document.docform.invAmtV3.value)+eeparseFloatTh(document.docform.invAmtV4.value)+eeparseFloatTh(document.docform.invAmtV5.value),2);
    document.docform.pA5B.value=document.docform.totalinvamount.value;
    document.docform.equipcost.value=document.docform.totalinvamount.value;
    recalc_onclick('pA5B');
    recalc_onclick('pA10B');
  }

  function mulvendorcommcalc()
  {

    var totalinvCommV  = pFCurrency(document.docform.totalinvCommV.value);
    var totalinvCommVR = pFCurrency(document.docform.totalinvCommVR.value);
    var invCommV0      = pFCurrency(document.docform.invCommV0.value);
    var invCommVR0     = pFCurrency(document.docform.invCommVR0.value);
    var invCommV1      = pFCurrency(document.docform.invCommV1.value);
    var invCommVR1     = pFCurrency(document.docform.invCommVR1.value);
    var invCommV2      = pFCurrency(document.docform.invCommV2.value);
    var invCommVR2     = pFCurrency(document.docform.invCommVR2.value);
    var invCommV3      = pFCurrency(document.docform.invCommV3.value);
    var invCommVR3     = pFCurrency(document.docform.invCommVR3.value);
    var invCommV4      = pFCurrency(document.docform.invCommV4.value);
    var invCommVR4     = pFCurrency(document.docform.invCommVR4.value);

    chktotalCommV      = (parseFloat(invCommV0)+parseFloat(invCommV1)+parseFloat(invCommV2)+parseFloat(invCommV3)+parseFloat(invCommV4));
    chktotalCommVR     = (parseFloat(invCommVR0)+parseFloat(invCommVR1)+parseFloat(invCommVR2)+parseFloat(invCommVR3)+parseFloat(invCommVR4));

    calcresult = totalinvCommV
    cents = Math.floor( ( calcresult * 100 + 0.5 ) % 100 );
    calcresult = Math.floor( ( calcresult * 100 + 0.5 ) / 100 ).toString();
    if ( cents < 10 ) { cents = "0" + cents; }
    for ( i = 0; i < Math.floor( ( calcresult.length - ( 1 + i ) ) / 3 ); i++) { calcresult = calcresult.substring( 0 ,calcresult.length - (4 * 1 + 3 ) ) + calcresult.substring( calcresult.length - ( 4 * 1 + 3 ) ); }
    totalinvCommV = '$' + calcresult + '.' + cents;

    calcresult = totalinvCommVR
    cents = Math.floor( ( calcresult * 100 + 0.5 ) % 100 );
    calcresult = Math.floor( ( calcresult * 100 + 0.5 ) / 100 ).toString();
    if ( cents < 10 ) { cents = "0" + cents; }
    for ( i = 0; i < Math.floor( ( calcresult.length - ( 1 + i ) ) / 3 ); i++) { calcresult = calcresult.substring( 0 ,calcresult.length - (4 * 1 + 3 ) ) + calcresult.substring( calcresult.length - ( 4 * 1 + 3 ) ); }
    totalinvCommVR = '$' + calcresult + '.' + cents;

    calcresult = chktotalCommV
    cents = Math.floor( ( calcresult * 100 + 0.5 ) % 100 );
    calcresult = Math.floor( ( calcresult * 100 + 0.5 ) / 100 ).toString();
    if ( cents < 10 ) { cents = "0" + cents; }
    for ( i = 0; i < Math.floor( ( calcresult.length - ( 1 + i ) ) / 3 ); i++) { calcresult = calcresult.substring( 0 ,calcresult.length - (4 * 1 + 3 ) ) + calcresult.substring( calcresult.length - ( 4 * 1 + 3 ) ); }
    chktotalCommV = '$' + calcresult + '.' + cents;

    calcresult = chktotalCommVR
    cents = Math.floor( ( calcresult * 100 + 0.5 ) % 100 );
    calcresult = Math.floor( ( calcresult * 100 + 0.5 ) / 100 ).toString();
    if ( cents < 10 ) { cents = "0" + cents; }
    for ( i = 0; i < Math.floor( ( calcresult.length - ( 1 + i ) ) / 3 ); i++) { calcresult = calcresult.substring( 0 ,calcresult.length - (4 * 1 + 3 ) ) + calcresult.substring( calcresult.length - ( 4 * 1 + 3 ) ); }
    chktotalCommVR = '$' + calcresult + '.' + cents;

    if (chktotalCommV  == totalinvCommV)  {} else { alert('Vendor Commisssion is out of balance'); } 
    if (chktotalCommVR == totalinvCommVR) {} else { alert('Vendor Rep Commisssion is out of balance'); }
  }

  function chk_vendorapp_form(theForm)
  {
    if (theForm.legalname.value == '')      { alert('Please enter your Company Legal Name');              theForm.legalname.focus();	 return (false); }
    if (theForm.legalname.value.length < 3)
    {
      alert("Please enter your Company Legal Name (Minimum 3 alpha-numerics)"); theForm.legalname.focus(); return (false);
    }
    if (theForm.operatingname.value == '')  { alert('Please enter your Trading Name');                    theForm.operatingname.focus();	 return (false); }
    if (theForm.vaddress.value == '')       { alert('Please enter your Address');                         theForm.vaddress.focus();	 return (false); }
    if (theForm.vcity.value == '')          { alert('Please enter your City');                            theForm.vcity.focus();		 return (false); }
    if (theForm.vprov.value == '')          { alert('Please enter your Province');                        theForm.vprov.focus();		 return (false); }
    if (theForm.vpc.value == '')            { alert('Please enter your Postal Code');                     theForm.vpc.focus();		 return (false); }
    if (theForm.vcontact.value  == '')      { alert('Please enter your Contact Name');                    theForm.vcontact.focus();	 return (false); }
    if (theForm.vphone.value == '')         { alert('Please enter your Telephone Number');                theForm.vphone.focus();	 return (false); }
    if (theForm.vfax.value == '')           { alert('Please enter your Fax Number');                      theForm.vfax.focus();		 return (false); }
    if (theForm.vemail.value == '')         { alert('Please enter your Email Address');                   theForm.vemail.focus();	 return (false); }
    if (theForm.vwebsite.value == '')       { alert('Please enter your Website Address');                 theForm.vwebsite.focus();	 return (false); }
    if (theForm.tradearea.value  == '')     { alert('Please enter your Trading Area(s)');                 theForm.tradearea.focus();	 return (false); }
    if (theForm.employees.value  == '')     { alert('Please enter the number of employees you have');     theForm.employees.focus();	 return (false); }
    if (theForm.salespeople.value  == '')   { alert('Please enter the number of Sales People you have');  theForm.salespeople.focus();	 return (false); }
    if (theForm.equiptype.value == '')      { alert('Please enter the type of Equipment you sell');       theForm.equiptype.focus();	 return (false); }
    if (theForm.leaserelations.value == '') { alert('Please enter your current Leasing Relationships');   theForm.leaserelations.focus(); return (false); }
    if (theForm.monthlysales.value == '')   { alert('Please enter your monthly sales volume value');      theForm.monthlysales.focus();	 return (false); }
    if (theForm.avgsale.value == '')        { alert('Please enter your average sales value');             theForm.avgsale.focus();	 return (false); }
    if (theForm.manufacturers.value  == '') { alert('Please enter the manufacturers equipment you sell'); theForm.manufacturers.focus();	 return (false); }

    if (theForm.vpc.value.length < 5)
    {
      alert("Post Code too short (Minimum 5 alpha-numerics)");
      theForm.vpc.focus();
      return (false);
    }

    if (theForm.vphone.value.length < 10)
    {
      alert("Telephone Number too short (10 numerics)");
      theForm.vphone.focus();
      return (false);
    }

    if (theForm.vfax.value.length < 10)
    {
      alert("Fax Number too short (10 numerics)");
      theForm.vfax.focus();
      return (false);
    }

    var checkOK = "0123456789 -()";
    var checkStr = theForm.vphone.value;
    var allValid = true;
    var allNum = "";
    for (i = 0;  i < checkStr.length;  i++)
    {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkOK.length;  j++)
        if (ch == checkOK.charAt(j))
          break;
      if (j == checkOK.length)
      {
        allValid = false;
        break;
      }
    }
    if (!allValid)
    {
      alert("Telephone Number field contains non-numeric characters - Allowed: numerics, spaces and ( ) -");
      theForm.vphone.focus();
      return (false);
    }

    var checkOK = "0123456789 -()";
    var checkStr = theForm.vfax.value;
    var allValid = true;
    var allNum = "";
    for (i = 0;  i < checkStr.length;  i++)
    {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkOK.length;  j++)
        if (ch == checkOK.charAt(j))
          break;
      if (j == checkOK.length)
      {
        allValid = false;
        break;
      }
    }
    if (!allValid)
    {
      alert("Fax Number field contains non-numeric characters - Allowed: numerics, spaces and ( ) -");
      theForm.vfax.focus();
      return (false);
    }

    var checkOK = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-.@";
    var checkStr = theForm.vemail.value;
    var allValid  = true;
    var allemailatFormat = false;
    var allemaildotFormat = false;
    var allNum = "";
    for (i = 0;  i < checkStr.length;  i++)
    {
      ch = checkStr.charAt(i);
      if (ch == "@")
      {
       allemailatFormat = true;
      }
      if (ch == ".")
      {
       allemaildotFormat = true;
      }
      for (j = 0;  j < checkOK.length;  j++)
        if (ch == checkOK.charAt(j))
          break;
      if (j == checkOK.length)
      {
        allValid = false;
        break;
      }
    }
    if (!allValid)
    {
      alert("Email field contains non-numeric characters");
      theForm.vemail.focus();
      return (false);
    }
    if (!allemailatFormat)
    {
      alert("Email field format is invalid '@ missing': yourname@yourdomain.yourdomainextention");
      theForm.vemail.focus();
      return (false);
    }
    if (!allemaildotFormat)
    {
      alert("Email field format is invalid '. missing': yourname@yourdomain.yourdomainextention");
      theForm.vemail.focus();
      return (false);
    }

    var checkOK = "0123456789";
    var checkStr = theForm.employees.value;
    var allValid = true;
    var allNum = "";
    for (i = 0;  i < checkStr.length;  i++)
    {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkOK.length;  j++)
        if (ch == checkOK.charAt(j))
          break;
      if (j == checkOK.length)
      {
        allValid = false;
        break;
      }
    }
    if (!allValid)
    {
      alert("Number of Employees field contains non-numeric characters - Allowed: numerics");
      theForm.employees.focus();
      return (false);
    }
 
    var checkOK = "0123456789";
    var checkStr = theForm.salespeople.value;
    var allValid = true;
    var allNum = "";
    for (i = 0;  i < checkStr.length;  i++)
    {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkOK.length;  j++)
        if (ch == checkOK.charAt(j))
          break;
      if (j == checkOK.length)
      {
        allValid = false;
        break;
      }
    }
    if (!allValid)
    {
      alert("Number of Sales People field contains non-numeric characters - Allowed: numerics");
      theForm.salespeople.focus();
      return (false);
    }

    var checkOK = "0123456789.,";
    var checkStr = theForm.monthlysales.value;
    var allValid = true;
    var allNum = "";
    for (i = 0;  i < checkStr.length;  i++)
    {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkOK.length;  j++)
        if (ch == checkOK.charAt(j))
          break;
      if (j == checkOK.length)
      {
        allValid = false;
        break;
      }
    }
    if (!allValid)
    {
      alert("Monthly Sales field contains non-numeric characters - Allowed: numerics, comma and period");
      theForm.monthlysales.focus();
      return (false);
    } 

    var checkOK = "0123456789.,";
    var checkStr = theForm.avgsale.value;
    var allValid = true;
    var allNum = "";
    for (i = 0;  i < checkStr.length;  i++)
    {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkOK.length;  j++)
        if (ch == checkOK.charAt(j))
          break;
      if (j == checkOK.length)
      {
        allValid = false;
        break;
      }
    }
    if (!allValid)
    {
      alert("Average Sale field contains non-numeric characters - Allowed: numerics, comma and period");
      theForm.avgsale.focus();
      return (false);
    }

  }

  function chk_vendorapplication_form(theForm)
  {
    if (theForm.agentid.value == '')        { alert('Please select your Questor Agent / or None');        theForm.agentid.focus();	 return (false); }
    if (theForm.agentid.value == '0')       { alert('Please select your Questor Agent / or None');        theForm.agentid.focus();	 return (false); }
    if (theForm.legalname.value == '')      { alert('Please enter your Company Legal Name');              theForm.legalname.focus();	 return (false); }
    if (theForm.legalname.value.length < 3)
    {
      alert("Please enter your Company Legal Name (Minimum 3 alpha-numerics)"); theForm.legalname.focus(); return (false);
    }
    if (theForm.vaddress.value == '')       { alert('Please enter your Address');                         theForm.vaddress.focus();	 return (false); }
    if (theForm.cityid.value == '')         { alert('Please enter your City');                            theForm.cityid.focus();	 return (false); }
    if (theForm.cityid.value == '0')        { alert('Please enter your City');                            theForm.cityid.focus();	 return (false); }
    if (theForm.cityid.value == '1')        
      {
      if (theForm.vcity.value == '')          { alert('Please enter your City');                            theForm.vcity.focus();	 return (false); }
      }
    if (theForm.provinceid.value == '')     { alert('Please enter your Province');                        theForm.provinceid.focus();	 return (false); }
    if (theForm.provinceid.value == '0')    { alert('Please enter your Province');                        theForm.provinceid.focus();	 return (false); }
    if (theForm.vpc.value == '')            { alert('Please enter your Postal Code');                     theForm.vpc.focus();		 return (false); }
    if (theForm.countryid.value == '')      { alert('Please enter your Country');                         theForm.countryid.focus();	 return (false); }
    if (theForm.countryid.value == '0')     { alert('Please enter your Country');                         theForm.countryid.focus();	 return (false); }
    if (theForm.vcontactfn.value  == '')    { alert('Please enter your Contact Name');                    theForm.vcontactfn.focus();	 return (false); }
    if (theForm.vcontactln.value  == '')    { alert('Please enter your Contact Name');                    theForm.vcontactln.focus();	 return (false); }
    if (theForm.vphone.value == '')         { alert('Please enter your Telephone Number');                theForm.vphone.focus();	 return (false); }
    if (theForm.vfax.value == '')           { alert('Please enter your Fax Number');                      theForm.vfax.focus();		 return (false); }
    if (theForm.vemail.value == '')         { alert('Please enter your Email Address');                   theForm.vemail.focus();	 return (false); }
    if (theForm.bustypeid.value == '')      { alert('Please select your Business Type');                  theForm.bustypeid.focus();	 return (false); }
    if (theForm.bustypeid.value == '0')     { alert('Please select your Business Type');                  theForm.bustypeid.focus();	 return (false); }
    if (theForm.vwebsite.value == '')       { alert('Please enter your Website Address');                 theForm.vwebsite.focus();	 return (false); }
    if (theForm.tradearea.value  == '')     { alert('Please enter your Trading Area(s)');                 theForm.tradearea.focus();	 return (false); }
    if (theForm.employees.value  == '')     { alert('Please enter the number of employees you have');     theForm.employees.focus();	 return (false); }
    if (theForm.salespeople.value  == '')   { alert('Please enter the number of Sales People you have');  theForm.salespeople.focus();	 return (false); }
    if (theForm.yrsinbusid.value == '')     { alert('Please select the # of Years in business');          theForm.yrsinbusid.focus();	 return (false); }
    if (theForm.yrsinbusid.value == '0')    { alert('Please select the # of Years in business');          theForm.yrsinbusid.focus();	 return (false); }
    if (theForm.languageid.value == '')     { alert('Please select your preferred language');             theForm.languageid.focus();	 return (false); }
    if (theForm.languageid.value == '0')    { alert('Please select your preferred language');             theForm.languageid.focus();	 return (false); }
    if (theForm.equipid.value == '')        { alert('Please enter the type of Equipment you sell');       theForm.equipid.focus();	 return (false); }
    if (theForm.equipid.value == '0')       { alert('Please enter the type of Equipment you sell');       theForm.equipid.focus();	 return (false); }
    if (theForm.leaserelations.value == '') { alert('Please enter your current Leasing Relationships');   theForm.leaserelations.focus(); return (false); }
    if (theForm.monthlysales.value == '')   { alert('Please enter your monthly sales volume value');      theForm.monthlysales.focus();	 return (false); }
    if (theForm.avgsale.value == '')        { alert('Please enter your average sales value');             theForm.avgsale.focus();	 return (false); }
    if (theForm.manufacturers.value  == '') { alert('Please enter the manufacturers equipment you sell'); theForm.manufacturers.focus();	 return (false); }

    if (theForm.vpc.value.length < 5)
    {
      alert("Post Code too short (Minimum 5 alpha-numerics)");
      theForm.vpc.focus();
      return (false);
    }

    if (theForm.vphone.value.length < 10)
    {
      alert("Telephone Number too short (10 numerics)");
      theForm.vphone.focus();
      return (false);
    }

    if (theForm.vfax.value.length < 10)
    {
      alert("Fax Number too short (10 numerics)");
      theForm.vfax.focus();
      return (false);
    }

    var checkOK = "0123456789 -()";
    var checkStr = theForm.vphone.value;
    var allValid = true;
    var allNum = "";
    for (i = 0;  i < checkStr.length;  i++)
    {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkOK.length;  j++)
        if (ch == checkOK.charAt(j))
          break;
      if (j == checkOK.length)
      {
        allValid = false;
        break;
      }
    }
    if (!allValid)
    {
      alert("Telephone Number field contains non-numeric characters - Allowed: numerics, spaces and ( ) -");
      theForm.vphone.focus();
      return (false);
    }

    var checkOK = "0123456789 -()";
    var checkStr = theForm.vfax.value;
    var allValid = true;
    var allNum = "";
    for (i = 0;  i < checkStr.length;  i++)
    {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkOK.length;  j++)
        if (ch == checkOK.charAt(j))
          break;
      if (j == checkOK.length)
      {
        allValid = false;
        break;
      }
    }
    if (!allValid)
    {
      alert("Fax Number field contains non-numeric characters - Allowed: numerics, spaces and ( ) -");
      theForm.vfax.focus();
      return (false);
    }

    var checkOK = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-.@";
    var checkStr = theForm.vemail.value;
    var allValid  = true;
    var allemailatFormat = false;
    var allemaildotFormat = false;
    var allNum = "";
    for (i = 0;  i < checkStr.length;  i++)
    {
      ch = checkStr.charAt(i);
      if (ch == "@")
      {
       allemailatFormat = true;
      }
      if (ch == ".")
      {
       allemaildotFormat = true;
      }
      for (j = 0;  j < checkOK.length;  j++)
        if (ch == checkOK.charAt(j))
          break;
      if (j == checkOK.length)
      {
        allValid = false;
        break;
      }
    }
    if (!allValid)
    {
      alert("Email field contains non-numeric characters");
      theForm.vemail.focus();
      return (false);
    }
    if (!allemailatFormat)
    {
      alert("Email field format is invalid '@ missing': yourname@yourdomain.yourdomainextention");
      theForm.vemail.focus();
      return (false);
    }
    if (!allemaildotFormat)
    {
      alert("Email field format is invalid '. missing': yourname@yourdomain.yourdomainextention");
      theForm.vemail.focus();
      return (false);
    }

    var checkOK = "0123456789";
    var checkStr = theForm.employees.value;
    var allValid = true;
    var allNum = "";
    for (i = 0;  i < checkStr.length;  i++)
    {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkOK.length;  j++)
        if (ch == checkOK.charAt(j))
          break;
      if (j == checkOK.length)
      {
        allValid = false;
        break;
      }
    }
    if (!allValid)
    {
      alert("Number of Employees field contains non-numeric characters - Allowed: numerics");
      theForm.employees.focus();
      return (false);
    }
 
    var checkOK = "0123456789";
    var checkStr = theForm.salespeople.value;
    var allValid = true;
    var allNum = "";
    for (i = 0;  i < checkStr.length;  i++)
    {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkOK.length;  j++)
        if (ch == checkOK.charAt(j))
          break;
      if (j == checkOK.length)
      {
        allValid = false;
        break;
      }
    }
    if (!allValid)
    {
      alert("Number of Sales People field contains non-numeric characters - Allowed: numerics");
      theForm.salespeople.focus();
      return (false);
    }

    var checkOK = "0123456789.,";
    var checkStr = theForm.monthlysales.value;
    var allValid = true;
    var allNum = "";
    for (i = 0;  i < checkStr.length;  i++)
    {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkOK.length;  j++)
        if (ch == checkOK.charAt(j))
          break;
      if (j == checkOK.length)
      {
        allValid = false;
        break;
      }
    }
    if (!allValid)
    {
      alert("Monthly Sales field contains non-numeric characters - Allowed: numerics, comma and period");
      theForm.monthlysales.focus();
      return (false);
    } 

    var checkOK = "0123456789.,";
    var checkStr = theForm.avgsale.value;
    var allValid = true;
    var allNum = "";
    for (i = 0;  i < checkStr.length;  i++)
    {
      ch = checkStr.charAt(i);
      for (j = 0;  j < checkOK.length;  j++)
        if (ch == checkOK.charAt(j))
          break;
      if (j == checkOK.length)
      {
        allValid = false;
        break;
      }
    }
    if (!allValid)
    {
      alert("Average Sale field contains non-numeric characters - Allowed: numerics, comma and period");
      theForm.avgsale.focus();
      return (false);
    }

  }

  function checkappco()
  {

  if (document.appform.languageid.options[document.appform.languageid.selectedIndex].value == 0)                       { alert("Please select your language preference");                      document.appform.languageid.focus(); return false; }
  if (document.appform.agentid.options[document.appform.agentid.selectedIndex].value == 0)                             { alert("Please select your assigned Questor Agent or 'None' if you do not yet have one"); document.appform.agentid.focus();  return false; }
  if (document.appform.customer.value == "")     { alert("Please enter your personal / organization's legal name");     document.appform.customer.focus();     return false; }
  if (document.appform.address.value == "")      { alert("Please enter your address");                                  document.appform.address.focus();      return false; }
  if (document.appform.cityid.options[document.appform.cityid.selectedIndex].value == 0)                               { alert("Please select your city");                                     document.appform.cityid.focus();     return false; }
  if (document.appform.cityid.options[document.appform.cityid.selectedIndex].value == 1)
  {
  if (document.appform.city.value == "")         { alert("Please enter your city");                                     document.appform.city.focus();         return false; }
  }
  if (document.appform.provinceid.options[document.appform.provinceid.selectedIndex].value == 0)                       { alert("Please select your province/state");                           document.appform.provinceid.focus(); return false; }
  if (document.appform.countryid.options[document.appform.countryid.selectedIndex].value == 0)                         { alert("Please select your country");                                  document.appform.countryid.focus();  return false; }
  if (document.appform.pc.value == "")           { alert("Please enter your postal/zip code");                          document.appform.pc.focus();           return false; }
  if (document.appform.phone.value == "")        { alert("Please enter your full 10 digit telephone number");           document.appform.phone.focus();        return false; }
  if (document.appform.phone.value.length < 10)  { alert("Please enter your full 10 digit telephone number");           document.appform.phone.focus();        return false; }
  if (document.appform.cfname.value == "")       { alert("Please enter your contact first name");                       document.appform.cfname.focus();       return false; }
  if (document.appform.clname.value == "")       { alert("Please enter your contact first name");                       document.appform.clname.focus();       return false; }
  if (document.appform.cemail.value == "")       { alert("Please enter your contact email address");                    document.appform.cemail.focus();       return false; }
  if (document.appform.titleid.options[document.appform.titleid.selectedIndex].value == 0)                             { alert("Please select your title");                                    document.appform.titleid.focus();    return false; }
  if (document.appform.bustypeid.options[document.appform.bustypeid.selectedIndex].value == 0)                         { alert("Please select your business classification");                  document.appform.bustypeid.focus();  return false; }
  if (document.appform.yrsinbusid.options[document.appform.yrsinbusid.selectedIndex].value == 0)                       { alert("Please select the number of years you have been in business"); document.appform.yrsinbusid.focus(); return false; }
  if (document.appform.industrytype.value == "") { alert("Please enter your industry type. eg Finance, Manufacturing"); document.appform.industrytype.focus(); return false; }
  if (document.appform.employees.value == "")    { alert("Please enter the number of employees");                       document.appform.employees.focus();    return false; }
  if (document.appform.annsales.value == "")     { alert("Please enter the value of your annual sales");                document.appform.annsales.focus();     return false; }
  if (document.appform.sameaddr.options[document.appform.sameaddr.selectedIndex].value == 0)                           { alert("Please confirm the equipment location");                       document.appform.sameaddr.focus();   return false; }

  if (document.appform.equipdesc.value == "")    { alert("Please enter the equipment description");                     document.appform.equipdesc.focus();    return false; }
  if (document.appform.equipcost.value == "")    { alert("Please enter the equipment cost");                            document.appform.equipcost.focus();    return false; }

  if (document.appform.sameaddr.options[document.appform.sameaddr.selectedIndex].value == 'N')
    { 

    document.getElementById('elocninfo').style.display='block';

    if (document.appform.eaddress.value == "")   { alert("Please enter your equipment location address");               document.appform.eaddress.focus();     return false; }
    if (document.appform.ecityid.options[document.appform.ecityid.selectedIndex].value == 0)                            { alert("Please select your equipment location city");                 document.appform.ecityid.focus();     return false; }
    if (document.appform.ecityid.options[document.appform.ecityid.selectedIndex].value == 1)
    {
    if (document.appform.ecity.value == "")      { alert("Please enter your equipment location city");                  document.appform.ecity.focus();         return false; }
    }
    if (document.appform.eprovinceid.options[document.appform.provinceid.selectedIndex].value == 0)                    { alert("Please select your equipment location province/state"); document.appform.eprovinceid.focus(); return false; }
    if (document.appform.ecountryid.options[document.appform.countryid.selectedIndex].value == 0)                      { alert("Please select your equipment location country");        document.appform.ecountryid.focus();  return false; }
    if (document.appform.epc.value == "")        { alert("Please enter your equipment location postal/zip code");       document.appform.epc.focus();          return false; }
    }

/*  if (document.appform.yrsinbusid.options[document.appform.yrsinbusid.selectedIndex].value < 4) */
/*    { */
/*    if (document.appform.bankid.options[document.appform.bankid.selectedIndex].value == 0)                             { alert("Please select your bank");  document.appform.bankid.focus();  return false; } */
/*    if (document.appform.bcname.value == "")    { alert("Please enter your bank's contact name");                      document.appform.bcname.focus();     return false; } */
/*    if (document.appform.bphone.value == "")    { alert("Please enter your bank's 10 digit telephone number");         document.appform.bphone.focus();     return false; } */
/*    if (document.appform.bemail.value == "")    { alert("Please enter your bank contact's email address");             document.appform.bemail.focus();     return false; } */
/*    if (document.appform.bacct.value == "")     { alert("Please enter your bank account number");                      document.appform.bacct.focus();      return false; } */
/*    }  */

  }

  function checkapppr()
  {
  if (document.appform.shfname1.value == "")   { alert("Please enter First Name");                     document.appform.shfname1.focus();      return false; }
  if (document.appform.shlname1.value == "")   { alert("Please enter Last Name");                      document.appform.shlname1.focus();      return false; }
  if (document.appform.shaddress1.value == "") { alert("Please enter Address");                        document.appform.shaddress1.focus();    return false; }
  if (document.appform.shcityid1.options[document.appform.shcityid1.selectedIndex].value == 0)         { alert("Please select your city"); document.appform.shcityid1.focus();     return false; }
  if (document.appform.shcityid1.options[document.appform.shcityid1.selectedIndex].value == 1)
  {
  if (document.appform.shcity1.value == "")    { alert("Please enter your city");                      document.appform.shcity1.focus();       return false; }
  }
  if (document.appform.shprovinceid1.options[document.appform.shprovinceid1.selectedIndex].value == 0) { alert("Please select Province/State");      document.appform.shprovinceid1.focus(); return false; }
  if (document.appform.shpc1.value == "")      { alert("Please enter Postal/Zip Code");                document.appform.shpc1.focus();         return false; }
  if (document.appform.shcountryid1.options[document.appform.shcountryid1.selectedIndex].value == 0)   { alert("Please select Country");             document.appform.shcountryid1.focus();  return false; }
  if (document.appform.shphone1.value == "")   { alert("Please enter Phone Number");                   document.appform.shphone1.focus();      return false; }
  if (document.appform.shphone1.value.length < 10) { alert("Please enter your full 10 digit telephone number");           document.appform.shphone1.focus();      return false; }
  if (document.appform.shhouse1.value == "")   { alert("Please enter House Value");                    document.appform.shhouse1.focus();      return false; }
  if (document.appform.shmtg1.value == "")     { alert("Please enter Mortgage Balance");               document.appform.shmtg1.focus();        return false; }
  if (document.appform.shsin1.value == "")     { alert("Please enter SIN Number");                     document.appform.shsin1.focus();        return false; }
  if (document.appform.shdob1.value == "")     { alert("Please enter Date of Birth");                  document.appform.shdob1.focus();        return false; }
  if (document.appform.showner1.value == "")   { alert("Please enter Ownership Percentage");           document.appform.showner1.focus();      return false; }
  if (document.appform.shincome1.value == "")  { alert("Please enter Annual Income ");                 document.appform.shincome1.focus();     return false; }
  if (document.appform.shindid1.options[document.appform.shindid1.selectedIndex].value == 0)           { alert("Please select Industry");            document.appform.shindid1.focus();      return false; }
  if (document.appform.shexpyrid1.options[document.appform.shexpyrid1.selectedIndex].value == 0)       { alert("Please select Years of Experience"); document.appform.shexpyrid1.focus();    return false; }
  }

  function checkappex()
  {
  if (document.appform.shareholderdetails.value == "")       { alert("Please enter Shareholder Details");         document.appform.shareholderdetails.focus();      return false; }
  /* if (document.appform.shareholderexperience.value == "") { alert("Please enter Details");                     document.appform.shareholderexperience.focus();   return false; } */
  if (document.appform.keyofficerdetails.value == "")        { alert("Please enter Key Officer Details");         document.appform.keyofficerdetails.focus();       return false; }
  /* if (document.appform.companydetails.value == "")        { alert("Please enter Company Details");             document.appform.companydetails.focus();          return false; } */
  /* if (document.appform.operationdetails.value == "")      { alert("Please enter Details");                     document.appform.operationdetails.focus();        return false; } */
  if (document.appform.acquisitiondetails.value == "")       { alert("Please enter Purpose of Acquisition");      document.appform.acquisitiondetails.focus();      return false; }
  /* if (document.appform.additionalinformation.value == "") { alert("Please enter Details");                     document.appform.additionalinformation.focus();   return false; } */
  }

  function checkappcs()
  {
  if (document.appform.signedby.value == "")    { alert("Please enter the Authorizing Officer's name");     document.appform.signedby.focus();   return false; }
  }

//-->
