sandbox.register_module('files_viewer', util.extend({
	title: 'File Manager'
	, description: 'Sets up the JS file viewer actions'
	, fancybox_options: {
		
	}
	, initialize: function() {
		// If we click on an image, display it in a lightbox.
		// If we click on a file, start the download for it.
		$('a.files-image-preview').click(function(e){
			e.preventDefault();
			e.stopPropagation();
			
			var opts = {
					title: 'Image Preview'
					, text: '<img src="'+$(this).attr('href')+'">'
					, footer: '<a href="'+$(this).attr('href')+'" target="_blank">View Full Size</a>'
			}
			
			sandbox.request_module('modal').set(opts).show();
		});
	}
}, sandbox.module));
