// ÀÌ¸§ÀÇ ±ÔÄ¢À¸·Î ¸¸µç rollover  _on.gif(gnb sub over)
$(document).ready(function(){
	$(".menu > ul > li > ul > li img").hover(
		function() {
			if ($(this).attr("src").substring($(this).attr("src").length-6,$(this).attr("src").length)=="_on.gif"){
				$(this).addClass ("over");
			}else{
				var currentImg = $(this).attr("src").replace("_off.gif", "_on.gif");
				$(this).attr("src", currentImg);
			}
		}, function() {
			if($(this).hasClass("over")!=true){
				var currentImg = $(this).attr("src").replace("_on.gif", "_off.gif");
				$(this).attr("src", currentImg);
			}
	});
});

/* navigation */
$(document).ready(function() {
	$(".menu > ul > li").hover(function(){
			$(this).contents("ul").show();
			$(this).contents("ul").css("z-index", "10");
			$(this).addClass("on");
		},
		function(){
			$(this).contents("ul").hide();
			$(this).contents("ul").css("z-index", "");
			$(this).removeClass("on");
		}
	);
	$(".menu li a").hover(
		function() {
			if ($(this).contents("img").attr("src").substring($(this).contents("img").attr("src").length-6,$(this).contents("img").attr("src").length)=="_on.png"){
				$(this).contents("img").addClass ("over");
			}else{
				var currentImg = $(this).contents("img").attr("src").replace("_off.png", "_on.png");
				$(this).contents("img").attr("src", currentImg);
			}

		}, function() {
			if($(this).contents("img").hasClass("over")!=true){
				var currentImg = $(this).contents("img").attr("src").replace("_on.png", "_off.png");
				$(this).contents("img").attr("src", currentImg);
				try
				{
					rightmenuOn();
				}
				catch(e) 
				{
				}
			}
		}
	)
});


/* rightmenu */
$(document).ready(function() {
	
	$("#right_area .right_menu >li").hover(function(){
			//$(this).contents("ul").show();
			$(this).contents("ul").css("z-index", "10");
			$(this).addClass("on");
		},
		function(){
			//$(this).contents("ul").hide();
			$(this).contents("ul").css("z-index", "");
			$(this).removeClass("on");
		}
	);
	$(".right_menu li a").hover(
		function() {
			if ($(this).contents("img").attr("src").substring($(this).contents("img").attr("src").length-6,$(this).contents("img").attr("src").length)=="_on.gif"){
				$(this).contents("img").addClass ("over");
			}else{
				var currentImg = $(this).contents("img").attr("src").replace("_off.gif", "_on.gif");
				$(this).contents("img").attr("src", currentImg);
			}

		}, function() {
			if($(this).contents("img").hasClass("over")!=true){
				var currentImg = $(this).contents("img").attr("src").replace("_on.gif", "_off.gif");
				$(this).contents("img").attr("src", currentImg);
				try
				{
					rightmenuOn();
				}
				catch(e) 
				{
				}
				
			}
		}
	)
	/*
	$("#right_area > ul > li > a").each(function(index){
		var $subDep = $("#right_area ul li li a");

		$(this).addClass("num"+(index+1));
		$(this).hover(
			function(){$(this).parents("li").addClass("_on");},
			function(){
				if($(this).contents("img").attr("src").substring($(this).contents("img").attr("src").length-6,$(this).contents("img").attr("src").length)!="_on.gif"){
					$(this).parents("li").removeClass("_on");
				}
			}
		);

		$subDep.hover(
			function(){$(this).addClass("_on")},
			function(){
				if($(this).contents("img").attr("src").substring($(this).contents("img").attr("src").length-6,$(this).contents("img").attr("src").length)!="_on.gif"){
					$(this).removeClass("_on")
				}
			}
		)
	})
	*/
});

function getSecNavi(pageCode){
	$("#right_area > ul > li ul").hide();
	$("#right_area > ul > li ul ul").hide();//for IE6.0
	var $thisPage = $("#right_area > ul").find("[id='"+pageCode+"']");
	if($thisPage.contents("ul").length >0 ){
		$thisPage.parent("ul").show("slow");
		$thisPage.contents("ul").show();
	}else{
		$thisPage.parent("ul").show("slow");
	}
}
//·¹ÇÁÆ®¸Þ´ºÀÌ¹ÌÁö¿ÂÃ³¸®
function getMenuon(menuCode,gnbCode,parentCode){
	try{
		var $thisMenu = $(".right_menu li").find("[name='"+menuCode+"']");
		currentImg = $thisMenu.attr("src").replace("_off.gif", "_on.gif");
		$thisMenu.attr("src", currentImg);
	}
	catch(e)
	{
	}
	try{
		var $parentMenu = $(".right_menu li").find("[name='gd0"+parentCode+"']");
		//var $gnbMenu = $(".menu li").find("[name='gnb0"+gnbCode+"']");

		currentImg2 = $parentMenu.attr("src").replace("_off.gif", "_on.gif");
		$parentMenu.attr("src", currentImg2);

		//currentImg3 = $gnbMenu.attr("src").replace("_off.png", "_on.png");
		//$gnbMenu.attr("src", currentImg3);
	}
	catch(e)
	{
	}
}


/*
$(document).ready(function() {
	var $viewTit = $(".footerIn .family > a");
	$(".footerIn .familyCNT").hide();
	$viewTit.click(
		function(){
			$(".footerIn .familyCNT").slideDown();
			$(".footerIn > .familyCNT").mouseout(function(){closeFamily();return false;})
			$(this).contents("img").attr("src","../images/common/btn_fs.gif");
		}
	);
	$(".footerIn .familyCNT .close a").click(function(){closeFamily();return false;});
	$(".familyCNT").hover(
		function(){
			$(".footerIn .familyCNT").slideDown();
		},function(){
			closeFamily();return false;
		}
	);

});


function closeFamily(){
	$(".footerIn .familyCNT").slideUp();
	$(".footerIn .family > a").contents("img").attr("src","../images/common/btn_fs.gif");
}

$(document).ready(function(){
	$("#wrapper .language ul").hide();
	$("#wrapper .language a:first-child").click(function(){
		$("#wrapper .language ul").slideToggle("fast");
	});
});
*/
/* ÁÖ°¡ ·Ñ¸µ_100719Ãß°¡
$(document).ready(function() {
	$('.roll').css({
		'display': 'block',
		'overflow': 'hidden'
	});
	$('.roll ul').append('<li></li>'); //<li> ÀÚµ¿ »ý¼º
	$('.roll ul li:last').html($('.roll ul li:first').html());

	var i = 0;
	var max = $('.roll ul li').length;  //¸®½ºÆ® ÀüÃ¼°¹¼ö
	var listH = $('.roll ul li').height(); //ÀÌµ¿°ª

	function roll() {
		if (i == max) {
			$('.roll ul').css('top', '0');
			i = 0; //ÃÊ±âÈ­
		}

		$('.roll ul').animate({top: -(i++)*listH}, 600);
		time=setTimeout(roll,1500);
	}
	roll();
});
*/

