//###### kB functions change classes for link text ########
function kOver(bID,bClass) {
  if (document.getElementById){document.getElementById(bID).className = bClass;}
}
function kPlain(bID,bClass) {
  if (document.getElementById){document.getElementById(bID).className = bClass;}
}
function kGoBack() {
  window.history.back();
}
//###### kCursorChange change cursor to hand symbol #######
function kCursorChange(objN) {
  if (document.getElementById) {  //DOM3 = IE5, NS6
	  document.getElementById(objN).style.cursor='pointer';}
}
//###### kRequireSelection verifies ######################
//###### consent checked before posting ###################
function kRequireSelection() {
  if (document.form00.RequestCat.value == "so") {
  window.alert("We request the you select an Inquiry Type before proceeding.");
  }	  
  else 
  {document.form00.submit();
  }
}
//###################determine browser#####################
if (document.layers) {navigator.family = "nn4"}
if (document.all) {navigator.family = "ie4"}
if (window.navigator.userAgent.toLowerCase().match("gecko")) {navigator.family = "gecko"}
//###### kCursorChange change cursor to hand symbol #######
function kCursorChange(objN) {
  if (document.getElementById) {  //DOM3 = IE5, NS6
	  document.getElementById(objN).style.cursor='pointer';}
}
//######finds center of document space and determines######
//######left edge of centered parent table#################
function kGetCoordX() {
  if (navigator.appName=="Netscape"){var xOfDoc = window.innerWidth;}
  else {var xOfDoc = document.body.clientWidth;}
  xCntrOfDoc = xOfDoc / 2;
  xEdgeOfTbl = xCntrOfDoc - 200; //200 is half the width of the table to be displayed
return xEdgeOfTbl;
}

//###### kPopWindow pops up specified page ################
//###### with specified height ############################
function kPopWindow(strPage,strHeight) {
attrib = "top=100,left=100,height=" 
         + strHeight
         +",width=500,menubar=no,status=no,titlebar=no,toolbar=no,menubar=no,location=no"
//url = "http://66.132.137.190/kb/"
//url = url + strPage
url = strPage
window.open(url,null,attrib);
}

//###### kCheckValidity pops up specified page ################
//###### with specified height ############################
function kCheckValidity(psource) {
     if (psource==1) { // funtion is called from basic search
       vmth1 = form00.smonth.value;
       vday1 = form00.sday.value;
       vyr1 = form00.syear.value;
       vdate1 = vmth1 + "/" + vday1 + "/" + vyr1;
       if (vmth1==4 || vmth1==6 || vmth1==9 || vmth1==11) // 30 day months
         vmax=30;
       else if ((vmth1==2) && leapYear(vyr1)) // february with leap year check
         vmax=29;
       else if (vmth1==2) 
         vmax=28;
       else // all remaining months
         vmax=31;
       if (vday1 > vmax) // selected date is invalid
         window.alert("The date you've selected, " + vdate1 + ", is not a valid date.");
       else // selected date is valid
         document.form00.submit();
     }
     else { // funtion is called from advanced search
       vmthb = document.form00.smonthb.value;
       vdayb = document.form00.sdayb.value;
       vyrb = document.form00.syearb.value;
       vdateb = vmthb + "/" + vdayb + "/" + vyrb;
       //window.alert(vdateb);
       vmthe = document.form00.smonthe.value;
       vdaye = document.form00.sdaye.value;
       vyre = document.form00.syeare.value;
       vdatee = vmthe + "/" + vdaye + "/" + vyre;
       //window.alert(vdatee);
       vmsg = ""
       //evaluate start date selection
       if (vmthb==4 || vmthb==6 || vmthb==9 || vmthb==11) // 30 day months
         vmaxb=30;
       else if ((vmthb==2) && leapYear(vyrb)) // february with leap year check
         vmaxb=29;
       else if (vmthb==2) 
         vmaxb=28;
       else // all remaining months
         vmaxb=31;
       //evaluate end date selection
       if (vmthe==4 || vmthe==6 || vmthe==9 || vmthe==11) // 30 day months
         vmaxe=30;
       else if ((vmthe==2) && leapYear(vyre)) // february with leap year check
         vmaxe=29;
       else if (vmthe==2) 
         vmaxe=28;
       else // all remaining months
         vmaxe=31;
       //prepare error message or submit post
       if (vdayb > vmaxb)  // selected beginning date is invalid
         vmsg = "The beginning date you've selected, " + vdateb + ", is not a valid date.\n";
       if (vdaye > vmaxe)  // selected beginning date is invalid
         vmsg = vmsg +  "The ending date you've selected, " + vdatee + ", is not a valid date.";
       if (vmsg.length > 0)
         window.alert(vmsg);
       else
         document.form00.submit();
     }
}
function leapYear(yr) {
 if (((yr % 4 == 0) && yr % 100 != 0) || yr % 400 == 0)
  return true;
 else
  return false;
}





