var sHref = document.location.href;
var oType = document.getElementById("searchtype");
//document.writeln(document.location.pathname);
for (var i = 0; i < oType.options.length ; i++ )
{
	if("/" + oType.options[i].value + "/" == document.location.pathname)oType.options[i].selected = true;
}
function doSearch(){
		var strUrl;
		var stype;
		var strKeyword;
		stype = document.searchform.searchtype.value;
		strKeyword = document.searchform.keyword.value;
		sQs =  encodeURIComponent(strKeyword);
		if ( strKeyword == ""){
			alert("关键字不能为空！");
			document.searchform.keyword.focus();
			return false;
		}else{
			/*if(hhasSensitiveWords(strKeyword)){
				alert(strKeyword + "中包含禁止使用的敏感字！");
				document.searchform.keyword.focus();
				return false;
			}*/
		}
		switch(stype){
			case "trade/buy":
				strUrl = "http://so.dnong.com/trade.aspx?t=2&q=" + sQs;
				break;
			case "trade/offer":
				strUrl = "http://so.dnong.com/trade.aspx?t=1&q=" + sQs;
				break;
			case "product":
				strUrl = "http://so.dnong.com/products.aspx?q=" + sQs;
				break;
			case "company":
				strUrl = "/company/list.mspx?keyword=" + strKeyword;
				break;
			case "info":
				strUrl = "http://so.dnong.com/s.aspx?q=" + sQs;
				break;
		}
		document.searchform.action=strUrl;
		document.searchform.target="_blank";
		document.searchform.submit();
	}