// 페이지 코드를 변형
function code_change(code) {
	if(!code) return false;
	for ( var i=0; i<menuCode.length; i++ ) {
		if ( code == menuCode[i][0] ) {
			return menuCode[i][1];
		}
	}
}

// defualt_script.js는 전영역 모든페이지에 쓰이는 파일이므로 페이지코드가 있는 페이지에서만 코드변형이 나타난다
if(typeof(pagecode) != 'undefined') pagenum = code_change(pagecode);

// breadcrumbs 나타내기
function show_path(code) {
	document.write("<div id='txtLocation'>&nbsp;<span id='home'><a href='"+menu[0][2]+"'>"+menu[0][1]+"</a></span>");
	var depth1 = code.substring(0,2);
	for(j=0;j<code.length;j=j+2) {
		parseCode = code.substring(0,j+2);
  
		for(i=0;i<=menu.length-1;i++) {
			
			if(parseCode.length == code.length && menu[i][0] == parseCode) {
				document.write("&nbsp;<img src='/kor/images/common/icon/nav_arr.gif' alt=''>&nbsp;<span class='historySelect"+depth1+"'>"+menu[i][1]+"</span>");
			}
  
			else if(menu[i][0] == parseCode) {
				document.write("&nbsp;<img src='/kor/images/common/icon/nav_arr.gif' alt=''>&nbsp;<a href='"+menu[i][2]+"'>"+menu[i][1]+"</a>");
			}
		}
	}
	document.write("</div>");
}

// top메뉴변경
function change_top_menu(val,btn_total) {
	//alert(val + ' ' + btn_total);
	for ( var i=0; i < btn_total; i++ ) {
		obj3DepthBtn = document.getElementById("TopMenu_3Depth_Btn_" + i);
		obj4Depth = document.getElementById("TopMenu_4Depth_"+i);
		if ( i ==  val ) {
			if ( obj3DepthBtn.src.indexOf("_on.gif") == -1 ) {
				obj3DepthBtn.src = obj3DepthBtn.src.replace("_off.gif", "_on.gif");
				obj4Depth.style.display = "block";
			}
		} else {
			if ( obj3DepthBtn.src.indexOf("_on.gif") != -1 ) {
				obj3DepthBtn.src = obj3DepthBtn.src.replace("_on.gif", "_off.gif");
				obj4Depth.style.display = "none";
			}
		}
	}
}

// top menu a 태그에 이벤트 등록
function show_top_menu(val, btn_total){
	var depth3 = document.getElementById('TopMenu_3Depth');
	var depth3_menu = depth3.getElementsByTagName('li');
	var menu_num = 0;
	for(var i = 0;i<depth3_menu.length;i++){
		if(depth3_menu[i].parentNode == depth3){
			//alert(depth3_menu[i].getElementsByTagName('a')[0]);
			//alert(menu_num);
			depth3_menu[i].getElementsByTagName('a')[0].menu_num = menu_num;

			depth3_menu[i].getElementsByTagName('a')[0].onfocus = function(){
				change_top_menu(this.menu_num, btn_total);
			}

			depth3_menu[i].getElementsByTagName('a')[0].onmouseover = function(){
				//alert(menu_num);
				change_top_menu(this.menu_num, btn_total);
			}
			menu_num++;
		}
	}
	change_top_menu(val, btn_total);
}

/**
 * 2008-10-23 투자유치센터 용으로 수정
 * 좌측메뉴 생성
 */
function show_menu(code) {
	var menu_code;
	var array_depth_3 = new Array();
	var array_depth_4 = new Array();
	var array_depth_5 = new Array();
	var array_depth_6 = new Array();
	var count_3 = 0; var count_4 = 0; var count_5 = 0; var count_6 = 0;
	var depth_3 = 0; var depth_4 = 0; var depth_5 = 0; var depth_6 = 0;
	var display_3 = 0; var display_4 = 0; var display_5 = 0; var display_6 = 0;
	var menu_total = menu.length;
	var current_menu = code.substring(0,4);
	
	var objBox = document.getElementById("Left_Menu_Box");
	
	for ( var i=0; i<menu_total; i++ ) {
		menu_code = menu[i][0];
		if ( current_menu == menu[i][0] ) {
			var current_menu_alt = menu[i][1];
		}
		if ( current_menu == menu_code.substring(0,4) ) {
			if ( menu_code.length == 6 ) {
				array_depth_3[count_3] = new Array(menu_code,menu[i][1],menu[i][2],menu[i][3],"off");
				count_3++; depth_3++;
				depth_4 = 0;
			} else if ( menu_code.length == 8 ) {
				array_depth_4[count_4] = new Array(menu_code,menu[i][1],menu[i][2],menu[i][3],"off",depth_3-1);
				count_4++; depth_4++;
				depth_5 = 0;
			} else if ( menu_code.length == 10 ) {
				array_depth_5[count_5] = new Array(menu_code,menu[i][1],menu[i][2],menu[i][3],"off",depth_3-1,depth_4-1);
				count_5++; depth_5++;
				depth_6 = 0;
			} else if ( menu_code.length == 12 ) {
				array_depth_6[count_6] = new Array(menu_code,menu[i][1],menu[i][2],menu[i][3],"off",depth_3-1,depth_4-1,depth_5-1);
				count_6++;
			}
		}
	}

	depth_3 = 0;
	for ( var i=0; i<array_depth_3.length; i++ ) {
		depth_4 = 0;
		for ( var j=0; j<array_depth_4.length; j++ ) { 
			if ( array_depth_4[j][5] == depth_3 ) {
				array_depth_3[i][4] = "on";
				depth_5 = 0;
				for ( var k=0; k<array_depth_5.length; k++ ) {
					if ( array_depth_5[k][5] == depth_3 && array_depth_5[k][6] == depth_4 ) {
						array_depth_4[j][4] = "on";
						for ( var l=0; l<array_depth_6.length; l++ ) {
							if ( array_depth_6[l][5] == depth_3 && array_depth_6[l][6] == depth_4 && array_depth_6[l][7] == depth_5 ) {
								array_depth_5[k][4] = "on";
							}
						}
						depth_5++;
					}
				}
				depth_4++;
			}
		}
		depth_3++;
	}
	
	var objLeftH2 = document.createElement("h2");
	objBox.appendChild(objLeftH2);
	var objLeftH2Img = document.createElement("img");
	objLeftH2Img.src = "/kor/images/left/" + current_menu + ".gif";
	objLeftH2Img.alt = current_menu_alt;
	objLeftH2.appendChild(objLeftH2Img);
	var objLeftSubDiv = document.createElement("div");
	objLeftSubDiv.id = "Left_Menu_Box_Sub";
	if ( !array_depth_3.length ) {
		objLeftSubDiv.style.background = "none";
		document.getElementById("Left_Menu_Box").style.background = "none";
	}
	objBox.appendChild(objLeftSubDiv);
	
	depth_3 = 0;
	for ( var i=0; i<array_depth_3.length; i++ ) {
		// 3뎁스 출력
		
		objLeft3DepthDl = document.createElement("dl");
		objLeftSubDiv.appendChild(objLeft3DepthDl);
		
		objLeft3DepthDt = document.createElement("dt");
		if ( i == 0 ) {
			objLeft3DepthDl.className = "first";
		}
		if ( array_depth_3[i][4] == "on" ) {
			objLeft3DepthDt.innerHTML = "<a href=\"javascript:display_menu(\'Depth3_" + depth_3 + "\','" + array_depth_3[i][2] + "');\">" + array_depth_3[i][1] +"</a>";
			objLeft3DepthDt.className = "step1";
		} else if ( array_depth_3[i][4] == "off" ) {
			if ( array_depth_3[i][3] == 1 ) {
				objLeft3DepthDt.innerHTML = "<a href=" + array_depth_3[i][2] + " target='_blank'>" + array_depth_3[i][1] + "</a>";
			} else {
				objLeft3DepthDt.innerHTML = "<a href=" + array_depth_3[i][2] + ">" + array_depth_3[i][1] + "</a>";
			}
		}
		if ( code.length == 6 && array_depth_3[i][0].substring(0,6) == code.substring(0,6) ) {
			objLeft3DepthDt.getElementsByTagName("a")[0].className = "current";
		}
		objLeft3DepthDl.appendChild(objLeft3DepthDt);
		
		objLeft3DepthDd = document.createElement("dd");
		objLeft3DepthDd.id = "Depth3_" + depth_3;
		objLeft3DepthDl.appendChild(objLeft3DepthDd);
		
		if ( code.length > 4 ) {
			if ( array_depth_3[i][0].substring(0,6) == code.substring(0,6) && array_depth_3[i][4] == "on" ) {
				objLeft3DepthDt.className = "step2";
				objLeft3DepthDd.style.display = "block";
			}
		}
		
		if ( array_depth_3[i][4] == "on" ) {
			depth_4 = 0;
			for ( var j=0; j<array_depth_4.length; j++ ) {
				if ( array_depth_3[i][4] == "on" && array_depth_4[j][5] == depth_3 ) {
					// 4뎁스 출력
					
					objLeft4DepthDl = document.createElement("dl");
					objLeft3DepthDd.appendChild(objLeft4DepthDl);
					objLeft4DepthDt = document.createElement("dt");
					
					if ( array_depth_4[j][4] == "on" ) {
						objLeft4DepthDt.innerHTML = "<a href=\"javascript:display_menu(\'Depth4_" + depth_3 + depth_4 + "\','" + array_depth_4[j][2] + "');\">" + array_depth_4[j][1] +"</a>";
						objLeft4DepthDt.className = "step1 current";
					} else if ( array_depth_4[j][4] == "off" ) {
						if ( array_depth_4[j][3] == 1 ) {
							objLeft4DepthDt.innerHTML = "<a href=" + array_depth_4[j][2] + " target='_blank'>" + array_depth_4[j][1] + "</a>";
						} else {
							objLeft4DepthDt.innerHTML = "<a href=" + array_depth_4[j][2] + ">" + array_depth_4[j][1] + "</a>";
						}
					}
					objLeft4DepthDl.appendChild(objLeft4DepthDt);

					objLeft4DepthDd = document.createElement("dd");
					objLeft4DepthDd.id = "Depth4_"+ depth_3 + depth_4;
					objLeft4DepthDl.appendChild(objLeft4DepthDd);
					
					if ( code.length > 6 ) {
						if ( array_depth_4[j][0].substring(0,8) == code.substring(0,8) ) {
							if ( array_depth_4[j][4] == "on" && array_depth_4[j][0].substring(0,6) == code.substring(0,6) ) {
								objLeft4DepthDd.style.display = "block";
								objLeft4DepthDt.className = "step2";
							}
							if ( code.length == 8 && array_depth_4[j][0].substring(0,8) == code.substring(0,8) ) {
								objLeft4DepthDt.getElementsByTagName("a")[0].className = "current";
							}
						}
					}
					
					if ( array_depth_4[j][4] == "on" ) {
						depth_5 = 0;
						objLeftul= document.createElement("ul");
						objLeft4DepthDd.appendChild(objLeftul);
						for ( var k=0; k<array_depth_5.length; k++ ) {
							if ( array_depth_4[j][4] == "on" && array_depth_5[k][5] == depth_3 && array_depth_5[k][6] == depth_4 ) {
								// 5뎁스 출력
								
								objLeftli = document.createElement("li");
								if ( array_depth_5[k][3] == 1 ) {
									objLeftli.innerHTML = "<a href=" + array_depth_5[k][2] + " target='_blank'>" + array_depth_5[k][1] + "</a>";
								} else {
									objLeftli.innerHTML = "<a href=" + array_depth_5[k][2] + ">" + array_depth_5[k][1] + "</a>";
								}
								objLeftul.appendChild(objLeftli);
								if ( code.length > 8 ) {
									if ( code.length == 10 && array_depth_5[k][0].substring(0,8) == code.substring(0,8) ) {
										if ( code.length == 10 && array_depth_5[k][0].substring(0,10) == code.substring(0,10) ) {
											objLeftli.getElementsByTagName("a")[0].className = "current";
										}
										document.getElementById(objLeft4DepthDd.id).parentNode.getElementsByTagName("dt")[0].className = "step2";
									}
								}
								
								if ( array_depth_5[k][4] == "on" ) {
									for ( var l=0; l<array_depth_6.length; l++ ) {
										if ( array_depth_5[k][4] == "on" && array_depth_6[l][5] == depth_3 && array_depth_6[l][6] == depth_4 && array_depth_6[l][7] == depth_5 ) {
											// 6뎁스 출력
											objLeftli = document.createElement("li");
											if ( array_depth_6[l][3] == 1 ) {
												objLeftli.innerHTML = "<a href=" + array_depth_6[l][2] + " target='_blank'>" + array_depth_6[l][1] + "</a>";
											} else {
												objLeftli.innerHTML = "<a href=" + array_depth_6[l][2] + ">" + array_depth_6[l][1] + "</a>";
											}
											objLeftli.className = "step1";
											if ( code.length > 10 ) {
												if ( array_depth_6[l][0] == code ) {
													objLeftli.getElementsByTagName("a")[0].className = "current";
													document.getElementById(objLeft4DepthDd.id).parentNode.getElementsByTagName("dt")[0].className = "step2";
												}
											}
											objLeftul.appendChild(objLeftli);
										}
									}
								}
							}
							depth_5++;
						}
					}
					depth_4++;
				}
			}
		}
		depth_3++;
	}
}

/**
 * 2008-10-23 투자유치센터 용으로 수정
 * 하위 depth열기
 */
function display_menu(val,url) {
	var objVal = document.getElementById(val);
	if ( objVal.style.display == "block" ) {
		if (url && location.href.indexOf(url) < 0) {
			location.href = url;
		} else {
			objVal.style.display = "none";
			objVal.parentNode.getElementsByTagName("dt")[0].className = "step1";
		}
	} else {
		if (url && location.href.indexOf(url) < 0) {
			location.href = url;
		} else {
			objVal.style.display = "block";
			objVal.parentNode.getElementsByTagName("dt")[0].className = "step2";
		}
	}
}

// 롤오버시 이미지 교체 // 2007.10.27 김정윤
function change_img(source, target) {
	var target_img = document.getElementById(target);
	target_img.src = source.src;
}

// 탭컨텐츠
function initTabMenu(tabContainerID, img_change) {
	img_change = (typeof(img_change) != 'undefined') ? true : false;
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i);
		else
			continue;

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.onclick = function tabMenuClick() {
			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				currentmenu.parentNode.className = currentmenu.parentNode.className.replace("current", "");
				if(currentmenu.getElementsByTagName('img')[0] && img_change) currentmenu.getElementsByTagName('img')[0].src = currentmenu.getElementsByTagName('img')[0].src.replace('_on.gif', '.gif');
			}

			this.targetEl.style.display = "block";
			this.parentNode.className += "current";
			if(this.getElementsByTagName('img')[0] && img_change) this.getElementsByTagName('img')[0].src = this.getElementsByTagName('img')[0].src.replace('.gif', '_on.gif');
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}


// 셀렉트 박스에 의한 url 이동
function visit(select){
	var url = select.options[select.selectedIndex].getAttribute('value');
	if(url) location.href = url;
}

/* 초기화 initView(ul엘리먼트의 id, 최초 보여지는 li 엘리먼트 갯수, display 값) */
function initView(el_id, view_item_count, style)
{
	var menu = document.getElementById(el_id);
	var menu_list = menu.getElementsByTagName('li');
	var menu_count = menu_list.length;
	style = (typeof(style) != 'undefined') ? style : 'block';

	for(var i=0;i<menu_count;i++){
		if(i<view_item_count) menu_list[i].style.display = style;
		else menu_list[i].style.display = 'none';
	}
}

/* 목록 이동 moveList(이동시킬방향 prev 또는 next, 이동시킬 ul 엘리먼트의 id, 보여질 목록 갯수, 이동시킬 갯수, display 값) */
function moveList(direction, el_id, view_item_count, scroll_count, style)
{
	var menu = document.getElementById(el_id);
	var menu_list = menu.getElementsByTagName('li');
	var menu_count = menu_list.length;
	var start_no = 0;

	style = (typeof(style) != 'undefined') ? style : 'block';

	// 현재 보여지고 있는 엘리먼트의 시작을 확인
	for(var i=0;i<menu_count;i++){
		if(menu_list[i].style.display == style){
			start_no = i;
			break;
		}
	}
	
	// 방향에 따른 이동
	if(direction == 'next'){
		if(menu_list[menu_count-1].style.display == style) return false;
		else{
			for(var i=0;i<menu_count;i++){
				if(i>=start_no + scroll_count && i<start_no + scroll_count + view_item_count){
					menu_list[i].style.display = style;
				}else{
					menu_list[i].style.display = 'none';
				}
			}
		}
	}else if(direction == 'prev'){
		if(menu_list[0].style.display == style) return false;
		else{
			for(var i=0;i<menu_count;i++){
				if(i>=start_no - scroll_count && i<start_no - scroll_count + view_item_count){
					menu_list[i].style.display = style;
				}else{
					menu_list[i].style.display = 'none';
				}
			}
		}
	}
}

	var slide_tid;
	var slide_tid2;
/* 목록 이동 slideList(이동시킬방향 prev 또는 next, 이동시킬 ul 엘리먼트의 id, 보여질 목록 갯수, 이동시킬 갯수, 시간 간격, display 값) */
function slideList(direction, el_id, view_item_count, scroll_count, time_interval, style)
{
	var menu = document.getElementById(el_id);
	var menu_list = menu.getElementsByTagName('li');
	var menu_count = menu_list.length;
	var start_no = 0;

	style = (typeof(style) != 'undefined') ? style : 'block';

	// 현재 보여지고 있는 엘리먼트의 시작을 확인
	for(var i=0;i<menu_count;i++){
		if(menu_list[i].style.display == style){
			start_no = i;
			break;
		}
	}

	if(start_no == menu_count-1) start_no = -1;
	
	
	// 방향에 따른 이동
	if(direction == 'next'){
//		if(menu_list[menu_count-1].style.display == style) return false;
//		else{
			for(var i=0;i<menu_count;i++){
				if(i>=start_no + scroll_count && i<start_no + scroll_count + view_item_count){
					menu_list[i].style.display = style;
				}else{
					menu_list[i].style.display = 'none';
					clearTimeout(slide_tid);				
				}
			}
//		}
	}else if(direction == 'prev'){
//		if(menu_list[0].style.display == style) return false;
//		else{
			for(var i=0;i<menu_count;i++){
				if(i>=start_no - scroll_count && i<start_no - scroll_count + view_item_count){
					menu_list[i].style.display = style;
				}else{
					menu_list[i].style.display = 'none';
					clearTimeout(slide_tid);
				}
			}
//		}
	}
	slide_tid = setTimeout("slideList('"+direction+"','"+el_id+"',"+view_item_count+","+scroll_count+", "+time_interval+")",time_interval);

}

/* 초기화 slideInitView(ul엘리먼트의 id, 최초 보여지는 li 엘리먼트 갯수, 시간 간격, display 값) */
function slideInitView(el_id, view_item_count, time_interval, slide_tid, style)
{
	var menu = document.getElementById(el_id);
	var menu_list = menu.getElementsByTagName('li');
	var menu_count = menu_list.length;
	style = (typeof(style) != 'undefined') ? style : 'block';

	for(var i=0;i<menu_count;i++){
		if(i<view_item_count) menu_list[i].style.display = style;
		else menu_list[i].style.display = 'none';
	}
	slide_tid = setTimeout("slideList('next', '"+el_id+"', "+view_item_count+","+1+", "+time_interval+")",time_interval);
}

/* 목록 이동 slideList(이동시킬방향 prev 또는 next, 이동시킬 ul 엘리먼트의 id, 보여질 목록 갯수, 이동시킬 갯수, 시간 간격, display 값) */
function slideList2(direction, el_id, view_item_count, scroll_count, time_interval, style)
{
	var menu = document.getElementById(el_id);
	var menu_list = menu.getElementsByTagName('li');
	var menu_count = menu_list.length;
	var start_no = 0;

	style = (typeof(style) != 'undefined') ? style : 'block';

	// 현재 보여지고 있는 엘리먼트의 시작을 확인
	for(var i=0;i<menu_count;i++){
		if(menu_list[i].style.display == style){
			start_no = i;
			break;
		}
	}

	if(start_no == menu_count-1) start_no = -1;
	
	
	// 방향에 따른 이동
	if(direction == 'next'){
//		if(menu_list[menu_count-1].style.display == style) return false;
//		else{
			for(var i=0;i<menu_count;i++){
				if(i>=start_no + scroll_count && i<start_no + scroll_count + view_item_count){
					menu_list[i].style.display = style;
				}else{
					menu_list[i].style.display = 'none';
					clearTimeout(slide_tid2);				
				}
			}
//		}
	}else if(direction == 'prev'){
//		if(menu_list[0].style.display == style) return false;
//		else{
			for(var i=0;i<menu_count;i++){
				if(i>=start_no - scroll_count && i<start_no - scroll_count + view_item_count){
					menu_list[i].style.display = style;
				}else{
					menu_list[i].style.display = 'none';
					clearTimeout(slide_tid2);
				}
			}
//		}
	}
	slide_tid2 = setTimeout("slideList2('"+direction+"','"+el_id+"',"+view_item_count+","+scroll_count+", "+time_interval+")",time_interval);

}

/* 초기화 slideInitView2(ul엘리먼트의 id, 최초 보여지는 li 엘리먼트 갯수, 시간 간격, display 값) */
function slideInitView2(el_id, view_item_count, time_interval, slide_tid, index, style)
{
	var menu = document.getElementById(el_id);
	var menu_list = menu.getElementsByTagName('li');
	var menu_count = menu_list.length;
	style = (typeof(style) != 'undefined') ? style : 'block';

	for(var i=0;i<menu_count;i++){
		if(i<view_item_count) menu_list[i].style.display = style;
		else menu_list[i].style.display = 'none';
	}
	slide_tid2 = setTimeout("slideList2('next', '"+el_id+"', "+view_item_count+","+1+", "+time_interval+", "+index+")",time_interval);
}

// 이미지보기 (가급적 viewImgCaption 함수를 사용하기 바람)
function viewImg(el_id, src){
	document.getElementById(el_id).setAttribute('src', src);
	if(alt) document.getElementById(el_id).setAttribute('alt', alt);
}

// 캡션이 변경되는 이미지 교체 인자로 넘겨지는 text으로 alt태그도 함께 변경됨
// viewImgCaption(img 엘리먼트의 id, 바뀔이미지 파일 경로, 보이는 텍스트의 캡션 엘리먼트 id, 캡션텍스트)
function viewImgCaption(img_id, src, caption_id, text)
{
	document.getElementById(img_id).setAttribute('src', src);
	document.getElementById(img_id).setAttribute('alt', text);
	if(caption_id && document.getElementById(caption_id)) document.getElementById(caption_id).firstChild.nodeValue = text;
}

//이미지만 뜨는 팝업 2007.11. 14 
function view01(x,y,z){
  newin=window.open('',y,z);
  newin.document.write("<head><title>Arrival Card</title></head><body background='"+x+"' onclick='self.close()' style='cursor:hand'>");
}

//테마별 선택시 뿌려주는 스크립트 2008.1.18
function view_detail_search(select)
{
	var category = select.options[select.selectedIndex].getAttribute('value');
	if(category == 'theme'){
		document.getElementById('select_step2').style.display = 'none';
		document.getElementById('select_step3').style.display = 'none';
		document.getElementById('theme').style.display = 'block';
	}else{
		document.getElementById('select_step2').style.display = 'inline';
		document.getElementById('select_step3').style.display = 'inline';
		document.getElementById('theme').style.display = 'none';
	}
}

function view_detail_search2(select)
{
	var category = select.options[select.selectedIndex].getAttribute('value');
	if(category == 'step1'){
		document.getElementById('select_step1').style.display = 'block';
		document.getElementById('select_step2').style.display = 'none';
		document.getElementById('select_step3').style.display = 'none';
		document.getElementById('select_step4').style.display = 'none';
	}else if(category == 'step2'){
		document.getElementById('select_step1').style.display = 'none';
		document.getElementById('select_step2').style.display = 'block';
		document.getElementById('select_step3').style.display = 'none';
		document.getElementById('select_step4').style.display = 'none';
	}else if(category == 'step3'){
		document.getElementById('select_step1').style.display = 'none';
		document.getElementById('select_step2').style.display = 'none';
		document.getElementById('select_step3').style.display = 'block';
		document.getElementById('select_step4').style.display = 'none';
	} else {
		document.getElementById('select_step1').style.display = 'none';
		document.getElementById('select_step2').style.display = 'none';
		document.getElementById('select_step3').style.display = 'none';
		document.getElementById('select_step4').style.display = 'block';
	}
}



/* 글자수 체크  textarea에 onkeyup="check_str_length(this, 'remain', 0, 100)" 등록*/
function check_str_length(el_textarea, taget_id, init_length, max_length){
	var el_target = document.getElementById(taget_id);
	var now_length = init_length;
	var strlen = 0;
	var temp;
	var tmpstr = '';

	for(k=0;k<el_textarea.value.length;k++){
		temp = el_textarea.value.charAt(k);

		if(init_length == 0){
			if(escape(temp).length > 4){
				now_length += 2;
				strlen += 2;
			}
			else{
				now_length++;
				strlen++;
			}
		}else{
			if(escape(temp).length > 4){
				now_length -= 2;
				strlen += 2;
			}else{
				now_length--;
				strlen++
			}
		}

		if(strlen > max_length){
			alert(max_length + 'byte를 초과 입력할수 없습니다. \n 초과된 내용은 자동으로 삭제 됩니다.');
			el_textarea.value = tmpstr;
			break;
		}else{
			el_target.childNodes[0].nodeValue = now_length;
			tmpstr += temp;
		}
	}
}

/*동영상 테두리 없애기*/
function activemovie(Msrc, Mwidth, Mheight) { 
	document.write("<embed src='"+ Msrc +"' width='"+ Mwidth + "' height='" + Mheight + "' showstatusbar='0' showcontrols=false>");
} 

/*동영상 테두리 없애기*/
function activemovie2(Msrc, Mwidth, Mheight, control) { 
	document.write("<embed src='"+ Msrc +"' width='"+ Mwidth + "' height='" + Mheight + "' autostart='1' showstatusbar='1' showcontrols=" + control + ">");
} 
/*플래쉬 테두리 없애기*/
function flash_write(strSrc, strW, strH )
{
 document.write('<Object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" WIDTH="'+strW+'" HEIGHT="'+strH+'" id="company_flash_sub_v1" ALIGN="">');
 document.write('<PARAM NAME=movie VALUE="'+strSrc+'"> ');
 document.write('<PARAM NAME=menu VALUE=false> ');
 document.write('<PARAM NAME=quality VALUE=high> ');
 document.write('<PARAM NAME=wmode VALUE=transparent> ');
 document.write('<PARAM NAME=bgcolor VALUE=#CCCCCC> ');
 document.write('<PARAM name=allowScriptAccess value=always />');
 document.write('<EMBED src="'+strSrc+'" menu=false quality=high wmode=transparent bgcolor=#CCCCCC  WIDTH="'+strW+'" HEIGHT="'+strH+'" NAME="company_flash_sub_v1" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
 document.write('</OBJECT>');
}

	function language_select(){
			var test = document.getElementById('language_select');
			if(test.style.display=="none")
				document.getElementById('language_select').style.display='block';
			else
				document.getElementById('language_select').style.display='none';	
	}
	// 수상작 보기
function view(what) {
var imgwin = window.open("",'WIN','scrollbars=auto,status=yes,toolbar=no,resizable=1,location=no,menu=no,width=10,height=10');
imgwin.focus();
imgwin.document.open();
imgwin.document.write("<html>\n");
imgwin.document.write("<head>\n");
imgwin.document.write("<title>Korea Tourism Organization</title>\n");
imgwin.document.write('<link rel="stylesheet" type="text/css" href="/knto/kor/css/popup.css">\n');
imgwin.document.write("<sc"+"ript>\n");
imgwin.document.write("function resize() {\n");
imgwin.document.write("pic = document.il;\n");
imgwin.document.write("if (eval(pic).height) { var name = navigator.appName\n");
imgwin.document.write(" if (name == 'Microsoft Internet Explorer') { myHeight = eval(pic).height + 150; myWidth = eval(pic).width + 30;\n");

imgwin.document.write(" } else { myHeight = eval(pic).height + 150; myWidth = eval(pic).width+20; }\n");
imgwin.document.write(" clearTimeout();\n");
imgwin.document.write(" var height = screen.height;\n");
imgwin.document.write(" var width = screen.width;\n");
imgwin.document.write(" var leftpos = width / 2 - myWidth / 2;\n");
imgwin.document.write(" var documentpos = height / 2 - myHeight / 2; \n");
imgwin.document.write(" self.moveTo(leftpos, documentpos);\n");
imgwin.document.write(" self.resizeTo(myWidth, myHeight);\n");
imgwin.document.write("}else setTimeOut(resize(), 100);}\n");
imgwin.document.write("</sc"+"ript>\n");

imgwin.document.write("</head>\n");
imgwin.document.write('<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF" oncontextmenu="return false" ondragstart="return false" onselectstart="return false">\n');
imgwin.document.write('<div id="popup_wrap-07">');
imgwin.document.write('<div id="p_title">');
imgwin.document.write('<h1>수상작 보기</h1></div><div id="p_contents"><div>');
imgwin.document.write("<img border=0 src="+what+" name=il onload='resize();' \n");
imgwin.document.write('</div></div><div id="p_bottom"><a href="javascript:window.close();"><img src="/knto/kor/images/common/btn/btn_popup_close_1.gif" border="0" alt="닫기" /></a></div></div>');
imgwin.document.write("</body>\n");
imgwin.document.close();

}