//专门用户form的检查
//检验用户
function checkuser(username,pwd1,pwd2){
	if(!isNull(username)){
		alert("用户登录名不能为空！");
		return false;
	}
	if(!isNull(pwd1) && !isNull(pwd2)){
		alert("用户密码不能为空！");
		return false;
	}
	if(pwd1!=pwd2){
		alert("两次输入的密码应该一样！");
		return false;
	}
	return true;checkdate
}



//对 个人用户 注册
function personcheck(checkuser){
	//checkuser:用于检查checkuser不能为空，以及密码必须一样！
        //if(document.mainform.prov_type.value.length<34){
	//	alert("省份不能为空！");
	//	document.mainform.prov_type.focus();
	//	return false;
	//}
        //if(document.mainform.city_type.value.length<43){
	//	alert("市不能为空！");
	//	document.mainform.city_type.focus();
	//	return false;
	//}
        //if(document.mainform.area_type.value.length<52){
	//	alert("区（县）不能为空！");
	//	document.mainform.area_type.focus();
	//	return false;
	//}
	if(!isNull(document.mainform.citycode.value)){
		//alert("个人姓名不能为空！");
		//document.mainform.citycode.focus();
		return false;
	}
	if(!isNull(document.mainform.Name.value)){
		alert("个人姓名不能为空！");
		document.mainform.Name.focus();
		return false;
	}
        //if(!isNull(document.mainform.PaperType.value)){
	//	alert("请选择证件类型！");
	//	document.mainform.PaperType.focus();
	//	return false;
	//}
	if(!isNull(document.mainform.PaperCode.value)){
		alert("身份证号码不能为空！");
		document.mainform.PaperCode.focus();
		return false;
	}
	if(!isIDCard(document.mainform.PaperCode.value)){
		alert("身份证号码必须由规定数字字符组成！");
		document.mainform.PaperCode.focus();
		return false;
	}
	if(document.mainform.PaperCode.value.length <15 || document.mainform.PaperCode.value.length >18 || (document.mainform.PaperCode.value.length >15 && document.mainform.PaperCode.value.length <18 )){
		alert("身份证号码必须是15或者18位！");
		document.mainform.PaperCode.focus();
		return false;
	}
	if(!isNull(document.mainform.Phone.value)){
		alert("联系电话不能为空！");
		document.mainform.Phone.focus();
		return false;
	}
	
        if(!isNumber(document.mainform.Mobile.value)){
		alert("手机的内容必须为数字！");
		document.mainform.Mobile.focus();
		return false;		
	}
        if(document.mainform.Mobile.value.length < 10 && document.mainform.Mobile.value.length >0 ){     
		alert("手机号码必须超过十一位！");
		document.mainform.Mobile.focus();
		return false;
	}
        if(!isNull(document.mainform.email.value)){
		alert("Email信箱不能为空！");
        	document.mainform.email.focus();
		return false;
        }
	if(!isEmail(document.mainform.email.value)){
		alert("Email信箱的格式必须正确！");
		document.mainform.email.focus();
		return false;
	}

        if(!isNull(document.mainform.Address.value)){
		alert("地址不能为空！");
		document.mainform.Address.focus();
		return false;
	}
	//if(!isNull(document.mainform.postcode.value)){
	//	alert("邮政编码不能为空！");
	//	document.mainform.postcode.focus();
	//	return false;
	//}
	if(!isNumber(document.mainform.zipcode.value)){
		alert("邮政编码的内容必须为数字！");
		document.mainform.zipcode.focus();
		return false;		
	}
	if(document.mainform.zipcode.value.length >0 && document.mainform.zipcode.value.length <6){     
		alert("邮政编码必须是六位数字！");
		document.mainform.zipcode.focus();
		return false;
	}
	if(checkuser=="yes"){ //检查登录用户名和用户密码
		if(!isNull(document.mainform.loginUser.value)){
			alert("登陆用户名不能为空！");
			document.mainform.loginUser.focus();
			return false;
		}
		if(!isNull(document.mainform.loginPwd.value)){
			alert("密码不能为空！");
			document.mainform.loginPwd.focus();
			return false;
		}
		if(!isNull(document.mainform.confirmPwd.value)){
			alert("确认密码不能为空！");
			document.mainform.confirmPwd.focus();
			return false;
		}
		if(document.mainform.loginPwd.value!=document.mainform.confirmPwd.value){
			alert("两次输入的密码应该一样！");
			document.mainform.loginPwd.focus();
			return false;
		}
	}
}

//对 业务人员 注册
function salecheck(checkuser){
        if(document.mainform.prov_type.value.length<33){
		alert("省份不能为空！");
		document.mainform.prov_type.focus();
		return false;
	}
        if(document.mainform.city_type.value.length<42){
		alert("市不能为空！");
		document.mainform.city_type.focus();
		return false;
	}
        if(document.mainform.area_type.value.length<51){
		alert("区（县）不能为空！");
		document.mainform.area_type.focus();
		return false;
	}
        if(!isNull(document.mainform.agentid.value)){
		alert("所属代理商不能为空！");
		document.mainform.agentid.focus();
		return false;
	}
	if(!isNull(document.mainform.Name.value)){
		alert("本人姓名不能为空！");
		document.mainform.Name.focus();
		return false;
	}
	//if(!isNull(document.mainform.PaperType.value)){
	//	alert("证件类型不能为空！");
	//	document.mainform.PaperType.focus();
	//	return false;
	//}
	if(!isNull(document.mainform.PaperCode.value)){
		alert("身份证号码不能为空！");
		document.mainform.PaperCode.focus();
		return false;
	}
        if(!isIDCard(document.mainform.PaperCode.value)){
		alert("身份证号码必须由规定数字字符组成！");
		document.mainform.PaperCode.focus();
		return false;
	}
        if(!isIDCard(document.mainform.PaperCode.value)){
		alert("身份证号码必须由规定数字字符组成！");
		document.mainform.PaperCode.focus();
		return false;
	}
        if(document.mainform.PaperCode.value.length <15 || document.mainform.PaperCode.value.length >18 || (document.mainform.PaperCode.value.length >15 && document.mainform.PaperCode.value.length <18 )){
		alert("身份证号码必须是15或者18位！");
		document.mainform.PaperCode.focus();
		return false;
	}
	if(!isNull(document.mainform.Hphone.value)){
		alert("家庭电话不能为空！");
		document.mainform.Hphone.focus();
		return false;
	}
	if(!isNull(document.mainform.Haddress.value)){
		alert("家庭地址不能为空！");
		document.mainform.Haddress.focus();
		return false;
	}
        if(!isNull(document.mainform.Pphone.value)){
		alert("手机不能为空！");
		document.mainform.Pphone.focus();
		return false;
	}
        if(!isNumber(document.mainform.Pphone.value)){
		alert("手机的内容必须为数字！");
		document.mainform.Pphone.focus();
		return false;		
	}
	if(document.mainform.Pphone.value.length < 10 && document.mainform.Pphone.value.length >0 ){     
		alert("手机号码必须超过十一位！");
		document.mainform.Pphone.focus();
		return false;
	}
	if(!isEmail(document.mainform.Email.value)){
		alert("Email信箱的格式必须正确！");
		document.mainform.Email.focus();
		return false;
	}
	if(!isNumber(document.mainform.ZipCode.value)){
		alert("邮政编码必须由数字组成！");
		document.mainform.ZipCode.focus();
		return false;
	}
        if(document.mainform.ZipCode.value.length >0 && document.mainform.ZipCode.value.length <6){     
		alert("邮政编码必须是六位数字！");
		document.mainform.ZipCode.focus();
		return false;
	}
	if(checkuser=="yes"){ //检查登录用户名和用户密码
		if(!isNull(document.mainform.loginUser.value)){
			alert("登陆用户名不能为空！");
			document.mainform.loginUser.focus();
			return false;
		}
		if(!isNull(document.mainform.loginPwd.value)){
			alert("密码不能为空！");
			document.mainform.loginPwd.focus();
			return false;
		}
		if(!isNull(document.mainform.confirmPwd.value)){
			alert("确认密码不能为空！");
			document.mainform.confirmPwd.focus();
			return false;
		}
		if(document.mainform.loginPwd.value!=document.mainform.confirmPwd.value){
			alert("两次输入的密码应该一样！");
			document.mainform.loginPwd.focus();
			return false;
		}
	}
}

//对 代理商 注册
function agentcheck(checkuser){
        if(!isNull(document.mainform.citycode.value)){
		//alert("代理商名称不能为空！");
		//document.mainform.citycode.focus();
		return false;
	}
	if(!isNull(document.mainform.Name.value)){
		alert("代理商名称不能为空！");
		document.mainform.Name.focus();
		return false;
	}
	if(!isNull(document.mainform.Caddress.value)){
		alert("单位地址不能为空！");
		document.mainform.Caddress.focus();
		return false;
	}
	if(!isNull(document.mainform.ZipCode.value)){
		alert("邮政编码不能为空！");
		document.mainform.ZipCode.focus();
		return false;
	}
        if(!isNumber(document.mainform.ZipCode.value)){
		alert("邮政编码必须由数字组成！");
		document.mainform.ZipCode.focus();
		return false;
	}
        if(document.mainform.ZipCode.value.length >0 && document.mainform.ZipCode.value.length <6){     
		alert("邮政编码必须是六位数字！");
		document.mainform.ZipCode.focus();
		return false;
	}
        if(!isNull(document.mainform.bank.value)){
		alert("开户银行不能为空！");
		document.mainform.bank.focus();
		return false;
	}
        if(!isNull(document.mainform.bankcode.value)){
		alert("银行帐号不能为空！");
		document.mainform.bankcode.focus();
		return false;
	}
	if(!isNull(document.mainform.Pname.value)){
		alert("负责人姓名不能为空！");
		document.mainform.Pname.focus();
		return false;
	}                            
	//if(!isNull(document.mainform.PpaperType.value)){
	//	alert("负责人证件类型不能为空！");
	//	document.mainform.PpaperType.focus();
	//	return false;
	//}
	if(!isNull(document.mainform.PpaperCode.value)){
		alert("负责人身份证号码不能为空！");
		document.mainform.PpaperCode.focus();
		return false;
	}
        if(!isIDCard(document.mainform.PpaperCode.value)){
		alert("身份证号码必须由规定数字字符组成！");
		document.mainform.PpaperCode.focus();
		return false;
	}
        if(document.mainform.PpaperCode.value.length <15 || document.mainform.PpaperCode.value.length >18 || (document.mainform.PpaperCode.value.length >15 && document.mainform.PpaperCode.value.length <18 )){
		alert("负责人身份证号码必须是15或者18位！");
		document.mainform.PpaperCode.focus();
		return false;
	}
	if(!isNull(document.mainform.Pphone.value)){
		alert("负责人电话不能为空！");
		document.mainform.Pphone.focus();
		return false;
	}
//	//if(!isNull(document.mainform.chargeFax.value)){
//	//	alert("负责人传真不能为空！");
//	//	document.mainform.chargeFax.focus();
//	//	return false;
//	//}
	if(!isNull(document.mainform.PEmail.value)){
		alert("负责人Email信箱不能为空！");
		document.mainform.PEmail.focus();
		return false;
	}
	if(!isEmail(document.mainform.PEmail.value)){
		alert("负责人Email信箱的格式必须正确！");
		document.mainform.PEmail.focus();
		return false;
	}
	if(!isNull(document.mainform.Ename.value)){
		alert("经办人姓名不能为空！");
		document.mainform.Ename.focus();
		return false;
	}
        //if(!isNull(document.mainform.EPaperType.value)){
	//	alert("经办人证件类型不能为空！");
	//	document.mainform.EPaperType.focus();
	//	return false;
	//}
	if(!isNull(document.mainform.EPaperCode.value)){
		alert("经办人身份证号码不能为空！");
		document.mainform.EPaperCode.focus();
		return false;
	}
        if(!isIDCard(document.mainform.EPaperCode.value)){
		alert("身份证号码必须由规定数字字符组成！");
		document.mainform.EPaperCode.focus();
		return false;
	}
        if(document.mainform.EPaperCode.value.length <15 || document.mainform.EPaperCode.value.length >18 || (document.mainform.EPaperCode.value.length >15 && document.mainform.EPaperCode.value.length <18 )){
		alert("经办人身份证号码必须是15或者18位！");
		document.mainform.EPaperCode.focus();
		return false;
	}
	if(!isNull(document.mainform.Ephone.value)){
		alert("经办人电话不能为空！");
		document.mainform.Ephone.focus();
		return false;
	}
//	if(!isNull(document.mainform.checkFax.value)){
//		alert("经办人传真不能为空！");
//		document.mainform.checkFax.focus();
//		return false;
//	}
	if(!isNull(document.mainform.EEmail.value)){
		alert("经办人Email信箱不能为空！");
		document.mainform.EEmail.focus();
		return false;
	}
	if(!isEmail(document.mainform.EEmail.value)){
		alert("经办人Email信箱的格式必须正确！");
		document.mainform.EEmail.focus();
		return false;
	}
        
	if(checkuser=="yes"){ //检查登录用户名和用户密码
		if(!isNull(document.mainform.loginUser.value)){
			alert("登陆用户名不能为空！");
			document.mainform.loginUser.focus();
			return false;
		}
		if(!isNull(document.mainform.loginPwd.value)){
			alert("密码不能为空！");
			document.mainform.loginPwd.focus();
			return false;
		}
		if(!isNull(document.mainform.confirmPwd.value)){
			alert("确认密码不能为空！");
			document.mainform.confirmPwd.focus();
			return false;
		}
		if(document.mainform.loginPwd.value!=document.mainform.confirmPwd.value){
			alert("两次输入的密码应该一样！");
			document.mainform.loginPwd.focus();
			return false;
		}
	}
}

//对 单位用户 注册
function companycheck(checkuser){
        if(!isNull(document.mainform.CityCode.value)){
		//alert("直辖市及省份不能为空！");
		//document.mainform.companyName.focus();
		return false;
	}
	if(!isNull(document.mainform.companyName.value)){
		alert("单位名称不能为空！");
		document.mainform.companyName.focus();
		return false;
	}
	if(!isNull(document.mainform.companyAddress.value)){
		alert("单位地址不能为空！");
		document.mainform.companyAddress.focus();
		return false;
	}
	if(!isNull(document.mainform.companypc.value)){
		alert("单位邮政编码不能为空！");
		document.mainform.companypc.focus();
		return false;
	}
	if(!isNumber(document.mainform.companypc.value)){
		alert("单位邮政编码必须由数字组成！");
		document.mainform.companypc.focus();
		return false;
	}
	if(!isNull(document.mainform.chargeName.value)){
		alert("负责人姓名不能为空！");
		document.mainform.chargeName.focus();
		return false;
	}
	if(!isNull(document.mainform.chargeIdcard.value)){
		alert("负责人身份证号不能为空！");
		document.mainform.chargeIdcard.focus();
		return false;
	}
        if(!isIDCard(document.mainform.chargeIdcard.value)){
		alert("身份证号码必须由规定数字字符组成！");
		document.mainform.chargeIdcard.focus();
		return false;
	}
        if(document.mainform.chargeIdcard.value.length <15 || document.mainform.chargeIdcard.value.length >18 || (document.mainform.chargeIdcard.value.length >15 && document.mainform.chargeIdcard.value.length <18 )){
		alert("经办人身份证号码必须是15或者18位！");
		document.mainform.chargeIdcard.focus();
		return false;
	}
	if(!isNull(document.mainform.chargePhone.value)){
		alert("负责人电话不能为空！");
		document.mainform.chargePhone.focus();
		return false;
	}
	if(!isNull(document.mainform.chargeFax.value)){
		alert("负责人传真不能为空！");
		document.mainform.chargeFax.focus();
		return false;
	}
	if(!isNull(document.mainform.chargeEmail.value)){
		alert("Email信箱不能为空！");
		document.mainform.chargeEmail.focus();
		return false;
	}
	if(!isEmail(document.mainform.chargeEmail.value)){
		alert("Email信箱的格式必须正确！");
		document.mainform.chargeEmail.focus();
		return false;
	}
	if(!isNull(document.mainform.checkName.value)){
		alert("经办人姓名不能为空！");
		document.mainform.checkName.focus();
		return false;
	}
	if(!isNull(document.mainform.checkIdcard.value)){
		alert("经办人身份证号不能为空！");
		document.mainform.checkIdcard.focus();
		return false;
	}
        if(!isIDCard(document.mainform.checkIdcard.value)){
		alert("身份证号码必须由规定数字字符组成！");
		document.mainform.checkIdcard.focus();
		return false;
	}
        if(document.mainform.checkIdcard.value.length <15 || document.mainform.checkIdcard.value.length >18 || (document.mainform.checkIdcard.value.length >15 && document.mainform.checkIdcard.value.length <18 )){
		alert("经办人身份证号码必须是15或者18位！");
		document.mainform.checkIdcard.focus();
		return false;
	}
	if(!isNull(document.mainform.checkPhone.value)){
		alert("经办人电话不能为空！");
		document.mainform.checkPhone.focus();
		return false;
	}
	if(!isNull(document.mainform.checkFax.value)){
		alert("经办人传真不能为空！");
		document.mainform.checkFax.focus();
		return false;
	}
	if(!isNull(document.mainform.checkEmail.value)){
		alert("Email信箱不能为空！");
		document.mainform.checkEmail.focus();
		return false;
	}
	if(!isEmail(document.mainform.checkEmail.value)){
		alert("Email信箱的格式必须正确！");
		document.mainform.checkEmail.focus();
		return false;
	}
	if(!isNull(document.mainform.checkDepartment.value)){
		alert("经办人所在部门不能为空！");
		document.mainform.checkDepartment.focus();
		return false;
	}
	if(!isNull(document.mainform.sendAddress.value)){
		alert("送货地址不能为空！");
		document.mainform.sendAddress.focus();
		return false;
	}
	if(!isNull(document.mainform.checkpc.value)){
		alert("送货邮政编码不能为空！");
		document.mainform.checkpc.focus();
		return false;
	}
	if(!isNumber(document.mainform.checkpc.value)){
		alert("送货邮政编码必须由数字组成！");
		document.mainform.checkpc.focus();
		return false;
	}
	if(!isNull(document.mainform.salename.value)){
		alert("服务人员姓名不能为空！");
		document.mainform.salename.focus();
		return false;
	}
	if(checkuser=="yes"){ //检查登录用户名和用户密码
		if(!isNull(document.mainform.loginUser.value)){
			alert("用户名不能为空！");
			document.mainform.loginUser.focus();
			return false;
		}
		if(!isNull(document.mainform.loginPwd.value)){
			alert("密码不能为空！");
			document.mainform.loginPwd.focus();
			return false;
		}
		if(!isNull(document.mainform.confirmPwd.value)){
			alert("密码不能为空！");
			document.mainform.confirmPwd.focus();
			return false;
		}
		if(document.mainform.loginPwd.value!=document.mainform.confirmPwd.value){
			alert("两次输入的密码应该一样！");
			document.mainform.loginPwd.focus();
			return false;
		}
	}
}

//对 单位负责人 注册
function companychargecheck(checkuser){
        if(!isNull(document.mainform.citycode.value)){
		//alert("单位名称不能为空！");
		//document.mainform.citycode.focus();
		return false;
	}
	if(!isNull(document.mainform.companyName.value)){
		alert("单位名称不能为空！");
		document.mainform.companyName.focus();
		return false;
	}
	if(!isNull(document.mainform.companyAddress.value)){
		alert("单位地址不能为空！");
		document.mainform.companyAddress.focus();
		return false;
	}
        if(!isNumber(document.mainform.zipcode.value)){
		alert("邮政编码必须由数字组成！");
		document.mainform.zipcode.focus();
		return false;
	}
        if(document.mainform.zipcode.value.length >0 && document.mainform.zipcode.value.length <6){     
		alert("邮政编码必须是六位数字！");
		document.mainform.zipcode.focus();
		return false;
	}
	if(!isNull(document.mainform.chargeName.value)){
		alert("负责人姓名不能为空！");
		document.mainform.chargeName.focus();
		return false;
	}
	if(!isNull(document.mainform.PaperCode.value)){
		alert("负责人身份证号码不能为空！");
		document.mainform.PaperCode.focus();
		return false;
	}
        if(!isIDCard(document.mainform.PaperCode.value)){
		alert("身份证号码必须由规定数字字符组成！");
		document.mainform.PaperCode.focus();
		return false;
	}
        if(document.mainform.PaperCode.value.length <15 || document.mainform.PaperCode.value.length >18 || (document.mainform.PaperCode.value.length >15 && document.mainform.PaperCode.value.length <18 )){
		alert("身份证号码必须是15或者18位！");
		document.mainform.PaperCode.focus();
		return false;
	}
	if(!isNull(document.mainform.chargePhone.value)){
		alert("负责人电话不能为空！");
		document.mainform.chargePhone.focus();
		return false;
	}
	if(!isNull(document.mainform.chargeEmail.value)){
		alert("Email信箱不能为空！");
        	document.mainform.chargeEmail.focus();
		return false;
        }
	
	if(!isEmail(document.mainform.chargeEmail.value)){
		alert("Email信箱的格式必须正确！");
		document.mainform.chargeEmail.focus();
		return false;
	}
        if(!isNull(document.mainform.Daddress.value)){
		alert("送货地址不能为空！");
		document.mainform.Daddress.focus();
		return false;
	}
        if(!isNumber(document.mainform.DZipCode.value)){
		alert("送货地址邮编必须由数字组成！");
		document.mainform.DZipCode.focus();
		return false;
	}
        if(document.mainform.DZipCode.value.length >0 && document.mainform.DZipCode.value.length <6){     
		alert("送货地址邮编必须是六位数字！");
		document.mainform.DZipCode.focus();
		return false;
	}
		if(checkuser=="yes"){ //检查登录用户名和用户密码
		if(!isNull(document.mainform.loginUser.value)){
			alert("登陆用户名不能为空！");
			document.mainform.loginUser.focus();
			return false;
		}
		if(!isNull(document.mainform.loginPwd.value)){
			alert("密码不能为空！");
			document.mainform.loginPwd.focus();
			return false;
		}
		if(!isNull(document.mainform.confirmPwd.value)){
			alert("确认密码不能为空！");
			document.mainform.confirmPwd.focus();
			return false;
		}
		if(document.mainform.loginPwd.value!=document.mainform.confirmPwd.value){
			alert("两次输入的密码应该一样！");
			document.mainform.loginPwd.focus();
			return false;
		}
	}
}
//对 单位经办人 注册
function companynormalcheck(checkuser){
       if(!isNull(document.mainform.citycode.value)){
		//alert("单位名称不能为空！");
		//document.mainform.citycode.focus();
		return false;
	}
	if(!isNull(document.mainform.companyName.value)){
		alert("单位名称不能为空！");
		document.mainform.companyName.focus();
		return false;
	}
        if(!isNull(document.mainform.companyAddress.value)){
		alert("单位地址不能为空！");
		document.mainform.companyAddress.focus();
		return false;
	}
        if(!isNumber(document.mainform.Czipcode.value)){
		alert("单位邮政编码必须由数字组成！");
		document.mainform.Czipcode.focus();
		return false;
	}
        if(document.mainform.Czipcode.value.length >0 && document.mainform.Czipcode.value.length <6){     
		alert("邮政编码必须是六位数字！");
		document.mainform.Czipcode.focus();
		return false;
	}
	if(!isNull(document.mainform.chargeName.value)){
		alert("经办人姓名不能为空！");
		document.mainform.chargeName.focus();
		return false;
	}
	//if(!isNull(document.mainform.PaperType.value)){
	//	alert("经办人证件类型不能为空！");
	//	document.mainform.PaperType.focus();
	//	return false;
	//}
	if(!isNull(document.mainform.PaperCode.value)){
		alert("经办人身份证号码不能为空！");
		document.mainform.PaperCode.focus();
		return false;
	}
        if(!isIDCard(document.mainform.PaperCode.value)){
		alert("身份证号码必须由规定数字字符组成！");
		document.mainform.PaperCode.focus();
		return false;
	}
        if(document.mainform.PaperCode.value.length <15 || document.mainform.PaperCode.value.length >18 || (document.mainform.PaperCode.value.length >15 && document.mainform.PaperCode.value.length <18 )){
		alert("经办人身份证号码必须是15或者18位！");
		document.mainform.PaperCode.focus();
		return false;
	}
	if(!isNull(document.mainform.chargePhone.value)){
		alert("经办人电话不能为空！");
		document.mainform.chargePhone.focus();
		return false;
	}
	if(!isEmail(document.mainform.chargeEmail.value)){
		alert("Email信箱的格式必须正确！");
		document.mainform.chargeEmail.focus();
		return false;
	}
	if(!isNull(document.mainform.Daddress.value)){
		alert("送货地址不能为空！");
		document.mainform.Daddress.focus();
		return false;
	}
	if(!isNumber(document.mainform.ZipCode.value)){
		alert("送货邮政编码必须由数字组成！");
		document.mainform.ZipCode.focus();
		return false;
	}
        if(document.mainform.ZipCode.value.length >0 && document.mainform.ZipCode.value.length <6){     
		alert("邮政编码必须是六位数字！");
		document.mainform.ZipCode.focus();
		return false;
	}
	if(checkuser=="yes"){ //检查登录用户名和用户密码
		if(!isNull(document.mainform.loginUser.value)){
			alert("登陆用户名不能为空！");
			document.mainform.loginUser.focus();
			return false;
		}
		if(!isNull(document.mainform.loginPwd.value)){
			alert("密码不能为空！");
			document.mainform.loginPwd.focus();
			return false;
		}
		if(!isNull(document.mainform.confirmPwd.value)){
			alert("确认密码不能为空！");
			document.mainform.confirmPwd.focus();
			return false;
		}
		if(document.mainform.loginPwd.value!=document.mainform.confirmPwd.value){
			alert("两次输入的密码应该一样！");
			document.mainform.loginPwd.focus();
			return false;
		}
	}
}
//对业务员协议进行检查
function saleprotocolcheck(){
	if(!isNull(document.mainform.protocolNum.value)){
		alert("协议编号不能为空！");
		document.mainform.protocolNum.focus();
		return false;
	}
	if(!isNull(document.mainform.saleNo.value)){
		alert("业务员代号不能为空！");
		document.mainform.saleNo.focus();
		return false;
	}
	if(!isNull(document.mainform.departName.value)){
		alert("业务员所在部门不能为空！");
		document.mainform.departName.focus();
		return false;
	}
	if(!isNull(document.mainform.protocoltime.value)){
		alert("合同期限不能为空！");
		document.mainform.protocoltime.focus();
		return false;
	}
	if(!isNull(document.mainform.begindate.value)){
		alert("合同起始日期不能为空！");
		document.mainform.begindate.focus();
		return false;
	}
	if(!isNull(document.mainform.enddate.value)){
		alert("合同终止日期不能为空！");
		document.mainform.enddate.focus();
		return false;
	}
	if(!isNull(document.mainform.creditLevel.value)){
		alert("信用等级不能为空！");	
		document.mainform.enddate.focus();
		return false;
	}
	if(!isNull(document.mainform.saleLevel.value)){
		alert("业务员等级不能为空！");
		document.mainform.saleLevel.focus();
		return false;
	}	
}

// 对样品注册进行检查
function specimencheck(){
	if(!isNull(document.mainform.productName.value)){
		alert("样品名称不能为空！");
		document.mainform.productName.focus();
		return false;
	}
	if(!isNull(document.mainform.productSize.value)){
		alert("样品尺寸不能为空！");
		document.mainform.productSize.focus();
		return false;
	}
	if(!isNull(document.mainform.productType.value)){
		alert("样品品种不能为空！");
		document.mainform.productType.focus();
		return false;
	}
	if(!isNull(document.mainform.coatShape.value)){
		alert("印壳形状不能为空！");
		document.mainform.coatShape.focus();
		return false;
	}
	if(!isNull(document.mainform.productType.value)){
		alert("产品类型不能为空！");
		document.mainform.productType.focus();
		return false;
	}
	if(!isNull(document.mainform.productGraph.value)){
		alert("产品图片不能为空！");
		document.mainform.productGraph.focus();
		return false;
	}
	if(!isNull(document.mainform.productSource.value)){
		alert("产品来源不能为空！");
		document.mainform.productSource.focus();
		return false;
	}
	if(!isNull(document.mainform.rowsPrice.value)){
		alert("原料价格不能为空！");
		document.mainform.rowsPrice.focus();
		return false;
	}
	if(!isNull(document.mainform.productPrice.value)){
		alert("产品生产价格不能为空！");
		document.mainform.productPrice.focus();
		return false;
	}
	if(!isNull(document.mainform.agentPrice.value)){
		alert("产品销售价格不能为空！");
		document.mainform.agentPrice.focus();
		return false;
	}
	if(!isNull(document.mainform.maxStore.value)){
		alert("最大库存量不能为空！");
		document.mainform.maxStore.focus();
		return false;
	}
	if(!isNull(document.mainform.minStore.value)){
		alert("最小库存量不能为空！");
		document.mainform.minStore.focus();
		return false;
	}

}
//lookuser form

function addnewusercheckinordorder(){
	if (!isNull(document.mainform.personname.value))
	{
		alert("经办人姓名不能为空！");
		document.mainform.personname.focus();
		return false;
	}
	if (!isNull(document.mainform.personphone.value))
	{
		alert("联系电话不能为空！");
		document.mainform.personphone.focus();
		return false;
	}
	if (!isNull(document.mainform.sendaddress.value))
	{
		alert("送货地址不能为空！");
		document.mainform.sendaddress.focus();
		return false;
	}
//	if(!isEmail(document.mainform.personEmail.value))
//	{
//		alert("Email信箱的格式必须正确！");
//		document.mainform.personEmail.focus();
//		return false;
//	}
}

function addnewusercheckinordorder1(){
	if (!isNull(document.mainform.personname.value))
	{
		alert("经办人姓名不能为空！");
		document.mainform.personname.focus();
		return false;
	}
	if (!isNull(document.mainform.personphone.value))
	{
		alert("联系电话不能为空！");
		document.mainform.personphone.focus();
		return false;
	}
	if (!isNull(document.mainform.personaddress.value))
	{
		alert("送货地址不能为空！");
		document.mainform.sendaddress.focus();
		return false;
	}
//	if(!isEmail(document.mainform.personEmail.value))
//	{
//		alert("Email信箱的格式必须正确！");
//		document.mainform.personEmail.focus();
//		return false;
//	}
}

function lookforcustomerinfo(){
	if (!isNull(document.mainform.name.value))
	{
		alert("经办人姓名不能为空！");
		document.mainform.name.focus();
		return false;
	}
	if (!isNull(document.mainform.phone.value))
	{
		alert("联系电话不能为空！");
		document.mainform.phone.focus();
		return false;
	}
	if(!isNumber(document.mainform.phone.value)){
		alert("联系电话必须由数字组成！");
		document.mainform.phone.focus();
		return false;
	}
	if(document.mainform.phone.value.length < 4){
		alert("联系电话必须超过四位！");
		document.mainform.phone.focus();
		return false;
	}
	if (!isNull(document.mainform.sendaddress.value))
	{
		alert("送货地址不能为空！");
		document.mainform.sendaddress.focus();
		return false;
	}
	
}
//send form

function sendformcheck(){
	if (!isNull(document.mainform.name.value))
	{
		alert("经办人姓名不能为空！");
		document.mainform.name.focus();
		return false;
	}
	if (!isNull(document.mainform.phone.value))
	{
		alert("联系电话不能为空！");
		document.mainform.phone.focus();
		return false;
	}
	if (!isNull(document.mainform.sendaddress.value))
	{
		alert("送货地址不能为空！");
		document.mainform.sendaddress.focus();
		return false;
	}
	if (!isNull(document.mainform.expectdate.value))
	{
		alert("期望日期不能为空！");
		document.mainform.expectdate.focus();
		return false;
	}
}

// 查询日期校验

	function checkdate(){

		if (!isNull(document.mainform.fromdate.value))
		{
			alert("年份不能为空！");
			document.mainform.fromdate.focus();
			return false;
		}
		if (!isNull(document.mainform.todate.value))
		{
			alert("年份不能为空！");
			document.mainform.todate.focus();
			return false;
		}
		if (!isDate_date(document.mainform.fromdate.value))
		{
			alert("期望日期应该正确输入！");
			document.mainform.fromdate.focus();
			return false;
		}
		if (!isDate_date(document.mainform.todate.value))
		{
			alert("期望日期应该正确输入！");
			document.mainform.todate.focus();
			return false;
		}
		return true
	}
	
function productcheckforadmin(){
	
	if (!isNull(document.mainform.name.value))
	{
		alert("产品名称不能为空！");
		document.mainform.name.focus();
		return false;
	}
	if (!isNull(document.mainform.productId.value))
	{
		alert("产品编号不能为空！");
		document.mainform.productId.focus();
		return false;
	}
	if (!isNull(document.mainform.pro_photo.value))
	{
		alert("产品图片不能为空！");
		document.mainform.pro_photo.focus();
		return false;
	}
	if (!isNull(document.mainform.size.value))
	{
		alert("产品尺寸不能为空！");
		document.mainform.size.focus();
		return false;
	}
	if (!isNull(document.mainform.kind.value))
	{
		alert("产品品种不能为空！");
		document.mainform.kind.focus();
		return false;
	}
//	if (!isNull(document.mainform.color.value))
//	{
//		alert("产品颜色不能为空！");
//		document.mainform.color.focus();
//		return false;
//	}
	if (!isNull(document.mainform.producePrice.value))
	{
		alert("产品生产价格不能为空！");
		document.mainform.producePrice.focus();
		return false;
	}
	if (!isNumberic(document.mainform.producePrice.value))
	{
		alert("产品生产价格应为数值！");
		document.mainform.producePrice.focus();
		return false;
	}
	if (!isNull(document.mainform.salePrice.value))
	{
		alert("销售价格不能为空！");
		document.mainform.salePrice.focus();
		return false;
	}
	if (!isNumberic(document.mainform.salePrice.value))
	{
		alert("销售价格应为数值！");
		document.mainform.salePrice.focus();
		return false;
	}
	if (!isNull(document.mainform.factoryPro.value))
	{
		alert("生产厂商不能为空！");
		document.mainform.factoryPro.focus();
		return false;
	}
//	if (!isNull(document.mainform.factorySale.value))
//	{
//		alert("销售厂商不能为空！");
//		document.mainform.factorySale.focus();
//		return false;
//	}
	if (!isNull(document.mainform.maxStore.value))
	{
		alert("最大库存不能为空！");
		document.mainform.maxStore.focus();
		return false;
	}
	if (!isNumberic(document.mainform.maxStore.value))
	{
		alert("最大库存量应为数值！");
		document.mainform.maxStore.focus();
		return false;
	}
	if (!isNull(document.mainform.minStore.value))
	{
		alert("最小库存不能为空！");
		document.mainform.minStore.focus();
		return false;
	}
	if (!isNumberic(document.mainform.minStore.value))
	{
		alert("最小库存量应为数值！");
		document.mainform.minStore.focus();
		return false;
	}
	if (!isNull(document.mainform.rebate1.value))
	{
		alert("产品折扣不能为空！");
		document.mainform.rebate1.focus();
		return false;
	}
	if (!isNull(document.mainform.rebate2.value))
	{
		alert("产品折扣不能为空！");
		document.mainform.rebate2.focus();
		return false;
	}
	if (!isNull(document.mainform.rebate3.value))
	{
		alert("产品折扣不能为空！");
		document.mainform.rebate3.focus();
		return false;
	}
	if (!isNull(document.mainform.rebate4.value))
	{
		alert("产品折扣不能为空！");
		document.mainform.rebate4.focus();
		return false;
	}
	if (!isNumberic(document.mainform.rebate1.value))
	{
		alert("产品折扣应为数值！");
		document.mainform.rebate1.focus();
		return false;
	}
	if (!isNumberic(document.mainform.rebate2.value))
	{
		alert("产品折扣应为数值！");
		document.mainform.rebate2.focus();
		return false;
	}
	if (!isNumberic(document.mainform.rebate3.value))
	{
		alert("产品折扣应为数值！");
		document.mainform.rebate3.focus();
		return false;
	}
	if (!isNumberic(document.mainform.rebate4.value))
	{
		alert("产品折扣应为数值！");
		document.mainform.rebate4.focus();
		return false;
	}
	if (!isNull(document.mainform.deduct1.value))
	{
		alert("产品提成不能为空！");
		document.mainform.deduct1.focus();
		return false;
	}
	if (!isNull(document.mainform.deduct2.value))
	{
		alert("产品提成不能为空！");
		document.mainform.deduct2.focus();
		return false;
	}
	if (!isNull(document.mainform.deduct3.value))
	{
		alert("产品提成不能为空！");
		document.mainform.deduct3.focus();
		return false;
	}
	if (!isNull(document.mainform.deduct4.value))
	{
		alert("产品提成不能为空！");
		document.mainform.deduct4.focus();
		return false;
	}
	if (!isNumberic(document.mainform.deduct1.value))
	{
		alert("产品提成应为数值！");
		document.mainform.deduct1.focus();
		return false;
	}
	if (!isNumberic(document.mainform.deduct2.value))
	{
		alert("产品提成应为数值！");
		document.mainform.deduct2.focus();
		return false;
	}
	if (!isNumberic(document.mainform.deduct3.value))
	{
		alert("产品提成应为数值！");
		document.mainform.deduct3.focus();
		return false;
	}
	if (!isNumberic(document.mainform.deduct4.value))
	{
		alert("产品提成应为数值！");
		document.mainform.deduct4.focus();
		return false;
	}
}

//productcheckforadmin_edit
function productcheckforadmin_edit(){
	
	if (!isNull(document.mainform.name.value))
	{
		alert("产品名称不能为空！");
		document.mainform.name.focus();
		return false;
	}
	if (!isNull(document.mainform.productId.value))
	{
		alert("产品编号不能为空！");
		document.mainform.productId.focus();
		return false;
	}
//	if (!isNull(document.mainform.pro_photo.value))
//	{
//		alert("产品图片不能为空！");
//		document.mainform.pro_photo.focus();
//		return false;
//	}
	if (!isNull(document.mainform.size.value))
	{
		alert("产品尺寸不能为空！");
		document.mainform.size.focus();
		return false;
	}
	if (!isNull(document.mainform.kind.value))
	{
		alert("产品品种不能为空！");
		document.mainform.kind.focus();
		return false;
	}
//	if (!isNull(document.mainform.color.value))
//	{
//		alert("产品颜色不能为空！");
//		document.mainform.color.focus();
//		return false;
//	}
	if (!isNull(document.mainform.producePrice.value))
	{
		alert("产品生产价格不能为空！");
		document.mainform.producePrice.focus();
		return false;
	}
	if (!isNumberic(document.mainform.producePrice.value))
	{
		alert("产品生产价格应为数值！");
		document.mainform.producePrice.focus();
		return false;
	}
	if (!isNull(document.mainform.salePrice.value))
	{
		alert("销售价格不能为空！");
		document.mainform.salePrice.focus();
		return false;
	}
	if (!isNumberic(document.mainform.salePrice.value))
	{
		alert("销售价格应为数值！");
		document.mainform.salePrice.focus();
		return false;
	}
	if (!isNull(document.mainform.factoryPro.value))
	{
		alert("生产厂商不能为空！");
		document.mainform.factoryPro.focus();
		return false;
	}
//	if (!isNull(document.mainform.factorySale.value))
//	{
//		alert("销售厂商不能为空！");
//		document.mainform.factorySale.focus();
//		return false;
//	}
	if (!isNull(document.mainform.maxStore.value))
	{
		alert("最大库存不能为空！");
		document.mainform.maxStore.focus();
		return false;
	}
	if (!isNumberic(document.mainform.maxStore.value))
	{
		alert("最大库存量应为数值！");
		document.mainform.maxStore.focus();
		return false;
	}
	if (!isNull(document.mainform.minStore.value))
	{
		alert("最小库存不能为空！");
		document.mainform.minStore.focus();
		return false;
	}
	if (!isNumberic(document.mainform.minStore.value))
	{
		alert("最小库存量应为数值！");
		document.mainform.minStore.focus();
		return false;
	}
	if (!isNull(document.mainform.rebate1.value))
	{
		alert("产品折扣不能为空！");
		document.mainform.rebate1.focus();
		return false;
	}
	if (!isNull(document.mainform.rebate2.value))
	{
		alert("产品折扣不能为空！");
		document.mainform.rebate2.focus();
		return false;
	}
	if (!isNull(document.mainform.rebate3.value))
	{
		alert("产品折扣不能为空！");
		document.mainform.rebate3.focus();
		return false;
	}
	if (!isNull(document.mainform.rebate4.value))
	{
		alert("产品折扣不能为空！");
		document.mainform.rebate4.focus();
		return false;
	}
	if (!isNumberic(document.mainform.rebate1.value))
	{
		alert("产品折扣应为数值！");
		document.mainform.rebate1.focus();
		return false;
	}
	if (!isNumberic(document.mainform.rebate2.value))
	{
		alert("产品折扣应为数值！");
		document.mainform.rebate2.focus();
		return false;
	}
	if (!isNumberic(document.mainform.rebate3.value))
	{
		alert("产品折扣应为数值！");
		document.mainform.rebate3.focus();
		return false;
	}
	if (!isNumberic(document.mainform.rebate4.value))
	{
		alert("产品折扣应为数值！");
		document.mainform.rebate4.focus();
		return false;
	}
	if (!isNull(document.mainform.deduct1.value))
	{
		alert("产品提成不能为空！");
		document.mainform.deduct1.focus();
		return false;
	}
	if (!isNull(document.mainform.deduct2.value))
	{
		alert("产品提成不能为空！");
		document.mainform.deduct2.focus();
		return false;
	}
	if (!isNull(document.mainform.deduct3.value))
	{
		alert("产品提成不能为空！");
		document.mainform.deduct3.focus();
		return false;
	}
	if (!isNull(document.mainform.deduct4.value))
	{
		alert("产品提成不能为空！");
		document.mainform.deduct4.focus();
		return false;
	}
	if (!isNumberic(document.mainform.deduct1.value))
	{
		alert("产品提成应为数值！");
		document.mainform.deduct1.focus();
		return false;
	}
	if (!isNumberic(document.mainform.deduct2.value))
	{
		alert("产品提成应为数值！");
		document.mainform.deduct2.focus();
		return false;
	}
	if (!isNumberic(document.mainform.deduct3.value))
	{
		alert("产品提成应为数值！");
		document.mainform.deduct3.focus();
		return false;
	}
	if (!isNumberic(document.mainform.deduct4.value))
	{
		alert("产品提成应为数值！");
		document.mainform.deduct4.focus();
		return false;
	}
}


//对  供应商 注册
function providercheck(checkuser){
        if(document.mainform.prov_type.value.length<36){
		alert("省份不能为空！");
		document.mainform.prov_type.focus();
		return false;
	}
        if(document.mainform.city_type.value.length<45){
		alert("市不能为空！");
		document.mainform.city_type.focus();
		return false;
	}
        if(document.mainform.area_type.value.length<54){
		alert("区（县）不能为空！");
		document.mainform.area_type.focus();
		return false;
	}
	if(!isNull(document.mainform.Name.value)){
		alert("供应商名称不能为空！");
		document.mainform.Name.focus();
		return false;
	}
	if(!isNull(document.mainform.Caddress.value)){
		alert("单位地址不能为空！");
		document.mainform.Caddress.focus();
		return false;
	}
	if(!isNull(document.mainform.ZipCode.value)){
		alert("邮政编码不能为空！");
		document.mainform.ZipCode.focus();
		return false;
	}
        if(!isNumber(document.mainform.ZipCode.value)){
		alert("邮政编码必须由数字组成！");
		document.mainform.ZipCode.focus();
		return false;
	}
        if(document.mainform.ZipCode.value.length >0 && document.mainform.ZipCode.value.length <6){     
		alert("邮政编码必须是六位数字！");
		document.mainform.ZipCode.focus();
		return false;
	}
        if(!isNull(document.mainform.bank.value)){
		alert("开户银行不能为空！");
		document.mainform.bank.focus();
		return false;
	}
        if(!isNull(document.mainform.bankcode.value)){
		alert("银行帐号不能为空！");
		document.mainform.bankcode.focus();
		return false;
	}
	if(!isNull(document.mainform.Pname.value)){
		alert("负责人姓名不能为空！");
		document.mainform.Pname.focus();
		return false;
	}                            
	//if(!isNull(document.mainform.PpaperType.value)){
	//	alert("负责人证件类型不能为空！");
	//	document.mainform.PpaperType.focus();
	//	return false;
	//}
	if(!isNull(document.mainform.PpaperCode.value)){
		alert("负责人身份证号码不能为空！");
		document.mainform.PpaperCode.focus();
		return false;
	}
       if(!isIDCard(document.mainform.PpaperCode.value)){
		alert("身份证号码必须由规定数字字符组成！");
		document.mainform.PpaperCode.focus();
		return false;
	}
        if(document.mainform.PpaperCode.value.length <15 || document.mainform.PpaperCode.value.length >18 || (document.mainform.PpaperCode.value.length >15 && document.mainform.PpaperCode.value.length <18 )){
		alert("负责人身份证号码必须是15或者18位！");
		document.mainform.PpaperCode.focus();
		return false;
	}
	if(!isNull(document.mainform.Pphone.value)){
		alert("负责人电话不能为空！");
		document.mainform.Pphone.focus();
		return false;
	}
//	//if(!isNull(document.mainform.chargeFax.value)){
//	//	alert("负责人传真不能为空！");
//	//	document.mainform.chargeFax.focus();
//	//	return false;
//	//}
	if(!isNull(document.mainform.PEmail.value)){
		alert("负责人Email信箱不能为空！");
		document.mainform.PEmail.focus();
		return false;
	}
	if(!isEmail(document.mainform.PEmail.value)){
		alert("负责人Email信箱的格式必须正确！");
		document.mainform.PEmail.focus();
		return false;
	}
	if(!isNull(document.mainform.Ename.value)){
		alert("经办人姓名不能为空！");
		document.mainform.Ename.focus();
		return false;
	}
        //if(!isNull(document.mainform.EPaperType.value)){
	//	alert("经办人证件类型不能为空！");
	//	document.mainform.EPaperType.focus();
	//	return false;
	//}
	if(!isNull(document.mainform.EPaperCode.value)){
		alert("经办人身份证号码不能为空！");
		document.mainform.EPaperCode.focus();
		return false;
	}
        if(!isIDCard(document.mainform.EPaperCode.value)){
		alert("身份证号码必须由规定数字字符组成！");
		document.mainform.EPaperCode.focus();
		return false;
	}
        if(document.mainform.EPaperCode.value.length <15 || document.mainform.EPaperCode.value.length >18 || (document.mainform.EPaperCode.value.length >15 && document.mainform.EPaperCode.value.length <18 )){
		alert("经办人身份证号码必须是15或者18位！");
		document.mainform.EPaperCode.focus();
		return false;
	}
	if(!isNull(document.mainform.Ephone.value)){
		alert("经办人电话不能为空！");
		document.mainform.Ephone.focus();
		return false;
	}
//	if(!isNull(document.mainform.checkFax.value)){
//		alert("经办人传真不能为空！");
//		document.mainform.checkFax.focus();
//		return false;
//	}
	if(!isNull(document.mainform.EEmail.value)){
		alert("经办人Email信箱不能为空！");
		document.mainform.EEmail.focus();
		return false;
	}
	if(!isEmail(document.mainform.EEmail.value)){
		alert("经办人Email信箱的格式必须正确！");
		document.mainform.EEmail.focus();
		return false;
	}
        
	if(checkuser=="yes"){ //检查登录用户名和用户密码
		if(!isNull(document.mainform.loginUser.value)){
			alert("登陆用户名不能为空！");
			document.mainform.loginUser.focus();
			return false;
		}
		if(!isNull(document.mainform.loginPwd.value)){
			alert("密码不能为空！");
			document.mainform.loginPwd.focus();
			return false;
		}
		if(!isNull(document.mainform.confirmPwd.value)){
			alert("确认密码不能为空！");
			document.mainform.confirmPwd.focus();
			return false;
		}
		if(document.mainform.loginPwd.value!=document.mainform.confirmPwd.value){
			alert("两次输入的密码应该一样！");
			document.mainform.loginPwd.focus();
			return false;
		}
	}
}
//ESEAL注册表单确认
function logincheck(checkuser){
	        if(checkuser=="yes"){
		if(!isNull(document.mainform.loginUser.value)){
			alert("登陆用户名不能为空！");
			document.mainform.loginUser.focus();
			return false;
		}
		if(!isNull(document.mainform.loginPwd.value)){
			alert("密码不能为空！");
			document.mainform.loginPwd.focus();
			return false;
		}
		if(!isNull(document.mainform.confirmPwd.value)){
			alert("确认密码不能为空！");
			document.mainform.confirmPwd.focus();
			return false;
		}
		if(document.mainform.loginPwd.value!=document.mainform.confirmPwd.value){
			alert("两次输入的密码应该一样！");
			document.mainform.loginPwd.focus();
			return false;
		}
       }
               
}  
//密码修改表单检查
function changecheck(checkuser){
	        if(checkuser=="yes"){
		if(!isNull(document.mainform.oldpwd.value)){
			alert("旧密码不能为空！");
			document.mainform.oldpwd.focus();
			return false;
		}
		if(!isNull(document.mainform.newpwd.value)){
			alert("新密码不能为空！");
			document.mainform.newpwd.focus();
			return false;
		}
		if(!isNull(document.mainform.confirmnew.value)){
			alert("确认密码不能为空！");
			document.mainform.confirmnew.focus();
			return false;
		}
		if(document.mainform.newpwd.value!=document.mainform.confirmnew.value){
			alert("两次输入的密码应该一样！");
			document.mainform.newpwd.focus();
			return false;
		}
       }
               
}  


//信息修改
function changepersoncheck(checkuser){
	
	if(!isNull(document.mainform.Phone.value)){
		alert("联系电话不能为空！");
		document.mainform.Phone.focus();
		return false;
	}
	//if(document.mainform.Phone.value.length < 7){     
	//	alert("联系电话必须超过七位！");
	//	document.mainform.Phone.focus();
	//	return false;
	//}
        if(!isNumber(document.mainform.Mobile.value)){
		alert("手机的内容必须为数字！");
		document.mainform.Mobile.focus();
		return false;		
	}
        
	if(!isNumber(document.mainform.zipcode.value)){
		alert("邮政编码的内容必须为数字！");
		document.mainform.zipcode.focus();
		return false;		
	}
	if(!isNull(document.mainform.email.value)){
		alert("Email信箱不能为空！");
        	document.mainform.email.focus();
		return false;
        }
	if(!isEmail(document.mainform.email.value)){
		alert("Email信箱的格式必须正确！");
		document.mainform.email.focus();
		return false;
	}
    if(!isNull(document.mainform.Address.value)){
		alert("送货地址不能为空！");
		document.mainform.Address.focus();
		return false;
	}
}
//修改业务员
function changesalescheck(checkuser){
        
	if(!isNull(document.mainform.Hphone.value)){
		alert("家庭电话不能为空！");
		document.mainform.Hphone.focus();
		return false;
	}
	if(!isNull(document.mainform.Haddress.value)){
		alert("家庭地址不能为空！");
		document.mainform.Haddress.focus();
		return false;
	}
	if(!isNull(document.mainform.Pphone.value)){
		alert("手机号码不能为空！");
		document.mainform.Pphone.focus();
		return false;
	}
	if(!isEmail(document.mainform.Email.value)){
		alert("Email信箱的格式必须正确！");
		document.mainform.Email.focus();
		return false;
	}
	if(!isNumber(document.mainform.ZipCode.value)){
		alert("邮政编码必须由数字组成！");
		document.mainform.ZipCode.focus();
		return false;
	}
	
}

//对 业务员添加个人用户的表单提交确认
      function salespersoncheck(checkuser){
        if(document.mainform.prov_type.value.length<41){
		alert("省份不能为空！");
		document.mainform.prov_type.focus();
		return false;
	}
        if(document.mainform.city_type.value.length<50){
		alert("市不能为空！");
		document.mainform.city_type.focus();
		return false;
	}
        if(document.mainform.area_type.value.length<59){
		alert("区（县）不能为空！");
		document.mainform.area_type.focus();
		return false;
	}
	if(!isNull(document.mainform.Name.value)){
		alert("个人姓名不能为空！");
		document.mainform.Name.focus();
		return false;
	}
        //if(!isNull(document.mainform.PaperType.value)){
	//	alert("请选择证件类型！");
	//	document.mainform.PaperType.focus();
	//	return false;
	//}
	//if(!isNull(document.mainform.PaperCode.value)){
	//	alert("身份证号码不能为空！");
	//	document.mainform.PaperCode.focus();
	//	return false;
	//}
	if(!isNumber(document.mainform.PaperCode.value)){
		alert("身份证号码必须由数字组成！");
		document.mainform.PaperCode.focus();
		return false;
	}
	if(document.mainform.PaperCode.value.length>0 && (document.mainform.PaperCode.value.length <15 || document.mainform.PaperCode.value.length >18 || (document.mainform.PaperCode.value.length >15 && document.mainform.PaperCode.value.length <18 ))){
		alert("身份证号码必须是15或者18位！");
		document.mainform.PaperCode.focus();
		return false;
	}
	if(!isNull(document.mainform.Phone.value)){
		alert("联系电话不能为空！");
		document.mainform.Phone.focus();
		return false;
	}
	
        if(!isNumber(document.mainform.Mobile.value)){
		alert("手机的内容必须为数字！");
		document.mainform.Mobile.focus();
		return false;		
	}
        if(document.mainform.Mobile.value.length < 10 && document.mainform.Mobile.value.length >0 ){     
		alert("手机号码必须超过十一位！");
		document.mainform.Mobile.focus();
		return false;
	}
        //if(!isNull(document.mainform.personEmail.value)){
	//	alert("Email信箱不能为空！");
	//	document.mainform.personEmail.focus();
	//	return false;
	//}
	if(!isEmail(document.mainform.email.value)){
		alert("Email信箱的格式必须正确！");
		document.mainform.email.focus();
		return false;
	}

        if(!isNull(document.mainform.Address.value)){
		alert("地址不能为空！");
		document.mainform.Address.focus();
		return false;
	}
	//if(!isNull(document.mainform.postcode.value)){
	//	alert("邮政编码不能为空！");
	//	document.mainform.postcode.focus();
	//	return false;
	//}
	if(!isNumber(document.mainform.zipcode.value)){
		alert("邮政编码的内容必须为数字！");
		document.mainform.zipcode.focus();
		return false;		
	}
	if(document.mainform.zipcode.value.length >0 && document.mainform.zipcode.value.length <6){     
		alert("邮政编码必须是六位数字！");
		document.mainform.zipcode.focus();
		return false;
	}
	
}

//对 业务员添加 单位经办人 用户
function salescompanynormalcheck(checkuser){
        if(document.mainform.prov_type.value.length<42){
		alert("省份不能为空！");
		document.mainform.prov_type.focus();
		return false;
	}
        if(document.mainform.city_type.value.length<51){
		alert("市不能为空！");
		document.mainform.city_type.focus();
		return false;
	}
        if(document.mainform.area_type.value.length<60){
		alert("区（县）不能为空！");
		document.mainform.area_type.focus();
		return false;
	}
	if(!isNull(document.mainform.companyName.value)){
		alert("单位名称不能为空！");
		document.mainform.companyName.focus();
		return false;
	}
        //if(!isNull(document.mainform.companyAddress.value)){
	//	alert("单位地址不能为空！");
	//	document.mainform.companyAddress.focus();
	//	return false;
	//}
        if(!isNumber(document.mainform.Czipcode.value)){
		alert("单位邮政编码必须由数字组成！");
		document.mainform.Czipcode.focus();
		return false;
	}
        if(document.mainform.Czipcode.value.length >0 && document.mainform.Czipcode.value.length <6){     
		alert("邮政编码必须是六位数字！");
		document.mainform.Czipcode.focus();
		return false;
	}
	if(!isNull(document.mainform.chargeName.value)){
		alert("经办人姓名不能为空！");
		document.mainform.chargeName.focus();
		return false;
	}
	//if(!isNull(document.mainform.PaperType.value)){
	//	alert("经办人证件类型不能为空！");
	//	document.mainform.PaperType.focus();
	//	return false;
	//}
	//if(!isNull(document.mainform.PaperCode.value)){
	//	alert("经办人身份证号码不能为空！");
	//	document.mainform.PaperCode.focus();
	//	return false;
	//}
         if(!isNumber(document.mainform.PaperCode.value)){
		alert("身份证号码必须由数字组成！");
		document.mainform.PaperCode.focus();
		return false;
	}
        if(document.mainform.PaperCode.value.length>0 && (document.mainform.PaperCode.value.length <15 || document.mainform.PaperCode.value.length >18 || (document.mainform.PaperCode.value.length >15 && document.mainform.PaperCode.value.length <18 ))){
		alert("经办人身份证号码必须是15或者18位！");
		document.mainform.PaperCode.focus();
		return false;
	}
	if(!isNull(document.mainform.chargePhone.value)){
		alert("经办人电话不能为空！");
		document.mainform.chargePhone.focus();
		return false;
	}
	if(!isEmail(document.mainform.chargeEmail.value)){
		alert("Email信箱的格式必须正确！");
		document.mainform.chargeEmail.focus();
		return false;
	}
	if(!isNull(document.mainform.Daddress.value)){
		alert("送货地址不能为空！");
		document.mainform.Daddress.focus();
		return false;
	}
	if(!isNumber(document.mainform.ZipCode.value)){
		alert("送货邮政编码必须由数字组成！");
		document.mainform.ZipCode.focus();
		return false;
	}
        if(document.mainform.ZipCode.value.length >0 && document.mainform.ZipCode.value.length <6){     
		alert("邮政编码必须是六位数字！");
		document.mainform.ZipCode.focus();
		return false;
	}
	
}

//对 修改代理商供应商表单提交
function changeprovidercheck(){	
	if(!isNull(document.mainform.Caddress.value)){
		alert("单位地址不能为空！");
		document.mainform.Caddress.focus();
		return false;
	}
	if(!isNull(document.mainform.ZipCode.value)){
		alert("邮政编码不能为空！");
		document.mainform.ZipCode.focus();
		return false;
	}
        if(!isNumber(document.mainform.ZipCode.value)){
		alert("邮政编码必须由数字组成！");
		document.mainform.ZipCode.focus();
		return false;
	}
        if(document.mainform.ZipCode.value.length >0 && document.mainform.ZipCode.value.length <6){     
		alert("邮政编码必须是六位数字！");
		document.mainform.ZipCode.focus();
		return false;
	}
        
	if(!isNull(document.mainform.Pphone.value)){
		alert("负责人电话不能为空！");
		document.mainform.Pphone.focus();
		return false;
	}
	if(!isNull(document.mainform.PEmail.value)){
		alert("负责人Email信箱不能为空！");
		document.mainform.PEmail.focus();
		return false;
	}
	if(!isEmail(document.mainform.PEmail.value)){
		alert("负责人Email信箱的格式必须正确！");
		document.mainform.PEmail.focus();
		return false;
	}
	
	if(!isNull(document.mainform.Ephone.value)){
		alert("经办人电话不能为空！");
		document.mainform.Ephone.focus();
		return false;
	}
	if(!isNull(document.mainform.EEmail.value)){
		alert("经办人Email信箱不能为空！");
		document.mainform.EEmail.focus();
		return false;
	}
	if(!isEmail(document.mainform.EEmail.value)){
		alert("经办人Email信箱的格式必须正确！");
		document.mainform.EEmail.focus();
		return false;
	}      	
}

//ESEAL收讫
function logincheckpaid(checkuser){
	        if(checkuser=="yes"){
	        if(!isNull(document.mainform.BatchID.value)){
			alert("系列号不能为空！");
			document.mainform.BatchID.focus();
			return false;
		}
		if(!isNull(document.mainform.loginUser.value)){
			alert("用户名不能为空！");
			document.mainform.loginUser.focus();
			return false;
		}
		if(!isNull(document.mainform.loginPwd.value)){
			alert("登录密码不能为空！");
			document.mainform.loginPwd.focus();
			return false;
		}
       }
               
}  

//ESEAL启用
function logincheckstartup(checkuser){
	        if(checkuser=="yes"){
	        if(!isNull(document.mainform.BatchID.value)){
			alert("系列号不能为空！");
			document.mainform.BatchID.focus();
			return false;
		}
		if(!isNull(document.mainform.startupPwd.value)){
			alert("启用密码不能为空！");
			document.mainform.startupPwd.focus();
			return false;
		}
       }
               
}  