// JavaScript Document
    $(function(){
  	var flashScroll = function (initTime)
	{
		var index = 0;
		var totLen = $(".flashNum ul li").length;
		var timer;
 		this.init = function ()
		{
			timer = setInterval(function(){
				index++;
				if(index>=totLen){index=0;}	
				scrollIt(index);
				
			},initTime);
			$(".flashNum ul li").eq(0).addClass("flashCurrent");
		}
		var scrollIt = function (index)
		{
 			$(".flashNum ul li").removeClass("flashCurrent").eq(index).addClass("flashCurrent");
			$(".flashimg img").fadeOut(1000).eq(index).fadeIn(1000);
			if(!$(".pngIMG , .flashWord").is(":animated")){
				$(".pngIMG , .flashWord").animate({
					bottom:"-88px"
				},1000);
				$(".pngIMG , .flashWord").animate({
					bottom:"0px"
				},1000);
			}
			$(".pngIMG").html($(".flashimg img").eq(index).attr("txtVal"));
		}
		
		$(".flashNum ul li").hover(function(){
			index = $(".flashNum ul li").index(this);
			scrollIt(index);
		}).eq(0).trigger("mouseover");
		
		$(".kvL").hover(function(){
			clearInterval(timer);
		},function(){
			timer = setInterval(function(){
				index++;
				if(index>=totLen){index=0;}	
				scrollIt(index);
			},initTime);	
		});
		
		 $('a.flasharrowL').click(function(){
					index--;
					if(index<0){index=totLen-1}
					scrollIt(index);
		 });
		 $('a.flasharrowR').click(function(){
					index++;
					if(index>=totLen){index=0;}
					scrollIt(index);
		 });
	}
	
	var flash = new flashScroll("6000");
	flash.init();
});
