/*
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
*/

//Site Search
var site_form_action		= "http://www.lboro.ac.uk/search-results.html";	//form
var site_search_attribute_1	= "000431813997250749365:d4xalstqvno";

//PGT Custom Search vars
var pgt_form_action			= "http://www.lboro.ac.uk/study/postgraduate/results/";	//form
var pgt_search_attribute_1 	= "000431813997250749365:lpq2xgkbzzc";								//hidden cx
var pgt_search_attribute_2 	= "FORID:11";														//hidden cof

//PGR Custom Search vars
var pgr_form_action			= "http://www.lboro.ac.uk/study/postgraduate/results/";	//form
var pgr_search_attribute_1 	= "000431813997250749365:7vmwbqaibco";								//hidden cx
var pgr_search_attribute_2 	= "FORID:11";														//hidden cof

//UG Custom Search vars
var ug_form_action			= "http://www.lboro.ac.uk/study/undergraduate/search/";//form
var ug_search_attribute_1   = "000431813997250749365:cxztoh0ujfi";								//hidden cx
var ug_search_attribute_2 	= "FORID:11";														//hidden cof



function searchSetSite(){
//Sets the search to 'site' mode
	//alert('setting site'); //debugging
	document.getElementById('site-search').setAttribute('action', site_form_action);
	document.getElementById('search_attribute_1').setAttribute('value', site_search_attribute_1);

}

function searchSetPGT(){
//Sets the search to 'PGT' mode
	//alert('setting PGT'); //debugging
	document.getElementById('site-search').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('site-search').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('site-search').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);
}
