//---------------------------------------------------------------------------
// Function used by misc_searchbox.jsp to control form elements
//---------------------------------------------------------------------------
//Changed for ENH-18 -- removed encoding of search term as it is enough to encode it only after querying endeca.
function Search() {
		
	// Get search property and term values from form elements
	/* Commented for ENH-18*/
	//var terms 	= encodeURIComponent(document.search_terms_form.st1.value);
	var terms 	= document.search_terms_form.st1.value;
	/* Added the escape function to perform the encoding for ENH-42*/
	/* Commented for BUG-377*/
	//location.href = "/kids/Search?st1="+escape(terms);
	document.search_terms_form.st1.value=encodeURIComponent(terms);
	document.search_terms_form.action="Search";
	return true;
}
/* Added for BUG-377*/
function OnClickSearch() {
	// Get search property and term values from form elements
	var terms 	= document.search_terms_form.st1.value;
	var encodedterm = encodeURIComponent(terms); 
	location.href = "Search?st1="+encodeURIComponent(encodedterm);
	return false;
}
/**
 * Function to submit the page on press of Enter from the Picture Search box.
 */
function PictSearch() {
		
	// Get search property and term values from form elements
	/* Commented for ENH-18*/
	//var terms 	= encodeURIComponent(document.pict_search_terms.st1.value);
	var terms 	= document.pict_search_terms.st1.value;
	// Alert if only dimension search is being performed
	/* Added the escape function to perform the encoding for ENH-42*/
	//location.href = "/kids/Search?st1="+escape(terms)+"&mt=pc";
	document.pict_search_terms.st1.value=encodeURIComponent(terms);
	document.pict_search_terms.action="Search";
	return true;
}
/**
 * Function to submit the page on click of the search button from PictureSearch box
 * @param SearchTerm Search term
 */
function OnClickPictSearch(SearchTerm) {
	// Get search property and term values from form elements
	var terms 	= SearchTerm;
	var encodedterm = encodeURIComponent(terms);
	location.href = "Search?st1="+encodeURIComponent(encodedterm)+"&mt=pc";
	return false;
}
/*  BUG-377 changes ends here*/