<!-- Begin //QUALIFY CUSTOMER ID FIELD

function checkID(why)
{
   //FIX ID
   document.idportal.CustomerID.value = document.idportal.CustomerID.value.toUpperCase()
    
   //STORE VARIABLES
   var IDlength = document.idportal.CustomerID.value.length
   var IDval = document.idportal.CustomerID.value.toUpperCase()
   var trueID1 = IDval.indexOf('-')
   var IDnums1 = IDval.charAt(4)
   var IDnums2 = IDval.charAt(5)
   var generalError = 0
   
   //IF THERE IS NO WHEREGO VALUE


   if (document.idportal.wherego.value == NaN)
     {var gowherego = 0}
   else
     {var gowherego = document.idportal.wherego.value}
 
   //IF THERE ARE NOT 6 CHARACTERS
   if (IDlength < 6)
  {alert('Your Customer ID must be exactly 6 characters including a Hyphen "-"'); return false}
   
    //IF THERE IS NO HYPHEN
   if (trueID1 == -1)
   {alert('Your Customer ID should be in the format "ZZZ-01."  Your Hyphen "-" is missing.'); return false}

    //IF THE HYPHEN IS MISPLACED
   if (trueID1 != 3)
   {alert('Your Customer ID should be in the format "ZZZ-01."  Your Hyphen "-" is misplaced.'); return false}

   //CHECK LAST 2 CHARACTERS OF ID FOR NUMERIC VALUES
   if (isNaN(IDnums1) || isNaN(IDnums2))
   {alert('Your Customer ID should be in the format "ZZZ-01."  Your last 2 characters must be numbers.'); return false}
   
   
   //IF CUSTOMER ID PASSES THE LABYRINTH OF REQUIREMENTS, LET THEM PASS
   
   if (gowherego == 0)
   {location = "http://www.creatingcommunity.net/advertising2.html?CustomerID="
    ; return false}
   
   if (gowherego == 1)
   {location = "https://creatingcommunity.net/submitlisting.html?CustomerID="
  ; return false}
    
   if (gowherego == 2)
   {location = "https://creatingcommunity.net/displayadmenu.html?CustomerID="
   ; return false}
	
   if (gowherego == 3)
   {location = "https://creatingcommunity.net/classifieds.html?CustomerID="
   ; return false}

  //if none
  // {location = "http://www.creatingcommunity.net/advertising2.html?CustomerID="
   // + document.idportal.CustomerID.value; return false}
 
}

//  End -->
