function ipopen(nro) {

	if (nro > 7) {
		width = 800;
	} else {
		width = 700;
	}
	nwindow = "Arrip" + nro;
	nurl = "http://www.riorevuelto.org/news/show_ipmail.php?nro=" + nro;
	nprops = "width=" + width + ",height=500,scrollbars,screenX=45,screenY=45";
	window.open (nurl, nwindow, nprops).focus();
	return true;
}

function imgOn (imgName, message) {
	if (document.images) {
		document[imgName].src = eval(imgName+"on.src"); 
		window.status = "Listo"; return true 
	} 
}	

function imgCl (imgName, message) {
	if (document.images) {
		document[imgName].src = eval(imgName+"cl.src"); 
		window.status = "Listo"; return true
	} 
}	

function imgOff (imgName, message) {
	if (document.images) {
		document[imgName].src = eval(imgName+"off.src");
		window.status = "Listo"; return true 
	} 
}

function isDate(dateStr) {

    var datePat = /^(\d{1,2})(\/|-)(\d{1,2})(\/|-)(\d{4})$/;
    var matchArray = dateStr.match(datePat);

    if (matchArray == null) {
        alert("La fecha está incompleta.");
        return false;
    }

    day   = matchArray[1];
    month = matchArray[3];
    year  = matchArray[5];

    if (month < 1 || month > 12) {
        alert("El mes debe estar entre 1 y 12.");
        return false;
    }

    if (day < 1 || day > 31) {
        alert("El día debe estar entre 1 y 31.");
        return false;
    }

    if ((month==4 || month==6 || month==9 || month==11) && day==31) {
        alert("El mes "+month+" no tiene 31 días.")
        return false;
    }

    if (month == 2) {
        var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
        if (day > 29 || (day==29 && !isleap)) {
            alert("Febrero de " + year + " no tiene " + day + " días.");
            return false;
        }
    }
    
    if (year < 1900 || year > 2030 ){
        alert( "El año ingresado es incorrecto" );
        return false;
    }

    return true;

}

/*
var static_icono_plus  = 0;
var static_icono_minus = 0;
*/
function open_close(object_nm, icon_nm){

    var actual;
    var visible;
	var icon;

    var object = document.getElementById(object_nm);
/*
    var icon  = document.getElementById(icon_nm);

    if (!static_icono_plus){
        static_icono_plus  = new Image(16, 16);
        static_icono_minus = new Image(16, 16);
        static_icono_plus.src  = "images/plus.gif";
        static_icono_minus.src = "images/minus.gif";
    }
*/
    actual = object.style.display;
    visible = object.style.visibility;
    
    if (visible == 'hidden'){
        object.style.visibility = "visible";
        if (icon) icon.src = static_icono_minus.src;
    } else if (visible == 'visible') {
        object.style.visibility = "hidden";
        if (icon) icon.src = static_icono_plus.src;
    } else if (actual == "none") {
        object.style.display = "";
        if (icon) icon.src = static_icono_minus.src;
    } else {
        object.style.display = "none";
        if (icon) icon.src = static_icono_plus.src;
    }
    
}

