<!--检查客户留言是否输入正常-->
//检验EMAIL是否合法
function checkMail(s)
{
  var pattern=/\w+@\w+\.[a-z]+/;
  if(pattern.test(s))
{
   return true;
  }
    else
 {
   return false;
  }
}
//检验电话号码是否合法
function checkNumber(ch)
{
if (ch>='0' && ch<='9')
{
//alert("合法");
return true;
}
else
{
// alert("不合法");
return false;
}
}
<!--检查留言是否输入正常-->
function CheckGuestBookSave()
{ 
 if (document.Book.Somane.value=="")
   { alert("请您输入联系人名称")
	 document.Book.Somane.focus();
	 return false;
   }   
  if (document.Book.Phone.value=="")
   { alert("请您输入联系电话")
	 document.Book.Phone.focus();
	 return false;
   }
 for(i=0;i<document.Book.Phone.value.length;i++)
	{
	 ch=document.Book.Phone.value.charAt(i)
	if(!checkNumber(ch))
	{
	alert("您输入的联系电话不正确，请检查有无错误。");
	document.Book.Phone.focus();
	return false;
	}
	}
	if (document.Book.Phone.value.length<8)
   { alert("你输入的不足八位以上，请重新输入！")
	 document.Book.Phone.focus();
	 return false;
   }
    if (document.Book.Email.value=="")
   { alert("请您输入Email地址")
	 document.Book.Email.focus();
	 return false;
   }
 if(!checkMail(document.Book.Email.value))
	{
	alert("您输入的E-mail格式不正确，请检查有写错误。");
	document.Book.Email.focus()
	return false;
	}	
   
  if (document.Book.Title.value=="")
   { alert("请您输入主题名称")
	 document.Book.Title.focus();
	 return false;
   }
   
  if (document.Book.Content.value=="")
   { alert("请您输入反馈内容")
	 document.Book.Content.focus();
	 return false;
   }
}

<!--检查英文留言是否输入正常-->
function CheckEnGuestBookSave()
{ 
 if (document.Book.Somane.value=="")
   { alert("Please enter the contact name")
	 document.Book.Somane.focus();
	 return false;
   }   
  if (document.Book.Phone.value=="")
   { alert("Please enter your contact Phone")
	 document.Book.Phone.focus();
	 return false;
   }
 for(i=0;i<document.Book.Phone.value.length;i++)
	{
	 ch=document.Book.Phone.value.charAt(i)
	if(!checkNumber(ch))
	{
	alert("You enter a contact phone is not correct, please check for errors.");
	document.Book.Phone.focus();
	return false;
	}
	}
	if (document.Book.Phone.value.length<8)
   { alert("You enter less than 8 or above, please re-enter the！")
	 document.Book.Phone.focus();
	 return false;
   }
    if (document.Book.Email.value=="")
   { alert("Please enter Email Address")
	 document.Book.Email.focus();
	 return false;
   }
 if(!checkMail(document.Book.Email.value))
	{
	alert("E-mail you entered is incorrect format, please check write errors.");
	document.Book.Email.focus()
	return false;
	}	
   
  if (document.Book.Title.value=="")
   { alert("Please enter a subject of name")
	 document.Book.Title.focus();
	 return false;
   }
   
  if (document.Book.Content.value=="")
   { alert("Please enter your feedback content")
	 document.Book.Content.focus();
	 return false;
   }
}

<!--检查订单是否输入正常-->
function CheckGuestOrderSave()
{ 
 if (document.Book.Somane.value=="")
   { alert("请您输入联系人名称")
	 document.Book.Somane.focus();
	 return false;
   }
  if (document.Book.Comane.value=="")
   { alert("请您输入公司名称")
	 document.Book.Comane.focus();
	 return false;
   }
  if (document.Book.Phone.value=="")
   { alert("请您输入联系电话")
	 document.Book.Phone.focus();
	 return false;
   }
 for(i=0;i<document.Book.Phone.value.length;i++)
	{
	 ch=document.Book.Phone.value.charAt(i)
	if(!checkNumber(ch))
	{
	alert("您输入的联系电话不正确，请检查有无错误。");
	document.Book.Phone.focus();
	return false;
	}
	}
	if (document.Book.Phone.value.length<8)
   { alert("你输入的不足八位以上，请重新输入！")
	 document.Book.Phone.focus();
	 return false;
   }
  if (document.Book.ProductName.value=="")
   { alert("请您输入产品名称")
	 document.Book.ProductName.focus();
	 return false;
   } 
 if (document.Book.Email.value=="")
   { alert("请您输入Email地址")
	 document.Book.Email.focus();
	 return false;
   }
 if(!checkMail(document.Book.Email.value))
	{
	alert("您输入的E-mail格式不正确，请检查有写错误。");
	document.Book.Email.focus()
	return false;
	}	
}

<!--检查产品咨询是否输入正常-->
function CheckAdvisorySave()
{  
 if (document.Book.Products.value=="")
   { alert("请您输入要咨询的产品名称")
	 document.Book.Products.focus();
	 return false;
   }
  if (document.Book.Somane.value=="")
   { alert("请您输入联系人名称")
	 document.Book.Somane.focus();
	 return false;
   }
   if (document.Book.Phone.value=="")
   { alert("请您输入联系电话")
	 document.Book.Phone.focus();
	 return false;
   }
 for(i=0;i<document.Book.Phone.value.length;i++)
	{
	 ch=document.Book.Phone.value.charAt(i)
	if(!checkNumber(ch))
	{
	alert("您输入的联系电话不正确，请检查有无错误。");
	document.Book.Phone.focus();
	return false;
	}
	}
	if (document.Book.Phone.value.length<8)
   { alert("你输入的不足八位以上，请重新输入！")
	 document.Book.Phone.focus();
	 return false;
   }
   if (document.Book.Email.value=="")
   { alert("请您输入Email地址")
	 document.Book.Email.focus();
	 return false;
   }
 if(!checkMail(document.Book.Email.value))
	{
	alert("您输入的E-mail格式不正确，请检查有写错误。");
	document.Book.Email.focus()
	return false;
	}
 if (document.Book.Content.value=="")
   { alert("请您输入反馈内容")
	 document.Book.Content.focus();
	 return false;
   }		
}

<!--检查客户登录用户是否输入正常-->
function CheckLogin()
{  
 if (document.Login.UserName.value=="")
   { alert("请您输入登录用户名")
	 document.Login.UserName.focus();
	 return false;
   }
 if (document.Login.Password.value=="")
   { alert("请您输入登录密码")
	 document.Login.Password.focus();
	 return false;
   }		
}

function CheckLogin1()
{  
 if (document.Login1.UserName.value=="")
   { alert("请您输入登录用户名")
	 document.Login1.UserName.focus();
	 return false;
   }
 if (document.Login1.Password.value=="")
   { alert("请您输入登录密码")
	 document.Login1.Password.focus();
	 return false;
   }		
}






<!--检查英文版客户登录用户是否输入正常-->
function CheckEnLogin()
{  
 if (document.Login.UserName.value=="")
   { alert("Please enter your user name registry")
	 document.Login.UserName.focus();
	 return false;
   }
 if (document.Login.Password.value=="")
   { alert("Please enter your password")
	 document.Login.Password.focus();
	 return false;
   }		
}



<!--检查英文版客户登录用户是否输入正常-->
function CheckEnLogin1()
{  
 if (document.Login1.UserName.value=="")
   { alert("Please enter your user name registry")
	 document.Login1.UserName.focus();
	 return false;
   }
 if (document.Login1.Password.value=="")
   { alert("Please enter your password")
	 document.Login1.Password.focus();
	 return false;
   }		
}












<!--检查客户注册是否输入正常-->
function CheckUserRegPost()
{  
 if (document.UserReg.UserName.value=="")
   { alert("请您输入用户名称")
	 document.UserReg.UserName.focus();
	 return false;
   }
 if (document.UserReg.Password.value=="")
   { alert("请您输入登录密码")
	 document.UserReg.Password.focus();
	 return false;
   }
 if (document.UserReg.Password.value.length>12 || document.UserReg.Password.value.length<6)
	{
	alert("请输入登录密码不能大于12小于6");
	document.UserReg.Password.focus();
	return false;
	}
 if (document.UserReg.PwdConfirm.value!=document.UserReg.Password.value)
   { alert("您输入的确认密码与登录密码不一致，请重新输入。")
	 document.UserReg.PwdConfirm.focus();
	 return false;
   }
 if (document.UserReg.Question.value=="")
   { alert("请您输入提示问题")
	 document.UserReg.Question.focus();
	 return false;
   }
 if (document.UserReg.Answer.value=="")
   { alert("请您输入问题答案")
	 document.UserReg.Answer.focus();
	 return false;
   }
 if (document.UserReg.Email.value=="")
   { alert("请您输入Email地址")
	 document.UserReg.Email.focus();
	 return false;
   }
 if(!checkMail(document.UserReg.Email.value))
	{
	alert("您输入的E-mail格式不正确，请检查有写错误。");
	document.UserReg.Email.focus()
	return false;
	}
  if (document.UserReg.Comane.value=="")
   { alert("请您输入公司名称")
	 document.UserReg.Comane.focus();
	 return false;
   }
 if (document.UserReg.Add.value=="")
   { alert("请您输入联系地址")
	 document.UserReg.Add.focus();
	 return false;
   } 
 if (document.UserReg.Somane.value=="")
   { alert("请您输入联系人")
	 document.UserReg.Somane.focus();
	 return false;
   }
 if (document.UserReg.Zip.value=="")
   { alert("请您输入邮政编码")
	 document.UserReg.Zip.focus();
	 return false;
   }
 for(i=0;i<document.UserReg.Zip.value.length;i++)
	{
	 ch=document.UserReg.Zip.value.charAt(i)
	if(!checkNumber(ch))
	{
	alert("您输入的邮政编码不正确，请检查有无错误。");
	document.UserReg.Zip.focus();
	return false;
	}
	}
 if (document.UserReg.Phone.value=="")
   { alert("请您输入联系电话")
	 document.UserReg.Phone.focus();
	 return false;
   }
}



<!--检查客户注册是否输入正常-->
function CheckEnUserRegPost()
{  
 if (document.UserReg.UserName.value=="")
   { alert("Please enter user name")
	 document.UserReg.UserName.focus();
	 return false;
   }
 if (document.UserReg.Password.value=="")
   { alert("Please enter your login password")
	 document.UserReg.Password.focus();
	 return false;
   }
 if (document.UserReg.Password.value.length>12 || document.UserReg.Password.value.length<6)
	{
	alert("Please enter the login password can not be greater than 12 is less than 6");
	document.UserReg.Password.focus();
	return false;
	}
 if (document.UserReg.PwdConfirm.value!=document.UserReg.Password.value)
   { alert("Confirm the password you entered is inconsistent with the login password, please re-enter the。")
	 document.UserReg.PwdConfirm.focus();
	 return false;
   }
 if (document.UserReg.Question.value=="")
   { alert("Please enter the Question")
	 document.UserReg.Question.focus();
	 return false;
   }
 if (document.UserReg.Answer.value=="")
   { alert("Please enter the answer")
	 document.UserReg.Answer.focus();
	 return false;
   }
 if (document.UserReg.Email.value=="")
   { alert("Please enter Email Address")
	 document.UserReg.Email.focus();
	 return false;
   }
 if(!checkMail(document.UserReg.Email.value))
	{
	alert("E-mail you entered is incorrect format, please check write errors。");
	document.UserReg.Email.focus()
	return false;
	}
  if (document.UserReg.Comane.value=="")
   { alert("Please enter the company name")
	 document.UserReg.Comane.focus();
	 return false;
   }
 if (document.UserReg.Add.value=="")
   { alert("Please enter the contact address")
	 document.UserReg.Add.focus();
	 return false;
   } 
 if (document.UserReg.Somane.value=="")
   { alert("Please enter the contact address")
	 document.UserReg.Somane.focus();
	 return false;
   }
 if (document.UserReg.Zip.value=="")
   { alert("Please enter a zip code")
	 document.UserReg.Zip.focus();
	 return false;
   }
 for(i=0;i<document.UserReg.Zip.value.length;i++)
	{
	 ch=document.UserReg.Zip.value.charAt(i)
	if(!checkNumber(ch))
	{
	alert("The postal code you entered is not correct, please check for errors。");
	document.UserReg.Zip.focus();
	return false;
	}
	}
 if (document.UserReg.Phone.value=="")
   { alert("Please enter your contact Phone")
	 document.UserReg.Phone.focus();
	 return false;
   }
}















<!--检查客户修改注册信息是否输入正常-->
function CheckUserRegPostEdit()
{  
 if (document.UserReg.UserName.value=="")
   { alert("请您输入用户名称")
	 document.UserReg.UserName.focus();
	 return false;
   }
 if (document.UserReg.Question.value=="")
   { alert("请您输入提示问题")
	 document.UserReg.Question.focus();
	 return false;
   }
 if (document.UserReg.Answer.value=="")
   { alert("请您输入问题答案")
	 document.UserReg.Answer.focus();
	 return false;
   }
 if (document.UserReg.Email.value=="")
   { alert("请您输入Email地址")
	 document.UserReg.Email.focus();
	 return false;
   }
 if(!checkMail(document.UserReg.Email.value))
	{
	alert("您输入的E-mail格式不正确，请检查有写错误。");
	document.UserReg.Email.focus()
	return false;
	}
  if (document.UserReg.Comane.value=="")
   { alert("请您输入公司名称")
	 document.UserReg.Comane.focus();
	 return false;
   }
 if (document.UserReg.Add.value=="")
   { alert("请您输入联系地址")
	 document.UserReg.Add.focus();
	 return false;
   } 
 if (document.UserReg.Somane.value=="")
   { alert("请您输入联系人")
	 document.UserReg.Somane.focus();
	 return false;
   }
 if (document.UserReg.Zip.value=="")
   { alert("请您输入邮政编码")
	 document.UserReg.Zip.focus();
	 return false;
   }
 for(i=0;i<document.UserReg.Zip.value.length;i++)
	{
	 ch=document.UserReg.Zip.value.charAt(i)
	if(!checkNumber(ch))
	{
	alert("您输入的邮政编码不正确，请检查有无错误。");
	document.UserReg.Zip.focus();
	return false;
	}
	}
 if (document.UserReg.Phone.value=="")
   { alert("请您输入联系电话")
	 document.UserReg.Phone.focus();
	 return false;
   }
}

<!--检查客户输入搜索是否正确-->
function CheckSearch()
{  
 if (document.Search.Title.value=="")
   { alert("请输入的要搜索的名称")
	 document.Search.Title.focus();
	 return false;
   }
}

function CheckEnSearch()
{  
 if (document.Search.Title.value=="")
   { alert("please input what you want to search")
	 document.Search.Title.focus();
	 return false;
   }
}


function checkChar(ch)
{
if ((ch>='a' && ch<='z') || (ch>='A' && ch<='Z') || (ch>='0' && ch<='9') || (ch=='_'))
{
//alert("合法");
return true;
}
else
{
//alert("不合法");
return false;
}
}

function show_sader(mylink)
{
window.open(mylink,'','top=140,left=135,width=480,height=280,scrollbars=no')
}

function eshop(id) { window.open("Eshop.asp?cpbm="+id,"","height=400,width=640,left=200,top=0,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
}

function keyword_onkeydown()
{
	if(window.event.keyCode==13)  document.Login.submit();
}

