﻿<!--Script for drop down menu for IE //-->
sfHover = function() {     
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
         sfEls[i].onmouseover=function() {
             this.className+=" sfhover";         
         }         
         sfEls[i].onmouseout=function() {
             this.className=this.className.replace(new RegExp(" sfhover\\b"), "");         
         }     
     }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
langHover = function() {     
	var sfEls = document.getElementById("items").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
         sfEls[i].onmouseover=function() {
             this.className+=" langhover";         
         }         
         sfEls[i].onmouseout=function() {
             this.className=this.className.replace(new RegExp(" langhover\\b"), "");         
         }     
     }
}
if (window.attachEvent) window.attachEvent("onload", langHover);

function mailpage()
{
mail_str = "mailto:?subject=Check out " + document.title;
mail_str += "&body=I thought you might be interested in the " + document.title + " page";
mail_str += ". You can view it at, " + location.href; 
location.href = mail_str;
}

function printWindow(){
   bV = parseInt(navigator.appVersion)
   if (bV >= 4) window.print()
}

function openDir(form) { 
	var newIndex = form.jargon.selectedIndex; 
	if ( newIndex == 0 ) { 
		alert( "Please select a term" ); 
	} else { 
		cururl = form.jargon.options[ newIndex ].value; 
		window.location.assign( cururl ); 
	} 
}

function hideTable(the_tbl,the_lnk){
	if  (document.getElementById(the_tbl).style.display=="") {
	  document.getElementById(the_tbl).style.display = "none";
	  document.getElementById(the_lnk).innerHTML = "Click for more details";
	} else {
	  document.getElementById(the_tbl).style.display = "";
	  document.getElementById(the_lnk).innerHTML = "Click to hide details";
	}
}

function validateGtrsrch(theForm)
{

  if (theForm.frmIndexName.selectedIndex < 0)
  {
    alert("Please select one of the \"Section\" options.");
    theForm.frmIndexName.focus();
    return (false);
  }

  if (theForm.frmIndexName.selectedIndex == 0)
  {
    alert("The first \"Section\" option is not a valid selection.  Please choose one of the other options.");
    theForm.frmIndexName.focus();
    return (false);
  }

  if (theForm.frmSearchString.value == "" || theForm.frmSearchString.value == null)
  {
    alert("Please enter a value for the \"Search Terms\" field.");
    theForm.frmSearchString.focus();
    return (false);
  }
  if (theForm.frmSearchString.value == " ")
  {
    alert("Please enter a value for the \"Search Terms\" field.");
    theForm.frmSearchString.focus();
    return (false);
  }
  return (true);
}
