////////////////////////////////////////////////////////////////////////////////
function isValidDate(day,month,year)
{
	month--;
	var dteDate;
	dteDate=new Date(year,month,day);
	return ((day==dteDate.getDate()) && (month==dteDate.getMonth()) && (year==dteDate.getFullYear()));
}
////////////////////////////////////////////////////////////////////////////////
function checkFloat(cadena)
{
	var poscoma=cadena.indexOf('.');
	if(poscoma < 0){
		if(isNaN(cadena)) return false
		else return true;
	}
	else{
		if(isNaN(cadena.substring(0,poscoma)) || isNaN(cadena.substring(poscoma+1,cadena.length))) return false;
		else return true;
	}
}
////////////////////////////////////////////////////////////////////////////////
function es_identificador(cadena)
{
	if(estaVacio(cadena)) return false;
	else{
		var validos="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-0123456789";
		for(i=0;i<cadena.length;i++){
			if( validos.indexOf(cadena.charAt(i)) < 0 ) return false;
		}
		return true;
	}
}
////////////////////////////////////////////////////////////////////////////////
function identificador_con_espacios(cadena)
{
	if(estaVacio(cadena)) return false;
	else{
		var validos="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ";
		for(i=0;i<cadena.length;i++){
			if( validos.indexOf(cadena.charAt(i)) < 0 ) return false;
		}
		return true;
	}
}
////////////////////////////////////////////////////////////////////////////////
function makeRequest(url,funcion_ready)
{
    var http_request = false;

    if (window.XMLHttpRequest) { // Mozilla, Safari, ...
        http_request = new XMLHttpRequest();
        if (http_request.overrideMimeType) {
            http_request.overrideMimeType('text/xml');
            // See note below about this line
        }
    } else if (window.ActiveXObject) { // IE
        try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
        }
    }

    if (!http_request) {
        alert('Giving up :( Cannot create an XMLHTTP instance');
        return false;
    }
    eval('http_request.onreadystatechange = function() { '+funcion_ready+'(http_request); };');
    http_request.open('GET', url, true);
    http_request.send(null);

}
////////////////////////////////////////////////////////////////////////////////
function ventana(url,ancho,alto){
	var resultado;
	resultado=window.open(url,'','width='+ancho+',height='+alto+',top=' + (screen.height-alto)/2 + ',left=' + (screen.width-ancho)/2 + ',scrollbars=0');
	if(!resultado) alert("Popup blocker");
}
////////////////////////////////////////////////////////////////////////////////
function ventana_scroll(url,ancho,alto){
	var resultado;
	resultado=window.open(url,'','width='+ancho+',height='+alto+',top=' + (screen.height-alto)/2 + ',left=' + (screen.width-ancho)/2 + ',scrollbars=1');
	if(!resultado) alert("Popup blocker");
}
////////////////////////////////////////////////////////////////////////////////
function isEmailAddr(Email)
{
	var result = false
	var theStr = new String(Email)
	var index = theStr.indexOf("@");
	if (index > 0){
		var pindex = theStr.indexOf(".",index);
		if ((pindex > index+1) && (theStr.length > pindex+1))
		result = true;
	}
	return result;
}
////////////////////////////////////////////////////////////////////////////////
function estaVacio(Str)
{
	if (Str.length == 0) return true;
	else for (i=0;i<Str.length;i++) if (Str.charAt(i) != " ") return false;
	return true;
}
////////////////////////////////////////////////////////////////////////////////
