/* ================================================================================================ \
|	psusearch.js
|
|	This function drives the PSU search widget in the site header.
\* =============================================================================================== */

function multiPSUsearch()
{
	with (window.document) {
		switch (searchengine.engine.selectedIndex)
		{
			case 1:
				psugoogle.q.value=searchengine.q.value;
				psugoogle.action="http://search-results.aset.psu.edu/search";
				psugoogle.client.value="PennState";
				psugoogle.proxystylesheet.value="PennState";
				psugoogle.output.value="xml_no_dtd";
				psugoogle.site.value="PennState";
				psugoogle.target="_blank";
				psugoogle.submit();
				break;
			case 2:
				psupeople.cn.value=searchengine.q.value;
				psupeople.action="http://www.psu.edu/cgi-bin/ldap/ldap_query.cgi";
				psupeople.target="_blank";
				psupeople.submit();
				break;
			case 3:
				psudepts.dept_name.value=searchengine.q.value;
				psudepts.action="http://www.psu.edu/cgi-bin/ldap/dept_query.cgi";
				psudepts.target="_blank";
				psudepts.submit();
				break;
			case 4:
				google.q.value=searchengine.q.value;
				google.action="http://www.google.com/search";
				google.ie.value="UTF-8";
				google.oe.value="UTF-8";
				google.target="_blank";
				google.submit();
				break;
			default:
				searchengine.submit();
		}
	}
	
	// Since we're handling the submit with the script, return false to cancel the button click
	return false;
}


// The search engine switcher requires JavaScript to function. If we're running this file, toggle display of the switcher
//document.searchengine.engine.style.display = '';