function slideSwitch(el) {
	var liNr=$(el+' li').length;
    var active = $(el+' li.active');
    var activeNr = $(el+' li.active').index();
    if(activeNr>=liNr-1){
    	active.removeClass('active');
    	$(el+' li').eq(0).addClass('active');
    	active.fadeOut(500,function(){$(el+' li').eq(0).fadeIn(500);});
    }
    var next = active.next();
    active.removeClass('active');
    next.addClass('active');
    active.fadeOut(500,function(){next.fadeIn(500);});
}

(function($){ 
    $.fn.extend({
    	 
        swapthis: function(options) {
            
            var defaults = {
                speed: 2, //Seconds
                delay: 0 //Seconds
            }
                 
            var options =  $.extend(defaults, options);
 	
            return this.each(function() {
                var o = options;
                o.speed = o.speed*1000;
                var main = '#'+$(this).attr('id');
                
                $(main).css({'list-style-type':'none','margin':'0','padding':'2px'})
                $(main+' li').hide();
                $(main+' li').eq(0).addClass('active');
                $(main+' li').eq(0).show();
                
                
                setTimeout(function(){ setInterval("slideSwitch('"+main+"')",o.speed); },o.delay*1000);
            });
        }
    });
     
})(jQuery);





