//°øÅë µ¥ÀÌÅÍ
document.write("<scr"+"ipt type=\"text/javas"+"cript\" src=\"http://changup.hankooki.com/service/v01/common_data.js\"></scr"+"ipt>");

function TabChange(){
	this.version = "0.1";
	this.name = "TabChange";
	this.item = new Array();
	this.itemcount = 0;
  
  this.add = function(){
		this.itemcount=this.add.arguments.length;
		for(i=0;i<this.itemcount;i++){
			this.item[i] = this.add.arguments[i];
		}
	}; 
	this.LayerChange = function(layerID){
		for(j=0;j<this.itemcount;j++){
			if(this.item[j] == layerID) document.getElementById( this.item[j]).style.display = "";
			else document.getElementById( this.item[j]).style.display = "none";
		}
	};
}

function Hki_GetCookie(NameCookie){
	var i=document.cookie.indexOf(NameCookie+'=');
	if(i!=-1){i+=NameCookie.length+1;NameEnd=document.cookie.indexOf(';',i);
	if(NameEnd==-1){
		NameEnd=document.cookie.length;
	}
	return unescape(document.cookie.substring(i,NameEnd));}else{return""}
}

function Hki_Login(HomeUrl,Path,LoginImg,LogoutImg,JoinImg,ModifyImg){
	Cookievalue=Hki_GetCookie('mlogin_cookie');
	var Cookie_idname=new Array();
	Cookie_idname=Cookievalue.split("|");
	var urls=location.host+location.pathname+location.search;
	urls=urls.replace(/&/g,"%26");
	if(Cookievalue!=""){
		document.writeln("<a href=\"https://login.hankooki.com/logout.php?mode=logout&home="+HomeUrl+"&path="+Path+"&url="+HomeUrl+"\" target=\"_top\"><img src=\""+LogoutImg+"\" alt=\"·Î±×¾Æ¿ô\" /></a>");
		document.writeln("<a href=\"https://login.hankooki.com/edit_member.php?path="+Path+"&home="+HomeUrl+"&url="+urls+"\" target=\"_top\"><img src=\""+ModifyImg+"\" alt=\"Á¤º¸¼öÁ¤\" /></a>");
	}else{
		document.writeln("<a href=\"https://login.hankooki.com/login.php?path="+Path+"&home="+HomeUrl+"&url="+urls+"\" target=\"_top\"><img src=\""+LoginImg+"\" alt=\"·Î±×ÀÎ\" /></a>");
		document.writeln("<a href=\"https://login.hankooki.com/agree.php?path="+Path+"&url="+urls+"\" target=\"_top\"><img src=\""+JoinImg+"\" alt=\"È¸¿ø°¡ÀÔ\" /></a>");
	}
}

function Top_GNB(){
	document.writeln("<div id=\"topgnb_wrap\">");
	document.writeln("	<div id=\"topgnb\">");
	document.writeln("		<!-- ¸ÅÃ¼³ª¿­ -->");
	//document.writeln("		<div class=\"uilogo\"><a href=\"http://www.hankooki.com\"><img src=\"http://img.hankooki.com/news/2011/06/hankooki_logo.jpg\" alt=\"ÇÑ±¹¾ÆÀÌ´åÄÄ! ¸·°­ ¹Ìµð¾î Æ÷ÅÐ!\" /></a></div>");
	document.writeln("		<div class=\"gnblink\">");
	document.writeln("			<ul>");
	document.writeln("			<li class=\"in\"><a href=\"http://news.hankooki.com\"><img src=\"http://img.hankooki.com/news/2011/06/topui_hk.gif\" alt=\"ÇÑ±¹ÀÏº¸\" title=\"ÇÑ±¹ÀÏº¸\" border=\"0\" /></a></li>");
	document.writeln("			<li class=\"in\"><a href=\"http://economy.hankooki.com\"><img src=\"http://img.hankooki.com/news/2011/06/topui_sk.gif\" alt=\"¼­¿ï°æÁ¦\" title=\"¼­¿ï°æÁ¦\" border=\"0\" /></a></li>");
	document.writeln("			<li class=\"in\"><a href=\"http://sports.hankooki.com\"><img src=\"http://img.hankooki.com/news/2011/06/topui_sp.gif\" alt=\"½ºÆ÷Ã÷ÇÑ±¹\" title=\"½ºÆ÷Ã÷ÇÑ±¹\" border=\"0\" /></a></li>");
	document.writeln("			<li class=\"in\"><a href=\"http://kids.hankooki.com\"><img src=\"http://img.hankooki.com/news/2011/06/topui_kids.gif\" alt=\"¼Ò³âÇÑ±¹ÀÏº¸\" title=\"¼Ò³âÇÑ±¹ÀÏº¸\" border=\"0\" /></a></li>");
	document.writeln("			<li class=\"in\"><a href=\"http://www.koreatimes.co.kr\"><img src=\"http://img.hankooki.com/news/2011/06/topui_kt.gif\" alt=\"ÄÚ¸®¾ÆÅ¸ÀÓ½º\" title=\"ÄÚ¸®¾ÆÅ¸ÀÓ½º\" border=\"0\" /></a></li>");
	document.writeln("			<li class=\"in\"><a href=\"http://www.sentv.co.kr\"><img src=\"http://img.hankooki.com/news/2011/06/topui_sentv.gif\" alt=\"¼­¿ï°æÁ¦TV\" title=\"¼­¿ï°æÁ¦TV\" border=\"0\" /></a></li>");
	document.writeln("			<li><a href=\"http://www.koreatimes.com\"><img src=\"http://img.hankooki.com/news/2011/06/topui_usa.gif\" alt=\"¹ÌÁÖÇÑ±¹ÀÏº¸\" title=\"¹ÌÁÖÇÑ±¹ÀÏº¸\" border=\"0\" /></a></li>");
	document.writeln("			</ul>");
	document.writeln("		</div>");
	document.writeln("		<!-- //¸ÅÃ¼³ª¿­ -->	");	
	document.writeln("		<div class=\"tr\">");
	document.writeln("			<!-- Search -->		");
	document.writeln("			<div class=\"search\">");
	document.writeln("				<fieldset>");
	document.writeln("					<legend class=\"hide\">°Ë»ö</legend>");
	document.writeln("					<form  name=\"isearch\" method=\"get\" action=\"http://search.hankooki.com/search.php\" onSubmit=\"return SetSearch.GoAction()\">");
	document.writeln("						<input type=\"hidden\" name=\"mode\" value=\"\"/>");
	document.writeln("						<input type=\"text\" name=\"kw\" class=\"input_search\" value=\"°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä\" onclick=\"SetSearch.check_search(this)\" /><input type=\"image\" value=\"°Ë»ö\" class=\"btn\" src=\"http://img.hankooki.com/news/2011/06/btn_search.gif\" /> ");
	document.writeln("					</form>	");				
	document.writeln("				</fieldset>");
	document.writeln("			</div>");
	document.writeln("			<!-- //Search -->		");
	document.writeln("			<!-- Login -->		");
	document.writeln("			<div class=\"hki_login\">");
	Hki_Login("changup.hankooki.com","","http://img.hankooki.com/news/2011/06/btn_login.gif","http://img.hankooki.com/news/2011/06/btn_logout.gif","http://img.hankooki.com/news/2011/06/btn_join.gif","http://img.hankooki.com/news/2011/06/btn_modify.gif");
	document.writeln("			</div>");
	document.writeln("			<!-- Login -->	");
	document.writeln("		</div>");
	document.writeln("	</div>");
	document.writeln("</div>");
}

function RightLink(){
	document.writeln("<li class=\"mtx\">");
	document.writeln("<a href=\"#\">¼Ò¼ÈÄ¿¸Ó½º</a>");
	document.writeln("<span class=\"line\"></span>");
	document.writeln("</li>");
}

//¸Þ´º ÅÇ 
var arrTopmenuTab = ["topmenu_01","topmenu_02","topmenu_03","topmenu_04","topmenu_05","topmenu_06","topmenu_07"];
function setTopmenuTab(tabid){
	for(i=0;i<arrTopmenuTab.length;i++){
		if(arrTopmenuTab[i]==tabid){
			document.getElementById(arrTopmenuTab[i]).style.display = "block";
			document.getElementById("tab0"+ (i+1)).className = "naviON";
		} else {
			document.getElementById(arrTopmenuTab[i]).style.display = "none";
			document.getElementById("tab0"+ (i+1)).className = "naviOFF";
		}
	}
}

function outTopmenuTab(e,obj) { 
	var to = e ? e.relatedTarget : event.toElement; 
	while(to) { 
		if(to == obj) return;
		to = to.parentNode;
	}
	obj.style.display='none';
}




/* Topmenu Link */
function MagazineMenuLink(){
	document.write("<li class=\"info\">Ã¢¾÷¸Å°ÅÁø</li>");
	document.write("<li><a href=\"http://changup.hankooki.com/v01/Board/boardList.php?tablename=planning\">±âÈ¹½ºÅä¸®</a></li>");
	document.write("<li><a href=\"http://changup.hankooki.com/v01/Board/newsList.php\">Ã¢¾÷´º½º</a></li>");
	document.write("<li><a href=\"http://changup.hankooki.com/v01/Board/boardList.php?tablename=biz\">¾÷°è¼Ò½Ä</a></li>");
	document.write("<li><a href=\"http://changup.hankooki.com/v01/Board/boardList.php?tablename=columns\">Ã¢¾÷Ä®·³</a></li>");
	document.write("<li><a href=\"http://changup.hankooki.com/v01/Board/boardList.php?tablename=video\">Ã¢¾÷¿µ»ó</a></li>");
}

function ItemMenuLink(){
	document.write("<li class=\"info\">Ã¢¾÷¾ÆÀÌÅÛ</li>");
	document.write("<li><a href=\"http://changup.hankooki.com/v01/Board/boardList.php?tablename=trend\">Ã¢¾÷Æ®·£µå</a></li>");
	document.write("<li><a href=\"http://changup.hankooki.com/v01/Item/itemList.php?tablename=item&category=1\">¾÷Á¾º° ºÐ·ù</a></li>");
	document.write("<li><a href=\"http://changup.hankooki.com/v01/Item/itemList.php?tablename=item&category=5\">Ã¢¾÷ÀÚ±Ýº° ºÐ·ù</a></li>");
}

function EduMenuLink(){
	document.write("<li class=\"info\">Ã¢¾÷±³À°</li>");
	document.write("<li><a href=\"http://changup.hankooki.com/v01/Education/eduList.php?tablename=education&category=1\">Ã¢¾÷±³À°&amp;¼¼¹Ì³ª</a></li>");
	document.write("<li><a href=\"http://changup.hankooki.com/v01/Education/eduList.php?tablename=education&category=2\">Á¤ºÎÁö¿ø±³À°</a></li>");
	document.write("<li><a href=\"http://changup.hankooki.com/v01/Education/eduList.php?tablename=education&category=3\">»ç¾÷¼³¸íÈ¸</a></li>");
	document.write("<li><a href=\"http://changup.hankooki.com/v01/Education/eduList.php?tablename=education&category=4\">ÇöÀåÃ¼Çè</a></li>");
}

function SupportMenuLink(){
	document.write("<li class=\"info\">Ã¢¾÷Áö¿ø¼¾ÅÍ</li>");
	document.write("<li><a href=\"http://changup.hankooki.com/v01/OneStop/info.htm\">Ã¢¾÷¿ø½ºÅ¾¼­ºñ½º</a></li>");
}

function StoreMenuLink(){
	document.write("<li class=\"info\">»óÁ¡&amp;Á¡Æ÷</li>");
	document.write("<li><a href=\"http://changup.hankooki.com/v01/Board/boardList.php?tablename=shop_info\">»ó±ÇÁ¤º¸</a></li>");
	document.write("<li><a href=\"http://changup.hankooki.com/v01/Sale/saleList.php?tablename=sale_item\">Á¡Æ÷¸Å¹°</a></li>");
}

function GuideMenuLink(){
	document.write("<li class=\"info\">Ã¢¾÷°¡ÀÌµå</li>");
	document.write("<li><a href=\"http://changup.hankooki.com/v01/Guide/guide.php\">Àü¹®°¡ Ã¢¾÷»ó´ã</a></li>");
	document.write("<li><a href=\"http://changup.hankooki.com/v01/Board/boardList.php?tablename=data\">Ã¢¾÷ ÀÚ·á½Ç</a></li>");
	document.write("<li><a href=\"http://changup.hankooki.com/v01/Board/boardList.php?tablename=success\">Ã¢¾÷¼º°ø»ç·Ê</a></li>");
	document.write("<li><a href=\"http://changup.hankooki.com/v01/Board/boardList.php?tablename=manual\">Ã¢¾÷¸Å´º¾ó</a></li>");
}

function CommunityMenuLink(){
	document.write("<li class=\"info\">Ä¿¹Â´ÏÆ¼</li>");
	document.write("<li><a href=\"http://changup.hankooki.com/v01/Community/boardList.php?tablename=review\">Ã¢¾÷ÈÄ±â</a></li>");
	document.write("<li><a href=\"http://changup.hankooki.com/v01/Community/vote.php\">¹Ú VS ¹Ú</a></li>");
	document.write("<li><a href=\"http://changup.hankooki.com/v01/Board/boardList.php?tablename=event\">ÀÌº¥Æ®</a></li>");
}

//Ã¢¾÷»ó´ã Q&A ·¹ÀÌ¾î
var togFaq = function(obj){
	if (obj == null || typeof(obj) == "object") {
		obj = window.location.href;
	}
	var id = obj.split("#hList_",obj.length-1)[1];
	var tarList= UI.$("hList_"+id);
	var tarDesc= UI.$("hDesc_"+id);
	if (!tarDesc) {
		return;
	}

	try {
		var allList = UI.$("HelpList").getElementsByTagName("li");
		var allDesc = UI.$("HelpList").getElementsByTagName("div");
		var allListCnt = allList.length;
		var allDescCnt = allDesc.length;

		for (var i = 0; i < allListCnt; i++) {
			if (allList[i].id.indexOf("hList_") == 0) {
				if (tarList.id != allList[i].id) { 
					allList[i].className = "";
				}
			}
		}
		for (var i = 0; i < allDescCnt; i++) {
			if (allDesc[i].id.indexOf("hDesc_") == 0) {
				if (tarDesc.id != allDesc[i].id) { 
					allDesc[i].style.display = "none";
				}
			}
		}		
	}
	catch(e) {
	}

	if(UI.getStyle(tarDesc,'display')=='none'){
		tarDesc.style.display='block';
		tarList.className='on';
	}else{
		tarDesc.style.display='none';
		tarList.className='';
	}

	try {
		var topPos = UI.getPosition(tarList).y;
		var dd = document.documentElement;
		var db = document.body;
		if (dd) {
			dd.scrollTop = topPos;
		}
		else if (db) {
			db.scrollTop = topPos;
		}
	}
	catch(e) {
	}
	return false;
};

var init_HelpList = function(obj){
	if(obj){
		UI.$("hList_"+obj).className='on';
		UI.$("hDesc_"+obj).style.display='block';
	}
};

var UI={};
Object.extend=function(a, b){
  for (var property in b) a[property] = b[property];
  return a;
};

UI.$=function(s) { return document.getElementById(s) };
UI.trim=function(s) {return s.replace(/(^\s*)|(\s*$)/g, "") };
UI.toogle=function(id) { UI.$(id).style.display=(UI.getStyle(UI.$(id),'display')=='none') ? 'block':'none' };
UI.getEl=function(e){var E=UI.getE(e);return E.target || E.srcElement}
UI.getE=function(e){return e || window.event}
UI.random=function(min, max){ return Math.floor(Math.random() * (max - min + 1) + min) };
UI.getStyle=function(el, style) {
	var value = el.style[style];
	if(!value)
	{
		if(document.defaultView && document.defaultView.getComputedStyle) 
		{
			var css = document.defaultView.getComputedStyle(el, null);
			value = css ? css[style] : null;
		} 
		else if (el.currentStyle) value = el.currentStyle[style];
	}
	return value == 'auto' ? null : value;
};

function ShowLayer(){
	if (document.getElementById('layer01').style.display == 'none'){
		document.getElementById('layer01').style.display = '';
		document.getElementById('layer02').style.display = 'none';
	} else {
		document.getElementById('layer01').style.display = 'none';
		document.getElementById('layer02').style.display = '';
	}
}
