/**
* ncSwap jQuery plugin V 1.0
* Eric Tompkins, North Wind Media
* 03/02/2008
*
* Required jQuery library version 1.2 or greater
*/
(function($){$.nc=$.nc||{};$.fn.ncSwap=function(options){return this.each(function(){new $.nc.swap(this,options)})};$.nc.swap=function(el,options){this.element;this.timer;this.li;this.itemCount;this.current;this.options={delay:5000,change:'swap',fadeSpeed:'normal',tag:'li'};this.options=jQuery.extend(this.options,options);this.element=$(el);this.items=$(this.options.tag,this.element);this.itemCount=this.items.length;this.element.css('position','relative');this.items.css({display:'none',position:'absolute',top:0});this.display(true)};$.extend($.nc.swap.prototype,{timer:function(){if(this.itemCount>1){this.current++;var self=this;setTimeout(function(){self.display()},this.options.delay)}},display:function(first){var past;if(undefined==this.current){this.current=0}if(this.current>(this.itemCount-1)){this.current=0}if(this.current>0){past=this.current-1}else if(true!==first){past=this.itemCount-1}switch(this.options.change){case'swap':this.swap(past);break;case'fade':this.fade(past);break}},swap:function(past){if(undefined!=past){this.items[past].style.display='none'}this.items[this.current].style.display='block';this.timer()},fade:function(past){if(undefined!=past){var self=this;$(this.items[past]).fadeOut(this.options.fadeSpeed,function(){self.fadeIn()})}else{this.fadeIn()}},fadeIn:function(){$(this.items[this.current]).fadeIn(this.options.fadeSpeed,this.timer())}})})(jQuery);