jQuery(document).ready(function($) {


    $('.gallery').each(function(index) {
        var left = $(this).parent().prev();
        $(this).appendTo(left).wrapInner('<div class="items" />').scrollable({items:'.gallery-item'/*, circular:true*/}).show();//.autoscroll(6000, { autoplay: false });
    });

    $('.gallery a').click(function() {
        var api = $(this).closest('.gallery').data("scrollable");

        if ( api.getIndex()+1 == api.getSize())
            api.seekTo(0)
        else 
            api.next();


        
        return false;
    });
        
    $('.press').scrollable({items:'.post'}).show();//.autoscroll(6000, { autoplay: false });

    $('.press img').click(function() {
        var api = $(this).closest('.press').data("scrollable");
        api.next();
        return false;
    });
        

});

