var strPromptOfEnterKey = "Enter Keywords";

function init()
{
	//document.Form1.Search1_txtKeyword.value = strPromptOfEnterKey;
}

function search()
{
	var strData = "";

	/*
	if (document.Form1.Search1_ddlMainCat.selectedIndex > 0)
		strData = "&mc=" + document.Form1.Search1_ddlMainCat[document.Form1.Search1_ddlMainCat.selectedIndex].value;
		
	if (document.Form1.ddlSubCat.selectedIndex > 0)	
		strData += "&sc=" + document.Form1.ddlSubCat[document.Form1.ddlSubCat.selectedIndex].value;
	*/
	
	if (ELB_GetValue("Search1_elbMainCat") != "ALL")
		strData = "&mc=" + ELB_GetValue("Search1_elbMainCat");
	
	if (ELB_GetValue("Search1_elbSubCat") != "ALL")
		strData = "&sc=" + ELB_GetValue("Search1_elbSubCat");
		
	if (document.Form1.Search1_ddlReg.selectedIndex > 0)		
		strData += "&ctry=" + document.Form1.Search1_ddlReg[document.Form1.Search1_ddlReg.selectedIndex].value;
	
	strData += "&et=" + document.Form1.Search1_ddlExhType[document.Form1.Search1_ddlExhType.selectedIndex].value;

	// Go back to homepage for searching
	// For production platform
	location.href = "http://exlist.tdctrade.com/index.aspx?cccode=" + document.Form1.txtCcCode.value + strData;
}

function searchByKeyword()
{
	var strSearchBy = document.Form1.Search1_ddlKeyword[document.Form1.Search1_ddlKeyword.selectedIndex].value;
	var strKeyword = document.Form1.Search1_txtKeyword.value;
	
	if (strKeyword == "")
	{
		alert("Please input keyword for searching.");
		document.Form1.Search1_txtKeyword.focus();
		return;
	} else if (containDoubleQuote(strKeyword)) {
		alert("Double quote is not allowed for keyword search.");
		document.Form1.Search1_txtKeyword.focus();
		return;
	}
	
	// Go back to homepage for searching
	// For production platform
	location.href = "http://exlist.tdctrade.com/index.aspx?cccode=" + document.Form1.txtCcCode.value + "&searchBy=" + strSearchBy + "&key=" + strKeyword;
}

function handleKeyTxtBox()
{
	/*
	if (document.Form1.Search1_txtKeyword.value == strPromptOfEnterKey)
		document.Form1.Search1_txtKeyword.value = "";
	*/
}