function updateSelectItems(toThis) {
   var formElements = document.getElementsByTagName("SELECT");

   for (var i=0; i<formElements.length; i++) {
      var currElement = formElements[i];

      // just hide them all
      currElement.style.visibility = toThis;
   }
}

function checkSearchptbanner(){
	var searchForm = document.fedSearch;
  	for (var i = 0; i < searchForm.elements.length; i++) {
    		if (searchForm.elements[i].name == "in_tx_query") {
     			if (searchForm.elements[i].value == "") {
      				return false;
     			}
    			return true;
    		}
  	}
  	return false;
}

function submitSearchptbanner() {
	if (checkSearchptbanner()) {
    		var searchForm = document.fedSearch;
    		searchForm.submit();
  	} else {
    		alert('Your search box was empty. Please enter some text in the search box.');
  	}
}

function handleKeyDownptbanner(evt) {
	evt = (evt) ? evt : ((event) ? event : null);
 	if (evt.keyCode == 13){
		if (checkSearchptbanner()) {
			return true;
	  	} else {
			alert('Your search box was empty. Please enter some text in the search box.');
	       		return false;
	  	}
 	}
 	return true;
}

function changeTab(tabId, arrayPosition) {
	document.getElementById(tabId).src =pt_13689.transformURL( navImagesArr[arrayPosition]);
}


// Header dropdown list JavaScript

sfHover = function() { 
   var sfEls = document.getElementById("stateagencies").getElementsByTagName("LI"); 

   for (var i=0; i<sfEls.length; i++) { 
      sfEls[i].onmouseover=function() { 
         this.className+=" sfhover";
         updateSelectItems('hidden');
      } 
      sfEls[i].onmouseout=function() { 
         this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
         updateSelectItems('visible');
      }
   }
} 



servHover = function() { 
   var sfEls = document.getElementById("onlineserv").getElementsByTagName("LI"); 

   for (var i=0; i<sfEls.length; i++) { 
      sfEls[i].onmouseover=function() { 
         this.className+=" servhover";
         updateSelectItems('hidden');
      } 
      sfEls[i].onmouseout=function() { 
         this.className=this.className.replace(new RegExp(" servhover\\b"), "");
         updateSelectItems('visible');
      }
   }
}