<div class="ncontent">
    <script type="text/javascript" src="/resource/js/reg.js"></script>
    <script>
        var email_ver=0;
        var inval_captcha=0;
        var reg_succ=0;
        var activation_val=0;
        var errormsg_function=0;
        function errormsg_send() {
            if(errormsg_function==1){
                $('#errormsg-send').reveal();
            }
        }
        function captcha_error() {
            if(inval_captcha==1){
                $('#keystring-err_invalid').reveal();
            }
        }
        function emailverify() {
            if(email_ver==1){
                $('#email-verify').reveal();
            }
        }
        function activation_valid() {
            if(activation_val==1){
                $('#activation-valid').reveal();
            }
        }
        function reg_success() {
            if(reg_succ==1){
                $('#reg-successful').reveal();
                function crfile() {
                    document.forms["textfile"].submit();
                }
                setTimeout(crfile, 1000); // 1000 = 1 секунда
            }
        }
        window.onload = function () {
            errormsg_send();
            activation_valid();
            emailverify();
            captcha_error();
            reg_success();
        }
    </script>
    <div class="login" style="width: 603px;">
        <div class="title">{$reg_title}</div>
        <form action="/user/register" method="post" id="f1">

            <div class="login-box">
                <div class="error-msg" style="display:none;"></div>
                <i class="icon-user"></i><input id="login" name="login" type="text" required minlength="4" maxlength="9" placeholder="{$reg_login}"/>
            </div>
            <div class="name-box">
                <i class="icon-user"></i><input id="name" name="name" type="text" minlength="4" maxlength="9" required placeholder="{$reg_name}"/>
            </div>
            <div class="pass-box">
                <div class="error-msg" style="display:none;">В пароле должны быть и цифры!</div>
                <i class="icon-lock" style="color: rgb(238, 70, 70);"></i><input id="pass" required name="pass" minlength="4" maxlength="9" type="password" placeholder="{$reg_pass}"/>
            </div>
            <div class="repass-box">
                <div class="error-msg" style="display:none;"></div>
                <i class="icon-ok"></i><input id="repass" name="repass" type="password" minlength="4" maxlength="9" required placeholder="{$reg_rep_pass}"/>
            </div>
            <div class="email-box">
                <div class="error-msg" style="display:none;"></div>
                <i class="icon-envelope"></i><input id="mail" name="email" type="email" minlength="4" maxlength="30" required placeholder="{$reg_email}" />
            </div>
            <div class="referal-box">
                <div class="error-msg" style="display:none;"></div>
                <i class="icon-referal"></i><input id="referal" name="referer" type="text" minlength="4" maxlength="20" maxlength="9" placeholder="{$reg_ref}"/>
            </div>
            <div>
                <i class="icon-picture"></i><input required type="text" placeholder="{$reg_captcha}" style="width:80px;" name="keystring" id="keystring" maxlength="6">
                <img src="/captcha" align="middle" id="captcha2" onclick="this.src='/captcha'">
            </div>
            <br>
            <div class="rules-box">
                <div class="error-msg" style="display:none;">Ознакомьтесь с правилами!</div>
                <input type="checkbox" name="checkbox" id="agreement" required>
                <label for="agreement"><span></span>{$reg_rules}</label>
            </div>
            <button name="register_btn" class="btn-enter auth" type="submit" id="btn_s">{$reg_button}</button>

        </form>
    </div>

</div>