function OpenBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
    if(window.screen)if(isCenter)if(isCenter=="true"){
        var myLeft = (screen.width-myWidth)/2;
        var myTop = (screen.height-myHeight)/2;
        features+=(features!='')?',':'';
        features+=',left='+myLeft+',top='+myTop;
    }
    window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}

function centraVentana(theURL,winName,features, myWidth, myHeight) { //v3.0
    var w = screen.availWidth
    var h = screen.availHeight
    var myLeft = (w-myWidth)/2;
    var myTop = (h-myHeight)/2;
    features2=',left='+myLeft+'px'+',top='+myTop+'px'+','+'width='+myWidth+',height='+myHeight;

    window.open(theURL,winName,features+features2);
}



function obtener_ancho()
{
    if (navigator.userAgent.indexOf("MSIE") > 0)
    {
        return(document.body.clientWidth);
    }
    else
    {
        return window.outerWidth;
    }
}

function obtener_alto()
{
    if (navigator.userAgent.indexOf("MSIE") > 0)
    {
        return(document.body.clientHeight);
    }
    else
    {
        return(window.outerHeight);
    }
}

var popup = new Object()
function CenterPopup(URL, width, height)
{
    var X = obtener_ancho() / 2
    var Y = obtener_alto() / 2
    popup = window.open(URL, '',
        'scrollbars=yes ' +
        'width=' + width + ' ' +
        'height=' + height + ' ' +
        'top=' + (window.screenTop + (Y - (height/2))) + ' ' +
        'left=' + (window.screenLeft + (X - (width/2)))
        )
    popup.focus()
}

function cambiaPestana(target)
{

    document.getElementById('celdaInicio').className='boton-1';
    document.getElementById('celdaInicioDerecha').className='boton-1Der';
    document.getElementById('celdaInicioIzquierda').className='boton-1Izq';
    document.getElementById('enlaceInicio').className='menuPrincipalBlanco';

    if (document.getElementById('celdaAlta')){
        document.getElementById('celdaAlta').className='boton-1';
        document.getElementById('celdaAltaDerecha').className='boton-1Der';
        document.getElementById('celdaAltaIzquierda').className='boton-1Izq';
        document.getElementById('enlaceAlta').className='menuPrincipalBlanco';
    }
    if (document.getElementById('celdaNosotros')){
        document.getElementById('celdaNosotros').className='boton-1';
        document.getElementById('celdaNosotrosDerecha').className='boton-1Der';
        document.getElementById('celdaNosotrosIzquierda').className='boton-1Izq';
        document.getElementById('enlaceNosotros').className='menuPrincipalBlanco';
    }
    if (document.getElementById('celdaSesion')){
        document.getElementById('celdaSesion').className='boton-1';
        document.getElementById('celdaSesionDerecha').className='boton-1Der';
        document.getElementById('celdaSesionIzquierda').className='boton-1Izq';
        document.getElementById('enlaceSesion').className='menuPrincipalBlanco';
    }
    if (document.getElementById('celdaContacto')){
        document.getElementById('celdaContacto').className='boton-1';
        document.getElementById('celdaContactoDerecha').className='boton-1Der';
        document.getElementById('celdaContactoIzquierda').className='boton-1Izq';
        document.getElementById('enlaceContacto').className='menuPrincipalBlanco';
    }

    switch(target){
        case "inicio" :
            document.getElementById('celdaInicio').className='botonNegro-1';
            document.getElementById('celdaInicioDerecha').className='botonNegro-1Der';
            document.getElementById('celdaInicioIzquierda').className='botonNegro-1Izq';
            break;
        case "alta" :
            document.getElementById('celdaAlta').className='botonNegro-1';
            document.getElementById('celdaAltaDerecha').className='botonNegro-1Der';
            document.getElementById('celdaAltaIzquierda').className='botonNegro-1Izq';
            break;
        case "nosotros" :
            document.getElementById('celdaNosotros').className='botonNegro-1';
            document.getElementById('celdaNosotrosDerecha').className='botonNegro-1Der';
            document.getElementById('celdaNosotrosIzquierda').className='botonNegro-1Izq';
            break;
        case "sesion" :
            document.getElementById('celdaSesion').className='botonNegro-1';
            document.getElementById('celdaSesionDerecha').className='botonNegro-1Der';
            document.getElementById('celdaSesionIzquierda').className='botonNegro-1Izq';
            break;
        case "contacto" :
            document.getElementById('celdaContacto').className='boton-1';
            document.getElementById('celdaContactoDerecha').className='botonNegro-1Der';
            document.getElementById('celdaContactoIzquierda').className='botonNegro-1Izq';
            break;
        default:
            document.getElementById('celdaInicio').className='botonNegro-1';
            document.getElementById('celdaInicioDerecha').className='botonNegro-1Der';
            document.getElementById('celdaInicioIzquierda').className='botonNegro-1Izq';
            break;
    }

}

