<%@ Page language="c#" Codebehind="reg.aspx.cs" AutoEventWireup="True" Inherits="Webdisk.reg" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
  <HEAD>
		<% @ Import Namespace="Webdisk" %>
		<link href="<%=xml.GetStyle()%>" type=text/css rel=stylesheet>
			<style type="text/css">.style5 { COLOR: #ff0000 }
	</style>
<title>用户注册</title></HEAD>
	<body >
<script type="text/javascript" language="javascript" src="js/dialog.js"></script>
			<script language="javascript">
function getUrlParam(paramName){	
	var s=location.search;
	if(s!=null){
	var sarr=s.substr(1).split("&");
	var tarr;
	for(i=0;i<sarr.length;i++){
	tarr=sarr[i].split("=");
	if(tarr.length==2&&tarr[0].toLowerCase()==paramName){
	return tarr[1];
	}
	}
	return "";
	}
}
function getRbGroupValue(rbGroup)
{
	var objs=document.getElementsByName(rbGroup);
	for(var i=0;i<objs.length;i++)
	{
		if(objs[i].checked)	return objs[i].value;
	}
	return "";
}
function RegUser()
{
	var sub;
	try
	{
		if (Page_ClientValidate()) sub=true;else sub=false;
	}
	catch(e)
	{
		sub=true;
	}
	if (sub)
	{
		Init();
		try{
		    Webdisk.reg.RegUser(getRbGroupValue('team'), document.all.username.value, document.all.Password1.value, document.all.uquestion.value, document.all.uanswer.value, document.all.email.value, getRbGroupValue('sex'), document.all.url.value, document.all.qq.value, document.all.msn.value, document.all.realname.value, document.all.phone.value, document.all.address.value, document.all.company.value, document.all.bm.value, document.all.recommend.value, "", document.all.ValidateCode.value, document.all.curr.value, document.getElementById("hidopenid").value, IsRegUser_callback);
		}
		catch(e){
			alert('IIS缺少默认的ashx扩展名支持！无法启用ajax，请在网站属性->目录->配置里，添加.ashx的扩展名，路径要设定到c:\\windows\\microsoft.net\\framework\\v1.1.4322\\aspnet_isapi.dll，若为.net2.0版本，中间的版本号要改为v2.0.50727，添加时一定要把\“确认文件是否存在\”的对勾去掉!');
		}
	}
}
function IsRegUser_callback(res)
{
	document.all.loading.style.display='none';
	var bRet = res.value;
	if (bRet == "0")
	{
		var d = new dialog();d.init();
		d.set('src','pics/dlgico_right.gif');
		d.set('title','系统提示信息');
		d.event('注册成功！', 'window.parent.location="login.aspx";','','');	
	}
	else if (bRet.charAt(0) == "1")
	{
		if (bRet.substr(1).indexOf("邮件")!=-1) window.location='regmail.aspx?user='+document.getElementById('username').value+'&mail='+document.getElementById('email').value;
		var d = new dialog();d.init();
		d.set('src','pics/dlgico_excal.gif');
		d.set('title','系统提示信息');
		d.event(bRet.substr(1), 'window.parent.location="login.aspx";','','');	
	}
	else
	{
		var d = new dialog();d.init();
		d.set('src','pics/dlgico_excal.gif');
		d.set('title','系统提示信息');
		d.event(bRet, 'window.close();','','');	
	}
}
function VerifyUsername(name)
{
	try{
			Webdisk.reg.check(name, IsUsernameExist_callback);
	}
	catch(e){
		alert('IIS缺少默认的ashx扩展名支持！无法启用ajax，请在网站属性->目录->配置里，添加.ashx的扩展名，路径要设定到c:\\windows\\microsoft.net\\framework\\v1.1.4322\\aspnet_isapi.dll，若为.net2.0版本，中间的版本号要改为v2.0.50727，添加时一定要把\“确认文件是否存在\”的对勾去掉!');
	}
}
function IsUsernameExist_callback(res)
{
	var msg = document.getElementById('chkinfo');
	var bRet = res.value;
	
	if (bRet == "") msg.style.display='none';
	else
	{
		msg.style.display='';
		msg.innerHTML = res.value;
		msg.style.color = 'red';	
	}
}
function Init()
{
	document.all.loading.style.top =Math.round((document.body.clientHeight-100)/2)+document.body.scrollTop-50;
	document.all.loading.style.left =Math.round((document.body.clientWidth-100)/2)-100;
	document.all.loading.style.display='';
}
function pass()
{
	showerror("&nbsp;<font color='#FD1004'><b>用户名</b></font>不能为空！！：）","pics/err.gif");
	return false;

}
function showerror(title,id)
{
var d = new dialog();d.init();
d.set('src',id);
d.set('title','系统提示信息');
d.event(title, 'window.close();','','');
}
		</script>
		<form id="Form1" method="post" runat="server">
		<div id="loading" style=" BORDER-RIGHT:#dbdce3 1px solid; BORDER-TOP:#dbdce3 1px solid; DISPLAY:none; BORDER-LEFT:#dbdce3 1px solid; BORDER-BOTTOM:#dbdce3 1px solid; POSITION:absolute; BACKGROUND-COLOR:#ffffae"><img src="pics/loading.gif" width="32" height="32" align="absMiddle"> <b>正在处理，请稍候……</b></div>
<asp:panel id="Panel3" runat="server"><BR>
			  <TABLE cellSpacing=0 cellPadding=0 width=552 align=center>
			    <TR>
			      <TD width=5><IMG height=5 src="pics/wenbenkuan_01.gif" width=5></TD>
			      <TD width=874 background=pics/wenbenkuan_02.gif><IMG height=5 
      src="pics/wenbenkuan_02.gif" width=5></TD>
			      <TD><IMG height=5 src="pics/wenbenkuan_03.gif" width=5></TD>
		        </TR>
			    <TR>
			      <TD background=pics/wenbenkuan_04.gif>&nbsp;</TD>
			      <TD class=tablebg background=pics/wenbenkuan_05.gif><TABLE width=652>
			        <TR>
			          <TD class=tabletop><IMG src="pics/user.gif" align=absMiddle> 注册网络硬盘&nbsp;&nbsp;&nbsp;&nbsp;<A 
            href="javascript:history.go(-1);"><IMG src="pics/link_back.gif" 
            align=absMiddle border=0></A></TD>
		            </TR>
			        <TR class=tablebg>
			          <TD><TABLE class=tablebgborder cellSpacing=1 cellPadding=2 width="95%" 
            align=center border=0>
			            <TR class=tablebg>
			              <TD height="20" align="center">即将绑定您的QQ号，请选择是否在本站注册过？</TD>
		                </TR>
			            <TR class=tablebg>
			              <TD align="center"><INPUT class=btn runat=server id=Submit4 type=button value=已在本站注册 name=Submit onserverclick="Submit4_ServerClick">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		                    <INPUT class=btn id=Submit6 runat=server type=button value=还没有注册 name=Submit3 onserverclick="Submit6_ServerClick"></TD>
		                </TR>
			            </TABLE></TD>
		            </TR>
			        </TABLE></TD>
			      <TD width=5 background=pics/wenbenkuan_06.gif><IMG height=5 
      src="pics/wenbenkuan_06.gif" width=5></TD>
		        </TR>
			    <TR>
			      <TD><IMG height=5 src="pics/wenbenkuan_07.gif" width=5></TD>
			      <TD background=pics/wenbenkuan_08.gif><IMG height=5 
      src="pics/wenbenkuan_08.gif" width=5></TD>
			      <TD><IMG height=5 src="pics/wenbenkuan_09.gif" 
width=5></TD>
		        </TR>
		      </TABLE>
			  </asp:panel>
<asp:panel id="Panel4" runat="server"><BR>
              <TABLE cellSpacing=0 cellPadding=0 width=552 align=center>
                <TR>
                  <TD width=5><IMG height=5 src="pics/wenbenkuan_01.gif" width=5></TD>
                  <TD width=874 background=pics/wenbenkuan_02.gif><IMG height=5 
      src="pics/wenbenkuan_02.gif" width=5></TD>
                  <TD><IMG height=5 src="pics/wenbenkuan_03.gif" width=5></TD>
                </TR>
                <TR>
                  <TD background=pics/wenbenkuan_04.gif>&nbsp;</TD>
                  <TD class=tablebg background=pics/wenbenkuan_05.gif><TABLE width=652>
                    <TR>
                      <TD class=tabletop><IMG src="pics/user.gif" align=absMiddle> 注册网络硬盘&nbsp;&nbsp;&nbsp;&nbsp;<A 
            href="javascript:history.go(-1);"><IMG src="pics/link_back.gif" 
            align=absMiddle border=0></A></TD>
                    </TR>
                    <TR class=tablebg>
                      <TD scope=col height=23>注：请登录已有帐号以便绑定该QQ号<span id="note3" style="display:none">（关联您的帐号后下次登录可以直接进入网盘系统）</span></TD>
                    </TR>
                    <TR class=tablebg>
                      <TD><TABLE class=tablebgborder cellSpacing=1 cellPadding=2 width="95%" 
            align=center border=0>
                        <TR class=tablebg>
                          <TD width="28%"><DIV align=left>用 户 名：</DIV></TD>
                          <TD colSpan=2 height=20><INPUT class=kuan id=username3 
                  onblur=VerifyUsername(this.value); maxLength=30 name=username3 
                  runat="server">
                            <SPAN class=style5>***
                              <asp:RequiredFieldValidator id=RequiredFieldValidator13 runat="server" ErrorMessage="请输入用户名" ControlToValidate="username3" Display="Dynamic"></asp:RequiredFieldValidator>
                            </SPAN>
                            <DIV id=chkinfo3></DIV></TD>
                        </TR>
                        <TR class=tablebg id="pass9">
                          <TD><DIV align=left>密 码：</DIV></TD>
                          <TD colSpan=2 height=18><P>
                            <INPUT class=kuan id=Password5 style="WIDTH: 130px" 
                  type=password size=22 name=Password5 runat="server">
                            <SPAN 
                  class=style5>***
                              <asp:RequiredFieldValidator id=RequiredFieldValidator14 runat="server" ErrorMessage="请输入密码" ControlToValidate="Password5" Display="Dynamic"></asp:RequiredFieldValidator>
                            </SPAN></P></TD>
                        </TR>
                        <TR class=tablebg id=vcode3 runat="server">
                          <TD><DIV align=left>请输入右侧的验证码：</DIV></TD>
                          <TD width="14%" height=22><INPUT class=kuan id=ValidateCode3 
                  maxLength=25 size=10 name=ValidateCode3 runat=server></TD>
                          <TD width="58%"><IMG src="ValidateCode.aspx" style="cursor:pointer" onClick="this.src='ValidateCode.aspx?time=' + new Date()"><SPAN 
                  class=style5>*** 
                              <asp:RequiredFieldValidator ID="RequiredFieldValidator15" runat="server" 
                                  ControlToValidate="ValidateCode3" Display="Dynamic" ErrorMessage="请输入验证码"></asp:RequiredFieldValidator>
                              </SPAN></TD>
                        </TR>
                        <TR class=tablebg>
                          <TD><DIV align=center></DIV></TD>
                          <TD colSpan=2><INPUT class=btn id=Submit5 type=button value=登录关联 runat=server name=Submit5 onserverclick="Submit5_ServerClick">
                            <INPUT id=curr3 type=hidden size=6 name=curr3 runat="server">
                            <asp:ValidationSummary id=ValidationSummary3 runat="server" ShowSummary="False" ShowMessageBox="True"></asp:ValidationSummary></TD>
                        </TR>
                      </TABLE></TD>
                    </TR>
                  </TABLE></TD>
                  <TD width=5 background=pics/wenbenkuan_06.gif><IMG height=5 
      src="pics/wenbenkuan_06.gif" width=5></TD>
                </TR>
                <TR>
                  <TD><IMG height=5 src="pics/wenbenkuan_07.gif" width=5></TD>
                  <TD background=pics/wenbenkuan_08.gif><IMG height=5 
      src="pics/wenbenkuan_08.gif" width=5></TD>
                  <TD><IMG height=5 src="pics/wenbenkuan_09.gif" 
width=5></TD>
                </TR>
              </TABLE>
              </asp:panel>
			<asp:panel id="Panel1" runat="server">
              <br>
              <TABLE cellSpacing=0 cellPadding=0 width=552 align=center>
  <TR>
    <TD width=5><IMG height=5 src="pics/wenbenkuan_01.gif" width=5></TD>
    <TD width=874 background=pics/wenbenkuan_02.gif><IMG height=5 
      src="pics/wenbenkuan_02.gif" width=5></TD>
    <TD><IMG height=5 src="pics/wenbenkuan_03.gif" width=5></TD></TR>
  <TR>
    <TD background=pics/wenbenkuan_04.gif>&nbsp;</TD>
    <TD background=pics/wenbenkuan_05.gif bgColor=#ffffff>
      <TABLE class=tabletop width=652>
        <TR>
          <TD class=tabletop><img src="pics/user.gif" align="absmiddle"> 注册协议&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:history.go(-1);"><img src="pics/link_back.gif" border="0" align="absMiddle"></a></TD>
        <TR class=tablebg>
          <TD>
            <TABLE class=tablebgborder cellSpacing=1 cellPadding=2 width="95%" 
            align=center border=0>
              <TR class=tablebg>
                <TD width="72%" height=22><TEXTAREA class=kuan id=agreement name=agreement rows=10 cols=100 runat="server"></TEXTAREA></TD></TR>
              <TR class=tablebg>
                <TD>
                  <DIV align=center><INPUT class=btn id=Submit2 type=button value=我同意 name=submit2 runat="server" onserverclick="Submit2_ServerClick">&nbsp;&nbsp;&nbsp;&nbsp; 
<INPUT class=btn id=Submit3 type=button value=不同意 name=submit3 runat="server" onserverclick="Submit3_ServerClick"> 
                  </DIV></TD></TR></TABLE></TD></TR></TABLE></TD>
    <TD width=5 background=pics/wenbenkuan_06.gif><IMG height=5 
      src="pics/wenbenkuan_06.gif" width=5></TD></TR>
  <TR>
    <TD><IMG height=5 src="pics/wenbenkuan_07.gif" width=5></TD>
    <TD background=pics/wenbenkuan_08.gif><IMG height=5 
      src="pics/wenbenkuan_08.gif" width=5></TD>
    <TD><IMG height=5 src="pics/wenbenkuan_09.gif" 
width=5></TD></TR></TABLE>
			</asp:panel><asp:panel id="Panel2" runat="server" Visible="False">
			  <br>
<TABLE cellSpacing=0 cellPadding=0 width=552 align=center>
  <TR>
    <TD width=5><IMG height=5 src="pics/wenbenkuan_01.gif" width=5></TD>
    <TD width=874 background=pics/wenbenkuan_02.gif><IMG height=5 
      src="pics/wenbenkuan_02.gif" width=5></TD>
    <TD><IMG height=5 src="pics/wenbenkuan_03.gif" width=5></TD></TR>
  <TR>
    <TD background=pics/wenbenkuan_04.gif>&nbsp;</TD>
    <TD class=tablebg background=pics/wenbenkuan_05.gif>
      <TABLE width=652>
        <TR>
          <TD class=tabletop><img src="pics/user.gif" align="absmiddle"> 注册网络硬盘&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:history.go(-1);"><img src="pics/link_back.gif" border="0" align="absMiddle"></a></TD></TR>
        <TR class=tablebg>
          <TD scope=col height=23>注：带<SPAN class=style5>***</SPAN>的为必填项</TD></TR>
        <TR class=tablebg>
          <TD><TABLE class=tablebgborder cellSpacing=1 cellPadding=2 width="95%" 
            align=center border=0>
            
            <TR class=tablebg>
              <TD width="28%"><div align="left">用 户 名：</div></TD>
              <TD colSpan=2 height=20><INPUT class=kuan id=username 
                  onblur=VerifyUsername(this.value); maxLength=30 name=username 
                  runat="server">
                  <SPAN class=style5>***
                    <asp:RequiredFieldValidator id=RequiredFieldValidator1 runat="server" ErrorMessage="请输入用户名" ControlToValidate="username" Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:regularexpressionvalidator id=Regularexpressionvalidator1 runat="server" ErrorMessage="用户名必须为数字或英文字母" ControlToValidate="username" Display="Dynamic" ValidationExpression="^[\w_]+$">用户名必须为数字或英文字母</asp:regularexpressionvalidator>
                    <asp:regularexpressionvalidator id=Regularexpressionvalidator2 runat="server" ErrorMessage="" ControlToValidate="username" Display="Dynamic" ValidationExpression="^[\w_]+$"></asp:regularexpressionvalidator>
                    </SPAN>
                  <DIV id=chkinfo></DIV></TD>
            </TR>
            <TR class=tablebg id="pass1">
              <TD><div align="left">密 码：</div></TD>
              <TD colSpan=2 height=18><P>
                <INPUT class=kuan id=Password1 style="WIDTH: 130px" 
                  type=password size=22 name=Password1 runat="server">
                  <SPAN 
                  class=style5>***
                    <asp:RequiredFieldValidator id=RequiredFieldValidator2 runat="server" ErrorMessage="请输入密码" ControlToValidate="Password1" Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:regularexpressionvalidator id=Regularexpressionvalidator4 runat="server" ErrorMessage="" ControlToValidate="Password1" Display="Dynamic" ValidationExpression="^[\w_]+$"></asp:regularexpressionvalidator>
                  </SPAN></P></TD>
            </TR>
            <TR class=tablebg id="pass2">
              <TD><div align="left">密码确认：</div></TD>
              <TD colSpan=2 height=20><INPUT class=kuan id=Password2 
                  style="WIDTH: 130px" type=password size=22 name=Password2 
                  runat="server">
                  <SPAN class=style5>***
                    <asp:RequiredFieldValidator id=RequiredFieldValidator4 runat="server" ErrorMessage="请再次输入密码" ControlToValidate="Password2" Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:CompareValidator id=CompareValidator1 runat="server" ErrorMessage="两次输入密码不一致" ControlToValidate="Password2" Display="Dynamic" ControlToCompare="Password1">两次输入密码不一致</asp:CompareValidator>
                  </SPAN></TD>
            </TR>
            <TR class=tablebg id="pass3">
              <TD><div align="left">密码提示问题：</div></TD>
              <TD colSpan=2 height=20><INPUT class=kuan id=uquestion 
                  name=uquestion runat="server">
                  <SPAN class=style5>***
                    <asp:RequiredFieldValidator id=RequiredFieldValidator5 runat="server" ErrorMessage="请输入提示问题" ControlToValidate="uquestion"></asp:RequiredFieldValidator>
                  </SPAN></TD>
            </TR>
            <TR class=tablebg id="pass4">
              <TD><div align="left">密码提示答案：</div></TD>
              <TD colSpan=2 height=22><INPUT class=kuan id=uanswer 
                  name=uanswer runat="server">
                  <SPAN class=style5>***
                    <asp:RequiredFieldValidator id=RequiredFieldValidator6 runat="server" ErrorMessage="请输入提示答案" ControlToValidate="uanswer" Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:CompareValidator id=CompareValidator2 runat="server" ErrorMessage="提示问题和答案不能相同" ControlToValidate="uanswer" Display="Dynamic" ControlToCompare="uquestion" Operator="NotEqual">提示问题和答案不能相同</asp:CompareValidator>
                  </SPAN></TD>
            </TR>
            <TR class=tablebg>
              <TD><div align="left">电子邮箱：</div></TD>
              <TD colSpan=2 height=22><INPUT class=kuan id=email name=email 
                  runat="server">
                  <SPAN class=style5>***
                    <asp:RequiredFieldValidator id=RequiredFieldValidator3 runat="server" ErrorMessage="请输入邮件地址" ControlToValidate="email" Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator id=RegularExpressionValidator3 runat="server" ErrorMessage="错误的电子邮件地址" ControlToValidate="email" Display="Dynamic" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                  </SPAN></TD>
            </TR>
            <TR class=tablebg>
              <TD><div align="left">性 别：</div></TD>
              <TD colSpan=2 height=22><INPUT type=radio CHECKED value=男 
                  name=sex>
                男
                <INPUT type=radio value=女 name=sex>
                女</TD>
            </TR>
            <TR class=tablebg>
              <TD><div align="left">主 页：</div></TD>
              <TD colSpan=2 height=22><INPUT class=kuan id=url 
              name=url></TD>
            </TR>
            <TR class=tablebg>
              <TD><div align="left">QQ：</div></TD>
              <TD colSpan=2 height=22><INPUT class=kuan id=qq name=qq></TD>
            </TR>
            <TR class=tablebg>
              <TD><div align="left">MSN：</div></TD>
              <TD colSpan=2 height=22><INPUT class=kuan id=msn 
              name=msn></TD>
            </TR>
            <TR class=tablebg>
              <TD><div align="left">真实姓名：</div></TD>
              <TD colSpan=2 height=22><INPUT class=kuan id=realname 
                  name=realname></TD>
            </TR>
            <TR class=tablebg>
              <TD><div align="left">联系电话：</div></TD>
              <TD colSpan=2 height=22><INPUT class=kuan id=phone 
                name=phone></TD>
            </TR>
            <TR class=tablebg>
              <TD><div align="left">联系地址：</div></TD>
              <TD colSpan=2 height=22><INPUT class=kuan id=address 
                  name=address></TD>
            </TR>
            <TR class=tablebg>
              <TD><div align="left">公司名称：</div></TD>
              <TD colSpan=2 height=22><INPUT class=kuan id=company 
                  name=company></TD>
            </TR>
            <TR class=tablebg>
              <TD><div align="left">所在部门：</div></TD>
              <TD colSpan=2 height=22><INPUT class=kuan id=bm name=bm></TD>
            </TR>
            <TR class=tablebg>
              <TD><div align="left">我的空间介绍：</div></TD>
              <TD colSpan=2 height=22><TEXTAREA class=kuan id=recommend name=recommend rows=5 cols=50></TEXTAREA></TD>
            </TR>
            <TR class=tablebg id=vcode runat="server">
              <TD><div align="left">请输入右侧的验证码：</div></TD>
              <TD width="14%" height=22><INPUT class=kuan id=ValidateCode 
                  maxLength=25 size=10 name=ValidateCode></TD>
              <TD width="58%"><IMG src="ValidateCode.aspx" style="cursor:pointer" onClick="this.src='ValidateCode.aspx?time=' + new Date()"><SPAN 
                  class=style5>*** </SPAN></TD>
            </TR>
            <TR class=tablebg>
              <TD><DIV align=center></DIV></TD>
              <TD colspan="2"><input class=btn id=Submit1 onClick=RegUser(); type=button value=现在注册 name=submit1>
                <input id=curr type=hidden size=1 name=curr runat="server">
                <asp:ValidationSummary ID=ValidationSummary1 runat="server" ShowSummary="False" ShowMessageBox="True"></asp:ValidationSummary></TD>
              </TR>
          </TABLE></TD></TR></TABLE></TD>
    <TD width=5 background=pics/wenbenkuan_06.gif><IMG height=5 
      src="pics/wenbenkuan_06.gif" width=5></TD></TR>
  <TR>
    <TD><IMG height=5 src="pics/wenbenkuan_07.gif" width=5></TD>
    <TD background=pics/wenbenkuan_08.gif><IMG height=5 
      src="pics/wenbenkuan_08.gif" width=5></TD>
    <TD><IMG height=5 src="pics/wenbenkuan_09.gif" 
width=5></TD></TR></TABLE>
			</asp:panel></form><input id="hidopenid" type="hidden" runat=server /> 
	</body>
</HTML>
<script>
    if (getUrlParam('code') != "")
{
	document.getElementById("pass1").style.display='none';
	document.getElementById("pass2").style.display='none';
	document.getElementById("pass3").style.display='none';
	document.getElementById("pass4").style.display='none';
	document.getElementById("note1").style.display='';
	document.getElementById("Submit1").value='关联帐号';
}
</script>