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