// JavaScript Document
// search box specific
//set style for search box
function changeSrcBx()
{
    document.getElementById('q').style.backgroundColor="#FFFFFF";
	// check to see if value = "Search English" and if it is clear
	if (document.getElementById('q').value=="Search English"){
		document.getElementById('q').value="";
	}
	//else if not default search text, don't clear
	//else {
	//}
	document.getElementById('q').style.color="#4B5263";
}

function changebackSrcBx()
{
    document.getElementById('q').style.backgroundColor="#6DAEF2";
	document.getElementById('q').style.color="#FFFFFF";
	// check for input text, if none revert back to search text
		if (document.getElementById('q').value=="") {
			document.getElementById('q').value="Search English";
			}
}
// set partition for search box
function srchPartitionSet()
{
	var partChoices = document.srchForm.partition
	// website partition
	var webPartcx = "013684769302239905964:wm4712yghsc"
	var webPartcof = "FORID:11"
	// people partition
	var peoplePartcx = "013684769302239905964:3f4989megay"
	var peoplePartcof = "FORID:11"

	for (var i=0; i<partChoices.length; i++){
		// if website partition selected return these values
		if (document.srchForm.partition[0].checked){
			document.srchForm.cx.value = webPartcx;
			document.srchForm.cof.value = webPartcof;
			return true;
			}
		// if people partition selected use these values
		else {
			document.srchForm.cx.value = peoplePartcx;
			document.srchForm.cof.value = peoplePartcof;
			return true;
		}
	}
}

// set partition for search box on results page
function srchPartitionSetRslt()
{
	var partChoices = document.srchFormRslt.partition
	// website partition
	var webPartcx = "013684769302239905964:wm4712yghsc"
	var webPartcof = "FORID:11"
	// people partition
	var peoplePartcx = "013684769302239905964:3f4989megay"
	var peoplePartcof = "FORID:11"

	for (var i=0; i<partChoices.length; i++){
		// if website partition selected return these values
		if (document.srchFormRslt.partition[0].checked){
			document.srchFormRslt.cx.value = webPartcx;
			document.srchFormRslt.cof.value = webPartcof;
			return true;
			}
		// if people partition selected use these values
		else {
			document.srchFormRslt.cx.value = peoplePartcx;
			document.srchFormRslt.cof.value = peoplePartcof;
			return true;
		}
	}
}