{template 'header.html'}
<div class="blank10"></div>
<div class="blank10"></div>

 <script type="text/javascript" LANGUAGE="javascript">
            <!--

            function check()
            {
                if(document.loginform.username.value.length==0){
                    alert("请输入用户名!");
                    document.loginform.username.focus();
                    return false;
                }

                if(document.loginform.password.value.length==0){
                    alert("请设置密码!");
                    document.loginform.password.focus();
                    return false;
                }

                if(document.loginform.password2.value.length==0){
                    alert("请输入确认密码!");
                    document.loginform.password2.focus();
                    return false;
                }

                if(document.loginform.aquestion.value.length==0){
                    alert("请设置安全问题!");
                    document.loginform.aquestion.focus();
                    return false;
                }

                if(document.loginform.question.value.length==0){
                    alert("请设置安全问题回答!");
                    document.loginform.question.focus();
                    return false;
                }

                if(document.loginform.answer.value.length==0){
                    alert("请输入自定义安全答案!");
                    document.loginform.answer.focus();
                    return false;
                }
                if(document.loginform.verify.value.length==0){
                    alert("请输入{lang(verifycode)}!");
                    document.loginform.verify.focus();
                    return false;
                }


            }


            function set_question(value)
            {
                document.getElementById("question").value=value;
                document.getElementById("question").focus();
            }
            //-->
        </script>

<style>
table {background:url({$skin_path}/re_bg.jpg) right bottom no-repeat;}
table tr td {height:38px;line-height:38px;font-size:14px;}
.input {width:170px;height:28px;line-height:28px;padding-left:10px;border:1px solid white;border-bottom:1px solid #CCC;}
#tdLeft {width:180px;}
</style>
    
            <form id="login_form"   name="loginform" method="post"  action="<?php echo url('user/register') ?>" onsubmit="return check()">
              
								<strong style="font-size:14px;color:red;">{message()}</strong>
                                    <table width="90%" border="0" cellspacing="0" cellpadding="0">
                                      {if config::get(reg_on)}
                                        <tr>
                                            <td nowrap="nowrap" align="right" id="tdLeft">
                                               {lang(username)}：
                                            </td>
                                            <td>
												<input name="username" type="text" id="username" value="{get('username')}" tabindex="1"  class="input" />
												</td>
                                        </tr>
                                        <tr>
                                            <td style="height: 30px" align="right">
                                                {lang(password)}：
                                            </td>
                                            <td style="height: 30px">
                                                <input name="password" type="password" id="password" value="<?php //echo $password;?>" tabindex="2" class="input" />
                                            </td>
                                        </tr>   
                                        <tr>
                                            <td style="height: 30px" align="right">{lang(againpassword)}：</td>
                                            <td><input type='password' id="password2"  name="password2" value="<?php //echo $password;?>" tabindex="3" class="input" />
                                            </td>
                                        </tr>

                                        <tr>
                                            <td style="height: 30px" align="right">{lang(question)}：</td>
                                            <td>
                                                <select name="" style="width:180px;border:1px solid white;border-bottom:1px solid #CCC;" onchange="set_question(this.value);">
                                                    <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 style="display:none;">
                                            <td style="height: 30px" align="right"></td>
                                            <td><input type='text' id="question"  name="question" value="" tabindex="3" class="input" />
                                            </td>
                                        </tr>

                                        <td style="height: 30px" align="right">{lang(answer)}：</td>
                                        <td>
                                            <input type='text' id="answer"  name="answer" value="" tabindex="3" class="input" /></td>
                                        </tr>

                                        <tr>
                                            <td style="height: 30px" align="right">{lang(e_mail)}：</td>
                                            <td><input type='text' id="e_mail"  name="e_mail" value="" tabindex="3"  class="input" /></td>
                                        </tr>

                               
                                        {loop $field $f}
                                        <?php
                                        $name=$f['name'];
                                        if(!preg_match('/^my_/',$name)) {
                                        unset($field[$name]);
                                        continue;
                                       }
                                       if(!setting::$var['user'][$name]['showinreg']) {
                                         continue;
                                        }
                                        ?>
                                        <tr>
                                            <td style="height: 30px" align="right"><?php echo setting::$var['user'][$name]['cname']; ?>：</td>
                                            <td width="80%">
                                                <?php echo form::getform($name,setting::$var['user'],$field,array()); ?>
                                            </td>
                                        </tr>
                                        {/loop}


                                      <?php if(config::get('verifycode')){ ?>
                                        <tr>
                                            <td style="height: 30px" align="right">
                                               {lang(verifycode)}：
                                            </td>
                                            <td style="height: 30px">
                                                <input type='text' id="verify"  tabindex="4"  name="verify" class="input" style="width:100px;" />&nbsp;{verify()}
                                            </td>
                                        </tr>
                                        <?php  } ?>

                                        <tr>
                                            <td style="height: 30px" align="right">

                                            </td>
                                            <td style="height: 30px" nowrap="nowrap">

                                                <input type="submit" name="submit" value=" {lang(register)} " class="button"   />
                                                &nbsp;&nbsp;&nbsp;&nbsp;<a href="{url('user/getpass')}">{lang(findpassword)}</a>&nbsp;&nbsp;<a href="<?php echo url('user/login');?>">{lang(login)}</a>
                                                </td>
                                        </tr>
                                        {else}
                                        <tr style="font-weight:bold;">
                                            <td style="height: 30px" align="right">{lang(tips)}：</td>
                                            <td style="color:red;">{lang(sitecloseregister)}</td>
                                        </tr>

                                        {/if}


                                    </table>
</form>

<div class="blank10"></div>
<div class="blank10"></div>
{template 'footer.html'}