$(document).ready(function(){
    $(".oppt").css("opacity","0");

//$("#nav-one li .oppt").animate({opacity : 1});
    var loc = location.href;

    $("#nav-one li").hover(function(){var loc = location.href;
        $(this).find(".oppt").stop().animate({opacity : 1});
        $(this).find("ul").show();
        //$(this).find("ul").css("display","block").stop().animate({opacity : 1});
    },function() {
        if(
            ($(this).parent().attr("class")!="rent" && (loc.indexOf( "systemso-alquiler" ) != -1)) ||
            ($(this).parent().attr("class")!="sale" && (loc.indexOf( "systemso-ventas" ) != -1)) ||
            ($(this).parent().attr("class")!="services" && (loc.indexOf( "systemso-servicios" ) != -1)) ||
            ($(this).parent().attr("class")!="empresa" && (loc.indexOf( "systemso-quienes-somos" ) != -1)) ||
            ($(this).parent().attr("class")!="empresa" && (loc.indexOf( "systemso-donde-estamos" ) != -1)) ||
            ($(this).parent().attr("class")!="account" && (loc.indexOf( "systemso-registro" ) != -1))||
            ($(this).parent().attr("class")!="account" && (loc.indexOf( "recuperar-contrasena" ) != -1)) ||
            ($(this).parent().attr("class")!="account" && (loc.indexOf( "systemso-pedidos" ) != -1)) ||
            ($(this).parent().attr("class")!="media" && (loc.indexOf( "systemso-galeria" ) != -1)) ||
            ($(this).parent().attr("class")!="account" && (loc.indexOf( "systemso-editar-cuenta" ) != -1))
            || (loc.indexOf( "index.jsp" ) != -1)  || loc=="http://www.systemso.com" || loc=="http://www.systemso.com/" || loc=="http://systemso.com/" || loc=="http://systemso.com" || (loc.indexOf( "systemso-privacidad" ) != -1) || (loc.indexOf( "systemso-contacto" ) != -1)
        )
                $(this).find(".oppt").stop().animate({opacity : 0},"slow");
        $(this).find("ul").hide();
       // $(this).find("ul").stop().animate({opacity : 0},"slow", function(){$(this).css("display","none");});
    });

    

    if(loc.indexOf( "systemso-quienes-somos" ) > -1 ) $("#_navigation .empresa .fader").stop().animate({opacity : 1});
    if(loc.indexOf( "systemso-donde-estamos" ) > -1 ) $("#_navigation .empresa .fader").stop().animate({opacity : 1});
    if(loc.indexOf( "systemso-servicios" ) > -1 ) $("#_navigation .services .fader").stop().animate({opacity : 1});
    if(loc.indexOf( "systemso-registro" ) > -1 ) $("#_navigation .account .fader").stop().animate({opacity : 1});
    if(loc.indexOf( "recuperar-contrasena" ) > -1 ) $("#_navigation .account .fader").stop().animate({opacity : 1});
    if(loc.indexOf( "systemso-editar-cuenta" ) > -1 ) $("#_navigation .account .fader").stop().animate({opacity : 1});
    if(loc.indexOf( "systemso-alquiler" ) > -1 ) $("#_navigation .rent .fader").stop().animate({opacity : 1});
    if(loc.indexOf( "systemso-galeria" ) > -1 ) $("#_navigation .media .fader").stop().animate({opacity : 1});
    if(loc.indexOf( "systemso-ventas" ) > -1 ) $("#_navigation .sale .fader").stop().animate({opacity : 1});

    ////    ///////////////////////////////////////////////
    ////    ////////// BIND LOGOUT ////////////////////////
    ////    ///////////////////////////////////////////////
    $("#_logout").bind("click",function(){
        _logout_exit();
    });
});
