//$(function() {
//    var len = $(".num > li").length;
//    var index = 0;
//    var adTimer;
//    $(".slider").width(len * 486);
//    $(".num li").mouseover(function() {
//        index = $(".num li").index(this);
//        showImg(index);
//    }).eq(0).mouseover();
//    $('.ad').hover(function() {
//        clearInterval(adTimer);
//    }, function() {
//        adTimer = setInterval(function() {
//            index++;
//            if (index == len) { index = 0; }
//            showImg(index);
//        }, 2000);
//    }).trigger("mouseleave");
//})

//function showImg(index) {
//    var adHeight = $(".ad").width();
//    $(".slider").stop(true, false).animate({ left: -adHeight * index }, 1000);
//    $(".num li").removeClass("on").eq(index).addClass("on");
//}

$(function(){
     var len  = $(".num > li").length;
	 var index = 0;
	 var adTimer;
	 $(".slider").width(len*280);
	
	 $(".num li").mouseover(function(){
		index  =   $(".num li").index(this);
		showImg(index);
	 }).eq(0).mouseover();	
	 $('.ad').hover(function(){
			 clearInterval(adTimer);
		 },function(){
			 adTimer = setInterval(function(){
			    index++;
				if(index==len){index=0;}
				showImg(index);	
			  } , 5000);
	 }).trigger("mouseleave");
})

function showImg(index){
    $(".slider li").fadeOut(0);
        var adHeight = $(".ad").width();

        $(".slider li").eq(index).fadeIn(500);
		$(".num li").removeClass("on").eq(index).addClass("on");
}