<!--
function isDigit (c) {
   return ((c >= "0") && (c <= "9"))
}

function isLetter (c) {
   return ( ((c >= "a") && (c <= "z")) || ((c >= "A") && (c <= "Z")) )
}

function isInteger(s) {
   for (i=0; i < s.length; i++) {
      var c=s.charAt(i);
      if (!isDigit(c)) return false;
   }
   return true;
}

function trimStr(val) {
   var str = val;
   while (str.length && (str.charAt(0) == ' ' || str.charAt(0) == '\r' || str.charAt(0) == '\n'))  {
      str = str.substr(1);
   }
   while (str.length && (str.charAt(str.length - 1) == " " || str.charAt(str.length - 1) == '\r' || str.charAt(str.length - 1) == '\n')) {
      str = str.substr(0, str.length - 1);
   }
   return str;
}

function isBlank(str) {
   if (str == "")
      return 1;
   j = 1;
   for (i=0; i < str.length; i++) {
     if (str.charAt(i) == ' ' || str.charAt(i) == '\\r' || str.charAt(i) == '\\n') {}
     else {
        j = 0;
        break;
     }
   }
   return j;
}

function show(p) {
    var e = document.getElementById(p);
    if (e) e.style.display = '';

}
function hide(p) {
    var e = document.getElementById(p);
    if (e) e.style.display = 'none';
}

function togglePrevLic() {
   f = document.forms.state;
   if (!f) return
   if (f.hasPrevLic[0] && f.hasPrevLic[0].value=="Y" && f.hasPrevLic[0].checked==true) {
      show('prevLicBlock')
   } else {
      hide('prevLicBlock')
   }
}

//******************** BEGIN - ORIGINAL TERESA's JS ******************************//
<!--
function disableButton()
{
   var next = new Boolean(1);

   if( document.custinfo != null && document.custinfo.resType.value != "R")
       next = OnChange();

   if( next )
   {
   // Work with new browsers only: NS6+ or IE5+
   if (document.all || document.getElementById) {
      for(i=0; i<document.forms.length; i++) {
         currentForm = document.forms[i];

         for(j=0; j<currentForm.elements.length; j++){
            currentElement = currentForm.elements[j];
            if(currentElement.type == "submit" && currentElement.name != "noCustNumber")
               currentElement.disabled = true;
         }
      }
      setTimeout('enableButton()', 15000); //+15 secs
   }

   return true;

   }
   else
   {
     document.custinfo.state.focus(); 
     return false;
   }
   
   
  
   
}

function enableButton()
{
   if (document.all || document.getElementById) {
      for(i=0; i<document.forms.length; i++) {
         currentForm = document.forms[i];
         for(j=0; j<currentForm.elements.length; j++){
            currentElement = currentForm.elements[j];
            if(currentElement.type == "submit")
               currentElement.disabled = false;
         }
      }
   }
   return true;
}

  //06/27/07
 //view PDF license 
  var pdfWindow;
  function openPDFwindow(f) {

     var id_num = document.viewLic.sessid.value;
     var url = "print_license_js.cgi?sessid=" + id_num;
     pdfWindow = window.open(url, "PDFLicense", "scrollbars=1,resizable=1,toolbar=0,menubar=1,status=1");
     pdfWindow.focus();
     return false;
  }


  function OnChange() 
  {
     var cIndex = document.custinfo.country.selectedIndex;
     var cVal = document.custinfo.country.options[cIndex].value; 
     var stIndex = document.custinfo.state.selectedIndex; 
     var stVal = document.custinfo.state.options[stIndex].value; 

     if( (cVal != "United States") && (stVal != "OT") )
     {
         alert("You have selected a non-U.S. country. \nPlease select \"OTHER\" for the state selection.");
         document.custinfo.state.focus();
         return false;
     } 
     else if( (cVal == "United States") && (stVal == "OT") ) 
     {
        alert("Invalid state selection for U.S. \nPlease re-select the state.");
        document.custinfo.state.focus();
        return false; 

     } 
    
     return true;
  }

  function clearAll(f)
  {

     var currentEle;
     for (var i=0; i <f.elements.length; i++) {

          currentEle = f.elements[i];
          if (currentEle.type == "text") 
          { 
              currentEle.value = ""; 
              

          }
          else if( currentEle.type == "radio")
          {

              currentEle.checked = "";
          }

          else if( currentEle.type == "select-one" || currentEle.type == "select-multi" )
          {

              currentEle.selectedIndex = -1;

          }
     }

 


  }


//******************** END - ORIGINAL TERESA's JS ******************************//



// -->
