﻿$(window).load(function () {
    if ($("#slider").length != 0) {
        $('#slider').nivoSlider({
            effect: 'boxRandom', // Specify sets like: 'fold,fade,sliceDown'
            boxCols: 8, // For box animations
            boxRows: 4, // For box animations
            animSpeed: 500, // Slide transition speed
            pauseTime: 6000, // How long each slide will show
            directionNav: false, // Next & Prev navigation
            captionOpacity: 1, // Universal caption opacity
            afterLoad: function () {
                jQuery('.nivo-caption').animate({ marginLeft: "0" }, { easing: "jswing" });
            },
            beforeChange: function () {
                jQuery('.nivo-caption').animate({ marginLeft: "-470px" }, { easing: "jswing" });
            },
            afterChange: function () {
                jQuery('.nivo-caption').animate({ marginLeft: "0" }, { easing: "easeOutBounce" });
            }
        });
    }
});
$(function () {
    $("#btlogin").click(function () {
        $("#login-caixa").toggle();
        $("#btlogin").toggleClass("ativo");
    });

    $("#login-caixa, #btlogin").mouseup(function () {
        return false
    });

    $(document).mouseup(function (e) {
        if ($(e.target).parents("#login-caixa").length == 0) {
            $("#btlogin").filter('.active').removeClass("active");
            $("#login-caixa:visible").hide();
        }
    });

    if ($("#menu-adm").length != 0) {
        $('#menu-adm > li').bind({
            mouseenter: function () {
                $(this).children('ul').css("display", "block")
            },
            mouseleave: function () {
                $(this).children('ul').css("display", "none")
            }
        });
    }
});
