function esDate(dateStr){

	var datePat = /^(\d{1,2})(\/|-)(\d{1,2})(\/|-)(\d{4})$/;
	var matchArray = dateStr.match(datePat); // la fecha es correcta

	if (matchArray == null) {
		alert("Debe ingresar una fecha correcta");
		return 0;
	}

	day = matchArray[1]; // separo la fecha en variables
	month = matchArray[3];
	year = matchArray[5];

	if (month < 1 || month > 12) { // valido el valor del mes
		alert("El mes debe ser entre 1 y 12");
		return 0;
	}

	if (day < 1 || day > 31) {
		alert("El día debe ser entre 1 y 31");
		return 0;
	}

	if ((month==4 || month==6 || month==9 || month==11) && day==31) {
		alert("El mes "+month+" no tiene 31 días!")
		return 0;
	}

	if (month == 2) { // valido el mes de febrero
		var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
		if (day > 29 || (day==29 && !isleap)) {
			alert("Febrero " + year + " no tiene " + day + " días!");
			return 0;
		}
	}
	
	return 1; // la fecha es valida

}
function ValidoHora(pHora){
	if(pHora > 24){
		alert("La hora ingresada es incorrecta. El valor debe ser de 00 a 24!");
		return 0;
	}
	return 1;
}
function ValidoMinutos(pMin){
	if(pMin > 59){
		alert("Los minutos ingresados son incorrectos. El valor debe ser de 00 a 59!");
		return 0;
	}
	return 1;
}
function AJAXCrearObjeto(){  
	var obj;  
	if(window.XMLHttpRequest) { // no es IE  
		obj = new XMLHttpRequest();  
	} 
	else { // Es IE o no tiene el objeto  
		try {  
			obj = new ActiveXObject("Microsoft.XMLHTTP");  
		}  
		catch (e) {  
			alert('El navegador utilizado no está soportado');  
		}  
	}  
	return obj;  
}  
