$(document).ready(function () {
	/*open modal whitch custombox*/
	$("body").on("click",".modal-trigger",function(e){
		var trigger = $(e.target);
		Custombox.open({
			target:trigger.attr('data-target'), 
			effect: 'fadein',
			complete:function(){
				$(".modal-body input:text").first().focus();
			}
		});
		e.preventDefault();
	});
	
	/* $('body').on('keyup','input:text', function(evt) {
	  $(this).val(function (_, val) {
		return val.toUpperCase();
	  });
	}); */
	
	$("#notification-btn").click(function(e){
		var uri=$(this).attr('href');
		Custombox.open({
			target:uri, 
			effect: 'fadein',
			complete:function(){
				$(".modal-body input:text").first().focus();
			}
		});
		e.preventDefault();
		e.stopPropagation();
	});
	$("#home-notificaciones-btn").click(function(){
		$("#notification-btn").trigger('click');
	});
	
	
});

function isNumberDecimalKey(e){
	var charCode = window.event ? window.event.keyCode : e.which;
	if ((charCode >= 48 && charCode <= 57) || (charCode >= 96 && charCode <= 105) || (charCode == 13 || charCode == 8 || charCode == 9 || charCode == 173 || charCode == 190 || charCode == 110 || charCode == 38 || charCode == 40)){
		return true;
	}else{
		return false;
	}
}
function error_noacces(){
	sweetAlert("Acceso Denegado", "Su cuenta posee permisos limitados y no le esta permitido ingresar a esta función, contacte un administrador del sistema para verificar los permisos de su cuenta.'", "error");
}
function openPopUp(href, width, height){
	var x; 
	var y; 
	x=(screen.width/2)-(width/2); 
	y=(screen.height/2)-(height/2) - 30; 
	window.open(href, "", "width="+width+",height="+height+",menubar=0,toolbar=0,directories=0,scrollbars=yes,resizable=no,left="+x+",top="+y+""); 
}