// For clarifications on the below script, please contact shine_cs@ncs.com.sg
// - - - Start - Configuration - Settings the Agency can modify - - - //
// All values passed to GSA must be URL-encoded. eg. spaces must be replaced by char '+'
var Search_Text_Box_Size = 30;
var Server_URL = "http://sgms.internet.gov.sg/search"; 
var Collections = "";
var SiteSearchItems = "";
var MetaDataFilters = "";

//Specify the Website's Feedback URL here e.g. http://www.mywebsite.gov.sg/feedback.html
//must have http:// as the start
var paramFeedbackPageURL ="http://www.psd.gov.sg/Feedback";

//Specify the Website's Contact Info URL here e.g. http://www.mywebsite.gov.sg/ContactInfo.html
var paramContactInfoPageURL ="http://www.psd.gov.sg/ContactUs";


// Specify additional Collection options using the following //
Collections =
[
	["Within All Government Websites", "default"]
]
// Specify within this site (ie. sitesearch) options using the following //
// Only specify the website hosting this script
SiteSearchItems =
[
	["Results Within This Website", "www.psd.gov.sg"]
]
// - - - End - Configuration - - - //

function clearSelectedRadio(radioId) {
	var x=document.getElementsByName(radioId);
	for(i=0;i<x.length;i++){x[i].checked=false;}
	document.getElementById('btnG').focus();
}
function ShowResults1() {
	document.write("<form method='GET' target='_self' name='SearchPlugInfrm' action='" + Server_URL + "' style='margin:0'><table border='0' cellspacing='0' cellpadding='0'><tr><td>aaa</td></tr></table></form>");
}
function ShowResults() {
	document.write("<form method='GET' target='_blank' name='SearchPlugInfrm' action='" + Server_URL + "' style='margin:0'><table border='0' cellspacing='0' cellpadding='0'>");
	document.write("<tr><td valign='middle'><img src='images/img_search.gif' border='0'></td>");
	document.write("<td align='right' valign='middle'><input type='text' name='q' size='"+ Search_Text_Box_Size + "' style='font-family:Arial;font-size:11px'></td> ");
	document.write("<td align='right' valign='bottom'><input type=image valign='bottom' name=SearchGo id=SearchGo src='images/bt_go.gif' value='Search' ></td>"); 
	document.write("</tr>");
	document.write("<tr><td></td><td>");
	if (Collections != "")
	{
		var param_site_value = ""; //Do not remove

		document.write("<SELECT name='site' style='font-family:Arial;font-size:11px'>");
		for (i = 0; i < Collections.length; i++)
		{
			document.writeln("<OPTION VALUE=" + Collections[i][1] +">" + Collections[i][0]);

			//Do not remove
			param_site_value += Collections[i][0] + "#" + Collections[i][1] + '|';
		}
		document.write("</SELECT>");

		//Do not remove
		document.write("<input type='hidden' name='filter_s' value='" + param_site_value + "' />");
	}
	else
	{
		//Do not remove
		document.write("<input type='hidden' name='site' value='default_collection' />");
	}
	document.write("</td></tr>");
	if (SiteSearchItems != "") {
		var param_ssearch_value = ""; //Do not remove
		document.writeln("<tr><td>&nbsp;</td><td align='right'>");
		for (i = 0; i < SiteSearchItems.length; i++) {
			document.writeln("<input type='checkbox' name='sitesearch' VALUE=" + SiteSearchItems[i][1] +" checked><span style='font-size:11px'>" + SiteSearchItems[i][0] + "</span>");
			//Do not remove
			param_ssearch_value += SiteSearchItems[i][0] + "#" + SiteSearchItems[i][1] + "|";
		}
		//Do not remove
		document.writeln("<input type='hidden' name='filter_ss' value='" + param_ssearch_value + "' />");
		document.writeln("</td></tr>");
	}
	document.write("</table>");
	document.write("<input type='hidden' value='" + paramFeedbackPageURL + "' name='feedback_url'  />");
	document.write("<input type='hidden' value='" + paramContactInfoPageURL + "' name='contact_url' />");
	document.write("<input type='hidden' name='client' value='default' />");
	document.write("<input type='hidden' name='proxystylesheet' value='default' />");
	document.write("<input type='hidden' name='output' value='xml_no_dtd' />");
	document.write("</form>");
}