/**
 * moreMenu:Í¼Æ¬ÂÖ²¥
 * @author:Ðì¹úÌÎ
 * @date:2010-5-19
 */
(function($){
	$.fn.autoPlayImg = function(options){
		var defaults = {
			n:0,
			count:0,
			t:0
		};
		var opts = jQuery.extend(defaults,options);
		
		var showAuto = function()
		{  
			opts.n = opts.n >= (opts.count - 1) ? 0 : opts.n + 1;
			$("#play_small li").eq(opts.n).click();
		}
		opts.count = $('#play_list a').size();
		$("#play_list a:not(:first-child)").hide();    
		$("#play_info").html($("#play_list a:first-child").find("img").attr('alt'));

		$("#play_small li").each(function(i){
			$(this).click(function(){
				opts.n = i;
				if (i >= opts.count) return; 
				$("#play_small_bg").css({'left':i*65+5});
				$("#play_info").html($("#play_list a").eq(i).find("img").attr('alt'));    
				$("#play_info").unbind().click(function(){window.open($("#play_list a").eq(i).attr('href'), "_blank")});
				$("#play_list a").filter(":visible").fadeOut('slow').parent().children().eq(i).fadeIn('slow');
			});
		});
		opts.t = setInterval(showAuto, 5000); 
		$("#play_list").hover(function(){clearInterval(opts.t)}, function(){opts.t = setInterval(showAuto, 5000);});
		return this.each(function(i){
			
		});
	};
})(jQuery)
