<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$language.lblLoginSignUp}</title>
<link rel="stylesheet" href="{$view_styles}/login.css">
{*<script type="text/javascript">
var cart = new Array();
cart["items"]=new Array();
cart["purchasedDetails"]=new Array();
var showCartNotification = "{$showCartNotification|default:''}";
var targetPath			= "";
var targetPathType	= "";
</script>*}
{assign var="enablePopupModal" value="No"}
{include file='CommonJavaScript.tpl'}
<script type="text/javascript">
$(document).ready(function() {
        var redirectUrl= '{$urlRedirect}';
        var closePopup= '{$closePopup}';
        if(closePopup=='Yes') {
            window.top.location.href = GLOBAL_BASE_PATH +'/'+redirectUrl+'';
        }	
	$(document).on("click",".logClose",function(){
		delete NO_VALIDATION_SCROLL;
		window.parent.postMessage("Close Popup", document.referrer);  
                window.top.location.href = GLOBAL_BASE_PATH +'/'+redirectUrl+'';
	}); 	
	$(document).on("click",".fr-pw",function(){
		$("#resend-block").show();
		$("#verify-div").hide();	
	});
	$(document).on("click",".bk-login",function(){
		$("#resend-block").hide();
		$("#verify-div").show();	
	});
        $("#userPhone").on("keypress keyup blur",function(){ //20-02-15		
		if($(this).val().charAt(0) === '0')
		{
			$(this).val($(this).val().slice(1));
		}	
	});
});
</script>

<div id="fb-root" class="fb-root01"></div>
</head>
<body>
<div class="verifypop">
<div class="col-xs-12  col-sm-12 col-xsm-12 top-head">
    <a class="logClose" href="Javascript:void(0);"  onclick="parent.window.hideModalPopup();">×</a>
        <h3>{$language.lblVerifyMobile}</h3>
        
</div>
<div class="tab-content">
<div class="container-fluid ">     
      <div class="row">
        <div class="col-xs-12  col-sm-12 col-xsm-12">
        <span class="text msge">{$language.lblverificationhlptxt}</span> 
          <div class="logarea" {if $showTab neq 'verify'} style="display:none" {/if} id="verify-div">
              
              <div id="common_message" ></div> 
                <small class="text msge hide">{$language.lblVerifyCodetext}</small>
             
              {assign var="userID" value=$userID|default:''}				 
            {form->start name="formVerifyMobile" action="" method="post" autocomplete="off" enctype="multipart/form-data"}           
           <div class="row">
              <div class="form-group col-xs-6"> {form->textbox name="verify_codes" validate_event="submit"  class="form-control" placeholder="{$language.lblVerifyCode}" autocomplete="off" validate="required" error=$language.errVerifyCode} </div>
            <div class="col-xs-6">
              <div class="sbmtAllgn form-group"> 
              {form->submit name="submitVerify" id="submit-verify" validate_submit="yes" value=$language.lblVerify class="btn btn-primary"} 
              <span class="inline-sec fnt-nrw-bld">
              <span class="fade-txt ">Not yet received ?</span>{html->anchor href="" class="fr-pw bpfc" id="verify-code" caption="{$language.lblResend} >>"} </span></div>
              </div>
              </div>
            {form->close} </div> 
            <div class="row" {if $showTab neq 'send'} style="display:none" {/if} id="resend-block">
            
            <div id="reset-verify-div">
               <div class="col-xs-12"> 
                {form->start name="formResendCode" action="" method="post" enctype="multipart/form-data"}
                </div>
                <div class="clearfix">
                  <div class="form-group col-xs-6">
                  {form->select id="countryCode" name="countryCode"  caption="->{$language.lblCountryCodes}"   options=$resListCountryCode
                        class="form-control" validate="required" error=$language.errCountryCodes} 
                     </div>   
                     <div class="form-group col-xs-6">   
                        {form->textbox class="form-control"
                         maxlength="20"
                         name="userPhone" 
                         onpaste="return false;" 
			 onkeypress="return validatePhoneNumber(event);"
                         validate="required~*callback_isphonenumber" 
                         error=$language.errMobileNumber|cat:"~*"|cat:$language.errMobileNumber 
                         autocomplete="off" 
                         placeholder="{$language.lblMobileNumber}"}    
                        </div>
                   <div class="form-group col-xs-12 txt-r">      
                  {form->submit name="reSendCode" id="submit" class="btn btn-primary" form="formResendCode" value=$language.lblSendCode} 
                {form->close}
                
                {html->anchor href="" class="bk-login bk-login linkStyle1 " caption="<small>{$language.lblBacktoVerify}</small>" id="back-verify-link"} 
                </div>
            
            </div>
          </div>
        </div>        
      </div>
    </div>

</div>
</div>
</div>
</div>
<script type="text/javascript">
function validatePhoneNumber(e)  //20-02-15	
{
	try {
		if (window.event) {
			var charCode = window.event.keyCode;
		}
		else if (e) {
			var charCode = e.which;
		}
		else{
			return true;
		}
		if (charCode > 31 && (charCode < 48 || charCode > 57)) {
			return false;
		}
		return true;
	}
	catch (err) {
		return false;
	}
}	
$(document).ready(function() {
if (window.parent.$("#userPhoneCountryID").length) { 
	$("#countryCode").val(window.parent.$("#userPhoneCountryID").val());}
if (window.parent.$("#userPhone").length)
	$("#userPhone").val(window.parent.$("#userPhone").val());
});
</script>
{html->messages_script id="common_message"}
{form->validate_script form="formVerifyMobile"}
{form->validate_script form="formResendCode"}
</body>
</html>
