KB.Live =
{
    liveWindow : null,
    playerWindow : null,
    
    openLive:function(liveSessionId) {
        var liveWindow=KB.Live.liveWindow;
        var url = KB.Config.http+'apps/live/?liveSessionId='+liveSessionId;
        if(liveWindow && !liveWindow.closed) {
            liveWindow.location.href = url;
        } else {
            var width = screen.width;
            var height = screen.height;
            var left = 0;
            var top = 0;
            liveWindow = window.open(url,'KnowBandLive','width='+width+',height='+height+',screenX='+left+',screenY='+top+',left='+left+',top='+top+',resizable=1,menubar=0,location=0,status=0,directories=0');
            if(!liveWindow) {
                alert('Popup blocker prevents opening the KnowbandLive window.');
            }
        }
    },
    
    openPlayer:function(url) {
        if(playerWindow && !playerWindow.closed) {
            playerWindow.location.href = url;
        } else {
            var width = screen.width;
            var height = screen.height;
            var left = 0;
            var top = 0;
            playerWindow = window.open(url,'KnowBandPlayer','width='+width+',height='+height+',screenX='+left+',screenY='+top+',left='+left+',top='+top+',resizable=1,menubar=0,location=0,status=0,directories=0');
            if(!playerWindow) {
                alert('Popup blocker prevents opening the KnowbandPlayer window.');
            }
        }
    }
};