<?php TPL::output('global/header_landing.tpl.htm'); ?>

<script type="text/javascript">
	$(document).ready(function () {
		$('#header_action').append('Sign up');
	});
</script>

<form action="account/ajax/register_process/" method="post" id="register_form">
<?php if ($this->icode) { ?><input type="hidden" name="icode" id="icode" value="<?php echo $this->icode; ?>"/><?php } ?>
<?php if ($this->return_url) { ?><input type="hidden" name="return_url" value="<?php echo $this->return_url; ?>"/><?php } ?>
<?php if ($this->fromuid AND $_GET['invite_question_id']) { ?>
  	<input type="hidden" name="invite_question_id" value="<?php echo $_GET['invite_question_id']; ?>"/> 
<?php } ?>
<div class="tny-login login_bg_02">
  <ul class="loging register" id="user_register">
    <li>
      <input type="text" class="login_txt" name="user_name" id="login_userName" title="Username" value="<?php echo $_GET['user_name'];?>" tabindex="1"/>
      <span class="hide"></span> </li>
    <li>
      <?php if ($_GET['email']) { ?><input type="hidden" id="userEmail" /><?php } ?>
      <input type="text" class="login_txt" id="login_account" title="Account (email)" name="email" value="<?php echo $_GET['email']; ?>" tabindex="2" />
      <span class="hide"></span> </li>
    <li>
      <input type="text" class="login_txt" id="login_password_txt" tabindex="3" title="Password" value="Password"/>
      <input type="password" name="password" title="Password" id="login_password" class="login_txt tny-hide">
      <span class="hide"></span> </li>
    <li<?php if ($this->fromuid || $this->icode || (get_setting('register_seccode') == 'N')) { ?> style="display:none;"<?php } ?>>
      <input type="text" class="login_txt auth_code" id="authCode" name="seccode_verify" title="Verification code" value="Verification code" tabindex="4" />
      <em class="auth_img"><img src="" onclick="this.src = GET_BASE_URL + '/account/captcha/rnd-' + Math.floor(Math.random() * 10000);" id="seccode" /></em> <span class="hide"></span> </li>
    <li id="global_err" class="tny-hide">
      <p class="global-err tny-small tny-err_bg"><em class="e"></em><span id="glo_Err">Account number or password is incorrect, please try again</span></p>
    </li>
    <li class="user_treaty">
      <input type="checkbox" name="agreement_chk" value="agree" id="user_agreement" checked="true"/>
      &nbsp;&nbsp;
      <label for="user_agreement">I agree <a href="javascript:;" onClick="$.register.s.EveClick();">User agreement</a> terms</label>
      <div class="usertt reg_treaty_bg rel tny-hide" id="user_agre"><span class="reg_arrows abs tny-small"></span><div class="txt" id="register_agreement">Loading......</div></div>
    </li>
    <li><a href="javascript:;" class="login_sub tny-cl_06 tny-fb_14 tny-right" title="Register now" tabindex="5"  onClick="$.register.reg.register().callback(function () { ajax_post($('#register_form'), _login_form_processer); });">Sign up</a></li>
  </ul>
</div>
</form>

<script type="text/javascript" src="<?php echo GET_STATIC_URL; ?>/js/app/login.js"></script>
<script type="text/javascript">
	$(document).ready(function () {
		$.get(GET_BASE_URL + '/account/ajax/register_agreement/', function (result) { $('#register_agreement').html(result.err); }, 'json');
		
		if (document.getElementById('seccode'))
		{
			$('#seccode').click();
		}
	});
</script>

<?php TPL::output('global/footer_blank.tpl.htm'); ?>