<br />
<div class="alert alert-danger" role="alert" style="display: %%GLOBAL_HideFormError%%">
	%%LNG_BadContactFormCaptcha%%
</div>
<script src="https://www.google.com/recaptcha/api.js?render=%%GLOBAL_SiteKey%%"></script>

<form action="%%GLOBAL_ShopPath%%/pages.php?action=sendContactForm" method="post" id="ContactForm" class="PL20">
	<input type="hidden" name="page_id" id="page_id" value="%%GLOBAL_PageId%%" />
	<input type="hidden" id="token" name="token">
	<div class="personal-infomation">
		<div class="primari-box personal-info-box">
			<h3 class="box-subheading">Enviar uma mensagem</h3>
			<div class="personal-info-content">
				<div class="form-content">
					<div class="form-group primary-form-group" style="display: %%GLOBAL_HideFullName%%">
						<label for="loginemail">%%LNG_ContactName%%:</label>
						<input type="text" name="contact_fullname" id="contact_fullname" class="form-control unicase-form-control text-input" value="%%GLOBAL_ContactName%%">
					</div>

					<div class="form-group primary-form-group">
						<label for="loginemail">%%LNG_ContactEmail%%:</label>
						<input type="text" name="contact_email" id="contact_email" class="form-control unicase-form-control text-input" value="%%GLOBAL_ContactEmail%%">
					</div>

					<div class="form-group primary-form-group" style="display: %%GLOBAL_HideCompanyName%%">
						<label for="loginemail">%%LNG_ContactCompanyName%%:</label>
						<input type="text" name="contact_companyname" id="contact_companyname" class="form-control unicase-form-control text-input" value="%%GLOBAL_ContactCompanyName%%">
					</div>

					<div class="form-group primary-form-group" style="display: %%GLOBAL_HidePhone%%">
						<label for="loginemail">%%LNG_ContactPhone%%:</label>
						<input type="text" name="contact_phone" id="contact_phone" class="form-control unicase-form-control text-input" value="%%GLOBAL_ContactPhone%%">
					</div>

					<div class="form-group primary-form-group" style="display: %%GLOBAL_HideOrderNo%%">
						<label for="loginemail">%%LNG_ContactOrderNo%%:</label>
						<input type="text" name="contact_orderno" id="contact_orderno" class="form-control unicase-form-control text-input" value="%%GLOBAL_ContactOrderNo%%">
					</div>

					<div class="form-group primary-form-group" style="display: %%GLOBAL_HideRMANo%%">
						<label for="loginemail">%%LNG_ContactRMANo%%:</label>
						<input type="text" name="contact_rma" id="contact_rma" class="form-control unicase-form-control text-input" value="%%GLOBAL_ContactRMA%%">
					</div>

					<div class="form-group primary-form-group"">
						<label for="loginemail">Mensagem:</label>
						<textarea name="contact_question" id="contact_question" class="form-control unicase-form-control text-input" rows="5" cols="50" style="height: 150px;">%%GLOBAL_ContactQuestion%%</textarea>
					</div>

					<div class="form-group primary-form-group" style="display: %%GLOBAL_HideCaptcha%%">
						<label for="loginemail">%%LNG_CaptchaVerification%%:</label>
						<dd style="margin: 0;display: %%GLOBAL_HideCaptcha%%">
							<p class="Warning">%%LNG_CaptchaIntro%%</p>
							<input style="margin-bottom:5px; width:105px" type="text" name="captcha" id="captcha" class="form-control unicase-form-control text-input" />
							%%GLOBAL_CaptchaImage%%
							<br><br>
						</dd>
					</div>

					<div class="buttons">
						<button class="btn btn-default buttonGray" type="submit">
							<span>%%LNG_SendForm%%</span>
						</button>
					</div>
				</div>
			</div>
		</div>
	</div>
</form>

%%Panel.ContactFormJavaScript%%
%%GLOBAL_ARSPanel%%
<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>