hostname = window.location.hostname;
pathname = window.location.pathname;
hrefname = window.location.href;

document.write('<!--- top_menu_s --->');

if( (hostname == "join4.creditbank.co.kr") || (hostname == "www.mycredit.co.kr") ) {
document.write('<br>');
}

document.write('<center>');
document.write('<table width=970 cellspacing=0 cellpadding=0 border=0>');
document.write('<tr>');
document.write('    <td width=270 height=59><a href=http://waple.chosun.com target=_top><img src=http://waple.chosun.com/image/waple_logo.jpg border=0></a></td>');
document.write('	<td width=450 valign=top><img src=http://waple.chosun.com/image/waple_text.gif><div class=font8 style=margin-left:1pt>¹æ¹®À» È¯¿µÇÕ´Ï´Ù</div></td>');
//document.write('    <td width=240><a href=http://www.chosun.com target=_top><img src=http://waple.chosun.com/image/c_go.gif></a><img src=http://waple.chosun.com/image/dot01.gif hspace=5><a href=http://membership.chosun.com target=_top><img src=http://waple.chosun.com/image/in_go.gif></a><img src=http://waple.chosun.com/image/dot01.gif hspace=5><a href=http://membership.chosun.com/join/registUser.jsp?site=chosun target=_top><img src=http://waple.chosun.com/image/m_go.gif></a><img src=http://waple.chosun.com/image/dot01.gif hspace=5><a href=http://www.chosun.com/section/customer/index.html target=_top><img src=http://waple.chosun.com/image/h_go.gif></a><img src=http://waple.chosun.com/image/dot01.gif hspace=5><a href=http://waple.chosun.com target=_top><img src=http://waple.chosun.com/image/qa_go.gif></a></td>');
document.write('    <td width=250>');

function getCookieVal (pos) {
	var str = "";
	var pos2 = document.cookie.indexOf(";", pos);
	//return document.cookie.substring(pos,pos2);
	if (pos2 == -1)
		return document.cookie.substring(pos);
	else
		return document.cookie.substring(pos,pos2);
}

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 () {
	var returl = document.location; 
	if (returl == null || returl == ""){
		returl = M_SITE;
	}
	returl = escape(returl);
		
	var login_url = "http://membership.chosun.com/login/protect_sso/sso_user_info.jsp?returl="+returl;
	var logout_url = "http://membership.chosun.com/login/logout.jsp?returl="+returl;
	var regist_url = "http://membership.chosun.com/join/registUser.jsp?site=chosun";
	var join_url = "http://membership.chosun.com/join/registUser.jsp?act=update&site=chosun";
	var idpw_url = "http://review.chosun.com/200710/idpw.html";
	var relogin_url = "http://membership.chosun.com/login/protect_sso/sso_user_info.jsp?returl="+returl;
	var str;
	
	//·Î±×ÀÎ¿©ºÎ - ÄíÅ°°ª È®ÀÎ
	if (!GetCookie('SMSESSION') || GetCookie('SMSESSION') == "LOGGEDOFF" || !GetCookie('SM_USER')) {
		str = "<a href=" + login_url + " target=_top><img src=http://waple.chosun.com/image/in_go.gif border=0></a><img src=http://waple.chosun.com/image/dot01.gif hspace=5> <a href=" + regist_url + " target=_top><img src=http://waple.chosun.com/image/m_go.gif border=0></a><img src=http://waple.chosun.com/image/dot01.gif hspace=5>";
	}	
	else if (!GetCookie('dz_nm') || !GetCookie('dz_info')) {	//20070406 rainy
		parent.location.href = relogin_url;
	}
	else {
		str = "<a href=" + logout_url + " target=_top><img src=http://waple.chosun.com/image/in_go_off.gif border=0></a><img src=http://waple.chosun.com/image/dot01.gif hspace=5> <a href=" + join_url + " target=_top><img src=http://waple.chosun.com/image/m_go_off.gif border=0></a><img src=http://waple.chosun.com/image/dot01.gif hspace=5> ";
	}
	
	return str;
}
document.write("<a href=http://waple.chosun.com/link.html?url=http://www.chosun.com target=_top><img src=http://waple.chosun.com/image/c_go.gif border=0></a><img src=http://waple.chosun.com/image/dot01.gif hspace=5>"+loginFrame()+"<a href=http://waple.chosun.com/link.html?url=http://www.chosun.com/section/customer/index.html target=_top><img src=http://waple.chosun.com/image/h_go.gif border=0></a><img src=http://waple.chosun.com/image/dot01.gif hspace=5><a href=http://waple.chosun.com target=_top><img src=http://waple.chosun.com/image/qa_go.gif border=0></a>");
document.write('    </td>');

document.write('</tr>');
document.write('<tr>');
document.write('    <td colspan=3>');

document.write('<table width=970 border=0 cellspacing=0 cellpadding=0>');
document.write('<tr>');

document.write('<td><a href=http://waple.chosun.com/times.html target=_top>');
if(hrefname == "http://waple.chosun.com/times.html") {
document.write('<img border=0 src=http://waple.chosun.com/image/menu01_on.gif width=163 height=40></a></td>');
} else {
document.write('<img name=Image5 border=0 src=http://waple.chosun.com/image/menu01_off.gif width=163 height=40></a></td>');
}

document.write('<td><a href=http://waple.chosun.com/club.html target=_top>');
if(hrefname == "http://waple.chosun.com/club.html") {
document.write('<img name=Image2 border=0 src=http://waple.chosun.com/image/menu02_on.gif width=161 height=40></a></td>');
} else {
document.write('<img name=Image5 border=0 src=http://waple.chosun.com/image/menu02_off.gif width=161 height=40></a></td>');
}

document.write('<td><a href=http://waple.chosun.com/essay.html target=_top>');
if(hrefname == "http://waple.chosun.com/essay.html") {
document.write('<img name=Image3 border=0 src=http://waple.chosun.com/image/menu03_on.gif width=161 height=40></a></td>');
} else {
document.write('<img name=Image5 border=0 src=http://waple.chosun.com/image/menu03_off.gif width=161 height=40></a></td>');
}

document.write('<td><a href=http://waplemagic.chosun.com/ target=_top>');
if(hostname == "waplemagic.chosun.com") {
document.write('<img name=Image4 border=0 src=http://waple.chosun.com/image/menu04_on.gif width=161 height=40></a></td>');
} else {
document.write('<img name=Image5 border=0 src=http://waple.chosun.com/image/menu04_off.gif width=161 height=40></a></td>');
}

document.write('<td><a href=http://www.mycredit.co.kr/mycredit/join_index.do?corp_cd=4000000501 target=_top>');
if((hostname == "www.mycredit.co.kr") || (hrefname == "http://waple.chosun.com/event/20080121_mycredit.html")) {
document.write('<img name=Image5 border=0 src=http://waple.chosun.com/image/menu05_on.gif width=161 height=40></a></td>');
} else {
document.write('<img name=Image5 border=0 src=http://waple.chosun.com/image/menu05_off.gif width=161 height=40></a></td>');
}

document.write('<td><a href=http://join4.creditbank.co.kr/chonsun_protect/main.cb target=_top>');
if(hostname == "join4.creditbank.co.kr") {
document.write('<img name=Image6 border=0 src=http://waple.chosun.com/image/menu06_on.gif width=163 height=40></a></td>');
} else {
document.write('<img name=Image5 border=0 src=http://waple.chosun.com/image/menu06_off.gif width=163 height=40></a></td>');
}

document.write('</tr>');
document.write('</table>');

document.write('    </td>');
document.write('</tr>');
document.write('</table>');
document.write('<!--- top_menu_e --->');