var movieLayer=true;

function getCookie( name )
{
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length )
	{
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie ) {
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )  endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )break;
	}
	return "";
}

function moveRightEdge(ysize) {}

  function movelayer()
  {

	/*
	2011-03-24 ±è¹Î¼º ´ë¸®ÀÇ ºÎÅ¹
	if(!movieLayer){
		return false;
	}

    var s_top = document.body.scrollTop;
    var top = document.getElementById('divMenu').style.top;

    var Naver = false;
	if( getCookie("NaverChk") == "1") Naver = true;


    if (Naver == true)
      var top_length = 335;
    else
      var top_length = 282;

	if(typeof nid != 'undefined'){
		if(nid =='270'){
			top_length = top_length -7;
		}else if(nid =='600'){
			top_length = top_length -95;
		}

	}

    if (s_top > top_length)
    {
      var final_top = parseInt(s_top) - parseInt(top_length);
	  var c_top = parseInt(document.getElementById('divMenu').style.top);

		var msn_top = parseInt(document.getElementById('bmsnlayer').style.top);

	  // ½ºÅ©·Ñ½Ã È­¸éÀ§¿¡¼­ ½½¶óÀÌµå µÇµµ·Ï ÁÂÇ¥¸¦ Á¶ÀýÇÏ°í 1px¾¿ ´õÇØÁØ´Ù.
	  if (c_top < (final_top - 30)) {
		  c_top = final_top - 30;
		msn_top = final_top - 30;
	}

	  c_top++;
		msn_top++;

	  if (c_top > final_top) {
		  c_top = final_top;
		msn_top = final_top;
	}

      document.getElementById('divMenu').style.top = c_top + 'px';
      document.getElementById('bmsnlayer').style.top = msn_top + 'px';
    }
    else if (s_top <= top_length)
    {
	  document.getElementById('divMenu').style.top = '0px';
	  document.getElementById('bmsnlayer').style.top = '0px';
    }

    setTimeout(movelayer, 1);*/
  }



// °æÁ¦¿ë¾î»çÀü ¸µÅ©
function DicOpen()
{
	var url;

	if( document.all.kWord.value == "" )
		url = "http://www.hankyung.com/dic/popMain.php?popup=1&sAuto=0&sType=0";
	else
		url = "http://www.hankyung.com/dic/popSearch.php?popup=1&sAuto=0&sType=0&kWord="+document.all.kWord.value;

	jwopen(url,688,530,'no','no');

	return false;
}

function EnterCheck()
{
	if(event.keyCode ==13)
	{
		DicOpen();
	}
}


// msn ·¹ÀÌ¾î
function msnlayer()
{
	var obj = document.getElementById('msnlayer');
	if (obj.style.display == 'none') obj.style.display = 'block';
	else obj.style.display = 'none';
}

function msnlayer_bottom()
{
	var obj = document.getElementById('msnlayer_bottom');
	if (obj.style.display == 'none') obj.style.display = 'block';
	else obj.style.display = 'none';
}

function kisa_explation(layer)
{
	if( layer == "" )
		layer = "kisa_explation";

	var obj = document.getElementById(layer);

	if( typeof(obj) == "undefined" )
		return;

	if( obj.style.display == 'none' )
		obj.style.display = '';
	else
		obj.style.display = 'none';
}

document.write("<div id='bmsnlayer' style='position:absolute; z-index:99'>");
document.write("<div id='msnlayer' style='position:absolute; display:none; z-index:99'>");
var aid = getParameter('aid');
if (aid)
{
  var newsid = aid.substring(12,13);
}
if (newsid == '0' || newsid == '1' || newsid == '8' || newsid == '6' || newsid == '7' || newsid == 'e')
{
	document.write("<p style='margin:19 0 0 259'>");
}
else {
	document.write("<p style='margin:19 0 0 209'>");
}
document.write("<table width='107' border='0' cellpadding='0' cellspacing='0' style='border:solid 2px #F1E1A8;'>");
document.write("<tr>");
document.write("	<td bgcolor='FDFCF2'>");
document.write("		<p style='margin:10 8 7 8'>");
document.write("		<table width='87' border='0' cellpadding='0' cellspacing='0'>");
document.write("		<tr valign='top'>");
document.write("			<td class='arti_txt2 al'><img src='http://img.hankyung.com/img/icon_kisa_wlm.gif' width='14' height='12' border='0' align='absmiddle' style='margin:0 3 3 0'><a href='javascript:msn();'>¸Þ½ÅÀú¼­ºñ½º</a><p style='margin:7 0 0 0'><img src='http://img.hankyung.com/img/icon_kisa_bell.gif' width='12' height='12' border='0' align='absmiddle' style='margin:0 4 3 1'><a href='http://signup.alerts.live.com/alerts/login.do?PINID=42110279&returnURL=http://www.hankyung.com/'>´º½º¾Ë¸²½ÅÃ»</a></td>");
document.write("		</tr>");
document.write("		</table>");
document.write("	</td>");
document.write("</tr>");
document.write("</table>");
document.write("</div>");
document.write("</div>");


function getParameter(t)
{
  var r = false;
  tmp = window.location;
  tmp = String(tmp).split('?'); //? ÀÌÈÄ°¡ ¹è¿­¿¡ ´ã±è

  if (tmp.length > 1)
  {
    tmp=tmp[1].split('&');//º¯¼ö¸¦ °¢°¢À» ¹è¿­·Î ´ã°í


    for(k in tmp)
    {
      tmp2=tmp[k].split('='); //Å°¿Í °ªºÐ¸®

      if (tmp2[0] == t)
      {
        r = tmp2[1];
        break;
      }
    }
  }

  return r;
}



function OpenNewsWindow(url)
{
	var winObj;
		winObj = window.open(url,"NewsWindow","width=1024, height=800, scrollbars=yes");
}

function SendNews(media)
{
	var url;
	var title = utf8Title;
	var eUrl=location.href.replace("http://","");
	var thisUrl=escape(eUrl);
	var param = "apitype=shorturl&url=" + thisUrl + "&shortdomain=hk";

	var url = livereReply.url("LivereAPI" , param);
	jQuery.getJSON( url , function(data) {
		var result = livereReply.convertJSON( data );
		shortUrl=result.SHORTURL;

		switch(media){
			case "twitter":
				url = "http://twitter.com/home?status=" + title + "+" + shortUrl;
				OpenNewsWindow(url);
				break;
			case "facebook":
				url = "http://www.facebook.com/sharer.php?u=" + shortUrl + "&t=" + title + "&src=sp";
				OpenNewsWindow(url);
				break;
			case "metoday":
				url = "http://me2day.net/posts/new?new_post[body]=\"" + title + "\":" + shortUrl + "&new_post[tags]=%ED%95%9C%EA%B2%BD%EB%8B%B7%EC%BB%B4+%EB%89%B4%EC%8A%A4%EC%8A%A4%ED%81%AC%EB%9E%A9";
				OpenNewsWindow(url);
				break;
		}
	});
}



// ÀÚÃ¼±â»ç / ¿¬ÇÕ±â»çÀÏ °æ¿ì ¸ð¹ÙÀÏ Àü¼Û Çã¿ë
if( newsid == "0" || newsid == "1" || newsid == "8" || newsid == "6" || newsid == "7" || newsid == "e" )
{
	var strMob = "<img src='http://img.hankyung.com/img/icon_kisa_mobile.gif' border='0' align='absmiddle' style='margin:0 2 3 6'><a href=javascript:jwopen('http://www.m-kok.com/w2p/mkok.jsp?mcode=10081&nid=" + aid + "','730','900','no','no'); >¸ð¹ÙÀÏ</a>";
}
else
{
    var strMob = "";
}

document.write('\
	<div id="divMenu" style="position:relative; visibility:visible; top:0px;">\
		<table width="560" border="0" cellpadding="0" cellspacing="0" style="margin-top:8px;">\
		<tr valign="top" bgcolor="#f3f4f7">\
			<td style="border-top:1px solid #e7e9f0; border-bottom:1px solid #e7e9f0; padding:7px 0;" class="ac dm f11 sp01">\
			<!-- ÇÁ¸°Æ® ¹öÆ° -->\
			<a href=javascript:jwopen(\'' + printUrl + '\',678,672,\'yes\',\'no\'); ><img src="http://img.hankyung.com/img/icon_kisa_print3.gif" alt="ÇÁ¸°Æ®" border="0" align="absmiddle" style="margin:0 8px 0 0"></a>\
			<!-- ½ºÅ©·¦ ¹öÆ° -->\
			<a href=javascript:jwopen(\'' + scrapUrl + '\',220,300,\'yes\',\'no\'); ><img src="http://img.hankyung.com/img/icon_kisa_blog3.gif" alt="³» ºí·Î±×¿¡ ½ºÅ©·¦" border="0" align="absmiddle" style="margin:0 8px 0 0"></a>\
			<!-- ¸ÞÀÏ ¹öÆ° -->\
			<a href=javascript:jwopen(\'' + mailUrl + '\',678,750,\'no\',\'no\'); ><img src="http://img.hankyung.com/img/icon_kisa_mail3.gif" alt="¸ÞÀÏ º¸³»±â" border="0" align="absmiddle" style="margin:0"></a>\
			<img src="http://img.hankyung.com/img/icon_kisa_bar.gif" border="0" align="absmiddle" style="margin:0 12px">\
			<!-- Æ®À§ÅÍ ¹öÆ° -->\
			<a style="cursor:pointer;" onClick="javascript:SendNews(\'twitter\');"><img src="http://img.hankyung.com/img/icon_kisa_twitter2.gif" alt="Æ®À§ÅÍ·Î º¸³»±â" border="0" align="absmiddle" style="margin:0 8px 0 0"></a>\
			<!-- ÆäÀÌ½ººÏ ¹öÆ° -->\
			<a style="cursor:pointer;" onClick="javascript:SendNews(\'facebook\');"><img src="http://img.hankyung.com/img/icon_kisa_facebook2.gif" alt="ÆäÀÌ½ººÏÀ¸·Î º¸³»±â" border="0" align="absmiddle" style="margin:0 8px 0 0"></a>\
			<!-- ¹ÌÅõµ¥ÀÌ ¹öÆ° -->\
			<a style="cursor:pointer;" onClick="javascript:SendNews(\'metoday\');"><img src="http://img.hankyung.com/img/icon_kisa_me2day2.gif" alt="¹ÌÅõµ¥ÀÌ·Î º¸³»±â" border="0" align="absmiddle" style="margin:0"></a>\
			<img src="http://img.hankyung.com/img/icon_kisa_bar.gif" border="0" align="absmiddle" style="margin:0 12px">\
			<!-- Ãà¼Ò ¹öÆ° -->\
			<a href="javascript:fontSizeLevel(-1);"><img src="http://img.hankyung.com/img/icon_kisa_minus02.gif" alt="±ÛÀÚÃà¼Ò" border="0" align="absmiddle" style="margin:0"></a><!-- È®´ë ¹öÆ° --><a href="javascript:fontSizeLevel(1)"><img src="http://img.hankyung.com/img/icon_kisa_plus02.gif" alt="±ÛÀÚÈ®´ë" border="0" align="absmiddle" style="margin:0"></a><img src="http://img.hankyung.com/img/icon_kisa_bar.gif" border="0" align="absmiddle" style="margin:0 12px">\
			<!-- °æÁ¦¿ë¾î»çÀü -->\
			°æÁ¦¿ë¾î»çÀü<input type="text" onkeydown="javascript:EnterCheck();" name="kWord" style="width:80px; height:18px; margin:0 4px 0 6px; border:1px solid #d8d8d8;"><img src="http://img.hankyung.com/img/btn_search_common05.gif" border="0" align="absmiddle" onclick="javascript:DicOpen();" style="cursor:hand";>\
			</td>\
		</tr>\
		</table>\
	</div>\
');
movelayer();
