﻿function idFindJS() {
    //window.open("https://member.imbc.com/Counsel/FindUserid.aspx");                                
}
function passFindJS() {
    // window.open("https://member.imbc.com/Counsel/FindPassword.aspx");                                
}
function joinJS() {
    //window.open("http://member.imbc.com/User/Join.html");                 
}
function goBillingPage(sItemID) {
    location.href = "http://www.mbcplus.com/Player/Player.aspx?itemID=" + sItemID;
}
function goReload() {
    //changeVod('','','','','');
}
function goDownloadPage(itemId) {

    popupDownload(itemId);
}
function goPopupPlayerCue(sUrl) {
    //window.location.href="http://playercue.imbc.com/TouchPlayer/TouchPlayerExe.aspx?id="+sBroadcastID+"&file="+sVodUrl;
}

function reSize(nWidth, nHeight) {
    window.resizeBy(0, nHeight);
    window.resizeBy(nWidth, 0);
}
function goPlayerCue(sItemID, sBroadcastID, sVodUrl) {
    //alert("플레이어큐로이동");
    //               if(sVodUrl.substring(0,3) == "mms")
    //               {
    //                    var opener = window.open("http://playercue.imbc.com/TouchPlayer/TouchPlayerExe.aspx?id="+sBroadcastID+"&file="+sVodUrl,
    //                        "_idx_11","menubar=0,resizable=1,width=320,height=240");
    //               }
}

function windowOpener(windowUri, windowName, windowWidth, windowHeight) {
    var centerWidth = (window.screen.width - windowWidth) / 2;
    var centerHeight = (window.screen.height - windowHeight) / 2;

    newWindow = window.open(windowUri, windowName, 'resizable=0,width=' + windowWidth +
                    ',height=' + windowHeight +
                    ',left=' + centerWidth +
                    ',top=' + centerHeight);

    newWindow.focus();
    return newWindow.name;
}


function goSponJoin() {
    // windowOpener("https://b2b.imbc.com/b2b/FreeSponsor", "spon",270,  180);              

}

function changeVod(itemID, broadcastID, startTime, endTime, itemIDX) {
    //document.getElementById("f_Main").changeVod(itemID,broadcastID,startTime,endTime,itemIDX);                
}
function changeOnAir() {
    //document.getElementById("f_Main").changeOnAir();
}


function onActiveXError_OnTOP() {
}
function onTop(bOnTop) {
    if (document.getElementById("div_ontop")) {
        if (document.getElementById("div_ontop").innerHTML == "") {
            //브라우져가 관리자 권한이 아닌 경우에 실행이 되지 않지만 무시함
            WriteObjectScript("div_ontop", "objOnTop", "onActiveXError_OnTOP()");
        }
        if (bOnTop == 1) OnTop(1); //download.js
        else OnTop(0);

    }
}
function goPopup(itemID, clipID) {
    if (clipID > 0)
        popupClipPlayer(clipID);        
    else
        popupPlayer(itemID);
}

function goHomePage(url) {
    var opener = window.open(url);
    if (opener == null) {
        alert("팝업이 차단되었습니다.");
    }
}
function goBoard(programID, bid) {
    var url = "http://www.mbcplus.com/program/api/redirectHOME.ashx?programID=" + programID + "&bid=" + bid;
    var opener = window.open(url);
    if (opener == null) {
        alert("팝업이 차단되었습니다.");
    }
}
function goBBS(url) {
    var opener = window.open(url);
    if (opener == null) {
        alert("팝업이 차단되었습니다.");
    }
}

function startSwfObject(sWidth, sHeight, sIitemID, sClipID, sTrailerID, sMode, sDivID) {
    var so = new SWFObject("http://www.mbcplus.com/Player/PlusPlayer.swf", "f_Main", sWidth, sHeight, "9.0.115");
    if (so != null) {
        so.addParam("allowScriptAccess", "always");
        so.addParam("allowFullScreen", "true");
        so.addParam("quality", "high");
        so.addParam("bgcolor", "#000000");
        //so.addParam("wmode", "transparent");
        //so.addParam("wmode", "opaque");
        so.addParam("wmode", "window");
        so.addParam("scale", "noscale");
        so.addParam("menu", "false");
        so.addParam("align", "left");
        so.addParam("salign", "t");


        so.addVariable("clipID", sClipID);
        so.addVariable("itemID", sIitemID);
        so.addVariable("trailerID", sTrailerID);
        so.addVariable("mode", sMode);


        so.addVariable("isGoOnAir", false);    //온에어직유입



        so.addVariable("isBookMark", false);   //북마크 직유입



        so.addVariable("onAirAble", false);



        so.write(sDivID);
    }
}

function setUpActiveX() {
    //window.open("setup.html");    
    OnExecuteKamuseActiveX();
}
function onAirErr() {
    //window.open("setup.html");

}
function ActiveX_error() {
    // 항상위 ActiveX 설치안됨
}
