/*

	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(obj, i) {
			obj.addClassName(className)
		})
		
		//Activate coverflow
		new Showcase.Horizontal($$('#'+container+' a'), $$('a.'+args['controls']), args);

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


}