//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://http://www.17funtv.com/pm/afreeca_pm_notice_full.htm";
}*/
//pm시풀기
//document.writeln("");
try
{
//document.domain = DOMAIN;
}
catch(e)
{
}
var bIsplaying=false; // 시간 제한 두기위함
var oTimeId;
var Max_Time = 2000;
// 공지사항 new 아이콘
function getIcon(flag)
{
if(flag=='Y') {
return '
';
} 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/tutorial.htm", null, "height=560, width=780, toolbar=no,menubar=no,location=no, top=250, left=250");
}
// 다운받기
function openDownload()
{
window.open( AFREECA+"/tutorial/download/download.htm", null, "height=560, width=780, 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 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 ResizeFrame(frame_name,num)
{
try
{
var objFrame = document.getElementById(frame_name);
var objBody = window.frames[num].document.body;
objFrame.height = objBody.scrollHeight + (objBody.offsetHeight-objBody.clientHeight);
}
catch (e)
{
}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i0&&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"
+ ""
+ ""
+ "";
document.write( szHtml );
}
//범위에 해당하는 난수를 생성하여 반환하는 함수 (아프리카에서 생긴 일에 사용)
function Return_Rand( szNo )
{
var arRandNo=new Array();
for(var i=0; i';
}
catch (e)
{
//메인페이지
}
try
{
parent.document.getElementById("imgQuickViewMenuBtn").src = AFREECA + "/item/img_btn/sub_btn_ticket.gif";
}
catch (e2)
{
//서브페이지 좌측 메뉴
}
try
{
parent.ChangeTab();
}
catch (e3)
{
//아이템관련 탭
}
}
return;
}
// 정기점검시 결제페이지 막음 - by 박군
function Pm_Alert()
{
today = new Date();
szNowYear = today.getYear();
szNowMonth = today.getMonth()+1;
szNowDate = today.getDate();
szNowHour = today.getHours();
szNowMinute = today.getMinutes();
if((""+szNowMonth).length == 1) { szNowMonth = "0"+szNowMonth; }
if((""+szNowDate).length == 1) { szNowDate = "0"+szNowDate; }
if((""+szNowHour).length == 1) { szNowHour = "0"+szNowHour; }
if((""+szNowMinute).length == 1) { szNowMinute = "0"+szNowMinute; }
szNowTm = String(szNowYear) + String(szNowMonth) + String(szNowDate) + String(szNowHour) + String(szNowMinute);
if(szNowTm > "200610110900" && "200610111000" > szNowTm )
{
return false;
}
else
{
return true;
}
}
// 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( !Pm_Alert() )
{
alert("因10月11日09:00 ~ 10:00進行停機維護,\n此時間暫時無法購買一起FunTV的道具。");
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
{
location.href = AFREECA + "/pay_policy.htm?nItemId=" + nItemId;
}
}
// 퀵뷰 무료체험 결제 팝업 - by 박군
function openFree()
{
if( !Pm_Alert() )
{
alert("因10月11日09:00 ~ 10:00進行停機維護,\n此時間暫時無法購買一起FunTV的道具。");
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
{
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 runPlayer(act)
{
var szUrl = "";
if( isPossblePlaying() )
{
if( act!="cast" )
{
makeIframe( LIVE_8057+"/afreeca/index.php?control=RunAfreeca" );
return;
}
else
{
Parse_Cookie(document);
var ticket = Read_Cookie("PdboxTicket");
if (ticket == null || ticket == "")
{
alert("請登入帳號,才能執行頻道放送。");
return;
}
makeIframe( LIVE_8057+"/afreeca/index.php?control=CastAfreeca" );
return;
}
}
else
{
alert( "執行中。請稍候。 " );
return;
}
}
// 플레이어 실행(af_station 용)
function 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";
return;
}
else
{
alert( "실행중입니다. 잠시만 기다려주세요" )
return;
}
}
// 메인 개편 이후 즐겨찾기 추가
function Add_Favorite(szId)
{
Parse_Cookie(document);
var ticket = Read_Cookie("PdboxTicket");
if (ticket == null || ticket == "")
{
alert("請登入帳號,才能增加我的最愛。 ");
return;
}
var szUserId = Read_Cookie("PdboxBbs");
makeIframe( LIVE_8079+"/app/favorite_list.cgi?szWork=ADD&favorite=" + szId + "&szBjId=" + szUserId );
}
// 메인 개편 이후 시청하기
function playBroad(broad_no, act)
{
var control;
if (broad_no == '')
{
alert ('現在不是在播放中');
}
else if (broad_no == 'full')
{
alert ('超過可以觀賞的人數');
}
else
{
control = act;
var szIdorNo = '&nBroadNo=' + broad_no;
if( act=="player" ) //시청하기
{
control ="SeeAfreeca";
}
else if( act=="scrap" ) //중계방송
{
control="ScrapBroad";
}
else if( act == "dummy_launch")
{
control = "Dummy_Launch";
szIdorNo = "&showType=flash&nBroadNo=&szSizeCode=&szBjId="+broad_no;
}
else if( act == "search_byid" ) //아이디로 플레이 broad_no 대신 아이디가 들어옴
{
control ="SeeAfreeca";
szIdorNo = '&szBjId=' +broad_no;
}
makeIframe( LIVE_8057+"/afreeca/index.php?control=" + control + szIdorNo );
}
}
// 메인개편 이후 퀵뷰 보유여부 표시
function dispItme()
{
try
{
eval( objItem );
Parse_Cookie(document);
var szAbroad = Read_Cookie("AbroadChk");
var nIsItem = objItem["isItem"];
var szDetail = objItem["detail"];
var szItemName = "Quick-View";
var szUrl = AFREECA+"/quickview.htm";
var szItemImg = AFREECA+"/img/main_img/login_a_btn03.gif";
if( szAbroad == "OK" ) // 해외 이용자
{
szItemName = "海外使用者入場券";
szUrl = AFREECA+"/abroad.htm";
if( nIsItem > 0 && szDetail == "ABROAD") // 보유 아이템 있을 경우
{
szItemImg = AFREECA+"/img/main_img/login_a_btn02.gif";
}
}
else
{
if( nIsItem > 0 ) // 보유 아이템 있을 경우
{
szUrl = POINT+"/afreeca/afreecauselist.asp";
szItemImg = AFREECA+"/img/main_img/login_a_btn02.gif";
}
}
document.getElementById("spnItemName").innerHTML = '' + szItemName + '';
document.getElementById("spnItemImg").innerHTML = '
';
}
catch (e)
{
//alert( e.description );
}
}
// 베스트 BJ 순위 표시
function dispBestBjRank()
{
document.getElementById("spnBestBj").innerHTML = '(Best 21名)';
}
// 아이프레임 동적 생성
function makeIframe( szUrl )
{
var iframe = document.createElement('iframe');
iframe.style.width = '50';
iframe.style.height = '0';
iframe.setAttribute('src', szUrl);
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";
}
}
// 메인, 서브페이지 검색 체크
function checkSearch( form )
{
/* if(form.szSearchType.tagName == "SELECT")
{
szSearchType = form.szSearchType.value;
}
else
{
if(form.szSearchType(0).checked == true)
{
var szSearchType = form.szSearchType(0).value;
}
else if(form.szSearchType(1).checked == true)
{
var szSearchType = form.szSearchType(1).value;
}
else if(form.szSearchType(2).checked == true)
{
var szSearchType = form.szSearchType(2).value;
}
else
{
var szSearchType = 'broad';
}
}
*/
var szSearchType = 'broad';
var szSearchValue = form.szSearchValue.value.replace(/(^[\s]*)|([\s]*$)/g, "");
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;
}
/*
function php_fn_utf8_to_array(str)
{
var re_arr = array();
var re_icount = 0;
for(var i=0, m=str.length; i nMaxLen ) // 허용 수를 넘어서면
{
str = str.substr(0,i) + "..";
break;
}
}
return str;
}
*/
function getByteLength( szMsg, nMaxLen )
{
var nBytes = 0;
var str = szMsg.substring(0);
if( str == null )
return 0;
for(var i=0; i 0) && (nAsc < 128) && (nAsc != '\r'))
nBytes += 1;
else nBytes += 2;
/* else if(nAsc >= 128 && nAsc < 2048)
nBytes += 2;
else if(nAsc >= 2048 && nAsc < 65396)
nBytes += 3;
else
nBytes += 4;
*/
if( nBytes > nMaxLen ) // 허용 수를 넘어서면
{
str = str.substr(0,i) + "..";
break;
}
}
return str;
}
// js 파일 동적 로딩
function include_js(file, callBackFunction)
{
var html_doc = document.getElementsByTagName('head')[0];
js = document.createElement('script');
js.setAttribute('type', 'text/javascript');
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();
}
}
}
// Fires in FF
js.onload = function () {
if( callBackFunction != null && callBackFunction != undefined )
{
callBackFunction();
}
}
return false;
}
// 속도체크
function Print_Ocx()
{
document.write("");
}