// - - - Start - Configuration - Settings the Agency can modify - - - //
var Enable_Search_Within_This_Site = true;
var Enable_Search_Within_Agency = false;
var Results_Per_Page = 10;
var Search_Text_Box_Size = 25;
var Server_URL = "http://sgms.internet.gov.sg/search";
var Server_HomePage = "http://sgms.internet.gov.sg/";
var Banner = "";
var AdditionalDropDownItems = "";
var Catalogue = "";
var Collections = "";
var SiteSearchItems = "";
var MetaDataFilters = "";

// Change the following paramter manually if its not desirable to get the website domain automatically.
var URLStr = "http://www.ida.gov.sg";


//Specify the Website's Feedback URL here e.g. www.mywebsite.gov.sg/feedback.html
var paramFeedbackPageURL="http://www.ida.gov.sg/General/Feedback.aspx";

//Specify the Website's Contact Info URL here e.g. www.mMywebsite.gov.sg/ContactInfo.html
var paramContactInfoPageURL="http://www.ida.gov.sg/General/ContactInfo.aspx";


// Specify additional drop down options using the following //
AdditionalDropDownItems =
[
	//["Within Citizens & Residents", 'I80VNN4VY:AUDIENCE_CODES'],
	//["Within Business", "I80Y14E8Z:AUDIENCE_CODES"],
	//["Within Non-Residents", 'I80VOSC4S:AUDIENCE_CODES']
]

Collections =
[	
	["Within This Website" , "ida1"],
 	["Within IDA-Related Websites ", "ida"],
	["Within All Singapore Gov Websites", "default"]
]

// Specify additional Catalgoue options using the following //
Catalogue =
[
 ["Within IDA-Related Websites", "139"]
]
// - - - End - Configuration - - - //


// - - - Start - Configuration - Debug Settings - - - //

var SplitResTry;


// - - - End - Configuration - - -//


function enableSearchWithInSite()
{
	return Enable_Search_Within_This_Site;
}

function enableSearchWithInAgency()
{
	return Enable_Search_Within_Agency;
}

function SetResultsPerPage()
{
	return Results_Per_Page;
}

var mtr = 0

function ShowResults()
{
	document.writeln('<form method="GET" target="new1" name="SearchPlugInfrm" action="' + Server_URL + '" >');
	document.write('<ul id="search2">');
    	document.write('<li><a href="javascript:document.forms[0].submit();"><img src="/_images/_common/go-btn.jpg" width="22" height="17" border="0" alt="GO" title="GO" /></a></li>');
    	document.write('<li id="searchDropdown2">');

	if (Collections != "")
	{
		var param_site_value = ""; //Do not remove

		document.writeln('<select id="searchWithin2" name="site">');
		for (i = 0; i < Collections.length; i++)
		{
			document.writeln('<option value="' + Collections[i][1] +'">' + Collections[i][0] + '</option>');

			//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' />");
	}

    	document.write('</li>');
    	document.write('<li><span id="searchFieldBox2"><input type="text" id="searchField" name="q" /></span></li>');
    	document.write('<li><span id="searchword2">Search</span></li>');
    	document.write('</ul>');
    
	
	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>");
}