/*
SEARCH SWITCH SCRIPT FOR PROPSECTUS HOMEPAGE
Switches the Google Custom Search between the UG propsectus and PG propsectus search engines

AUTHOR: T.E.Hook@lboro.ac.uk
DATE: 25-03-2009
Notes: 15/06/09 - added PGR option
*/

//PGT Custom Search vars
var pgt_form_action			= "http://www.lboro.ac.uk/prospectus/pg/courses/search/index.htm";	//form
var pgt_search_attribute_1 	= "012921159861776743957:m_v6bl1mvfa";								//hidden cx
var pgt_search_attribute_2 	= "FORID:11";														//hidden cof

//PGR Custom Search vars
var pgr_form_action			= "http://www.lboro.ac.uk/prospectus/pg/courses/search/index.htm";	//form
var pgr_search_attribute_1 	= "012921159861776743957:xfm9ax4rdii";								//hidden cx
var pgr_search_attribute_2 	= "FORID:11";														//hidden cof

//UG Custom Search vars
var ug_form_action			= "http://www.lboro.ac.uk/prospectus/ug/general/courses/results.htm";//form
var ug_search_attribute_1 	= "012921159861776743957:yelpvoymscm";								//hidden cx
var ug_search_attribute_2 	= "FORID:10";														//hidden cof


function searchSetPGT(){
//Sets the search to 'PGT' mode
	//alert('setting PGT'); //debugging
	document.getElementById('cse-search-box').setAttribute('action', pgt_form_action);
	document.getElementById('search_attribute_1').setAttribute('value', pgt_search_attribute_1);
	document.getElementById('search_attribute_2').setAttribute('value', pgt_search_attribute_2);
}

function searchSetPGR(){
//Sets the search to 'PGR' mode
	//alert('setting PGR'); //debugging
	document.getElementById('cse-search-box').setAttribute('action', pgr_form_action);
	document.getElementById('search_attribute_1').setAttribute('value', pgr_search_attribute_1);
	document.getElementById('search_attribute_2').setAttribute('value', pgr_search_attribute_2);
}

function searchSetUG(){
//Sets the search to 'UG' mode	
	//alert('setting UG'); //debugging
	document.getElementById('cse-search-box').setAttribute('action', ug_form_action);
	document.getElementById('search_attribute_1').setAttribute('value', ug_search_attribute_1);
	document.getElementById('search_attribute_2').setAttribute('value', ug_search_attribute_2);
}