//pm½Ã ¸·¾Æ³õ±â

/*
if( location.href != "http://www.pdbox.co.kr/" && location.href != "http://www.pdbox.co.kr/body.htm" && location.href != "http://www.pdbox.co.kr/index.asp" && location.href != "http://www.nowcom.co.kr/hotIssueAfreeca.htm" )
{
	//location.href= "http://www.afreeca.com/pm/afreeca_pm_notice_full.htm";
	location.href= "http://www.afreeca.com/pm/isa_pm.html";
}
*/
//pm½ÃÇ®±â

//document.writeln("<script type='text/javascript' src='"+AFREECA+"/script/cAjax.js'></script>");
try
{
	//document.domain = DOMAIN;
}
catch(e)
{
}

var bLayerPopUp = false;		// ÆäÀÌ¾î ÆË¾÷ Ãâ·Â À¯¹«

var bIsplaying=false;              // ½Ã°£ Á¦ÇÑ µÎ±âÀ§ÇÔ
var oTimeId;
var Max_Time = 2000;

// °øÁö»çÇ× new ¾ÆÀÌÄÜ
function getIcon(flag)
{
    if(flag=='Y') {
		return '<img src="'+AFREECA+'/img/main_img/new.gif" />';
    } else {
        return '';
    }
}

//½Ã°£ Á¦ÇÑ ·çÆ¾
function ClearTimeout()
{
	bIsplaying = false;
	clearTimeout(oTimeId);
}


function isPossblePlaying()
{
	if( ! bIsplaying )
	{
		bIsplaying = true;
		clearTimeout(oTimeId);
		oTimeId = setTimeout("ClearTimeout()",Max_Time);
		
		return true;
	}
	else
	{
		return false;
	}
}

// Æ©Åä¸®¾ó
function openTutorial()
{
	window.open( AFREECA+"/tutorial/tutorial_new.html", null, "height=560, width=756, toolbar=no,menubar=no,location=no, top=250, left=250");
}

// ´Ù¿î¹Þ±â
function openDownload()
{
	window.open( AFREECA+"/tutorial/tutorial_down.html", null, "height=560, width=756, toolbar=no,menubar=no,location=no, top=250, left=250");
}

// ÇØ´ç È¸¿øÀÇ ¹æ¼Û±¹ ¹Ù·Î°¡±â
function goStation(szId)
{
	if (szId == null || szId == "")
	{
		parent.location.href = AFREECA;
	}
	else
	{
		if(location.href == LIVE_8057+"/pg_gen/afreeca_app_main.htm")
		{
			window.open( AFREECA_ISAPI+szId,"","");
		}
		else
		{
			parent.location.href = AFREECA_ISAPI+szId;
		}
    }
}

function goStationBlank(szId)
{
	window.open( AFREECA_ISAPI+szId,"","");
	
}


// ÇØ´ç È¸¿øÀÇ ¿µ»óÅ¬¸³ ¸®½ºÆ®·Î ¹Ù·Î°¡±â
function goOnDemand(szId)
{
	if (szId == null || szId == "")
	{
		parent.location.href = AFREECA;
	}
	else
	{
		parent.location.href = LIVE_8079 + "/app/index.cgi?szType=list_ucc_bbs&szBjId=" + szId;
    }
}


// ¾ÆÀÌÇÁ·¹ÀÓ ³»¿¡¼­ ·©Å· ¹Ù·Î°¡±â(¸ÞÀÎ+·Î±×ÀÎ)
function goRank(szWhich)
{
	if(szWhich=="" || szWhich==null)
	{
		parent.location.href = LIVE_8057 + "/afreeca/bj_rank.php";
	}
	else
	{
		parent.location.href = LIVE_8057 + "/afreeca/bj_rank.php?szWhich="+szWhich;
	}
}

// ¾ÆÀÌÇÁ·¹ÀÓ ³»¿¡¼­ ÂÊÁö ¹Ù·Î°¡±â
function goNote()
{
	var szUrl	= NOTE_8133 + "/app/index.php";
	try
	{
		if( parent.location == location )
		{
			location.href = szUrl;
		}
		else
		{
			parent.location.href = szUrl;
		}
	}
	catch (e)
	{
		location.href = szUrl;
	}	
}

// ÂÊÁö º¸³»±â ÆË¾÷ ¿­±â
function goSendNote( szUserId )
{
	if( szUserId == 'undefined' || szUserId == null )
	{
		szUserId = '';
	}

	var oWindow = window.open(NOTE_8133 + "/app/index.php?page=write&id_list=" + szUserId, 'noteWriteWindow','left=10,top=10,width=400,height=440,marginwidth=0,marginheight=0,resizable=0,scrollbars=no');
	if( !oWindow ) alert( "Â÷´ÜµÈ ÆË¾÷À» Çã¿ëÇØÁÖ¼¼¿ä.");
	else    oWindow.focus();
}

/**
  *	@brief ÂÊÁö Ä«¿îÆ® api È£Ãâ
  */
function getNoteCnt( spnId )
{
    include_js( NOTE_8133 + "/api/note_cnt_api.php?szType=json&szScriptVar=oNoteInfo", onLoadNoteCnt, "scrNote", spnId );
}

/**
  *	@brief ÂÊÁö Ä«¿îÆ® Ãâ·Â
  */
function onLoadNoteCnt( spnId )
{
    try
    {
        eval( oNoteInfo );

        if( oNoteInfo.CHANNEL.RESULT  == 1 )
        {
            var nNoteCnt = oNoteInfo.CHANNEL.NOTE_CNT;

			try
			{
				document.getElementById( spnId ).innerHTML = nNoteCnt;
			}
			catch(e2)
			{
				document.write( nNoteCnt );
			}
        }
    }
    catch(e)
    {
    }
}

// ¾ÆÀÌÇÁ·¹ÀÓ ³»¿¡¼­ Æ÷ÀÎÆ® ¹Ù·Î°¡±â(¸ÞÀÎ+·Î±×ÀÎ) - 2008/03/11
function goPoint(szWhich)
{
	var szUrl = "";

	if( !checkPointPm() )
	{
		alert("[¾ÆÇÁ¸®Ä« Á¤±âÁ¡°Ë]\nÁö±ÝÀº ¼­ºñ½º Á¡°ËÁßÀÔ´Ï´Ù.\n\n¼­ºñ½º Á¡°Ë½Ã°£\n" + PMSPM_TEXT );
		return;
	}

	switch( szWhich )
	{
		case "point" : 
			szUrl = POINT + "/report/AfreecaUserOutList.asp";
			break;
		
		case "quickview" : 
			var param = "";
			var szHref = location.href;

			if (szHref == "http://www.afreeca.com/")
			{
				param = "from=7";
			}
			else
			{
				param = "from=8";
			}

			szUrl = AFREECA + "/quickview.htm?" + param;
			break;

		case "abroad" : 
			szUrl = AFREECA + "/abroad.htm";
			break;

		case "balloon" : 
			szUrl = AFREECA + "/balloon.htm";
			break;
		
		case "alimi" : 
			szUrl = AFREECA + "/alimi.htm";
			break;

		case "my" : 
			szUrl = POINT + "/report/AfreecaUseList.asp";
			break;

		case "my_balloon" : 
			szUrl = POINT + "/Report/AfreecaBalloonList.asp";
			break;


		case "gold" : 
			szUrl = AFREECA + "/starcandy.htm";
			break;

		case "sticker" : 
			szUrl = AFREECA + "/sticker.htm";
			break;

		case "fanlove" : 
			szUrl = AFREECA + "/item/fanlove.htm";
			break;

		case "sportshout" : 
			szUrl = AFWBBS1_8081 + "/app/index.php?board=sportshout";
			break;

		case "kboshout" : 
			szUrl = AFREECA + "/kboshout.htm";
			break;

		case "chatcon" :
			szUrl = AFWBBS1_8081 + "/app/index.php?board=chatcon";
			break;
			
		case "free" : 
			szUrl = AFREECA + "/fpoint.htm";
			break;
	}
	
	try
	{
		if( parent.location == location )
		{
			location.href = szUrl;
		}
		else
		{
			parent.location.href = szUrl;
		}
	}
	catch (e)
	{
		location.href = szUrl;
	}
}


// PMS PM¿©ºÎ Ã¼Å©
function checkPointPm()
{
	var szDate = new Date();

	var szYear = szDate.getFullYear();
	var szMonth =  ((szDate.getMonth()+1 < 10)?"0":"")+(szDate.getMonth()+1);
	var szDay = ((szDate.getDate() < 10)?"0":"")+szDate.getDate();
	var szHours = ((szDate.getHours() < 10)?"0":"")+szDate.getHours();
	var szMinutes = ((szDate.getMinutes() < 10)?"0":"")+szDate.getMinutes();

	var szNowTm = String(szYear)+String(szMonth)+String(szDay)+String(szHours)+String(szMinutes);
	
	// ½Ã°£ Ã¼Å©
	if( szNowTm >= PMSPM_START_TM && szNowTm < PMSPM_END_TM ) 
	{
		return false;
	}
	return true;
}


// Ç®ÆäÀÌÁö PM¿©ºÎ Ã¼Å©
function checkFullPagePm( nowtm, target )
{
	var szNowTm = nowtm;
	if( szNowTm == undefined || szNowTm == null || szNowTm == "" )
	{
		return;
	}

	var szFullUrl = AFREECA + "/pm/afreeca_pm_notice_full.htm";
	var szPopUrl = AFREECA + "/pm/afreeca_pm_notice_pop.htm";
	var szUrl = (target == "pop") ? szPopUrl : szFullUrl;
	
	// ½Ã°£ Ã¼Å©
	if( szNowTm >= FULLPM_START_TM && szNowTm < FULLPM_END_TM ) 
	{
		try
		{
			top.location.href = szUrl;
		}
		catch (e)
		{
			location.href = szUrl;
		}
		return false;
	}
	return true;
}


// ¾ÆÀÌÇÁ·¹ÀÓ ¸®»çÀÌÁî
function ResizeFrame(frame_name,num) 
{ 
	try
	{	
		var objFrame = document.getElementById(frame_name); 
		var objBody;

		if(window.navigator.appName.indexOf("Explorer") !=-1)		// IE
		{
			objBody = window.frames[frame_name].document.body;
			objFrame.height = objBody.scrollHeight + (objBody.offsetHeight-objBody.clientHeight);
		}
		else if(window.navigator.appName.indexOf("Opera") !=-1)		// Opera
		{
			objBody = objFrame.contentDocument.documentElement;
			objFrame.height = objBody.scrollHeight + 10;
		}
		else														// FF, Chrome, Safari
		{
			objBody = objFrame.contentDocument.documentElement;
			objFrame.height = objBody.offsetHeight + 10;
		}
		
		objFrame.style.height = objFrame.height + "px";
	}
	catch (e)
	{
	}
}



function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



//¸®»çÀÌÁî ¾ÈÇÏ´Â ÆË¾÷À» ¿¬´Ù
function Pop_Open3( szUrl,szTitle,szStyle )
{
	var obj=window.open(szUrl,szTitle,szStyle);
}

//¸®»çÀÌÁî ¾ÈÇÏ´Â ÆË¾÷À» ¿¬´Ù
function Pop_Open2( szUrl,szTitle,nLeft,nTop,nWidth,nHeight )
{
	var obj=window.open(szUrl,szTitle,'left='+nLeft+', top='+nTop+', width='+nWidth+',height='+nHeight+",marginwidth=0,marginheight=0,resizable=0,scrollbars=no'");
}

//¾È¿¡¼­ resizetoÇÏ´Â ÆË¾÷À» ¿¬´Ù
function Pop_Open( szUrl,szTitle,nLeft,nTop )
{
	Pop_Open2( szUrl,szTitle,nLeft,nTop,10,10 );
}

// Ç®ÆäÀÌÁö ·Î±×ÀÎ
function Go_Pop_Up_Login()
{
	Parse_Cookie(document);
	var ticket = Read_Cookie("PdboxTicket");

	if (ticket == null || ticket == "")
	{
		var szHref = location.href;

		var szExp  =/&/g
		var szHref = szHref.replace(szExp,"%26");
		
		//#, #top»èÁ¦ IE¿¡¼­¸¸ ¿¡·¯°¡ ³²!
		var szExp = /#$|#top$/g 
		var szHref = szHref.replace(szExp,"");
		
		location.href = LOGIN_8100 + "/afreeca/login.php?szFrom=full&request_uri="+szHref;
		return 0;
	}
	return 1;
}


// ¹öÆÛ¸µ ÆäÀÌÁö
function Bufferinginpo04()
{
	var szHtml = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='610' height='218'>"
						+ "<param name=movie value='"+AFREECA+"/flash/buffer04.swf'>"
						+ "<param name=quality value=high>"
						+ "<embed src='"+AFREECA+"/flash/buffer04.swf' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='610' height='218'>"
						+ "</embed>"
						+ "</object>";

	document.write( szHtml );
}


//¹üÀ§¿¡ ÇØ´çÇÏ´Â ³­¼ö¸¦ »ý¼ºÇÏ¿© ¹ÝÈ¯ÇÏ´Â ÇÔ¼ö (¾ÆÇÁ¸®Ä«¿¡¼­ »ý±ä ÀÏ¿¡ »ç¿ë)
function Return_Rand( szNo )	
{
	var arRandNo=new Array();

	for(var i=0; i<szNo; i++)
	{
		arRandNo[arRandNo.length]=i; 
	}

	arRandNo.sort( function(){return Math.random()*2-1;} );
	return arRandNo; 
}

//¹üÀ§¿¡ ÇØ´çÇÏ´Â ³­¼ö¸¦ »ý¼ºÇÏ¿© ¹ÝÈ¯ÇÏ´Â ÇÔ¼ö (½ÃÀÛ°ª ÀÖÀ½)
function Return_Rand2( szStartNo, szNo )	
{
	var arRandNo=new Array();

	for(var i=szStartNo; i<szNo; i++)
	{
		arRandNo[arRandNo.length]=i; 
	}

	arRandNo.sort( function(){return Math.random()*2-1;} );
	return arRandNo; 
}



function createHttpRequest()
{
     if( window.ActiveXObject)
     {
		 try
		 {
		 	return new ActiveXObject("Msxml2.XMLHTTP");
		 }
		 catch (e)
		 {
			 try
			 {
			 	return new ActiveXObject("Microsoft.XMLHTTP");
			 }
			 catch (e2)
			 {
				 return null;
			 }
		 }
    }
    else if(window.XMLHttpRequest)
    {
		return new XMLHttpRequest();
    }
    else
    {
		return null;
    }
}


// ÇØ¿ÜÀÌ¿ëÀÚ Ã¼Å© °á°ú¸¦ ÄíÅ°·Î ±¸¿öÁÜ	 - by ¹Ú±º ( ¸ÞÀÎ°³Æí ÀÌÈÄ µðÀÚÀÎ )
function Abroad_Chk_Result( szData )
{
	if(szData == "OK")
	{
		try
		{
			parent.document.getElementById("divMainQuickview").className = "afreeca_item_abroad";
			parent.document.getElementById("divMainQuickview").innerHTML = '<ul><li><a href="#abroad" onClick="javascript:goPoint(\'abroad\');"><img src="'+AFREECA+'/images/main/btn_item_abroad.gif" alt="ÇØ¿ÜÀÌ¿ëÀÚ ÀÔÀå±Ç" class="on"/></a></li><li><a href="#balloon" onClick="javascript:goPoint(\'balloon\');"><img src="'+AFREECA+'/images/main/btn_item_ball.gif" alt="º°Ç³¼±" /></a></li><li><a href="#alimi" onclick="javascript:goPoint(\'alimi\');"><img src="'+AFREECA+'/images/main/btn_item_alimi.gif" alt="¾Ë¸®¹Ì" /></a></li><li><a href="#my" onClick="javascript:goPoint(\'my\');"><img src="'+AFREECA+'/images/main/btn_item_info.gif" alt="³» ¾ÆÀÌÅÛ Á¤º¸" /></a></li></ul>';
		}
		catch (e)
		{
			//¸ÞÀÎÆäÀÌÁö
		}

		try
		{
			parent.document.getElementById("imgQuickViewMenuBtn").src = AFREECA + "/item/img_btn/sub_btn_ticket.gif";
		}
		catch (e2)
		{
			//¼­ºêÆäÀÌÁö ÁÂÃø ¸Þ´º
		}

		try
		{
			parent.ChangeTab();
		}
		catch (e3)
		{
			//¾ÆÀÌÅÛ°ü·Ã ÅÇ
		}
	}
	
	return;
}

// get ¸Þ¼Òµå ÆÄ½ÌÇØ¼­ °¡Á®¿À±â	 - by ¹Ú±º
function getParam( szFullParam, szParamName)
{
	var szOnlyParam	= szFullParam.substr(1);
	
	var aOnlyParam	= szOnlyParam.split("&");
	
	for(i = 0; i < aOnlyParam.length; i++)
	{
		var aParam	= aOnlyParam[i].split("=");
		if( aParam[0] == szParamName)
		{
			return aParam[1];
		}
	}
	return '';
}


// Äüºä, ÇØ¿Ü¾ÆÀÌÅÛ °áÁ¦ ÆË¾÷ - by ¹Ú±º
function openPay( nItemId )
{
	if( !checkPointPm() )
	{
		alert("[¾ÆÇÁ¸®Ä« Á¤±âÁ¡°Ë]\nÁö±ÝÀº ¼­ºñ½º Á¡°ËÁßÀÔ´Ï´Ù.\n\n¼­ºñ½º Á¡°Ë½Ã°£\n" + PMSPM_TEXT );
		return;
	}

	Parse_Cookie(document);
    var ticket = Read_Cookie("PdboxTicket");

	if (ticket == null || ticket == "")
	{
		location.href = LOGIN_8100 + "/afreeca/login.php?szFrom=full&request_uri=" + location.href;	
	}
	else if( nItemId == 0)
	{
	}
	else
	{
		var szAbroad = Read_Cookie("AbroadChk");
		var szConfirmMsg = "Àá±ñ!\n\n"
					+ "Æí¸®ÇÑ 'Äüºä 30ÀÏ ÀÚµ¿°áÁ¦'¸¦ ÀÌ¿ëÇØº¸¼¼¿ä.\n"
					+ "ÀÏ¹Ý »óÇ°º¸´Ù 10% Àú·ÅÇÑ 3,500¿ø¿¡ Äüºä¸¦ Áñ±æ ¼ö ÀÖ½À´Ï´Ù.\n\n"
					+ " - È®ÀÎ : ÀÚµ¿°áÁ¦ ½ÅÃ»ÇÏ±â(3,500¿ø)\n"
					+ " - Ãë¼Ò : ÀÏ¹Ý Äüºä 30ÀÏ ÀÌ¿ë±Ç ±¸¸ÅÇÏ±â(3,900¿ø)";
		
		if( nItemId == "463671" || nItemId == "456190" || nItemId == "462911" || nItemId == "462912" || nItemId == "462913" || nItemId == "465003" || nItemId == "465004" || nItemId == "465005" || nItemId == "465006" )
		{
			if ( nItemId == "465004" || nItemId == "465003" || nItemId == "465005" || nItemId == "465006") // ¾ÆÀÌÇÉ Á¡°Ë Áß Äüºä ¼±¹° Â÷´Ü¿ë
			{
				window.open( MEMBER_8108+"/app/ipin_pm.php?szType=popup&itemid="+nItemId,"point", "toolbar=0 ,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=1,width=436,height=529,top=0,left=0");
			}
			/**** Äüºä ÀÚµ¿°áÁ¦ À¯µµ ¸Þ½ÃÁö ·ÎÁ÷ 20100719 Á¦¿Ü(requester ÀÓ) 			*/
			else if ( nItemId == "462911" && confirm(szConfirmMsg)) // ÄüºäÀÚµ¿°áÁ¦ ÀçÈ®ÀÎ ¾ó·µ
			{
				window.open( POINT+"/SetAutoPay.asp?itemcnt=1&paytype=0&itemid=520800","point", "toolbar=0 ,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=1,width=436,height=529,top=0,left=0");	
			}
			else
			{
				window.open( POINT+"/afreeca_license_check.asp?itemcnt=1&paytype=0&itemid="+nItemId,"point", "toolbar=0 ,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=1,width=436,height=529,top=0,left=0");
			}
		}
		else if(nItemId == "520800") // ÄüºäÀÚµ¿°áÁ¦ »óÇ°
		{
			window.open( POINT+"/SetAutoPay.asp?itemcnt=1&paytype=0&itemid=" + nItemId,"point", "toolbar=0 ,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=1,width=436,height=529,top=0,left=0");
		}
		else // ÇØ¿ÜÀÌ¿ëÀÚ´Â ¼ÓµµÃ¼Å© ÆË¾÷
		{
			window.open( AFREECA+"/popup/abroad_speed_test.htm?itemid="+nItemId,"","width=530,height=457");
		}
	}
}


// Äüºä ¹«·áÃ¼Çè °áÁ¦ ÆË¾÷	- by ¹Ú±º
function openFree()
{
	Parse_Cookie(document);
    var ticket = Read_Cookie("PdboxTicket");

	if (ticket == null || ticket == "")
	{
		location.href = LOGIN_8100 + "/afreeca/login.php?szFrom=full&request_uri=" + location.href;	
	}
	else
	{
		window.open( POINT+"/afreeca/afreecafreeInsform.asp?itemid=364925","point", "toolbar=0 ,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=1,width=436,height=529,top=0,left=0");
	}
}


// À¯·á¼­ºñ½º ÀÌ¿ë¾à°ü ÆË¾÷	- by ¹Ú±º
function popPolicy()
{
	window.open( AFREECA+"/popup/pop_pay_policy.htm","point", "toolbar=0 ,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=1,width=540,height=650,top=0,left=0");
}


// ÇØ¿ÜÀÌ¿ëÀÚ ¾ÆÀÌÅÛ ¹Ù·Î°¡±â ¸·´Â ½ºÅ©¸³Æ®	- by ¹Ú±º
function Abroad_Alert()
{
	if(location.href == AFREECA+"/afreeca_app_main.htm")
	{
		window.open( AFREECA+"/abroad.htm",'','');
	}
	else
	{
		location.href = AFREECA+"/abroad.htm";
	}
	return;
}


function self_resize()
{
	try
	{
		var bIsSP2 = false;
		var add_sp = 0;
		bIsSP2 = (window.navigator.userAgent.indexOf("SV1") != -1);
		if (bIsSP2)
		{     
			  // XP SP2 ºê¶ó¿ìÀúÀÓ..
			  add_sp = 25;
		}  
		else
		{
			 add_sp = 0;
		}

		var oBody   = document.body;
		
		window.resizeTo(oBody.scrollWidth+10,oBody.scrollHeight + (oBody.offsetHeight-oBody.clientHeight)+add_sp  );
	}
	catch(e)
	{
		//Trace("jscript/pop_index.js ¿¡ self_resize()¿À·ù:"+e.description);
	}
		

}

// vod ½ÇÇà
function playVod( chatting_url,vod_server,vod_filename,broad_title )
{
     Parse_Cookie(document);
     var ticket = Read_Cookie("PdboxTicket");

	 if (ticket == null || ticket == "")
	 {
		alert("¾ÆÇÁ¸®Ä« ¹æ¼Û ½ÃÃ»À» À§ÇØ¼­ ·Î±×ÀÎÀ» ÇØÁÖ½Ê½Ã¿À.");
		if(location.href == LIVE_8057+"/pg_gen/afreeca_web_main.htm" )
		{
			return;
		}
		else
		{	
			Go_Pop_Up_Login();
		}
		return;
	}
     
     if( Go_Pop_Up_Login() )
     {
         var obj= document.playerform;
         obj.chatting_url.value  = chatting_url;
         obj.vod_server.value    = vod_server;
         obj.vod_filename.value  = vod_filename;
         obj.broad_title.value   = broad_title;
         obj.control.value       = "play_broad";

         obj.action = LIVE_8057+"/app/index.php";
         obj.target = "common_action_frame";
         obj.submit();
     }
}

// È­¸é °¡·Î Å©±â
function getClientWidth()
{
	var nClientWidth;
	if(self.innerWidth)
	{
		// IE ¿Ü ¸ðµç ºê¶ó¿ìÀú
		nClientWidth = self.innerWidth;
	}
	else if(document.documentElement && document.documentElement.clientWidth)
	{
		// IE 6 ¸¸
		nClientWidth = document.documentElement.clientWidth;
	}
	else if(document.body)
	{
		// IE °è¿­(IE 6 Á¦¿Ü)
		nClientWidth = document.body.clientWidth;
	}
	
	return nClientWidth;
}

// È­¸é ¼¼·Î Å©±â
function getClientHeight()
{
	var nClientHeight;
	if(self.innerHeight)
	{
		// IE ¿Ü ¸ðµç ºê¶ó¿ìÀú
		nClientHeight = self.innerHeight;
	}
	else if(document.documentElement && document.documentElement.clientHeight)
	{
		// IE 6 ¸¸
		nClientHeight = document.documentElement.clientHeight;
	}
	else if(document.body)
	{
		// IE °è¿­(IE 6 Á¦¿Ü)
		nClientHeight = document.body.clientHeight;
	}
	
	return nClientHeight;
}

// IE6 ºê¶ó¿ìÀú »ç¿ëÀÚ ·¹ÀÌ¾î ÆË¾÷ »ý¼º(1.0¸¸ º¸ÀÌ±â/°¨Ãß±â)-110906
function chkBrowser(funcName, obj)
{
	if(bLayerPopUp)
	{
		bLayerPopUp = false;
		return;
	}
	
	var brVer = navigator.userAgent;
	var brVerId = brVer.indexOf('MSIE');
	var brNum = brVer.substr(brVerId, 8);

	if(brNum == "MSIE 6.0")
	{
		var szHtml = '';
		szHtml += '<div style="position:relative; z-index:109; width:630px; height:560px; background:url(http://www.afreeca.com/images/popup/ie8.gif) left top no-repeat;"><a href="http://www.afreeca.com" target="_new" title="afreeca" style="width:110px; height:40px; position:absolute; left:26px; top:8px; text-indent:-3000em; ">afreeca</a><a href="#" id="ie8_popup_close" onclick=popupclose("'+funcName+'","'+obj+'"); title="´Ý±â" style="width:42px; height:42px; position:absolute; top:8px; left:570px; text-indent:-3000em; ">´Ý±â</a><a href="http://windows.microsoft.com/ko-KR/internet-explorer/downloads/ie-8" title="explorer8 ¼³Ä¡ÇÏ±â" target="_new" style="width:560px; height:66px; position:absolute; left:35px; top:445px; text-indent:-3000em;">explorer8 ¼³Ä¡ÇÏ±â</a></div>';

		var layerpopup = document.getElementById("layerpopup");
		if(layerpopup != null)
		{
			document.body.removeChild(layerpopup);
		}
		
		var doc = document.body;
		var el_layerpopup = document.createElement('DIV');
			
		el_layerpopup.setAttribute("class", "layerpopup");
		el_layerpopup.setAttribute("id", "layerpopup");
		el_layerpopup.setAttribute("align", "center");
		el_layerpopup.style.cssText = "cursor:default; Z-INDEX: 109; LEFT: 0px; POSITION: absolute; TOP: 0px; border: solid;border-color: #dedede; border-width: 2px;";	// ÅÂ±×ÀÇ style °ª ¼³Á¤(¸ðµç ºê¶ó¿ìÀú¿¡ Àû¿ëµÊ)
		el_layerpopup.innerHTML = szHtml;
			
		doc.appendChild(el_layerpopup);
		
		// ÆË¾÷ Ãâ·Â À§Ä¡ ¼³Á¤
		var nDivPopupWidth = document.getElementById('layerpopup').clientWidth;
		var nDivPopupHeight = document.getElementById('layerpopup').clientHeight;
		
		var nLeftMargin = (getClientWidth() - nDivPopupWidth) / 2;
		var nTopMargin = (getClientHeight() - nDivPopupHeight) / 2;
		
		if (nLeftMargin < 0) nLeftMargin = 0;
		if (nTopMargin < 0) nTopMargin = 0;
		
		document.getElementById('layerpopup').style.marginLeft = nLeftMargin + 'px';		
		document.getElementById('layerpopup').style.marginTop = nTopMargin + 'px';
		
		layerpopup.style.display = "";
		exit;
	}
	else
	{
		bLayerPopUp = true;
		return;
	}
}

// ·¹ÀÌ¾î ÆË¾÷ ´Ý±â-110906
function popupclose(funcName, obj)
{
	var layerpopup = document.getElementById("layerpopup");
	layerpopup.style.display = "none";
	bLayerPopUp = true;
	
	//alert(funcName+"("+obj+")");	
	eval(funcName+"("+obj+")");
	
	return;
}

// ÇÃ·¹ÀÌ¾î ½ÇÇà (1.0/2.0 °øÅë)
function runPlayer(act,etc)
{
	// IE6 »ç¿ëÀÚ ·¹ÀÌ¾î ÆË¾÷ Ãâ·Â
	if(act == "cast" || act == "app_player")
	{
		chkBrowser('runPlayer', "'"+act+"','"+etc+"'");
	}

	var szUrl = "";
	var szEtc = "";

	if(etc == undefined || etc == null)
	{
		etc = '';
	}

	if(  isPossblePlaying() )
	{
		if( act == "cast" )
		{
			Parse_Cookie(document);
			var ticket = Read_Cookie("PdboxTicket");
			
			if (ticket == null || ticket == "")
			{
				alert("¹æ¼ÛÀ» ÇÏ½Ã·Á¸é ¸ÕÀú ·Î±×ÀÎÀ» ÇØÁÖ¼¼¿ä.\n½ÃÃ»ÇÏ±â´Â ·Î±×ÀÎ ¾øÀÌ ¹Ù·Î ½ÃÃ»ÀÌ °¡´ÉÇÕ´Ï´Ù.");
				return;
			}
			
			makeIframe( LIVE_8057+"/afreeca/index.php?control=CastAfreeca" );
			return;
		}
		else if( act == "app_player" ) 
		{
			if( etc != '' )
			{
				var szFullField = etc;
				var szField = etc.replace( etc.replace(/^(.*?)(search_keyword%3d)/gi, ""), "" );
				var szValue = etc.replace(/^(.*?)(search_keyword%3d)/gi, "");
				szEtc  = (szField != "" ) ? '&szEtc=' + szField + unescape(szValue) : '&szEtc=' + escape(etc);
			}

			makeIframe( LIVE_8057+"/afreeca/index.php?control=RunAfreeca" + szEtc );
			return;
		}
		else
		{
			runSvlPlayer();
			return;
		}
	}
	else
	{
		alert( "½ÇÇàÁßÀÔ´Ï´Ù. Àá½Ã¸¸ ±â´Ù·ÁÁÖ¼¼¿ä. " );
		return;
	}
}

// ½ºÆ©µð¿À ½ÇÇà(af_station ¿ë)
function runPlayer2(act) 
{
	// IE6 »ç¿ëÀÚ ·¹ÀÌ¾î ÆË¾÷ Ãâ·Â
	chkBrowser('runPlayer2', "'"+act+"'");

	Parse_Cookie(document);
	var ticket = Read_Cookie("PdboxTicket");

	if (ticket == null || ticket == "")
	{
		if( act == 'cast' )
		{
			alert("¾ÆÇÁ¸®Ä« ½ºÆ©µð¿À ½ÇÇàÀ» À§ÇØ¼­ ·Î±×ÀÎÀ» ÇØÁÖ½Ê½Ã¿À.");
			Go_Pop_Up_Login();
		}
		return;
	}

	if(  isPossblePlaying() )
	{
		//document.common_action_frame.location.href = LIVE_8057 + "/afreeca/index.php?control=CastAfreeca";
		makeIframe( LIVE_8057+"/afreeca/index.php?control=CastAfreeca" );
		return;
	}
	else
	{
		alert( "½ÇÇàÁßÀÔ´Ï´Ù. Àá½Ã¸¸ ±â´Ù·ÁÁÖ¼¼¿ä" )
		return;
	}
}

//¾ÆÇÁ¸®Ä« 2.0 ½ÃÃ»ÇÏ±â
function runSvlPlayer(uId, bNo)
{
	var szOpenUrl = PLAYER_80;
	if(uId != null && uId != undefined && uId != '')
	{
		szOpenUrl += "/" + uId;
		
		if(bNo != null && bNo != undefined && bNo != '')
		{
			szOpenUrl += "/" + bNo;
		}
	}
	var nPop = window.open( szOpenUrl, 'newPlayer', 'left=10,top=10,width=1024,height=768,marginwidth=0,margnheight=0,resizable=1,scrollbars=no');
	if(nPop == "" || nPop == null || nPop == undefined)
	{
		alert("ÆË¾÷ÀÌ Â÷´ÜµÇ¾î ÀÖ½À´Ï´Ù. ÆË¾÷À» Çã¿ëÇØ ÁÖ¼¼¿ä.");
	}
	else
	{
		nPop.focus();
	}
	return;
}

//¾ÆÇÁ¸®Ä« 1.0 ½ÃÃ»ÇÏ±â
function playBroad(broad_no, act, user_id)
{
	// IE6 »ç¿ëÀÚ ·¹ÀÌ¾î ÆË¾÷ Ãâ·Â
	chkBrowser('playBroad', "'"+broad_no+"','"+act+"','"+user_id+"'");

	var control;
	var szIdorNo;

	if (broad_no == '') 
	{ 
		alert ('ÇöÀç ¹æ¼ÛÁßÀÌ ¾Æ´Õ´Ï´Ù.');
		return;
	} 
	else if (broad_no == 'full') 
	{ 
		alert ('½ÃÃ»°¡´É Á¤¿øÀÌ ÃÊ°úµÇ¾ú½À´Ï´Ù.');
		return;
	}
	else
	{ 
		control = act;
		szIdorNo = '&showType=flash&nBroadNo=&szSizeCode=';
		
		if( act=="player" )   
		{
			if( user_id != null && user_id != undefined && user_id != '' )
			{
				runSvlPlayer(user_id, broad_no);
				return;
			}
			else
			{
				// (showType ÀÌ flash¸é index.php¿¡¼­ ¹«Á¶°Ç Dummy_Launch ·Î ¹Ù²ã¹ö¸². 
				// index.php¿¡¼­´Â Dummy_Launch¸é ½Ç¹ö¶óÀÌÆ®·Î location ½ÃÅ´
				//control = "Dummy_Launch";
				control = "SeeAfreeca";
				szIdorNo += '&showType=flash&nBroadNo=' + broad_no;
			}
		}
		else if( act=="scrap" )     
		{
			control = "ScrapBroad";
			szIdorNo = '&nBroadNo=' + broad_no;
		}
		else if( act == "dummy_launch" )
		{
			runSvlPlayer(broad_no);
			return;
		}
		else if( act == "search_byid" )    
		{
			runSvlPlayer(broad_no);
			return;
		}
		else if( act == "category" )
		{
			runSvlPlayer();
			return;
		}	
		else if( act == "app_launch" )
		{
			control	= "RunAfreeca";
			szIdorNo = '&szBjId=' + broad_no;
			makeIframe(LIVE_8057+"/afreeca/index.php?control=" + control + szIdorNo);
			return;
		}
		
		window.open( LIVE_8057+"/afreeca/index.php?control=" + control + szIdorNo, 'oRunAfreeca', 'left=10,top=10,width=10,height=10,marginwidth=0,margnheight=0,resizable=1,scrollbars=no' );
	}
}
//¾ÆÇÁ¸®Ä« 1.0 ¼ºÀÎ¹æ ½ÃÃ»ÇÏ±â
function playAdultBroad(broad_no, act, user_id)
{
	playBroad(broad_no, act, user_id);
}

// °ÔÀÓTV ÇÃ·¯±×ÀÎ ¼³Ä¡¾È³»
function showPluginInstall()
{
	try{
		var bIsInstalled = false;
		if( BrowserCheck() == "" )
		{
			var aPlugins = navigator.plugins;
		
			for(var i=0; i<aPlugins.length; i++)
			{
				if(aPlugins[i].name.indexOf('AFCStarter') > -1)
				{
					bIsInstalled = true;
					break;
				}
			}
			
			if(bIsInstalled)
			{
				document.getElementById("afcPluginInfoDiv").innerHTML = '';
			}
			else
			{
				printPluginInfo('http://afupd1.afreeca.com:9091/AFC/AFCUpdater.exe', 'Install');
			}	
		}
	}catch(e)
	{
	}
}

//ÇÃ·¯±×ÀÎ ¼³Ä¡ ¾È³»
function printPluginInfo(plink, type)
{
	var szHtml = '';
	//¾ÆÇÁ¸®Ä« ¸ÞÀÎ¿¡¼­
	if(type != "SeeAfreeca")
	{
		szHtml = '<div class="layer_plugin">';
	}
	else//°³ÀÎ¹æ¼Û±¹¿¡¼­
	{
		szHtml = '<div class="layer_plugin mybs_position">';
	}
	
	szHtml = '<div class="layer_plugin">';
	
	szHtml += '<p class="blind">ÆÄÀÌ¾îÆø½º, Å©·Ò, »çÆÄ¸®, ¿ÀÆä¶ó ºê¶ó¿ìÀú¿¡¼­<br /> ¿øÈ°ÇÑ ÀÌ¿ëÀ» À§ÇØ ÇÃ·¯±×ÀÎ ¼³Ä¡°¡ ÇÊ¿äÇÕ´Ï´Ù.</p>'
			+ '<a href="' + plink + '" class="plugin" title="ÇÃ·¯±×ÀÎ ¼³Ä¡ÇÏ±â">ÇÃ·¯±×ÀÎ ¼³Ä¡ÇÏ±â</a>'
			+ '<a href="javascript:closePluginInfo();" class="layer_close1" title="´Ý±â">´Ý±â</a>';
			
	szHtml += '</div>';
	
	try
	{
		document.getElementById('afcPluginInfoDiv').innerHTML = szHtml;		
	}
	catch(e)
	{
		//alert(e);
	}
}

//ÇÃ·¯±×ÀÎ ¼³Ä¡ ´Ý±â
function closePluginInfo()
{
	document.getElementById('afcPluginInfoDiv').innerHTML = '';
}
// ¸ÞÀÎ °³Æí ÀÌÈÄ Áñ°ÜÃ£±â Ãß°¡
function Add_Favorite(szId)
{
	Parse_Cookie(document);
    var ticket = Read_Cookie("PdboxTicket");

    if (ticket == null || ticket == "")
    {
        alert("Áñ°ÜÃ£±â Ãß°¡¸¦ À§ÇØ¼­ ·Î±×ÀÎ ÇØÁÖ¼¼¿ä. ");
        return;
    }

	var szUserId = Read_Cookie("PdboxBbs");
	makeIframe( FAV_8057+"/afreeca/favorite_api.php?szWork=ADD&favorite=" + szId + "&szBjId=" + szUserId );
}

// ¸ÞÀÎ°³Æí ÀÌÈÄ Äüºä º¸À¯¿©ºÎ Ç¥½Ã
function dispItme()
{
	try
	{
		eval( objItem );

		Parse_Cookie(document);
		var szAbroad = Read_Cookie("AbroadChk");

		var nIsItem = objItem["isItem"];
		var szDetail = objItem["detail"][0];
	
		var szWhich = "quickview";
		var szItemName = "Äüºä ";
		var szAltText	= "±¸¸Å";
		var szUrl = AFREECA+"/quickview.htm";
		var szItemImg = AFREECA+"/images/main/login_a_btn03.gif";

		if( szAbroad == "OK" )		// ÇØ¿Ü ÀÌ¿ëÀÚ
		{
			szWhich = "abroad";
			szItemName = "ÇØ¿ÜÀÌ¿ëÀÚ ÀÔÀå±Ç";
			szUrl = AFREECA+"/abroad.htm";

			if( nIsItem > 0 && szDetail == "ABROAD")		// º¸À¯ ¾ÆÀÌÅÛ ÀÖÀ» °æ¿ì
			{
				szItemImg = AFREECA+"/images/main/btn_on.gif";
				szAltText = "Äüºäon";
			}
		}
		else
		{
			if( nIsItem > 0 )		// º¸À¯ ¾ÆÀÌÅÛ ÀÖÀ» °æ¿ì
			{
				szWhich = "my";
				szUrl = POINT+"/report/afreecauselist.asp";
				szItemImg = AFREECA+"/images/main/btn_on.gif";
				szAltText = "Äüºäon";
			}
		}

		document.getElementById("spnItemName").innerHTML = '<a href="#point" class="quickv" onclick="javascript:goPoint(\'' + szWhich + '\');">' + szItemName + '</a>';
		document.getElementById("spnItemImg").innerHTML = '<a href="#point" onclick="javascript:goPoint(\'' + szWhich + '\');"><img src="' + szItemImg + '" alt="'+ szAltText +'" border="0"></a>';
	}
	catch (e)
	{
	}
}


// ¸µÅ© ¿­±â
function openLink(url, target)
{
	if( target == "_blank" || target == 1 )
	{
		Pop_Open3(url, 'openLink', 'toolbar=yes,menubar=yes,location=yes,resizable=yes,scrollbars=yes');
	}
	else
	{
		location.href = url;
	}
}


// º£½ºÆ® BJ ¼øÀ§ Ç¥½Ã

function dispBestBjRank()
{
	document.getElementById("spnBestBj").innerHTML = '(<a href="#" class="gray007">º£½ºÆ® 21À§</a>)';
}

// ¾ÆÀÌÇÁ·¹ÀÓ µ¿Àû »ý¼º

function makeIframe( szUrl )
{
	var iframe = document.createElement('iframe');

	iframe.style.width = '50';
	iframe.style.height = '0';
	iframe.setAttribute('src', szUrl);
	iframe.setAttribute('frameborder','0');
	
	document.getElementsByTagName('body').item(0).appendChild(iframe);
}

// ºê¶ó¿ìÀú ¹öÁ¯ Ã¼Å©

function checkBrowserVersion()
{
	if(new RegExp(/Firefox/).test(navigator.userAgent)){ 
		return "FF";
	}else if(new RegExp(/Netscape/).test(navigator.userAgent)){ 
		return "NC";
	}else if(new RegExp(/MSIE/).test(navigator.userAgent)){ 
		return "IE";
	} 
}


/**
 * @brief   GNB ¿µ¿ª °Ë»ö Å¸ÀÌÆ² ¼³Á¤
 */
function setSearchData( nValue, oTitle, oSearchType, oSearchList )
{
	var szTitle = "";

	if(nValue == "broad")	{ szTitle = "»ý¹æ¼Û";	 }
	else if(nValue == "ucc") { szTitle = "¿µ»óÅ¬¸³"; }
	else if(nValue == "bj") { szTitle = "BJ"; }

	try
	{
		oTitle.innerHTML = szTitle;
		oSearchType.value = nValue;
	}
	catch (e)
	{
	}

	oSearchList.style.display = 'none';
}

/**
 * @brief	GNB ¿µ¿ª °Ë»ö¸Þ´º ¼³Á¤
 */
function setSearchMenu( oSearchList )
{
	try
	{
		var szDisp = (oSearchList.style.display == "block") ? "none" : "block";
		oSearchList.style.display = szDisp;		
	}
	catch (e)
	{
	}
}


// ¸ÞÀÎ, ¼­ºêÆäÀÌÁö °Ë»ö Ã¼Å©
function checkSearch( form )
{
	var szSearchType = "broad";

	if(form.szSearchType.tagName == "SELECT")
	{
		szSearchType = form.szSearchType.value;
	}
	else if(form.szSearchType.tagName == "CHECKBOX" )
	{
		if(form.szSearchType(0).checked == true)
		{
			szSearchType = form.szSearchType(0).value;
		}
		else if(form.szSearchType(1).checked == true)
		{
			szSearchType = form.szSearchType(1).value;
		}
		else if(form.szSearchType(2).checked == true)
		{
			szSearchType = form.szSearchType(2).value;
		}
	}
	else
	{
		szSearchType = form.szSearchType.value;
	}

	var szSearchValue = form.szSearchValue.value.replace(/(^[\s]*)|([\s]*$)/g, "");
	
	/* ÇÑ±ÛÀÚ °Ë»öÁ¦ÇÑ »ç¿ëÇÔ.	 by jwizard
	if( LimitForSearch( szSearchValue ) )
	{
		top.location.href = AFREECA+"/web_search.htm?szSearchType=" + szSearchType + "&szSearchValue=" + szSearchValue;	
	}
	*/
	// ÇÑ±ÛÀÚ °Ë»öÁ¦ÇÑ »ç¿ëÇÏÁö ¾ÊÀ½.
	top.location.href = AFREECA+"/web_search.htm?szSearchType=" + szSearchType + "&szSearchValue=" + szSearchValue;
	return false;
}


// Æ¯¼ö¹®ÀÚ Á¦°Å

function isSpecial(szText)
{
    var szSpecial = /\+|\[|\&|\*|\(|\)|\+|\?|\#|\%/g;
    if(szSpecial.exec( szText))
    {
        return true;
    }
    return false;
}


// Æ¯¼ö¹®ÀÚ Á¦°Å2

function isSpecial2(szText, szSpecial)
{
    if(szSpecial.exec( szText))
    {
        return true;
    }
    return false;
}


// ¹®ÀÚ¿­À» Á¤ÇØÁø byte¼ö¸¸Å­ Àß¶ó³¿
function getByteLength( szMsg, nMaxLen )
{
	try
	{
		var nBytes = 0;
		var str = szMsg.substring(0);

		if( str == null )
			return 0;

		for(var i=0; i<str.length; i++)
		{
			var nAsc = str.charCodeAt(i);

			if ( (nAsc > 0)  && (nAsc < 256) && (nAsc != '\r'))
				nBytes += 1;
			else
				nBytes += 2;

			if( nBytes > nMaxLen )	// Çã¿ë ¼ö¸¦ ³Ñ¾î¼­¸é
			{
				str = str.substr(0,i) + "..";
				break;
			}
		}
	}
	catch(e)
	{
	}
	return str;
}


// js ÆÄÀÏ µ¿Àû ·Îµù
function include_js(file, callBackFunction, szId, callBackParam )
{
	try
	{
		var html_doc = document.getElementsByTagName('head')[0];
		//id°ª Ãß°¡ by mino 2009-03-24
		if(!szId || szId == 'undefined' || szId == null)
		{
			szId = 'json';
		}
		var removeTarget = document.getElementById(szId);
		if(removeTarget != 'undefined' && removeTarget!=null)
		{
			html_doc.removeChild( removeTarget );
		}
		//ÄÝ¹é ÆÄ¶ó¹ÌÅÍ Ãß°¡
		if( callBackParam == 'undefined' || callBackParam == null )
		{
			callBackParam = '';
		}

		js = document.createElement('script');
		js.setAttribute('type', 'text/javascript');
		js.setAttribute('charset', 'euc-kr');
		js.setAttribute('id', szId);
		js.setAttribute('src', file);

		html_doc.appendChild(js);
	
		// Fires in IE, also modified the test to cover both states
		js.onreadystatechange = function () {
			if (/complete|loaded/.test(js.readyState)) {
				if( callBackFunction != null && callBackFunction != undefined )
				{
					callBackFunction( callBackParam );
				}
			}
		}
		// Fires in FF
		js.onload = function () {
			if( callBackFunction != null && callBackFunction != undefined )
			{
				callBackFunction( callBackParam );
			}
		}	
		return false;
	}	
	catch (e)
	{
	}
}

// js ÆÄÀÏ µ¿Àû ÀÎÅ¬·çµå ¿Ï·á ÈÄ »èÁ¦
function remove_js(szId)
{
	try
	{
		var html_doc = document.getElementsByTagName('head')[0];
		if(!szId || szId == 'undefined' || szId == null)
		{
			szId = 'json';
		}
		var removeTarget = document.getElementById(szId);
		if(removeTarget != 'undefined' && removeTarget!=null)
		{
			html_doc.removeChild( removeTarget );
		}
		removeTarget = null;
	}
	catch (e)
	{
	}
}

// ¼ÓµµÃ¼Å©
function Print_Ocx()
{
	document.write("<OBJECT id='AfSpeedCheck' style='WIDTH:0px; HEIGHT:15px' CODEBASE='"+AFREECA+"/ocx/AfSpeedCheck.cab#version=1,0,1,4' CLASSID=CLSID:0AE0F5F9-8233-49A4-A3C8-004CE190787B NAME='SpeedCheck'></OBJECT>");
}


// URL º¹»ç
function copyCurUrl( szUrl )
{
	try
	{
		var bResult = false;

		if( window.clipboardData )		// IE
		{
			bResult = window.clipboardData.setData("Text", szUrl);
		}
		else
		{
			alert( "URL º¹»ç´Â IE ¿¡¼­¸¸ »ç¿ë °¡´ÉÇÏ½Ê´Ï´Ù.");
			return;
		}

		if( bResult == true)
		{
			alert("°Ô½Ã¹° ÁÖ¼Ò°¡ º¹»çµÇ¾ú½À´Ï´Ù.\nCtrl+V ·Î ºÙ¿©³Ö±â ÇÒ ¼ö ÀÖ½À´Ï´Ù.");
			return;
		}		
	}
	catch (e)
	{
		alert( e.description );
	}
}

/**
   * @brief  StringBuffer »ç¿ë 
   * @author	jwizard
   **/
var StringBuffer = function() 
{
	this.buffer = new Array() ;
}

StringBuffer.prototype.append = function(str) 
{
	this.buffer[this.buffer.length] = str ;
}

StringBuffer.prototype.toString = function() 
{
	return this.buffer.join("") ;
}



function goFramePage( szUrl )
{
	try
	{
		top.location.href = szUrl;
	}
	catch (e)
	{
		location.href = szUrl;
	}
}

var $A = function(iterable) {
  if (!iterable) return [];
  if (iterable.toArray) {
    return iterable.toArray();
  } else {
    var results = [];
    for (var i = 0; i < iterable.length; i++)
      results.push(iterable[i]);
    return results;
  }
}



Function.prototype.bind = function() {
 try{
  var __method = this, args = $A(arguments),object = args.shift();
  return function() {
     return __method.apply(object, args.concat($A(arguments)));
  }
 }catch(e){alert(e.message)}
}

/**
  *	@brief ÇöÀç½Ã°£ yyyymmdd ÇüÅÂ·Î ¸®ÅÏ
  */
function getNowDate()
{
    var szDate = new Date();

    var szYear = szDate.getFullYear();
    var szMonth =  ((szDate.getMonth()+1 < 10)?"0":"")+(szDate.getMonth()+1);
    var szDay = ((szDate.getDate() < 10)?"0":"")+szDate.getDate();
    var szHours = ((szDate.getHours() < 10)?"0":"")+szDate.getHours();
    var szMinutes = ((szDate.getMinutes() < 10)?"0":"")+szDate.getMinutes();

    var szNowTm = String(szYear)+String(szMonth)+String(szDay)+String(szHours)+String(szMinutes);
    
    return szNowTm ;
}

function setPng24(obj) 
{
	obj.width=obj.height=1; 
	obj.className=obj.className.replace(/\bpng24\b/i,''); 
	obj.style.filter = 
	"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');" 
	obj.src='';  
	return ''; 
}

