$(document).delegate('.signotp_btn_verify_acclog', 'click', function() {
	$.ajax({
		url: 'index.php?route=account/login/signotp_verify',
		type: 'post',
		dataType: 'json',
		cache: false,
		data: 'signotp_otp=' + encodeURIComponent($('input[name*="signotp_otp"]').val()),
		beforeSend: function() {
			$('.signotp_btn_verify_acclog').html('<i class="fa fa-spinner fa-pulse"></i>');
		},
		complete: function() {				
			$('.signotp_btn_verify_acclog').html($('.signotp_btn_verify_acclog').attr('btntext'));
		},				
		success: function(json) {
			$('.otpalert').remove();
			if (json['success'] == 1) {
				$('.popup-wrapper').remove();
				setTimeout(function(){ parent.location.reload(); }, 500);				
			} 
			if (json['error']) {
 				$('input[name*="signotp_otp"]').closest('.form-group').append('<label class="label label-danger otpalert">' + json['error'] + '</label>'); 
			}
		}
	});
});