	document.domain = "joins.com"	
	
	function getCookie(varname) {
		varname += "=";
		startpos = document.cookie.indexOf(varname);

		if (startpos >= 0) {
			startpos += varname.length;
			endpos = document.cookie.indexOf(";", startpos);
			if (endpos == -1) endpos = document.cookie.length;
			return unescape(document.cookie.substring(startpos, endpos));
		}
	}

	function getCookie2(uName,uName2)		//ÄíÅ°¿­ Áß¿¡ uName2ÀÇ °ªÀ» ±¸ÇÑ´Ù 
	{
		var string = getCookie(uName);
		
		var flag = string.indexOf(uName2+'=');
		if (flag != -1) 
		{ 
			flag += uName2.length + 1
			end = string.indexOf('&', flag) 

			if (end == -1) end = string.length
			return unescape(string.substring(flag, end))
		}
		else
		{
			return ""
		}
	}	
	
	function login_send() {
        if (document.frm_login.txtId.value == "")  {
               alert("È¸¿ø ID¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
               document.frm_login.txtId.focus();
               return;
        }
        if (document.frm_login.txtPasswd.value == "")  {
               alert("È¸¿ø ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
               document.frm_login.txtPasswd.focus();
               return;
        }
		document.frm_login.referer.value=window.location;
		document.frm_login.submit();
	}
	
	function getarticletime() {
		var todayDate = new Date();
		var atime = document.codes.atime.value;
		year = atime.substr(0,4);
		month = atime.substr(4,2);
		day = atime.substr(6,2);
		hour = atime.substr(8,2);
		min = atime.substr(10,2);

		var date = new Date(year, month - 1, day, hour, min);
		var intervalmin = Math.floor((todayDate - date) / (1000 * 60) + 1);
		if ((intervalmin > 60) && (intervalmin < 720))	{
			var tmp = (intervalmin / 60);
			var atimeh = parseInt( tmp, 10);
			var atimem = parseInt((tmp - atimeh) * 60, 10);
			intervalmin = atimeh + "½Ã°£ " + atimem + "ºÐÀü ¾÷µ¥ÀÌÆ®";
		}else if(intervalmin > 720){
			intervalmin = "["+year+"-"+month+"-"+day+" "+hour+":"+min+" ÀÔ·Â]";
		}else{
			intervalmin = intervalmin + "ºÐÀü ¾÷µ¥ÀÌÆ®";
		}
		document.write(intervalmin);
	}

	//·£´ý ¼ýÀÚ »ý¼ºÇÏ±â
	function get_random_num(max_num) {
		var rnd_no = Math.round(Math.random()*(max_num-1))+1;				//½ÇÁ¦ id°¡ 1ºÎÅÍ ½ÃÀÛÇÏ¹Ç·Î 1À» ´õÇß´Ù.(2°³¸é 1,2)
		return rnd_no;
	}

	function articleprint() {
		var aid = document.codes.aid.value ;
		window.open('http://isplussvc.joins.com/asp/articleprint.asp?aid='+aid, "articleprint", "left=0, top=0, width=602, height=680, scrollbars=yes, resizable=no");
	}
	
	function articleemail() {
		var aid = document.codes.aid.value ;
		window.open('http://isplussvc.joins.com/asp/articleemail.asp?aid='+aid, "articlemail", "left=0, top=0, width=400, height=450, scrollbars=no, resizable=no");
	}

	function clickrate_article_frame() {
		if (document.codes!=null) {
			var atype = document.codes.atype.value;
			if (atype=="A") {
				var aid = document.codes.aid.value ;
				//var servcode = document.codes.servcode.value;
				var maincode = document.codes.maincode.value;
				var go_url ="http://isplussvc.joins.com/asp/clickrate_article.asp?aid=" + aid + "&maincode=" + maincode;
				var strContent;
				//document.frames("hiddenclickrate").location=go_url;
				document.getElementById("hiddenclickrate").src = go_url;
			}
		}
	}
	function bodyonload() {
		initFont();
		clickrate_article_frame();
	}
	document.write ("<span  style='display:none'><IFRAME WIDTH=0 HEIGHT=0 NORESIZE SCROLLING=No FRAMEBORDER=0 MARGINHEIGHT=0 MARGINWIDTH=0 width=0 height=0 SRC='about:blank' name='hiddenclickrate' id='hiddenclickrate'></IFRAME></span>");


//============================ Font °ü·Ã ÇÔ¼ö ================================
	var article_fontSize = parseInt(getCookie("jes_article_fontSize"));

	function initFont() { 		
		if ( (article_fontSize < 1) || (article_fontSize > 6) || (isNaN(article_fontSize) == true)) {
				article_fontSize = 4;	
		}	
		setFont(article_fontSize);
	}
	function setFont(article_fontSize) { 		
		document.getElementById("arti_txt").className = "article0"+article_fontSize;
		setFontCookie(article_fontSize);
	}
	function setFontCookie(article_fontSize) {
		var expiry = new Date();
		var path = "/";
		var domain = ".joins.com";
		var secure = "";
		expiry.setTime(expiry.getTime() + 90 * (24 * 60 * 60 * 1000));
		setCookie("jes_article_fontSize",article_fontSize,expiry,path,domain,secure);
	}	
	function fontPlus() {		        
		if (article_fontSize < 6) {
			article_fontSize = article_fontSize + 1; 
			setFont(article_fontSize); 
		}
	}
	function fontMinus() {
		if (article_fontSize > 1) {
			article_fontSize = article_fontSize - 1; 
			setFont(article_fontSize); 
		}
	}
// ============================ Font °ü·Ã ÇÔ¼ö =============================


	function adswitch() {

		if (document.getElementById("component") == null){		//°ü·Ã±â»ç °íÁ¤»çÁø ÄÄÆ÷³ÍÆ®°¡ ¾øÀ»°æ¿ì¸¸ ±¤°í°¡ ¾ÈÀ¸·Î µé¾î°£´Ù.
			

			var new_content_top = "<!--// s : ±¤°í //--><div style='margin-bottom:15px;margin-left:15px;'><table width='250' cellspacing='0' cellpadding='0' border='0' align='right'><tr><td align='right' valign='top' style='padding:0 0 10px 10px;'>"
			var new_content_bottom = "</td></tr></table></div><!--// s : ±¤°í //-->"

			var new_content = new_content_top + document.getElementById("AD_250px_01").innerHTML + new_content_bottom;	

			document.getElementById("arti_txt").innerHTML = new_content + document.getElementById("arti_txt").innerHTML;
			document.getElementById("AD_250px_01").style.display = "none";

			jemiTot = 2;

/*
			var new_content_top = "<!--// s : ±¤°í //--><div style='margin-bottom:15px;margin-left:15px;'><table width='230' cellspacing='0' cellpadding='0' border='0' align='right'><tr><td align='right' valign='top' style='padding:0 0 5 0'>"
			var new_content_bottom = "</td></tr></table></div><!--// s : ±¤°í //-->"

			var currenturl = window.location.toString();
			var len = currenturl.length;
			
			var string = "";
			if (currenturl.lastIndexOf("/sports/baseball/", len)+1 >0) {
				var new_content = new_content_top + "<IFRAME WIDTH=220 HEIGHT=240 NORESIZE SCROLLING=No FRAMEBORDER=0 MARGINHEIGHT=0 MARGINWIDTH=0 SRC='http://isplus.joins.com/ui/ad/2006ad/adimg_baseball_220240.html'  id='midbanner240' ></IFRAME>" + new_content_bottom;	
			} else if (currenturl.lastIndexOf("/sports/soccer/", len)+1 >0) {
				var new_content = new_content_top + "<IFRAME WIDTH=220 HEIGHT=240 NORESIZE SCROLLING=No FRAMEBORDER=0 MARGINHEIGHT=0 MARGINWIDTH=0 SRC='http://isplus.joins.com/ui/ad/2006ad/adimg_football_220240.html'  id='midbanner240' ></IFRAME>" + new_content_bottom;	
			} else if (currenturl.lastIndexOf("/enter/movie/", len)+1 >0) {
				var new_content = new_content_top + "<IFRAME WIDTH=220 HEIGHT=240 NORESIZE SCROLLING=No FRAMEBORDER=0 MARGINHEIGHT=0 MARGINWIDTH=0 SRC='http://isplus.joins.com/ui/ad/2006ad/adimg_movie_220240.html'  id='midbanner240' ></IFRAME>" + new_content_bottom;	
			} else if (currenturl.lastIndexOf("/enter/", len)+1 >0) {
				var new_content = new_content_top + "<IFRAME WIDTH=220 HEIGHT=240 NORESIZE SCROLLING=No FRAMEBORDER=0 MARGINHEIGHT=0 MARGINWIDTH=0 SRC='http://isplus.joins.com/ui/ad/2006ad/adimg_enter_220240.html'  id='midbanner240' ></IFRAME>" + new_content_bottom;	
			} else if (currenturl.lastIndexOf("/leisure/", len)+1 >0) {
				var new_content = new_content_top + "<IFRAME WIDTH=220 HEIGHT=240 NORESIZE SCROLLING=No FRAMEBORDER=0 MARGINHEIGHT=0 MARGINWIDTH=0 SRC='http://isplus.joins.com/ui/ad/2006ad/adimg_leisure_220240.html'  id='midbanner240' ></IFRAME>" + new_content_bottom;	
			} else if (currenturl.lastIndexOf("/game/", len)+1 >0) {
				var new_content = new_content_top + "<IFRAME WIDTH=220 HEIGHT=240 NORESIZE SCROLLING=No FRAMEBORDER=0 MARGINHEIGHT=0 MARGINWIDTH=0 SRC='http://isplus.joins.com/ui/ad/2006ad/adimg_game_220240.html'  id='midbanner240' ></IFRAME>" + new_content_bottom;	
			} else if (currenturl.lastIndexOf("/comics/", len)+1 >0) {
				var new_content = new_content_top + "<IFRAME WIDTH=220 HEIGHT=240 NORESIZE SCROLLING=No FRAMEBORDER=0 MARGINHEIGHT=0 MARGINWIDTH=0 SRC='http://isplus.joins.com/ui/ad/2006ad/adimg_cartoon_220240.html'  id='midbanner240' ></IFRAME>" + new_content_bottom;	
			} else {
				var new_content = new_content_top + "<IFRAME WIDTH=220 HEIGHT=240 NORESIZE SCROLLING=No FRAMEBORDER=0 MARGINHEIGHT=0 MARGINWIDTH=0 SRC='http://isplus.joins.com/ui/ad/2006ad/adimg_generals_220240.html'  id='midbanner240' ></IFRAME>" + new_content_bottom;
			}
			document.all.arti_txt.innerHTML = new_content + document.all.arti_txt.innerHTML;
			document.all.right_banner.style.display = "none";
*/
		}

	}


	/***************************************       msn °ü·Ã ÇÔ¼ö      ********************************************/
function setCookie_domain(name ,value, expires, path, domain, secure)
{
	document.cookie = name + "=" + escape (value) +
	((expires) ? "; expires=" + expires.toGMTString() : "") +
	((path) ? "; path=" + path : "") +
	((domain) ? "; domain=" + domain : "") +
	((secure) ? "; secure" : "");
}

function fn_CookieAdd(value)
{
	var expiry = new Date();
	var name = "isplus_msn_newssvc";
	var path = "/";
	var domain = "joins.com";
	var secure = "";

	var urlData = location.href;
	var start_point = "";
	var end_point = "";

	deleteCookie(name)
	expiry.setTime(expiry.getTime() + 1 * (24 * 60 * 60 * 1000));
	setCookie_domain(name, value, expiry, path, domain, secure);
}

function fn_GetCookie() 
{
	var name = "isplus_msn_newssvc";
	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 fn_CheckCookie()
{
	if (!fn_GetCookie())
	{
		alert ("ÄíÅ°¼³Á¤°¡ Çã¿ëµÇÁö ¾ÊÀº °æ¿ì ´Ù¸¥±â»ç°¡ Àü¼ÛµÉ ¼ö ÀÖ½À´Ï´Ù. \n\nÀÎÅÍ³Ý¿É¼Ç¿¡¼­ ÄíÅ°Çã¿ëÀ» È®ÀÎÇØ ÁÖ¼¼¿ä.");
		return false;
	}
}

var obj;


function fn_TryMSN() {  
	var AppID = "99995582";
	var total_id = document.codes.aid.value;
	fn_CookieAdd(total_id);
	fn_CheckCookie();
	CheckMessenger();
	LaunchApp(AppID, "");
}

function CheckMessenger()
{
	eval ('try {obj = new ActiveXObject("MSNMessenger.P4QuickLaunch");} catch (e) {obj = null;}');
	var strErrorPage = "http://isplus.joins.com";
}

function LaunchApp(AppID, emailID)
{
	if (obj != null)
	{
		obj.LaunchApp(AppID, emailID);
	}
}

function delCookie(name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}

 /**
  * ÄíÅ° »èÁ¦
  * @param cookieName »èÁ¦ÇÒ ÄíÅ°¸í
  */
 function deleteCookie( cookieName )
 {
  var expireDate = new Date();
  
  //¾îÁ¦ ³¯Â¥¸¦ ÄíÅ° ¼Ò¸ê ³¯Â¥·Î ¼³Á¤ÇÑ´Ù.
  expireDate.setDate( expireDate.getDate() - 1 );
  document.cookie = cookieName + "= " + "; expires=" + expireDate.toGMTString() + "; path=/";
 }
 
// Article Page ¿¡¼­ ÇÃ·¹ÀÌ¾î Ã¢ È£ÃâÇÏ±â(µ¿¿µ»óID °ª ÇÊ¼ö) - Joins Ãø ¿äÃ» ³»¿ëÀÓ
function showplayiframe(movieID) {
	document.write("<center><iframe name='Jplayer' id='Jplayer' src='http://tv02.joins.com/movie_iframe.asp?mov_id="+ movieID +"' width=460 height=478 frameborder='0' scrolling=no leftmargin=0 topmargin=0></iframe></center>");
}

// Article Page ¿¡¼­ ÇÃ·¹ÀÌ¾î Ã¢ È£ÃâÇÏ±â _ Á¤ÀûÆäÀÌÁö (µ¿¿µ»óurl°ú ÀÌ¹ÌÁö°æ·Î ÇÊ¼ö)
function showplayiframe_static(mov_url, mov_img) {
document.write("<center><iframe name='Jplayer' id='Jplayer' src='http://news.joins.com/special/joinstv/movie_iframe.html?mov_url="+ mov_url +"&mov_img="+ mov_img +"' width=460 height=478 frameborder='0' scrolling=no leftmargin=0 topmargin=0></iframe></center>");
}
