/* 
우클릭방지 스크립트
document.oncontextmenu = new Function('return false');
document.ondragstart = new Function('return false');
document.onselectstart = new Function('return false');
*/

function printFlash(src, w, h, id, vars) {
	var Flash_html = "";
	Flash_html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10.0.12.36" id="'+id+'" width="'+w+'" height="'+h+'">';
	Flash_html += '<param name="movie" value="'+src+'">';
	Flash_html += '<param name="quality" value="high">';
	Flash_html += '<param name="allowScriptAccess" value="sameDomain">';
	Flash_html += '<param name="wmode" value="transparent">';
	Flash_html += '<param name="FlashVars" value="'+vars+'">';
	Flash_html += '<param name="swliveconnect" value="true">';
	Flash_html += '<embed src="'+src+'" quality=high wmode="transparent" FlashVars="'+vars+'" width="'+w+'" height="'+h+'" swliveconnect="true" allowScriptAccess="sameDomain" id="'+id+'" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"><\/embed>';
	Flash_html += '</object>';
	document.write(Flash_html);
}


/*1010 추가*/

function hovers() {
	$(".top_sub_menu img.gnb24").mouseover(function() {
		$(this).attr("src", $(this).attr("src").replace(".gif", "_on.gif")); 
	});
	$(".top_sub_menu img.gnb24").mouseout(function() {
		$(this).attr("src", $(this).attr("src").replace("_on.gif", ".gif")); 
	});
}


// 전역 스타일 핸들링
$(document).ready(function(){
	 hovers();
	// GNB URL 정보 셋팅
	var URL_mirror_check = location.href;
	
	if (URL_mirror_check.toLowerCase().lastIndexOf('contentsmall_m') == -1 ){
		//GNBgetData();
	}
	else{
		
		//GNBgetData_mirror();
	}
	// 텍스트 인풋, 텍스트에리어 포커스 스타일 변경
	$("input[class*='text'],textarea").focus(function(){
		//var readOnly = $("input[class*='text'],textarea").attr("readonly")
		//if( readOnly == readonly){
		//}
       $(this).css("border","1px solid #e58987").css("background","#fff");
    });
	$("input[class*='text'],textarea").blur(function(){
       $(this).css("border-left","1px solid #e0e0e4").css("border-top","1px solid #d6d6da").css("border-right","1px solid #eaeaed").css("border-bottom","1px solid #eaeaed").css("background","#eaeaed");
    });
	// 게시판 리스트 테이블 마지막 행 스타일 변경
	$("table[class='list_basic'] tr:last").addClass("end");
	$("table[class='list_basic'] tr").mouseover(function() {$(this).addClass("over");}).mouseout(function(){$(this).removeClass("over");});
	$("table[class='list_basic'] tr:last").mouseover(function() {$(this).addClass("over_end");}).mouseout(function(){$(this).removeClass("over_end");});
	// 페이징 넘버 스타일 예외 적용
	$(".paging span.num a:last-child").addClass("end");
	$(".paging span.num strong:last-child").addClass("end");
	//썸네일 게시판 썸네일 유무 구분
	$("table[class='list_thumb'] .thumb").parent().children("dl").css("width","520px");
	$("table[class='list_thumb'] tr:last").addClass("end");
	$("table[class='list_thumb'] td").mouseover(function() {$(this).addClass("over");}).mouseout(function(){$(this).removeClass("over");});
	//pr room 동영상 썸네일
	$("div[class='list_movie'] ul li a").mouseover(function() {$(this).parent("li").addClass("over");}).mouseout(function(){$(this).parent("li").removeClass("over");});
	//뷰 하단 비 썸네일 이전다음글 */
	$("ul[class*='list_pn'] li").mouseover(function() {$(this).addClass("over");}).mouseout(function(){$(this).removeClass("over");});
	$("table[class*='list_book'] tr:last td").addClass("end");
	$("table[class*='list_book'] tr").mouseover(function() {$(this).addClass("over");}).mouseout(function(){$(this).removeClass("over");});
	//월페이퍼 보기 페이지의 해상도 버튼
	var btnRes = $("div[class*='view_wallpaper']>dl>dd>ul>li>a")
	btnRes.mouseover(function() {$(this).addClass("over");}).mouseout(function(){$(this).removeClass("over");});
	
	// 메뉴 상단 탭
	tabActs();
	// 검색 종류 선택
	selectKind();
	// 로케이션 함수
	locMake();
});

// faq, 자료실의 폴딩 리스트
jQuery(function(){
	var article = $('.list_fold .article');
	article.addClass('hide');
	article.find('.c').slideUp(100);
	//article.eq(0).removeClass('hide').addClass('show'); // show first item
	//article.eq(0).find('.a').slideDown(100); // show first item
	$('.list_fold .article .t').mouseover(function() {$(this).addClass("over");}).mouseout(function(){$(this).removeClass("over");});
	$('.list_fold .article .t a').click(function(){
		var myArticle = $(this).parents('.article:first');
		if(myArticle.hasClass('hide')){
			article.addClass('hide').removeClass('show'); // 아코디언 폴딩
			article.find('.c').slideUp(100); // 아코디언 폴딩
			myArticle.removeClass('hide').addClass('show');
			myArticle.find('.c').slideDown(100);
			// 벌어질때 발생하는 액션 : 2010-08-09 光
			fnShowAction($(this));
		} else {
			myArticle.removeClass('show').addClass('hide');
			myArticle.find('.c').slideUp(100);
		}
	});
});
	
// 팝업 열기
function openPopup(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable) {
	var objPopup;
	toolbar_str 	= 	toolbar 	? 'yes' : 'no';	
	menubar_str 	= 	menubar 	? 'yes' : 'no';	
	statusbar_str = 	statusbar   ? 'yes' : 'no';	
	scrollbar_str = 	scrollbar   ? 'yes' : 'no';	
	resizable_str = 	resizable   ? 'yes' : 'no';		
	objPopup = window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
	return objPopup;
}

function popPrintProduct(){
  window.open('/Product/popupPrint.asp', 'popup_print', 'left=20,top=20,width=740,height=650,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=no');
}
function popPrintBrochure(){
  window.open('/Product/popupBrochure.asp', 'popup_print', 'left=20,top=20,width=740,height=650,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=no');
}
function openSponge(){
  var popSponge = window.open('/Inc/quizSpongePop.asp', 'Sponge', 'left=20,top=20,width=708,height=344,toolbar=no,menubar=no,status=no,scrollbars=no,resizable=no');
  popSponge.focus() ;
}
function openFusionQooktv(){
	  window.open('/Product/popupQookTV.asp', 'QOOKTV', 'left=20,top=20,width=665,height=500,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=no');
}
function openFusionPhone(){
	  window.open('/Product/popupQookPhone.asp', 'Phone', 'left=20,top=20,width=665,height=500,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=no');
}
function openFusionIphone(){
	  window.open('/Product/popupQookIPhone.asp', 'InternetPhone', 'left=20,top=20,width=665,height=500,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=no');
}
function openFusionInternet(){
	  window.open('/Product/popupQookInternet.asp', 'Internet', 'left=20,top=20,width=665,height=500,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=no');
}
function applyOlleh(){
	  window.open('/ContentsMall/OllehCampus/applyTour.asp', 'Internet', 'left=20,top=20,width=676,height=600,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=no');
}
function mainPop(){
	  window.open('/Inc/pop/popup_ollehcam.asp', 'Olleh', 'left=20,top=20,width=676,height=600,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=no');
}

function popupCenter() { 
	var x,y; 
	// IE 외 모든 브라우저
	if (self.innerHeight) {  
	x = (screen.availWidth - self.innerWidth) / 2; 
	y = (screen.availHeight - self.innerHeight) / 2; 
	// Explorer 6 Strict 모드 
	} else if (document.documentElement && document.documentElement.clientHeight) { 
	x = (screen.availWidth - document.documentElement.clientWidth) / 2; 
	y = (screen.availHeight - document.documentElement.clientHeight) / 2; 
	// 다른 IE 브라우저( IE < 6)
	} else if (document.body) {  
	x = (screen.availWidth - document.body.clientWidth) / 2; 
	y = (screen.availHeight - document.body.clientHeight) / 2; 
	} 
	window.moveTo(x,y); 
}


function getCookie( cookieName )
{
	var search = cookieName + "=";
	var cookie = document.cookie;
	
	// 현재 쿠키가 존재할 경우
	if( cookie.length > 0 )
	{
		// 해당 쿠키명이 존재하는지 검색한 후 존재하면 위치를 리턴.
		startIndex = cookie.indexOf( cookieName );
	
		// 만약 존재한다면
		if( startIndex != -1 )
		{
			// 값을 얻어내기 위해 시작 인덱스 조절
			startIndex += cookieName.length;
			
			// 값을 얻어내기 위해 종료 인덱스 추출
			endIndex = cookie.indexOf( ";", startIndex );
			
			// 만약 종료 인덱스를 못찾게 되면 쿠키 전체길이로 설정
			if( endIndex == -1) 
			{
				endIndex = cookie.length;
			}
			
			// 쿠키값을 추출하여 리턴
			return unescape( cookie.substring( startIndex + 1, endIndex ) );
			
		}
		else
		{
			// 쿠키 내에 해당 쿠키가 존재하지 않을 경우
			return false;
		}
	}
	else
	{
		// 쿠키 자체가 없을 경우
		return false;
	}

}

// GNB URL 정보 셋팅
function GNBgetData(){
	/*$("#divGnb").load("/inc/main_navi_by_promind.xml");*/
	try{
		if(loVal){
			locNumber = loVal.substring(0,2);
		}else{
			locNumber ="00";
		}
		$.ajax({
				url : "/Xhtml/ktbiz2010/main_navi_by_promind.xml", 
				type : "get",
				dataType : "xml", 
				success : function(xml) {
					$("#divGnb .menu_list").append("");
					if(locNumber == "00"){
						var $depth01 = $(xml).find("navi").find("Depth1");
						if($depth01.length > 0){
							$depth01.each(function(n, value) {	
								//$("#divGnb .menu_list").append("<a href='#' onclick=urlMove('"+$(this).attr("param")+"') ><img src='/Images/common/gnb0"+n+"0.gif' alt='"+$(this).attr("name")+"' title='' /></a>");
								/*
									제휴사이트 iframe target 문제로 인해 1Depth에 target 값을 추가
									제휴사이트 확인변수 : boolAllianceIframeMode = true;
								*/
								if (boolAllianceIframeMode){
									$("#divGnb .menu_list").append("<a href=\"javascript: urlMove('"+$(this).attr("param")+"','',true)\"><img src='/Images/common/gnb0"+n+"0.gif' alt='"+$(this).attr("name")+"' title='' /></a>");
								}
								else {
									$("#divGnb .menu_list").append("<a href=\"javascript: urlMove('"+$(this).attr("param")+"')\"><img src='/Images/common/gnb0"+n+"0.gif' alt='"+$(this).attr("name")+"' title='' /></a>");
								}
							});
						}
					}else if(locNumber == "01"){
						var $depth01 = $(xml).find("navi").find("Depth1").eq(0).find("Depth2");
						var sortNum = 0;
						if($depth01.length > 0){
							$depth01.each(function(n, value) {
								$("#divGnb .menu_list").append("<a href='#' onclick=showMenu('"+sortNum+"',"+n+",this) ><img src='/Images/common/gnb00"+(parseInt(n)+1)+".gif' alt='"+$(this).attr("name")+"' title='' /></a>");
							});
						}
					}else if(locNumber == "02"){
						var $depth01 = $(xml).find("navi").find("Depth1").eq(1).find("Depth2");
						var sortNum = 1;
							if($depth01.length > 0){
							$depth01.each(function(n, value) {
								$("#divGnb .menu_list").append("<a href='#' onclick=showMenu('"+sortNum+"',"+n+",this) ><img src='/Images/common/gnb01"+(parseInt(n)+1)+".gif' alt='"+$(this).attr("name")+"' title='' /></a>");
							});
						}
					}else if(locNumber == "03"){
						var $depth01 = $(xml).find("navi").find("Depth1").eq(2).find("Depth2");
						var sortNum = 2;
						if($depth01.length > 0){
							$depth01.each(function(n, value) {
								$("#divGnb .menu_list").append("<a href='#' onclick=showMenu('"+sortNum+"',"+n+",this) ><img src='/Images/common/gnb02"+(parseInt(n)+1)+".gif' alt='"+$(this).attr("name")+"' title='' /></a>");
							});
						}
					}
				},
				error : function(xhr, ajaxOptions, thrownError) {
					//alert("Error Code : "+xhr.status); 
					//alert(thrownError); 
				}
		});
	}catch(e) {}
	
}

// GNB 페이지 이동 함수

function urlMove(urls,obj, targetparent){
	if(urls == "X"){
		if(obj.className == "dep04"){
			if($(obj).children("ul.dep05").eq(0).css("display") == "none"){
				$("#divGnb .top_sub_menu ul.dep05").hide();
			}
			
			$(obj).children("ul.dep05").toggle();
			$("h5 img.h5_blt00").each(function(n) {
				$(this).attr("src","/Images/common/blt_open.gif");
			});
			if($(obj).children("ul.dep05").css("display") == "block"){
				obj.getElementsByTagName("img")[1].src = "/Images/common/blt_close.gif";
			}
			//alert($(obj).children("h5 img").attr("class"));
			//$(obj).children("img.h5_blt00").attr("src","/Images/common/blt_close.gif");
			
		}
		return false;
	}

	if(urls == "http://www.ktvpn.com/WEB/CNM/Common/Login/LoginPage.aspx") {
		window.open(urls);
	}else if(urls == "http://ktbiz.ibk.co.kr/biz") {
		window.open(urls);
	}else{
		if (targetparent) {parent.location.href = urls;}
		else {	location.href = urls;}
	}

}

function showMenu(depth, sortNum, obj){
	$("#frLayer").attr("height",0);
	if(($(".top_sub_menu_wp").css("display") == "inline" || $(".top_sub_menu_wp").css("display") == "block") && obj.firstChild.src.indexOf("_on.gif") != -1) {$(".top_sub_menu_wp").hide(); obj.firstChild.src = obj.firstChild.src.replace("_on.gif",".gif"); return false;}
	$(".menu_list a img").each(function(n){
		$(this).attr("src", this.src.replace("_on.gif",".gif"));
	});
	if(obj.nodeName == "A") {obj.firstChild.src = obj.firstChild.src.replace(".gif","_on.gif");}
	//alert($(obj).offset().top +" " + $(obj).position().left);
	if(loVal.substring(0,2) == "02" || loVal.substring(0,2) == "03"){
		var classAdd = "clears";
		$(".top_sub_menu_wp").css("width", 210);
	}else { 
		var classAdd = ""; 
		$(".top_sub_menu_wp").css("width", 160);
	}
	$.ajax({
			url : "/Xhtml/ktbiz2010/main_navi_by_promind.xml", 
			type : "get",
			dataType : "xml", 
			success : function(xml) {
				$("#divGnb .top_sub_menu ul").remove();
				var $depth_list = $(xml).find("navi").find("Depth1").eq(depth).find("Depth2").eq(sortNum).find("Depth3");
				if($depth_list.length == 1) {$(".top_sub_menu_wp").css("width", 210);}
				if($depth_list.length > 0){
					for(var i = 0; i < $depth_list.length ; i++){
						$("#divGnb .top_sub_menu").append("<ul class='dep03 "+classAdd+"' id='dep03"+i+"'><li class='dep03' onclick=urlMove('"+$depth_list.eq(i).attr("param")+"',this)><h4 onmouseover='bgChangeIn(4, this)' onmouseout='bgChangeOut(4,this)' ><img src='/Images/common/h4_"+depth+"_"+sortNum+"_"+i+".png' class='png24' alt='"+$depth_list.eq(i).attr("name")+"' /></h4></li></u>");
						if(loVal.substring(0,2) == "01"){
							var $depth_list_4 = $depth_list.eq(i).find("Depth4");
							for(var k = 0; k < $depth_list_4.length ; k++){
								var $depth_list_5 = $depth_list_4.eq(k).find("Depth5");
								var addStr = "";
								if($depth_list_5.length > 0) {addStr = "<img class='h5_blt00' src='/Images/common/blt_open.gif' alt='' />";}
								$("#divGnb .top_sub_menu ul#dep03"+i+" li.dep03").append("<ul class='dep04' id='dep04"+k+"'><li class='dep04' onclick=urlMove('"+$depth_list_4.eq(k).attr("param")+"',this)><h5 onmouseover='bgChangeIn(5, this)' onmouseout='bgChangeOut(5, this)' ><img src='/Images/common/h5_"+depth+"_"+sortNum+"_"+i+"_"+k+".png' class='png24' alt='"+$depth_list_4.eq(k).attr("name")+"' /> "+addStr+"</h5></li></u>");
								
								for(var m = 0; m < $depth_list_5.length ; m++){
									$("#divGnb .top_sub_menu ul#dep03"+i+" li.dep03 ul#dep04"+k+" li.dep04").append("<ul class='dep05'><li class='dep05' onclick=urlMove('"+$depth_list_5.eq(m).attr("param")+"',this)><h6 onmouseover='bgChangeIn(6, this)' onmouseout='bgChangeOut(6, this)' ><img src='/Images/common/h6_"+depth+"_"+sortNum+"_"+i+"_"+k+"_"+m+".png' class='png24' alt='"+$depth_list_5.eq(m).attr("name")+"' /></h6></li></u>");
								}
							}
						}
					}
				}
				$("#divGnb .top_sub_menu_wp").hide();
				//$("#divGnb .top_sub_menu").css("top", $(obj).offset().top);
				$("#divGnb .top_sub_menu_wp").css("left", $(obj).position().left);
				$("#divGnb .top_sub_menu_wp").slideDown(800);
				$("#frLayer").attr("height",parseInt($("#top_sub_menu").css("height"))+3);
				//alert(parseInt($("#top_sub_menu").css("height")));
				
			},
			error : function(xhr, ajaxOptions, thrownError) {
				//alert("Error Code : "+xhr.status); 
				//alert(thrownError); 
			}
	});
}

function showMenu_Fs(depth, sortNum, obj){
	if(($(".top_sub_menu_wp").css("display") == "inline" || $(".top_sub_menu_wp").css("display") == "block") && obj.firstChild.src.indexOf("_on.gif") != -1) {$(".top_sub_menu_wp").hide(); obj.firstChild.src = obj.firstChild.src.replace("_on.gif",".gif"); return false;}
	$(".menu_list a img").each(function(n){
		$(this).attr("src", this.src.replace("_on.gif",".gif"));
	});
	if(obj.nodeName == "A") {obj.firstChild.src = obj.firstChild.src.replace(".gif","_on.gif");}
	//alert($(obj).offset().top +" " + $(obj).position().left);
	if(loVal.substring(0,2) == "02" || loVal.substring(0,2) == "03"){
		var classAdd = "clears";
		$(".top_sub_menu_wp").css("width", 210);
	}else { 
		var classAdd = ""; 
		$(".top_sub_menu_wp").css("width", 160);
	}
	$(".top_sub_menu").hide();
	$("#divGnb .top_sub_menu_wp").css("left", $(obj).position().left);
	$(".top_sub_menu_wp").show();
	$("#top_sub_menu_"+depth+""+sortNum).show();
	
}

function showMenu_F(depth, sortNum, obj){
	
	if(obj.nodeName == "A" && obj.firstChild.src.indexOf("_on") == -1) {obj.firstChild.src = obj.firstChild.src.replace(".gif","_on.gif");}
	//alert($(obj).offset().top +" " + $(obj).position().left);
	if(loVal.substring(0,2) == "02" || loVal.substring(0,2) == "03"){
		var classAdd = "clears";
		$(".top_sub_menu_wp").css("width", 210);
	}else { 
		var classAdd = ""; 
		$(".top_sub_menu_wp").css("width", 158);
	}
	$(".top_sub_menu").hide();
	$("#divGnb .top_sub_menu_wp").css("left", $(obj).position().left);
	$(".top_sub_menu_wp").show();
	$("#top_sub_menu_"+depth+""+sortNum).show();
	
}

function showMenu_FO(obj){
	
	if(obj.nodeName == "A" && obj.firstChild.src.indexOf("_on") > -1) {obj.firstChild.src = obj.firstChild.src.replace("_on.gif",".gif");}
	$(".top_sub_menu_wp").hide();
}

function showMenu_FL(obj, types, num){
	if(types == "in"){
		if($(".menu_list a img").get(num).src.indexOf("_on.gif") == -1){
			$(".menu_list a img").get(num).src = $(".menu_list a img").get(num).src.replace(".gif","_on.gif");
		}
		$(".top_sub_menu_wp").show();
	}else if(types == "out"){
		if($(".menu_list a img").get(num).src.indexOf("_on.gif") > -1){
			$(".menu_list a img").get(num).src = $(".menu_list a img").get(num).src.replace("_on.gif",".gif");
		}
		$(".top_sub_menu_wp").hide();
	}
}

// #############################     컨텐츠몰 미러 사이트 하위메뉴 시작     ###########################
// #############################     컨텐츠몰 미러 사이트 하위메뉴 시작     ###########################
// #############################     컨텐츠몰 미러 사이트 하위메뉴 시작     ###########################

// GNB URL 정보 셋팅
function GNBgetData_mirror(){
	/*$("#divGnb").load("/inc/main_navi_by_promind.xml");*/
	try{
		if(loVal){
			locNumber = loVal.substring(0,2);
		}else{
			locNumber ="00";
		}
		$.ajax({
				url : "/Xhtml/ktbiz2010/main_navi_by_promind.xml", 
				type : "get",
				dataType : "xml", 
				success : function(xml) {
					$("#divGnb .menu_list").append("");
					if(locNumber == "00"){
						var $depth01 = $(xml).find("navi").find("Depth1");
						if($depth01.length > 0){
							$depth01.each(function(n, value) {	
								//$("#divGnb .menu_list").append("<a href='#' onclick=urlMove('"+$(this).attr("param")+"') ><img src='/Images/common/gnb0"+n+"0.gif' alt='"+$(this).attr("name")+"' title='' /></a>");
								/*
									제휴사이트 iframe target 문제로 인해 1Depth에 target 값을 추가
									제휴사이트 확인변수 : boolAllianceIframeMode = true;
								*/
								if (boolAllianceIframeMode){
									$("#divGnb .menu_list").append("<a href=\"javascript: urlMove('"+$(this).attr("param")+"','',true)\"><img src='/Images/common/gnb0"+n+"0.gif' alt='"+$(this).attr("name")+"' title='' /></a>");
								}
								else {
									$("#divGnb .menu_list").append("<a href=\"javascript: urlMove('"+$(this).attr("param")+"')\"><img src='/Images/common/gnb0"+n+"0.gif' alt='"+$(this).attr("name")+"' title='' /></a>");
								}
							});
						}
					}else if(locNumber == "01"){
						var $depth01 = $(xml).find("navi").find("Depth1").eq(0).find("Depth2");
						var sortNum = 0;
						if($depth01.length > 0){
							$depth01.each(function(n, value) {
								$("#divGnb .menu_list").append("<a href='#' onclick=showMenu_mirror('"+sortNum+"',"+n+",this) ><img src='/Images/common/gnb00"+(parseInt(n)+1)+".gif' alt='"+$(this).attr("name")+"' title='' /></a>");
							});
						}
					}else if(locNumber == "02"){
						var $depth01 = $(xml).find("navi").find("Depth1").eq(1).find("Depth2");
						var sortNum = 1;
							if($depth01.length > 0){
							$depth01.each(function(n, value) {
								$("#divGnb .menu_list").append("<a href='#' onclick=showMenu_mirror('"+sortNum+"',"+n+",this) ><img src='/Images/common/gnb01"+(parseInt(n)+1)+".gif' alt='"+$(this).attr("name")+"' title='' /></a>");
							});
						}
					}else if(locNumber == "03"){
						
						var $depth01 = $(xml).find("navi").find("Depth1").eq(2).find("Depth2");
						var sortNum = 2;
						if($depth01.length > 0){
							$depth01.each(function(n, value) {
								$("#divGnb .menu_list").append("<a href='#' onclick=showMenu_mirror('"+sortNum+"',"+n+",this) ><img src='/Images/common/gnb02"+(parseInt(n)+1)+".gif' alt='"+$(this).attr("name")+"' title='' /></a>");
							});
						}
					}
				},
				error : function(xhr, ajaxOptions, thrownError) {
					//alert("Error Code : "+xhr.status); 
					//alert(thrownError); 
				}
		});
	}catch(e) {}
	
}



function showMenu_mirror(depth, sortNum, obj){
	$("#frLayer").attr("height",0);
	if(($(".top_sub_menu_wp").css("display") == "inline" || $(".top_sub_menu_wp").css("display") == "block") && obj.firstChild.src.indexOf("_on.gif") != -1) {$(".top_sub_menu_wp").hide(); obj.firstChild.src = obj.firstChild.src.replace("_on.gif",".gif"); return false;}
	$(".menu_list a img").each(function(n){
		$(this).attr("src", this.src.replace("_on.gif",".gif"));
	});
	if(obj.nodeName == "A") {obj.firstChild.src = obj.firstChild.src.replace(".gif","_on.gif");}
	//alert($(obj).offset().top +" " + $(obj).position().left);
	if(loVal.substring(0,2) == "02" || loVal.substring(0,2) == "03"){
		var classAdd = "clears";
		$(".top_sub_menu_wp").css("width", 210);
	}else { 
		var classAdd = ""; 
		$(".top_sub_menu_wp").css("width", 160);
	}
	$.ajax({
			url : "/Xhtml/ktbiz2010/main_navi_by_promind.xml", 
			type : "get",
			dataType : "xml", 
			success : function(xml) {
				$("#divGnb .top_sub_menu ul").remove();
				var $depth_list = $(xml).find("navi").find("Depth1").eq(depth).find("Depth2").eq(sortNum).find("Depth3");
				if($depth_list.length == 1) {$(".top_sub_menu_wp").css("width", 210);}
				if($depth_list.length > 0){
					for(var i = 0; i < $depth_list.length ; i++){
						
						var dep3_param =$depth_list.eq(i).attr("param");//미러사이트 전용 3depth URL

						$("#divGnb .top_sub_menu").append("<ul class='dep03 "+classAdd+"' id='dep03"+i+"'><li class='dep03' onclick=urlMove('"+dep3_param.toLowerCase().replace('contentsmall','contentsmall_m')+"',this)><h4 onmouseover='bgChangeIn(4, this)' onmouseout='bgChangeOut(4,this)' ><img src='/Images/common/h4_"+depth+"_"+sortNum+"_"+i+".png' class='png24' alt='"+$depth_list.eq(i).attr("name")+"' /></h4></li></u>");
						if(loVal.substring(0,2) == "01"){
							var $depth_list_4 = $depth_list.eq(i).find("Depth4");
							for(var k = 0; k < $depth_list_4.length ; k++){
								var $depth_list_5 = $depth_list_4.eq(k).find("Depth5");
								var addStr = "";
								if($depth_list_5.length > 0) {addStr = "<img class='h5_blt00' src='/Images/common/blt_open.gif' alt='' />";}
								$("#divGnb .top_sub_menu ul#dep03"+i+" li.dep03").append("<ul class='dep04' id='dep04"+k+"'><li class='dep04' onclick=urlMove('"+$depth_list_4.eq(k).attr("param")+"',this)><h5 onmouseover='bgChangeIn(5, this)' onmouseout='bgChangeOut(5, this)' ><img src='/Images/common/h5_"+depth+"_"+sortNum+"_"+i+"_"+k+".png' class='png24' alt='"+$depth_list_4.eq(k).attr("name")+"' /> "+addStr+"</h5></li></u>");
								
								for(var m = 0; m < $depth_list_5.length ; m++){
									$("#divGnb .top_sub_menu ul#dep03"+i+" li.dep03 ul#dep04"+k+" li.dep04").append("<ul class='dep05'><li class='dep05' onclick=urlMove('"+$depth_list_5.eq(m).attr("param")+"',this)><h6 onmouseover='bgChangeIn(6, this)' onmouseout='bgChangeOut(6, this)' ><img src='/Images/common/h6_"+depth+"_"+sortNum+"_"+i+"_"+k+"_"+m+".png' class='png24' alt='"+$depth_list_5.eq(m).attr("name")+"' /></h6></li></u>");
								}
							}
						}
					}
				}
				$("#divGnb .top_sub_menu_wp").hide();
				//$("#divGnb .top_sub_menu").css("top", $(obj).offset().top);
				$("#divGnb .top_sub_menu_wp").css("left", $(obj).position().left);
				$("#divGnb .top_sub_menu_wp").slideDown(800);
				$("#frLayer").attr("height",parseInt($("#top_sub_menu").css("height"))+3);
				//alert(parseInt($("#top_sub_menu").css("height")));
				
			},
			error : function(xhr, ajaxOptions, thrownError) {
				//alert("Error Code : "+xhr.status); 
				//alert(thrownError); 
			}
	});
}
//####################################  컨텐츠몰 미러 사이트   끝    ######################
//####################################  컨텐츠몰 미러 사이트   끝    ######################
//####################################  컨텐츠몰 미러 사이트   끝    ######################


// 메뉴 상단 탭 관련 함수

function tabActs() {
	$(".site_kind ul li img").mouseover(function() {
		if($(this).attr("alt") == "홈/개인"){
			$("#topRedBar").animate({left:0}, 200, function() {});
		}else if($(this).attr("alt") == "개인사업자"){
			$("#topRedBar").animate({left:67}, 200, function() {});
		}else if($(this).attr("alt") == "기업"){
			$("#topRedBar").animate({left:134}, 200, function() {});
		}
		$(this).attr("src",this.src.replace(".gif","_on.gif"));
	});
	$(".site_kind ul li img").mouseout(function() {
		$(this).attr("src",this.src.replace("_on.gif",".gif"));
	});
}

// 검색 종류 선택 함수

function selectKind() {
	$(".search_kind").click(function() {
		$(".search_kind_li").slideToggle();
	});
	if(document.getElementById("search_kind_li")){
		var nodes = document.getElementById("search_kind_li").getElementsByTagName("li");
		for(var i=0; i < nodes.length; i++){
			nodes[i].onclick = function() {
				document.getElementById("search_kind").firstChild.nodeValue = this.firstChild.nodeValue;
				ClearTxt(this.firstChild.nodeValue);
			};
			
		}
	}
}

function ClearTxt(ClearVal){
	var IntNode = $("#search_kind_li").find("li").length;
	$("#search_kind_li").find("li").attr("style","display:block")
	for(var z=0; z < IntNode; z++){
		var findOBJ = $("#search_kind_li").find("li").eq(z);
		if (findOBJ.text() == ClearVal)
		{
			findOBJ.attr("style","display:none");
		}
	}
	
}
// 메뉴 배경 변경

function bgChangeIn(nums, obj){
	if($.browser.version.substring(0, 1) != "6" && $.browser.version.substring(0, 1) != "7"){
		if(nums == 5){
			obj.style.background = "#3d3d3d";
		}else if(nums == 6){
			obj.style.background = "#3d3d3d";
		}else if(nums == 4){
			obj.style.background = "#3d3d3d";
		}
	}
}

function bgChangeOut( nums, obj){
	if($.browser.version.substring(0, 1) != "6" && $.browser.version.substring(0, 1) != "7"){
		if(nums == 5){
			obj.style.backgroundColor = "#767676";
			obj.style.backgroundImage = "url(/Images/common/bg_gnb_h5.gif)";
			obj.style.backgroundPosition = "8px 8px";
			obj.style.backgroundRepeat = "no-repeat";

		}else if(nums == 6){
			obj.style.backgroundColor = "#767676";
			obj.style.backgroundImage = "url(/Images/common/bg_gnb_h6.gif)";
			obj.style.backgroundPosition = "12px 9px";
			obj.style.backgroundRepeat = "no-repeat";
		}else if(nums == 4){
			obj.style.backgroundColor = "#767676";
		}
	}
}

// PNG 처리
function setPng24(obj) {
	obj.width=obj.height=1;
	obj.className=obj.className.replace(/\bpng24\b/i,'');
	obj.style.filter =
	"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
	obj.src=''; 
	return '';
}

// 로케이션 생성 함수

function locMake() {
	try{
	if(loVal == "00" || loVal == "01" || loVal == "02" || loVal == "03") {
		$(".location_info").hide();
		$("#header").css("height",139);
	}
	}catch(e) {}
}

// 비지 초기화

function bizInit(){
	
	$(".biz_steps img").remove();
	$(".biz_steps01").hide();
	$(".biz_result").hide();
	$(".biz_steps01_wp").css("left",0);
	$(".biz_steps").show();
}

// 비지서치 함수

function openBizsearch(num, ud) {
	if(ud == 1){
		$("#biz_search_wrap").css("top",180);
	}
	$(".biz_result").hide();
	$("#biz_search_wrap").show();
	$("#biz_search_wrap").animate({width:980}, 1000, function() {
		$("#biz_search_wrap").animate({height:388}, 1000 , function() {
			$("#biz_search_inner").fadeIn(1000, function() {
				$("#biz_search_fr").show();
			});
		});
	});
	$("#biz_steps01_ul li").remove();
	$("#biz_steps02_ul li").remove();
	$(".biz_steps01_l img").remove();
	$("#biz_result_ul li").remove();
	$(".biz_steps01_wp").css("left",0);
	$(".biz_steps").show();
	if(num == 1) {
		$(".biz_tit img").attr("src", "/Images/main/img_case.gif");
		$(".biz_search_menu ul li img").eq(0).attr("src", "/Images/main/img_biz00_on.gif");
		$(".biz_search_menu ul li img").eq(1).attr("src", "/Images/main/img_biz01.gif");
		$(".biz_search_menu ul li img").eq(2).attr("src", "/Images/main/img_biz02.gif");
		$(".biz_steps img").remove();
		$(".biz_steps").append("<img src='/Images/main/img_sosa.gif' class='lmags' onclick='bizShows(0, 1)' alt='' /><img src='/Images/main/img_it.gif' alt=''  onclick='bizShows(1, 1)' />");
	}else if(num == 2){
		$(".biz_tit img").attr("src", "/Images/main/img_work.gif");
		$(".biz_search_menu ul li img").eq(0).attr("src", "/Images/main/img_biz00.gif");
		$(".biz_search_menu ul li img").eq(1).attr("src", "/Images/main/img_biz01_on.gif");
		$(".biz_search_menu ul li img").eq(2).attr("src", "/Images/main/img_biz02.gif");
		$(".biz_steps img").remove();
		$(".biz_steps").append("<img src='/Images/main/work01.gif' class='imgwork' onclick='bizShows(0, 2)' alt='' /><img src='/Images/main/work02.gif' class='imgwork' onclick='bizShows(1, 2)' alt='' /><img src='/Images/main/work03.gif' class='imgwork' onclick='bizShows(2, 2)' alt='' /><img src='/Images/main/work04.gif' class='imgwork' onclick='bizShows(3, 2)' alt='' /><img src='/Images/main/work05.gif' class='imgwork' onclick='bizShows(4, 2)' alt='' /><img src='/Images/main/work06.gif' class='imgwork' onclick='bizShows(5, 2)' alt='' />");
	}else if(num == 3){
		$(".biz_tit img").attr("src", "/Images/main/img_service.gif");
		$(".biz_search_menu ul li img").eq(0).attr("src", "/Images/main/img_biz00.gif");
		$(".biz_search_menu ul li img").eq(1).attr("src", "/Images/main/img_biz01.gif");
		$(".biz_search_menu ul li img").eq(2).attr("src", "/Images/main/img_biz02_on.gif");
		$(".biz_steps img").remove();
		$(".biz_steps").append("<img src='/Images/main/service01.gif' class='lmagsvs' onclick='bizShows(0, 3)' alt='' /><img src='/Images/main/service02.gif' alt='' class='lmagsvs' onclick='bizShows(1, 3)' /><img src='/Images/main/service03.gif' alt='' class='lmagsvs' onclick='bizShows(3, 3)' /><img src='/Images/main/service04.gif' alt='' class='lmagsvs' onclick='bizShows(2, 3)' />");
	}
}

function bizClose() {
	$("#biz_search_fr").hide();
	$("#biz_search_wrap").fadeOut(500, function() {
		bizInit();
		$("#biz_search_wrap").css("height", 20);
		$("#biz_search_wrap").css("width", 0);
	});
}

// 비지서치 슬라이드 효과

function bizSlide(locNumber, n, m, shType) {
	var tagStr;
	$("#biz_steps02_ul li").remove();
	BizgetData(locNumber, n, m, shType);
	$(".biz_steps01_wp").animate({left:-337}, 800);
	
}

function bizShows(num, shType) {
	var kinds;
	if(num == 0){
		kinds = "sosali0";
		//$("#sosaimg").attr("src","/Images/main/sosa01_on.gif"); 
		//$("#itimg").attr("src","/Images/main/it01.gif"); 
	}else if(num == 1) {
		kinds = "itli0";
		//$("#sosaimg").attr("src","/Images/main/sosa01.gif");
		//$("#itimg").attr("src","/Images/main/it01_on.gif"); 
	}
	$("#biz_steps01_ul li").remove();
	BizgetData(num, -1, -2, shType);
	$(".biz_steps").fadeOut(100, function() {
		$(".biz_steps01_wp").show();
		$(".biz_steps01").fadeIn(800);
	});
}

function bizSearchResult(locNumber, n, m, shType) {
	BizgetData(locNumber, n, m, shType);
	$(".biz_steps01_wp").fadeOut(100, function() {
		$(".biz_result").fadeIn(800);
	});
}

function BizgetData(locNumber, n, m, shType){
	/*$("#divGnb").load("/inc/main_navi_by_promind.xml");*/
	var urlPath;
	if(shType == 1) {
		urlPath = "/xhtml/ktbiz2010/product0.xml";
	}else if(shType == 2) {
		urlPath = "/xhtml/ktbiz2010/product1.xml";
	}else if(shType == 3) {
		urlPath = "/xhtml/ktbiz2010/product2.xml";
	}
	$.ajax({
			url : urlPath, 
			type : "get",
			dataType : "xml", 
			success : function(xml) {
				if(shType == 1){
					if(n == -1){
						var $depth01 = $(xml).find("selectF");
						if($depth01.length > 0){
							var $txtList = $depth01.eq(locNumber).find("selectS");
							$txtList.each(function(n, value) {
								tagStr = "<li onclick='bizSlide("+locNumber+", "+n+", -1, "+shType+")'><span>"+$txtList.eq(n).attr("name").substring(0,24)+"</span></li>";
								$("#biz_steps01_ul").append(tagStr);
							});
						}
						$(".biz_steps01_l img").remove();
						$(".biz_steps01_l").append("<img src='/Images/main/sosa01.gif' id='sosaimg' onclick='bizShows(0, 1)' alt='' /><img src='/Images/main/it01.gif' id='itimg' onclick='bizShows(1, 1)' alt='' />");
					}
					if(m == -1){
						var $depth01 = $(xml).find("selectF").eq(locNumber).find("selectS");
						if($depth01.length > 0){
							var $txtList = $depth01.eq(n).find("selectT");
							$txtList.each(function(m, value) {
								tagStr = "<li onclick='bizSearchResult("+locNumber+", "+n+", "+m+", "+shType+")'><span>"+$txtList.eq(m).attr("name").substring(0,24)+"</span></li>";
								$("#biz_steps02_ul").append(tagStr);
							});
						}
					}
					if(m >= 0){
						var $depth01 = $(xml).find("selectF").eq(locNumber).find("selectS").eq(n).find("selectT");
						if($depth01.length > 0){
							var $txtList = $depth01.eq(m).find("image");
							$txtList.each(function(k, value) {
								if(k == 5) {return false;}
								var strRes = $txtList.eq(k).attr("content");
								if($txtList.eq(k).attr("content").length >= 50){
									strRes = $txtList.eq(k).attr("content").substring(0,50)+"...";
								}
								tagStr = "<li class='tities' onclick='viewComment(this)' ><span class='tities'>"+$txtList.eq(k).attr("name")+"</span></li><li class='conts'><span class='conts'><a href='"+$txtList.eq(k).attr("param")+"'>"+strRes+"</a></span></li>";
								$("#biz_result_ul").append(tagStr);
							});
						}
					}
				}
				if(shType == 2) {
					if(n == -1){
						var $depth01 = $(xml).find("selectF");
						if($depth01.length > 0){
							var $txtList = $depth01.eq(locNumber).find("selectS");
							$txtList.each(function(n, value) {
								tagStr = "<li onclick='bizSearchResult("+locNumber+", "+n+", -1, "+shType+")'><span>"+$txtList.eq(n).attr("name").substring(0,24)+"</span></li>";
								$("#biz_steps01_ul").append(tagStr);
							});
						}
						$(".biz_steps01_l img").remove();
						$(".biz_steps01_l").append("<img src='/Images/main/works01.gif' class='worksimg' alt='' onclick='bizShows(0, 2)' /><img src='/Images/main/works02.gif' class='worksimg' alt='' onclick='bizShows(1, 2)' /><img src='/Images/main/works03.gif' class='worksimg' alt='' onclick='bizShows(2, 2)' /><img src='/Images/main/works04.gif' class='worksimg' alt='' onclick='bizShows(3, 2)' /><img src='/Images/main/works05.gif' class='worksimg' alt='' onclick='bizShows(4, 2)' /><img src='/Images/main/works06.gif' class='worksimg' alt='' onclick='bizShows(5, 2)' />");
					}
					if(m == -1){
						var $depth01 = $(xml).find("selectF").eq(locNumber).find("selectS");
						if($depth01.length > 0){
							var $txtList = $depth01.eq(n).find("image");
							$txtList.each(function(k, value) {
								if(k == 5) {return false;}
								var strRes = $txtList.eq(k).attr("content");
								if($txtList.eq(k).attr("content").length >= 50){
									strRes = $txtList.eq(k).attr("content").substring(0,50)+"...";
								}
								tagStr = "<li class='tities' onclick='viewComment(this)' ><span class='tities'>"+$txtList.eq(k).attr("name")+"</span></li><li class='conts'><span class='conts'><a href='"+$txtList.eq(k).attr("param")+"'>"+strRes+"</a></span></li>";
								$("#biz_result_ul").append(tagStr);
							});
						}
					}
				}
				if(shType == 3){
					if(n == -1){
						var $depth01 = $(xml).find("selectF");
						if($depth01.length > 0){
							var $txtList = $depth01.eq(locNumber).find("selectS");
							$txtList.each(function(n, value) {
								tagStr = "<li onclick='bizSearchResult("+locNumber+", "+n+", -1, "+shType+")'><span>"+$txtList.eq(n).attr("name").substring(0,24)+"</span></li>";
								$("#biz_steps01_ul").append(tagStr);
							});
						}
						$(".biz_steps01_l img").remove();
						$(".biz_steps01_l").append("<img src='/Images/main/services01.gif' class='svcimg' alt='' onclick='bizShows(0, 3)' /><img src='/Images/main/services02.gif' class='svcimg' alt='' onclick='bizShows(1, 3)' /><img src='/Images/main/services03.gif' class='svcimg' alt='' onclick='bizShows(2, 3)' /><img src='/Images/main/services04.gif' class='svcimg' alt='' onclick='bizShows(3, 3)' />");
					}
					if(m == -1){
						var $depth01 = $(xml).find("selectF").eq(locNumber).find("selectS");
						if($depth01.length > 0){
							var $txtList = $depth01.eq(n).find("image");
							$txtList.each(function(k, value) {
								if(k == 5) {return false;}
								var strRes = $txtList.eq(k).attr("content");
								if($txtList.eq(k).attr("content").length >= 50){
									strRes = $txtList.eq(k).attr("content").substring(0,50)+"...";
								}
								tagStr = "<li class='tities' onclick='viewComment(this)' ><span class='tities'>"+$txtList.eq(k).attr("name")+"</span></li><li class='conts'><span class='conts'><a href='"+$txtList.eq(k).attr("param")+"'>"+strRes+"</a></span></li>";
								$("#biz_result_ul").append(tagStr);
							});
						}
					}
				}
				
			},
			error : function(xhr, ajaxOptions, thrownError) {
				//alert("Error Code : "+xhr.status); 
			}
	});
	
}

// 비지 서치 결과 액션 함수

function viewComment(obj){
	if($(obj).next().css("display") == "block"){
		$(obj).css("backgroundColor","#202020").css("backgroundImage","url(/images/common/open00.gif)").css("backgroundRepeat","no-repeat");
		$(obj).next().css("display","none");
	}else{
		$(obj).css("backgroundColor","#f81e1c").siblings("li.tities").css("backgroundColor","#202020").css("backgroundImage","url(/images/common/open00.gif)").css("backgroundRepeat","no-repeat");
		$(obj).css("backgroundImage","url(/images/common/close00.gif)");
		$(obj).css("backgroundRepeat","no-repeat");
		$(obj).css("backgroundPosition","545px 14px");
		$(obj).siblings("li.conts").css("display","none");
		$(obj).next().css("display","block");
	}
	
}

// 추천 상품 함수
currentIndex = 1;
function recomandAction() {
	
	$("#roll_list div").remove();
	var urlPath = "/xhtml/ktbiz2010/main_rcmdProducts.xml";
	$.ajax({
			url : urlPath, 
			type : "get",
			dataType : "xml", 
			success : function(xml) {
				var $depth01 = $(xml).find("depth0").eq(0).find("image");
				if($depth01.length > 0){
					$depth01.each(function(n, value) {
						if($depth01.eq(n).attr("content").length >= 37){
							var strTxt = $depth01.eq(n).attr("content").substring(0,37) + "...";
						}else{
							var strTxt = $depth01.eq(n).attr("content").substring(0,40);
						}
						$("#roll_list").append("<div class='items reco"+$depth01.eq(n).attr("num")+"'><div class='items_name'><a href='"+$depth01.eq(n).attr("param")+"' target='_blank'>"+$depth01.eq(n).attr("name")+"</a></div><div class='items_conts'><a href='"+$depth01.eq(n).attr("param")+"' target='_blank'>"+strTxt+"</a></div><d/iv>");
					});
				}
				var imgWidth = 160;
				var maxWidth = $depth01.length*imgWidth;
				
				$("#list_recom_roll").css("width", maxWidth);
				$(".recomand_goods").fadeIn(1000);
				$("#rec_prev").click(function() {
					recomNextview($depth01.length, imgWidth);
				});
				$("#rec_next").click(function() {
					recomPreview($depth01.length, imgWidth);
				});
			},
			error : function(xhr, ajaxOptions, thrownError) {
				//alert("Error Code : "+xhr.status); 
			}
	});
}

function recomPreview(tsize, imgWidth) {
	
	$("#rec_next").unbind("click");
	if(currentIndex >= 1 && currentIndex < 5){
		
		$("#list_recom_roll").animate({left:$("#list_recom_roll").position().left-imgWidth}, 500, function() {
			currentIndex = currentIndex + 1;
			$("#rec_next").bind("click", function() {recomPreview(tsize, imgWidth);});
		});
	}else{
			$("#rec_next").bind("click", function() {recomPreview(tsize, imgWidth);});
	}
}

function recomNextview(tsize, imgWidth) {
	
	$("#rec_prev").unbind("click");
	if(currentIndex > 1){
		$("#list_recom_roll").animate({left:$("#list_recom_roll").position().left+imgWidth}, 500, function() {
			currentIndex = currentIndex - 1;
			$("#rec_prev").bind("click", function() {recomNextview(tsize, imgWidth);});
		});
	}else{
			$("#rec_prev").bind("click", function() {recomNextview(tsize, imgWidth);});
	}
}

function recomClose(obj){
	currentIndex = 1;
	$("#rec_prev").unbind("click");
	$("#rec_next").unbind("click");
	$("#list_recom_roll").css("left",0);
	$("#roll_list div").remove();
	$(obj.parentNode).hide();
}

function openfixeds (){
	$(".fixed_goods").fadeIn(1000);
}

function goMoveTs(urls){
	location.href = urls;
}

