document.write(" \
<style type='text/css'> \
#lnb{position:relative;float:right;margin:9px 0 0 0;z-index:6;} \
#lnb li.spn_chosun,#lnb li.busi,#lnb li#all_ser,#lnb li#myremot{float:left;color:#333333;} \
#lnb li.menu_font{float:left;color:#333333;font-size:12px;padding-top:3px;letter-spacing:-1px; font-family: 'Dotum', '돋움';} \
#lnb li img{vertical-align:middle;margin:0 0 2px 0;cursor:pointer;_cursor /**/:hand;} \
#lnb li span{padding:0 2px 0 1px;} \
#lnb li#all_ser{position:relative;} \
#lnb li#myremot{position:relative;margin:0 0 0 12px;display:inline;} \
#all_list{position:absolute;top:15px;right:0px;width:267px;padding:12px 0 6px 11px;border:2px solid #afafaf;background-color:#fff;display:none;z-index:7; color:#333333; font-family: 'Dotum', '돋움'; font-size:12px} \
#all_list ul{float:left;margin:0 20px 0 0;} \
#all_list ul.lastchild{margin:0;} \
#all_list ul li{float:none;margin:0 0 3px 0;letter-spacing:-1px;} \
#all_list ul li.all_view a{color:#cb7273;} \
\
#myremot_view{position:absolute;top:0px;left:76px;width:208px;border:2px solid #afafaf;background:#fff url('http://image.chosun.com/cs/gnb/bg_myremot.gif') left top no-repeat;padding:0 0 12px 0;z-index:8;display:none;} \
.myremot_tit{position:relative;margin:4px 5px 0 6px;padding:5px 0 2px 17px;background:#e3e3e3 url('http://image.chosun.com/cs/gnb/ic_remot.gif') 3px 5px no-repeat;color:#000;font-weight:bold; font-size:12px;font-family: 'Dotum', '돋움';} \
.myremot_tit span{position:absolute;top:3px;right:2px;} \
.myremot_tit span img#btn_close{margin:0 0 2px 2px;} \
.inbox_ff{width:197px;margin:4px 0 0 6px;background-color:#fff;} \
.inbox_ff .inbox_bor{width:195px;margin:1px;background-color:#fff;border:1px solid #dfdfdf;padding:8px 0 5px 0;overflow:hidden;} \
.inbox_bor p{position:relative;margin:0 1px 6px 1px;padding:0 0 0 7px;border-bottom:1px solid #d8d8d8;color:#bb3333;font-weight:bold;letter-spacing:-1px;font-size:12px;font-family: 'Dotum', '돋움';} \
.inbox_ff .inbox_bor p span{position:absolute;top:0px;right:9px;font-weight:normal;color:#c86a6a;cursor:pointer;_cursor /**/:hand;} \
.inbox_ff .inbox_bor ul{float:none;clear:both;margin:3px 0 0 2px;padding:0 0 0 0;overflow:hidden;} \
.inbox_ff .inbox_bor ul li{float:left;width:56px;margin:0 0 0 5px;display:inline;} \
.inbox_ff .inbox_bor ul li a{color:#c86a6a;letter-spacing:-1px;font-size:12px;font-family: 'Dotum', '돋움';} \
.view_art_tit{float:none;clear:both;margin:17px 0 0 10px;width:188px;border-bottom:1px solid #d1d1d1;font-weight:bold;color:#555555;overflow:hidden;font-size:12px;font-family: 'Dotum', '돋움';} \
.view_art_list{float:none;clear:both;margin:5px 0 0 4px;width:194px;} \
.view_art_list li span{font-weight:bold;color:#a4a4a4;} \
.view_art_list li{margin:3px 0 0 0;letter-spacing:-1px;font-size:12px;font-family: 'Dotum', '돋움';} \
.none_art{padding:18px 0 25px 0; text-align:center;color:#a4a4a4;} \
.remot_tab{margin:10px 0 0 10px;width:188px;background:url('http://image.chosun.com/cs/gnb/bg_remot_tab.gif') left top no-repeat;overflow:hidden;} \
.remot_tab li{float:left;width:61px;margin:1px 0 0 1px;padding:4px 0 4px 0;display:inline;text-align:center;letter-spacing:-1px; cursor:pointer;_cursor /**/:hand;font-size:12px;font-family: 'Dotum', '돋움';} \
.remot_tab li#rtab2{width:62px;} \
.remot_tab li a{color:#666666;} \
.remot_tab li.on{background-color:#fff;font-weight:bold;color:#666666;} \
.remot_tab li.off{background:url('http://image.chosun.com/cs/gnb/bg_remot_tab_off.gif') left top no-repeat;font-weight:normal;} \
.remot_tab li.off2{background:url('http://image.chosun.com/cs/gnb/bg_remot_tab2_off.gif') left top no-repeat;font-weight:normal;} \
.my_list{float:none;clear:both;margin:5px 0 0 4px;width:194px;display:none;} \
.my_list li span{font-weight:bold;color:#a4a4a4;} \
.my_list li{margin:3px 0 0 0;letter-spacing:-1px;font-size:12px;font-family: 'Dotum', '돋움';} \
.my_list_more {text-align:right; padding:0 5px 0 0;} \
\
#myremot_set{position:absolute;width:604px;border:2px solid #afafaf;background-color:#fff;top:128px;right:0px;z-index:9;padding:0 0 15px 0;overflow:hidden;display:none;} \
#myremot_set p.desc{position:relative;width:572px;color:#666;margin:22px 0 10px 20px; font-family: 'Dotum', '돋움'; font-size:12px;} \
#myremot_set p.desc span{position:absolute;top:-11px;right:0px;} \
.set_list{float:left;width:91px;margin:0 6px 0 16px;display:inline;} \
.set_list p{width:91px;background-color:#efefef;padding:6px 0 2px 0;text-align:center;color:#333;font-weight:bold;font-size:12px;font-family: 'Dotum', '돋움';} \
.set_list ul{margin:0 0 0 5px;padding:5px 0 20px 0;} \
.set_list ul li{margin:5px 0 0 0;color:#333;font-size:12px;font-family: 'Dotum', '돋움';} \
.submit_img{float:none;clear:both;position:relative;width:575px;margin:0 0 0 16px;padding:12px 0 0 0;border-top:1px solid #d2d2d2;text-align:center;} \
.submit_img span{position:absolute;right:0px;top:12px;} \
.inputCheck{vertical-align:middle; width:13px; height:13px;} \
</style> \
");



document.write(" \
	<ul id='lnb'> \
		<li class='menu_font'><a href='http://news.chosun.com/'>뉴스</a><span> | </span></li> \
		<li class='menu_font'><a href='http://news.chosun.com/se/'>스포츠·연예</a><span> | </span></li> \
		<li class='menu_font'><a href='http://newsplus.chosun.com/'>뉴스플러스</a><span> | </span></li> \
		<li class='menu_font'><a href='http://focus.chosun.com/'>포커스</a><span> | </span></li> \
		<li class='menu_font'><a href='http://blog.chosun.com/' target='_blank'>블로그</a><span> | </span></li> \
		<li class='menu_font'><a href='http://morningplus.chosun.com/' target='_blank'>모닝플러스</a><span> | </span></li> \
		<li id='all_ser' onMouseOut=\"lclose('all_list');\"> \
			<img src='http://image.chosun.com/cs/gnb/bar_allservice.gif' alt='전체서비스보기' onMouseOver=\"lview('all_list');\"> \
			<div id='all_list' onMouseOver=\"lview('all_list');\"> \
				<ul> \
					<li><a href='http://danmee.chosun.com/?Dep0=chosunmain&amp;Dep1=gnb&amp;Dep2=bar&amp;Dep3=danmee' target='_blank'>단미</a></li> \
					<li><a href='http://travel.chosun.com/?Dep0=chosunmain&amp;Dep1=gnb&amp;Dep2=bar&amp;Dep3=travel' target='_blank'>여행<a></li> \
					<li><a href='http://careview.chosun.com/?Dep0=chosunmain&amp;Dep1=gnb&amp;Dep2=bar&amp;Dep3=careview' target='_blank'>카리뷰</a></li> \
					<li><a href='http://people.chosun.com/?Dep0=chosunmain&amp;Dep1=gnb&amp;Dep2=bar&amp;Dep3=people'>인물정보</a></li> \
				</ul> \
				<ul> \
					<li><a href='http://golf.chosun.com/?Dep0=chosunmain&amp;Dep1=gnb&amp;Dep2=bar&amp;Dep3=golf' target='_blank'>골프</a></li> \
					<li><a href='http://keywui.chosun.com/?Dep0=chosunmain&amp;Dep1=gnb&amp;Dep2=bar&amp;Dep3=keywui' target='_blank'>키위</a></li> \
					<li><a href='http://kid.chosun.com/?Dep0=chosunmain&amp;Dep1=gnb&amp;Dep2=bar&amp;Dep3=kid' target='_blank'>소년조선</a></li> \
					<li><a href='http://comic.chosun.com/?Dep0=chosunmain&amp;Dep1=gnb&amp;Dep2=bar&amp;Dep3=comic' target='_blank'>만화</a></li> \
					</ul> \
				<ul> \
					<li><a href='http://cafe.chosun.com/?Dep0=chosunmain&amp;Dep1=gnb&amp;Dep2=bar&amp;Dep3=cafe' target='_blank'>카페</a></li> \
					<li><a href='http://bemil.chosun.com/?Dep0=chosunmain&amp;Dep1=gnb&amp;Dep2=bar&amp;Dep3=bemil' target='_blank'>유용원M</a></li> \
					<li><a href='http://issue.chosun.com/?Dep0=chosunmain&amp;Dep1=gnb&amp;Dep2=bar&amp;Dep3=issue'>이슈</a></li> \
					<li><a href='http://weather.chosun.com/'>날씨</a></li> \
				</ul> \
				<ul class='lastchild'> \
					<li><a href='http://review.chosun.com/?Dep0=chosunmain&amp;Dep1=gnb&amp;Dep2=bar&amp;Dep3=review' target='_blank'>리뷰</a></li> \
					<li><a href='http://health.chosun.com/?Dep0=chosunmain&amp;Dep1=gnb&amp;Dep2=bar&amp;Dep3=health' target='_blank'>헬스</a></li> \
					<li><a href='http://srchdb1.chosun.com/pdf/i_service/?Dep0=chosunmain&amp;Dep1=gnb&amp;Dep2=bar&amp;Dep3=pdf'>PDF·지면</a></li> \
					<li class='all_view'><a href='http://www.chosun.com/section/customer/sitemap.html?Dep0=chosunmain&amp;Dep1=gnb&amp;Dep2=bar&amp;Dep3=all'>전체보기 <img src='http://image.chosun.com/cs/gnb/ic_list.gif' alt=''></a></li> \
				</ul> \
			</div> \
		</li> \
		<li id='myremot'> \
			<img src='http://image.chosun.com/cs/gnb/btn_myrem.gif' alt='마이리모콘' onClick='javascript:openMyRemoteView()'> \
");



var lVar=false;
function lview(viewID){
	if(lVar==true){
	document.getElementById(viewID).style.display = 'none';
	lVar=false;
	} else {
	document.getElementById(viewID).style.display = 'block';
	lVar=true;
	}
	}
	function lclose(viewID){
	document.getElementById(viewID).style.display = 'none';
	lVar=false;
}


// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// 마이리모콘 API정의
// 마이홈에서 분리해서 몇가지 함수를 따로이 정의하는 것은 해당페이지를 마이홈과 분리되서 작동할 수 있도록 하기 위해서임

var MYREMOTECONST = new Object();
MYREMOTECONST.DEFAULT = [ "만평", "비지니스앤", "헬스", "문화야놀자", "플래시게임", "랭킹뉴스" ];
MYREMOTECONST.myremoteLinkCookieName = "myremote_links";
MYREMOTECONST.myremoteOpenCookieName = "myremote_open";
MYREMOTECONST.myremoteMaxLink = 9;

var MYREMOTEVAR = Class.create();
MYREMOTEVAR.myremoteLink = [];

// 마이리모콘 항목배열
// !!! 아래배열은 그 순서에 따라서 마이홈페이지의 설정과 관련이 많습니다. 마이홈서버에 장착되는
//     스크립트라면 아래 배열을 수정할 때 마이홈페이지도 같이 연동할 수 있도록 주의하여야 합니다.
MYREMOTECONST.URLS =
{
	// 뉴스
	"최신기사":"http://news.chosun.com/svc/list_in/list.html"
	, "경제":"http://news.chosun.com/economy/"
	, "정치":"http://news.chosun.com/politics/"
	, "사회":"http://news.chosun.com/national/"
	, "국제":"http://news.chosun.com/international/"
	, "문화":"http://news.chosun.com/culture/"
	, "사설/칼럼":"http://news.chosun.com/editorials/"
	, "스포츠":"http://news.chosun.com/sports/"
	, "연예":"http://news.chosun.com/ent/"
	, "포토":"http://photo.chosun.com/"
	, "만평":"http://photo.chosun.com/svc/list/cartoon_list.html?catid=5&amp;Dep0=chosunmain&amp;Dep1=gnb&amp;Dep2=myremote&amp;Dep3=cartoon"
	, "동영상":"http://video.chosun.com/"
	, "포커스":"http://focus.chosun.com/"
	, "이슈":"http://issue.chosun.com/"
	// 뉴스플러스
	, "골프":"http://golf.chosun.com/"
	, "단미":"http://danmee.chosun.com/"
	, "리뷰":"http://review.chosun.com/"
	, "문화야놀자":"http://playculture.chosun.com/?Dep0=chosunmain&amp;Dep1=gnb&amp;Dep2=myremote&amp;Dep3=culture"
	, "북스":"http://books.chosun.com/"
	, "붐업코리아":"http://boomup.chosun.com/"
	, "비지니스앤":"http://businesstv.chosun.com/?Dep0=chosunmain&amp;Dep1=gnb&amp;Dep2=myremote&amp;Dep3=businesstv"
	, "싱글N":"http://single.chosun.com/"
	, "아트N":"http://art.chosun.com/"
	, "영화":"http://cinema.chosun.com/servlet/cinema.MakeList.DispNowMList?dir=pre/prelist_dir"
	, "카리뷰":"http://careview.chosun.com/"
	, "키위닷컴":"http://keywui.chosun.com/"
	, "트래블N":"http://travel.chosun.com/?Dep0=chosunmain&amp;Dep1=gnb&amp;Dep2=myremote&amp;Dep3=travel"
	, "헬스":"http://health.chosun.com/?Dep0=chosunmain&amp;Dep1=gnb&amp;Dep2=myremote&amp;Dep3=health"
	// 커뮤니티
	, "카페":"http://cafe.chosun.com/"
	, "블로그":"http://blog.chosun.com/"
	, "블로그뉴스":"http://blognews.chosun.com/"
	, "블로그기자":"http://blogreporter.chosun.com/pressmain.screen"
	, "토론마당":"http://forum.chosun.com/"
	, "100자평":"http://newsplus.chosun.com/ranking/list.html?site=bbs"
	, "유용원 M":"http://bemil.chosun.com/"
	, "박선이 W":"http://special.chosun.com/w/index.html"
	, "김기철 B":"http://special.chosun.com/b/index.html"
	// 서비스
	, "마이홈":"http://myhome.chosun.com/"
	, "모닝플러스":"http://morningplus.chosun.com/"
	, "랭킹뉴스":"http://newsplus.chosun.com/ranking/index.html?Dep0=chosunmain&amp;Dep1=gnb&amp;Dep2=myremote&amp;Dep3=ranking"
	, "검색플러스":"http://search.chosun.com/"
	, "게임업":"http://gameup.chosun.com/"
	, "만화":"http://comic.chosun.com/ "
	, "무협":"http://promurim.chosun.com/main.asp"
	, "운세":"http://unse.chosun.com/"
	, "플래시게임":"http://flashgame.chosun.com/game_flash/?Dep0=chosunmain&amp;Dep1=gnb&amp;Dep2=myremote&amp;Dep3=game"
	, "성인문학관":"http://redbook.chosun.com/"
	, "RSS":"http://rssplus.chosun.com/rss/"
	, "모바일":"http://mobile.chosun.com/"
	, "아이리더":"http://ireader.chosun.com/"
	, "탑히스토리":"http://news.chosun.com/svc/top_history/top.html"
	, "요일별연재":"http://www.chosun.com/chosun/serialList.html"
	// 정보
	, "헤드라인":"http://srchdb1.chosun.com/headline/"
	, "PDF보기":"http://srchdb1.chosun.com/pdf/i_service/"
	, "인물정보":"http://people.chosun.com/?Dep0=chosunmain&amp;Dep1=gnb&amp;Dep2=myremote&amp;Dep3=people"
	, "날씨":"http://weather.chosun.com/"
	, "취업정보":"http://joba.chosun.com/"
	, "창업정보":"http://moneta.chosun.com/"
	, "온라인서점":""
	, "브랜드":"http://brandplus.chosun.com/"
	, "맛있는공부":"http://study.chosun.com/"
	// 매거진
	, "스포츠조선":"http://sports.chosun.com/"
	, "주간조선 ":"http://weekly.chosun.com/"
	, "소년조선":"http://kid.chosun.com/"
	, "월간산":"http://san.chosun.com/"
	, "월간조선":"http://monthly.chosun.com/"
	, "여성조선":"http://woman.chosun.com/"
	, "게임조선":""
};


// 마이리모콘 설정 관련 함수 정의 
var MYREMOTEAPI = new Object();

/**
 *	쿠키값을 읽어온다.
 *	@param keywords: 검색어 배열
 */
MYREMOTEAPI.loadCookie = function(name)
{
	var cookies = document.cookie.split("; ");

	for ( var i = 0; i < cookies.length; i++ )
	{
		var tokens = cookies[i].split("=");
		
		if ( name == tokens[0] ) {
			//alert("name:"+tokens[0]+" , value:"+unescape(tokens[1]));
			return unescape(tokens[1]);
		}
	}
	return null;
}

/**
 *	쿠키값을 설정한다.
 *	@param keywords: 검색어 배열
 */
MYREMOTEAPI.saveCookie = function(name, value)
{
	var argv = arguments;
	var argc = arguments.length;
	var expires = (2 < argc) ? argv[2] : null;
	var path = (3 < argc) ? argv[3] : null;
	var domain = (4 < argc) ? argv[4] : null;
	var secure = (5 < argc) ? argv[5] : false;

	var today = null;
	if(expires!=null) {
		var today = new Date();
		today.setDate( today.getDate() + parseInt( expires ) );
	}

	var cookieVal = name + "=" + escape(value) +
		((today == null) ? "" : ("; expires="+today.toGMTString())) +
		((path == null) ? "" : ("; path=" + path)) +
		((domain == null) ? "" : ("; domain=" + domain)) +
		((secure == true) ? "; secure" : "");

	document.cookie  = cookieVal
}


/**
 *	마이리모콘에 설정된 퀵링크 정보를 구한다.
 *	@return links: 바로가기 배열
 */
MYREMOTEAPI.loadLink = function()
{
	var cookies = document.cookie.split("; ");

	for ( var i = 0; i < cookies.length; i++ )
	{
		var tokens = cookies[i].split("=");
		//alert("cookie - "+tokens[0]+" : " +tokens[1]);

		if ( "myremote_links" == tokens[0] ) 
		{
			var	jsonStr = unescape(tokens[1]);
			//주의:prototype.js가 없을 경우에도 대비;
			if ( jsonStr != undefined && /\S+/.test(jsonStr) ) return (jsonStr.evalJSON == undefined) ? eval(jsonStr) : jsonStr.evalJSON();
		}
	}
	return MYREMOTECONST.DEFAULT;
}

MYREMOTEAPI.getUrl = function(linkName)
{
	var	url = MYREMOTECONST.URLS[linkName];
	return (url == undefined) ? "" : url;
}

/**
 *	마이리모콘에 설정된 퀵링크 정보를 구한다.
 *	@return links: 바로가기 배열
 */
MYREMOTEAPI.loadRemoteLinks = function()
{
	var	jsonStr = MYREMOTEAPI.loadCookie(MYREMOTECONST.myremoteLinkCookieName);
	return (jsonStr != undefined && /\S+/.test(jsonStr)) ? jsonStr.evalJSON() : MYREMOTECONST.DEFAULT;
}

/**
 *	마이리모콘에 설정된 퀵링크 정보를 저장한다.
 *	@param links: 바로가기 배열
 */
MYREMOTEAPI.saveRemoteLinks = function(links)
{	
	var	value = links.toJSON();
	MYREMOTEAPI.saveCookie(MYREMOTECONST.myremoteLinkCookieName, value, 365, "/", ".chosun.com");	
	//MYREMOTEAPI.saveCookie(MYREMOTECONST.myremoteCookieName, value, 365);
}

/** 
 * 마이리모콘 설정화면을 구성한다. 
 */
var	__REMOTE_STTING_SHOW = false;
var	__REMOTE_STTING_READ = false;

MYREMOTEAPI.showRemoteSetting = function()
{
	__REMOTE_STTING_SHOW = !__REMOTE_STTING_SHOW;

	if ( __REMOTE_STTING_SHOW )
	{
		// 꼭,이곳에서 설정을 읽어와서 설정판을 구성한다.
		// 그 이유는, 입력값 캐싱된 것과 충돌을 피할 수 있고, 초기화면뜨는 시간을 조금이라도 덜 수 있다.

		if ( !__REMOTE_STTING_READ )
		{			
			MYREMOTEVAR.myremoteLink = MYREMOTEAPI.loadRemoteLinks();

			var	remoteFinder = "";
			for ( var i = 0; i < MYREMOTEVAR.myremoteLink.length; i++ ) remoteFinder += ("^" + MYREMOTEVAR.myremoteLink[i] + "$");

			var	remoteCheckboxs = document.getElementsByName("remote_checkbox");
			for ( var i = 0; i < remoteCheckboxs.length; i++ )
			{
				remoteCheckboxs[i].onclick = myremoteChecked.bind(remoteCheckboxs[i]);
				remoteCheckboxs[i].checked = (remoteFinder.indexOf("^" + remoteCheckboxs[i].value + "$") != -1);
			}
			
			__REMOTE_STTING_READ = true;
		}
		
		$('myremot_set').style.display='block';
		$('myremot_set').style.visibility = 'visible';
	}
	else
	{ 
		$('myremot_set').style.display = "none";
		$('myremot_set').style.visibility = "hidden";
	}
}

/**
 *	마이리모콘 퀵링크 정보를 설정하는 동시에 화면에 보여준다.
 */
MYREMOTEAPI.refresh = function()
{
	try
	{
		var	links = MYREMOTEAPI.loadLink();
		var	htmlCode = "";
		htmlCode += "<p>Quick Link<span onclick='javascript:MYREMOTEAPI.showRemoteSetting()' style='cursor:hand'><img src='http://image.chosun.com/cs/gnb/ic_list.gif' alt=''> 설정</span></p>";

		// 3개씩 나누어 쓴다.
		var splitCount = 3;
		for ( var i = 0; i < links.length; i += splitCount )
		{
			htmlCode += "<ul>";
			var endIndex = i + splitCount;
			if( endIndex > links.length )	 endIndex = links.length;

			for ( var k = i; k < endIndex ; k++ )
			{
				var	url = MYREMOTEAPI.getUrl(links[k]);
				if ( url == "" ) continue;
				htmlCode += "<li><a href='" + url + "'>" + links[k] + "</a></li>";
			}			
			htmlCode += "</ul>";
		}
	
		var	linkDiv = document.getElementById("__myremote_link_p");
		linkDiv.innerHTML = htmlCode;
	}
	catch(e) {}
}

/** 
 * 마이리모콘 설정정보를 저장한다.
 */
MYREMOTEAPI.saveRemoteSetting = function()
{
	// 저장한다.
	MYREMOTEAPI.saveRemoteLinks(MYREMOTEVAR.myremoteLink);

	alert("설정정보가 저장되었습니다");

	// 설정한 정보가 마이리모콘 화면에 보여지도록 한다.	
	if(MYREMOTEAPI != undefined) MYREMOTEAPI.refresh();
}

/** 
 * 마이리모콘 설정을 추가/삭제한다.
 */
 function myremoteChecked()
{	
	if ( this.checked ) // 추가
	{
		if ( MYREMOTEVAR.myremoteLink.length < MYREMOTECONST.myremoteMaxLink )
		{
			if(this.value == "온라인서점" || this.value == "게임조선")
			{
				this.checked = false;
				alert("준비중입니다.");
				return;
			}
			MYREMOTEVAR.myremoteLink[MYREMOTEVAR.myremoteLink.length] = this.value;
		}
		else
		{
			this.checked = false;
			alert("최대 9개까지 설정이 가능합니다.");
			return;
		}
	}
	else if ( !this.checked )	 //삭제
	{
		// 삭제위치를 찾는다.
		var	index = 0;
		for ( ; index < MYREMOTEVAR.myremoteLink.length; index++ )
		{
			if ( MYREMOTEVAR.myremoteLink[index] == this.value ) break;
		}
		
		// 삭제하고, 댕긴다.
		var	endIndex = MYREMOTEVAR.myremoteLink.length - 1;
		for ( var i = index; i < endIndex; i++ )
		{
			MYREMOTEVAR.myremoteLink[i] = MYREMOTEVAR.myremoteLink[i + 1];
		}
		
		MYREMOTEVAR.myremoteLink.length--;
	}		
	//alert("length:"+MYREMOTEVAR.myremoteLink.length);
}

/** 
 * 마이리모콘 설정을 초기화한다.
 */
function resetRemoteCheck()
{
	//alert("length:"+MYREMOTEVAR.myremoteLink.length);

	var	remoteCheckboxs = document.getElementsByName("remote_checkbox");
	for ( var i = 0; i < remoteCheckboxs.length; i++ )
	{
		if(remoteCheckboxs[i].checked) {
			remoteCheckboxs[i].checked = false;
			MYREMOTEVAR.myremoteLink.length = 0;
		}
	}
}

function chkMyRemoteView()
{
	var cookieVal = MYREMOTEAPI.loadCookie(MYREMOTECONST.myremoteOpenCookieName);
	if(cookieVal != undefined && cookieVal == 'true') 
	{
		document.getElementById('myremot_view').style.display='block';
		ch_mlayer_init();
	}
}

function openMyRemoteView()
{	
	document.getElementById('myremot_view').style.display='block';
	ch_mlayer_init();
	MYREMOTEAPI.saveCookie(MYREMOTECONST.myremoteOpenCookieName, 'true', null, '/', '.chosun.com');
}

function closeMyRemoteView()
{
	var expireDate = new Date();
	expireDate.setDate(expireDate.getDate() - 1);

	MYREMOTEAPI.saveCookie(MYREMOTECONST.myremoteOpenCookieName, '', expireDate.toGMTString(), '/', '.chosun.com');

	document.getElementById('myremot_view').style.display='none';
	document.getElementById('myremot_set').style.display='none';
}



// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// 마이리모콘 박스

// 퀵 링크
document.write(" \
			<!-- 마이리모콘 우측 팝업레이어 --> \
			<div id='myremot_view'> \
				<p class='myremot_tit'>마이리모콘<span><a href='http://myhome.chosun.com/'><img src='http://image.chosun.com/cs/gnb/btn_myhome.gif' alt='마이홈'></a><img src='http://image.chosun.com/cs/gnb/btn_rem_close.gif' alt='마이리모콘 숨기기' id='btn_close' onclick=\"closeMyRemoteView()\"></span></p> \
				<!-- quick_link --> \
				<div class='inbox_ff'> \
					<div id='__myremote_link_p' class='inbox_bor'> \
						<!--p>Quick Link<span onclick=\"document.getElementById('myremot_set').style.display='block';\"><img src='http://image.chosun.com/cs/gnb/ic_list.gif' alt=''> 설정</span></p--> \
						<p>Quick Link<span onclick='javascript:MYREMOTEAPI.showRemoteSetting()' style='cursor:hand'><img src='http://image.chosun.com/cs/gnb/ic_list.gif' alt=''> 설정</span></p> \
");
try
{
	var	links = MYREMOTEAPI.loadLink();
	// 3개씩 나누어 쓴다.
	var splitCount = 3;
	for ( var i = 0; i < links.length; i += splitCount )
	{
		document.write("<ul>");
		var endIndex = i + splitCount;
		if( endIndex > links.length )	 endIndex = links.length;
		for ( var k = i; k < endIndex ; k++ )	document.write("<li><a href='" + MYREMOTEAPI.getUrl(links[k]) + "'>" + links[k] + "</a></li>");
		document.write("</ul>");
	}
}
catch(e){}	

// 내가 본 기사, 내스크랩, 내 백자평, 내 토론방
document.write(" \
					</div> \
				</div> \
				<!-- quick_link --> \
\
				<p class='view_art_tit'>내가본기사</p> \
				<ul id='my_list0' class='view_art_list'> \
				</ul> \
\
				<ul class='remot_tab'> \
					<li id='rtab1' class='off' onclick=\"ch_mlayer_display(1,1)\">내 스크랩</li> \
					<li id='rtab2' class='off2' onclick=\"ch_mlayer_display(2,1)\">내 백자평</li> \
					<li id='rtab3' class='off' onclick=\"ch_mlayer_display(3,1)\">내 토론방</li> \
				</ul> \
				<ul id='my_list1' class='my_list'> \
				</ul> \
				<ul id='my_list2' class='my_list'> \
				</ul> \
				<ul id='my_list3' class='my_list'> \
				</ul> \
");

function ch_mlayer(n){
	for (i=1; i<4 ; i++){
		if(i==2){
			document.getElementById('rtab'+i).className = 'off2';
			document.getElementById('my_list'+i).style.display = 'none';
		}else{
			document.getElementById('rtab'+i).className = 'off';
			document.getElementById('my_list'+i).style.display = 'none';
		}
	}
	document.getElementById('rtab'+n).className = 'on';
	document.getElementById('my_list'+n).style.display = 'block';
}

// 마이리모콘 활성화
function ch_mlayer_init() {
	// 내가본기사 
	ch_mlayer_display(0,0);
	// 내스크랩
	//ch_mlayer_display(1,1);
}
function ch_mlayer_display (ul_id, ul_login){
	var li_div = "my_list" + ul_id;
	var tmpObj = document.getElementById(li_div);

	// 로그인확인
	var ch_login = checkLogin();

	if( ul_login == 1 && ch_login == 0 ) {
		var tmp_li = tmpObj.getElementsByTagName('li')
		if(tmp_li.length == 0) {
			li_obj = document.createElement('li');
			li_obj.className='none_art';
			li_text = document.createTextNode('로그인이 필요한 서비스입니다.')
			li_obj.appendChild(li_text);
			tmpObj.appendChild(li_obj);
		}
	}
	else {
		var tmp_li = tmpObj.getElementsByTagName('li')
		if(tmp_li.length == 0) {
			// <li> 태그의 유무에 따라서 작동, 최초에 한번만 접근해서 값을 가져오고 작동하지 않는다.
			var head = document.getElementsByTagName("head").item(0);
			var script = document.createElement ("script");
			if(0 == ul_id) {
				// 내가 본 기사
				script.src = 'http://news.chosun.com/svc/chosun/art_his_main.php?returnFunction=ch_mplayer_data&showLen=44&showDiv='+li_div;
				head.appendChild (script);
			}
			else if(1 == ul_id) {
				// 내 스크랩
				script.src = 'http://newsplus.chosun.com/ranking/scrap/my_scrap.html?returnFunction=ch_mplayer_data&showLen=30&showDiv='+li_div;
				head.appendChild (script);
			}
			else if (2 == ul_id) {
				// 내 백자평
				script.src = 'http://m100.chosun.com/svc/guest/extern/myguest.html?returnFunction=ch_mplayer_data&showLen=30&showDiv='+li_div;
				head.appendChild (script);
			}
			else if (3 == ul_id) {
				// 내 토론방
				script.src = 'http://forum.chosun.com/bbs.extern.my_message.screen?reutrnFunction=ch_mplayer_data&showLen=15&showDiv='+li_div;
				script.charset = "UTF-8";
				head.appendChild (script);
			}
		}

	}
	if(0 != ul_id) ch_mlayer(ul_id);
}

function ch_mplayer_data(myObject) {

	var li_div = myObject.root[0].show_div;	
	var tmpObj = document.getElementById(li_div);
	if (tmpObj == null) return;
	var item_total = myObject.root[0].total;	

	// 한번더 확인 - <li> 태그의 유무에 따라서 작동, 최초에 한번만 접근해서 값을 가져오고 작동하지 않는다.
	var tmp_li = tmpObj.getElementsByTagName('li')
	if(tmp_li.length == 0) {

		if(item_total > 0) {
		
			for(var i=0; i<item_total; i++) {
				li_obj = document.createElement('li');
				li_obj.style.color='#000000';
				span_obj = document.createElement('span');
				span_text = document.createTextNode('ㆍ');
				span_obj.appendChild(span_text);
							
				var my_link = document.createElement('a');
				var my_href = document.createAttribute('href')
				my_href.value = myObject.root[0].item[i].url;
				my_link.setAttributeNode(my_href);
			
				var my_target = document.createAttribute('target');
				my_target.value = '_blank';
				my_link.setAttributeNode(my_target);
		
				if( checkIE() ) {
					// IE version
					my_link.innerText = myObject.root[0].item[i].title;
				} else {
					// FF version
					var my_title = document.createTextNode(myObject.root[0].item[i].title);
					my_link.appendChild(my_title);					
				}
			
				li_obj.appendChild(span_obj);
				li_obj.appendChild(my_link);
				tmpObj.appendChild(li_obj);
			}
			
			// 마지막 더보기 링크 - 내가 본 기사 제외
			if ("my_list0" == li_div) {}
			else {
				li_obj = document.createElement('li');
				li_obj.className = "my_list_more";
				
				var my_link = document.createElement('a');
				var my_href = document.createAttribute('href')
				
				if ("my_list1" == li_div)
					my_href.value = "http://newsplus.chosun.com/scrap/index.html";
				else if ("my_list2" == li_div)
					my_href.value = "http://m100.chosun.com/svc/guest/user/myBbs.html";
				else
					my_href.value = "http://forum.chosun.com/mybbs.jsp";
					
				my_link.setAttributeNode(my_href);
				
				var my_target = document.createAttribute('target');
				my_target.value = '_blank';
				my_link.setAttributeNode(my_target);
				
				if( checkIE() ) {
					// IE version
					my_link.innerText = "+더보기";
				} else {
					// FF version
					var my_title = document.createTextNode("+더보기");
					my_link.appendChild(my_title);
				}
				
				li_obj.appendChild(my_link);
				tmpObj.appendChild(li_obj);
			}
		}
		else {
			li_obj = document.createElement('li');
			li_obj.className='none_art';
			
			if ("my_list0" == li_div)
				li_text = document.createTextNode('내가 본 기사가 없습니다.');
			else if ("my_list1" == li_div)
				li_text = document.createTextNode('내가 스크랩한 기사가 없습니다.');
			else if ("my_list2" == li_div)
				li_text = document.createTextNode('내가 쓴 100자평이 없습니다.');
			else
				li_text = document.createTextNode('내가 참여한 토론방이 없습니다.');
			li_obj.appendChild(li_text);
			tmpObj.appendChild(li_obj);		
			
		}
	}
}
function default_function (myObject){
	ch_mplayer_data(myObject);
}

function checkIE() {
	if (navigator.appName == "Microsoft Internet Explorer") return true;
	else return false;
}

function ch_mlayer(n){
	for (i=1; i<4 ; i++){
		if(i==2){
			document.getElementById('rtab'+i).className = 'off2';
			document.getElementById('my_list'+i).style.display = 'none';
		}else{
			document.getElementById('rtab'+i).className = 'off';
			document.getElementById('my_list'+i).style.display = 'none';
		}
	}
	document.getElementById('rtab'+n).className = 'on';
	document.getElementById('my_list'+n).style.display = 'block';
}

function checkLogin() {
    if (!ch_mplayer_cookie('SMSESSION') || ch_mplayer_cookie('SMSESSION') == "LOGGEDOFF" || !ch_mplayer_cookie('SM_USER')) {
        return 0;
    }
    else {
        return 1;
    }
}
function ch_mplayer_cookie (name) {
    var cookies = document.cookie;
    var value  = "";
 
    if(cookies.indexOf(name) != -1) {
        var start = cookies.indexOf(name) + name.length + 1;
        var end   = cookies.indexOf(";",start);
 
        if(end == -1) end = cookies.length;
 
        value = cookies.substring(start,end);
        value = unescape(value);
    }
 
    return value;
}



// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// 마이리모콘 퀵링크 설정 박스 
document.write(" \
			</div> \
			<!--  마이리모콘 설정 팝업 시작 --> \
			<div id='myremot_set'> \
				<p class='desc'>자주가는 서비스를 최대 9개까지 설정할 수 있습니다.<span><img src='http://image.chosun.com/cs/gnb/btn_close_img.gif' alt='설정창 닫기' onclick=\"document.getElementById('myremot_set').style.display='none';__REMOTE_STTING_SHOW=false;\"></span></p> \
				<form action='' method='post' class='myremot_setting'> \
					<fieldset> \
						<legend>마이리모콘 세팅선택</legend> \
						<div class='set_list'> \
							<p>뉴스</p> \
							<ul> \
");
try {
	var	myremoteKeys = null;
	myremoteKeys = $H(MYREMOTECONST.URLS).keys();
	for ( var i = 0; i < 14; i++ )	{
		var	name = myremoteKeys[i];
		document.write("<li><input type='checkbox' name='remote_checkbox' value='"+ name + "' class='inputCheck' title='"+name+"'> " + name + "</il>");
	}
}
catch(e) { }
document.write(" \
							</ul> \
						</div> \
						<div class='set_list'> \
							<p>뉴스플러스</p> \
							<ul> \
");
try {
	for ( var i = 14; i < 28; i++ ) {
		var	name = myremoteKeys[i];
		document.write("<li><input type='checkbox' name='remote_checkbox' value='"+ name + "' class='inputCheck' title='"+name+"'> " + name + "</il>");
	}
}
catch(e) { }
document.write(" \
							</ul> \
						</div> \
						<div class='set_list'> \
							<p>커뮤니티</p> \
							<ul> \
");
try {
	for ( var i = 28; i < 34; i++ ) {
		var	name = myremoteKeys[i];
		document.write("<li><input type='checkbox' name='remote_checkbox' value='"+ name + "' class='inputCheck' title='"+name+"'> " + name + "</il>");
	}
}
catch(e) { }
document.write(" \
							</ul> \
							<ul> \
");
try {
	for ( var i = 34; i < 37; i++ ) {
		var	name = myremoteKeys[i];
		document.write("<li><input type='checkbox' name='remote_checkbox' value='"+ name + "' class='inputCheck' title='"+name+"'> " + name + "</il>");
	}
}
catch(e) { }
document.write(" \
							</ul> \
						</div> \
						<div class='set_list'> \
							<p>서비스</p> \
							<ul> \
");
try {
	for ( var i = 37; i < 41; i++ ) {
		var	name = myremoteKeys[i];
		document.write("<li><input type='checkbox' name='remote_checkbox' value='"+ name + "' class='inputCheck' title='"+name+"'> " + name + "</il>");
	}
}
catch(e) { }
document.write(" \
							</ul> \
							<ul> \
");
try {
	for ( var i = 41; i < 47; i++ ) {
		var	name = myremoteKeys[i];
		document.write("<li><input type='checkbox' name='remote_checkbox' value='"+ name + "' class='inputCheck' title='"+name+"'> " + name + "</il>");
	}
}
catch(e) { }
document.write(" \
							</ul> \
							<ul> \
");
try {
	for ( var i = 47; i < 52; i++ ) {
		var	name = myremoteKeys[i];
		document.write("<li><input type='checkbox' name='remote_checkbox' value='"+ name + "' class='inputCheck' title='"+name+"'> " + name + "</il>");
	}
}
catch(e) { }
document.write(" \
							</ul> \
						</div> \
						<div class='set_list'> \
							<p>정보</p> \
							<ul> \
");
try {
	for ( var i = 52; i < 61; i++ ) {
		var	name = myremoteKeys[i];
		document.write("<li><input type='checkbox' name='remote_checkbox' value='"+ name + "' class='inputCheck' title='"+name+"'> " + name + "</il>");
	}
}
catch(e) { }
document.write(" \
							</ul> \
							<p>매거진</p> \
							<ul> \
");
try {
	for ( var i = 61; i < 68; i++ ) {
		var	name = myremoteKeys[i];
		document.write("<li><input type='checkbox' name='remote_checkbox' value='"+ name + "' class='inputCheck' title='"+name+"'> " + name + "</il>");
	}
}
catch(e) { }
document.write(" \
							</ul> \
						</div> \
						<div class='submit_img'> \
							<img src='http://image.chosun.com/cs/gnb/btn_save.gif' alt='저장' onClick='javascript:MYREMOTEAPI.saveRemoteSetting()'> \
							<span><img src='http://image.chosun.com/cs/gnb/btn_reset.gif' alt='초기화' onClick='javascript:resetRemoteCheck()'></span> \
						</div> \
					</fieldset> \
				</form> \
			</div> \
			<!--  마이리모콘 설정 팝업 끝 --> \
		</li> \
	</ul> \
");

chkMyRemoteView();
