<%@ page language="C#" autoeventwireup="true" inherits="reg_index, kfenlei" %><%@ Register Src="~/inc/top.ascx" TagPrefix="qth8" TagName="top" %><%@ Register Src="~/inc/foot.ascx" TagPrefix="qth8" TagName="foot" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta name="Keywords" content="<%=sWebCity %>用户注册" />
<meta name="Description" content="免费注册，加入<%=sWebName %>" />
<title>用户注册 - <%=sWebName %></title>
<link rel="stylesheet" href="/template/css.css" type="text/css" />
<link rel="stylesheet" href="/template/top.css" type="text/css" />
<link rel="stylesheet" href="reg.css" type="text/css" />
</head>
<body>
<div align="center">
<qth8:top ID="top" runat="server" />
<div class="main">
<div class="main_part" align="left">
<div class="regTitle">
<h2>用户注册</h2>
我已有账号，<a href="/login/<%=sLogin %>">[直接登录]</a>
</div>
<form action="/action/?s=reg" method="post" name="regForm" id="regForm">
<input type="hidden" name="jump" value="<%=sJumpUrl %>" />
<table width="800" border="0" class="reg_table" cellspacing="0" cellpadding="0">
<tr>
<td class="reg_table_title" width="100">用户名：</td>
<td width="240"><input type="text" class="inputTextBox" id="qth8UserName" name="qth8UserName" onblur="checkusername()" /></td>
<td class="ps"><div id="UserNamePs">2-16位，汉字、字母、数字、下划线</div></td>
</tr>
<tr>
<td class="reg_table_title">密码：</td>
<td><input type="password" class="inputTextBox" id="qth8PassWord" name="qth8PassWord" onblur="check_password()" /></td>
<td class="ps"><div id="passWordPs">请输入6-16位密码</div></td>
</tr>
<tr>
<td class="reg_table_title">确认密码：</td>
<td><input type="password" class="inputTextBox" id="qth8PassWord1" name="qth8PassWord1" onblur="check_password1()" /></td>
<td class="ps"><div id="passWord1Ps">请再输入一遍密码,以防错误</div></td>
</tr>
<%if(s10!="1"){ %><tr>
<td class="reg_table_title">验证码：</td>
<td><input type="text" class="inputTextBox" style="width:70px;" name="qth8Validate" />&nbsp;&nbsp;<img src="/validate/?cache=<%=sRandom %>" alt="点击更换图片" onclick="this.src='/validate/?cache='+Math.random()" style="cursor:pointer" /></td>
<td></td><%} %>
</tr>
<tr>
<td class="reg_table_title"></td>
<td><input id="Submit1" value="" class="reg_button" type="submit" /></td>
<td>&nbsp;</td>
</tr>
</table>
</form>
<div class="right"><img src="images/br01.png" width="205" height="196" alt="用户注册" /></div>
<div class="clear"></div>
</div>
</div>
<qth8:foot ID="foot" runat="server" />
</div>
<script type="text/javascript">
function check_password(){
var password=document.regForm.qth8PassWord.value;
if(password.length<6 || password.length>16 || password.length==0){
    document.getElementById("passWordPs").className="error_text";
	document.getElementById("passWordPs").innerHTML="请输入6-16位密码";
	}
	else{
			document.getElementById("passWordPs").className="right_text";
	document.getElementById("passWordPs").innerHTML="输入正确";
	}
}
function check_password1(){
var password=document.regForm.qth8PassWord.value;
var password1=document.regForm.qth8PassWord1.value;
if(password!=password1){
document.getElementById("passWord1Ps").className="error_text";
	document.getElementById("passWord1Ps").innerHTML="两次密码不相同";
	}
	else{
			document.getElementById("passWord1Ps").className="right_text";
	document.getElementById("passWord1Ps").innerHTML="输入正确";
	}

}
 function checkusername(){
	var user_name_value=document.regForm.qth8UserName.value;
	if(!/^[a-zA-Z0-9\u4e00-\u9fa5_]{2,16}$/.test(user_name_value)){
	document.getElementById("UserNamePs").className="error_text";
	document.getElementById("UserNamePs").innerHTML="用户名请输入2-16位汉字、字母、数字、下划线！";
	}
	else{
	var xmlhttp;
		if (window.XMLHttpRequest)
  		{// code for IE7+, Firefox, Chrome, Opera, Safari
  			xmlhttp=new XMLHttpRequest();
  		}
		else
  		{// code for IE6, IE5
 		 	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  		}
		xmlhttp.onreadystatechange=function()
  		{
  			if (xmlhttp.readyState==4 && xmlhttp.status==200)
    		{
				document.getElementById("UserNamePs").className="";
    			document.getElementById("UserNamePs").innerHTML=xmlhttp.responseText;
    		}
  		}
		xmlhttp.open("GET","/services/?s=checkUserName&v="+user_name_value,true);
		xmlhttp.send();
		}
	}

function check_form(){
	var password=document.regForm.qth8PassWord.value;
	if(password.length<6 || password.length>16 || password.length==0){
    	alert("请输入6-16位密码");
		return false;
	}
	var password1=document.regForm.qth8PassWord1.value;
		if(password!=password1){
		alert("两次密码不相同");
		return false;
	}
	var user_name_value=document.regForm.qth8UserName.value;
	if(!/^[a-zA-Z0-9\u4e00-\u9fa5_]{2,16}$/.test(user_name_value)){
	alert("用户名请输入2-16位汉字、字母、数字、下划线！")
	return false;
	}
	return true;
	}
	
	if(getCookie("kfRegUserName")!="")
{
	document.regForm.qth8UserName.value=decodeURI(escape(getCookie("kfRegUserName")));
	alert(decodeURI(escape(getCookie("kfRegPs"))));
}
</script>
</body>
</html>

