var t = n = count = 0;   
var mn = mcount = 0;
$(document).ready(function(){
	count = $("#indexAd li").size();
    $("#indexAd li:not(:first-child)").hide();   
    //$("#indexAd").html($("#play_list a:first-child").find("img").attr('alt'));   
    //$("#indexAd li:first-child").css({"background":"#fff",'color':'#000'});   
    //$("#indexAd").click(function(){window.open($("#indexAd a:first-child").attr('href'), "_blank")});   
    $("#indexAd li").click(function() {   
        var i = $("#indexAd li").index(this)+1;   
        if (i >= count) i=0;   
        n = i;   
        //$("#indexAd").html($("#indexAd a").eq(i).find("img").attr('alt'));   
        //$("#indexAd").unbind().click(function(){window.open($("#play_list a").eq(i).attr('href'), "_blank")})   
        $("#indexAd li").filter(":visible").fadeOut(500).parent().children().eq(i).fadeIn(1000);   
        //$(this).css({"background":"#fff",'color':'#000'}).siblings().css({"background":"#000",'color':'#fff'});   
    });   
    t = setInterval("showAuto()", 3000);   
    $("#indexAd").hover(function(){clearInterval(t)}, function(){t = setInterval("showAuto()", 3000);});

	// 滚动显示会员
	mcount = $(".memBox li").size();
    m = setInterval("showMem()", 3000);   

});  
  
function showAuto()   
{   
    n = n >= (count - 1) ? 0 : n + 1;   
    $("#indexAd li").eq(n).trigger('click');   
}

function showMem(){
	if(mn > (mcount - 1)){
		mn = 0;
	}
	$(".memBox li").eq(mn).hide(300);

	mn = mn+1;
	//$("#ingroup").text(mn+"/"+mcount);
	if(mn==(mcount-1)){
		mn = 0;
		$(".memBox li").show(300);
	}

}

