function checkform()
{
	if(document.getElementById("title").value=="")
	{
		alert("请填写标题!")
		return false;
	}
	if(document.getElementById("Guest_name").value=="")
	{
		alert("请填写您的名称!")
		return false;
	}
	if(document.getElementById("tel").value=="")
	{
		
		alert("请填写电话!")
		return false;
	}
	if(isTel(document.getElementById("tel").value))
	{
		
		alert("电话填写的格式不正确!")
		return false;
	}
	
	if(!document.getElementById("oicq").value=="")
	{
		if(isQQ(document.getElementById("oicq").value))
	    {
		alert("QQ号码填写的格式不正确!")
		return false;
	    }	
	}
	
	if(!document.getElementById("mial").value=="")
	{
		if(isMail(document.getElementById("mial").value))
	    {
		alert("E-MAIL的填写的格式不正确!")
		return false;
	    }	
	}
	
	
	if(document.getElementById("text").value=="")
	{
		
		alert("请填写留言内容!")
		return false;
	}
	if(document.getElementById("text").value.length>200)
	{
		
		alert("您请填写留言内容过长!")
		return false;
	}
	if(document.getElementById("otherpwd").value=="")
	{
		
		alert("请填写验证码!")
		return false;
	}
	return true;
	
}
	
	
function checkform2()
{
	
	if(document.getElementById("Guest_name").value=="")
	{
		alert("请填写您的名称!")
		return false;
	}
	if(document.getElementById("tel").value=="")
	{
		
		alert("请填写电话!")
		return false;
	}
	if(isTel(document.getElementById("tel").value))
	{
		
		alert("电话填写的格式不正确!")
		return false;
	}
	
	if(!document.getElementById("oicq").value=="")
	{
		if(isQQ(document.getElementById("oicq").value))
	    {
		alert("QQ号码填写的格式不正确!")
		return false;
	    }	
	}
	
	if(!document.getElementById("mial").value=="")
	{
		if(isMail(document.getElementById("mial").value))
	    {
		alert("E-MAIL的填写的格式不正确!")
		return false;
	    }	
	}
	
	
	if(document.getElementById("text").value=="")
	{
		
		alert("请填写留言内容!")
		return false;
	}
	return true;
	if(document.getElementById("num").value=="")
	{
		
		alert("请填写产品数量！")
		return false;
	}
	return true;

}
















//校验是否全由数字组成 
function isDigit(s) 
{ 
var patrn=/^[0-9]{1,20}$/; 
if (patrn.exec(s)) return false 
return true 
} 

//校验登录名：只能输入5-20个以字母开头、可带数字、“_”、“.”的字串 
function isRegisterUserName(s) 
{ 
var patrn=/^[a-zA-Z]{1}([a-zA-Z0-9]|[._]){4,19}$/; 
if (patrn.exec(s)) return false 
return true 
} 

//校验用户姓名：只能输入1-30个以字母开头的字串 
function isTrueName(s) 
{ 
var patrn=/^[a-zA-Z]{1,30}$/; 
if (patrn.exec(s)) return false 
return true 
} 

//校验密码：只能输入6-20个字母、数字、下划线 
function isPasswd(s) 
{ 
var patrn=/^(\w){6,20}$/; 
if (patrn.exec(s)) return false 
return true 
} 

//校验普通电话、传真号码：可以“+”开头，除数字外，可含有“-” 
function isTel(s) 
{ 
//var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?(\d){1,12})+$/; 
var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/; 
if (patrn.exec(s)) return false 
return true 
} 

//校验手机号码：必须以数字开头，除数字外，可含有“-” 
function isMobil(s) 
{ 
var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/; 
if (patrn.exec(s)) return false 
return true 
} 

//校验邮政编码 
function isPostalCode(s) 
{ 
//var patrn=/^[a-zA-Z0-9]{3,12}$/; 
var patrn=/^[a-zA-Z0-9 ]{3,12}$/; 
if (patrn.exec(s)) return false 
return true 
} 
//校验QQ 
function isQQ(s) 
{ 
//var patrn=/^[a-zA-Z0-9]{3,12}$/; 
var patrn=/[1-9][0-9]{4,}/; 
if (patrn.exec(s)) return false 
return true 
} 

//校验邮件 
function isMail(s) 
{ 
//var patrn=/^[a-zA-Z0-9]{3,12}$/; 
var patrn=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/; 
if (patrn.exec(s)) return false 
return true 
} 
