var menu01 = new Array(

//°Ç°­´º½º
"0::01::00::Çï½º´º½º::http://health.hankyung.com/health/news/",
"9::01::1", //Áß¸Þ´º½ÃÀÛ
"1::01::01::°ú¸ñº° ´º½º::http://health.hankyung.com/news/app/newslist.php?sid=1001&nid=280&type=3",
"1::01::06::À£ºù ´º½º::http://health.hankyung.com/news/app/newslist.php?sid=1005&nid=280&type=3",
"1::01::05::Çàº¹ÇÑàõ::http://health.hankyung.com/news/app/newslist.php?sid=011607&nid=280&type=3",
"1::01::02::°Ç°­Ä®·³::http://health.hankyung.com/news/app/newslist.php?sid=1002&nid=280&type=3",
"1::01::03::°Ç°­½Å¼­::http://health.hankyung.com/news/app/newslist.php?sid=1003&nid=280&type=3",
//"1::01::04::½Å¾à¼Ò°³::http://health.hankyung.com/news/app/newslist.php?sid=1004&nid=280&type=3",
"1::01::07::ÁøÂ¥ ´ÙÀÌ¾îÆ®::http://health.hankyung.com/news/app/newslist.php?sid=01062071&nid=280&type=3",
"9::01::4", //¸Þ´º´ÝÀ½

//°Ç°­µ¿¿µ»ó
"0::02::00::Çï½ºµ¿¿µ»ó::http://health.hankyung.com/health/vod/",
"9::02::1", //Áß¸Þ´º½ÃÀÛ
"1::02::01::°ú¸ñº°¸ÂÃãµ¿¿µ»ó::http://health.hankyung.com/health/vod/health_editlist.php",
"1::02::02::WOW¸ÞµðÄÃ¼¾ÅÍ::http://health.hankyung.com/health/vod/health_list.php",
"1::02::03::Ã£¾Æ¶óÀü¹®Å¬¸®´Ð::http://health.hankyung.com/health/vod/health_list.php?search_program=P0475",
"1::02::04::¸ÞµðÄÃÃÊ´ë¼®::http://health.hankyung.com/health/vod/health_list.php?search_program=P0681",
"1::02::05::¸ÞµðÄÃÆ÷Ä¿½º::http://health.hankyung.com/health/vod/health_list.php?search_program=P0477",
"1::02::06::ºÎºÎ¸¸Á·100%::http://health.hankyung.com/health/vod/health_list.php?search_program=P0561",
"1::02::07::Àß¸Ô°í Àß»ç´Â¹ý::http://health.hankyung.com/health/vod/health_list.php?search_program=P0770",
"1::02::08::ÀúÃâ»ê°í·ÉÈ­»çÈ¸::http://health.hankyung.com/health/vod/health_list.php?search_program=P0771",
"1::02::18::3ºÐ µ¿¿µ»ó::http://health.hankyung.com/health/board/list.php?id=3minute",
"1::02::09::Æ¯Áý ÇÁ·Î±×·¥::#",
"9::02::2", //¼Ò¸Þ´º½ÃÀÛ
"2::02::10::°í·Á¼öÁöÄ§°­ÁÂ::http://health.hankyung.com/health/vod/health_list.php?search_program=P0722",
"2::02::11::Áö¹æ°£µµÁúÈ¯ÀÌ´Ù::http://health.hankyung.com/health/vod/health_list.php?search_program=P0798",
"2::02::12::TVÀÇ·á¹ýÁ¤::http://health.hankyung.com/health/vod/health_list.php?search_program=P0578",
"9::02::3", //¼Ò¸Þ´º´ÝÀ½
"9::02::4", //¸Þ´º´ÝÀ½

//°Ç°­Ä®·³
"0::03::00::Çï½ºÄ®·³::http://health.hankyung.com/health/column/",
"9::03::1", //Áß¸Þ´º½ÃÀÛ
"1::03::01::°ú¸ñº° Ä®·³::http://health.hankyung.com/health/column/health_columnlist_all.php",
"1::03::02::Ä®·³´Ï½ºÆ®::http://health.hankyung.com/health/column/health_columnist_main.php",
"1::03::03::´ÚÅÍ Ä«Æä::http://health.hankyung.com/health/column/health_column_drcafe.php",
"9::03::4", //¸Þ´º´ÝÀ½

//Çï½ºÁ¤º¸
"0::04::00::Çï½ºÁ¤º¸::http://health.hankyung.com/health/info/",
"9::04::1", //Áß¸Þ´º½ÃÀÛ
"1::04::01::°ú¸ñº° Áúº´Á¤º¸::http://health.hankyung.com/health/info/health_infolist_heal.php?msid=2",
"1::04::02::ÀÇÇÐ »ó½Ä::http://health.hankyung.com/health/board/list.php?id=comsense",
"1::04::03::ÀÚ°¡Áø´Ü Å×½ºÆ®::http://health.hankyung.com/health/info/health_info_selftest.html",
//"1::04::04::°Ç°­»ó½Ä Yes No::http://health.hankyung.com/health/info/health_quiz.php",
"1::04::05::À£ºù¹ä»ó ::http://health.hankyung.com/health/board/list.php?id=wellbeing",
"9::04::4", //¸Þ´º´ÝÀ½

//Çï½º»ó´ã
"0::05::00::Çï½º»ó´ã::http://health.hankyung.com/health/counsel/",
"9::05::1", //Áß¸Þ´º½ÃÀÛ
"1::05::01::°ú¸ñº° »ó´ãÁ¤º¸::http://health.hankyung.com/health/board/list.php?id=counsel_online",
"1::05::02::»ó´ãÇÏ±â::http://health.hankyung.com/health/counsel/health_counsel_main.html",
"1::05::03::»ó´ãÁÖÄ¡ÀÇ::http://health.hankyung.com/health/counsel/health_consultor_main.php",
"1::05::04::ÀÇ·á»ç°í »ó´ã½Ç::http://health.hankyung.com/health/counsel/health_medicide_main.php",
"9::05::4", //¸Þ´º´ÝÀ½

//º£½ºÆ®Å¬¸®´Ð
"0::06::00::º£½ºÆ®Å¬¸®´Ð::http://health.hankyung.com/health/clinic/",
"9::06::1", //Áß¸Þ´º½ÃÀÛ
"1::06::01::°úº°º£½ºÆ®Å¬¸®´Ð::http://health.hankyung.com/health/clinic/health_cliniclist_all.php",
"1::06::02::º´¿ø´Ü½Å::http://health.hankyung.com/health/board/list.php?id=hospitalnews",
"1::06::03::º´¿ø°Ë»ö::http://health.hankyung.com/health/clinic/health_clinic_hossearch.php",
"1::06::04::º´¿øµî·Ï::http://health.hankyung.com/health/clinic/health_clinic_freeapp.php",
"1::06::05::º£½ºÆ®Å¬¸®´Ð¾È³»::http://health.hankyung.com/health/clinic/health_bestclinic_info.php",
"9::06::4", //¸Þ´º´ÝÀ½

//±âÅ¸
"0::99::00::±âÅ¸::",
"9::99::1", //Áß¸Þ´º½ÃÀÛ
"1::99::01::Çï½º °Ë»ö::http://health.hankyung.com/health/search/health_search.php",
"9::99::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);
}


var smenuArr = new Array();
var smenuFlag = false;
var line1 = "<img src='http://health.hankyung.com/health/img/menu_left_line.gif' width='100' height='2' align='absmiddle'>";

function menu(sub1,sub2) {
  var if2show = false;
  var left_ttl;
  var pm3 = "<p style=margin-top:3>";
  var pm5 = "<p style=margin-top:5>";
  var pm6 = "<p style=margin-top:6>";
  var pm7 = "<p style=margin-top:7>";
  var pm8 = "<p style=margin-top:8>";
  var pm9 = "<p style=margin-top:9>";
  var line2 = "<tr><td valign='top' height='5'></td></tr>";
  var img1 = "<img src='/health/img/menu_left_stop.gif' width='124' height='3' border='0'>";
  var img2 = "<img src='/health/img/menu_left_sbottom.gif' width='124' height='8' border='0'>";
  var bimg1 = "<img src='/health/img/menu_left_top.gif' width='150' height='6' border='0'>";
  var bimg2 = "<tr><td valign='top' background='/health/img/menu_left_body.gif'>";
  var bimg3 = "<img src='/health/img/menu_left_bottom.gif' width='150' height='6' border='0'>";
  var dimg = "<img src='/health/img/menu_left_spep_down.gif' width='13' height='12' border='0' align='absmiddle' style='margin:0 0 2 2; cursor:hand'>";
  var arw1 = "<img src='http://www.hankyung.com/img/arrow01_red.gif' width='4' height='13' align='absmiddle' style='margin-left:3px'>";
  var arw2 = "<img src='http://www.hankyung.com/img/arrow02_gray.gif' width='7' height='13' align='absmiddle' style='margin-left:3px'>";
  var td1 = "<tr><td valign='top'>";
  var td2 = "<tr><td><div id='smenu'><table width='100' cellpadding='0' cellspacing='0' border='0'><tr><td><img src='http://health.hankyung.com/health/img/menu_left_line02.gif' width='100' height='1' align='absmiddle'></td></tr><tr><td valign='top' style='padding-left:4px; background:B8DDE0; letter-spacing:-1;'>";
  var td3 = "</td></tr>";
  var td4 = "</div></td></tr><tr><td><img src='http://health.hankyung.com/health/img/menu_left_line02.gif' width='100' height='1' align='absmiddle'></td></tr></table>";

  // html ÄÚµå ½ÃÀÛ
  document.write ("<table width='150' border='0' cellpadding='0' cellspacing='0'>");
  document.write (td1 + bimg1 + td3 + bimg2);
  document.write ("<p style='margin:0 13 0 13'>");
  document.write ("<table width='124' border='0' cellpadding='0' cellspacing='0'>");

	var oldDepth;

  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 (menu01[i] != undefined) { // ¹è¿­¿¡ °ªÀÌ ¾øÀ» ¶© Ç¥½Ã ¾ÈÇÔ
      if (code1 == sub1) { // ÇØ´ç ´ëºÐ·ù¸¸ Ç¥½ÃÇÔ

        //´ë¸Þ´ºÇ¥½Ã
        if (depth == 0) {
			switch (code1) {
			 case '01': left_ttl="menu_left_newsttl.gif"; break;
			 case '02': left_ttl="menu_left_vodttl.gif"; break;
			 case '03': left_ttl="menu_left_columnttl.gif"; break;
			 case '04': left_ttl="menu_left_infottl.gif"; break;
			 case '05': left_ttl="menu_left_counselttl.gif"; break;
			 case '06': left_ttl="menu_left_clinicttl.gif"; break;
			}
				document.write ("<tr><td><a href='" + murl + "' target='_top'><img src='/health/img/" + left_ttl + "' height='30' border='0' style='margin:9 0 0 9'></a></td></tr>");
				document.write ("<tr><td valign='top' style='padding-top:7'>" + img1 + "</td></tr><tr><td valign='top' bgcolor='#CEE9EB' style='padding:0 8 0 12'>");
				document.write ("<p style='margin:1 0'>");
				document.write ("<table width='100' border='0' cellpadding='0' cellspacing='0'>");
		}

		if( oldDepth == depth ) {
			if( depth == 1 ) document.write(line1);
		}

		oldDepth = depth;

        //Áß¸Þ´ºÇ¥½Ã
        if (depth == 1) {
          if (code2 == sub2) {
			  if (code1 == 2  && code2 == 9) { document.write ( pm8 + "<font style='color:#4A7A91'>" + mname + "</font><a onclick=\"displaySMenu();\">" + dimg + "</a>" + pm5); }
			  else { document.write (pm8 + "<a href='" + murl + "' target='_top' style='color:#333; letter-spacing:-1'><b>" + mname + "</b></a>" + pm5); } //¼±ÅÃµÈ Áß¸Þ´º ½ºÅ¸ÀÏ

          } else {
			  if (code1 == 2  && code2 == 9) { document.write (pm8 + "<font style='color:#4A7A91'>" + mname + "</font><a onclick=\"displaySMenu();\">" + dimg + "</a>" + pm5); }
			  else { document.write (pm8 + "<a href='" + murl + "' target='_top' style='color:#4A7A91'>" + mname + "</a>" + pm5); }
			
          }
		  
        }

        //¼ÒºÐ·ùÇ¥½Ã
        if (depth == 2) {
          if (code2 == sub2) {
            document.write ("<a href='" + murl + "' target='_top' style='color:#6693A5'>" + mname + "</a>" + pm5); //¼±ÅÃµÈ ¼Ò¸Þ´º ºÓ°Ô (ºÓÀº È­»ìÇ¥ Æ÷ÇÔ)
          } else {
            document.write ("<a href='" + murl + "' target='_top' style='color:#6693A5'>" + mname + "</a>" + pm5); //¼Ò¸Þ´ºÇ¥½Ã
          }
        }

        //·¹ÀÌ¾Æ¿ô¿ä¼Ò Ç¥½Ã
        if (depth == 9) {
          switch (grph) {
            case '1': document.write (td1); break; //Áß¸Þ´º½ÃÀÛ
            case '2': document.write (td2 + pm6); break; //¼Ò¸Þ´º½ÃÀÛ
            case '3': document.write (td4 + td3 + td1); break; //¼Ò¸Þ´º³¡(Áß¸Þ´º½ÃÀÛ)
            case '4': document.write (td3); break; //¸Þ´º´ÝÀ½
          }
        }

      }
  }
  document.write ("</table>"); 
  document.write (td3 + "<tr><td valign='top' style='padding-bottom:7'>" + img2 + "</td></tr>");
  document.write ("</table>");
  document.write ("<script language='javascript'>displaySMenu();</script>");
  document.write (td3 + td1 + bimg3 + td3);
  document.write ("</table>");

}

var oldHtml = "";
function displaySMenu() {
	var obj = MM_findObj("smenu");

	if( obj == null ) return;

	if( oldHtml == "" )	oldHtml = obj.innerHTML;
	
	if( smenuFlag ) {
		obj.innerHTML = oldHtml;
		smenuFlag = false;
	}
	else {
		//obj.innerHTML = line1;
		obj.innerHTML = ""
		smenuFlag = true;
	}

	
}



function hbar(sub1,sub2) {

    var grp, murl='', mname='';
    var root = "<img src='/health/img/health_sub_history_icon.gif' width='11' height='11' border='0' align='absmiddle' style='margin-right:5'><a href='http://health.hankyung.com/' target='_top' style='color:#818181'>È¨</a> > ";
	var hla = "<a href='http://health.hankyung.com/health/news/' target='_top' style='color:#818181'>Çï½º´º½º</a> > ";
	var hlab = "<a href='http://health.hankyung.com/health/news/' target='_top' style='color:#818181'><b>Çï½º´º½º</b></a>";
	var hlb = "<a href='http://health.hankyung.com/health/vod/' target='_top' style='color:#818181'>Çï½ºµ¿¿µ»ó</a> > ";
	var hlbb = "<a href='http://health.hankyung.com/health/vod/' target='_top' style='color:#818181'><b>Çï½ºµ¿¿µ»ó</b></a>";
	var hlc = "<a href='http://health.hankyung.com/health/column/' target='_top' style='color:#818181'>Çï½ºÄ®·³</a> > ";
	var hlcb = "<a href='http://health.hankyung.com/health/column/' target='_top' style='color:#818181'><b>Çï½ºÄ®·³</b></a>";
	var hld = "<a href='http://health.hankyung.com/health/info/' target='_top' style='color:#818181'>Çï½ºÁ¤º¸</a> > ";
	var hldb = "<a href='http://health.hankyung.com/health/info/' target='_top' style='color:#818181'><b>Çï½ºÁ¤º¸</b></a>";
	var hle = "<a href='http://health.hankyung.com/health/counsel/' target='_top' style='color:#818181'>Çï½º»ó´ã</a> > ";
	var hleb = "<a href='http://health.hankyung.com/health/counsel/' target='_top' style='color:#818181'><b>Çï½º»ó´ã</b></a>";
	var hlf = "<a href='http://health.hankyung.com/health/clinic/' target='_top' style='color:#818181'>º£½ºÆ®Å¬¸®´Ð</a> > ";
	var hlfb = "<a href='http://health.hankyung.com/health/clinic/' target='_top' style='color:#818181'><b>º£½ºÆ®Å¬¸®´Ð</b></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 (hla);
					document.write ("<a href='" + murl + "' target='_top' style='color:#818181'><b>" + mname + "</b></a>"); break;
				default : document.write (hlab); break;
        	}
        } else if (isNaN(sub2)) {
            document.write (hla + " <b>" + sub2 + "</b>");
        } else {
            document.write (hlab);
        }
    }
	if (sub1 == 2) {
        if (mname != '') {
        	switch (grp) {
        	    case '1':
					document.write (hlb);
					document.write ("<a href='" + murl + "' target='_top' style='color:#818181'><b>" + mname + "</b></a>"); break;
				case '2':
					if (sub2 >= 10 && sub2 <= 12) {document.write (hlb + "Æ¯ÁýÇÁ·Î±×·¥ > <a href='" + murl + "' target='_top'><b>" + mname + "</b></a>");}	break;
				default : document.write (hlbb); break;
        	}
        } else if (isNaN(sub2)) {
            document.write (hlb + " <b>" + sub2 + "</b>");
        } else {
            document.write (hlbb);
        }
    }
	if (sub1 == 3) {
        if (mname != '') {
        	switch (grp) {
        	    case '1':
					document.write (hlc);
					document.write ("<a href='" + murl + "' target='_top' style='color:#818181'><b>" + mname + "</b></a>"); break;
				default : document.write (hlcb); break;
        	}
        } else if (isNaN(sub2)) {
            document.write (hlc + " <b>" + sub2 + "</b>");
        } else {
            document.write (hlcb);
        }
    }
	if (sub1 == 4) {
        if (mname != '') {
        	switch (grp) {
        	    case '1':
					document.write (hld);
					document.write ("<a href='" + murl + "' target='_top' style='color:#818181'><b>" + mname + "</b></a>"); break;
				default : document.write (hldb); break;
        	}
        } else if (isNaN(sub2)) {
            document.write (hld + " <b>" + sub2 + "</b>");
        } else {
            document.write (hldb);
        }
    }
	if (sub1 == 5) {
        if (mname != '') {
        	switch (grp) {
        	    case '1':
					document.write (hle);
					document.write ("<a href='" + murl + "' target='_top' style='color:#818181'><b>" + mname + "</b></a>"); break;
				default : document.write (hleb); break;
        	}
        } else if (isNaN(sub2)) {
            document.write (hle + " <b>" + sub2 + "</b>");
        } else {
            document.write (hleb);
        }
    }
	if (sub1 == 6) {
        if (mname != '') {
        	switch (grp) {
        	    case '1':
					document.write (hlf);
					document.write ("<a href='" + murl + "' target='_top' style='color:#818181'><b>" + mname + "</b></a>"); break;
				default : document.write (hlfb); break;
        	}
        } else if (isNaN(sub2)) {
            document.write (hlf + " <b>" + sub2 + "</b>");
        } else {
            document.write (hlfb);
        }
    }
	if (sub1 == 99) {
        if (mname != '') {
        	switch (grp) {
        	    case '1': document.write ("<a href='" + murl + "' target='_top'><b>" + mname + "</b></a>"); break;
        	    default : document.write (); break;
        	}
        } else if (isNaN(sub2)) {
            document.write (" <b>" + sub2 + "</b>");
        } else {
            document.write ();
        }
    }
}

// Å¸ÀÌÆ²¹Ù Ãâ·Â
function ttlbar(sub1,sub2,ttl) {


	var grp, murl='', mname='';
	var hla=' &lt; Çï½º´º½º'
	var hlb=' &lt; Çï½ºµ¿¿µ»ó'
	var hlc=' &lt; Çï½ºÄ®·³'
	var hld=' &lt; Çï½ºÁ¤º¸'
	var hle=' &lt; Çï½º»ó´ã'
	var hlf=' &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 + hla ); break;
        	    default : document.write (hla); break;
        	}
        } else if (isNaN(parseInt(sub2))) {
            document.write (sub2 + hla);
        } else {
            document.write (hla);
        }
    }
	if (sub1 == 2) {
        if (mname != '') {
        	switch (grp) {
        	    case '1': document.write ( mname + hlb ); break;
        	    default : document.write (hlb); break;
        	}
        } else if (isNaN(parseInt(sub2))) {
            document.write (sub2 + hlb);
        } else {
            document.write (hlb);
        }
    }
	if (sub1 == 3) {
        if (mname != '') {
        	switch (grp) {
        	    case '1': document.write ( mname + hlc ); break;
        	    default : document.write (hlc); break;
        	}
        } else if (isNaN(parseInt(sub2))) {
            document.write (sub2 + hlc);
        } else {
            document.write (hlc);
        }
    }
	if (sub1 == 4) {
        if (mname != '') {
        	switch (grp) {
        	    case '1': document.write ( mname + hld ); break;
        	    default : document.write (hld); break;
        	}
        } else if (isNaN(parseInt(sub2))) {
            document.write (sub2 + hld);
        } else {
            document.write (hld);
        }
    }
	if (sub1 == 5) {
        if (mname != '') {
        	switch (grp) {
        	    case '1': document.write ( mname + hle ); break;
        	    default : document.write (hle); break;
        	}
        } else if (isNaN(parseInt(sub2))) {
            document.write (sub2 + hle);
        } else {
            document.write (hle);
        }
    }
	if (sub1 == 6) {
        if (mname != '') {
        	switch (grp) {
        	    case '1': document.write ( mname + hlf ); break;
        	    default : document.write (hlf); break;
        	}
        } else if (isNaN(parseInt(sub2))) {
            document.write (sub2 + hlf);
        } else {
            document.write (hlf);
        }
    }

    document.write (" &lt; ÇÑ°æÇï½º :: ÇÑ°æ´åÄÄ ::</title>");
}
