﻿function initMenu() {

//拒绝回车提交事件
$("#txtSeach").bind("keydown", function(event){
 if(event.keyCode==13)
 {
 var txt=$("#Seach1_txtSeach").val();
   alert("Please Enter GO And Seach");
   event.preventDefault();
 }
});

  
////搜索操作
$("#btSeach").click(
  function(){
    var txt=$("#txtSeach").val();
    if(txt==""||txt=="")
    {
    alert("Please Input Keywords");
    }
    else
    {
     window.location.href="http://127.0.0.1/Search_"+txt+"_KeyWords.htm";
    }
  }
); 

//语言屏蔽设置
var timezoneOffset = new Date().getTimezoneOffset()/60*-1;    //获取客户端操作系统时区
if(timezoneOffset==8)
{
	var Re="F"; //F 关闭  T  开启
	if(Re=="T")
	{
	 top.location='http://www.generallamp.com/indexcn.html';
	}
	else
	{;}
};

var wn=window.navigator;
if (wn.systemLanguage=="zh-cn"||wn.language=="zh-CN")
{
    var ReS="T"; //F 关闭  T  开启
	if(ReS=="T")
	{
	top.location='http://www.generallamp.com/indexcn.html';
	}
	else
	{;}    
};

}







function getCookie(NameOfCookie)
{
if (document.cookie.length > 0)
{

begin = document.cookie.indexOf(NameOfCookie+"=");
if (begin != -1)    
{
begin += NameOfCookie.length+1;//cookie值的初始位置
end = document.cookie.indexOf(";", begin);//结束位置
if (end == -1) end = document.cookie.length;//没有;则end为字符串结束位置
return unescape(document.cookie.substring(begin, end)); }
}
return null;
}


function setCookie(NameOfCookie, value, expiredays)
{

var ExpireDate = new Date ();
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
document.cookie = NameOfCookie + "=" + escape(value) +
  ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}
 
$(document).ready(
function() {initMenu();}
);

