/******************************************************
Google Search Appliance 
Search Integration
*******************************************************/


/**********************
* DO NOT MODIFY BELOW
* THIS POINT
***********************/

function DoGoogleSearch(SearchTextBoxID, CollectionName)
{
	if (SearchTextBoxID == "")
	{
		alert("The paremeter SearchTextBoxID cannot be empty.");
	}
	
	else if (!document.getElementById(SearchTextBoxID))
	{
		alert("The paremeter SearchTextBoxID reference to an non existing element in the form. Please specify a correct parameter name.");
	}

	else if (document.getElementById(SearchTextBoxID).type != "text")
	{
		alert("The paremeter SearchTextBoxID reference to a non-text element in the form. SearchTextBoxName should be a text element.");
	}
		
	else
	{	
			
		var searchURL = "http://search.transportation.org/search?q="+document.getElementById(SearchTextBoxID).value+"&site="+CollectionName+"&btnG=Search&entqr=0&output=xml_no_dtd&sort=date%3AD%3AL%3Ad1&client=aashto_frontend&ud=1&oe=UTF-8&ie=UTF-8&proxystylesheet=aashto_frontend&proxyreload=0";

		var searchWindow = window.open(searchURL,"searchwindow");
		
		if (searchWindow == null)
		{
			alert("Your browser blocked popup. Please add http://"+document.domain+" to the sites allowed to open popup in your browser.");
		}
			
	}
	
}