
$(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();	

	 $('.asd').hover(function()
	 {
			 clearInterval(adTimer);
	 },function()
	 {
			 adTimer = setInterval(function()
			 {
			    showImg(index)
				index++;
				if(index==len){index=0;}
			  } , 3000);
	 }).trigger("mouseleave");
})

function showImg(index){
        var adHeight = $(".asd").height()+3;
        var position = -adHeight*index
        //alert(position);
        //alert(adHeight);
		$(".slider").stop(true,false).animate({top : position},1000);
		$(".num li").removeClass("on")
			.eq(index).addClass("on");
}


$(document).ready(function()
{
     var len  = $(".numnew > li").length;
	 var index = 0;
	 var adTimer;
	 $(".numnew li").mouseover(function(){
		index  =   $(".numnew li").index(this);
		showImgnew(index);
	 }).eq(0).mouseover();	

	 $('.asdnew').hover(function()
	 {
			 clearInterval(adTimer);
	 },function()
	 {
			 adTimer = setInterval(function()
			 {
			    showImgnew(index)
				index++;
				if(index==len){index=0;}
			  } , 3000);
	 }).trigger("mouseleave");
})

function showImgnew(index){
        var adHeight = $(".asdnew").height()+3;
        var position = -adHeight*index
        //alert(position);
        //alert(adHeight);
		$(".slidernew").stop(true,false).animate({top : position},1000);
		$(".numnew li").removeClass("on")
			.eq(index).addClass("on");
}
