//search.js
//written by LDButa on 1/25/2005

var tab5_active = false;
function visibilityToggle(obj) {
var el = document.getElementById(obj).style;
if (obj == 'searchBox') {
	tab5_active = true;
	if (el.visibility == 'hidden') {
		el.visibility = 'visible';
		document.searchForm.nfsSearchBox.focus();
	}
	else if (el.visibility == 'visible') {
		el.visibility = 'hidden';
	}
}
}

function init() {
//set the docEvent function show search form will hide if someone clicks out of the tab graphic
	document.body.onclick = docEvent;
}
//not using the docEvent function at this time
function docEvent() {
if (tab5_active) {
		document.getElementById('searchBox').style.visibility = 'hidden';
		tab5_active = false;
	}
}

function checkEntry () {
	if (document.searchForm.nfsSearchBox.value.length==0) {
		alert("Please enter some search criteria.");
		document.searchForm.nfsSearchBox.focus();
		return false;
	}
	if (!check_BadChars()) {
		alert("Please check your search criteria. It seems to include some HTML characters.");
		document.searchForm.nfsSearchBox.focus();
		document.searchForm.nfsSearchBox.select();
		return false;
	}
	
	else return true;
}
//don't let a user input html chars
function check_BadChars() {
	 var str_Checked = document.searchForm.nfsSearchBox.value;
	 	if (str_Checked.indexOf('<') != -1 || str_Checked.indexOf('>') != -1) return false;
		else return true;
	}