var skey_txt = '请输入搜索关键词...例如：电磁阀';
var tag_val = new Array('gongying', 'qiugou', 'chanpin', 'qiye', 'zixun', 'zhanhui', 'xizai');

document.write("<div id=\"top1bar\"><font color=#FF3300>打造领先的液压气动设备在线商务平台！</font> <span style=\"color:#999999;margin-left:30px;\">[ <a class=\"gray1\" href=\"#\"  onClick=\"this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.yeyab.com/');return(false);\">自动访问</a> | <a class=\"gray1\" href=\"#\" onclick=\"window.external.addFavorite(window.location.href, '液压气动商情网YEYAB.com');\">加入收藏</a> | <a class=\"gray1\" href=\"/about/map.asp\">网站导航</a> | <a class=\"gray1\" href=\"/about/adv.asp\">广告服务</a> ]</span><span style=\"color:#FF3300;margin-left:50px;\">进入在线商务管理系统&nbsp;&nbsp; <a href=/olm/login.asp><img src=\"/images/login.jpg\" align=\"absmiddle\" border=0></a>  <a href=\"/regmember.asp\" style=\"margin-left:20px;\">免费注册</a> | <a href=\"#\">忘记密码？</a> | <a href=\"#\">帮助中心</a></span></div>" + getFestivalTheme() + "<div id=\"nav\"><a href=\"http://www.yeyab.com/\"><img src=\"/images/logo_01.gif\" style=\"float:left;border:0px;\"></a>");
showTopSearch();
document.write("<div id=\"hotkeys\"> <B><font color=\"#FF0000\">热门搜索</font></B> <a href=\"/search/gongying/丹尼逊,1.html\">丹尼逊</a> <a href=\"/search/gongying/dusterloh,1.html\">dusterloh</a> <a href=\"/search/gongying/伊顿威格士,1.html\">伊顿威格士</a> <a href=\"/search/gongying/柱塞泵,1.html\">柱塞泵</a> <a href=\"/search/gongying/威格士,1.html\">威格士</a> <a href=\"/search/gongying/,1.html\">HAWE</a> <a href=\"/search/gongying/parker,1.html\">parker</a> <a href=\"/search/gongying/力士乐,1.html\">力士乐</a> <a href=\"/search/gongying/电磁阀,1.html\">电磁阀</a> <a href=\"/search/gongying/压力传感器,1.html\">压力传感器</a></div></div>");
chgSearchTag(0);

function getFestivalTheme() {
	var themeString = "";
	if (typeof(festivalPic) != 'undefined' && festivalPic.length > 0)
	{
		themeString = "<style><!--#RedStyle { background: url('/images/festival/newyear_indexbg2.gif') no-repeat center top; width:100%; height:350px; position: absolute; top:0px; left:0px; z-index:-1;} #top1bar {border-bottom: 2px solid #990000;}//--></style><div id='RedStyle'></div><center><img src='/images/festival/" + festivalPic + "'></center>";
	}
	return themeString;
}

function showTopSearch() {

	var tag_label = new Array('供应', '求购', '产品', '企业', '资讯', '展会', '下载');
	var tag_value = new Array('1', '2', '3', '4', '5', '6', '7');
	
	var topsearch = "<form style=\"float:left;width:470px;height:60px;background:url('/images/logo_020.gif');margin:0px;padding:0px;padding-top:15px;padding-left:40px;\"><div style=\"margin-bottom:5px;\">";

	var tag_str = "";
	for( var i = 0; i < tag_value.length; i++) {
		tag_str+="<span id=tstag" + i + " class=\"stag stag0\" onmouseover=\"chgSearchTag(" + i + ");\">" + tag_label[i] + "</span>";
	}

	topsearch+= tag_str + "</div><input type=text name=skey value=\"" + skey_txt + "\" style=\"border:1px solid #F4B73B;width:360px;color:#000000;font-size:12px;color:#999999;padding:3px;\" onclick=\"this.value='';this.style.color='#000000';\"> <input type=hidden id=sc name=sc value='gongying'> <img style=\"cursor:pointer;\" src=\"/images/searchbtn.gif\" align=\"absmiddle\" onclick='doSearch();'></form>";

	document.write(topsearch);

	var css_str = "<STYLE>.stag {display:inline-block;width:50px;height:18px;line-height:18px;text-align:center;cursor:hand;font-size:12px;} .stag0 {background-color:#FFFFFF;font-weight:normal;color:#000000;} .stag1 {background-color:#F9ECC1;font-weight:bold;color:#CC0000;border:1px solid #F4B73B;}</STYLE>";

	document.write(css_str);

}

function chgSearchTag(idx) {
	for( var i = 0; i < 7; i++) {
		var stag = document.getElementById('tstag' + i);
		if(idx == i) {
			stag.className = 'stag stag1';
			document.getElementById('sc').value = tag_val[i];
		}
		else {
			stag.className = 'stag stag0';
		}
	}
}

function doSearch() {
	var sc = document.getElementById('sc').value;
	var skey = document.getElementById('skey').value;
	skey = skey.replace(',', '');
	skey = skey.replace('/', '');
	if(skey == '' || skey == null || skey == skey_txt) {
		alert('请输入搜索关键词');
		document.getElementById('skey').focus();
		return;
	}
	window.location = '/search/' + sc + '/' + skey + ',1.html';
}
