jQuery(document).ready(function($) {
	if ($('a[rel*=facebox]').length == 1) {
		$('a[rel*=facebox]').facebox();
	} else if ($('a[rel*=facebox]').length > 1) {
		$('a[rel*=facebox]').facebox({
			next_image    : 'inc/css/facebox/fast_forward.png',
			play_image    : 'inc/css/facebox/play.png',
			pause_image   : 'inc/css/facebox/pause.png',
			prev_image    : 'inc/css/facebox/rewind.png'
		});
	}
	
	Galleria.loadTheme('inc/galleria/themes/classic/galleria.classic.min.js');
	$("#gallery").galleria({
		width: 680,
		height: 277,
		autoplay: 3000,
		imageCrop:true,
		imagePan:false,
		popupLinks:false,
		thumbnails: "empty",
		thumbCrop: true,
		initialTransition:"fade",
		transition:"fade",
		extend: function(options) {
            var gallery = this; 
            
            this.bind("loadstart", function(e) {
			    if ( !e.cached ) {
			    }
			});
			
			this.bind('idle_enter', function(e) { 
            	this.play();
        	});

        }

	});
	$("#gallery-sub").galleria({
		width: 680,
		height: 207,
		autoplay: 3000,
		imageCrop:true,
		imagePan:false,
		popupLinks:false,
		thumbnails: "empty",
		thumbCrop: true,
		transition:"fade",
		extend: function(options) {
            var gallery = this; 
            
            this.bind("loadstart", function(e) {
			    if ( !e.cached ) {
			    }
			});
			
			this.bind('idle_enter', function(e) { 
            	this.play();
        	});

        }

	});
});

