// ½½·Î°Ç
document.title = "TVº¸´Ù ´õ Å« ¼¼»ó, iMBC.com";
document.write("<script" + " src=http://www.imbc.com/common/js/makePCookie.js></script" + ">");

//document.domain = "imbc.com";

// IMBC ID GET
ID = escape(getCookie("IMBCMAIN"))
tUrl = document.location

// Ad flag ¿µ¿ª
if (typeof(sCurAdFlag) == "undefined") {
	var sCurAdFlag = "sub";			

	var sCurLoc = String(document.location).toLowerCase();
	var arrTemp;

	var arrMainAdLoc = new Array("http://www.imbc.com","http://www.imbc.com/broad/tv/drama","http://www.imbc.com/broad/tv/ent","http://www.imbc.com/broad/tv/culture","http://www.imbc.com/broad/radio","http://imnews.imbc.com","http://imbc.com","http://imbc.com/broad/tv/drama","http://imbc.com/broad/tv/ent","http://imbc.com/broad/tv/culture","http://imbc.com/broad/radio", "http://search.imbc.com", "http://cue.imbc.com");
	var arrSubAdLoc = new Array("http://www.imbc.com/","http://www.imbc.com/broad/tv/drama/","http://www.imbc.com/broad/tv/ent/","http://www.imbc.com/broad/tv/culture/","http://www.imbc.com/broad/radio/","http://imnews.imbc.com/","http://imbc.com/","http://imbc.com/broad/tv/drama/","http://imbc.com/broad/tv/ent/","http://imbc.com/broad/tv/culture/","http://imbc.com/broad/radio/", "http://search.imbc.com/", "http://cue.imbc.com");
	var arrEtcAdLoc = new Array("http://sports.imbc.com");

	var arrMainAdType = new Array("main","drama/dramamain","ent/entmain","culture/culturemain","radio/radiomain","news/newsmain","main","drama/dramamain","ent/entmain","culture/culturemain","radio/radiomain", "search", "search");
	var arrSubAdType = new Array("sub","drama/dramasub","ent/entsub","culture/culturesub","radio/radiosub","news/newssub","sub","drama/dramasub","ent/entsub","culture/culturesub","radio/radiosub", "search", "search");
	var arrEtcAdType = new Array("sports");

	for(var i = 0; i < arrMainAdLoc.length; i++) {
		if (sCurLoc.indexOf(arrMainAdLoc[i],0) != -1) {
			sCurAdFlag = arrMainAdType[i];
			if (sCurLoc.length > arrMainAdLoc[i].length) {
				arrTemp = sCurLoc.substring(arrMainAdLoc[i].length, sCurLoc.length).split("/");
				if (arrTemp.length > 2) {
					sCurAdFlag = arrSubAdType[i];
				}
			}
		}
	}

	for(var j = 0; j < arrEtcAdLoc.length; j++) {
		if (sCurLoc.indexOf(arrEtcAdLoc[j],0) != -1) {
			sCurAdFlag = arrEtcAdType[j];
		}
	}

}  

// ·Î±×ÀÎ Àü ==> ·Î±×ÀÎ/È¸¿ø°¡ÀÔ
// ·Î±×ÀÎ ÈÄ ==> ·Î±×¾Æ¿ô/È¸¿øÁ¤º¸¼öÁ¤
function SetLoginNew() {
	ID = escape(getCookie("IMBCMAIN"))
	if (ID == "")
	{
		document.write("<td><a href='javascript:iMbc_login();' target='_top' tabindex='3'><img src='http://img.imbc.com/admin/images/imbc2006_login.jpg' alt='·Î±×ÀÎ' width='41' height='19' border='0'></a></td>");
		document.write("<td><a href='http://login.imbc.com/imbc/Login/Member.html' tabindex='4'><img src='http://img.imbc.com/admin/images/imbc2006_member_in.jpg' alt='È¸¿ø°¡ÀÔ' width='47' height='19' border='0'></a></td>");
	}	
	else 
	{
		document.write("<td><a href='javascript:iMbc_logout();' target='_top' tabindex='3'><img src='http://img.imbc.com/admin/images/imbc2006_logout.jpg' alt='·Î±×¾Æ¿ô' width='48' height='19' border='0'></a></td>");
		document.write("<td><a href='http://login.imbc.com/imbc/login/ModiMember.asp' onClick='SetUrl();' tabindex='4'><img src='http://img.imbc.com/admin/images/imbc2006_member_out.jpg' alt='È¸¿øÁ¤º¸' width='46' height='19' border='0'></a></td>");
	}
}

// ·Î±×ÀÎ Àü ==> ·Î±×ÀÎ/È¸¿ø°¡ÀÔ
// ·Î±×ÀÎ ÈÄ ==> ·Î±×¾Æ¿ô/È¸¿øÁ¤º¸¼öÁ¤
function SetLogin() {
	ID = escape(getCookie("IMBCMAIN"))
	if (ID == "")
	{
		document.write("	  <td width=150><a href='javascript:iMbc_login();' target='_top' onfocus='this.blur();'><img src=http://img.imbc.com/broad/radio/images/2005r_main_login.jpg border=0></a><a href='http://login.imbc.com/imbc/Login/Member.html' onfocus='this.blur();'><img src=http://img.imbc.com/broad/radio/images/2005r_main_member_in.jpg border=0></a></td>");
	}	
	else 
	{
		document.write("      <td width=150><a href='javascript:iMbc_logout();' onfocus='this.blur();'><img src=http://img.imbc.com/broad/radio/images/2005r_main_logout.jpg border=0></a><a href='http://login.imbc.com/imbc/login/ModiMember.asp' onClick='SetUrl();' onfocus='this.blur();'><img src=http://img.imbc.com/broad/radio/images/2005r_main_member_out.jpg border=0></a></td>");
	}
}	

// ·Î±×ÀÎ Àü ==> ·Î±×ÀÎ/È¸¿ø°¡ÀÔ
// ·Î±×ÀÎ ÈÄ ==> ·Î±×¾Æ¿ô/È¸¿øÁ¤º¸¼öÁ¤
function SetLoginMain() {
	ID = escape(getCookie("IMBCMAIN"))
	if (ID == "")
	{
		document.write('      <td width="76"><img src="http://img.imbc.com/admin/images/main_onair01.jpg" width="76" height="18"></td>');
		document.write('      <td><a href="javascript:iMbc_login();" target="_top"><img src="http://img.imbc.com/admin/images/main_login.jpg" alt="·Î±×ÀÎ" width="61" height="18" border="0"></a></td>');
		document.write('   </tr>');
		document.write('   <tr> ');
		document.write('      <td><img src="http://img.imbc.com/admin/images/main_onair02.jpg" width="76" height="24"></td>');
		document.write('      <td><a href="http://login.imbc.com/imbc/Login/Member.html"><img src="http://img.imbc.com/admin/images/main_member_in.jpg" alt="È¸¿ø°¡ÀÔ" width="61" height="24" border="0"></a></td>');
	}	
	else 
	{
		document.write('      <td width="76"><img src="http://img.imbc.com/admin/images/main_onair01.jpg" width="76" height="18"></td>');
		document.write('      <td><a href="javascript:iMbc_logout();"><img src="http://img.imbc.com/admin/images/main_logout.jpg" alt="·Î±×¾Æ¿ô" width="61" height="18" border="0"></a></td>');
		document.write('   </tr>');
		document.write('   <tr> ');
		document.write('      <td><img src="http://img.imbc.com/admin/images/main_onair02.jpg" width="76" height="24"></td>');
		document.write('      <td><a href="http://login.imbc.com/imbc/login/ModiMember.asp" onClick="SetUrl();"><img src="http://img.imbc.com/admin/images/main_member_out.jpg" alt="È¸¿øÁ¤º¸" width="61" height="24" border="0"></a></td>');
	}
}	

// MBC¿ÍÇÔ²² Àü¿ë Login
function SetLoginWithmbc() {
	ID = escape(getCookie("IMBCMAIN"))
	if (ID == "")
	{
		document.write('<td width="76"><a href="javascript:iMbc_login();" target="_top"><img src="http://withmbc.imbc.com/withmbc/images/withmbc_main_login.jpg" width="76" height="25" border="0"></a></td>');
		document.write('<td><a href="http://login.imbc.com/imbc/Login/Member.html"><img src="http://withmbc.imbc.com/withmbc/images/withmbc_main_joinfo.jpg" width="54" height="25" border="0"></a></td>');
	}	
	else 
	{
		document.write('<td width="76"><a href="javascript:iMbc_logout();"><img src="http://withmbc.imbc.com/withmbc/images/withmbc_main_logout.jpg" width="76" height="25" border="0"></a></td>');
		document.write('<td><a href="http://login.imbc.com/imbc/login/ModiMember.asp" onClick="SetUrl();"><img src="http://withmbc.imbc.com/withmbc/images/withmbc_main_join.jpg" width="54" height="25" border="0"></a></td>');
	}
}	

// MBC¿ÍÇÔ²² Àü¿ë Login 2007-11-27
function SetLoginWithmbc_2007() {
	ID = escape(getCookie("IMBCMAIN"))
	if (ID == "")
	{
		document.write('<a href="javascript:iMbc_login();" target="_top">·Î±×ÀÎ</a> | <a href="http://login.imbc.com/imbc/Login/Member.html">È¸¿ø°¡ÀÔ</a>');
	}	
	else 
	{
		document.write('<a href="javascript:iMbc_logout();">·Î±×¾Æ¿ô</a> | <a href="http://login.imbc.com/imbc/login/ModiMember.asp" onClick="SetUrl();">È¸¿øÁ¤º¸</a>');
	}
}	

// withmbc Àü¿ë Login
function SetLoginWithmbcSub() {
	ID = escape(getCookie("IMBCMAIN"))
	if (ID == "")
	{
		document.write('<td width="68"><a href="javascript:iMbc_login();" target="_top"><img src=http://withmbc.imbc.com/withmbc/images/withmbc_log_in.jpg width=68 height=31 border=0></a></td>');
		document.write('<td><a href="http://login.imbc.com/imbc/Login/Member.html"><img src=http://withmbc.imbc.com/withmbc/images/withmbc_join.jpg width=53 height=31 border=0></a></td>');
	}	
	else 
	{
		document.write('<td width="68"><a href="javascript:iMbc_logout();"><img src=http://withmbc.imbc.com/withmbc/images/withmbc_log_out.jpg width=68 height=31 border=0></a></td>');
		document.write('<td><a href="http://login.imbc.com/imbc/login/ModiMember.asp" onClick="SetUrl();"><img src=http://withmbc.imbc.com/withmbc/images/withmbc_joinfo.jpg width=53 height=31 border=0></a></td>');
	}
}	

// µ¥ÀÌÅÍ¹æ¼Û Àü¿ë Login
function SetLoginDTV() {
	ID = escape(getCookie("IMBCMAIN"))
	if (ID == "")
	{
		document.write('<a href=javascript:iMbc_Dtvlogin();><img src=http://img.imbc.com/broad/dtv/images/datainfo_02_3_1.jpg width=147 height=46 border=0></a>');
	}
	else 
	{
		document.write('<a href=http://login.imbc.com/imbc/login/ModiMember.asp target=_top><img src=http://img.imbc.com/broad/dtv/images/datainfo_02_3_2.jpg width=147 height=46 border=0></a>');
	}
}

// 2006Â÷¹ü±Ù Àü¿ë Login
function SetLogin2006Cha() {
	ID = escape(getCookie("IMBCMAIN"))
	if (ID == "")
	{
		document.write('<td><a href="javascript:iMbc_login();" target="_top"><img src="http://2006cha.imbc.com/images/chaboom_login.jpg" alt="·Î±×ÀÎ" width="57" height="21" border="0"></a></td>');
		document.write('<td><a href="http://login.imbc.com/imbc/Login/Member.html"><img src="http://2006cha.imbc.com/images/chaboom_member.jpg" alt="È¸¿ø°¡ÀÔ" width="55" height="21" border="0"></a></td>');
	}	
	else 
	{
		document.write('<td><a href="javascript:iMbc_logout();"><img src="http://2006cha.imbc.com/images/chaboom_logout.jpg" alt="·Î±×¾Æ¿ô" width="57" height="21" border="0"></a></td>');
		document.write('<td><a href="http://login.imbc.com/imbc/login/ModiMember.asp" onClick="SetUrl();"><img src="http://2006cha.imbc.com/images/chaboom_member_info.jpg" alt="È¸¿øÁ¤º¸" width="55" height="21" border="0"></a></td>');
	}
}

// ·Î±×ÀÎ Àü ==> ·Î±×ÀÎ/È¸¿ø°¡ÀÔ
// ·Î±×ÀÎ ÈÄ ==> ·Î±×¾Æ¿ô/È¸¿øÁ¤º¸¼öÁ¤
function SetLogin2006() {
	ID = escape(getCookie("IMBCMAIN"))
	if (ID == "")
	{
		document.write("<td style='padding:0 0 0 4'><a href='javascript:iMbc_login();' target='_top' tabindex='3'><img src='http://img.imbc.com/2006_admin/images/top_link_txt01.gif' border='0' ></a></td>");
		document.write("<td><img src='http://img.imbc.com/2006_admin/images/null.gif' border='0' height='1' width='12'></td>");
		document.write("<td><img src='http://img.imbc.com/2006_admin/images/top_blt01.gif' border='0' ></td>");
		document.write("<td style='padding:0 0 0 4'><a href='http://login.imbc.com/imbc/Login/Member.html' tabindex='4'><img src='http://img.imbc.com/2006_admin/images/top_link_txt02.gif' border='0' ></a></td>");
	}	
	else 
	{
		document.write("<td style='padding:0 0 0 4'><a href='javascript:iMbc_logout();' target='_top' tabindex='3'><img src='http://img.imbc.com/2006_admin/images/logout_01.gif' border='0' alt='·Î±×¾Æ¿ô'></a></td>");
		document.write("<td><img src='http://img.imbc.com/2006_admin/images/null.gif' border='0' height='1' width='12'></td>");
		document.write("<td><img src='http://img.imbc.com/2006_admin/images/top_blt01.gif' border='0' ></td>");
		document.write("<td style='padding:0 0 0 4'><a href='http://login.imbc.com/imbc/login/ModiMember.asp' onClick='SetUrl();' tabindex='4'><img src='http://img.imbc.com/2006_admin/images/member_01.gif' border='0' alt='È¸¿øÁ¤º¸'></a></td>");
	}
}

// ·Î±×ÀÎ Àü ==> ·Î±×ÀÎ/È¸¿ø°¡ÀÔ
// ·Î±×ÀÎ ÈÄ ==> ·Î±×¾Æ¿ô/È¸¿øÁ¤º¸¼öÁ¤
function SetLogin2006Sub() {
	ID = escape(getCookie("IMBCMAIN"))
	if (ID == "")
	{
		document.write("<td><a href='javascript:iMbc_login();' target='_top' tabindex='3'><img src='http://img.imbc.com/2006_admin/images/n_login.jpg' alt='·Î±×ÀÎ' width='48' height='20' border='0'></a></td>");
		document.write("<td><a href='http://login.imbc.com/imbc/Login/Member.html' tabindex='4'><img src='http://img.imbc.com/2006_admin/images/n_member.jpg' alt='È¸¿ø°¡ÀÔ' width='55' height='20' border='0'></a></td>");
	}	
	else 
	{
		document.write("<td><a href='javascript:iMbc_logout();' target='_top' tabindex='3'><img src='http://img.imbc.com/2006_admin/images/n_logout.jpg' alt='·Î±×¾Æ¿ô' width='58' height='20' border='0'></a></td>");
		document.write("<td><a href='http://login.imbc.com/imbc/login/ModiMember.asp' onClick='SetUrl();' tabindex='4'><img src='http://img.imbc.com/2006_admin/images/n_member_info.jpg' alt='È¸¿øÁ¤º¸' width='55' height='20' border='0'></a></td>");
	}
}

// DTV °¡ÀÔÇÏ±â 
function iMbc_Dtvlogin () 
{
	if (escape(getCookie("IMBCMAIN")) == "") 
	{
		document.domain = "imbc.com";
		window.open("http://dtvsys.imbc.com/agree.asp", "dtvagree", "resizable=no,scrollbars=no,width=405,height=335");
	}
	else 
	{
		window.location.reload();
	}
}

// RETURN PAGE¸¦ À§ÇØ ÇöÀç ÆäÀÌÁö Á¤º¸¸¦ ÄíÅ°·Î ÀúÀå
function SetUrl() 
{
	setCookie("IMBCURL",document.location,null,"/","imbc.com")			
}


// ·Î±×ÀÎ 
function iMbc_login () 
{
			
	if (escape(getCookie("IMBCMAIN")) == "") 
	{
		SetUrl();
		window.location.href="http://login.imbc.com/imbc/Login/Login.asp";
	}
	else 
	{
		window.location.reload();
	}
}

// ·Î±×¾Æ¿ô
function iMbc_logout () 
{
	SetUrl();
	window.location.href="http://login.imbc.com/imbc/logininte/Logout.asp";
}

// ÄíÅ°¼ÂÆÃ
function setCookie(strName, strValue, dateExpires, strPath, strDomain, isSecure)
{
	var strCookie;
	if(strName == "") return ;

	strCookie = strName + "=" + escape(strValue) + 
				   ((dateExpires) ? "; expires=" + dateExpires.toGMTString() : "")  + 
				   ((strPath)     ? "; path="    + strPath : "") + 
			   ((strDomain)   ? "; domain="  + strDomain : "") + 
				   ((isSecure)    ? "; secure" : "");

	document.cookie = strCookie; 
}

// ÄíÅ°Á¤º¸ °¡Á®¿À±â
function getCookie(strName)
{
	var strArg = new String(strName + "=");	
	var nArgLen, nCookieLen, nEnd;
	var i = 0, j;

	nArgLen    = strArg.length;
	nCookieLen = document.cookie.length;

	if(nCookieLen > 0) {
		while(i < nCookieLen) {
			j = i + nArgLen;
			if(document.cookie.substring(i, j) == strArg) {
				nEnd = document.cookie.indexOf (";", j);
				if(nEnd == -1) nEnd = document.cookie.length;
				return unescape(document.cookie.substring(j, nEnd));
			}
			i = document.cookie.indexOf(" ", i) + 1;
			if (i == 0) break;
		}
	}
	return("");
}

// ÄíÅ° »èÁ¦
function delCookie( name )
{
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate()-1 );
	document.cookie = name+"=; domain=imbc.com; path=/; expires="+todayDate.toGMTString()+";";
}

// On-Air TV
function newTV()
{
	document.location ='http://playercue.imbc.com/onair/';
//		document.location ='http://imbc.com/broad/tv/culture/toron/event/index.html?OnAir';
  }



// »ý¹æ¼Û Ç¥ÁØ FM ¸ÖÆ¼Ä³½ºÆ®¿ë
//	function newsfm()
//	{
//		newVODPlayer("SFM", "LR_M");
//	}

// »ý¹æ¼Û À½¾Ç FM ¸ÖÆ¼Ä³½ºÆ®¿ë
//	function newmfm()
//	{
//		newVODPlayer("MFM", "LR_M");
//	}


// »ý¹æ¼Û Ç¥ÁØ FM À¯´ÏÄ³½ºÆ®¿ë
function newsfm()
{
	newVODPlayerAnal("SFM", "LR");
}

// »ý¹æ¼Û À½¾Ç FM À¯´ÏÄ³½ºÆ®¿ë
function newmfm()
{
	newVODPlayerAnal("MFM", "LR");
}

// New VOD Player
function newVODPlayer(file, cont_type)
{
	url = "http://touch.imbc.com/Touchplayer.asp?file=" + file + "&type=" + cont_type;
	window.open(url, '', 'width=380, height=430, resizable=yes');
}
// MainÅë°è¿ë 2007.06.05 ÃÖ¿ì¼® (Ãß°¡)
function newVODPlayerAnal(file, cont_type)
{
	url = "http://playercue.imbc.com/TouchPlayer/TouchPlayerExe.aspx?file=" + file + "&type=" + cont_type;
	window.open(url, '', 'width=380, height=430, resizable=yes');
}



// ÇÁ·¹ÀÓ ÆÄÀÏ ¹þ¾î³ª±â
function fMoveTopUrl(str)
{
	// top.parent.location.href = str;
	parent.top.location.href = str;
}

function in_f(e) {
	document.all.onair01.style.display = "none";
	switch (parseInt(e)) {
		case 1 : 
			document.all.onair01.style.display = "";
			break;
	}
}
 
function AODPlayer(main_part,rank,touchid) // ¸ðµç VOD´Â ¾ÕÀ¸·Î ÀÌ°ÍÀ¸·Î. ¿À¿µÁø
{	
	if (touchid.substr(touchid.length-1,1) == ' ') {touchid = touchid.substr(0,touchid.length-1)}
	if (touchid.substr(touchid.length-1,1) == ' ') {touchid = touchid.substr(0,touchid.length-1)}
		speed = 56
	if (main_part == 'RA') {linkText = 'http://music.imbc.com/touch2/player.asp?main_part=' + main_part + '&count=1&l1=' + main_part + touchid.substr(touchid.length-7,7) + '&size=0&speed=' + speed}
	else {linkText = 'http://music.imbc.com/touch2/player.asp?main_part=' + main_part + '&count=1&l1=' + touchid + '&size=0&speed=' + speed}
		newwins = window.open(linkText, '_player','width=621,height=548,marginwidth=0,marginheight=0,resizable=0,scrollbars=0');

	newwins.focus();
}

function AODAllPlayer(main_part,count,touchids) // ¸ðµç VOD´Â ¾ÕÀ¸·Î ÀÌ°ÍÀ¸·Î. ¿À¿µÁø
{
	if (touchids.substr(touchids.length-1,1) == ' ') {touchids = touchids.substr(0,touchids.length-1)}
	if (touchids.substr(touchids.length-1,1) == ' ') {touchids = touchids.substr(0,touchids.length-1)}
	speed = 56
	linkText = 'http://music.imbc.com/touch2/player.asp?main_part=' + main_part + '&count=' + count+ '&' + touchids + '&size=1&speed=' + speed
	newwins = window.open(linkText, '_player','width=440,height=548,marginwidth=0,marginheight=0,resizable=0,scrollbars=0');
	newwins.focus();
}

// TOUCH PLAYER °ü·Ã
function openOMP(url) {
	window.open(url, 'dewna', 'width=780, height=600');
}

function openVOD(url) {
	window.open(url, 'POPUP_CUE', 'width=385, height=435, resizable=no, scrollbars=no, status=no');
}

function OpenWin2( VodCnt ) {
	var winProperties = "directories=no,location=no,menubar=no,status=no,toolbar=no,scrollbars=no,resizable=no,width=604,height=540";
	win = window.open( VodCnt, "win2", winProperties);
} 

function OpenWin3(previewcnt) {
	var winProperties1 = "directories=no,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=no,width=604,height=650";
	win = window.open( previewcnt, "win3", winProperties1);
} 

function OpenWin4(previewcnt) {
	var winProperties1 = "directories=no,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=no,width=604,height=650";
	win = window.open( previewcnt, "win4", winProperties1);
} 

function openDOWN(url) {
	window.open(url, '_blank', 'width=410, height=475, resizable=yes');
}

function openUBook(url) {
	window.open('http://ubook.imbc.com/booktopia/affiliate_site/imbc/script/script.asp' + url, 'ubook', 'width=430, height=400, resizable=yes');
}

function openUBookInfo() {
	window.open('http://ubook.imbc.com/booktopia/affiliate_site/imbc/script/new_help4.htm', 'ubookinfo', 'width=470, height=400, scrollbars=yes, resizable=yes');
}

function openDownInfo() {
	window.open('http://www.imbc.com/broad/tv/infoguide/overseas_help/index.html', 'downinfo', 'width=700, height=550, resizable=no');
}

// ¿À¸¥ÂÊ ÇÁ·¹ÀÓÀÌ ºÙÀº Touch Player ¶ç¿ì±â
			// url : µ¿¿µ»ó URL
			// url2 : ¿À¸¥ÂÊ ÇÁ·¹ÀÓ URL
function openVODEx(url, url2) 
{
	var sURL;
	sURL = url.replace('Touchplayer.asp', 'SVPlayer.asp');
	window.open(sURL+"&svURL="+url2, '', 'width=678, height=414, resizable=yes');
}

// ÇÑÁÙÅå ºÙÀº Touch Player ¶ç¿ì±â
function openVODEx2(url, svcdiv)
{
	if (svcdiv == '')
	{
		openVOD(url);
	}
	else
	{
		var sURL;
		sURL = url.replace('Touchplayer.asp', 'SVPlayer.asp');
		svcdiv = svcdiv.replace('http://comment.imbc.com/MemoList.asp?SvcDiv=', '');
		svcdiv = svcdiv.replace('http://campaign.imbc.com/discussion/MemoList.asp?SvcDiv=', '');
		window.open(sURL+"&svcdiv="+svcdiv, '', 'width=410, height=416, resizable=yes');
	}
}



// ¿À¸¥ÂÊ ÆäÀÌÁö¿¡¼­ ¿ÞÂÊ TOUCH URLº¯°æ          ¿ø·¡ ½ºÅ©¸³Æ®..... ¹é¾÷!!!!!!!!!!!!!!!!!!!!!!!!!
function ChangeVOD_backup(url)
{
	if(window.parent && window.parent.PlayFrm && window.parent.PlayFrm.OpenMedia)
	{		
		var nPos;
		nPos = url.indexOf("file=", 0);
		if(nPos < 0 )
		{
			window.parent.PlayFrm.OpenMedia(url, 0);	
		}
		else
		{
			var nPos2;
			var sMediaURL;
			nPos2 = url.indexOf("&", nPos);
			if(nPos2 < 0) sMediaURL = url.substring(nPos+5, url.length)
			else sMediaURL = url.substring(nPos+5, nPos2)
			window.parent.PlayFrm.OpenMedia(sMediaURL, 0);				
		}
	
	}
}


// ÅÍÄ¡ÇÃ·¹ÀÌ¾îÀÇ ¹Ìµð¾î ÆÄÀÏÀ» º¯°æ.
function ChangeVOD(url)
{
	ChangePos(url, 0);
}


// ÅÍÄ¡ÇÃ·¹ÀÌ¾îÀÇ Àç»ýÀ§Ä¡¸¦ º¯°æ.
function ChangePos(url, pos)
{
	if(top.window && top.window.PlayFrm && top.window.PlayFrm.OpenMedia)
	{	
		var nPos;
		nPos = url.indexOf("file=", 0);
		if(nPos < 0 )
		{
			top.window.PlayFrm.OpenMedia(url, pos);	
		}
		else
		{
			var nPos2;
			var sMediaURL;
			nPos2 = url.indexOf("&", nPos);
			if(nPos2 < 0) sMediaURL = url.substring(nPos+5, url.length)
			else sMediaURL = url.substring(nPos+5, nPos2)
			top.window.PlayFrm.OpenMedia(sMediaURL, pos);				
		}
	
	}
}

			// »çÀÌÁî ÁöÁ¤ °¡´ÉÇÑ ÇÑÁÙÅå Ã¢ ¶ç¿ì±â
	function openVODEx3(url, svcdiv, intWidth, intHeight)
{

	if (svcdiv == '')
	{
		openVOD(url);
	}
	else
	{
		var sURL;
		sURL = url.replace('Touchplayer.asp', 'SVPlayer.asp');
		svcdiv = svcdiv.replace('http://comment.imbc.com/MemoList.asp?SvcDiv=', '');
		window.open(sURL+"&svcdiv="+svcdiv+"&w="+intWidth+"&h="+intHeight, '', 'width=410, height=440, resizable=yes');
	}
}


function hideDivPpl() {
	hideDivPpl(document.getElementById('divppl'));
}

function hideDivPpl(s) {
	if (s!=null) s.style.display = 'none'; 
}

function getPpl(ppl_no) {
	var list;
	var posX, posY;
	
	try {
		if (ppl_no.indexOf(",") >= 0) {
			list = ppl_no.split(",");
			ppl_no = list[0];
			posX = parseInt(list[1]);
			posY = parseInt(list[2]);
		} else {
			posX = window.event.clientX + document.body.scrollLeft;
			posY = window.event.clientY + document.body.scrollTop + 5;
		}
		frameppl.location.href = "http://people.imbc.com/pplPopSrv.asp?ppl_no=" + ppl_no;

		var obj = document.getElementById('divppl');
		obj.style.position = 'absolute';
		obj.style.left = posX;
		obj.style.top = posY;
		obj.style.display = '';
	} catch(e) {}
}

function resizeFramePpl() {
	try {
		var oBody	=	frameppl.document.body;
		var oFrame	=	document.getElementById('frameppl');
	
		oFrame.style.height = oBody.scrollHeight + (oBody.offsetHeight - oBody.clientHeight);
		oFrame.style.width = oBody.scrollWidth + (oBody.offsetWidth - oBody.clientWidth);
	} catch(e) {}
}

function openPplPopDetail(ppl_no) {
	//window.open("http://people.imbc.com/pplPopSrvDetail.asp?ppl_no=" + ppl_no, "pplpopdetail", "scrollbars=yes,width=491,height=750");
	window.open("http://people.imbc.com/user/PeopleDetail.asp?PeoNo=" + ppl_no, "pplpopdetail");
}

function MM_jumpMenu(targ,selObj,restore){
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}

function writeRno(strNo) {
	var i=0;
	
	try {
		if (strNo==null || strNo=="") return;
		while(i<strNo.length) {
			if (strNo.substring(i,i+1) != "0") {
				document.write(strNo.substring(i, strNo.length));
				return;
			} else {
				i++;
			}
		}
		document.write(strNo);
	} catch(e) {}
}

function writeSwfVars(url, width, height, allowDomain, vars) {
	if (allowDomain == "") {
		allowDomain = false;
	}
	try {
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + width + '" height="' + height + '">');
		document.write('<param name="movie" value="' + url + '">');
		if (allowDomain == true) {
			document.write('<param name="allowScriptAccess" value="sameDomain"/>');
		} else {
			document.write('<param name="allowScriptAccess" value="always"/>');
		}
		document.write('<param name="FlashVars" value="' + vars+ '">');
		document.write('<param name="quality" value="high"><param name="wmode" value="transparent">');
		document.write('<embed src="' + url + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>');
		document.write('</object>');
	} catch(E){}
}

function writeSwf(url, width, height, allowDomain, swfid) {
	if (allowDomain == "") {
		allowDomain = false;
	}
	if( (typeof swfid)=='undefined') {
		swfid = '';
	}

	try {
		document.write('<object id="'+swfid+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + width + '" height="' + height + '">');
		document.write('<param name="movie" value="' + url + '">');
		if (allowDomain == true) {
			document.write('<param name="allowScriptAccess" value="sameDomain"/>');
		} else {
			document.write('<param name="allowScriptAccess" value="always"/>');
		}
		document.write('<param name="quality" value="high"><param name="wmode" value="transparent">');
		document.write('<embed src="' + url + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>');
		document.write('</object>');
	} catch(E){}
}

//ºÒÅõ¸íºÎºÐ
function writeSwfOpa(url, width, height, allowDomain) {
	if (allowDomain == "") {
		allowDomain = false;
	}
	try {
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + width + '" height="' + height + '">');
		document.write('<param name="movie" value="' + url + '">');
		if (allowDomain == true) {
			document.write('<param name="allowScriptAccess" value="sameDomain"/>');
		} else {
			document.write('<param name="allowScriptAccess" value="always"/>');
		}
		document.write('<param name="quality" value="high">');
		document.write('<embed src="' + url + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>');
		document.write('</object>');
	} catch(E){}
}

// scriptlet
function fWriteScriptlet(strUrl, intWidth, intHeight)
{
	document.writeln("<object type=text/x-scriptlet width="+intWidth+" height="+intHeight+" data="+strUrl+"></object>");
}

// Àü±¹ °³±× ½ÅÃ»
function fApp()
{
	var winl = (screen.width - 300) / 2;
	var wint = (screen.height - 430) / 2;
	
	win = window.open('http://campaign.imbc.com/gag/EvtAppForm.asp', 'APP', 'toolbar=no,location=no,status=no,menubar=no,resizable=no,scrollbars=no,top='+wint+',left='+winl+',width=430,height=300');
	win.focus();
}	


function DownLoadOpen() {
	try {
				var openurl = "";
				var uri = null;
				if((typeof vodform.itemid)=='undefined') {
					alert('¼±ÅÃÇÒ¼ö ÀÖ´Â ¾ÆÀÌÅÛÀÌ ¾ø½À´Ï´Ù.');
				}else {
					if((typeof vodform.itemid.length)=='undefined') {
						if(vodform.itemid.checked) {
							uri = vodform.itemid.value;
							vodform.itemidCheck.value = vodform.itemid.value;
						}
						else
						{
							vodform.itemidCheck.value = "0";
						}
					}else {
						for(var i=0;i<vodform.itemid.length;i++) {
							
							if(vodform.itemid[i].checked) 
							{
								if(uri==null) {
									uri = vodform.itemid[i].value;
									vodform.itemidCheck[i].value = vodform.itemid[i].value;		
								} else {
									uri += ","+vodform.itemid[i].value;
									vodform.itemidCheck[i].value = vodform.itemid[i].value;;
								}	
							}
							else
							{
								vodform.itemidCheck[i].value = "0";	
							}
						}
						
					}
					if(uri==null) {
						alert('¾ÆÀÌÅÛÀ» ¼±ÅÃÇÏ¼Å¾ß ÇÕ´Ï´Ù.');
					}else {
						//alert('¼º°ø\n'+'sItmId='+uri);
						//var oNewWin = window.open("http://script.imbc.com/dowload_info.asp?sItmIds=" + uri ,"_blank","width=1,height=1,left=50,top=50,toolbar=no,directories=no,status=no,scrollbars=auto,resize=yes,menubar=no");
						
						var fTarget = "f" + parseInt(Math.random()*10000000) 
						var oNewWin = window.open("http://script.imbc.com/loading.html",fTarget,"width=100,height=100,left=50,top=50,toolbar=no,directories=no,status=no,scrollbars=auto,resize=yes,menubar=no");
						vodform.target = fTarget;
						vodform.submit();

					}
				}
			}
			catch(e){}
}

function onCheckBox(){
	var Chid = escape(getCookie("IMBCMAIN"));
	if (Chid == "")
	{
				var CheckBoxmsg="·Î±×ÀÎ ÈÄ ÀÌ¿ë °¡´É ÇÕ´Ï´Ù!";
				var st=window.showModalDialog("http://login.imbc.com/imbc/login/error/win_box_1.asp?msg="+CheckBoxmsg,"","dialogWidth:334px; dialogHeight:190px; status:no; help:no;resize:no; scroll:no");
	iMbc_login();
	}	
}

// ¸¶ÀÌÆäÀÌÁö Áñ°ÜÃ£±â
function writeMyFav(PC) {
	var tID = escape(getCookie("IMBCMAIN"))
	if (tID == "") {
		document.write("	<TABLE cellSpacing='1' cellPadding='2' width='131' align='center' bgColor='#999999' border='0'>");
		document.write("		<TR>");
		document.write("			<TD vAlign='top' align='center' bgColor='#e7e7e7'>");
		document.write("				<TABLE cellSpacing='1' cellPadding='0' width='100%' bgColor='#96a2b6' border='0'>");
		document.write("					<TR>");
		document.write("						<TD bgColor='#ffffff'>");
		document.write("							<TABLE cellSpacing='0' cellPadding='0' width='100%' border='0'>");
		document.write("								<TR >");
		document.write("									<TD valign='middle'><IMG hspace='3' src='http://img.imbc.com/login/images/mp_icn_05.gif' align='absMiddle'");
		document.write("											vspace='1' ><B><FONT color='#0078bf'>Áñ°ÜÃ£±â</FONT></B></TD>");
		document.write("									<TD valign='middle' align='right'><IMG alt='¼³Á¤' onclick='iMbc_login()' style='cursor:hand' hspace='2' src='http://img.imbc.com/login/images/mp_btn_favedit.gif' align='absMiddle'");
		document.write("												border='0'></A></TD>");
		document.write("								</TR>");
		document.write("							</TABLE>");
		document.write("						</TD>");
		document.write("					</TR>");
		document.write("				</TABLE>");
		document.write("				<TABLE cellSpacing='0' cellPadding='2' width='100%' border='0'>");
		document.write("					<TR>");
		document.write("						<TD align='center' width='100%' bgColor='#e4e4e4' colSpan='2' height='30'  style='padding:3 0 0 0'>");
		document.write("								<select name='BookMark_List' id='BookMark_List' class='bt' onclick='iMbc_login()' style='width:121px;FONT-SIZE: 12px;' >");
		document.write("<option>-Áñ°ÜÃ£±â ¸ñ·Ï-</option>");
		document.write("</select></TD>");
		document.write("					</TR>");
		document.write("				</TABLE>");
		document.write("			</TD>");
		document.write("		</TR>");
		document.write("	</TABLE>");
	}else {
		document.write("<table cellSpacing='0' cellPadding='0' align='center' valign='top' width='131' height='60'><tr><td><iframe src='http://mypage.imbc.com/MyFav/MyBookMarkList.aspx?PC="+PC+"' frameborder=0 width='131' height='60'  scrolling=no></iframe></td></tr></table>");
	}
}

// Á¾¿µÇÁ·Î±×·¥ ÇÃ·ÎÆÃ ¹è³Ê
//document.write("<scr"+"ipt language=javas"+"cript src=http://www.imbc.com/common/js/closed_prog_list.js></sc"+"ript>");

// µå¶ó¸¶ ÇÁ·Î±×·¥¹Ù·Î°¡±â
document.write("<scri"+"pt language='javas"+"cript' src='http://www.imbc.com/broad/tv/js/drama_program_go_n.js'></sc"+"ript>");

//±¤°í¿ë GeoIP ¼¼ÆÃ.
if(escape(getCookie("geo")) == "")
{
		document.write("<scri"+"pt language='javas"+"cript' src='http://ads.imbc.com/geoip.php'></sc"+"ript>");
}

function layer_view(e_id){document.getElementById(e_id).style.display='block';}
function layer_hidden(e_id){document.getElementById(e_id).style.display='none';}

function openPop(theURL) { //v2.0
  window.open(theURL,'pop','width=418,height=600,scrollbars=yes');
}

function writeSwf_welf(url, width, height, allowDomain, swfid) {
	if (allowDomain == "") {
		allowDomain = false;
	}
	if( (typeof swfid)=='undefined') {
		swfid = '';
	}

	try {

		document.write('<object id="'+swfid+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0" width="' + width + '" height="' + height + '">');
		document.write('<param name="movie" value="' + url + '">');
		if (allowDomain == true) {
			document.write('<param name="allowScriptAccess" value="sameDomain"/>');
		} else {
			document.write('<param name="allowScriptAccess" value="always"/>');
		}
		document.write('<param name="quality" value="high"><param name="wmode" value="transparent">');

		if (allowDomain == true) {
			document.write('<embed src="' + url + '" quality="high" wmode="transparent" allowscriptaccess="sameDomain" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>');
		}
		else{
			document.write('<embed src="' + url + '" quality="high" wmode="transparent" allowscriptaccess="always" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>');
		}	
		
		
		document.write('</object>');
	} catch(E){}
}