{template 'phpcms','header'}
<script language="javascript">
<!--
function CheckForm() {
if ($F('reg_username') == "")
	{
	    alert("请输入用户名！")
		Field.clear('reg_username')
		Field.focus('reg_username');
	    return false
	 }
if ($F('reg_password') == "")
	{
	    alert("请输入密码！")
		Field.clear('reg_password')
		Field.focus('reg_password');
	    return false
	 }
if ($F('pwdconfirm') != $F('reg_password'))
	{
	    alert("两次输入的密码不一致！")
		Field.clear('reg_password')
		Field.clear('pwdconfirm')
		Field.focus('reg_password');
	    return false
	 }
if ($F('email') == "")
	{
	    alert("请输入E-mail！")
		Field.clear('email')
		Field.focus('email');
	    return false
	 }
{if $MOD['enablecheckcodeofreg']}
if (myform.checkcodestr.value == "")
	{
	    alert("请输入验证码！")
	    return false
	 }
{/if}
    document.myform.submit.disabled = true;
}

function checkuser(inputname)
{
    if(inputname==''){
        alert("会员名不能为空！");
        $('username_notice').innerHTML="<font color='red'>会员名不能为空！</font>";
        Field.focus('username');
    }else{
        var checkurl = '{$MOD[linkurl]}register.php';
		var pars = "action=checkuser&username="+inputname;
		var myAjax = new Ajax.Request(checkurl, {method: 'post', parameters: pars, onComplete: checkmessage});
    }
}

function checkmessage(Request)
{
	if(Request.responseText == '1'){
		alert("您填写的会员名长度不合法！");
		$('username_notice').innerHTML="<font color='red'>您注册的会员名长度不合法，请重新填写。</font>";
		Field.clear('reg_username')
		Field.focus('reg_username');
	}else if(Request.responseText == '2'){
		alert("您填写的会员名含有非法字符！");
		$('username_notice').innerHTML="<font color='red'>您注册的会员名含有非法字符，请重新填写。</font>";
		Field.clear('reg_username')
		Field.focus('reg_username');
	}else if(Request.responseText == '3'){
		alert("您填写的会员名已被使用！");
		$('username_notice').innerHTML="<font color='red'>您注册的会员名已被使用，请重新填写。</font>";
		Field.clear('reg_username')
		Field.focus('reg_username');
	}else if(Request.responseText == '4'){
		alert("您填写的会员名已被禁止使用！");
		$('username_notice').innerHTML="<font color='red'>您注册的会员名被禁止使用，请重新填写。</font>";
		Field.clear('reg_username')
		Field.focus('reg_username');
	}else{
		$('username_notice').innerHTML="<font color=green>您注册的会员名尚未被使用，可以注册。</font>";
	}
}

function checkemail(email)
{
    if(email==''){
        alert("E-mail 不能为空！");
        $('email_notice').innerHTML="<font color='red'>E-mail 不能为空！</font>";
        Field.focus('email');
    }else{
        var checkurl = '/member/register.php';
		var pars = "action=checkemail&email="+email;
		var myAjax = new Ajax.Request(checkurl, {method: 'post', parameters: pars, onComplete: checkemailmessage});
    }
}

function checkemailmessage(Request)
{
	if(Request.responseText == '1'){
		alert("E-mail 地址不合法！");
		$('email_notice').innerHTML="<font color='red'>E-mail 地址不合法！请重新填写。</font>";
		Field.clear('email')
		Field.focus('email');
	}else if(Request.responseText == '2'){
		alert("您填写的E-mail已被他人占用！");
		$('email_notice').innerHTML="<font color='red'>您填写的E-mail已被他人占用！请重新填写。</font>";
		Field.clear('email')
		Field.focus('email');
	}else{
		$('email_notice').innerHTML="<font color=green>您填写的 E-mail 尚未被占用，可以注册。</font>";
	}
}
//-->
</script>

<div class="memberborder_1">
<div class="memberborder_2">
<h1>基本资料 [必填]</h1>
  <form name="myform" method="post" action="{$MOD[linkurl]}register.php" onSubmit='return CheckForm();'>
   <table cellpadding="0" cellspacing="0" class="righttable">
    <tr>
      <td width="15%" class="td_right">用户名：</td>
      <td><input name="username" type="text" id="reg_username" value="{$username}" size="15" onBlur="checkuser(this.value);">
          <span id="username_notice" class="color_1">3到20个字符，不得包含非法字符！</span></td>
    </tr>
    <tr>
      <td class="td_right">密　码：</td>
      <td><input name="password" type="password" id="reg_password" size="15">
        <span class="color_1">4到20个字符</span></td>
    </tr>
    <tr>
      <td class="td_right">确认密码：</td>
      <td><input name="pwdconfirm" type="password" id="pwdconfirm" size="15"></td>
    </tr>
    <tr>
      <td class="td_right">密码提示问题：</td>
      <td><input name="question" type="text" id="question" size="30"></td>
    </tr>
    <tr>
      <td class="td_right">问题答案：</td>
      <td><input name="answer" type="text" id="answer" size="30"></td>
    </tr>
    <tr>
      <td class="td_right">Email地址：</td>
      <td>
        <input name="email" type="text" id="email" size="30" maxlength="50"  onBlur="checkemail(this.value);">
        <input type="checkbox" name="showemail" id="showemail" value="1" class="radio">
        <span class="color_1">是否公开</span> <span id="email_notice" class="color_1"></span></td>
    </tr>
<!--{if $MOD['enablecheckcodeofreg']}-->
    <tr>
      <td class="td_right">验证码：</td>
      <td>
      <input name="checkcodestr" type="text" size="15">
	  <img src="{PHPCMS_PATH}checkcode.php" id="checkcode" onclick="this.src='{PHPCMS_PATH}checkcode.php?id='+Math.random()*5;" style="cursor:pointer;" alt="验证码,看不清楚?请点击刷新验证码" align="absmiddle"/>
        <span class="color_1">请把图形中的字符填写到输入框中</span> </td>
    </tr>
<!--{/if}-->
</table>
<script language="javascript">
function show(c_Str){
if(document.all(c_Str).style.display=='none'){
document.all(c_Str).style.display='block'
}else{
document.all(c_Str).style.display='none'
}
}
</script>
<h1>详细资料 [选填] <input type="checkbox" name="showdetail" id="showdetail" value="1" class="radio" onclick="javascript:show('detail')">　</h1>
<table cellpadding="0" cellspacing="0" class="righttable">
<tbody id="detail" style="display:none">
    <tr>
      <td width="15%" class="td_right">真实姓名：</td>
      <td><input name="truename" type="text" id="truename" size="20" maxlength="50"></td>
    </tr>
    <tr>
      <td class="td_right">性　　别：</td>
      <td>
        <input name="gender" type="radio" style="border:0px " value="1" checked>
        <span class="color_2">男</span>        <input type="radio" name="gender" value="0" class="radio">
        <span class="color_2">女</span></td>
    </tr>
    <tr>
      <td class="td_right">生　　日：</td>
      <td>
        <input name="byear" type="text" size="4" value="19">
        <span class="color_2">年</span> 
		<select name="bmonth" id="bmonth">
          <option value="00"></option>
          <option value="01">1</option>
          <option value="02">2</option>
          <option value="03">3</option>
          <option value="04">4</option>
          <option value="05">5</option>
          <option value="06">6</option>
          <option value="07">7</option>
          <option value="08">8</option>
          <option value="09">9</option>
          <option value="10">10</option>
          <option value="11">11</option>
          <option value="12">12</option>
        </select>
        <span class="color_2">月</span> 
		<select name="bday" id="bday">
          <option value="00"></option>
          <option value="01">1</option>
          <option value="02">2</option>
          <option value="03">3</option>
          <option value="04">4</option>
          <option value="05">5</option>
          <option value="06">6</option>
          <option value="07">7</option>
          <option value="08">8</option>
          <option value="09">9</option>
          <option value="10">10</option>
          <option value="11">11</option>
          <option value="12">12</option>
          <option value="13">13</option>
          <option value="14">14</option>
          <option value="15">15</option>
          <option value="16">16</option>
          <option value="17">17</option>
          <option value="18">18</option>
          <option value="19">19</option>
          <option value="20">20</option>
          <option value="21">21</option>
          <option value="22">22</option>
          <option value="23">23</option>
          <option value="24">24</option>
          <option value="25">25</option>
          <option value="26">26</option>
          <option value="27">27</option>
          <option value="28">28</option>
          <option value="29">29</option>
          <option value="30">30</option>
          <option value="31">31</option>
        </select>
        <span class="color_2">日</span></td>
    </tr>
    <tr>
      <td class="td_right">证件类别：</td>
      <td>
        <select name="idtype">
          <option value="身份证" >身份证</option>
          <option value="学生证" >学生证</option>
          <option value="军人证" >军人证</option>
          <option value="护照" >护照</option>
        </select>
      </td>
    </tr>
    <tr>
      <td class="td_right">证件号码：</td>
      <td><input type=text name="idcard" value="" size=22 maxlength=18></td>
    </tr>
    <tr>
      <td class="td_right">>所在地：</td>
      <td>
<select name="province" id="province" onchange="javascript:loadcity(this.value);">
<option value="0" selected="selected">请选择</option>
</select>

<select name="city" id="city" onchange="javascript:loadarea($('province').value, this.value);">
<option value="0" selected="selected">请选择</option>
</select>

<select name="area" id="area">
<option value="0" selected="selected">请选择</option>
</select>

<script language="javascript">
<!--
var phpcms_path = '{PHPCMS_PATH}';
var selectedprovince = '{$PHPCMS[province]}';
var selectedcity = '{$PHPCMS[city]}';
var selectedarea = '{$PHPCMS[area]}';
//-->
</script>
<script type="text/javascript" src="{PHPCMS_PATH}include/js/area.js"></script>

      </td>
    </tr>
    <tr>
      <td class="td_right">所属行业：</td>
      <td>
        <select name="industry">
          <option value="">请选择　　</option>
          <option value="金融业">金融业</option>
          <option value="服务业">服务业</option>
          <option value="信息产业">信息产业</option>
          <option value="制造业">制造业</option>
          <option value="传播业">传播业</option>
          <option value="教育">教育</option>
          <option value="政府机构">政府机构</option>
          <option value="医疗保健">医疗保健</option>
          <option value="房地产">房地产</option>
          <option value="其它">其它</option>
        </select>
      </td>
    </tr>
    <tr>
      <td class="td_right">教育水平：</td>
      <td>
        <select name="edulevel" size=1>
          <option value="">请选择　　</option>
          <option value="博士">博士</option>
          <option value="硕士">硕士</option>
          <option value="大学">大学</option>
          <option value="高中">高中</option>
          <option value="初中">初中</option>
          <option value="小学">小学</option>
        </select>
      </td>
    </tr>
    <tr>
      <td class="td_right">从事职业：</td>
      <td>
        <select name="occupation">
          <option value="">请选择　　</option>
          <option value="学生">学生</option>
          <option value="职员">职员</option>
          <option value="经理">经理</option>
          <option value="专业人士">专业人士</option>
          <option value="公务员">公务员</option>
          <option value="私营主">私营主</option>
          <option value="待业">待业</option>
          <option value="退休">退休</option>
          <option value="其它">其它</option>
        </select>
      </td>
    </tr>
    <tr>
      <td class="td_right">收入水平：</td>
      <td>
        <select name="income">
          <option value="">请选择　　</option>
          <option value="6000以上">6000以上</option>
          <option value="4001-6000">4001-6000</option>
          <option value="2001-4000">2001-4000</option>
          <option value="1001-2000">1001-2000</option>
          <option value="501-1000">501-1000</option>
          <option value="500以下">500以下</option>
        </select>
      </td>
    </tr>
    <tr>
      <td class="td_right">电　　话：</td>
      <td><input name="telephone" type="text" id="telephone" size="20"></td>
    </tr>
    <tr>
      <td class="td_right">手　　机：</td>
      <td><input name="mobile" type="text" id="mobile" size="20"></td>
    </tr>
    <tr>
      <td class="td_right">地　　址：</td>
      <td><input name="address" type="text" id="address" size="50">
      </td>
    </tr>
    <tr>
      <td class="td_right">邮　　编：</td>
      <td><input name="postid" type="text" id="postid" size="10">
      </td>
    </tr>
    <tr>
      <td class="td_right">主　　页：</td>
      <td><input name="homepage" type="text" id="homepage" size="20"></td>
    </tr>
    <tr>
      <td class="td_right">QQ号码：</td>
      <td><input name="qq" type="text" id="qq" size="20" maxlength="20"></td>
    </tr>
    <tr>
      <td class="td_right">MSN帐号：</td>
      <td><input name="msn" type="text" id="msn" size="20" maxlength="50"></td>
    </tr>
    <tr>
      <td class="td_right">ICQ号码：</td>
      <td><input name="icq" type="text" id="icq" size="20" maxlength="20"></td>
    </tr>
    <tr>
      <td class="td_right">Skype帐号：</td>
      <td><input name="skype" type="text" id="skype" size="20" maxlength="50"></td>
    </tr>
    <tr>
      <td class="td_right">支付宝帐号：</td>
      <td><input name="alipay" type="text" id="alipay" size="20" maxlength="50"></td>
    </tr>
    <tr>
      <td class="td_right">贝宝帐号：</td>
      <td><input name="paypal" type="text" id="paypal" size="20" maxlength="50"></td>
    </tr>
    <tr>
      <td class="td_right">头像地址：</td>
      <td><input name="userface" type="text" id="userface" size="50" maxlength="50"></td>
    </tr>
    <tr>
      <td class="td_right">头像大小：</td>
      <td><span class="color_2">宽度：</span>
          <input name="facewidth" type="text" id="facewidth" size="4" maxlength="50">
        <span class="color_2">px 高度</span>：
        <input name="faceheight" type="text" id="faceheight" size="4" maxlength="50">
        <span class="color_2">px</span></td>
    </tr>
    <tr>
      <td class="td_right">签名信息：</td>
      <td><textarea name='sign' cols='35' rows='5' id='sign'></textarea></td>
    </tr>
	</tbody>
</table>
{if $fields}
<h1>其他资料</h1>
<table cellpadding="0" cellspacing="0" class="righttable">
{$fields}
</table>
{/if}
<table cellpadding="0" cellspacing="0" class="righttable">
    <tr>
      <td width="15%" class="td_right">&nbsp;</td>
      <td height="60">
	      <input name="dosubmit" type="hidden" id="dosubmit" value="1">
          <input name="forward" type="hidden" id="forward" value="{$forward}">
		  <input type="submit" name="submit" value=" 注 册 " class="btn">
		　<input type="reset" name="Submit" value=" 清 除 " class="btn">
	  </td>
     </tr>
</table>
</form>
</div>
</div>
{template 'phpcms','footer'}