// 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 = 24;
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.ssc.gov.sg/publish/Corporate/en/header/feed.html";

//Specify the Website's Contact Info URL here e.g. http://www.mywebsite.gov.sg/ContactInfo.html
var paramContactInfoPageURL ="http://www.ssc.gov.sg/publish/Corporate/en/header/about.html";


// Specify additional Collection options using the following //
Collections =
[	
	["Within Singapore Gov Websites", "default"],
	["Within Business", "within_biz"],
	["Within Citizens And Residents", "within_cit_res"],
	["Within Non-Residents", "within_non_res"]
]

// - - - End - Configuration - - - //


function ShowResults()
{
    //document.write("<style type='text/css' media='screen,print'>");
    //document.write("html,input,td{font-family:Arial;font-size:80%;}");
    //document.write("select{font-family:Arial;font-size:90%}");
    //document.write(".fLink{font-family: Arial;font-size: 11px;text-decoration: underline;color:Blue;cursor:hand;}")
    //document.write("</style>");

	document.writeln("<form method='GET' target='_self' name='SearchPlugInfrm' style='margin:0' action='" + Server_URL + "' >");
	document.writeln("<tr>");
	document.writeln("<td height='24' valign='top'>");
	document.writeln("<div align='right'><span class='smalltextwhite'><strong>Search</strong></span>");

	
	document.writeln("<input type='text' class='smalltextblack' name='q' size='"+ Search_Text_Box_Size + "'> ");
	document.writeln("<input type=submit class='smalltextblack' name=SearchGo id=SearchGo  value='Go' >"); 
	document.writeln("</div>");
	document.writeln("</td><td>&nbsp;</td>");
	document.writeln("</tr>");
	document.writeln("<tr>");
	document.writeln("<td height='27'> <div align='right'>");

	

	if (Collections != "")
	{
		var param_site_value = ""; //Do not remove

		document.writeln("<SELECT class='search-dropdown' name='site' class='smalltextblack'>");
		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 + "' />");
	}
	else
	{
		//Do not remove
		document.writeln("<input type='hidden' name='site' value='default_collection' />");
	}


	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>");
}
