<script type="text/javascript" src="%%GLOBAL_ShopPath%%/modules/checkout/cartaodecreditomanual/js/mascara.js"></script>

<script type="text/javascript">
jQuery(function($){
$("#cc_cpf").mask("99999999999");
$("#cc_datanasc").mask("99/99/9999");
$("#cc_tel").mask("(99)9999-9999?9");
});
</script>
<script>
var verfuncpf = '%%GLOBAL_lerfunccpf%%';
if(verfuncpf == 1) {
function TestaCPF(strCPF) {var Soma, Resto, borda_original;Soma = 0;
if (strCPF == ""){document.getElementById("cc_cpf").setCustomValidity('Informe o CPF');return false;}
if (strCPF == "00000000000"){document.getElementById("cc_cpf").setCustomValidity('CPF incorreto');return false;}
if (strCPF == "11111111111"){document.getElementById("cc_cpf").setCustomValidity('CPF incorreto');return false;}
if (strCPF == "22222222222"){document.getElementById("cc_cpf").setCustomValidity('CPF incorreto');return false;}
if (strCPF == "33333333333"){document.getElementById("cc_cpf").setCustomValidity('CPF incorreto');return false;}
if (strCPF == "44444444444"){document.getElementById("cc_cpf").setCustomValidity('CPF incorreto');return false;}
if (strCPF == "55555555555"){document.getElementById("cc_cpf").setCustomValidity('CPF incorreto');return false;}
if (strCPF == "66666666666"){document.getElementById("cc_cpf").setCustomValidity('CPF incorreto');return false;}
if (strCPF == "77777777777"){document.getElementById("cc_cpf").setCustomValidity('CPF incorreto');return false;}
if (strCPF == "88888888888"){document.getElementById("cc_cpf").setCustomValidity('CPF incorreto');return false;}
if (strCPF == "99999999999"){document.getElementById("cc_cpf").setCustomValidity('CPF incorreto');return false;}
for (i=1; i<=9; i++){Soma = Soma + parseInt(strCPF.substring(i-1, i)) * (11 - i);}
Resto = (Soma * 10) % 11;if ((Resto == 10) || (Resto == 11)){Resto = 0;}
if (Resto != parseInt(strCPF.substring(9, 10))){document.getElementById("cc_cpf").setCustomValidity('CPF incorreto');return false;}
Soma = 0;for (i = 1; i <= 10; i++){Soma = Soma + parseInt(strCPF.substring(i-1, i)) * (12 - i);}
Resto = (Soma * 10) % 11;
if ((Resto == 10) || (Resto == 11)){Resto = 0;}
if (Resto != parseInt(strCPF.substring(10, 11))){document.getElementById("cc_cpf").setCustomValidity('CPF incorreto');return false;}
document.getElementById("cc_cpf").setCustomValidity('');return true;}
}
</script>

<div class="box-left-icon-bg">
	<div class="alert alert-info">%%LNG_CCManualPaymentIntro%%</div>
	<div class="alert alert-danger" style="display: %%GLOBAL_HideCCManualError%%">%%GLOBAL_CCErrorMessage%%</div>

	<form action="%%GLOBAL_ShopPathSSL%%/checkout.php?action=process_payment" method="post" onsubmit="return check_cc_payment_form()">
		<div class="form-group row">
			<label class="col-sm-2 col-form-label"><span class="Required">*</span> Cliente:</label>
			<div class="col-sm-5"><input type="text" class="form-control" name="cc_name" id="cc_name" value="%%GLOBAL_CCName%%" size="30" /></div>
		</div>

		<div class="form-group row">
			<label class="col-sm-2 col-form-label"><span class="Required">*</span> Cartão:</label>
			<div class="col-sm-5">
				<select name="cc_cctype" id="cc_cctype" class="form-control" onchange="updateCreditCardType()">
					<option value="">Selecione o Cartão</option>
					%%GLOBAL_CCTypes%%
				</select>
			</div>
		</div>

		<div class="form-group row">
			<label class="col-sm-2 col-form-label"><span class="Required">*</span> Número do Cartão:</label>
			<div class="col-sm-5">
				<input type="text" class="form-control" name="cc_ccno" id="cc_ccno" value="%%GLOBAL_CCNum%%" size="30"  style="margin: 0;" />
				<small>Apenas números, não use simbolos ou espaços.</small>
			</div>
		</div>

		<div class="form-group row CVV2Input">
			<label class="col-sm-2 col-form-label"><span class="Required">*</span> Código CCV2:</label>
			<div class="col-sm-3">
				<input type="text" class="form-control" name="cc_cvv2" id="cc_cvv2" value="%%GLOBAL_CCCVV2%%" size="4" style="margin: 0;" />
				<small>Últimos 3 dígitos atrás do cartão.</small>
			</div>
		</div>
				
		<div class="form-group row CCIssueNo">
			<label class="col-sm-2 col-form-label"><span class="Required">&nbsp;</span> Número Secreto:</label>
			<div class="col-sm-3">
				<input type="text" class="form-control" name="cc_issueno" id="cc_issueno" value="%%GLOBAL_CCIssueNo%%" size="4" />
			</div>
		</div>

		<div class="form-group row">
			<label class="col-sm-2 col-form-label"><span class="Required">*</span> Validade:</label>
			<div class="col-sm-1">
				<select name="cc_ccexpm" id="cc_ccexpm" class="form-control">
					<option value=""></option>
					%%GLOBAL_CCMonths%%
				</select>
			</div>

			<div class="col-sm-1">
				<select name="cc_ccexpy" id="cc_ccexpy" class="form-control">
					<option value=""></option>
					%%GLOBAL_CCYears%%
				</select>
			</div>
		</div>

		<div class="form-group row CCIssueDate">
			<label class="col-sm-2 col-form-label"><span class="Required">&nbsp;</span> Segredo Validade:</label>
			<div class="col-sm-2">
				<select name="cc_issuedatem" id="cc_issuedatem" class="form-control">
					<option value=""></option>
					%%GLOBAL_CCIssueDateMonths%%
				</select>
			</div>

			<div class="col-sm-2">
				<select name="cc_issuedatey" id="cc_issuedatey" class="form-control">
					<option value=""></option>
					%%GLOBAL_CCIssueDateYears%%
				</select>
			</div>
		</div>

		<div style="display: %%GLOBAL_hidecpf%%" class="form-group row" >
			<label class="col-sm-2 col-form-label"><span class="Required">*</span> CPF Títular Cartão:</label>
			<div class="col-sm-4">
				<input type="text" class="form-control" name="cc_cpf" id="cc_cpf" pattern="[0-9]+$" onblur="TestaCPF(this.value)" maxlength="14"  style="margin: 0;" />
			</div>
		</div>

		<div style="display: %%GLOBAL_hidenas%%" class="form-group row">
			<label class="col-sm-2 col-form-label"><span class="Required">*</span> Data de Nascimento:</label>
			<div class="col-sm-4">
				<input type="text" class="form-control" name="cc_datanasc" id="cc_datanasc" value=""  />
			</div>
		</div>
		
		<div style="display: %%GLOBAL_hidetel%%" class="form-group row">
			<label class="col-sm-2 col-form-label"><span class="Required">*</span> Telefone:</label>
			<div class="col-sm-4">
				<input type="text" class="form-control" name="cc_tel" id="cc_tel" value=""  />
			</div>
		</div>
		
		<div class="form-group row">
			<label class="col-sm-2 col-form-label"><span class="Required">*</span> Dividir em:</label>
			<div class="col-sm-10">
				%%GLOBAL_Dividir%%
			</div>
		</div>
		<input type="submit" value="Pagar Pedido" class="btn btn-success" />
	</form>
	%%Panel.CCManualPaymentJavaScript%%
</div>