/*

	Gallery is just a wrapper for EmbeddedGallery and PopUpGallery
	Receives all the same configuration plus the 'type' directive,
	which can be set to popup (default) or embed.
	
	** Modified to use image flow script

*/
function Gallery(container, args) {

	//Check type
	if(args['type'] && args['type'] == 'embed')
		return new EmbeddedGallery(container, args);
		
	else if(args['type'] && args['type'] == 'coverflow') {
		
		//Add classname to links
		var className = container+Math.round(Math.random()*11);
		$('#'+container+' a').each(function(i, obj) {
			$(obj).addClass(className)
		})
		
		//Activate coverflow
		new ShowcaseHorizontal($('#'+container+' a').get(), $('a.'+args['controls']).get(), args);

		return new PopUpGallery(className, args);				
		
	} else		
		return new PopUpGallery(container, args);


}
