/*  
 Date 04/09/2009
  This line is to include Foresee survey on all pages. Please refer to 
   "/Main/various/foresee/foresee-serv-def.js" for the exclusion liost
*/
document.write("<script type='text/javascript' src='/main/various/foresee/foresee-trigger.js'></scr"+"ipt>");


// toggles the more/less on the home page......DLuko 1/22/08
function toggle(element) {
             if (document.getElementById(element).style.display == "none") {
                      document.getElementById(element).style.display = "";
                      } else {
                                 document.getElementById(element).style.display = "none";
                      }
}



function leapto(form) {
	var myindex=form.elements[0].selectedIndex;                // number of selection
	str = new String(form.elements[0].options[myindex].value); // value of selection
	strarray = str.split(/\,/);                                // splits value on a comma	

	switch (strarray[0]){
	case "self":
		// loads in current browser window
		window.location.href = strarray[1];
		break;
	case "popup":
		// load in popup window
		window.open(strarray[1], "_blank");
		// reset pulldown menu
		myindex = 0;
		form.elements[0].options[myindex].selected = true;
		break;
	default:
		// loads in current browser window
		window.location.href = strarray[1];
		break;
	}
}
// findInPage Script - BEGIN

// Original:  Mike Hall (MHall75819@aol.com)
// Web Site:  http://members.aol.com/MHall75819

// This script and many more are available free online at
// The JavaScript Source!! http://javascript.internet.com

var NS4 = (document.layers);
var IE4 = (document.all);

var win = this;
var n   = 0;

function findInPage(str) {
	var txt, i, found;
	if (str == "")
		return false;
	
	if (NS4) {
		if (!win.find(str))
			while(win.find(str, false, true))
				n++;
		else
			n++;
		if (n == 0) alert(str + " was not found on this page.");
	}
	
	if (IE4) {
		txt = win.document.body.createTextRange();
		for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) {
			txt.moveStart("character", 1);
			txt.moveEnd("textedit");
		}
		if (found) {
			txt.moveStart("character", -1);
			txt.findText(str);
			txt.select();
			txt.scrollIntoView();
			n++;
		}
		else {
			if (n > 0) {
				n = 0;
				findInPage(str);
			}
			else
				alert(str + " was not found on this page.");
			}
	}
	
	return false;
}


// findInPage Script - END

//
// Begin 3 functions for AutoTabbing to next input field ..Dluko 5/20/03
//
var isNN = (navigator.appName.indexOf("Netscape")!=-1);

function autoTab(input,len, e) {
             var keyCode = (isNN) ? e.which : e.keyCode; 
             var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];

             if(input.value.length >= len && !containsElement(filter,keyCode)) {
             input.value = input.value.slice(0, len);
             input.form[(getIndex(input)+1) % input.form.length].focus();
             }

function containsElement(arr, ele) {
             var found = false, index = 0;

             while(!found && index < arr.length)
             if(arr[index] == ele)
             found = true;
             else
             index++;
             return found;
             }

function getIndex(input) {
             var index = -1, i = 0, found = false;

             while (i < input.form.length && index == -1)
             if (input.form[i] == input)index = i;
             else i++;
             return index;
             }

return true;
             }
//  End Auto Tabbing functions-->
