function getMsg(version)
{
	this.alertMsg = (version=="cn" ? "关键字不能为空" : "Error keyword");	
	this.txtMsg = (version=="cn" ? "请输入查询关键字" : "Please input the keyword");	
}
function searchTxtFocus(version)
{
	var o = GI("TopPage_search_keyword");
	var msg = new getMsg(version);
	if(o.value==msg.txtMsg)
		o.value = "";
}
function goSearch(version)
{
	var vObj = new getTopPageValue();
	var msg = new getMsg(version);
	var url = "/pages/searchList.aspx";
	var t = "TopPage_search_type=" + vObj.t;
	var b = "TopPage_search_bound=" + vObj.b;
	//whene bound is member
	if(vObj.b=="")
		b = "TopPage_search_bound=exp";
	//whene bound is member
	var k = "TopPage_search_keyword=" + vObj.k;
	url +=  "?" + t +"&" +(version=="en" ? "version=en" : "version=cn")+"&"+ b + "&" + k ;
	
	if((Ion_trim(vObj.k, 0)!="" || vObj.k!="") && vObj.k!=msg.txtMsg)
		location.href = url;
	else
			alert(msg.alertMsg);	
}
function getTopPageValue()
{
	//alert(">>"+GI("TopPage_search_bound").outerHTML);
	this.t = GI("TopPage_search_type").value;
	this.b = GI("TopPage_search_bound").value;
	this.k = GI("TopPage_search_keyword").value;
}
function _onSelectClick(oName)
{
	window.setTimeout("onSelectClick('"+ oName +"')", 50);
}
function onSelectClick(oName)
{
	var o = GI(oName + "_Dv");
	if(o.style.display=="")
		o.style.display = "none";
	else
		o.style.display = "";
}
function onSelectEvent(o, flag)
{
	if(flag==0)
	{
		o.style.backgroundColor = "#E07276";
		o.style.color = "#ffffff";
	}
	else if(flag==1)
	{
		o.style.backgroundColor = "";
		o.style.color = "";
	}
}
function onSelectPitch(o, oName, text, value)
{
		o.style.backgroundColor = "";
		o.style.color = "";
		GI(oName + "_Txt").value = text;
		if(oName=="bound")
			GI("TopPage_search_bound").value = value;
		else if(oName=="type")
			GI("TopPage_search_type").value = value;
}
function createSelect(oName, items, itemsValue, flag, version)
{
	var _items = items.split("|");
	var _itemsValue = itemsValue.split("|");
	GI("TopPage_search_"+oName).value = _itemsValue[0];
	var selectClassName = "searchTxt_0";
	var childClass = "93px;";
	
	if(oName=="bound" && version=="en")
	{
		selectClassName = "searchTxt_1";
		childClass = "180px;";
	}
	
	
	var htmlStr = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	htmlStr += "<tr>";
	htmlStr += "<td>";
	htmlStr += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	htmlStr += "<tr>";
	htmlStr += "<td><img src=\"/images/topPage_select_txt_01.gif\" width=\"8\" height=\"24\" /></td>";
	htmlStr += "<td>";
	htmlStr += "<input id=\""+ oName +"_Txt\" type=\"text\" class=\""+ selectClassName +"\" readonly value=\""+ _items[0] +"\" />";
	htmlStr += "</td>";
	htmlStr += "<td><img src=\"/images/topPage_select_txt_03.gif\" width=\"4\" height=\"24\" /></td>";
	htmlStr += "</tr>";
	htmlStr += "</table>";
	htmlStr += "</td>";
	
	htmlStr += "<td><img src=\"../images/topPage_select_button.gif\" style=\"cursor:pointer;\" onclick=\"_onSelectClick('"+ oName +"')\"></td>";
	htmlStr += "</tr>";
	htmlStr += "<tr>";
	htmlStr += "<td colspan=\"2\" style=\"height:1px;\">";
	htmlStr += "<div id=\""+ oName +"_Dv\" class=\"select_Dv\" style=\"width:"+ childClass +"\" style=\"display:none;\">";
	htmlStr += "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	for(var i=0; i<_items.length; i++)
	{
		htmlStr += "<tr>";
		htmlStr += "<td style=\"height:18px; padding-left:25px;\" ";
		htmlStr += " onmouseover=\"onSelectEvent(this, 0);\" onmouseout=\"onSelectEvent(this, 1);\" ";
		htmlStr += " onclick=\"onSelectPitch(this, '"+ oName +"', '"+ _items[i] +"', '"+ _itemsValue[i] +"');\" >"+ _items[i] +"</td>";
		htmlStr += "</tr>";
	}
	htmlStr += "</table>";
	htmlStr += "</div>";
	htmlStr += "</td>";
	htmlStr += "</tr>";
	htmlStr += "</table>";
	DW(htmlStr);
}
