//========== ÄíÅ°°ª Ã³¸® ÇÔ¼ö S
function getCookieVal (offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
		endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {	//while open
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
			return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0)
			break; 
	}	//while close
	return null;
}
//========== ÄíÅ°°ª Ã³¸® ÇÔ¼ö E

cat_tmp = CatID.substring(0, 1);

// SUBMENU LINE ½ÃÀÛ 
var TimeOut         = 300;
var currentLayer    = null;
var currentitem     = null;
var currentimg    = null;

var currentLayerNum = null;
var noClose         = 0;
var closeTimer      = null;

// Open Hidden Layer
function mopen(n)
{
    var mm  = document.getElementById('gnb1_'+n);
    var nn = document.getElementById('gnb2_s'+n);
    var sel_img = document.getElementById('gnbimg_'+n);
    if(nn)
    {
		sel_img.src='http://image.chosun.com/books/gnb/pmenu'+n+'_on.gif';
        mcancelclosetime();
        nn.style.display='block';
        if(currentLayer && (currentLayerNum != n)){
            currentLayer.style.display='none';
			currentimg.src='http://image.chosun.com/books/gnb/pmenu'+currentLayerNum+'.gif';
			sel_menu();
		}
        currentLayer = nn;
        currentitem = mm;
		currentimg = sel_img;
        currentLayerNum = n;
    }
    else if(currentLayer)
    {
        currentLayer.style.display='none';
		currentimg.src='http://image.chosun.com/books/gnb/pmenu'+currentLayerNum+'.gif';
		sel_menu();
        currentLayerNum = n;
        currentitem = null;
        currentLayer = null;
		currentimg = null;
    }
}
// Turn On Close Timer
function mclosetime()
{
    closeTimer = window.setTimeout(mclose, TimeOut);
}
// Cancel Close Timer
function mcancelclosetime()
{
    if(closeTimer)
    {
        window.clearTimeout(closeTimer);
        closeTimer = null;
    }
}
// Close Showed Layer
function mclose()
{
    if(currentLayer && noClose!=1)
    {
        currentLayer.style.display='none';
		currentimg.src='http://image.chosun.com/books/gnb/pmenu'+currentLayerNum+'.gif';
        currentLayerNum = null;
		sel_menu();
        currentLayer = null;
        currentitem = null;
		currentimg = null;
    }
    else
    {
        noClose = 0;
    }
    currentLayer = null;
    currentitem = null;
}
function over_menu(on_menu){
	if(on_menu){
		document.getElementById('gnbimg_'+on_menu).src='http://image.chosun.com/books/gnb/pmenu'+on_menu+'_on.gif';
	}else{
		document.getElementById('gnbimg').src='http://image.chosun.com/books/gnb/pmenu_on.gif';
	}
}
function out_menu(off_menu){
	if(off_menu){
	document.getElementById('gnbimg_'+off_menu).src='http://image.chosun.com/books/gnb/pmenu'+off_menu+'.gif';
	}else{
		document.getElementById('gnbimg').src='http://image.chosun.com/books/gnb/pmenu_off.gif';
	}
sel_menu();
}
function sel_menu(){
if(cat_tmp)	{
		if(cat_tmp == 'G')
		{
			document.getElementById('gnbimg_2').src='http://image.chosun.com/books/gnb/pmenu2_on.gif';
		}else if(cat_tmp == 'H')
		{
			document.getElementById('gnbimg_3').src='http://image.chosun.com/books/gnb/pmenu3_on.gif';
		}else{
			
			if(document.getElementById('gnbimg_'+cat_tmp)!=null) {
				document.getElementById('gnbimg_'+cat_tmp).src='http://image.chosun.com/books/gnb/pmenu'+cat_tmp+'_on.gif';
			}
		}
	}
}
// Close Layer Then Click-out
document.onclick = mclose; 

//·Î±×ÀÎ °ü·Ã ---
function getCookieVal (offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
		endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {	//while open
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
			return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0)
			break; 
	}	//while close
	return null;
}
//·Î±×ÀÎ
function loginFrame () {
	//ÆäÀÌÁö URL
	var returl = document.location; 
	if (returl == null || returl == ""){
		returl = M_SITE;
	}
	returl = escape(returl);

	var login_url = "https://membership.chosun.com/login/protect_sso/sso_user_info.jsp?returl="+returl;
	var logout_url = "https://membership.chosun.com/login/logout.jsp?returl="+returl;
	var regist_url = "https://membership.chosun.com/join/registUser.jsp?site=chosun";
	var join_url = "https://membership.chosun.com/join/registUser.jsp?act=myindex&site=chosun";
	var idpw_url = "https://membership.chosun.com/join/registUser.jsp?act=idpw&site=chosun";
	var logStr;

	//·Î±×ÀÎ¿©ºÎ - ÄíÅ°°ª È®ÀÎ
	if (!GetCookie('SMSESSION') || GetCookie('SMSESSION') == "LOGGEDOFF" || !GetCookie('SM_USER')) {
		logStr = "<li><span>¤ý</span><a href=" + login_url + " target='_top'>·Î±×ÀÎ</a></li><li><span>¤ý</span><a href=" + regist_url + " target='_top'>È¸¿ø°¡ÀÔ</a></li><li><span>¤ý</span><a href=" + idpw_url + " target='_top'>¾ÆÀÌµð / ºñ¹Ð¹øÈ£ Ã£±â</a></li>";
	}
	else if (!GetCookie('dz_nm') || !GetCookie('dz_info')) {	//20070406 rainy
	var relogin_url = "https://membership.chosun.com/login/protect_sso/sso_user_info.jsp?returl="+returl;
		parent.location.href = relogin_url;
	}
	else {
		logStr = "<li><span class='user_name'>"+unescape(GetCookie('dz_nm'))+"</span>´Ô</li>" ;
		logStr = logStr + "<li><span>¤ý</span><a href=" + logout_url + " target='_top'>·Î±×¾Æ¿ô</a></li><li><span>¤ý</span><a href=" + join_url + " target='_top'>Á¤º¸¼öÁ¤</a></li>";
	}
	
	return logStr;
}

function submitSearchQuery(f) {
	var	query = encodeURIComponent(f.query.value);
	window.open('http://search.chosun.com/search/news.search?categoryname=' + encodeURIComponent('ºÏ½º') + '&query=' + query);
}


document.write(" \
<style type='text/css'> \
body{text-align:center;}\
input,textarea{background-color:#fff;font-family:inherit;font-size:0.75em;} \
fieldset,img{border:none;} \
hr,legend{display:none;} \
#header{margin:0 auto; width:970px; text-align:left; }\
#logo_etc{float:none;clear:both;margin:0;padding:0;} \
#logo{position:relative;width:235px;float:left;margin:0 0px 0 19px;display:inline;} \
#logo h1{float:left;font-style:normal;font-size:12px;margin:7px 4px 0 0;} \
#logo h1 img{vertical-align:top;} \
#logo h2{float:left;font-style:normal;font-size:12px;margin-top:2px;} \
#logo h2 img{vertical-align:top;} \
#logo ul#login{position:absolute;top:38px;left:0px;} \
#logo ul#login li{float:left;font-size:11px;color:#666666;} \
#logo ul#login li a{font-size:11px;color:#666666;letter-spacing:-1px;line-height:12px;} \
#logo ul#login li span{color:#333;font-weight:bold;} \
#logo ul#login li span.user_name{color:#666;} \
#lang{float:left;width:55px;margin:0 55px 0 0;line-height:16px;} \
#lang li{margin:2px 0 0 0;padding:0 0 1px 8px;border-bottom:1px solid #cdcdcd;background:url('http://image.chosun.com/cs/gnb/bul_sq_9f.gif') 0 6px no-repeat;} \
#lang li.firstchild{margin:0;padding:0 0 0 6px;} \
#lang li.lastchild{border:none;padding:0 0 0 8px;} \
#tot_search{width:266px;float:left;margin:8px 0 0 0;} \
#tot_search fieldset input{vertical-align:middle;} \
.search_box{position:relative;background:url('http://image.chosun.com/cs/gnb/bg_search.gif') left top no-repeat;margin-right:3px;width:250px;height:24px;} \
.search_box input.search_text{border:none;width:205px;margin:3px 0 2px 3px;font-size:12px;font-family:'Dotum';color:#333;ime-mode:active;} \
.search_box input.search_btn{position:absolute;top:0px;left:217px;} \
.popular_search{float:none;clear:both;margin-top:3px;} \
#top_ban{float:right;width:250px;height:57px;margin:5px 0 -2px 0;padding:0;} \
#gnb_new{float:none;clear:both;position:relative;width:970px;height:39px;margin:0;background:url('http://image.chosun.com/books/gnb/bg_pgnb.gif') left top repeat-x;z-index:2;} \
#gnb1{float:left;margin:9px 0 0 32px;display:inline;} \
#gnb1 li{position:relative;float:left;margin:0; padding-left:11px;} \
#gnb1 li span{padding:0 10px 0 20px;} \
.gnb2{position:absolute;top:24px;left:-10px;display:none;width:110px;padding:14px 0 15px 0;border:2px solid #136980;background-color:#fff;overflow:hidden;} \
.gnb2 li{float:none !important;margin:6px 0 0 5px !important;} \
.gnb2 li span{font-weight:bold;color:#999;padding:0 0 0 0 !important;} \
.gnb2 li a{color:#333 !important;;font-weight:normal !important;text-decoration:none !important;} \
.gnb2 li a:hover{text-decoration:underline !important;} \
#gnb3{float:right;margin:8px 10px 0 0;display:inline;} \
#gnb3 li{float:left;} \
.logoEtc	{position:relative; float:left; clear:both; width:970px; min-height:65px;} \
.logoEtc h1{float:left; margin-top:13px;} \
.logoEtc .etcAd{float:left; padding-left:100px; height:65px;} \
.logoEtc .etcAd iframe{width:270px; height:65px;} \
.searchFormBx{position:absolute; top:14px; right:0; width:280px;} \
* html body .searchFormBx {width:279px;}\
* html body .InputOutline {margin-right:-3px; height:35px;} \
* html body .searchTerm {margin-top:5px;}\
.searchFormBx dt{position:absolute; display:block; overflow:hidden; left:0; top:-5000px;} \
.searchTerm{position:absolute; width:211px; padding:7px 0 5px 5px; border:0 none; font-family:Dotum; font-size:15px;} \
.InputOutline{float:left; display:inline-block; width:216px; height:31px; border:2px solid #c51919;} \
.searchResult{float:left;} \
</style> \
<base target='_top'> \
	<!-- logo_etc --> \
	<div class='logoEtc'> \
		<div id='logo'> \
			<h1><a href='http://www.chosun.com/'><img height='15' width='104' align='top' style='margin: 7px 5px 0px 3px;' title='Á¶¼±´åÄÄ' alt='chosun.com' src='http://image.chosun.com/cs/gnb/logo_chosun_s2010.gif'></a><a href='http://books.chosun.com/'><img src='http://image.chosun.com/books/gnb/chosun_title_books2010.gif' alt='ºÏ½ºÁ¶¼±' style='margin-top:8px;'></a></h1> \
		</div> \
		<div class='etcAd'><iframe height='65' frameborder='0' width='270' scrolling='no' marginheight='0' marginwidth='0' src='http://news.chosun.com/svc/with/common/promotion.html'></iframe></div>\
		<dl class='searchFormBx'> \
		<dt>°Ë»ö</dt> \
		<dd> \
			<form method='get' name='searchForm' id='id_searchForm' action='http://search.chosun.com/search/total.search' target='_blank' accept-charset='utf-8' onsubmit='goSearch(); return false;'>\
			<fieldset>\
				<legend>ÅëÇÕ°Ë»ö</legend>\
				<span class='InputOutline'><input type='text'  id='query' name='query' class='searchTerm' title='°Ë»ö¾î ÀÔ·Â'></span>\
				<input type='image' src='http://image.chosun.com/cs/201003/searchBtn.gif' alt='°Ë»ö' title='°Ë»ö' class='searchResult'>\
			</fieldset>\
			</form>\
		</dd> \
		</dl> \
	</div> \
");
document.write(" \
	<!-- logo_etc // --> \
	<!-- gnb --> \
	<div id='gnb_new'> \
		<ul id='gnb1'> \
			<li id='gnb1' onmouseover=\"mopen('1');\" onmouseout=\"mclosetime();\"><a href='http://books.chosun.com/svc/list.html?catid=1'><img src='http://image.chosun.com/books/gnb/pmenu1.gif' id='gnbimg_1' alt='´º½º'></a><span><img src='http://image.chosun.com/books/gnb/bar_pgnb.gif'></span></li> \
				<ul id='gnb2_s1' class='gnb2'> \
					<li><span>¤ý</span><a href='http://books.chosun.com/svc/list.html?catid=1'>´º½º</a></li> \
					<li><span>¤ý</span><a href='http://books.chosun.com/svc/list.html?catid=11'>½Å°£¼Ò°³</a></li> \
				</ul> \
			<li id='gnb1_0'><a href='http://books.chosun.com/bookzine/index.html'><img src='http://image.chosun.com/books/gnb/pmenu0.gif' id='gnbimg_0' alt='ºÏÁø' onmouseover=\"over_menu('0')\" onmouseout=\"out_menu('0')\"></a><span><img src='http://image.chosun.com/books/gnb/bar_pgnb.gif'></span></li> \
			<li id='gnb1_1' onmouseover=\"mopen('2');\" onmouseout=\"mclosetime();\"><a href='http://books.chosun.com/svc/list.html?catid=G'><img src='http://image.chosun.com/books/gnb/pmenu2.gif' id='gnbimg_2' alt='ÃßÃµµµ¼­'></a><span><img src='http://image.chosun.com/books/gnb/bar_pgnb.gif'></span></li> \
				<ul id='gnb2_s2' class='gnb2'> \
					<li><span>¤ý</span><a href='http://books.chosun.com/svc/list.html?catid=G1'>Å×¸¶ÃßÃµ</a></li> \
					<li><span>¤ý</span><a href='http://books.chosun.com/svc/list.html?catid=G2'>ÆÄ¿öÃßÃµ</a></li> \
					<li><span>¤ý</span><a href='http://books.chosun.com/svc/list.html?catid=G3'>ÁýÁßºÐ¼®</a></li> \
				</ul> \
			<li id='gnb1_2' onmouseover=\"mopen('3');\" onmouseout=\"mclosetime();\"><a href='http://books.chosun.com/svc/list.html?catid=H1'><img src='http://image.chosun.com/books/gnb/pmenu3.gif' id='gnbimg_3' alt='Ä®·³¸®ºä'></a><span><img src='http://image.chosun.com/books/gnb/bar_pgnb.gif'></span></li> \
				<ul id='gnb2_s3' class='gnb2'> \
					<li><span>¤ý</span><a href='http://books.chosun.com/svc/list.html?catid=H1'>¸í»çÄ®·³</a></li> \
					<li><span>¤ý</span><a href='http://books.chosun.com/svc/list.html?catid=H2'>±âÀÚÄ®·³</a></li> \
				</ul> \
			<li id='gnb1_3'><a href='http://books.chosun.com/schedule/books_calendar.html'><img src='http://image.chosun.com/books/gnb/pmenu8.gif' id='gnbimg_8' alt='¿À´ÃÀÐÀ»Ã¥' onmouseover=\"over_menu('8')\" onmouseout=\"out_menu('8')\"></a><span><img src='http://image.chosun.com/books/gnb/bar_pgnb.gif'></span></li> \
			<li id='gnb1_4'><a href='http://bbs.chosun.com/bbs.message.list.screen?bbs_id=2013171220'><img src='http://image.chosun.com/books/gnb/pmenu4.gif' id='gnbimg_4' alt='¸¶ÀÌ¸®ºä' onmouseover=\"over_menu('4')\" onmouseout=\"out_menu('4')\"></a><span><img src='http://image.chosun.com/books/gnb/bar_pgnb.gif'></span></li> \
		</ul> \
		<ul id='gnb3'> \
			<li><a href='http://www.yes24.com/?pid=106710'><img src='http://image.chosun.com/books/gnb/psmenu4.gif' alt='¿Â¶óÀÎ¼­Á¡'></a></li> \
			<!--li><a href='http://library.books.chosun.com/'><img src='http://image.chosun.com/books/gnb/psmenu5.gif' alt='Áö½Ä¶óÀÌºê·¯¸®'></a></li--> \
			<li><a href='http://barobook.books.chosun.com/'><img src='http://image.chosun.com/books/gnb/psmenu6.gif' alt='ÀüÀÚÃ¥'></a></li> \
		</ul> \
	</div> \
	<!-- gnb // --> \
");
sel_menu();