
$(document).ready(
    function initializeGalleryColorBox() {
        $(".linkFancyBox").colorbox({width:660, height:600}, function(){
					intializeGallery();
				});
        $("#cboxOverlay").hide(); 
    }
);

function intializeGallery() {
    $(function() { 
        var galleries = $('.ad-gallery').adGallery({
            animation_speed: 900, // Which ever effect is used to switch images, how long should it take?
            slideshow: 
            {
                enable: true,
                autostart: true,
                speed: 7000,
                start_label: 'Start',
                stop_label: 'Stop',
                stop_on_scroll: true, // Should the slideshow stop if the user scrolls the thumb list?
                countdown_prefix: '(', // Wrap around the countdown
                countdown_sufix: ')'
            }
        });
    });
}