<div class="Block Moveable Panel" id="CreateAccountForm">
	<h2 class="title">%%GLOBAL_CreateAccountHeading%%</h2>
	<script src="https://www.google.com/recaptcha/api.js?render=%%GLOBAL_SiteKey%%"></script>
	<p>%%LNG_CreateAccountIntro4%% <em>%%GLOBAL_StoreName%%</em> %%LNG_CreateAccountIntro5%%</p>
	<div class="BlockContent">
		<div class="alert alert-danger" style="display:%%GLOBAL_HideCreateAccountErrorMessage%%">
			%%GLOBAL_ErrorMessage%%
		</div>

		<form action="%%GLOBAL_ShopPath%%/login.php?action=save_new_account" method="post" onsubmit="return check_create_account_form()" class="form-horizontal account-register clearfix">
			<input type="hidden" id="token" name="token">
			<fieldset>
				<legend>%%LNG_PersonalDetails%%<br><small style="font-size: 11px;">%%LNG_CreateAccountPersonalIntro%%</small></legend>
				%%GLOBAL_CreateAccountEmailPassword%%
			</fieldset>

			<fieldset>
				<legend>%%LNG_ShippingDetails%%<br><small style="font-size: 11px;">%%LNG_CreateAccountShippingIntro%%</small></legend>
				%%GLOBAL_CreateAccountDetails%%
			</fieldset>

			<div class="buttons">
				<div class="pull-right">
					<input type="submit" value="%%GLOBAL_CreateAccountButtonText%%" class="btn btn-primary">
				</div>
			</div>
		</form>
	</div>
</div>
%%Panel.CreateAccountJavaScript%%
%%GLOBAL_CarregaEndereco%%
<script>
var interval = setInterval(function(){
  if(window.grecaptcha){
        grecaptcha.ready(function() {
       grecaptcha.execute('%%GLOBAL_SiteKey%%', {action: 'homepage'}).then(function(token) {
          // console.log(token);
          document.getElementById("token").value = token;
       });
       // refresh token every minute to prevent expiration
       setInterval(function(){
         grecaptcha.execute('%%GLOBAL_SiteKey%%', {action: 'homepage'}).then(function(token) {
           console.log( 'refreshed token:', token );
           document.getElementById("token").value = token;
         });
       }, 60000);

     });
    clearInterval(interval);
  }
}, 100);
</script>