var hk_menu;
var PromotionLink;

function hk_menu(sub1,sub2)
{
	//¸Þ´º¼±ÅÃ ¹øÈ£
	//sub1: 0-¼±ÅÃX, 1-´º½º, 2-Áõ±ÇP, 3-ºÎµ¿»êP, 4-ÀçÅ×Å©P, 5-ÀÚµ¿Â÷P, 6-°ñÇÁP
	//sub2: ¼­ºê¸Þ´º ¼±ÅÃ

	//Ã¤³Î¸Þ´º¼±ÅÃ
	var menu_no;

	hk_menu = sub1;

	switch (sub1) {
		case 1:	 menu_no = "01"; break;
		case 2:	 menu_no = "02"; break;
		case 3:	 menu_no = "03"; break;
		case 4:	 menu_no = "04"; break;
		case 5:	 menu_no = "05"; break;
		case 6:	 menu_no = "06"; break;
		default: menu_no = "00"; break;
	}

	//¼­ºê¸Þ´º¼±ÅÃ
	var sub_no01 = "off";
	var sub_no02 = "off";
	var sub_no03 = "off";
	var sub_no04 = "off";
	var sub_no05 = "off";
	var sub_no06 = "off";
	var sub_no07 = "off";
	var sub_no08 = "off";
	var sub_no09 = "off";
	var sub_no10 = "off";
	var sub_no11 = "off";
	var sub_no12 = "off";
	var sub_no13 = "off";
	var sub_no14 = "off";
	var sub_no15 = "off";
	var sub_no16 = "off";

	switch (sub2) {
		case 1: sub_no01 = "on"; break;
		case 2: sub_no02 = "on"; break;
		case 3: sub_no03 = "on"; break;
		case 4: sub_no04 = "on"; break;
		case 5: sub_no05 = "on"; break;
		case 6: sub_no06 = "on"; break;
		case 7: sub_no07 = "on"; break;
		case 8: sub_no08 = "on"; break;
		case 9: sub_no09 = "on"; break;
		case 10: sub_no10 = "on"; break;
		case 11: sub_no11 = "on"; break;
		case 12: sub_no12 = "on"; break;
		case 13: sub_no13 = "on"; break;
		case 14: sub_no14 = "on"; break;
		case 15: sub_no15 = "on"; break;
		case 16: sub_no16 = "on"; break;
	}

	// ´º½º
	if (sub1 == 1) {
		submenu = '\
			<td><a href="http://www.hankyung.com/news/stock/" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0101_' + sub_no01 + '.gif" height="27" border="0" style="margin:0 0 0 7"></a></td>\
			<td><a href="http://www.hankyung.com/news/economy/" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0102_' + sub_no02 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://www.hankyung.com/news/estate/" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0103_' + sub_no03 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://www.hankyung.com/news/industry/" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0104_' + sub_no04 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://www.hankyung.com/news/intl/" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0105_' + sub_no05 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://www.hankyung.com/news/politics/" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0106_' + sub_no06 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://www.hankyung.com/news/sports/" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0107_' + sub_no07 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://www.hankyung.com/news/column/" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0108_' + sub_no08 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
		';
	}

	// Áõ±ÇPlus
	if (sub1 == 2) {
		submenu = '\
			<td><a href="http://www.hankyung.com/stockplus/investinfo/investinfo.php" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0201_' + sub_no01 + '.gif" height="27" border="0" style="margin:0 0 0 7"></a></td>\
			<td><a href="http://www.hankyung.com/stockplus/snapshot/snapshot.php" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0202_' + sub_no02 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://www.hankyung.com/stockplus/stockinfo/stockinfo.php" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0203_' + sub_no03 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://global.hankyung.com/hankyung/hankyung.jsp" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0204_' + sub_no04 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://starwars.hankyung.com/" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0205_' + sub_no05 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://www.hankyung.com/news/app/newslist.php?sid=010290&amp;nid=200&amp;type=1" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0214_' + sub_no14 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://www.hankyung.com/stockplus/varo/" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0209_' + sub_no09 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
		';
	}

	// ºÎµ¿»êPlus
	if (sub1 == 3) {
		submenu = '\
			<td><a href="http://www.hankyung.com/landplus/news/" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0301_' + sub_no01 + '.gif" height="27" border="0" style="margin:0 0 0 7"></a></td>\
			<td><a href="http://www.hankyung.com/landplus/price/" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0302_' + sub_no02 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://www.hankyung.com/landplus/offering/" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0303_' + sub_no03 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://www.hankyung.com/landplus/sale/" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0304_' + sub_no04 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://www.hankyung.com/landplus/counsel/" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0305_' + sub_no05 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://neonet.hankyung.com/novo-hankyung/view/community/CommunityIndex.neo" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0306_' + sub_no06 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<!--<td><a href="http://pbank.hankyung.com/" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0310_' + sub_no10 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>-->\
			<td><a href="http://auction.hankyung.com/" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0315_' + sub_no15 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://moving.hankyung.com/" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0316_' + sub_no16 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://www.hankyung.com/landplus/sangga/" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0309_' + sub_no09 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
		';
	}

	// ÀçÅ×Å©Plus
	if (sub1 == 4) {
		submenu = '\
			<td><a href="http://www.hankyung.com/ftplus/ft_strategy.html" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0401_' + sub_no01 + '.gif" height="27" border="0" style="margin:0 0 0 54"></a></td>\
			<td><a href="http://www.hankyung.com/ftplus/fund/" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0402_' + sub_no02 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://bohumplaza.hankyung.com/" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0404_' + sub_no04 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://www.hankyung.com/ftplus/snapshot_a.php" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0405_' + sub_no05 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://www.hankyung.com/ftplus/material.php" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0406_' + sub_no06 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<!--<td><a href="http://fundmall.hankyung.com/" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0407_' + sub_no07 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>-->\
			<td><a href="http://www.hankyung.com/ftplus/media/" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0411_' + sub_no11 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://www.hankyung.com/ftplus/richclub/" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0412_' + sub_no12 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
		';
	}

	// ÀÚµ¿Â÷Plus
	if (sub1 == 5) {
		submenu = '\
			<td><a href="http://www.hankyung.com/autoplus/carnews.html" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0501_' + sub_no01 + '.gif" height="27" border="0" style="margin:0 0 0 7"></a></td>\
			<td><a href="http://www.hankyung.com/autoplus/carnew.html" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0502_' + sub_no02 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://www.hankyung.com/autoplus/carlife.html" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0504_' + sub_no04 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://www.hankyung.com/autoplus/carstory.html" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0505_' + sub_no05 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://www.hankyung.com/autoplus/cargallery.html" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0506_' + sub_no06 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://www.hankyung.com/autoplus/racingmodel.html" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0507_' + sub_no07 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
		';
	}

	// °ñÇÁPlus
	if (sub1 == 6) {
		submenu = '\
			<td><a href="http://www.hankyung.com/golfplus/news.html" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0601_' + sub_no01 + '.gif" height="27" border="0" style="margin:0 0 0 43"></a></td>\
			<td><a href="http://www.hankyung.com/golfplus/column.html" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0602_' + sub_no02 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://www.hankyung.com/golfplus/lesson.html" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0603_' + sub_no03 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://www.hankyung.com/golfplus/trendsetter/" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0608_' + sub_no08 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://booking.hankyung.com/" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0605_' + sub_no05 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://www.hankyung.com/golfplus/par3/" target="_top" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0606_' + sub_no06 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
			<td><a href="http://plusmall.golfsky.com/" target="_blank" onfocus="blur()"><img src="http://www.hankyung.com/img/new2_submenu0607_' + sub_no07 + '.gif" height="27" border="0" style="margin:0 0 0 15"></a></td>\
		';
	}

	if (sub1 == 0) {
		submenu = '<td height="27"><p style="margin:0"></td>'
	}

	//·Î±×ÀÎ&·Î±×¾Æ¿ô »Ñ¸®±â
	var user_id = getCookie('UserId');
	var url     = escape(location.href);
	var urlArr  = url.split("url%3D");

	if (eval(url.indexOf("url%3D"))>0) {
		if (eval(urlArr[1].indexOf("iderror"))>0) {
			url = escape("http://www.hankyung.com");
		}
	}

	// ¸Þ´º »Ñ¸®±â ½ÃÀÛ
	document.write('\
		<!-- ¸Þ´º ½ÃÀÛ -->\
		<table width="980" border="0" cellpadding="0" cellspacing="0">\
		<tr bgcolor="#142C67">\
			<td width="210">\
				<!-- ·Î±×ÀÎ/È¸¿ø°¡ÀÔ/PDF½Å¹® ½ÃÀÛ -->\
				<table width="210" border="0" cellpadding="0" cellspacing="0">\
				<tr valign="top">\
					<td width="29"></td>\
					<td width="181">\
	');

	

	if( typeof(user_id) == "undefined" || user_id == ""){
		document.write ('<a href="http://clubmall.hankyung.com/members/mem_login.php?url=' + url + '" target="_top"><img src="http://www.hankyung.com/img/btn_mem_login01.gif" width="28" height="10" border="0" style="margin:2 0 0 1"></a><a href="http://clubmall.hankyung.com/members/mem_apply.php?url='+url[1]+'" target="_top"><img src="http://www.hankyung.com/img/btn_mem_apply01.gif" width="40" height="10" border="0" style="margin:2 0 0 14"></a><a href="http://pdf.hankyung.com/epaper/" target="_top"><img src="http://www.hankyung.com/img/btn_pdf01.gif" width="40" height="10" border="0" style="margin:2 0 0 14"></a>');		
	}else{
		document.write ('<a href="http://clubmall.hankyung.com/members/mem_logout.php" target="_top"><img src="http://www.hankyung.com/img/btn_mem_logout01.gif" width="39" height="10" border="0" style="margin:2 0 0 1"></a><a href="http://clubmall.hankyung.com/members/mem_modify.php?url=' + url + '" target="_top"><img src="http://www.hankyung.com/img/btn_mem_modify01.gif" width="30" height="10" border="0" style="margin:2 0 0 14"></a><a href="http://pdf.hankyung.com/epaper/" target="_top"><img src="http://www.hankyung.com/img/btn_pdf01.gif" width="40" height="10" border="0" style="margin:2 0 0 13"></a>');
	}
	document.write('\
					</td>\
				</tr>\
				</table>\
				<!-- ·Î±×ÀÎ/È¸¿ø°¡ÀÔ/PDF½Å¹® ³¡ -->\
			</td>\
			<td width="650"><img src="http://www.hankyung.com/img/new4_topmenu' + menu_no + '.gif" width="650" height="22" border="0" usemap="#topmenu"></td>\
			<td width="120"><a onclick="this.style.behavior=\'url(#default#homepage)\'; this.setHomePage(\'http://www.hankyung.com/\');"><img src="http://www.hankyung.com/img/new_submenu_bookmark02.gif" height="10" border="0" style="margin:0 0 2 1; cursor:pointer"></a></td>\
		</tr>\
	');

	if ( sub1 >= 0 && sub1 <= 7 ) {

		var searchSelArr = new Array( "", "", "", "", "", "", "" , "");

		// Áõ±ÇÇÃ·¯½ºÀÏ ¶§
		if( hk_menu == 2 ) searchSelArr[2] = " selected"; // °Ë»ö Ç®´Ù¿î¸Þ´º => ÇöÀç°¡

		document.write('\
			<tr bgcolor="#E6E6E6">\
				<td width="210">\
					<!-- ³¯¾¾ ½ÃÀÛ -->\
					<table width="210" border="0" cellpadding="0" cellspacing="0">\
					<tr valign="top">\
						<td width="29"></td>\
						<td width="181"><iframe src="http://www.hankyung.com/inc/common_top_weather.html" width="181" height="27" frameborder="0" scrolling="no"></iframe></td>\
					</tr>\
					</table>\
					<!-- ³¯¾¾ ³¡ -->\
				</td>\
				<td width="770" height="27" colspan="2">\
					<table width="770" border="0" cellpadding="0" cellspacing="0">\
					<tr valign="top">\
						<td width="470">\
							<!-- ¼­ºê ¸Þ´º ½ÃÀÛ -->\
							<table border="0" cellpadding="0" cellspacing="0">\
							<tr valign="top">\
							' + submenu + '\
							</tr>\
							</table>\
							<!-- ¼­ºê ¸Þ´º ³¡ -->\
						</td>\
						<td width="300">\
							<!-- °Ë»ö ½ÃÀÛ -->\
							<p style="margin:3 0 0 0">\
							<scr'+'ipt language="javascript" src="http://search.hankyung.com/service/inc_search.js"></scr'+'ipt>\
							<table border="0" cellpadding="0" cellspacing="0">\
							<FORM NAME="srch_form" method="post" target="_blank" action="http://search.hankyung.com/service/result_all.php" onsubmit="javascript:{return kwdSearchTotalComboJump(document.srch_form);}">\
							<input Type="hidden" Name="pageNum" value="1">\
							<input type="hidden" name="pageSize" value="10">\
							<input type="hidden" name="kwd" value="">\
							<input type="hidden" name="ord" value="1">\
							<input type="hidden" name="method" value="allwordthruindex">\
							<input type="hidden" name="stype" value="">\
							<input type="hidden" name="newsperiod" value="1">\
							<input type="hidden" name="newsmenu" value="">\
							<input type="hidden" name="speriod" value="">\
							<input type="hidden" name="eperiod" value="">\
							<input type="hidden" name="promotion" value="">\
							<tr>\
								<td><select name="srchmenu" style="width:80px; height:20px">\
								<option value="1"'+searchSelArr[0]+'>ÅëÇÕ°Ë»ö</option>\
								<option value="2"'+searchSelArr[1]+'>±â»ç</option>\
								<option value="3"'+searchSelArr[2]+'>ÇöÀç°¡</option>\
								<option value="4"'+searchSelArr[3]+'>i Ä®·³/°Ô½ÃÆÇ</option>\
								<option value="8"'+searchSelArr[7]+'>ºí·Î±×</option>\
								<option value="5"'+searchSelArr[4]+'>Àü¹®ÀÚ·á</option>\
								<option value="6"'+searchSelArr[5]+'>°æÁ¦¿ë¾î</option>\
								<option value="7"'+searchSelArr[6]+'>°æÁ¦ÀÎ¹°</option>\
								<option value="9"'+searchSelArr[8]+'>SÇÑ°æ</option>\
                                <option value="10"'+searchSelArr[9]+'>PDF ½Å¹®</option>\
								</select></td>\
								<td width="4"></td>\
		');
		// ÀÍ½º¸¸ Àû¿ë
		if(window.ActiveXObject){
			document.write('\
									<scr'+'ipt language="javascript" src="http://www.hankyung.com/js/promotion.php"></scr'+'ipt>\
									<td><span id="promotionHtml"></span></td>\
			');
		}else{
			document.write('\
									<td><input type="text" class="input01" name="srch_kwd" style="width:172; height:20; ime-mode:active;"></td>\
			');
		}
		document.write('\
								<td width="4"></td>\
								<td><input type="image" name="submit" src="http://www.hankyung.com/img/btn_search_common04.gif" width="30" height="20" border="0"></td>\
							</tr>\
							</FORM>\
							</table>\
							<!-- °Ë»ö ³¡ -->\
						</td>\
					</tr>\
					</table>\
				</td>\
			</tr>\
		');
	}
	document.write('\
		<tr><td height="15" bgcolor="#FFFFFF" colspan="3"></td></tr>\
		</table>\
		<map name="topmenu">\
		<area shape="rect" coords="0,0,36,22" href="http://www.hankyung.com/" target="_top" title="´º½º">\
		<area shape="rect" coords="44,0,80,22" href="http://www.hankyung.com/stockplus/" target="_top" title="Áõ±Ç">\
		<area shape="rect" coords="88,0,138,22" href="http://www.hankyung.com/landplus/" target="_top" title="ºÎµ¿»ê">\
		<area shape="rect" coords="146,0,196,22" href="http://www.hankyung.com/ftplus/" target="_top" title="ÀçÅ×Å©">\
		<area shape="rect" coords="204,0,254,22" href="http://www.hankyung.com/autoplus/" target="_top" title="ÀÚµ¿Â÷">\
		<area shape="rect" coords="262,0,298,22" href="http://www.hankyung.com/golfplus/" target="_top" title="°ñÇÁ">\
		<area shape="rect" coords="306,0,342,22" href="http://fashion.hankyung.com/" target="_top" title="ÆÐ¼Ç">\
		<area shape="rect" coords="350,0,400,22" href="http://w.hankyung.com/" target="_top" title="Á÷ÀåÀÎ">\
		<area shape="rect" coords="408,0,468,22" href="http://s.hankyung.com/" target="_top" title="°æÁ¦±³½Ç">\
		<area shape="rect" coords="476,0,525,22" href="http://blog.hankyung.com/" target="_top" title="ºí·Î±×">\
		</map>\
		<!-- ¸Þ´º ³¡ -->\
	');
}
