<style>
#inscripcion{
	padding:25px 10px;
	background:#fafbfc;
	border:1px solid #f0f2f5;
	border-radius:10px;
	overflow:hidden;}

#inscripcion .campo{
	text-align:right;
	padding:5px 10px;}

#inscripcion .col-md-2, .col-md-4, .col-md-9, .col-md-6{
	margin:3px 0;}
	
#inscripcion .submit{
	float:right;}

#inscripcion .requerido{
	color:#e52121;}

#error_validate{
	padding:15px;
	margin:5px 0;}
	
	
</style>

<div id="inscripcion" class="col-md-12">
            <form id="formdatos" class="col-md-12">
                         <div class="col-md-3">Email:  </div>
                         <div class="col-md-9"><input class="form-control" name="email" value="{$MAIL_UNSUSCRIBE}" /></div>
                         <div class="col-md-3">Captcha </div>
                         <div class="col-md-9"> 
                         						<input type="text" name="norobot" class="form-control captcha" maxlength="4" tabindex="10" /> 
                                				<img class="captcha" src="http://<?=DOMINIO?>/plugins/captcha.php" />
                         </div>
                         
                         <div class="col-md-12"><h6>Escríbe los caractéres como aparecen en la imagen.</h6></div>

              <input type="hidden" name="unsuscribe" class="hidden" id="hidden" value="confirm" />
              <input type="submit" name="submit" class="submit btn btn-lg btn-block btn-warning" id="submit" value="Cancelar Suscripción!" />
            
            </form>
            <div id="error_validate" class="col-md-12 alert alert-warning" style="display:none">Ingresa tus Datos.</div>
</div>
{literal}

<script>
$('input.captcha').change(function(){
			var atrib = $(this).attr("value");
			
					$.post("{/literal}{$SITE_URL}{literal}/plugins/captcha.php", "&verify="+ atrib, function(data) {
						if(data != 'VALIDATED'){
								$('input.captcha').val('');
							}
					});
			});
$.validator.setDefaults({
	submitHandler: function() {
		
		$('#loading').show();
		$('#formcontacto').hide();
		
			var formdata = $('#formdatos').serialize();
			$.ajax({
			  type: "POST",
			  url: "{/literal}{$SITE_URL}/{$SEO}&display=ajax{literal}",
			  data: formdata,
			  success: function(res){
				$('.contenido_ajax').html(res);
				$('#loading').hide();
				}
			
			 })
					  
	  return false;	
	 }
});

$("#formdatos").validate({
	
	rules: {
		email: {
			required: true,
			email: true
		},
		norobot: {
			required: true,
		},
	},
	
	
	messages: {
		email: {
			required: "",
			email: ""
		},
		norobot: {
			required: "",
		},
	},
	
		errorLabelContainer: $("#error_validate")

});


</script>
{/literal}
