// JavaScript Document<!--
function CheckForm()
{
	if(document.theform.name.value=="")
	{
		alert("请输入你的姓名!");
		document.theform.name.focus();
		return false;
	}
	if(document.theform.company.value=="")
	{
		alert("请输入公司名称!");
		document.theform.company.focus();
		return false;
	}
	if(document.theform.address.value=="")
	{
		alert("请输入公司地址!");
		document.theform.address.focus();
		return false;
	}
	if(document.theform.tel.value=="")
	{
		alert("请输入联系电话!");
		document.theform.tel.focus();
		return false;
	}
	if(document.theform.mail.value=="")
	{
		alert("请输入你的联系E-mail!");
		document.theform.mail.focus();
		return false;
	}
	
	if(document.theform.mail.value!=""){
	var email = theform.mail.value; 
	var pattern = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/; 
	flag = pattern.test(email); 
	if(!flag){ 
		alert("email格式不正确!"); 
		theform.mail.focus(); 
		return false; 
	}
	}
	if(document.theform.content.value == "")
	{
		alert("请输入留言内容！");
		document.theform.content.focus();
		return false;
	}
}

function checkNum(obj){
	var checkOK = "0123456789 ";
	var checkStr = obj.value;
	var allValid = true;
	for (i = 0;  i < checkStr.length;  i++){
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
		if (ch == checkOK.charAt(j))
			break;
		if (j == checkOK.length){
			allValid = false;
			break;
		}
	}
	if (!allValid){
		alert("只能由数字组成！");
		obj.value="";
		obj.select();
		return (false);
	}
	return (true);	
}
function checkemail(email,lbl)
{
	email=trim(email);
	if ( email.length == 0) 
		return true;
	
	var re="/^[\-!#\$%&'\*\+\\\.\/0-9=\?A-Z\^_`a-z{|}~]+@[\-!#\$%&'\*\+\\\.\/0-9=\?A-Z\^_`a-z{|}~]+(\.[\-!#\$%&'\*\+\\\.\/0-9=\?A-Z\^_`a-z{|}~]+)+$/";
	
	if (re.test(email))
		return true;
	
	alert("系统提示："+lbl+":"+"不正确的email地址");
	return false;

}
//-->