<!-- START JAVASCRIPT CODE
//////////////////////////////////////////////////////////////////////////////////////
// SET UP INITIAL CONDITION FOR DIFFERENT BROWSERS
//////////////////////////////////////////////////////////////////////////////////////
var ns4 = (document.layers) ? true:false;
var ie4 = (document.all)    ? true:false;
var visible;
var hidden;
if(ns4)
{
  visible = 'show';
	hidden  = 'hide';
	alert("This site is optimized for the latest Netscape Browser [ver 6.0]\n" + 
	      "You will not be able to navigate the site correctly with your current browser");
}
else if(ie4)
{
  visible = 'visible';
	hidden  = 'hidden';
}
else
{
  visible = 'visible';
	hidden  = 'hidden';
}
//////////////////////////////////////////////////////////////////////////////////////
//  REVEAL HIDDEN LAYERS AND HIDE VISIBLE ONES
//////////////////////////////////////////////////////////////////////////////////////
var lastLayer = null;
function swapLayer(current)
{
  var currentLayer;
	if(ns4) currentLayer = document.layers[current];
	else    currentLayer = document.all[current].style;
	currentLayer.visibility = visible;
	lastLayer = currentLayer;
}
//////////////////////////////////////////////////////////////////////////////////////
//  HIDE SPECIFIED LAYER
//////////////////////////////////////////////////////////////////////////////////////
function hideLayer(current)
{ 
  if(current!=null)
	{
	  if(ns4) document.layers[current].visibility = hidden;
	  else    document.all[current].style.visibility = hidden;
	}
	else if(lastLayer!=null) lastLayer.visibility = hidden;
}
//////////////////////////////////////////////////////////////////////////////////////
//  CHANGES THE POINTER OF AN IMAGE TO ANOTHER
//////////////////////////////////////////////////////////////////////////////////////
function swapImage(current, location)
{
  document.images[current].src = location;
}
//////////////////////////////////////////////////////////////////////////////////////
//  CHANGE BACKGROUND COLOR OF AN OBJECT
//////////////////////////////////////////////////////////////////////////////////////
function colorChange(current, color)
{
  if(ns4) current.backgroundColor = color;
  else    current.style.backgroundColor = color;
}
//////////////////////////////////////////////////////////////////////////////////////
//  ADD A NEW MENU ITEM TO THE CURRENT MENU
//////////////////////////////////////////////////////////////////////////////////////
function addMenuItem(whatName, whatClass, 
                     whatLink, whatOptions)
{
	if(whatOptions==null) whatOptions="";
	var output = "";
			output+= "<tr>\n";
	    output+= "<td class='itembox'\n";
			output+= " onMouseOver=\"colorChange(this,'000070');return false;\"\n";
			output+= " onMouseOut =\"colorChange(this,'7f7fff');return false;\">\n";
			output+= "  <a href='" + whatLink + "' class='" + whatClass + "'\n";
			output+= " " + whatOptions + ">" + whatName + "</a>\n";
			output+= "</td>\n";
			output+= "</tr>";
	document.writeln(output);
}
//////////////////////////////////////////////////////////////////////////////////////
//  KEYBOARD EVENT HANDLER (ENTER KEY)
//   - Can accept a third argument, jump, default value 1.
//   - Skips hidden fields.
//////////////////////////////////////////////////////////////////////////////////////
function handleEnter (field, event) 
{
   var jump;
   if (arguments.length>2)
	jump=arguments[3];
   else jump=1;
   var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
   if (keyCode == 13) {
	var i;
	for (i = 0; i < field.form.elements.length; i++)
		if (field == field.form.elements[i])
		break;
		i = (i + jump) % field.form.elements.length;
		while (field.form.elements[i].type=="hidden")
			i=(i + 1) % field.form.elements.length;
		field.form.elements[i].focus();
		return false;
	} 
	else
	return true;
}  
//////////////////////////////////////////////////////////////////////////////////////
//  TRIM STRING FUNCTION
//////////////////////////////////////////////////////////////////////////////////////
function trim(inputString) {
   // Removes leading and trailing spaces from the passed string. Also removes
   // consecutive spaces and replaces it with one space. If something besides
   // a string is passed in (null, custom object, etc.) then return the input.
   if (typeof inputString != "string") { return inputString; }
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") { // Check for spaces at the beginning of the string
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") { // Check for spaces at the end of the string
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
   }
   return retValue; // Return the trimmed string back to the user
} // Ends the "trim" function
//////////////////////////////////////////////////////////////////////////////////////
//  CHECK INTEGER
//////////////////////////////////////////////////////////////////////////////////////
function CheckInt(strInt) {
    var ccCheckRegExp = /[^\d ]/;
    
    if (strInt.length<1) return false;
    if (ccCheckRegExp.test(strInt)) return false;
    
    return true;
}
//////////////////////////////////////////////////////////////////////////////////////
//  CHECK NUMERICAL
//////////////////////////////////////////////////////////////////////////////////////
function CheckNum(strNum) {
    var ccCheckRegExp = /[^\d ]/;
    
    if (strNum.length<1) return false;
    for (var i=0;i<strNum.length;i++) 
     if ((ccCheckRegExp.test(strNum.charAt(i))) && (strNum.charAt(i)!=".")) return false;
    
    return true;
}
//////////////////////////////////////////////////////////////////////////////////////
//  DATE VALIDATION
//   - Only return true for date format in "mm/dd/yyyy"
//////////////////////////////////////////////////////////////////////////////////////
function validateDate (strDate) {
   var parsedDate = strDate.split ("/");
   if (parsedDate.length != 3) return false;
   var day, month, year;
   month = parsedDate[0]-1;
   day = parsedDate[1];
   year = parsedDate[2];

   var objDate = new Date (strDate);
   if (month != objDate.getMonth()) return false;
   if (day != objDate.getDate()) return false;
   if (year != objDate.getFullYear()) return false;

   return true;
} 
//////////////////////////////////////////////////////////////////////////////////////
//  SET AND RETURN A VALID DATE ENTRY
//   - Return format: "mm/dd/yyyy"
//////////////////////////////////////////////////////////////////////////////////////
function setValidDate(strDate) {
	var checkdate;
	var day;
	var month;
	var year;
	var rtnDate;
	
	rtnDate=trim(strDate);
	if (rtnDate.length>0) {
	 if (rtnDate.indexOf("/")==-1) {
	  month=rtnDate.substr(0,2);
	  day=rtnDate.substr(2,2);
	  year=rtnDate.substring(4,rtnDate.length);
	  rtnDate=month + "/" + day + "/" + year;
	 }
	 checkdate=rtnDate.split("/");
	 if (checkdate.length==3) {
	  if (checkdate[2].length==2) {
	    rtnDate=checkdate[0] + "/" + checkdate[1] + "/20" + checkdate[2];
	  }
	 }
	}
	
	return rtnDate;
} 
//////////////////////////////////////////////////////////////////////////////////////
//  PHONE VALIDATION
//   - Check for non-numeric characters, number of digits, dash.
//////////////////////////////////////////////////////////////////////////////////////
function validatePhone (strPhone) {
    var ccCheckRegExp = /[^\d ]/;

	if (strPhone.indexOf("-")==-1) {return false;}	
    var parsedNo = strPhone.split ("-");
    if (parsedNo.length!=3) {return false;}
    if (ccCheckRegExp.test(parsedNo[0]) || (parsedNo[0].length!=3)) return false;
    if (ccCheckRegExp.test(parsedNo[1]) || (parsedNo[1].length!=3)) return false;
    if (ccCheckRegExp.test(parsedNo[2]) || (parsedNo[2].length!=4)) return false;
   
	return true;
}
//////////////////////////////////////////////////////////////////////////////////////
//  SET AND RETURN A VALID PHONE ENTRY
//   - Return format: "nnn-nnn-nnnn"
//   - Replace spaces and any non-numeric characters
//////////////////////////////////////////////////////////////////////////////////////
function setValidPhone(strPhone) {
	var rtnPhone;
	var areano;
	var no1;
	var no2;
	
	rtnPhone=strPhone.replace(/ /g,"");
	rtnPhone=rtnPhone.replace(/[^\d ]/g,"");
	rtnPhone=trim(rtnPhone);
	if ((rtnPhone.indexOf("-")==-1) && (rtnPhone.length==10)) {
	 areano=rtnPhone.substr(0,3);
	 no1=rtnPhone.substr(3,3);
	 no2=rtnPhone.substr(6,4);
	 rtnPhone=areano + "-" + no1 + "-" + no2;
	}
	
	return rtnPhone;
}
//////////////////////////////////////////////////////////////////////////////////////
//  RETURN THE CURRENT LOCATION FILE NAME
//   - getLoc("FullLoc") returns the full file name
//   - getLoc() returns the file name without extension
//////////////////////////////////////////////////////////////////////////////////////
function getLoc() {
 var FullLoc=location.href.split("/");
 var Loc=FullLoc[FullLoc.length-1].split(".");
 
 if (arguments.length>0) {
  if (arguments[1]=="FullLoc")
    return FullLoc;
 }
 return Loc[0];
}
// END JAVA SCRIPT CODE -->