/*==============================
MENU ANIMATE
==============================*/

//$(document).ready(function () {
//    $(".dropdown").hover(
//        function () {
//            $('.dropdown-menu', this).not('.in .dropdown-menu').stop(true, true).slideDown("400");
//            $(this).toggleClass('open');
//        },
//        function () {
//            $('.dropdown-menu', this).not('.in .dropdown-menu').stop(true, true).slideUp("400");
//            $(this).toggleClass('open');
//        }
//    );
//});


$(document).ready(function () {

    $('#offcanvas-toggle').on('click', function (e) {
        $('html').toggleClass('open-menu');
        return false;
    });


    $('div#offcanvas-overlay').on('click', function () {
        $('html').removeClass('open-menu');
    })

});



/*==============================
SCROLL TO TOP
==============================*/

$(document).ready(function () {

    $(window).scroll(function () {
        if ($(this).scrollTop() > 100) {
            $('.scrollup').fadeIn();
        } else {
            $('.scrollup').fadeOut();
        }
    });

    $('.scrollup').click(function () {
        $("html, body").animate({ scrollTop: 0 }, 600);
        return false;
    });

});


 
/*==============================
FADE SCRIPT
==============================*/
jQuery(document).ready(function ($) {
    $("#fade").delay(200).animate({ "opacity": "1" }, 400);
});


$(window).scroll(function () {
    $(window).scroll(function () {
        if ($(this).scrollTop() > 280) {
            $('header').addClass('white-head');
        } else {
            $('header').removeClass('white-head');
        }

    });
});


/*==============================
GOOGLE MAP
==============================*/
$(window).load(function () {
    // Disable scroll zooming and bind back the click event
    var onMapMouseleaveHandler = function (event) {
        var that = $(this);

        that.on('click', onMapClickHandler);
        that.off('mouseleave', onMapMouseleaveHandler);
        that.find('iframe').css("pointer-events", "none");
    }

    var onMapClickHandler = function (event) {
        var that = $(this);

        // Disable the click handler until the user leaves the map area
        that.off('click', onMapClickHandler);

        // Enable scrolling zoom
        that.find('iframe').css("pointer-events", "auto");

        // Handle the mouse leave event
        that.on('mouseleave', onMapMouseleaveHandler);
    }

    // Enable map zooming with mouse scroll when the user clicks the map
    $('.maps.embed-container').on('click', onMapClickHandler);
});//]]> 








