function pagina(pag)
	{
		window.location.href = pag
	}


function menu_esconder(modulo,opcion){
	var i=0;
	var i1=0;
	var lenMod=0;
	
	lenMod = modulo.length;
	
	for (i=0; i< document.all.length ; i++){
		if (document.all.item(i).id.substring(0,4) == 'mnu_' && document.all.item(i).id.substring(document.all.item(i).id.length,document.all.item(i).id.length-2) !='_0'){
			document.all.item(i).style.display = 'none';
			//alert(document.all.item(i).id);
		}
		if (document.all.item(i).id.substring(0,4+lenMod+1) == 'mnu_'+modulo+'_'){
			//alert(document.all.item(i).id);
			//alert(lenMod);
			//alert(modulo);
			document.all.item(i).style.display = '';
		}
	}
}

function Click_Accion(objButton) {
	objButton.disabled = true;
	var btn = document.getElementById(objButton);
	btn.click();
}

function validar_CheckSeleccion(nombreChecked){
var tmp='';
var tmpres='';
	for (i=0; i< document.all.length ; i++){
		if (document.all.item(i).type=='checkbox'){
			tmp = document.all.item(i).id;
			if (tmp.search(nombreChecked)>0){
				tmp =document.getElementById(document.all.item(i).id);
				if (tmp.checked == true){
					return true	
					
				}
			}
		}
	}		
	alert('Se debe seleccionar un registro.');
	return false
}

function Desactivar_Pregunta(objButton,nombreChecked){
	if (!validar_CheckSeleccion(nombreChecked)){return false;}
	
	if (confirm('¿Está seguro de eliminar los registros seleccionados?')) {
			Click_Accion(objButton)
			return true;
	}
	else{
		return false;	
	}
}

function popUpAgenda(fecha)
	{
	strURL="";
	strURL ="../mantenimiento/popup_calendario.aspx";
	strURL = strURL + "?v_obj_fecha=" + fecha.name;		
	window.open(strURL, "PopUp", "top=100,left=200,height=150,width=190,menu=no,status=no,toolbar=no,address=no,scrollbars=no");
	}
	
	
function validarnumero(strCad)
{
	var strCadena = new String(strCad);
	strCadena = strCadena.toUpperCase();
	valido = "0123456789";
	
	for (i = 0 ; i <= strCadena.length - 1; i++)
	{	
		if (valido.indexOf(strCadena.substring(i,i+1),0) == -1)
		{
			valido = strCadena.substring(i,i + 1);
			return(false);
		} 
	}	
	return(true);
}

function validarnumerico(){
	var sKey
	sKey = String.fromCharCode(window.event.keyCode);
	if(!(sKey >= "0" && sKey <= "9")) {window.event.keyCode = 0;}
}