var show_word="输入关键字进行搜索";
var search_roll;
//var show_search_content=['洗斑','无烟锅','如烟','丽姿'];
var show_search_content=['','','',''];
var show_search_rand=0;
var show_search_speed = 3000;
var show_number=3;
//==============表单提交
function searchSubmitTo(){
	var formobj=document.getElementById("searchForm");
	formobj.action="http://www.51dg.com/search.asp";
	//formobj.action="index.htm";
	formobj.submit();
	return false;
}

function changeClass(searchValue)
{
	if(search_roll) clearInterval(search_roll);
	document.getElementById("Key").value=show_word;
	document.getElementById("Key").style.color="gray";
	var keyFootObj=document.getElementById("Key_foot");
	if(keyFootObj){
		keyFootObj.value=show_word;
		keyFootObj.style.color="gray";
	}
}
function showSearchRoll(){
	var show_search_obj = document.getElementById("Key")
	if(show_search_rand==show_number)
		show_search_rand=0;
	else show_search_rand++;
	show_search_obj.value=show_search_content[show_search_rand];
}
function chooseSearch(keyObj){
	if(search_roll) clearInterval(search_roll);
	keyObj.value="";
	keyObj.style.color='#000000';
	//document.getElementById("isGoto").value=1;
}
function showSearch(){
	var show_search_obj = document.getElementById("Key")
	if(show_search_obj.value==""){
			show_search_obj.style.color="red";
			show_search_obj.value=show_search_content[show_search_rand];
			search_roll=setInterval(showSearchRoll,show_search_speed);
	}
}
//================提交检测
function checkHeadSubmit(keyDefault,keyId){
	var obj=document.getElementById(keyId);
	if(keyDefault==obj.value||obj.value==""){
		alert("开始新搜索，请输入搜索关键字！");
		obj.value="";
		obj.focus();
		return false;
	}
	return true;
}

document.write("<table width=\"760\" bgcolor=\"#ffffff\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\n");
document.write("  <tr>\n");
document.write("    <td height=\"30\" class=\"table-zuoyou\" background=\"http://www.51dg.com/images/index_bg.gif\"><table width=\"99%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\n");
document.write("      <tr>\n");
document.write("        <td height=\"30\" style=\"padding-left:35px\"><form id=\"searchForm\" method=get target=\"_blank\" action=\"http://www.51dg.com/search.asp\"><select name=\"lbid\" class=\"wenbenkuang\" onChange=\"changeClass(this.value)\">\n");
document.write("          <option value=\"0\">全部类别</option>\n");
document.write("          <option value=\"2\">数码外设</option>\n");
document.write("          <option value=\"3\">康体美容</option>\n");
document.write("          <option value=\"4\">时尚礼品</option>\n");
document.write("          <option value=\"5\">专卖店</option>\n");
document.write("        </select> <input name=\"Key\" id=\"Key\" style=\"width:260px;color:gray\" value=\"输入关键字进行搜索\" onClick=\"chooseSearch(this)\"  onblur=\"showSearch()\">\n");
document.write("        <input name=\"image\" type=\"submit\" value=\" 搜 索 \" onClick=\"if(checkHeadSubmit('输入关键字进行搜索','Key')) return searchSubmitTo(); else return false;\"> <a href=http://www.51dg.com/search2.asp ><font color=#FFFFFF>高级搜索</font></a> <b><font color=#FFFFFF>关键词：</font></b><a href=http://www.51dg.com/search.asp?lbid=0&Key=减肥  ><font color=#FFFFFF>减肥</font></a> <a href=http://www.51dg.com/search.asp?lbid=0&Key=无烟锅><font color=#FFFFFF>无烟锅</font></a> <a href=http://www.51dg.com/search.asp?lbid=0&Key=手机 ><font color=#FFFFFF>手机</font></a> <a href=http://www.51dg.com/search.asp?lbid=0&Key=丰胸 ><font color=#FFFFFF>丰胸</font></a> <a href=http://www.51dg.com/search.asp?lbid=0&Key=欧姆龙 ><font color=#FFFFFF>欧姆龙</font></a>\n");
document.write("      </form></td>\n");
document.write("      </tr>\n");
document.write("    </table></td>\n");
document.write("  </tr>\n");
document.write("</table>\n");
