/*
 *Conjunto de funciones que quizas hacen algo por HomeRevRed
 **/
//TODO ponerle nombres estandares a estas funciones
var ns4 = (document.layers);
var ie4 = (document.all && !document.getElementById);
var ie5 = (document.all && document.getElementById);
var ns6 = (!document.all && document.getElementById);


function openwin(parametro, Id) {
    window.open("Resumen.jsp?iCve="+ parametro +"&Id="+ Id +"","visitas","width=615,height=400,top=50,left=50,scrollbars=yes");
}

function ratonin(src,fondoin) {
    if (!src.contains(event.fromElement)) {
        src.style.cursor = 'hand';
        src.bgColor = fondoin;
    }
}

function ratonout(src,fondout) {
    if (!src.contains(event.toElement)) {
        src.style.cursor = 'default';
        src.bgColor = fondout;
    }
}

function MM_preloadImages() {
    var d=document; if(d.images){
        if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
            if (a[i].indexOf("#")!=0){
                d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];
            }
    }
}

function open_window(clave, id){
    var url="../../principal/auxHomRevRed.jsp?cverev="+clave+"&id="+id;
    var urlstring = url;
    newWindow = window.open(urlstring,'','height=300,width=450,toolbar=no,minimize=no,status=yes,menubar=no,location=no,scrollbars=yes');
}

function todasocultas(){
    document.getElementById('r1').style.visibility="hidden";
    document.getElementById('r2').style.visibility="hidden";
    document.getElementById('r3').style.visibility="hidden";

    document.getElementById('r1').style.display="none";
    document.getElementById('r2').style.display="none";
    document.getElementById('r3').style.display="none";
}

function capas(id){
    todasocultas();
    // Netscape 4
    if(ns4){
        document.layers[id].visibility = "show";
        document.getElementById(id).style.display="block";
    }
    // Explorer 4
    else if(ie4){
        document.all[id].style.visibility = "visible";
        document.getElementById(id).style.display="block";
    }
    // W3C - Explorer 5+ and Netscape 6+
    else if(ie5 || ns6){
        document.getElementById(id).style.visibility="visible";
        document.getElementById(id).style.display="block";
    }
}

function toggleLayer(id)
{
    var elem, vis;
    if( document.getElementById ) // this is the way the standards work
        elem = document.getElementById(id);
    else if( document.all ) // this is the way old msie versions work
        elem = document.all[id];
    else if( document.layers ) // this is the way nn4 works
        elem = document.layers[id];
    vis = elem.style;
    // if the style.display value is blank we try to figure it out here
    if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
        vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
    vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}


