﻿			var starbcliId = "bcli1";
			function GetById(ByName){
				return document.getElementById(ByName);
			}
			function switchShow(ulId){	//鼠标移上 显示下拉分类
				var otemul = document.getElementById(ulId);
				if(document.getElementById(ulId)!=null){
					var LIs=document.getElementById(ulId).getElementsByTagName("li");
					for (var i=0;i<LIs.length;i++){
					  if(LIs[i].style.display!='none')
					  {
					  	starbcliId = LIs[i].id;
					  }
					  LIs[i].style.display = 'block';
					}
				}
			}
			function switchHide(ulId){	//鼠标移开 隐藏下拉分类
				var otemul = document.getElementById(ulId);
				if(otemul!=null){
					var LIs=otemul.getElementsByTagName("li");
					for (var i=0;i<LIs.length;i++){
					  LIs[i].style.display = 'none';
					  if(LIs[i].id==starbcliId)
					  {
						//LIs[i].style.display = 'block';
					  }
					}
					document.getElementById(starbcliId).style.display = 'block';
				}
			}
			function switchsel(liId,hidId){	//这里是选中哪一分类
				starbcliId = liId;	//要显示的id	保存 便于等下调用函数 这id显示 其他隐藏
				GetById(hidId).value = GetById(liId).title;
				switchHide("bcAll");
			}
			function checkscorvalue(showclassid,hideclassid,hidvalue){	//这里用于判断是否选中产品
				if(document.getElementById(showclassid)!=null){
					document.getElementById(showclassid).className = "cru";
				}
				if(document.getElementById(hideclassid)!=null){
					document.getElementById(hideclassid).className = "";
				}
				if(document.getElementById("strselect")!=null){
					document.getElementById("strselect").value=hidvalue;
				}
			}
			function searchForm()	//查询提交
			{
				var url = document.Search.strselect.value;
				var strtype= document.Search.strcategories.value;
				var keyword = document.Search.SearchKeyword.value;
				if (keyword =="" )
				{
					alert("* Please input and search the key word!");
					document.Search.SearchKeyword.focus();
					return false;
				}
				else
				{
				//location.href =url+"?SearchKeyword="+escape(keyword);
				//location.href =url+"?wstype="+strtype+"&SearchKeyword="+keyword;
				location.href =url+"?wstype="+escape(strtype)+"&SearchKeyword="+escape(keyword);
				}
			}
			/*function keyDown(e){
			  if(event.keyCode==13){
				var url = document.Search.strselect.value;
				var strtype= document.Search.strcategories.value;
				var keyword = document.Search.SearchKeyword.value;
				if (keyword =="" )
				{
					alert("* Please input and search the key word!");
					document.Search.SearchKeyword.focus();
					return false;
				}
				else
				{
				//location.href =url+"?SearchKeyword="+escape(keyword);
				//location.href =url+"?SearchKeyword="+keyword;
				//document.all.Search.action=url+"?wstype="+strtype+"&SearchKeyword="+keyword;
				document.all.Search.action=url+"?wstype="+escape(strtype)+"&SearchKeyword="+escape(keyword);
				document.all.Search.submit();
				}
			  }
			}*/



			document.onkeydown = function(e){
        		if(!e) e = window.event;
        		if((e.keyCode || e.which) == 13){
            		var obtnSearch=document.getElementById("imgSearch")
            		var Keyword = document.getElementById("SearchKeyword")

			
				if (Keyword.value =="" )
				{
					alert("* Please input and search the key word!");
					Keyword.focus();
					return false;
				}
  				else
				{
					obtnSearch.focus();
            				obtnSearch.onclick();
				}

			
        		}
			}

