/********************************************************doSearch Scripts taken from theGlobal JavaScript functions for the CodeStore.net DomBlog templateJake Howlett, v2.1, 15/12/02 16:14********************************************************//*doSearch is called from the button below simple query box on all forms */function doSearch ( s, which ) {	var doc = document;	var form = doc.forms[0];	var regExp1 = /\bfield\b/i; //used to test for reserved word field in query string	var regExp2 = /[(,),<,>,\[,\]]/; //used to test for reserved char(s) in the query string	var str = s.value;		if ( trim(str) == "" ){		alert("Please be sure to enter something to search for.");		s.focus();		return false;	} else {		if ( typeof regExp1.source != 'undefined' ) //supports regular expression testing			if ( regExp1.test( str ) || regExp2.test( str ) ){					var alrt = "Please note that you can not include:";					alrt += "\n\nThe reserved word 'field'\nthe characters [, ], (, ), < or >";					alrt += "\n\nin your search query.";					alert( alrt );					s.focus();					return false;			}						if(which == true){				location.href = 					"/" + location.pathname.slice( 1, location.pathname.toLowerCase().lastIndexOf('.nsf')+4) 					+ "/search_web?SearchView&Query=" + escape( str ) + "&start=1&count=10&SearchFuzzy=True";			} else {				location.href =					'http://www.stkate.edu/google_search/results.php?cx=001492010490937357836%3Aahydjkhsqv0'+					'&cof=FORID%3A11'+					'&q='+ escape( str ) +					'&sa=Go#184'			}			}}//Remove leading and trailing spaces from a string//Originally written by Jim Frickerfunction trim(aStr) {	return aStr.replace(/^\s{1,}/, "").replace(/\s{1,}$/, "")}//Get URL with JavaScript and Keyfunction getPage (url){	var doc = document;	var form = doc.forms[0];	var key = form.controlkey.value;	var page = url+"?OpenDocument&k="+key;	window.location = page;}//Prevent Enter from submitting formfunction checkEnter(field, event){	var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;	if(keyCode == 13 && field.value != "Search"){		var query = document.getElementById('Query');		var whichsearch = document.getElementById('whichsearch1').checked;		doSearch(query, whichsearch); 	}		return false;}    // return the value of the radio button that is checked// return an empty string if none are checked, or// there are no radio buttonsfunction getCheckedValue(radioObj) {	if(!radioObj)		return "";	var radioLength = radioObj.length;	if(radioLength == undefined)		if(radioObj.checked)			return radioObj.value;		else			return "";	for(var i = 0; i < radioLength; i++) {		if(radioObj[i].checked) {			return radioObj[i].value;		}	}	return "";}