jQuery(document).ready(function() {
    
    if ( $('#scroller').length > 0 ) {
        // Scroll those images
        $('#scroller').serialScroll({
            items:'li',
            prev:'#scroll_prev',
            next:'#scroll_next',
            offset:0, //when scrolling to photo, stop 230 before reaching it (from the left)
            start:0, //as we are centering it, start at the 2nd
            duration:1000,
            force:true,
            stop:true,
            lock:false,
            cycle:true, //don't pull back once you reach the end
            easing:'easeInOutQuint', //use this easing equation for a funny effect
            jump: false, //click on the images to scroll to them
            step: 8
        });
    }
    
    
    var url = window.location.href,
        s = url.split('//'),
        server = s[1].split('/'),
        blogurl = 'http://' + server[0] + '/events/';
    
    $.get(blogurl, function(data) {
        var $posts = $(data).find('.post');
        $posts = $posts.filter(function(index) {
            if (index > 1) return false;
            return true;
        });
        $('#events').html($posts);
    });
    
    $('.album > a > img, .other_album > a > img, #you_cant_lose_image > a > img').mouseenter(function() {
        $(this).parent().parent().find('.album_tooltip').fadeIn('slow');
    }).mouseleave(function() {
        $(this).parent().parent().find('.album_tooltip').fadeOut('fast');
    });
    
    if ( $('#ad-container').length > 0 ) {
        $('#ad-container').load('/files/ads.html #ads');
    }
    

});



