//
// menu-pie.js
//

function ocultarActivos(){
    $("#menuContactoActiveLayer").hide();
    $("#menuContactoLinkLayer").show();

    $("#menuUneteActiveLayer").hide();
    $("#menuUneteLinkLayer").show();

    $("#menuServiciosActiveLayer").hide();
    $("#menuServiciosLinkLayer").show();

    $("#menuEmpresaActiveLayer").hide();
    $("#menuEmpresaLinkLayer").show();

    $("#menuInicioActiveLayer").hide();
    $("#menuInicioLinkLayer").show();
}

function activarContacto(){
    ocultarActivos();
    $("#menuContactoLinkLayer").hide();
    $("#menuContactoActiveLayer").show();
}

function activarUnete(){
    ocultarActivos();
    $("#menuUneteLinkLayer").hide();
    $("#menuUneteActiveLayer").show();
}

function activarServicios(){
    ocultarActivos();
    $("#menuServiciosLinkLayer").hide();
    $("#menuServiciosActiveLayer").show();
}

function activarEmpresa(){
    ocultarActivos();
    $("#menuEmpresaLinkLayer").hide();
    $("#menuEmpresaActiveLayer").show();
}

function activarInicio(){
    ocultarActivos();
    $("#menuInicioLinkLayer").hide();
    $("#menuInicioActiveLayer").show();
}

$(document).ready(function(){

    // This is required for the PNG fix to work.
    if (window.DD_belatedPNG)
        DD_belatedPNG.fix('.pngimg');

    // This is some javascript to stop IE from displaying the img alt attributes
    // when you mouse over imagess.  If you would like IE to display the alt attributes,
    // just comment out the following 4 lines.  Don't worry, if you leave this in
    // place, your ALT attributes are still readable by the search engines.
    var tmpalt;
    $("img").hover(
        function(){
            tmpalt = $(this).attr( "alt" );
            $(this).attr( "alt", "" );
        },
        function(){
            $(this).attr( "alt", tmpalt );
        });

    // This is code to handle all of the _linkover events.  It works by
    // creating a special Wrap class, adding it to the link and linkover
    // divs of each link and linkover pair, and assigning a hover event to
    // that.

    //Menu
    $("#menuInicioOverLayer").addClass("Wrap-menuInicio").hide();
    $("#menuInicioLinkLayer").addClass("Wrap-menuInicio");
    //$("#menuInicioText").addClass("Wrap-menuInicio");
    $(".Wrap-menuInicio").hover(
        function(){
            $("#menuInicioOverLayer").show();
            $("#menuInicioLinkLayer").hide();
        },
        function(){
            $("#menuInicioLinkLayer").show();
            $("#menuInicioOverLayer").hide();
        });

    $("#menuEmpresaOverLayer").addClass("Wrap-menuEmpresa").hide();
    $("#menuEmpresaLinkLayer").addClass("Wrap-menuEmpresa");
    //$("#menuEmpresaText").addClass("Wrap-menuEmpresa");
    $(".Wrap-menuEmpresa").hover(
        function(){
            $("#menuEmpresaOverLayer").show();
            $("#menuEmpresaLinkLayer").hide();
        },
        function(){
            $("#menuEmpresaLinkLayer").show();
            $("#menuEmpresaOverLayer").hide();
        });

    $("#menuServiciosOverLayer").addClass("Wrap-menuServicios").hide();
    $("#menuServiciosLinkLayer").addClass("Wrap-menuServicios");
    //$("#menuServiciosText").addClass("Wrap-menuServicios");
    $(".Wrap-menuServicios").hover(
        function(){
            $("#menuServiciosOverLayer").show();
            $("#menuServiciosLinkLayer").hide();
        },
        function(){
            $("#menuServiciosLinkLayer").show();
            $("#menuServiciosOverLayer").hide();
        });

    $("#menuUneteOverLayer").addClass("Wrap-menuUnete").hide();
    $("#menuUneteLinkLayer").addClass("Wrap-menuUnete");
    //$("#menuUneteText").addClass("Wrap-menuUnete");
    $(".Wrap-menuUnete").hover(
        function(){
            $("#menuUneteOverLayer").show();
            $("#menuUneteLinkLayer").hide();
        },
        function(){
            $("#menuUneteLinkLayer").show();
            $("#menuUneteOverLayer").hide();
        });

    $("#menuContactoOverLayer").addClass("Wrap-menuContacto").hide();
    $("#menuContactoLinkLayer").addClass("Wrap-menuContacto");
    //$("#menuContactoText").addClass("Wrap-menuContacto");
    $(".Wrap-menuContacto").hover(
        function(){
            $("#menuContactoOverLayer").show();
            $("#menuContactoLinkLayer").hide();
        },
        function(){
            $("#menuContactoLinkLayer").show();
            $("#menuContactoOverLayer").hide();
        });    
});
