﻿;(function(){
	$.fn.slide=function(options){
		var defaults={
			container:"imageContainer",
			interval:5000,
			size:3
		}
		return this.each(function(){
			var o=$.extend(defaults,options),
			n=0,
			self=this
			over='';
			var c=$(this).attr("class");
			
			$(this).children('table').wrap("<div></div>").parent().addClass('init').first().addClass("zshow").removeClass("init");
			
			over=setInterval(showInterval,o.interval);
			
			
			
			function showInterval(){
				if(n>=o.size){
					n=0;
				}else{
					n++;
				}
				
				play();
			}
			function play(){			
				$(self).next().children('li').removeClass("high").eq(n).addClass("high");
				
				
				$(self)
				.children('div')
				.removeClass('zshow').eq(n)
				.addClass('zshow')
				.animate({
				   opacity:1
				},1000,function(){
					$(self).children('div').not($(this)).css('opacity',0);
				});
			}
		})
	}
})(jQuery);
