 function dater(theField)
 {
        // Date Validator
        //  only if IE v4.0 > and Netscape 3.0 >
        browserName = navigator.appName;
        browserVer = parseInt(navigator.appVersion);

        if (( browserVer >= 3)&&( browserName == "Netscape" )) {
           doit = "Yup";
        }
        else if (( browserVer >= 4)&&( browserName == "Microsoft Internet Explorer" )) {
           doit = "Yup";
        }
        else doit = "NoWay";

        if (doit == "Yup")  {
 
          if (theField.value != "")  {
          
            stLength = theField.value.length;
            newdate = new String ( "" );
            strTest = new String ( "" );
            counter = 0;
            ind1 = 0;
  
            if ( (theField.value.charAt(ind1) >= "0") && (theField.value.charAt(ind1) <= "9") && ((theField.value.charAt(ind1+1) == "-") || (theField.value.charAt(ind1+1) == "/")) ) {
                  newdate += "0";
                  newdate += theField.value.charAt(ind1);
                  counter += 2;
                  ind1 = 1;
            }
            else {  
                 for ( var ind1 = 0; ((counter < 2)&&( ind1 < stLength )); ind1++ )  {
                     if ((theField.value.charAt(ind1) >= "0") && (theField.value.charAt(ind1) <= "9")) {
                        newdate += theField.value.charAt(ind1);
                        counter ++;
                     }
                 }
            }
            newdate += "/";
            if ( (theField.value.charAt(ind1+1) >= "0") && (theField.value.charAt(ind1+1) <= "9") && ((theField.value.charAt(ind1+2) == "-") || (theField.value.charAt(ind1+2) == "/")) ) {
                  newdate += "0";
                  newdate += theField.value.charAt(ind1+1);
                  counter += 2;
                  ind1 += 2;
            }
            else {  
               for ( var ind2 = 0; ((counter < 4)&&( ind1 < stLength )); ind1++ )  {
                   if ((theField.value.charAt(ind1) >= "0") && (theField.value.charAt(ind1) <= "9")) {
                          newdate += theField.value.charAt(ind1);
                          counter ++;
                   }
               }
            }
            newdate += "/";
            if ( ((ind1+3) == stLength) && (theField.value.charAt(ind1+1) >= "0") && (theField.value.charAt(ind1+1) <= "9") && (theField.value.charAt(ind1+2) >= "0") && (theField.value.charAt(ind1+2) <= "9") ) {
                  strTest = theField.value.charAt(ind1+1) + theField.value.charAt(ind1+2);
                  if (  strTest < "32" ) {
                       newdate += "20";
                  }
                  else {
                       newdate += "19";
                  }
                  newdate +=  theField.value.charAt(ind1+1) + theField.value.charAt(ind1+2);
                  counter += 4;
            }
            else {
                for ( var ind3 = 0; ((counter < 8)&&( ind1 < stLength )); ind1++ )  {
                   if ((theField.value.charAt(ind1) >= "0") && (theField.value.charAt(ind1) <= "9")) {
                      newdate += theField.value.charAt(ind1);
                      counter ++;
                   }
                }
            }
            
            theField.value = newdate;
            
            if ( newdate.length != 10)
            {
               alert("Please enter your date in this format: mm/dd/yyyy including a 4 digit year.");
               theField.focus();
               return (false);
            }
           }
           return (true);
       }
    return (true);
}