(function ($) {
    $(window).load(function () {



        $("a[rel^='agrandar']").prettyPhoto();



        $("div.subCategory a").hover(

        function () {

            $(this).stop(true, true).animate({
                opacity: '0'
            }, 100).queue(function () {

                $(this).animate({
                    opacity: '1'
                }, 500).css({
                    backgroundPosition: 'center top',
                    height: 270,
                    width: 310,
                    left: -50,
                    top: -50,
                    zIndex: 500
                });

                $(this).dequeue();

            });



        },

        function () {

            $(this).stop(true, true).animate({
                opacity: '0'
            }, 100).queue(function () {

                $(this).animate({
                    opacity: '1'
                }, 250).css({
                    backgroundPosition: 'center bottom',
                    height: 200,
                    width: 209,
                    position: 'absolute',
                    left: 0,
                    top: 0,
                    zIndex: 500
                });

                $(this).dequeue();

            });

        });



        $("div.catItemHeader a").hover(

        function () {

            $(this).stop(true, true).animate({
                opacity: '0'
            }, 100).queue(function () {

                $(this).animate({
                    opacity: '1'
                }, 500).css({
                    backgroundPosition: 'center 20px',
                    height: 281,
                    width: 271,
                    left: -58,
                    top: -95,
                    zIndex: 500
                });

                $(this).dequeue();

            });



        },

        function () {

            $(this).stop(true, true).animate({
                opacity: '0'
            }, 100).queue(function () {

                $(this).animate({
                    opacity: '1'
                }, 250).css({
                    backgroundPosition: 'center bottom',
                    height: 187,
                    width: 155,
                    position: 'absolute',
                    left: 0,
                    top: 0,
                    zIndex: 500
                });

                $(this).dequeue();

            });

        });



        //----------------------- FOOTER ANIMATIONS----------------------------


        $(".btnFacebook").click(function (e) {

            e.preventDefault();

            $(".slideContent").slideUp(300);

            $(".sc2").slideDown(300);

            //setTimeout(function() { $.scrollTo('.footerNavigation', 700); }, 350);
        });

        $(".btnTwitter").click(function (e) {

            e.preventDefault();

            $(".slideContent").slideUp(300);

            $(".sc3").slideDown(300);

            //setTimeout(function() { $.scrollTo('.footerNavigation', 700); }, 350);
        });

        $(".btnMicro").click(function (e) {

            e.preventDefault();

            $(".slideContent").slideUp(300);

            $(".sc4").slideDown(300);

            //setTimeout(function() { $.scrollTo('.footerNavigation', 700); }, 350);
        });


    });
})(jQuery);
