// Slideshow Functions
function ncShowcase(container,flair) {

	// Create reference for THIS instance
	var me = this;

	// Find the CONTAINER
	this.container = ($('#' + container).length) ? $('#' + container) : $('.' + container);
	if(!this.container.length) return false;

	// Get the SLIDES
	this.slides = this.container.children();
	if(this.slides.length < 2) return false;

	// Set the Delay
	this.delay = (!this.container.attr('delay') || isNaN(this.container.attr('delay'))) ? 3000 : this.container.attr('delay');

	// Load jQuery UI
	if(flair && !jQuery.ui){$('<script/>',{type:'text/javascript',src:'/js/jquery/jquery-ui.js'}).appendTo('head');}

	// Flip the SLIDES
	this.action = function(){

		// Get CURRENT Slide
		var jC = me.slides.filter(':visible');

		// Get NEXT or FIRST Frame
		var jN;
		me.slides.each(function(i,o){

			if($(o).is(':visible') && i == me.slides.length - 1){jN = me.slides.eq(0);}
			else if($(o).is(':visible')){jN = me.slides.eq(i+1);}

		});

		// Toggle Animation
		jC.add(jN).slideToggle(1000);

	}

	// Initialize 
	this.timer = setInterval(this.action,this.delay);

}	
