var errorMsg;

function getTodayString()
   {
   // returns today date in mm/dd/yy format
   var today = new Date();
   return (today.getMonth() + 1) + "/" + today.getDate() + "/" + today.getFullYear();
   }

function trim(s)
   {
   var result = "";
   var last = 0;

   if (s != null)
      {
      for (i = 0; i < s.length; i++)
         {
         if (s.charAt(i) != ' ')
            {
            if (last == 0)
               last = i;

            // We need to catch up since we last copied.
            for (; last <= i; last++)
               result += s.charAt(last);
            }
         }
      }

   return result;
   }

function isEmpty(sString1)
   {
   var fReturn = false;

   sString1 = trim(sString1);

   if ((sString1 == null) || (sString1.length == 0))
      fReturn = true;

   return fReturn;
   }

function checkDate(sString1, fRequired)
   {
   var fResult = true;

   sString1 = trim(sString1);

   if (isEmpty(sString1))
      {
      if (fRequired == true)
         {
         fResult = false;
         errorMsg = "Please enter the date using digits, with no blank spaces\nusing the format: mm/dd/yyyy";
         }
      }
   else
      {
      // Is sDate in mm/dd/yyyy Format?

      var regexpDateFormat = /^((0)?[1-9]|1[0-2])\/((0)?[1-9]|[1-2]\d|3[0-1])\/(19|20)\d\d$/;

      if (!regexpDateFormat.test(sString1))
         {
         fResult = false;
         errorMsg = "Please enter the date using digits, with no blank spaces\nusing the format: mm/dd/yyyy";
         }

      else
         {
         // Parse User's sString1 Into Month, Day, Year

         var iSlash1   = sString1.indexOf("index.html");
         var iSlash2   = sString1.indexOf("index.html", (iSlash1+ 1));
         var sUMonth   = sString1.slice(0,iSlash1);
         var sUDay     = sString1.slice((iSlash1 + 1), iSlash2);
         var sUYear    = sString1.slice((iSlash2 + 1), sString1.length);

         // Make sure the number of days is correct for the month.

         switch (sUMonth)
            {
            case "1":
            case "01":
            case "3":
            case "03":
            case "5":
            case "05":
            case "7":
            case "07":
            case "8":
            case "08":
            case "10":
            case "12":
               {
               if (sUDay > 31)
                  fResult = false;

               break;
               }

            case "2":
            case "02":
            case "4":
            case "04":
            case "6":
            case "06":
            case "9":
            case "09":
            case "11":
               {
               if (sUDay > 30)
                  fResult = false;

               break;
               }
            } // end switch

         if (fResult == false)
            {
            errorMsg = "The entered month does not have this many days.";
            }
         else
            {
            // If The User Thinks It Is Leap Year And It Is Not

            if ((sUMonth == "2") && (sUDay == "29"))
               {
               if (sUYear % 4 != 0)
                  {
                  errorMsg = "February 29 in not a valid date in a non-leap year";
                  fResult = false;
                  }
               else if (!(sUYear % 400 == 0) && (sYear % 100 == 0))
                  {
                  errorMsg = "February 29 in not a valid date in a non-leap year";
                  fResult = false;
                  }
               }
            }
         }
      }

   return fResult;
   } // end checkDate

function checkDateRange(sDate1, sDate2, numdays)
   {
   // Check if sDate2 is within numdays of sDate1.
   // Note that this functions assumes both dates are valid.  Use checkDate()
   // to check the validity of each date string.

   var fResult = true;

   sDate1 = trim(sDate1);
   sDate2 = trim(sDate2);

   var MilliDate1 = Date.parse(sDate1);
   var MilliDate2 = Date.parse(sDate2);

   var difference = MilliDate2 - MilliDate1;

   if (difference > (numdays * 86400000))
      {
      fResult = false;
      errorMsg = "End date is greater than " + numdays + " days from start date."
      }

   return fResult;
   } // end function checkDateRange

function checkAlpha(sString1, fRequired)
   {
   var fResult = true;
   var regexpAlpha = /^[a-zA-Z ]+$/;

   sString1 = trim(sString1);

   if (isEmpty(sString1))
      {
      if (fRequired == true)
         {
         fResult = false;
         errorMsg = "String must contain only alphabetic characters.";
         }
      }
   else
      {
      if (!regexpAlpha.test(sString1))
         {
         fResult = false;
         errorMsg = "String must contain only alphabetic characters.";
         }
      }

   return fResult;
   } // end checkAlpha

function checkAlphaWithSpaces(sString1, fRequired)
   { // this one allows embedded spaces (but not a string with all spaces)
   var fResult = true;
   var regexpAlpha = /^[a-zA-Z ]+$/;
   var regexpAllSpaces = /^[ ]+$/;

   sString1 = trim(sString1);

   if (isEmpty(sString1))
      {
      if (fRequired == true)
         {
         fResult = false;
         errorMsg = "String must contain only alphabetic characters.";
         }
      }
   else
      {
      if ((!regexpAlpha.test(sString1)) || (regexpAllSpaces.test(sString1)))
         {
         fResult = false;
         errorMsg = "String must contain only alphabetic characters.";
         }
      }

   return fResult;
   } // end checkAlphaWithSpaces

function checkAlphaDigits(sString1, fRequired)
   {
   var fResult = true;
   var regexpAlphaDigits = /^[a-zA-Z0-9-]+$/;

   sString1 = trim(sString1);

   if (isEmpty(sString1))
      {
      if (fRequired == true)
         {
         fResult = false;
         errorMsg = "String must contain alphabetic or numeric characters.";
         }
      }
   else
      {
      if (!regexpAlphaDigits.test(sString1))
         {
         fResult = false;
         errorMsg = "String must contain alphabetic or numeric characters.";
         }
      }

   return fResult;
   } // end checkAlphaDigits

function checkAlphaDigitsWithSpaces(sString1, fRequired)
   { // this one allows embedded spaces (but not a string with all spaces)
   var fResult = true;
   var regexpAlphaDigits = /^[a-zA-Z0-9- ]+$/;
   var regexpAllSpaces = /^[ ]+$/;

   sString1 = trim(sString1);

   if (isEmpty(sString1))
      {
      if (fRequired == true)
         {
         fResult = false;
         errorMsg = "String must contain alphabetic or numeric characters.";
         }
      }
   else
      {
      if ((!regexpAlphaDigits.test(sString1)) || (regexpAllSpaces.test(sString1)))
         {
         fResult = false;
         errorMsg = "String must contain alphabetic or numeric characters.";
         }
      }

   return fResult;
   } // end checkAlphaDigitsWithSpaces

function checkPrintable(sString1, fRequired)
   {
   var fResult = true;

   sString1 = trim(sString1);

   if (isEmpty(sString1))
      {
      if (fRequired == true)
         {
         fResult = false;
         errorMsg = "String must contain only printable characters.";
         }
      }
   return fResult;
   } // end checkPrintable

function checkPrintableWithSpaces(sString1, fRequired)
   { // this one allows embedded spaces (but not a string with all spaces)
   var fResult = true;
   var regexpAllSpaces = /^[ ]+$/;

   sString1 = trim(sString1);

   if (isEmpty(sString1))
      {
      if (fRequired == true)
         {
         fResult = false;
         errorMsg = "String must contain only printable characters.";
         }
      }
   else
      {
      if ((regexpAllSpaces.test(sString1)))
         {
         fResult = false;
         errorMsg = "String must contain only printable characters.";
         }
      }

   return fResult;
   } // end checkPrintableWithSpaces

function checkDigits(sString1, fRequired)
   {
   var fResult = true;
   var regexpDigits = /^\d+$/;

   sString1 = trim(sString1);

   if (isEmpty(sString1))
      {
      if (fRequired == true)
         {
         fResult = false;
         errorMsg = "String must contain only numeric characters.";
         }
      }
   else
      {
      if (!regexpDigits.test(sString1))
         {
         fResult = false;
         errorMsg = "String must contain only numeric characters.";
         }
      }

   return fResult;
   } // end checkDigits

function checkIPAddress(sString1, fRequired)
   {
   var fResult = true;
   var regexpIPAddress = /^\d{1,3}(\.)\d{1,3}(\.)\d{1,3}(\.)\d{1,3}$/;

   sString1 = trim(sString1);

   if (isEmpty(sString1))
      {
      if (fRequired == true)
         {
         fResult = false;
         errorMsg = "String must contain an IP address of the form 999.999.999.999";
         }
      }
   else
      {
      if (!regexpIPAddress.test(sString1))
         {
         fResult = false;
         errorMsg = "String must contain an IP address of the form 999.999.999.999";
         }
      }

   return fResult;
   } // end checkIPAddress

function checkIPAddressWithMask(sString1, fRequired)
   {
   var fResult = true;
   var regexpIPAddress = /^\d{1,3}(\.)\d{1,3}(\.)\d{1,3}(\.)\d{1,3}\/[0123][0-9]$/;

   sString1 = trim(sString1);

   if (isEmpty(sString1))
      {
      if (fRequired == true)
         {
         fResult = false;
         errorMsg = "String must contain an address/mask of the form 999.999.999.999/99.  A valid IP address is required left of the slash, and a mask value between 00-32 is required right of the slash.";
         }
      }
   else
      {
      if (!regexpIPAddress.test(sString1))
         {
         fResult = false;
         errorMsg = "String must contain an address/mask of the form 999.999.999.999/99.  A valid IP address is required left of the slash, and a mask value between 00-32 is required right of the slash.";
         }
      }

   return fResult;
   } // end checkIPAddressWithMask

function checkNpaNxx(sString1, fRequired)
   {
   var fResult = true;
   var regexpNPANXX = /^\d{3}-\d{3}$/;

   sString1 = trim(sString1);

   if (isEmpty(sString1))
      {
      if (fRequired == true)
         {
         fResult = false;
         errorMsg = "String must contain an NPA-NXX address of the form 999-999";
         }
      }
   else
      {
      if (!regexpNPANXX.test(sString1))
         {
         fResult = false;
         errorMsg = "String must contain an NPA-NXX address of the form 999-999";
         }
      }

   return fResult;
   } // end checkNpaNxx

function checkPhone(sString1, fRequired)
   {
   var fResult = true;
   var regexpPhoneNum = /^\d{3}-\d{3}-\d{4}$/;
   var regexpPhoneNumA = /^((\d{3}))\d{3}-\d{4}$/;
   sString1 = trim(sString1);

   if (isEmpty(sString1))
      {
      if (fRequired == true)
         {
         fResult = false;
         //errorMsg = "String must contain a phone number of the form 999-999-9999 OR (999)999-9999 \n should not be empty";
		 errorMsg = "String must contain a phone number of the form 999-999-9999 \n should not be empty";
         }
      }
   else
      {
      if ( ! (  regexpPhoneNum.test(sString1) )   )
         {
         fResult = false;
         //errorMsg = "String must contain a phone number of the form 999-999-9999 OR (999)999-9999";
		 errorMsg = "String must contain a phone number of the form 999-999-9999";
         }
      }

   return fResult;
   } // end checkPhone

   function checkPhone2(sString1, fRequired)
   {
   var fResult = true;
   var regexpPhoneNum = /^\d{3}-\d{3}-\d{4}$/;
   var regexpPhoneNumA = /^((\d{3}))\d{3}-\d{4}$/;
   sString1 = trim(sString1);

   if (isEmpty(sString1))
      {
      if (fRequired == true)
         {
         fResult = false;
         //errorMsg = "String must contain a phone number of the form 999-999-9999 OR (999)999-9999 \n should not be empty";
		 errorMsg = "String must contain a phone number of the form (999)999-9999 \n should not be empty";
         }
      }
   else
      {
      if ( ! (  regexpPhoneNumA.test(sString1) )   )
         {
         fResult = false;
         //errorMsg = "String must contain a phone number of the form 999-999-9999 OR (999)999-9999";
		 errorMsg = "String must contain a phone number of the form (999)999-9999";
         }
      }

   return fResult;
   } // end checkPhone

function checkPhoneAndExt(sString1, fRequired)
   {
   var fResult = true;
   var regexpPhoneNum = /^\d{3}-\d{3}-\d{4}( (x|X)\d{1,5})?$/;

   sString1 = trim(sString1);

   if (isEmpty(sString1))
      {
      if (fRequired == true)
         {
         fResult = false;
         errorMsg = "String must contain a phone number and optional extension of the form 999-999-9999 x99999";
         }
      }
   else
      {
      if (!regexpPhoneNum.test(sString1))
         {
         fResult = false;
         errorMsg = "String must contain a phone number and optional extension of the form 999-999-9999 x99999";
         }
      }

   return fResult;
   } // end checkPhoneAndExt

function checkEmail(sString1, fRequired)
   {
   var fResult = true;
   var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
   var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");

   sString1 = trim(sString1);

   if (isEmpty(sString1))
      {
      if (fRequired == true)
         {
         fResult = false;
         errorMsg = "String must contain a valid email address form xxx@yyy.zzz";
         }
      }
   else
      {
      if (!((!r1.test(sString1) && r2.test(sString1))))
         {
         fResult = false;
         errorMsg = "String must contain a valid email address form xxx@yyy.zzz";
         }
      }

   return fResult;
   } // end checkEmail

function checkUSZip(sString1, fRequired)
   {
   var fResult = true;
   var regexpZip = /^\d{5}(-\d{4})?$/;

   sString1 = trim(sString1);

   if (isEmpty(sString1))
      {
      if (fRequired == true)
         {
         fResult = false;
         errorMsg = "String must contain a U.S. zip code form 99999 or 99999-9999";
         }
      }
   else
      {
      if (!regexpZip.test(sString1))
         {
         fResult = false;
         errorMsg = "String must contain a U.S. zip code form 99999 or 99999-9999";
         }
      }

   return fResult;
   } // end checkUSZip

function checkUSState(sString1, fRequired)
   {
   var fResult = true;

   sString1 = trim(sString1);

   if (isEmpty(sString1) || (sString1 == "__"))
      {
      if (fRequired == true)
         {
         fResult = false;
         errorMsg = "Must select a state";
         }
      }

   return fResult;
   } // end checkUSState

function checkCurrency(sString1, leftOfDecimal, rightOfDecimal, fRequired)
   {
   var fResult = true;
   var regexp = "^\\d{1," + leftOfDecimal + "}(\\.\\d{" + rightOfDecimal + "})?$";
   var regexpFloat = new RegExp(regexp);

   sString1 = trim(sString1);

   if (isEmpty(sString1))
      {
      if (fRequired == true)
         {
         fResult = false;
         errorMsg = "String must contain currency with up to " + leftOfDecimal + " digits to the left of the decimal point and optionally " + rightOfDecimal + " digits to the right.";
         }
      }
   else
      {
      if (!regexpFloat.test(sString1))
         {
         fResult = false;
         errorMsg = "String must contain currency with up to " + leftOfDecimal + " digits to the left of the decimal point and optionally " + rightOfDecimal + " digits to the right.";
         }
      }

   return fResult;
   } // end checkCurrency

function checkUSCurrency(sString1, leftOfDecimal, fRequired)
   {
   var fResult = true;
   var regexp = "^\\d{1," + leftOfDecimal + "}(\\.\\d{0,2})?$";
   var regexpFloat = new RegExp(regexp);

   sString1 = trim(sString1);

   if (isEmpty(sString1))
      {
      if (fRequired == true)
         {
         fResult = false;
         errorMsg = "String must contain a dollar amount with up to " + leftOfDecimal + " digits to the left of the decimal point.  Do not include the dollar sign ($).  Examples: 23.45 and 67";
         }
      }
   else
      {
      if (!regexpFloat.test(sString1))
         {
         fResult = false;
         errorMsg = "String must contain a dollar amount with up to " + leftOfDecimal + " digits to the left of the decimal point.  Do not include the dollar sign ($).  Examples: 23.45 and 67";
         }
      }

   return fResult;
   } // end checkUSCurrency

function checkPercentage(sString1, leftOfDecimal, fRequired)
   {
   var fResult = true;
   var regexp = "^\\d{1," + leftOfDecimal + "}(\\.\\d{0,2})?$";
   var regexpFloat = new RegExp(regexp);

   sString1 = trim(sString1);

   if (isEmpty(sString1))
      {
      if (fRequired == true)
         {
         fResult = false;
         errorMsg = "String must contain a percentage amount with up to " + leftOfDecimal + " digits to the left of the decimal point.  Do not include the percentage sign (%).  Examples: 23.45 and 67";
         }
      }
   else
      {
      if (!regexpFloat.test(sString1))
         {
         fResult = false;
         errorMsg = "String must contain a percentage amount with up to " + leftOfDecimal + " digits to the left of the decimal point.  Do not include the percentage sign (%).  Examples: 23.45 and 67";
         }
      }

   return fResult;
   } // end checkPercentage


function txtTrim(txtObject)
   {
   if (txtObject != null)
      {
      txtObject.value = trim(txtObject.value);
      }
   }
   
function isMyEmpty(sString1)
   {
   var fReturn = false;

   sString1 = trim(sString1);

   if ((sString1 == null) || (sString1.length == 0))
      fReturn = true;

   errorMsg = "Please enter the data, with no blank spaces";
   
   return fReturn;
   }

function txtIsEmpty(txtObject)
   {
   txtTrim(txtObject);
   return(isEmpty(txtObject.value));
   }

function txtIsNull(txtObject, fRequired, strErrorMessagePrefix)
   {
   txtTrim(txtObject);
   
   if(fRequired && isMyEmpty(txtObject.value))
   {
         alert(strErrorMessagePrefix + errorMsg);
         txtObject.focus();
         return false;
   }
   return true;
   }

function txtCheckDate(txtObject, fRequired, strErrorMessagePrefix)
   {
   txtTrim(txtObject);

   if (!checkDate(txtObject.value, fRequired))
      {
      alert(strErrorMessagePrefix + errorMsg);
      txtObject.focus();
      return false;
      }

   return true;
   } // end txtCheckDate

function txtCheckAlpha(txtObject, fRequired, strErrorMessagePrefix)
   {
   txtTrim(txtObject);

   if (!checkAlpha(txtObject.value, fRequired))
      {
      alert(strErrorMessagePrefix + errorMsg);
      txtObject.focus();
      return false;
      }

   return true;
   } // end checkAlpha

function txtCheckAlphaWithSpaces(txtObject, fRequired, strErrorMessagePrefix)
   { // this one allows embedded spaces (but not a string with all spaces)
   txtTrim(txtObject);

   if (!checkAlphaWithSpaces(txtObject.value, fRequired))
      {
      alert(strErrorMessagePrefix + errorMsg);
      txtObject.focus();
      return false;
      }

   return true;
   } // end txtCheckAlphaWithSpaces

function txtCheckAlphaDigits(txtObject, fRequired, strErrorMessagePrefix)
   {
   txtTrim(txtObject);

   if (!checkAlphaDigits(txtObject.value, fRequired))
      {
      alert(strErrorMessagePrefix + errorMsg);
      txtObject.focus();
      return false;
      }

   return true;
   } // end txtCheckAlphaDigits

function txtCheckAlphaDigitsWithSpaces(txtObject, fRequired, strErrorMessagePrefix)
   { // this one allows embedded spaces (but not a string with all spaces)
   txtTrim(txtObject);

   if (!checkAlphaDigitsWithSpaces(txtObject.value, fRequired))
      {
      alert(strErrorMessagePrefix + errorMsg);
      txtObject.focus();
      return false;
      }

   return true;
   } // end txtCheckAlphaDigitsWithSpaces

function txtCheckPrintable(txtObject, fRequired, strErrorMessagePrefix)
   {
   txtTrim(txtObject);

   if (!checkPrintable(txtObject.value, fRequired))
      {
      alert(strErrorMessagePrefix + errorMsg);
      txtObject.focus();
      return false;
      }

   return true;
   } // end txtCheckPrintable

function txtCheckPrintableWithSpaces(txtObject, fRequired, strErrorMessagePrefix)
   { // this one allows embedded spaces (but not a string with all spaces)
   txtTrim(txtObject);

   if (!checkPrintableWithSpaces(txtObject.value, fRequired))
      {
      alert(strErrorMessagePrefix + errorMsg);
      txtObject.focus();
      return false;
      }

   return true;
   } // end txtCheckPrintableWithSpaces

function txtCheckDigits(txtObject, fRequired, strErrorMessagePrefix)
   {
   txtTrim(txtObject);

   if (!checkDigits(txtObject.value, fRequired))
      {
      alert(strErrorMessagePrefix + errorMsg);
      txtObject.focus();
      return false;
      }

   return true;
   } // end txtCheckDigits

function txtCheckIPAddress(txtObject, fRequired, strErrorMessagePrefix)
   {
   txtTrim(txtObject);

   if (!checkIPAddress(txtObject.value, fRequired))
      {
      alert(strErrorMessagePrefix + errorMsg);
      txtObject.focus();
      return false;
      }

   return true;
   } // end txtCheckIPAddress

function txtCheckIPAddressWithMask(txtObject, fRequired, strErrorMessagePrefix)
   {
   txtTrim(txtObject);

   if (!checkIPAddressWithMask(txtObject.value, fRequired))
      {
      alert(strErrorMessagePrefix + errorMsg);
      txtObject.focus();
      return false;
      }

   return true;
   } // end txtCheckIPAddressWithMask

function txtCheckNpaNxx(txtObject, fRequired, strErrorMessagePrefix)
   {
   txtTrim(txtObject);

   if (!checkNpaNxx(txtObject.value, fRequired))
      {
      alert(strErrorMessagePrefix + errorMsg);
      txtObject.focus();
      return false;
      }

   return true;
   } // end txtCheckNpaNxx

function txtCheckPhone(txtObject, fRequired, strErrorMessagePrefix)
   {
   txtTrim(txtObject);

   if (!checkPhone(txtObject.value, fRequired))
      {
      alert(strErrorMessagePrefix + errorMsg);
      txtObject.focus();
      return false;
      }

   return true;
   } // end txtCheckPhone

   function txtCheckPhone2(txtObject, fRequired, strErrorMessagePrefix)
   {
   txtTrim(txtObject);

   if (!checkPhone2(txtObject.value, fRequired))
      {
      alert(strErrorMessagePrefix + errorMsg);
      txtObject.focus();
      return false;
      }

   return true;
   } // end txtCheckPhone

function txtCheckPhoneAndExt(txtObject, fRequired, strErrorMessagePrefix)
   {
   txtTrim(txtObject);

   if (!checkPhoneAndExt(txtObject.value, fRequired))
      {
      alert(strErrorMessagePrefix + errorMsg);
      txtObject.focus();
      return false;
      }

   return true;
   } // end txtCheckPhoneAndExt

function txtCheckEmail(txtObject, fRequired, strErrorMessagePrefix)
   {
   txtTrim(txtObject);

   if (!checkEmail(txtObject.value, fRequired))
      {
      alert(strErrorMessagePrefix + errorMsg);
      txtObject.focus();
      return false;
      }

   return true;
   } // end txtCheckEmail

function txtCheckUSZip(txtObject, fRequired, strErrorMessagePrefix)
   {
   txtTrim(txtObject);

   if (!checkUSZip(txtObject.value, fRequired))
      {
      alert(strErrorMessagePrefix + errorMsg);
      txtObject.focus();
      return false;
      }

   return true;
   } // end txtCheckUSZip

function txtCheckCurrency(txtObject, leftOfDecimal, rightOfDecimal, fRequired, strErrorMessagePrefix)
   {
   txtTrim(txtObject);

   if (!checkCurrency(txtObject.value, leftOfDecimal, rightOfDecimal, fRequired))
      {
      alert(strErrorMessagePrefix + errorMsg);
      txtObject.focus();
      return false;
      }

   return true;
   } // end txtCheckCurrency

function txtCheckUSCurrency(txtObject, leftOfDecimal, fRequired, strErrorMessagePrefix)
   {
   txtTrim(txtObject);

   if (!checkUSCurrency(txtObject.value, leftOfDecimal, fRequired))
      {
      alert(strErrorMessagePrefix + errorMsg);
      txtObject.focus();
      return false;
      }

   return true;
   } // end txtCheckUSCurrency
   
function txtCheckPercentage(txtObject, leftOfDecimal, fRequired, strErrorMessagePrefix)
   {
   txtTrim(txtObject);

   if (!checkPercentage(txtObject.value, leftOfDecimal, fRequired))
      {
      alert(strErrorMessagePrefix + errorMsg);
      txtObject.focus();
      return false;
      }

   return true;
   } // end txtCheckUSCurrency

function selCheckUSState(selObject, fRequired, strErrorMessagePrefix)
   {
   if (!checkUSState(selObject.options[selObject.selectedIndex].text, fRequired))
      {
      alert(strErrorMessagePrefix + errorMsg);
      selObject.focus();
      return false;
      }

   return true;
   } // end selCheckUSState

