
	function f1(){
		document.all.aaa1.src = '/u1club/yzm.do?a='+Math.random();		
	}
	
	function f2(){
		document.all.aaa2.src = '/u1club/yzm.do?a='+Math.random();		
	}
	
	
	function cTrims(sInputString,iType){
		var sTmpStr = ' '
		var i = -1
		
		if(iType == 0 || iType == 1)
		{
				while(sTmpStr == ' ')
				{
					++i
					sTmpStr = sInputString.substr(i,1)
				}
				sInputString = sInputString.substring(i)
		}
		
		if(iType == 0 || iType == 2)
		{
			sTmpStr = ' '
			i = sInputString.length
			while(sTmpStr == ' ')
			{
				--i
				sTmpStr = sInputString.substr(i,1)
			}
			sInputString = sInputString.substring(0,i+1)
		}
			return sInputString
	}
	
	function checklogins(){
		var cloginid = cTrims(document.all.loginid1.value,0);
		var cpassword = cTrims(document.all.password_1.value,0);
		var yzm = cTrims(document.all.yzm1.value,0);
		var tip ="";
		document.all.checkloginid1.innerHTML="";
		document.all.checkpassword1.innerHTML="";
		 var reg= /^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+[a-zA-Z0-9_-]{2,3}$/;
		    if(cloginid==""||reg.test(cloginid)==false){
		    	tip +="请输入正确邮箱";
		    	document.all.checkloginid1.innerHTML="<font color='red'>请输入正确邮箱</font>";
		    }if(cpassword==""){
		    	tip +="请输入密码";
		    	document.all.checkpassword1.innerHTML="<font color='red'>请输入密码</font>";
		    }if(isNaN(yzm) || (yzm.length!=4)){
		    	tip +="请输入正确验证码";
		    	document.all.checkyzm1.innerHTML="<font color='red'>请输入正确验证码</font>";
		    }
		    
		    if(tip==""){
		    	document.getElementById('formid1').submit();
		    	//onsubmitMyloginForm();
		    	return true;
		    }else if(tip =="请输入正确邮箱"){
		    	document.all.checkloginid1.innerHTML="<font color='red'>请输入正确邮箱</font>";
		    	return false;
		    }else if(tip =="请输入密码"){
		    	document.all.checkpassword1.innerHTML="<font color='red'>请输入密码</font>";
		    	return false;
		    }else if(tip =="请输入正确验证码"){
		    	document.all.checkyzm1.innerHTML="<font color='red'>请输入正确验证码</font>";
		    	return false;
		    }else{
				return false;
		    }
	}
	
	function checkloginId1(){
		var cloginid = cTrims(document.all.loginid1.value,0);
		document.all.checkloginid1.innerHTML="";
		var reg= /^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+[a-zA-Z0-9_-]{2,3}$/;
		if(cloginid==""||reg.test(cloginid)==false){
		    	document.all.checkloginid1.innerHTML="<font color='red'>请输入正确邮箱</font>";
		    	return false;
		}
	}
	
	function checkloginPassword1(){
		var cpassword = cTrims(document.all.password_1.value,0);
		document.all.checkpassword1.innerHTML="";
		if(cpassword==""){
		    	//tip +="请输入密码!";
		    	document.all.checkpassword1.innerHTML="<font color='red'>请输入密码</font>";
		    	return false;
		}
		
		if(cpassword.length<6){
			document.all.checkpassword1.innerHTML="<font color='red'>密码不能小于6位</font>";
		    return false;
		}
	}
	
	function checkloginYzm1(){
		var yzm = cTrims(document.all.yzm1.value,0);
		document.all.checkyzm1.innerHTML="";
		if( isNaN(yzm) || (yzm.length!=4)){
		    	document.all.checkyzm1.innerHTML="<font color='red'>请输入正确验证码</font>";
		    	return false;
		}
	}

	function myreset1(){
		document.all.loginid1.value="";
		document.all.password_1.value="";
		document.all.yzm1.value="";
	}
	
	function resp_enter(obj){
		if(event.keyCode==13){
			if(obj==1)checklogins();
			if(obj==2)checkregist2();
		}
   }
   
   
   
   
   
   
   //注册的相关验证
   
	var flg;
	//得到XMLHttpRequest对象
	function newXMLHttpRequest() {
		var xmlreq = false;  
		if (window.XMLHttpRequest) {  
			xmlreq = new XMLHttpRequest();
		} else if (window.ActiveXObject) {
		try { 
				xmlreq = new ActiveXObject("Msxml2.XMLHTTP"); 
			}catch (e1) {
				try {
				  xmlreq = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e2) {}
			}
		}
		return xmlreq;
	}
	 
	function check2(){
		flg=newXMLHttpRequest();
		//当XMLHttpRequest对象在请求过程中间状态改变的时候
		//回来调用xmlonchange方法 
		var reg= /^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+[a-zA-Z0-9_-]{2,3}$/;
		var cloginid = cTrims(document.all.loginid2.value,0);
		if(reg.test(cloginid)==false){
			document.getElementById('dis2').innerHTML="<font color='red'>请输入正确邮箱</font>";
			return false;
		}else{
			flg.onreadystatechange=xmlonchange1;    
			flg.open("post","/u1club/regist.do?mmmm=checkLoginid",true);
			flg.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
			flg.send("iname="+cloginid);
		}
	}
	
	
	
	//处理函数
	function xmlonchange1(){
		//4表示状态完成
		document.getElementById('dis2').innerText="";
		if(flg.readyState == 4){
		//如果为成功
			if(flg.status == 200){
				//将结果放入对应的块中间
				document.getElementById('dis2').innerHTML=flg.responseText;
			}else{
				document.getElementById('dis2').innerHTML="";
			}
		}else{
			document.getElementById('dis2').innerHTML=""
		}
	}
	
	function checkloginPassword2(){
		var cpassword = cTrims(document.all.password2.value,0);
		document.all.checkpassword2.innerHTML="";
		if(cpassword==""){
		    	//tip +="请输入密码!";
		    	document.all.checkpassword2.innerHTML="<font color='red'>请输入密码</font>";
		    	return false;
		}
		
		if(cpassword.length<6){
			document.all.checkpassword2.innerHTML="<font color='red'>密码不能小于6位</font>";
		    return false;
		}
	}
	
	function checkLoginPass2(){
		var cpassword = cTrims(document.all.password2.value,0);
		var cpassword1 = cTrims(document.all.password3.value,0);
		document.all.checkpassword3.innerHTML="";
		if(cpassword !=cpassword1 ){
	    	document.all.checkpassword3.innerHTML="<font color='red'>两次密码不一致</font>";
	    	return false;
		}
	}
	
	function checkloginYzm2(){
		var yzm = cTrims(document.all.yzm2.value,0);
		document.all.checkyzm2.innerHTML="";
		if( isNaN(yzm) || (yzm.length!=4)){
		    	document.all.checkyzm2.innerHTML="<font color='red'>请输入正确验证码</font>";
		    	return false;
		}
	}
	
	function checkregist2(){
			var cloginid = cTrims(document.all.loginid2.value,0);
			var cpassword = cTrims(document.all.password2.value,0);
			var cpassword1 = cTrims(document.all.password3.value,0);
			var yzm = cTrims(document.all.yzm2.value,0);
		    var tip ="";
		    document.all.dis2.innerHTML="";
		    document.all.checkpassword2.innerHTML="";
		    document.all.checkpassword3.innerHTML="";
		    var reg= /^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+[a-zA-Z0-9_-]{2,3}$/;;
		    
		    if(cloginid==""||reg.test(cloginid)==false){
		    	tip +="请输入正确邮箱";
		    	document.all.dis2.innerHTML="<font color='red'>请输入正确邮箱</font>";
		    }if(cpassword==""||cpassword.length<6){
		    	tip +="密码至少6位";
		    	document.all.checkpassword2.innerHTML="<font color='red'>密码至少6位</font>";
		    }if(cpassword !=cpassword1 ){
		    	tip +="两次密码不一致";
		    	document.all.checkpassword3.innerHTML="<font color='red'>两次密码不一致!</font>";
		    }if(isNaN(yzm)||yzm.length!=4){
		    	tip +="请正确输入验证码";
		    	document.all.checkyzm2.innerHTML="<font color='red'>请正确输入验证码</font>";
		    }
		    
		    if(tip==""){
		    	document.getElementById('formid2').submit();
		    	return true;
		    }else if(tip =="请输入正确邮箱"){
		    	document.all.dis2.innerHTML="<font color='red'>请输入正确邮箱</font>";
		    	return false;
		    }else if(tip =="密码至少6位"){
		    	document.all.checkpassword2.innerHTML="<font color='red'>密码至少6位</font>";
		    	return false;
		    }else if(tip =="两次密码不一致"){
		    	document.all.checkpassword3.innerHTML="<font color='red'>两次密码不一致</font>";
		    	return false;
		    }else if(tip =="请正确输入验证码"){
		    	document.all.checkyzm2.innerHTML="<font color='red'>请正确输入验证码</font>";
		    	return false;
		    }else{
				return false;
		    }
		}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
