<%@ Page Language="C#" AutoEventWireup="true" CodeFile="reg_step1.aspx.cs" EnableViewState="True"
    Inherits="reg_step1" %>

<%@ Import Namespace="Spaces" %>
<html>
<head>
    <title>Register</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <script language="javascript" type="text/javascript" src="include/js/base.js"></script>
    <script language="javascript" type="text/javascript" src="include/js/net_secure.js"></script>
    <script language="javascript" type="text/javascript" src="<%=Globals.ScriptPath %>/dialog.js"></script>
    <script language="javascript" type="text/javascript" src="include/js/spaces_soap.js"></script>
    <script language="javascript" type="text/javascript" src="<%=Globals.ScriptPath %>/reg_step1.js"></script>
    <script language="JavaScript" src='<%=Globals.ScriptPath %>/selectcity.js'></script>
    <style type="text/css">
<!--
A:link {
	text-align: center;
	font-size: 12px;
	color: #000000;
	text-decoration: none;
}
A:visited {
	text-align: center;
	font-size: 12px;
	color: #000000;
	text-decoration: none;
}
A:hover {
	background-color: #E2FFA5;
	border: 1px solid #B8C2AA;
	font-size: 12px;
	color: #FF0000;
	text-decoration: none;
	text-align: center;
}
body,td,div{font-size:12px ; 
 margin:0px
}
}
.1pxborder {
	border: 1px solid #009900;
}
.noborder {
	border: 0px dotted #FFFFFF;
	margin: 0px;
	padding: 0px;
}
.myinput {
	background-attachment: fixed;
	background-image: url(images/search_inputbackground.gif);
	background-repeat: repeat-x;
	border: 1px solid #999999;
	height:19px;
	padding:2px 2px 2px;
}
.myinputfocus {
	background-attachment: fixed;
	background-image: url(images/search_inputbackgroundfocus.gif);
	background-repeat: repeat-x;
	height:19px;
	padding:2px 2px 3px;
	border: 1px solid #009900;
	filter: Glow(Color=green, Strength=2); }
.chkbox {
	border: none;
	clear: none;
	overflow: hidden;
	font-family: "Arial", "Helvetica", "sans-serif";
	color: #009900;
}
.regline{
background-image: url(images/dot_hline_gray01.gif);
}
.regline2
{  
padding: 12 0 9 15; background-color:#F5F5F5;height:30px;  
font-size:12px;
    
}
-->
</style>

    <script type="text/javascript">
    function chku(username)
    {
     if(!chkUsername(username))
      return ;
      checkUsername(username);
    }
    function chka(account)
    {
    if(!chkAccount(account))
     return ;
     checkAccount(account);
    }
    function chkUsername(username)
     { 
     if(username.trim()=='')
     {
      _error_msg_show(Strings.MessageLostName);
     return false;
     }
     if(username.length<=1)
     {
      _error_msg_show(Strings.MessageUsernameLengthTip);
      return false;
     }
     if(!(/^[a-zA-Z0-9_\u4e00-\u9fa5]*$/.test(username)))
     {_error_msg_show(Strings.MessageUsernameError);
     return false ;
     }
     
     return true;
     }
     function chkAccount(account)
     {
      if(account.trim()=='')
   {
   _error_msg_show(Strings.MessageLostAccount);
   return false;
   }
  if(account.trim().length<4||account.trim().length>16)
   {
  _error_msg_show(Strings.MessageAccountLengthTip);
   return false ;
    }
   if(!(/^[a-zA-Z0-9_]*$/.test(account)))
   {
    _error_msg_show(Strings.MessageAccountTip);
     return false ;
    }
   return true;
     }
String.prototype.isTime = function() //检查是否时间
{
  var r = this.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/); 
  if(r==null)return false; var d = new Date(r[1], r[3]-1,r[4]); 
  return (d.getFullYear()==r[1]&&(d.getMonth()+1)==r[3]&&d.getDate()==r[4]);
}
function isEmail(emailStr)
      {

var reg=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
return reg.test(emailStr)
    }
  function regCheck(obj)
  {
  var username=$('<%=txtUsername.ClientID %>').value;
   
   if(!chkUsername(username))
    {
     return false;
    }
    
   var account= $('mydomain').value;
  
   if(!chkAccount(account))
   {
     return false;
   }
   var password =$('<%=txtPassword.ClientID %>').value;
   var password2=$('pwd2').value;
   if(password.trim()=='')
   {
     _error_msg_show(Strings.MessageLostPassword);
     return false;
   }
   if(password2.trim()=='')
   {
      _error_msg_show(Strings.MessageLostRePassword);
     return false;
   }
   if(password.length<4||password.length>16)
   {
     _error_msg_show(Strings.MessagePasswordLengthTip);
     return false;
    }
   if(password!=password2)
   {
     _error_msg_show(Strings.MessagePasswordError);
     return false;
   }
   
   var email =$('<%=txtEmail.ClientID %>').value;
   if(!isEmail(email))
   {
    _error_msg_show(Strings.MessageEmailError);
     return false;
   }
   var nickName=$('<%=txtNickName.ClientID%>').value;
    if(nickName.trim()=='')
   {
   _error_msg_show(Strings.MessageLostNiceName);
   return false;
   }
   var vcity=$('city');
   if(vcity.value=='-1')
   {
    _error_msg_show(Strings.MessageNoSelectedCity);
   return false;
   }
   var data=$('<%=dropYear.ClientID %>').value+'-'+$('<%=dropMonth.ClientID %>').value+'-'+$('<%=DropDay.ClientID %>').value;
   if(!data.isTime())
    {
     _error_msg_show(Strings.MessageTimeError);
     return false;
    }                                 
    return true;
  }
  
    </script>
 
</head>
<body>
    <form runat="server">
 
        <table width="770" border="0" align="center" cellpadding="0" cellspacing="0">
            <tbody>
                <tr valign="bottom">
                    <td style="padding-bottom: 3px; ">
                        <a href="http://www.bfor.cn">
                            <img border="0" src="images/bfor.gif" /></a></td>
                    <td style="padding-right: 10px; padding-left: 0px; padding-bottom: 5px; padding-top: 0px"
                        align="right">
                        &nbsp;
                    </td>
                </tr>
            </tbody>
        </table>
        <!---- //TOP ---->
        <table width="770" border="0" align="center" cellpadding="0" cellspacing="0">
            <tbody>
                <tr bgcolor="#67c107">
                    <td>
                        <img height="30" src="images/top_left.gif" width="4"></td>
                    <td width="762" bgcolor="#67c107" style="padding-left: 44px">
                        <%=Globals.Text["Register_Welcome"]%>
                    </td>
                    <td>
                        <img height="30" src="images/top_right.gif" width="4"></td>
                </tr>
            </tbody>
        </table>
        <!---- //TOP ---->
        <!---- CONTENTS ---->
        <table width="770" border="0" align="center" cellpadding="0" cellspacing="0">
            <tbody>
                <tr>
                    <td width="1" bgcolor="#c8e9a6" height="20">
                    </td>
                    <td width="768">
                    </td>
                    <td width="1" bgcolor="#c8e9a6">
                    </td>
                </tr>
                <tr valign="top">
                    <td bgcolor="#c8e9a6">
                    </td>
                    <td align="center">
                        <table width="678" border="0" cellpadding="0" cellspacing="0" class="font12">
                            <tr>
                                <td class="font18">
                                    <strong>
                                        <%=Globals.Text["Register_NewRegister"]%>
                                    </strong>
                                </td>
                            </tr>
                            <tr>
                                <td style='padding: 8 0 30 0'>
                                    <font color="#666666">
                                        <%=Globals.Text["Register_RegisterWarning"]%>
                                        <br>
                                        <%=Globals.Text["Register_RegisterPromiss"]%>
                                    </font>
                                </td>
                            </tr>
                        </table>
                        <table width="678" border="0" cellpadding="0" cellspacing="0" class="font12">
                            <tr>
                                <td>
                                    (<span class='o01'><font color="#FF0000">*</font></span>)<font
                                        color="#FF0000">*</font></td>
                            </tr>
                        </table>
                        <table width="673" border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td height="2" colspan="2" bgcolor="#D7D7D7">
                                </td>
                            </tr>
                            <tr valign="top">
                                <td width="115" class="regline2">
                                    <span class='o01'><font color="#FF0000">*</font></span><%=Globals.Text["Register_MemberLogin"]%></td>
                                <td class='lh18 regline2'>
                                    <asp:TextBox ID="txtUsername" runat="server" Width="150px" Columns="20" CssClass="myinput" onfocus="this.className='myinputfocus'"
                                        onblur="this.className='myinput'"></asp:TextBox>&nbsp; <a href="javascript:chku($('<%=txtUsername.ClientID %>').value);" style="cursor: hand">Check Username</a>
                                
                                </td>
                            </tr>
                            <tr valign="top">
                                <td class="regline2" width="115">
                                    <span style="color: #ff0000">*</span>网址:</td>
                                <td class="lh18 regline2">
                                    <asp:Literal ID="txtUserDomain" runat="server"></asp:Literal> &nbsp;<a href="javascript:chka($('mydomain').value)">检查网址</a><br /><%=Globals.Text["Register_AccountLength"]%><%=Globals.Text["Register_RegisterColorTip"]%><%=Globals.Text["Register_RegisterMustFill"]%></td>
                                    
                            </tr>
                            <tr>
                                <td height="1" colspan="2" class="regline">
                                </td>
                            </tr>
                            <tr valign="top">
                                <td class="regline2">
                                    <span class='o01'><font color="#FF0000">*</font><%=Globals.Text["Register_Password"]%></span></td>
                                <td class='lh18 regline2'>
                                    <asp:TextBox ID="txtPassword" runat="server" Width="150px" TextMode="Password" CssClass="myinput"
                                        MaxLength="12" onfocus="this.className='myinputfocus'" onblur="this.className='myinput'"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td height="1" colspan="2" class="regline">
                                </td>
                            </tr>
                            <tr valign="top">
                                <td class="regline2">
                                    <span class='o01'><font color="#FF0000">*</font><%=Globals.Text["Register_Password2"]%></span></td>
                                <td class='lh18 regline2'>
                                    <input name="pwd2" id="pwd2" type="password" class='myinput'  style="width:150px" maxlength="12" onfocus="this.className='myinputfocus'"
                                        onblur="this.className='myinput'">
                                </td>
                            </tr>
                            <tr>
                                <td height="1" colspan="2" class="regline">
                                </td>
                            </tr>
                            <tr valign="top">
                                <td class="regline2">
                                    <span class='o01'><font color="#FF0000">*</font></span><%=Globals.Text["Register_Email"]%></td>
                                <td class='lh18 regline2'>
                                    <asp:TextBox ID="txtEmail" runat="server" Width="150px" Columns="40" CssClass="myinput" onfocus="this.className='myinputfocus'"
                                        onblur="this.className='myinput'"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td height="1" colspan="2" class="regline">
                                </td>
                            </tr>
                            <tr>
                                <td class="regline2" width="115">
                                    <%=Globals.Text["Register_NiceName"]%>
                                </td>
                                <td class='lh18 regline2'>
                                    <asp:TextBox ID="txtNickName" runat="server" CssClass="myinput" Width="150px"  MaxLength="12"
                                        onfocus="this.className='myinputfocus'" onblur="this.className='myinput'"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" style="height: 1px" class="regline">
                                </td>
                            </tr>
                           
                                <tr valign="top">
                                <td class="regline2">
                                   城市:
                                </td>
                                <td class='lh18 regline2'>
                                    <select name="prov" onchange="javascript:selectcity()" size="1">
                                                    <option selected="selected" value="-1">select</option>
                                                </select>

                                                <script language="javascript">  ProvinceOptionMenu();                              
                                                </script>
                                                <select id="city" name="city" size="1">
                                                    <option selected="selected" value="-1">请选择</option>
                                                </select>
                                </td>
                            </tr>
                             <tr>
                                <td colspan="2" style="height: 1px" class="regline">
                                </td>
                            </tr>
                            <tr valign="top">
                                <td class="regline2">
                                    <%=Globals.Text["Register_Sex"]%>
                                </td>
                                <td class='lh18 regline2'>
                                    <asp:RadioButtonList ID="Gender" runat="server" RepeatDirection="Horizontal">
                                    </asp:RadioButtonList>
                                </td>
                            </tr>
                            <tr>
                                <td height="1" colspan="2" class="regline">
                                </td>
                            </tr>
                            <tr valign="top">
                                <td  class="regline2">
                                    <%=Globals.Text["Register_Address"]%>
                                </td>
                                <td   class="regline2">
                                    <asp:TextBox ID="txtAddress" runat="server" CssClass="myinput" Columns="40" onfocus="this.className='myinputfocus'"
                                        onblur="this.className='myinput'"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td height="1" colspan="2" class="regline">
                                </td>
                            </tr>
                            <div id="doctoritem" style="display: none">
                            </div>
                            <tr valign="top">
                                <td class="regline2">
                                    <%=Globals.Text["Register_Birthday"]%>
                                </td>
                                <td class='lh18 regline2'>
                                    <asp:DropDownList ID="dropYear" runat="server">
                                    </asp:DropDownList><%=Globals.Text["Register_BirthdayYear"]%><asp:DropDownList ID="dropMonth"
                                        runat="server">
                                    </asp:DropDownList><%=Globals.Text["Register_BirthdayMonth"]%><asp:DropDownList ID="DropDay"
                                        runat="server">
                                    </asp:DropDownList><%=Globals.Text["Register_BirthdayDay"]%>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" style="height: 1px" class="regline">
                                </td>
                            </tr>
                      
                            <tr>
                                <td colspan="2" height="20">
                                </td>
                            </tr>
                        </table>
                        <table width="770" cellspacing="0" cellpadding="0" border="0">
                            <tr>
                                <td height="1" bgcolor="#67C107">
                                </td>
                            </tr>
                            <tr>
                                <td align="center" style='padding: 30 0 49 0'>
                                    <asp:Button ID="btnReg" runat="server" Text="  开通我的空间  " OnClientClick="return regCheck(this);"
                                        OnClick="btnReg_Click" />
                                       
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td bgcolor="#c8e9a6">
                        <!-- MARGIN -->
                    </td>
                </tr>
            </tbody>
        </table>
        <!---- //CONTENTS ---->
        <!---- FOOTER ---->
        <table width="770" border="0" align="center" cellpadding="0" cellspacing="0" class="black333333_red_noline">
            <tbody>
                <tr>
                    <td bgcolor="#67c107" height="2">
                        <!-- MARGIN -->
                    </td>
                </tr>
                <tr>
                    <td>
                        <table width="100%" border="0" cellpadding="2" cellspacing="0" class="black333333_red_noline">
                            <tr>
                                <td height="35">
                                    Copyright &copy; <font color="#0066CC"><a href="http://www.bfor.cn" target="_blank">
                                        <font color="#0066CC">bfor.cn</font></a>.</font>All Rights Reserved.</td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </tbody>
        </table>
        <table width="100%" height="89" border="0" align="center" cellpadding="4" cellspacing="0"
            background="images/table_bg.gif" class="font12">
            <tr>
                <td height="30" align="center">
                    &nbsp;
                </td>
            </tr>
           
        </table>
    </form>
</body>
</html>
<asp:literal runat="server" id="Message"></asp:literal>
