﻿$(window).load(function() {
    $('.pics').cycle({
        fx: 'fade',
        speed: 2000,
        timeout: 8000,
        before: onBefore
    });
});

// hide all but the first image when page loads
$(document).ready(function() {
    $('.pics img:gt(0)').hide();
});

// callback fired when each slide transition begins
function onBefore(curr,next,opts) {
    
    var $slide = $(next);
    var w = $slide.outerWidth();
    ;
    var h = $slide.outerHeight();
    
    $slide.css({
        marginTop: (605 - h) / 2,
        marginLeft: (900 - w) / 2
    });
};


