/*
	leftrightslide[0] ='<table><tr><td class="index_partner_in"><td class="index_partner_in"><a href="http://www.molab.go.kr/" target="_blank"><img src="images/index/img_banner01.gif" alt="노동부" border=0 /></a></td>';
	leftrightslide[1] ='<td class="index_partner_in"><a href="http://www.kcomwel.or.kr/" target="_blank"><img src="images/index/img_banner02.gif" alt="근로복지공단" border=0 /></a></td>';
	leftrightslide[2] ='<td class="index_partner_in"><a href="http://www.adobe.com/kr/" target="_blank"><img src="images/index/img_banner03.gif" alt="Abode" border=0 /></a></td>';
	leftrightslide[3] ='<td class="index_partner_in"><a href="http://www.oracle.com/global/kr/" target="_blank"><img src="images/index/img_banner04.gif" alt="Oracle" border=0 /></td>';
	leftrightslide[4] ='<td class="index_partner_in"><a href="http://www.vue.com/" target="_blank"><img src="images/index/img_banner05.gif" alt="Pearson View" border=0 /></a></td>';
	
	leftrightslide[5] ='<td class="index_partner_in"><a href="http://www.oracle.com/index.html" target="_blank"><img src="images/index/img_banner06.gif" alt="Sun" border=0 /></a></td>';
	
 */
	
	
$(function(){
	//$(".numList_inner_image").attr({"width":"352px","height","415px"})
	$(".numList_inner_image:eq(0)").show();	
	leftImageRepeat();
	
	
	var leftImageCount = 1;
	
	var main_pop_image = "images/index/main_pop0";
	var main_pop_btn_image = "images/index/btn_num0";
	
	$("#numList li a:eq(0)").css("background","url("+main_pop_btn_image+"1_on.gif) no-repeat");
	$("#numList li").each(function(){
		$(this).hover(function(){
			imageChage($(this));
		});//hover
	});//each
	
	function imageChage(jObj){
		var c_image_count = jObj.index();
		$("#numList li").each(function(){
			var numListIndex = $(this).index()+1;
			$(this).find("a").css("background","url("+main_pop_btn_image+numListIndex+"_off.gif) no-repeat");
		});//each
		var numListIndex = jObj.index()+1;
		leftImageCount = jObj.index();
		$(".numList_inner_image").hide();
		$(".numList_inner_image:eq("+c_image_count+")").show();//attr("src",main_pop_image+numListIndex+".jpg");
		jObj.find("a").css("background","url("+main_pop_btn_image+numListIndex+"_on.gif) no-repeat");
	}
	
	function leftImageRepeat(){
		autoRepeat = setInterval(function(){
			imageChage($("#numList li:eq("+leftImageCount+")"));
			if(leftImageCount==$(".numList_inner_image").size()-1){
				leftImageCount = 0;
			} else {
				leftImageCount++;
			}
		},3000);
	}
	$("#numList_inner_image").hover(function(){
		clearInterval(autoRepeat);
	}, function(){
		leftImageRepeat();
	});
})


$(function(){
	var c_list_status = true;		//click stop status
	var cc_select = 0;				//button index
	var $cThis = $(".topArea ol li");
	var imagesCount = $("#popupImageLay img").size();
	var autoRepeat;
	var imageWidth = 255;
	var c_left = 0;
	$("#popupImageLay").css({
		"width":(imageWidth*imagesCount)+"px",
		"position":"absolute","left":0,"top":0
	});
	
	rightContainerChang = function(pleft){
		c_left = pleft;
	}
	
	layOffLeftMove = function( aIndex ){
		var left = (aIndex)*imageWidth;
		return "+="+left;
	}
	
	$cThis.click(function(){
		if(autoRepeat){
			repeatStop();
		}
		$(".topArea ol li").each(function(ei){
			$(this).find("a img").attr("src","/images/index/icon_num0"+(ei+1)+"_off.gif");
		});
		
		var index = $cThis.index(this);
		
		$(this).find("a img").attr("src","/images/index/icon_num0"+(index+1)+"_on.gif");
		
		
		if (c_list_status && index!=cc_select) {			//index!=cc_select  click stop status
			//jScrollPaneDrag jScrollPaneTrack
			for(var j=0; j<imagesCount; j++){
				if(index==j){
					rightContainerChang(j*imageWidth);
				}
			}
			
			c_left = layOffLeftMove( (cc_select-index ));
			cc_select = index;
			//alert(cc_select);
			//var c_left = cc_select==0 ? '+=600' : '-=600';	//left animate 
			c_list_status = false;
			
			$("#popupImageLay").animate({
					opacity: 1.0,
					left: c_left,top:0
				}, 1000, function(){
					c_list_status = true;
					imageRepeat();
			});// end animate
		}//if end
	});//click end
	
	$(".popupZone").hover(function(){
		repeatStop();
	},function(){
		imageRepeat();
	});
	
	function imageRepeat(){
		autoRepeat = setInterval(function(){
			if(cc_select==(imagesCount-1)){
				$(".topArea ol li:eq(0)").trigger("click");
			} else {
				$(".topArea ol li:eq("+(cc_select+1)+")").trigger("click");
			}
			
		},3000);
	}
	function repeatStop(){
		if(autoRepeat){
			clearInterval(autoRepeat);
		}
	}
	
	imageRepeat();
		
		
});// event end			

					 

