// JavaScript Document
$(document).ready(function () {
    ////////////////////////////////////////////
    ////////////////// GLOBAL //////////////////
    ////////////////////////////////////////////

    $('div.BlokSlider').easySlider({
        controlsShow: false,
        vertical: false,
        speed: 800,
        pause: 5000,
        auto: true,
        continuous: true
    });

    $('div.BlokGallery div.imgs_small ul.gallery_small').each(function () {
        var container = $(this).parent();
        container.css('overflow', 'hidden');

        var ulPadding = 15;

        container.mousemove(function (e) {
            var divWidth = $(this).width();
            var lastLi = $(this).find('li:last-child');

            var ulWidth = lastLi[0].offsetLeft + lastLi.outerWidth() + ulPadding;
            var left = (e.pageX - container.offset().left) * (ulWidth - divWidth) / divWidth;
            container.scrollLeft(left);
        });
    });

    $("a.zoomImg").fancybox({
        'zoomOpacity': true,
        'overlayShow': true,
        'zoomSpeedIn': 500,
        'zoomSpeedOut': 500,
        'imageScale': true,
        'hideOnContentClick': true
    });

    ////////////////////////////////////////////
    ////////////// SITE SPECIFIC ///////////////
    ////////////////////////////////////////////

    $('#navNav ul li:not(li:has(ul))').hover(function () {
        $(this).stop().animate({ marginRight: '10px' }, 50);
    }, function () {
        $(this).stop().animate({ marginRight: '0px' }, 300);
    });

    $('.project .info').slideUp().first().slideDown();
    $('.project').click(function () {
        $('.project .info').slideUp();
        $(this).find('.info').slideToggle();
    });
});

//banners
function hideBanner() {
    $('#bannerFade, #bannerCenter').css('display', 'none');
};
