// Triple Search Function -  Brian Daley
// Added fourth Search Function - for Department - hack by MGR 20060204

function UC_Search(object){ 
	// Determine Radio Value
	for (i=0, n=object.sitesearch.length; i<n; i++) {
	    if (object.sitesearch[i].checked) {
		   RV = object.sitesearch[i].value;
		   break;
	    }
	}

	object.action = "http://www.google.com/u/UConnWeb";
	object.domains.value = "uconn.edu";
	
	// Quick Validation 
	if((object.q.value == '') || (object.q.value == 'Type Search Here')){
		alert('You must enter your search criteria.');
		object.q.focus();
		return false;
	}
	
	// Set Variables for People Search (Phonebook)
	if(RV == 'People'){
		object.method = "POST";
		object.action = "http://phonebk.uconn.edu/results.php";
		object.q.name = "basictext";
	}

	// Set Variables for Department Search (Google)
	if(RV == 'Department' || RV == ''){
		object.method = "GET";
		object.action = "http://www.google.com/u/UConnPhysics";
		object.q.name = "q";
		object.domains.value = "";
		object.sitesearch[0].value = "";
	}
}
