// Easing equation, borrowed from jQuery easing plugin
// http://gsgd.co.uk/sandbox/jquery/easing/
jQuery.easing.easeOutQuart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};

 // Load theme
Galleria.loadTheme('/js/galleria.classic.js');

// run galleria and add some options
$('#preview').galleria({
    image_crop: false, // crop all images to fit
    thumb_crop: true, // crop all thumbnails to fit
    image_margin: 5,
    thumb_margin: 0,
    show_info: false,
    transition: 'fade', // crossfade photos
    transition_speed: 700, // slow down the crossfade
    lightbox_fade_speed: 400,
    extend: function() {
        this.bind(Galleria.IMAGE, function(e) {
            // bind a click event to the active image
            $(e.imageTarget).css('cursor','pointer').click(this.proxy(function() {
                // open the image in a lightbox
                this.openLightbox();
            }));
        });
    }
});

$('#slideshow').galleria({
    image_crop: false, // crop all images to fit
    thumb_crop: true, // crop all thumbnails to fit
    image_margin: 10,
    autoplay: 4000,
    show_imagenav: false,
    thumbnails: 'empty',
    show_info: false,
    show_counter: false,
    transition: 'fade', // crossfade photos
    transition_speed: 700, // slow down the crossfade
    lightbox_fade_speed: 400
});
