// catnav rollover script ----------------------------------------------------
// number of menu items, current item selected, path to graphics
numCatnavItems = 3;
curCatnavItem = 0;
catnavPath = "graphics/";

// Initialize images
var catnavOver = new Array();
var catnavOut = new Array();
for (i=1; i<=numCatnavItems; i++)
	{
	catnavOver[i] = new Image();
	catnavOver[i].src = catnavPath + "catnav" + i + "_over" + ".gif";
	catnavOut[i] = new Image();
	catnavOut[i].src = catnavPath + "catnav" + i + "_out" + ".gif";
	}

function catnavImgOver(n)
	{
	if (document["catnav"+n]) {document["catnav"+n].src = catnavOver[n].src;}
	}

function catnavImgOut(n)
	{
	if (curCatnavItem != n)
		{
		if (document["catnav"+n]) {document["catnav"+n].src = catnavOut[n].src;}
		}
	else
		{
		if (document["catnav"+n]) {document["catnav"+n].src = catnavOver[n].src;}
		}
	}

function catnavImgOn(n)
	{
	for (i=1; i<=numCatnavItems; i++)
		{
		if (document["catnav"+i]) {document["catnav"+i].src = catnavOut[i].src;}
		}
	if (document["catnav"+n]) {document["catnav"+n].src = catnavOver[n].src;}
	curCatnavItem = n;
	}

// myPPK rollover script --------------------------------

// number of menu items, current item selected, path to graphics
numItems = 5;
curItem = 0;
path = "graphics/myppk/";

// Initialize images
var menuOver = new Array();
var menuOut = new Array();
var menuDown = new Array();
var menuOn = new Array();
for (i=1; i<=numItems; i++)
	{
	menuOver[i] = new Image();
	menuOver[i].src = path + "menu" + i + "_over" + ".gif";
	menuOut[i] = new Image();
	menuOut[i].src = path + "menu" + i + "_out" + ".gif";
	menuDown[i] = new Image();
	menuDown[i].src = path + "menu" + i + "_down" + ".gif";
	menuOn[i] = new Image();
	menuOn[i].src = path + "menu" + i + "_on" + ".gif";
	}

function imgOver(n)
	{
	document["menu"+n].src = menuOver[n].src;
	}

function imgOut(n)
	{
	if (curItem != n) {document["menu"+n].src = menuOut[n].src;}
	else {document["menu"+n].src = menuOn[n].src;}
	}

function imgDown(n)
	{
	document["menu"+n].src = menuDown[n].src;
	}

function imgOn(n)
	{
	for (i=1; i<=numItems; i++) {document["menu"+i].src = menuOut[i].src;}
	document["menu"+n].src = menuOn[n].src;
	curItem = n;
	}


function chkSearchForm()
	{
	//alert('here');
	var sText = document.searchForm.Keywords.value;
	sText = ReplaceBadCharsWithBlank(sText);
	document.searchForm.Keywords.value = sText;
	if (sText == "")
		{
		alert("Please enter the text you would like to search for in the space provided.");
		document.searchForm.Keywords.focus();
		}
	else if (sText.length<2)
		{
		alert("Your search text must be at least 2 characters long.");
		document.searchForm.Keywords.focus();
		}
	else	{
		document.location.href = "searchResults"+searchMode+".asp?cat=0&keywords=" + urlencode(sText);
		}
	}
	
	function urlencode(str) {
str = escape(str);
str = str.replace('+', '%2B');
str = str.replace('%20', '+');
str = str.replace('*', '%2A');
str = str.replace('/', '%2F');
str = str.replace('@', '%40');
return str;
}

function ReplaceBadCharsWithBlank(sTemp) 
	{
	// sTemp = sTemp.replace(/\<|\>|\"|\'|\.|\%|\;|\(|\)|\&|\+|\-/g," ");
	 sTemp = sTemp.replace(/\<|\>|\"|\.|\%|\;|\(|\)|\*|\@|\{|\}|\[|\]|\#|\+/g,"");

	return sTemp;
	}

function focusText(fld,t)
	{
	if (fld.value == "Search " + t){fld.value = "";}
	}

function blurText(fld,t)
	{
	if (fld.value == ""){fld.value = "Search " + t;}
	}

// TR highlighter
var colr = 0;

function overcol(obj)
	{
	colr=obj.style.backgroundColor;
	obj.style.backgroundColor = '#FFFFFF';
	}

function outcol(obj)
	{
	obj.style.backgroundColor = colr;
	}
	
	function forgotLogin()
		{
		Popup = window.open( "sendLogin.asp", "Popup","resizable=no,width=500,height=150"); 
		}
