
$(function()
{
    
     var len  = $(".num > li").length;
	 var index = 0;
	 var adTimer;
	 $(".num li").mouseover(function(){
		index  =   $(".num li").index(this);
		showImg(index);
	 }).eq(0).mouseover();	

	 $('.ad').hover(function()
	 {
			 clearInterval(adTimer);
	 },function()
	 {
			 adTimer = setInterval(function()
			 {
			    showImg(index)
				index++;
				if(index==len){index=0;}
			  } , 5000);
	 }).trigger("mouseleave");
})

function showImg(index){
        var adHeight = $(".default_change .ad").height();
        var position = -adHeight*index
        //alert(position);
        //alert(adHeight);
		$(".slider").stop(true,false).animate({top : position},1000);
		$(".num li").removeClass("on")
			.eq(index).addClass("on");
}
