 
//添加留言调用
function Add(the){
	//判断昵称如果为空自动输入“网友”
	if(the.Name.value==""){
		the.Name.value="网友";
	}
	//判断昵称不能为以下特殊符号
	tChk = /^[^ \s~!@#$%\^\&\*\(\)_\+|\-\=\/\?:;'"\[\{\]\}`\.>,<\\]+$/;
	if(!tChk.exec(the.Name.value)){
		alert("请输入正确的姓名！\n\n姓名必须在1-10位之间，且不得含有特殊符号！");
		the.Name.focus();
		return false;
	}
	//判断昵称不得小于10个字符
	if(the.Name.value.length>10){
		alert("昵称不得大于10个字符！");
		the.Name.focus();
		return false;
	}
	//判断EMAIL
	tChk = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
	if(!tChk.exec(the.Mail.value)){
		alert("请输入正确的E-Mail！");
		the.Mail.focus();
		return false;
	}
	//判断QQ不能小于5
	if(the.Qq.value.length<5){
		alert("QQ不得小于5个字符！");
		the.Qq.focus();
		return false;
	}
	//判断QQ不能大于9
	if(the.Qq.value.length>9){
		alert("QQ不得大于9个字符！");
		the.Qq.focus();
		return false;
	}
	//判断QQ只能为数字
	if(isNaN(the.Qq.value))
		 {
		     alert("有不是数字的QQ吗？！");
			 
			 return  false;		
		 } 	
	//判断留言内容只能大于10
	if(the.Info.value.length<10){
		alert("留言内容不得小于10个字符！");
		the.Info.focus();
		return false;
	}
	//判断留言内容只能小于1200
	if(the.Info.value.length>1200){
		alert("留言内容不得大于1200个字符！");
		the.Info.focus();
		return false;
	}
}
//登陆后台调用
function Login(the){
	//判断管理员不能为空
	if(the.User.value==""){
		alert("管理员不能为空！");
		the.User.focus();
		return false;
	}
	//判断管理员密码不能为空
	if(the.password.value==""){
		alert("管理员不能为空！");
		the.password.focus();
		return false;
	}
}

//修改管理员调用
function Modify_admin(the){
	//判断管理员不能为空
	if(the.User.value==""){
		alert("管理员不能为空！");
		the.User.focus();
		return false;
	}
	//判断管理员旧密码不能为空
	if(the.oldpass.value==""){
		alert("管理员旧密码不能为空！");
		the.oldpass.focus();
		return false;
	}
	//判断管理员新密码不能为空
	if(the.newpass.value==""){
		alert("管理员新密码不能为空！");
		the.newpass.focus();
		return false;
	}
	//判断管理员新密码不得小于6个字符
	if(the.newpass.value.length<6){
		alert("管理员新密码不得小于6个字符！");
		the.newpass.focus();
		return false;
	}
	//判断管理员确认密码不能为空
	if(the.confirm.value==""){
		alert("管理员确认密码不能为空！");
		the.confirm.focus();
		return false;
	}
	//判断管理员两次新密码必须相等
	if(the.newpass.value!=the.confirm.value){
		alert("两次新密码不一致！");
		the.newpass.focus();
		return false;
	}
}

//删除留言
function Del()
{
if(confirm("请确定是否删除留言！"))
	return true;
else
	return false;

}
 