var hk_menu;
var PromotionLink;

function hk_menu(sub1,sub2)
{
	//¸Þ´º¼±ÅÃ ¹øÈ£
	//sub1: 0-¼±ÅÃX, 1-Ä®·³¡¤Ä¿¹Â´ÏÆ¼, 2-±³À°¼¾ÅÍ, 3-Ãë¾÷¼¾ÅÍ, 4-Ã¢¾÷¼¾ÅÍ
	//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;
		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";

	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;
	}

	// Ä®·³¡¤Ä¿¹Â´ÏÆ¼
	if (sub1 == 1) {
		submenu = '\
			<td><a href="http://w.hankyung.com/community/work/" target="_top" onfocus="blur()"><img src="http://w.hankyung.com/img/submenu0101_' + sub_no01 + '.gif" height="27" border="0" style="margin:0 0 0 7"></a></td>\
			<td><a href="http://w.hankyung.com/community/economy/" target="_top" onfocus="blur()"><img src="http://w.hankyung.com/img/submenu0102_' + sub_no02 + '.gif" height="27" border="0" style="margin:0 0 0 13"></a></td>\
			<td><a href="http://w.hankyung.com/community/world/" target="_top" onfocus="blur()"><img src="http://w.hankyung.com/img/submenu0103_' + sub_no03 + '.gif" height="27" border="0" style="margin:0 0 0 13"></a></td>\
			<td><a href="http://w.hankyung.com/community/life/" target="_top" onfocus="blur()"><img src="http://w.hankyung.com/img/submenu0104_' + sub_no04 + '.gif" height="27" border="0" style="margin:0 0 0 13"></a></td>\
		';
	}

	// ±³À°¼¾ÅÍ
	if (sub1 == 2) {
		submenu = '\
			<td><a href="http://w.hankyung.com/edu/news/" target="_top" onfocus="blur()"><img src="http://w.hankyung.com/img/submenu0201_' + sub_no01 + '.gif" height="27" border="0" style="margin:0 0 0 7"></a></td>\
			<td><a href="http://hkworld.hankyung.com/hkworld.html" target="_top" onfocus="blur()"><img src="http://w.hankyung.com/img/submenu0202_' + sub_no02 + '.gif" height="27" border="0" style="margin:0 0 0 13"></a></td>\
			<td><a href="http://w.hankyung.com/edu/hrd/" target="_top" onfocus="blur()"><img src="http://w.hankyung.com/img/submenu0208_' + sub_no08 + '.gif" height="27" border="0" style="margin:0 0 0 13"></a></td>\
			<td><a href="http://w.hankyung.com/edu/business/" target="_top" onfocus="blur()"><img src="http://w.hankyung.com/img/submenu0203_' + sub_no03 + '.gif" height="27" border="0" style="margin:0 0 0 13"></a></td>\
			<td><a href="http://w.hankyung.com/edu/career/" target="_top" onfocus="blur()"><img src="http://w.hankyung.com/img/submenu0204_' + sub_no04 + '.gif" height="27" border="0" style="margin:0 0 0 13"></a></td>\
			<td><a href="http://itedu.hankyung.com/lecture/lecturelist_new.asp" target="_top" onfocus="blur()"><img src="http://w.hankyung.com/img/submenu0205_' + sub_no05 + '.gif" height="27" border="0" style="margin:0 0 0 13"></a></td>\
			<td><a href="http://itcampus.hankyung.com/" target="_blank" onfocus="blur()"><img src="http://w.hankyung.com/img/submenu0206_' + sub_no06 + '.gif" height="27" border="0" style="margin:0 0 0 13"></a></td>\
			<td><a href="http://w.hankyung.com/board/list.php?id=w_edu_qna&ch=edu" target="_top" onfocus="blur()"><img src="http://w.hankyung.com/img/submenu0207_' + sub_no07 + '.gif" height="27" border="0" style="margin:0 0 0 13"></a></td>\
		';
	}

	// Ãë¾÷¼¾ÅÍ
	if (sub1 == 3) {
		submenu = '\
			<td><a href="http://job.hankyung.com/jobs/" target="_top" onfocus="blur()"><img src="http://w.hankyung.com/img/submenu0301_' + sub_no01 + '.gif" height="27" border="0" style="margin:0 0 0 149"></a></td>\
			<td><a href="http://job.hankyung.com/headhunting/" target="_top" onfocus="blur()"><img src="http://w.hankyung.com/img/submenu0302_' + sub_no02 + '.gif" height="27" border="0" style="margin:0 0 0 13"></a></td>\
			<td><a href="http://w.hankyung.com/news/app/newslist.php?sid=011609&nid=253&type=1" target="_top" onfocus="blur()"><img src="http://w.hankyung.com/img/submenu0303_' + sub_no03 + '.gif" height="27" border="0" style="margin:0 0 0 13"></a></td>\
		';
	}

	// Ã¢¾÷¼¾ÅÍ
	if (sub1 == 4) {
		submenu = '\
			<td><a href="http://w.hankyung.com/changup/news/" target="_top" onfocus="blur()"><img src="http://w.hankyung.com/img/submenu0401_' + sub_no01 + '.gif" height="27" border="0" style="margin:0 0 0 48"></a></td>\
			<td><a href="http://w.hankyung.com/changup/seminar/" target="_top" onfocus="blur()"><img src="http://w.hankyung.com/img/submenu0402_' + sub_no02 + '.gif" height="27" border="0" style="margin:0 0 0 13"></a></td>\
			<td><a href="http://bizplace.hankyung.com/item/list.html" target="_top" onfocus="blur()"><img src="http://w.hankyung.com/img/submenu0403_' + sub_no03 + '.gif" height="27" border="0" style="margin:0 0 0 13"></a></td>\
			<td><a href="http://sangganews.hankyung.com/" target="_top" onfocus="blur()"><img src="http://w.hankyung.com/img/submenu0404_' + sub_no04 + '.gif" height="27" border="0" style="margin:0 0 0 13"></a></td>\
			<td><a href="http://koreachangup.hankyung.com/index.asp" target="_top" onfocus="blur()"><img src="http://w.hankyung.com/img/submenu0405_' + sub_no05 + '.gif" height="27" border="0" style="margin:0 0 0 13"></a></td>\
			<td><a href="http://koreachangup.hankyung.com/guide.asp" target="_top" onfocus="blur()"><img src="http://w.hankyung.com/img/submenu0406_' + sub_no06 + '.gif" height="27" border="0" style="margin:0 0 0 13"></a></td>\
			<td><a href="http://koreachangup.hankyung.com/businessinfomain.asp" target="_top" onfocus="blur()"><img src="http://w.hankyung.com/img/submenu0407_' + sub_no07 + '.gif" height="27" border="0" style="margin:0 0 0 13"></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="#002F74">\
			<td width="196">\
				<!-- ·Î±×ÀÎ/È¸¿ø°¡ÀÔ/PDF½Å¹® ½ÃÀÛ -->\
				<p style="margin:6 0 0 0">\
				<table width="196" border="0" cellpadding="0" cellspacing="0">\
				<tr valign="top">\
					<td width="29"></td>\
					<td width="167">\
	');

	

	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>');
	}

	
	var searchSelArr = new Array( "", "", "", "", "");

	// Áõ±ÇÇÃ·¯½ºÀÏ ¶§
	if( hk_menu == 99 ) searchSelArr[99] = " selected"; // °Ë»ö Ç®´Ù¿î¸Þ´º => ÇöÀç°¡

	document.write('\
					</td>\
				</tr>\
				</table>\
				<!-- ·Î±×ÀÎ/È¸¿ø°¡ÀÔ/PDF½Å¹® ³¡ -->\
			</td>\
			<td width="484"><img src="http://w.hankyung.com/img/topmenu' + menu_no + '.gif" width="484" height="34" border="0" usemap="#topmenu"></td>\
			<td width="300" valign="top">\
				<!-- °Ë»ö ½ÃÀÛ -->\
				<p style="margin:6 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>\
					</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:181; 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_common02.gif" width="21" height="20" border="0"></td>\
				</tr>\
				</FORM>\
				</table>\
				<!-- °Ë»ö ³¡ -->\
			</td>\
		</tr>\
	');

	if ( sub1 >= 1 && sub1 <= 4 ) {
		document.write('\
			<tr bgcolor="#E6E6E6">\
				<td width="196">\
					<!-- ³¯¾¾ ½ÃÀÛ -->\
					<table width="196" border="0" cellpadding="0" cellspacing="0">\
					<tr valign="top">\
						<td width="29"></td>\
						<td width="167"><iframe src="http://www.hankyung.com/inc/common_top_weather.html" width="166" height="27" frameborder="0" scrolling="no"></iframe></td>\
					</tr>\
					</table>\
					<!-- ³¯¾¾ ³¡ -->\
				</td>\
				<td width="784" height="27" colspan="2">\
					<table width="784" border="0" cellpadding="0" cellspacing="0">\
					<tr valign="top">\
						<td width="784">\
							<!-- ¼­ºê ¸Þ´º ½ÃÀÛ -->\
							<table border="0" cellpadding="0" cellspacing="0">\
							<tr valign="top">\
							' + submenu + '\
							</tr>\
							</table>\
							<!-- ¼­ºê ¸Þ´º ³¡ -->\
						</td>\
					</tr>\
					</table>\
				</td>\
			</tr>\
			<tr><td height="12" bgcolor="#FFFFFF" colspan="3"></td></tr>\
		');
	} else {
		document.write('\
			<tr><td height="10" bgcolor="#FFFFFF" colspan="3"></td></tr>\
		');
	}

	document.write('\
		</table>\
		<map name="topmenu">\
		<area shape="rect" coords="0,9,88,34" href="http://w.hankyung.com/community/" target="_top" title="Ä®·³¡¤Ä¿¹Â´ÏÆ¼">\
		<area shape="rect" coords="106,9,169,34" href="http://w.hankyung.com/edu/" target="_top" title="±³À°¼¾ÅÍ">\
		<area shape="rect" coords="188,9,251,34" href="http://job.hankyung.com/" target="_top" title="Ãë¾÷¼¾ÅÍ">\
		<area shape="rect" coords="270,9,333,34" href="http://w.hankyung.com/changup/" target="_top" title="Ã¢¾÷¼¾ÅÍ">\
		</map>\
		<!-- ¸Þ´º ³¡ -->\
	');
}