//========== ÄíÅ°°ª Ã³¸® ÇÔ¼ö 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

var ctid = null;
if (CatID){
	if (CatID=='37'){
		ctid='1';
	} else if (CatID=='32'){
		ctid='2';
	} else if (CatID=='31'){
		ctid='3';
	} else if (CatID=='39'){
		ctid='4';
	} else if (CatID=='36'){
		ctid='9';
	} else if (CatID=='2' || CatID=='21' || CatID=='22' || CatID=='23'){
		ctid='5';
	} else if (CatID=='1' || CatID=='11' || CatID=='12' || CatID=='13' || CatID=='14'){
		ctid='6';
	} else if (CatID=='51'|| CatID=='52' || CatID=='54' || CatID=='55' || CatID=='56'){
		ctid='7';
	} else if (CatID=='4' || CatID=='41' || CatID=='42' || CatID=='43' || CatID=='44'){
		ctid='8';
	}
}

tmp_gnb = CatID.substring(0, 2);

function sel_menu(){
	if(tmp_gnb == '37'){
		document.getElementById('gnb1_0').className='sel';
	} else if(tmp_gnb == '32'){
		document.getElementById('gnb1_1').className='sel';
	} else if(tmp_gnb == '31'){
		document.getElementById('gnb1_2').className='sel';
	} else if(tmp_gnb == '39'){
		document.getElementById('gnb1_3').className='sel';
	} else if(tmp_gnb == '33'){
		document.getElementById('gnb1_4').className='sel';
	} else if(tmp_gnb == '2'){
		document.getElementById('gnb1_4').className='sel';
	} else if(tmp_gnb == '36'){
		document.getElementById('gnb1_5').className='sel no_bg';
	} else {
		document.getElementById('gnb1_5').className='no_bg';
	}
}
//·Î±×ÀÎ °ü·Ã ---
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;
}
document.write("\
<style type='text/css'>\
input,textarea,select{background-color:#fff;font-family:inherit;}\
fieldset,img{border:none;}\
hr,legend{display:none;}\
#logo_etc{position:relative;float:none;clear:both;height:60px;margin:0;padding:0;}\
#logo{width:230px;position:relative;float:left;margin:0 11px 0 13px;display:inline;}\
#logo h1{position:absolute;top:7px;left:7px;font-style:normal;font-size:12px;}\
#logo h1 img{vertical-align:top;}\
#logo ul#login{position:absolute;top:39px;left:2px;}\
#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;}\
#tot_search{position:absolute;top:8px;left:345px;width:55px;width:266px;}\
#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;margin:11px 0 0 0;}\
.no_bg{background:none !important;}\
.gnb0{position:relative; width:970px; height:34px; overflow:hidden; float:left; border-top:2px solid #0c4079; border-bottom:1px solid #6384a9; background:url(http://image.chosun.com/review/0907/bg_gnb_line.gif) repeat-x;}\
.gnb0 li.on{margin:0 -2px;}\
.gnb0 li{float:left; padding-right:2px; background:url(http://image.chosun.com/review/0907/line_bar.gif) no-repeat right 8px;}\
.gnb0 li a{display:block; float:left;}\
.gnb0 li.etcMenu{position:absolute; top:8px; right:11px; background:none;}\
.gnb1{float:left; margin-left:-3px; height:34px; background:url(http://image.chosun.com/review/0907/bg_gnb_line2.gif) repeat-x;}\
.gnb1 li{float:left; padding:9px 12px 0; background:url(http://image.chosun.com/review/0907/line_bar2.gif) no-repeat right 11px;}\
.gnb1 li a{display:inline; color:#fefeff; font-size:12px; font-weight:bold; letter-spacing:-1px;}\
.gnb1 li a:hover{display:inline; color:#fefeff; font-size:12px; font-weight:bold; letter-spacing:-1px;}\
#gnb1 li.sel a{text-decoration:underline;}\
#gnb1 li.sel a:hover{text-decoration:underline;}\
</style>\
<!-- logo_etc -->\
<div id='logo_etc'>\
	<div id='logo'>\
		<h1><a href='http://review.chosun.com/'><img src='http://image.chosun.com/review/0901/chosun_logo_0810.gif' alt='review chosun'></a></h1>\
		<ul id='login'>" +loginFrame()+ "</ul>\
	</div>\
	<div id='tot_search'>\
		<form method='get' action='http://search.chosun.com/search/newsSearch.jsp?sTarget=news&categoryValue=¸®ºä' target='_blank'>\
			<fieldset>\
				<legend>ÅëÇÕ°Ë»ö</legend>\
				<div class='search_box'><input type='text' name='searchTerm' id='searchTerm' class='search_text' tabindex='1' title='°Ë»ö¾î ÀÔ·Â'><input type='hidden' name='categoryValue' value='¸®ºä'><input type='image' src='http://image.chosun.com/cs/gnb/gnb_search_btn.gif' class='search_btn' alt='ÅëÇÕ°Ë»ö'></div>\
			</fieldset>\
		</form>\
		<div class='popular_search'>\
			<iframe src='http://review.chosun.com/common/pr/index.html' title='°øÁö»çÇ×' width='262' height='18' frameborder='0' scrolling='no'></iframe>\
		</div>\
	</div>\
	<div id='top_ban'><iframe src='http://review.chosun.com/common/ad/index.html' title='¹è³Ê' width='265' height='40' frameborder='0' scrolling='no'></iframe></div>\
</div>\
<!-- //logo_etc -->\
<!-- gnb -->\
<ul class='gnb0'>\
<li><a href='http://review.chosun.com/svc/list/list.html?catid=1'><img src='http://image.chosun.com/review/0907/gnb_menu1.jpg' alt='´º½º'></a>\
<li class='on'><a href='http://review.chosun.com/svc/list/list.html?catid=3'><img src='http://image.chosun.com/review/0907/gnb_menu2_on.jpg' alt='¸®ºä'></a>\
	<ul id='gnb1' class='gnb1'>\
	<li id='gnb1_0'><a href='http://review.chosun.com/svc/list/list.html?catid=37'>³ëÆ®ºÏ¡¤PC</a></li>\
	<li id='gnb1_1'><a href='http://review.chosun.com/svc/list/list.html?catid=32'>µðÄ«¡¤Ä·ÄÚ´õ</a></li>\
	<li id='gnb1_2'><a href='http://review.chosun.com/svc/list/list.html?catid=31'>¸ð¹ÙÀÏ</a></li>\
	<li id='gnb1_3'><a href='http://review.chosun.com/svc/list/list.html?catid=39'>PMP¡¤NAVI¡¤MP3</a></li>\
	<li id='gnb1_4'><a href='http://review.chosun.com/svc/list/list.html?catid=2'>»ýÈ°°¡Àü¡¤±âÅ¸</a></li>\
	<li id='gnb1_5' class='no_bg'><a href='http://review.chosun.com/svc/list/list.html?catid=36'>°ÔÀÓ±â</a></li>\
	</ul>\
</li>\
<li><a href='http://bbs.chosun.com/bbs.message.list.screen?bbs_id=2013110001'><img src='http://image.chosun.com/review/0907/gnb_menu3.jpg' alt='Ä¿¹Â´ÏÆ¼'></a></li>\
<li class='no_bg'><a href='http://review.chosun.com/svc/list/list.html?catid=4'><img src='http://image.chosun.com/review/0907/gnb_menu4.jpg' alt='ÀÌº¥Æ®'></a></li>\
<li class='etcMenu'><a href='http://careview.chosun.com' target='_blank'><img src='http://image.chosun.com/review/0907/gnb_menu5.jpg' alt='Ä«¸®ºä'></a></li>\
</ul>\
<div style='clear:both;'></div>\
<!-- //gnb -->\
");
sel_menu();