$(function() {
    $(".boxEvidenceCnt").hover(
        function() {
            $(this).stop().animate({boxShadow: '0px 0px 8px #5fadde'}, 100);
        },
        function() {
            $(this).stop().animate({boxShadow: '0px 0px 0px #5fadde'});
        }
    );
    $("#esercentiTipo1 a").hover(
        function() {
            $(this).parent().stop().animate({boxShadow: '0px 0px 8px #5fadde'}, 100);
        },
        function() {
            $(this).parent().stop().animate({boxShadow: '0px 0px 0px #5fadde'});
        }
    );
    
    $("#menuTipologie ul.dropdown li a").hover(
        function() {
            $(this).stop().animate({backgroundPosition:'(0 -255px)'}, 200);
        },
        function() {
            $(this).stop().animate({backgroundPosition:'(0 0)'});
        }
    );
    
    $(".boxEs a").hover(
        function() {
            $(this).stop().animate({boxShadow: '0px 0px 8px #5fadde'}, 100);
        },
        function() {
            $(this).stop().animate({boxShadow: '0px 0px 0px #5fadde'});
        }
    );
    
    $(".vaiAlNegozio").hover(
        function() {
            $(this).stop().animate({"opacity": "0.8"}, "fast");
        },
        function() {
            $(this).stop().animate({"opacity": "1"}, "fast");
        }
    );
    
    $("a.promo-link").hover(function() {
        $(this).find("span.promo-obj-overflow").stop().animate({"opacity": "1"}, "fast");
    }, function() {
        if($(this).attr("rel") != "act")
        {
            $(this).find("span.promo-obj-overflow").stop().animate({"opacity": "0.4"}, "fast");
        }
    });
    $("a.promo-link").click(function() {
        var id = $(this).attr("id");
        id = id.substr(9);
        var objImg = $("#obj-img-" + id);
        
        $(".promo-obj-img").attr("class","promo-obj-img promo-obj-img-noview");
        objImg.attr("class","promo-obj-img promo-obj-img-view");
        
        $("a.promo-link").attr("rel","");
        $("a.promo-link span.promo-obj-overflow").css("opacity","0.4");
        $(this).attr("rel","act");
        $(this).find("span.promo-obj-overflow").css("opacity","1");
    });
    $("a.promo-link").each(function() {
        if($(this).attr("rel") != "act")
            $(this).find("span.promo-obj-overflow").css("opacity","0.4");
    });
});
