var menu01 = new Array(

//ÇÑ°æ¸Ó´Ï
"0::01::00::ÇÑ°æ¸Ó´Ï::http://money.hankyung.com/index.html",
"9::01::1", //Áß¸Þ´º½ÃÀÛ
"1::01::01::ÇÑ°æ¸Ó´Ï ¾È³»::http://money.hankyung.com/index.html",
"9::01::2", //¼Ò¸Þ´º½ÃÀÛ(Áß¸Þ´º´ÝÀ½)
"2::01::02::¿ÜÈ¯±ÝÀ¶Á¤º¸::http://money.hankyung.com/foreign.html",
"2::01::03::ÁÖ¿ä±ÝÀ¶Á¤º¸::http://money.hankyung.com/import.html",
"2::01::04::ÁÖ¿ä±â´É::http://money.hankyung.com/function.html",
"2::01::05::°­·ÂÇÑ Â÷Æ®::http://money.hankyung.com/chart.html",
"2::01::06::½ÉµµÀÖ´Â ÀÚ·á::http://money.hankyung.com/depthdata.html",
"2::01::07::Àü¹®ÀûÀÎ ³»¿ë::http://money.hankyung.com/contents.html",
"9::01::3", //¼Ò¸Þ´º´ÝÀ½
"9::01::1", //Áß¸Þ´º½ÃÀÛ
//"1::01::08::ÇÑ°æ¸Ó´Ï PLUS::http://money.hankyung.com/plus.html",
"1::01::09::¹«·á»ç¿ë½ÅÃ»::http://money.hankyung.com/trial.php",
"1::01::10::´Ù¿î·Îµå/¼³Ä¡::http://money.hankyung.com/download.html",
"1::01::11::À¯·á°¡ÀÔ¾È³»::http://money.hankyung.com/charge.html",
"9::01::4" //¸Þ´º´ÝÀ½
);

//ÄÚµå ºÐ¸®
function div(sub1,sub2) {
	switch (sub2) {
		case 1: sub2 = sub1.substring(0,sub1.indexOf("::")); break; // ±¸ºÐÀÚ(::) ¾Õ´Ü ÃßÃâ
		case 2: sub2 = sub1.substring(sub1.indexOf("::")+2); break; // ±¸ºÐÀÚ(::) µÞ´Ü ÃßÃâ
	}
	return(sub2);
}

function menu(sub1,sub2) {

	var p2 = '<tr><td height="2" colspan="2"></td></tr>';
	var p6 = '<tr><td height="6" colspan="2"></td></tr>';
	var td1 = '<tr><td style="padding:5 0 3 1; letter-spacing:-1">';
	var td2 = '</td><td style="padding:3 2 0 0" align="right">';
	var td3 = '</td></tr>';
	var td4 = '<tr><td style="padding:7 0 0 7; font-size:11px; font-family:µ¸¿ò; letter-spacing:-1" bgcolor="#F3F3F3" colspan="2">';
	var td5 = '</table>';
	var line1 = '<tr><td height="1" bgcolor="#E9E9E9" colspan="2"></td></tr>';
	var line2 = '<tr><td height="2" bgcolor="#F3F3F3" colspan="2"></td></tr>';
	var line3 = '<tr><td height="6" bgcolor="#F3F3F3" colspan="2"></td></tr>';
	var arw1 = '<img src="http://www.hankyung.com/ftplus/img/icon_ftplus_leftmenu_arw01.gif" width="5" height="3" border="0" align="absmiddle" style="margin:0 0 4 0">';

	// html ÄÚµå ½ÃÀÛ
	document.write ('<table width="120" border="0" cellpadding="0" cellspacing="0" background="http://www.hankyung.com/ftplus/img/ftplus_menu_left_bg01.gif">');
	document.write ('<tr><td><a href="http://money.hankyung.com/" target="_top"><img src="http://www.hankyung.com/img/ftplus_leftmoney.gif" border="0"></a></td></tr>');
	document.write ('<tr><td style="padding:9 11 0 11">');


// ·Î±×ÀÎ
if (!getCookie('UserId')) {
document.write ('<table width="98" border="0" cellpadding="0" cellspacing="0">');
document.write ('<col width="45"><col width="53">');
document.write ('<form name="login" method="post" action="./inc/money_login_db.php" onsubmit="return checkIt()">');
document.write ('<input type="hidden" name="url" value="' + top.location +'">');
document.write ('<input type="hidden" name="mode" value="login">');
document.write ('<tr><td height="4" colspan="2"></td></tr>');
document.write ('<tr><td class="td18 f11 dm sp01">¾ÆÀÌµð</td><td><input name="user_id" type="text" style="width:53; height:16; border:solid 1px #DDDDDD"></td></tr>');
document.write ('<tr><td class="td18 f11 dm sp01">ºñ¹Ð¹øÈ£</td><td><input name="pass_word" type="password" style="width:53; height:16; border:solid 1px #DDDDDD"></td></tr>');
document.write ('<tr><td height="5" colspan="2"></td></tr>');
document.write ('</table>');
document.write ('<table width="98" border="0" cellpadding="0" cellspacing="0">');
document.write ('<col width="45"><col width="53">');
document.write ('<tr>');
document.write ('	<td><input type="image" src="img/btn_login01.gif" width="43" height="16" border="0" style="border:solid 0;background-repeat: no-repeat;"></td>');
document.write ('	<td><a href="http://clubmall.hankyung.com/members/mem_apply.php?user_tag=1" target="_top"><img src="img/btn_member01.gif" width="53" height="16" border="0"></a></td>');
document.write ('</tr>');
document.write ('<tr><td height="4" colspan="2"></td></tr>');
document.write ('<tr><td colspan="2"><a href="http://money.hankyung.com/install/autoinstall.html" target="_top"><img src="img/btn_money01.gif" width="98" height="16" border="0"></a></td></tr>');
document.write ('</form>');
document.write ('</table>');
document.write ('</td></tr>');
}
// ·Î±×¾Æ¿ô
else{
document.write ('<table width="98" border="0" cellpadding="0" cellspacing="0">');
document.write ('<form name="login" method="post" action="./inc/money_login_db.php">');
document.write ('<input type="hidden" name="url" value="' + top.location +'">');
document.write ('<input type="hidden" name="mode" value="logout">');
document.write ('<tr>');
document.write ('	<td class="ac f11 dm sp01 he16"><p style="margin:3 0 0 0"><b class="f11 dm sp01">'+getCookie('UserId')+'</b> ´ÔÀÇ<br>');
document.write ('	<a href="https://clubmall.hankyung.com/members/mem_modify.php" target="_top">My Á¤º¸º¸±â</a> | <a href="https://clubmall.hankyung.com/members/mem_modify.php" target="_top">¼öÁ¤</a>');
document.write ('	</td>');
document.write ('</tr>');
document.write ('<tr><td height="3" colspan="2"></td></tr>');
document.write ('<tr align="center">');
document.write ('	<td><input type=image src="img/btn_logout01.gif" style="width:98; height:16; border:solid 0;background-repeat: no-repeat;"><p style="margin:2 0 0 0"><a href="http://money.hankyung.com/charge.html"><img src="img/btn_memregist01.gif" width="98" height="16" border="0"></a></td>');
document.write ('</tr>');
document.write ('<tr><td height="4" colspan="2"></td></tr>');
document.write ('<tr><td colspan="2"><a href="http://money.hankyung.com/install/autoinstall.html" target="_top"><img src="img/btn_money01.gif" width="98" height="16" border="0"></a></td></tr>');
document.write ('</form>');
document.write ('</table>');
document.write ('</td></tr>');
}

	for (i=0; i <= menu01.length-1; i++) { // ¹è¿­ ³¡³¯ ¶§±îÁö µ¹¸²
		var depth = div(menu01[i],1);
		var code1 = div(div(menu01[i],2),1);
		var code2 = div(div(div(menu01[i],2),2),1);
		var mname = div(div(div(div(menu01[i],2),2),2),1);
		var murl = div(div(div(div(menu01[i],2),2),2),2);
		var grph = div(div(menu01[i],2),2);

		if (code1 == sub1) { // ÇØ´ç ´ëºÐ·ù¸¸ Ç¥½ÃÇÔ

			//´ë¸Þ´ºÇ¥½Ã
			if (depth == 0) {
				document.write ('<tr><td style="padding:9 9 0 9">');
				document.write ('<table width="102" border="0" cellpadding="0" cellspacing="0">');
			}

			//Áß¸Þ´ºÇ¥½Ã
			if (depth == 1) {

				if (code2 == sub2) {
					document.write ( td1 + '<b class="sp01"><a href="' + murl + '" target="_top" style="color:#8A704D">' + mname + '</a></b> ' + td2); //µÞÇ×¸ñÀÌ ¼Ò¸Þ´ºÀÏ¶§ ¾Æ·¡·Î µÈ È¸»ö È­»ìÇ¥
					if (div(menu01[i+1],1) == 9 && div(div(menu01[i+1],2),2) != 4) {
						document.write (arw1);
					}
				} else {
					document.write ( td1 + '<a href="' + murl + '" target="_top">' + mname + '</a> ' + td2); //Áß¸Þ´ºÇ¥½Ã
					//µÞÇ×¸ñÀÌ ¼Ò¸Þ´ºÀÏ¶§ ¾Æ·¡·Î µÈ È¸»ö È­»ìÇ¥
					if (div(menu01[i+1],1) == 9 && div(div(menu01[i+1],2),2) != 4) {
						document.write (arw1);
					}
				}

				if (div(menu01[i+1],1) != 9) {
					document.write (td3); //µÞÇ×¸ñÀÌ Áß¸Þ´ºÀÏ¶§ ±¸ºÐ¶óÀÎ Ç¥½Ã
				} else {
					document.write (td3);
				}

			}

			//¼ÒºÐ·ùÇ¥½Ã
			if (depth == 2) {
				if (code2 == sub2) {
					document.write (td4 + '<b class="sp01"><a href="' + murl + '" target="_top" style="color:#8A704D">' + mname + '</a></b> ' + td3 ); //¼±ÅÃµÈ ¼Ò¸Þ´º ¿À·»Áö»ö
				} else {
					document.write (td4 + '<a href="' + murl + '" target="_top">' + mname + '</a>' + td3 ); //¼Ò¸Þ´ºÇ¥½Ã
				}
			}

			//·¹ÀÌ¾Æ¿ô¿ä¼Ò Ç¥½Ã
			if (depth == 9) {
				switch (grph) {
					case '1': document.write (); break;
					case '2': document.write (td3 + p2 + line1 + line2); break;
					case '3': document.write (line3 + line1 + p6); break;
					case '4': document.write (td5); break;
				}
			}
		}

	}
	document.write ('</td>');
	document.write ('</tr>');
	document.write ('<tr><td><img src="http://www.hankyung.com/ftplus/img/ftplus_menu_bottom01.gif" width="120" height="11" border="0"></td></tr>');
	document.write ('</table>');
	document.write ('<p style="margin:6 0 0 0">');

	/* ¸Ó´Ï ÇïÇÁµ¥½ºÅ© ¹è³Ê */
	if ( sub1 == 1) {
	document.write ('<img src="http://www.hankyung.com/ftplus/img/bnr_money01.gif" width="120" border="0"><br>');
	}


}

function checkIt() {
	if (!login.user_id.value) {
		alert('¾ÆÀÌµð(ID)¸¦ ÀÔ·ÂÇÏ¼¼¿ä!');
		login.user_id.focus();
		return false;
	}
	else if (!login.pass_word.value) {
		alert('ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä!');
		login.pass_word.focus();
		return false;
	}
	return true;
}


function hbar(sub1,sub2) {

	var grp, murl='', mname='';
	var root = '<a href="http://www.hankyung.com/" target="_top">HOME</a> > <a href="http://www.hankyung.com/ftplus/" target="_top">ÀçÅ×Å©Plus</a> > ';
	var money = '<a href="http://money.hankyung.com/" target="_top">ÇÑ°æ¸Ó´Ï</a>';


	for (i=0; i<menu01.length; i++) {
		if (div(menu01[i],1) != 9) {
			if (sub1 == div(div(menu01[i],2),1)) {
				if (sub2 == div(div(div(menu01[i],2),2),1)) {
					grp = div(menu01[i],1);
					murl = div(div(div(div(menu01[i],2),2),2),2);
					mname = div(div(div(div(menu01[i],2),2),2),1);
				}
			}
		}
	}

	document.write (root);
	if (sub1 == 1) {
		if (mname != '') {
			switch (grp) {
				case '1': document.write (money + ' > <a href="' + murl + '" target="_top">' + mname + '</a>'); break;
				case '2':
					if ( sub2 >= 2 && sub2 <= 7 ) {
						document.write (money + ' > ÇÑ°æ¸Ó´Ï ¾È³» > ');
					}
					document.write ('<a href="' + murl + '" target="_top">' + mname + '</a>');
					break;
				default : document.write (money); break;
			}
		} else if (isNaN(parseInt(sub2))) {
			document.write (money + sub2);
		} else {
			document.write (money);
		}
	}

}


function ttlbar(sub1,sub2,ttl) {

	var grp, murl='', mname='';
	var money = ' &lt; ÇÑ°æ¸Ó´Ï ¾È³»';

	document.write ('<title>');
	document.write (ttl + ' &lt; ');

	for (i=0; i<menu01.length; i++) {
		if (div(menu01[i],1) != 9) {
			if (sub1 == div(div(menu01[i],2),1)) {
				if (sub2 == div(div(div(menu01[i],2),2),1)) {
					grp = div(menu01[i],1);
					murl = div(div(div(div(menu01[i],2),2),2),2);
					mname = div(div(div(div(menu01[i],2),2),2),1);
				}
			}
		}
	}

	if (sub1 == 1) {
		if (mname != '') {
			switch (grp) {
				case '1': document.write ( mname + money ); break;
				case '2':
					if ( sub2 >= 2 && sub2 <= 7 ) {
						document.write ( mname + ' &lt; ÀçÅ×Å©Ä®·³' + money );
					}
					else {
						document.write ( mname + money );
					} break;
				default : document.write (money); break;
			}
		} else if (isNaN(parseInt(sub2))) {
			document.write (sub2 + money);
		} else {
			document.write (money);
		}
	}

	document.write (' &lt; ÀçÅ×Å© Plus :: ÇÑ°æ´åÄÄ ::</title>');
}