/*!
 * Galleria Classic Theme
 * http://galleria.aino.se
 *
 * Copyright (c) 2010, Aino
 * Licensed under the MIT license.
 */

(function($) {

Galleria.addTheme({
    name: 'classic',
    author: 'Galleria',
    version: '1.2',
    css: 'galleria.classic.css',
    defaults: {
        transition: 'fade',
        transition_speed: 900,
        show_caption: true,
        show_counter: false,
        thumb_crop: 'height',
        image_crop: true,
        autoplay: false,
        show_imagenav: false
    },
    init: function(options) {
		

        this.$('loader').show().fadeTo(200, .4);
        
        this.$('thumbnails').children().hover(function() {
            $(this).not('.active').children().stop().fadeTo(100, 1);
        }, function() {
            $(this).not('.active').children().stop().fadeTo(400, .4);
        }).not('.active').children().css('opacity',.4);
        
               
        
        this.bind(Galleria.LOADSTART, function(e) {
            if (!e.cached) {
                this.$('loader').show().fadeTo(200, .4);
            }
           
        });

        this.bind(Galleria.LOADFINISH, function(e) {
            this.$('loader').fadeOut(200);
        });
        this.bind(Galleria.LOADSTART, function(e) {
            $(e.thumbTarget).css('opacity',1).parent().addClass('active')
                .siblings('.active').removeClass('active').children().css('opacity',.4);
            $(".galleria-info-text").fadeOut();
            
        });
        this.bind(Galleria.IMAGE, function(e){
        	$(".galleria-info-text").html($("#home_panels").children().eq(e.index).clone()).slideToggle();
        	
        });
    }
});

})(jQuery);
