//heres our search function
function goSearch(s)
{
	//get pagetype so we can pass it to the search 
	var type = "";
	var URL = window.document.location.href;
	if (URL.indexOf("type=mhc") >= 0)
	{
	type = "mhc";
	} 
	if (URL.indexOf("type=hh") >= 0)
	{
	type = "hh";
	} 
	if (URL.indexOf("type=sjmh") >= 0)
	{
	type = "sjmh";
	} 

	var InputQuery = s.value;
	var regExp1 = /\bfield\b/;
	var regExp2 = /[(,),<,>,\[,\]]/;
	var OutputQuery = ""; 
	for ( i = 0; i < InputQuery.length; i++ ) 
	{ 
		var GetString = InputQuery.substring ( i , i+1); 
		if (GetString == " " ) 
		{ 
			OutputQuery = OutputQuery + "+"; 
		} 
		else 
		{
			OutputQuery = OutputQuery + GetString 
		} 
	} 

	if(OutputQuery=="") {
		alert("Please be sure to enter a keyword to search for.");
		s.focus();
	}else{
		if ( typeof regExp1.source != 'undefined' ) //supports regular expression testing 
		if ( regExp1.test( OutputQuery ) || regExp2.test( OutputQuery ) ){
		var alrt = "Please note that you can not include:"; 
		alrt += "\n\nThe reserved word 'field'\nthe characters [, ], (, ), < or >";
		alrt += "\n\nin your search query!\n\nPlease try your search again."
		s.focus();
		return alert( alrt );
		}
		//location.href="./SearchSite?OpenAgent&DBIDS="+searchDBlist+"&QUERY="+OutputQuery
		location.href="../SearchSite?OpenAgent&DBIDS=JGUR-4YVU9X:JGUR-4YVUBD:CWEA-4YZ5KZ&QUERY="+OutputQuery+"&type="+type
    }
}


