// JavaScript Document
//高级查询
function clycq(){
	var a1=document.getElementById("TextBox1").value;
		tChk =/^(\d{4})(-|\/)(\d{1,2})\2(\d{1,2})$/;
		if(a1!=""){
			if(!tChk.exec(a1)){
				alert("请输入正确的时间（yyyy-MM-dd或yyyy/MM/dd)");
				return false;
			}else{
				return true;
			}
		}else{
			alert("预产期不能为空");return false;
		}
}
//精确查找
function xm(ve)
{
		if(ve.length!=0){
			if(ve.length>6){
				alert("用户名过长");return false;
			}else{
			ckstr=/[\u4e00-\u9fa5]/;
			if(!ckstr.exec(ve)){
				alert("请输入正确的姓名");
			return false;
			}else{
				return true;
			}}
		}else{
			alert("姓名不能为空");
			return false;
		}	
}
function gh(ve){
	if(ve.length==0){
		alert("工号不能为空");
		return false;
	}else if(ve.length>20){
		alert("工号过长");
		return false;
	}else{
		tChk = /^[^ \s~!@#$%\^\&\*\(\)_\+|\-\=\/\?:;'"\[\{\]\}`\.>,<\\]+$/;
			if(!tChk.exec(ve)){
				alert("工号填写错误！不得含有特殊符号！");
				return false;
			}else{
				return true;
			}
	}
}
function jqcz(){
	var ve=document.getElementById("TextBox2").value;
	var ve2=document.getElementById("TextBox3").value;
	if(ve.length==0&&ve2.length==0){
		alert("信息不能为空！");
		return false;
	}else{
		if(ve.length>0&&ve2.length>0){
			if(xm(ve)&&gh(ve2)){
				return true;
			}else{
				if(ve.length>0){
					if(xm(ve)){
						return true;
					}else{
						return false;
					}
				}
				if(ve2.length>0){
					if(gh(ve2)){
						return true;
					}else{
						return false;
					}
				}
			}
		}
	}
}
//育儿嫂
function xme(ve)
{
		if(ve.length!=0){
			if(ve.length>6){
				alert("用户名过长");return false;
			}else{
			ckstr=/[\u4e00-\u9fa5]/;
			if(!ckstr.exec(ve)){
				alert("请输入正确的姓名");
			return false;
			}else{
				return true;
			}}
		}else{
			alert("姓名不能为空");
			return false;
		}	
}
function ghe(ve){
	if(ve.length==0){
		alert("工号不能为空");
		return false;
	}else if(ve.length>20){
		alert("工号过长");
		return false;
	}else{
		tChk = /^[^ \s~!@#$%\^\&\*\(\)_\+|\-\=\/\?:;'"\[\{\]\}`\.>,<\\]+$/;
			if(!tChk.exec(ve)){
				alert("工号填写错误！不得含有特殊符号！");
				return false;
			}else{
				return true;
			}
	}
}
function yes(){
	var ve=document.getElementById("TextBox4").value;
	var ve2=document.getElementById("TextBox5").value;
	if(ve.length==0&&ve2.length==0){
		alert("信息不能为空！");
		return false;
	}else{
		if(ve.length>0&&ve2.length>0){
			if(xme(ve)&&ghe(ve2)){
				return true;
			}else{
				if(ve.length>0){
					if(xme(ve)){
						return true;
					}else{
						return false;
					}
				}
				if(ve2.length>0){
					if(ghe(ve2)){
						return true;
					}else{
						return false;
					}
				}
			}
		}
	}
}
//合同
function hth(){
	var ve=document.getElementById("TextBox7").value;
	if(ve.length==0){
		alert("号码不能为空");
		return false;
	}else if(ve.length>30){
		alert("号码过长");
		return false;
	}else{
		tChk = /^[^ \s~!@#$%\^\&\*\(\)_\+|\-\=\/\?:;'"\[\{\]\}`\.>,<\\]+$/;
			if(!tChk.exec(ve)){
				alert("号码填写错误！不得含有特殊符号！");
				return false;
			}else{
				return true;
			}
	}
}
function sjh(){
	var ve=document.getElementById("TextBox7").value;
	if(ve.length==0){
	alert("合同号不能为空");
		return false;
	}else if(ve.length>30){
		alert("收据过长");
		return false;
	}else{
		tChk = /^[^ \s~!@#$%\^\&\*\(\)_\+|\-\=\/\?:;'"\[\{\]\}`\.>,<\\]+$/;
			if(!tChk.exec(ve)){
				alert("收据号填写错误！不得含有特殊符号！");
				return false;
			}else{
				return true;
			}
	}	
}
function hts(){
	var ve=document.getElementById("TextBox6").value;
	var ve2=document.getElementById("TextBox7").value;
	if(ve.length==0&&ve2.length==0){
		alert("内容不能为空");
		return false;
	}else{
		if(hth(ve)||sjh(ve2)){
		return true;
	}else{
		return false;
	}
	}
}
