// For clarifications on the below script, please contact shine_cs@ncs.com.sg
// Release V1.1 - 22 Jan 2008 
// - - - 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.gov.sg/feedback.htm";

//Specify the Website's Contact Info URL here e.g. http://www.mywebsite.gov.sg/ContactInfo.html
var paramContactInfoPageURL ="http://www.gov.sg/contactinfo.htm";


// Specify additional Collection options using the following //
Collections =
[
	["Within All Government Websites", "default"],
	["Within Business", "within_biz"],
	["Within Citizens And Residents", "within_cit_res"],
	["Within Non-Residents", "within_non_res"]
]

// Specify within this site (ie. sitesearch) options using the following //
// Only specify the website hosting this script
SiteSearchItems =
[
	//["Results Within This Website", ""]
]

// - - - End - Configuration - - - //


function ShowResults()
{
	document.write("<form id='searchBox' name='SearchPlugInfrm' target='_blank' method='GET' action='" + Server_URL + "' >");
    document.write("<table cellpadding='0' cellspacing='0'><tr><td><input type='text' class='text' name='q' id='searchTerms' /></td>");
	document.write("<td><img src='http://www.sgdi.gov.sg/img/btnSearch.png' border='0' id='searchBtn' alt='Search' ONCLICK=' document.SearchPlugInfrm.submit(); return false;' style='cursor:hand'/></td></tr>");
    document.write("<tr><td colspan='2'><div>");
    document.write("<select name='site' id='site' onchange='' size='1'>");

	var param_site_value = ""; //Do not remove
	
	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.writeln("</SELECT>");

	//Do not remove
	document.writeln("<input type='hidden' name='filter_s' value='" + param_site_value + "' />");
    document.writeln("</div></td></tr></table>")
	document.writeln("<input type='hidden' value='" + paramFeedbackPageURL + "' name='feedback_url'  />");
	document.writeln("<input type='hidden' value='" + paramContactInfoPageURL + "' name='contact_url' />");
	document.writeln("<input type='hidden' name='client' value='default' />");
	document.writeln("<input type='hidden' name='proxystylesheet' value='default' />");
	document.writeln("<input type='hidden' name='output' value='xml_no_dtd' />");
	document.writeln("</form>");
}

function clearSelectedRadio(radioId) 
{
    var x=document.getElementsByName(radioId); 
    for(i=0;i<x.length;i++){x[i].checked=false;}
    document.getElementById('btnG').focus();
}
