/******************/
/* FUNCIONES AJAX */
/******************/

function nuevoAjax(){
	var xmlhttp=false;
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch (e) {
		try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
		}
	}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}

function cargarContenido(url_redir, nombre_div){
	var contenedor;
	var ajax;
	contenedor = document.getElementById(nombre_div);
	ajax=nuevoAjax();
	ajax.open("GET", url_redir, true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==1) {
        	contenedor.innerHTML="<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td><center><img src='./images/preload.gif'> Cargando... </center></td></tr></table>";
        }else if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText
		}
	}
	ajax.send(null)
}

/**********************/
/* FIN FUNCIONES AJAX */
/**********************/

var nav4 = window.Event ? true : false;
function acceptNum(evt){
// NOTE: Backspace = 8, Enter = 13, '0' = 48, '9' = 57
	var key = nav4 ? evt.which : evt.keyCode;
	return (key <= 13 || (key >= 48 && key <= 57));
}
