		var flag=[0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0];
		var $=function(tagName){
			return document.getElementsByTagName(tagName);
		}
		var $div=function(tagName){
			return document.getElementById(tagName+"_txt");
		}
		var $val=function(tagName){
			return document.getElementById(tagName);
		}
		var thisname;
		var thisinfo;
		function getinfo(){
			thisname=event.srcElement.name;
			thisinfo=$val(thisname).value;
		}

	//----------接受协议
		function accept_info(){
			flag[0]=1;
			check_data();
		}
	//----------拒绝协议
		function refuse_info(){
			flag[0]=0;
			check_data();
		}

	//----------邮箱检测
		function check_email(email){
			var reEmail=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
			var b_email=reEmail.test(email);
			if(b_email){
				$("span")[13].innerHTML="<img src='images/reg_yesok.gif'/> 邮箱可用";
				flag[1]=1;
				check_data();
			}
			else{
				$("span")[13].innerHTML="<img src='images/reg_yesno.gif'/> 邮箱错误";
				flag[1]=0;
				check_data();
			}
		}
	//----------长度判断
		function getStrActualLen(sChars){  
				return sChars.replace(/[^\x00-\xff]/g,"xx").length;  
			} 

	//***************************************
	//检查中文输入
		function isChinese(str){ 
				var badChar ="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 
				badChar += "abcdefghijklmnopqrstuvwxyz"; 
				badChar += "0123456789"; 
				badChar += " "+"　";//半角与全角空格 
				badChar += "`~!@#$%^&()-_=+]\\\\|:;\\\\\<,>?/";//不包含*或.的英文符号
				if(""==str){ 
					return false; 
					} 
				for(var i=0;i<str.length;i++){ 
					var c = str.charAt(i);//字符串str中的字符 
					if(badChar.indexOf(c) > -1){ 
						return false; 
						} 
				} 
				return true; 
			} 
	//身份证判断输入
		function   isIdCardNo(num){
				var len = num.length, re;   
				if (len == 15) 
					re = new RegExp(/^(\d{6})()?(\d{2})(\d{2})(\d{2})(\d{3})$/); 
				else if (len == 18) 
					re = new RegExp(/^(\d{6})()?(\d{4})(\d{2})(\d{2})(\d{3})(\d)$/); 
				else {
					return false;} 
				var a = num.match(re); 
				if (a != null) 
				{ 
				  if (len==15) 
				  { 
					  var D = new Date("19"+a[3]+"/"+a[4]+"/"+a[5]); 
					  var B = D.getYear()==a[3]&&(D.getMonth()+1)==a[4]&&D.getDate()==a[5]; 
				  } 
				  else 
				  { 
					  var D = new Date(a[3]+"/"+a[4]+"/"+a[5]); 
					  var B = D.getFullYear()==a[3]&&(D.getMonth()+1)==a[4]&&D.getDate()==a[5]; 
				  } 
				  if (!B) { return false;} 
				}
				return true; 
			} 

	//----------姓名检测
		function check_UserName(){
			getinfo();
			if(thisinfo!="" && isChinese(thisinfo) && getStrActualLen(thisinfo)<9 && getStrActualLen(thisinfo)>2){
				$div(thisname).innerHTML="<img src='images/reg_yesok.gif'/> 正确!";
				$div(thisname).className="rig";
				flag[1]=1;
				check_data();
			}
			else{
				$div(thisname).innerHTML="<img src='images/reg_yesno.gif'/> 您的姓名错误，请使用中文!";
				$div(thisname).className="err";
				flag[1]=0;
				check_data();
			}
			
		}
	//----------籍贯检测
		function check_Birthplace(){
			getinfo();
			if(thisinfo!="" && getStrActualLen(thisinfo)<20 && getStrActualLen(thisinfo)>3){
				$div(thisname).innerHTML="<img src='images/reg_yesok.gif'/> 正确!";
				$div(thisname).className="rig";
				flag[2]=1;
				check_data();
			}
			else{
				$div(thisname).innerHTML="<img src='images/reg_yesno.gif'/> 籍贯填写错误!";
				$div(thisname).className="err";
				flag[2]=0;
				check_data();
			}
			
		}
	
	//----------身份证检测
	function check_IdentityNO(){
		getinfo();
		if(thisinfo!="" && !isChinese(thisinfo) && isIdCardNo(thisinfo)){
			$div(thisname).innerHTML="<img src='images/reg_yesok.gif'/> 正确！";
			$div(thisname).className="rig";
			flag[3]=1;
			check_data();
		}
		else{
			$div(thisname).innerHTML="<img src='images/reg_yesno.gif'/> 请正确填写15或18位身份证号码!";
			$div(thisname).className="err";
			flag[3]=0;
			check_data();
		}
	}
	//----------准考证检测
	function check_zkz(){
		getinfo();
		var reId=/^[\w\u0391-\uFFE5]+$/;
		var b_id=reId.test(thisinfo);
		if(thisinfo!="" && (b_id) && getStrActualLen(thisinfo)>6){
			$div(thisname).innerHTML="<img src='images/reg_yesok.gif'/> 正确！";
			$div(thisname).className="rig";
			flag[4]=1;
			check_data();
		}
		else{
			$div(thisname).innerHTML="<img src='images/reg_yesno.gif'/> 请正确填写高考准考证号码!";
			$div(thisname).className="err";
			flag[4]=0;
			check_data();
		}
	}
	//----------报名号检测
	function check_bmh(){
		getinfo();
		var reId=/^[\w\u0391-\uFFE5]+$/;
		var b_id=reId.test(thisinfo);
		if(thisinfo!="" && (b_id) && getStrActualLen(thisinfo)>6){
			$div(thisname).innerHTML="<img src='images/reg_yesok.gif'/> 正确！";
			$div(thisname).className="rig";
			flag[5]=1;
			check_data();
		}
		else{
			$div(thisname).innerHTML="<img src='images/reg_yesno.gif'/> 请正确填写高考报名号号码!";
			$div(thisname).className="err";
			flag[5]=0;
			check_data();
		}
	}
	//----------所在省市检测
		function check_cityinfo(){
			getinfo();
			if(thisinfo!="" && getStrActualLen(thisinfo)<20 && getStrActualLen(thisinfo)>3){
				$div(thisname).innerHTML="<img src='images/reg_yesok.gif'/> 正确!";
				$div(thisname).className="rig";
				flag[6]=1;
				check_data();
			}
			else{
				$div(thisname).innerHTML="<img src='images/reg_yesno.gif'/> 请正确填写高考所在省市!";
				$div(thisname).className="err";
				flag[6]=0;
				check_data();
			}
			
		}
	//----------150分检测
	function check_cj(x){
		getinfo();
		if(thisinfo<151 && thisinfo>=0 && thisinfo!=""){
			$div(thisname).innerHTML="<img src='images/reg_yesok.gif'/> 正确！";
			$div(thisname).className="rig";
			flag[x]=1;
			check_data();
		}
		else{
			$div(thisname).innerHTML="<img src='images/reg_yesno.gif'/> 请正确高考成绩!";
			$div(thisname).className="err";
			flag[x]=0;
			check_data();
		}
	}

	//----------300分检测
	function check_l4(){
		getinfo();
		if(thisinfo<301 && thisinfo>=0 && thisinfo!=""){
			$div(thisname).innerHTML="<img src='images/reg_yesok.gif'/> 正确！";
			$div(thisname).className="rig";
			flag[11]=1;
			check_data();
		}
		else{
			$div(thisname).innerHTML="<img src='images/reg_yesno.gif'/> 请正确高考成绩!";
			$div(thisname).className="err";
			flag[11]=0;
			check_data();
		}
	}
	//----------100字节检测
	function check_100(x){
		getinfo();
		if(getStrActualLen($val(thisname).outerText)<101){
			$div(thisname).innerHTML=" 选填项，长度限制为100字节。 ";
			$div(thisname).className="infos";
		}
		else{
			$div(thisname).innerHTML="<img src='images/reg_yesno.gif'/> 内容超长,长度限制为100字节!";
			$div(thisname).className="err";
			flag[x]=0;
			alert(flag[12]);
			check_data();
		}
	}
	//----------家庭住址检测
		function check_address(){
			getinfo();
			if(getStrActualLen(thisinfo)>9&&getStrActualLen(thisinfo)<51){
				$div(thisname).innerHTML="<img src='images/reg_yesok.gif'/> 正确！";
				$div(thisname).className="rig";
				flag[13]=1;
				check_data();
			}
			else{
				$div(thisname).innerHTML="<img src='images/reg_yesno.gif'/> 家庭住址错误(长度范围：10-50字节)!";
				$div(thisname).className="err";
				flag[13]=0;
				check_data();
			}
		}

	//----------电话检测
		function check_phone(){
			getinfo();
			var Tel=/(^[\d]{3,4}-[\d]{7,8}$)|(^[\d]{7,8}$)|(^[\d]{10,12}$)|(^0{0,1}13[0-9]{9}$)/ 
			var b_Tel=Tel.test(thisinfo)
			if(b_Tel){
				$div(thisname).innerHTML="<img src='images/reg_yesok.gif'/> 正确！";
				$div(thisname).className="rig";
				flag[14]=1;
				check_data();
			}
			else{
				$div(thisname).innerHTML="<img src='images/reg_yesno.gif'/> 电话格式错误(010-88888888)!";
				$div(thisname).className="err";
				flag[14]=0;
				check_data();
			}
		}
	//----------手机检测
		function check_tel(){
			getinfo();
			var Pho=/(^0{0,1}1(([3]{1}[0-9]{0,1})|([5]{1}[3|6|8|9]{0,1}))[0-9]{8}$)/
			//var Pho=/(^0{0,1}1[3|5][0-9]{9}$)/
			var b_Phone=Pho.test(thisinfo);
			if(b_Phone){
				$div(thisname).innerHTML="<img src='images/reg_yesok.gif'/> 正确！";
				$div(thisname).className="rig";
				flag[15]=1;
				check_data();
			}
			else{
				$div(thisname).innerHTML="<img src='images/reg_yesno.gif'/> 电话格式错误(13888888888)!";
				$div(thisname).className="err";
				flag[15]=0;
				check_data();
			}
		}
	
	//----------密码检测
	function check_password(obj){
		getinfo();
		var reChinese=/[\u0391-\uFFE5]+/;
		var b_chinese=reChinese.test(thisinfo);
		var reSpace=/\s+/;
		var b_space=reSpace.test(thisinfo);
		//-------长度测试
		if(thisinfo.length<6&&thisinfo.length>16){
			$div(thisname).innerHTML="<img src='images/reg_yesno.gif'/> 密码长度不能小于6";
			$div(thisname).className="err";
			flag[16]=0;
			check_data();
		}
		//-------合法性检测:不能包含汉字
		else if(b_chinese){
			$div(thisname).innerHTML="<img src='images/reg_yesno.gif'/> 密码不能包含中文";
			$div(thisname).className="err";
			flag[16]=0;
			check_data();
		}
		//-------合法性检测:不能包含空格
		else if(b_space){
			$div(thisname).innerHTML="<img src='images/reg_yesno.gif'/> 密码不能包含空格";
			$div(thisname).className="err";
			flag[16]=0;
			check_data();
		}
		//-------合法时显示密码强度
		else{
			//定义对应的消息提示
			var num=getResult(thisinfo);
			var msg=new Array("<img src='images/reg_bad.gif'/> 密码强度差","<img src='images/reg_comm.gif'/> 密码强度一般","<img src='images/reg_good.gif'/> 密码强度强壮");
			$div(thisname).innerHTML=msg[num];
			$div(thisname).className="rig";
			if($val("password2").value!=""){check_pw();}
			return flag[16]=1;
				check_data();
			}
		}	
		//---------密码一致性检测	
			function check_pw(){
				var pwd=$val("password1").value.toString();
				var check_pwd=$val("password2").value.toString();
				if(flag[16]==1){
					if(pwd==check_pwd){
						$div("password2").innerHTML="<img src='images/reg_yesok.gif'/> 密码可以使用";
						$div("password2").className="err";
						flag[7]=1;
						check_data();
					}
					else{
						$div("password2").innerHTML="<img src='images/reg_yesno.gif'/> 两次密码不相同";
						$div("password2").className="err";
						flag[7]=0;
						check_data();
					}
				}
			}
		//定义检测函数,返回0/1/2分别代表差/一般/强
			function getResult(s){
				var ls =-1;
				if (s.match(/[a-z]/ig)){
					ls++;
				}
				if (s.match(/[0-9]/ig)){
					ls++;
				}
	 			if (s.match(/(.[^a-z0-9])/ig)){
					ls++;
				}
				return ls;
			}

		//---------检查数据,使提交按钮是否生效
			function check_data(){
				if(flag[0]==1 && flag[1]==1 && flag[2]==1 && flag[3]==1 && flag[4]==1 && flag[5]==1 && flag[6]==1 && flag[7]==1 && flag[8]==1 && flag[9]==1 && flag[10]==1 && flag[11]==1 && flag[12]==1 && flag[13]==1 && flag[14]==1 && flag[15]==1 && flag[16]==1 && flag[17]==1 && flag[18]==1){
					$val("submit").disabled=false;
				}
				else{
					$val("submit").disabled=true;
				}
			}
			function checkflag()
			{
				var sssi;
				for (i=0;i<=18 ;i++ )
			{if (flag[i]==0){sssi+=i+". ";}
			}
			
			alert(sssi);}
			
	//--------------------------------------------------------------------
