var blockOpt = {
	uuid:null,
	monid:null,
	serverConnection:top.serverConnection,
	defaultblockCount:4,
	blockCache:[],
	loginparam:null,
},serverConnection;

$(function(){
	(window !== top.WebRtcServer.reqPage) && top.WebRtcServer.setReqPage(window);
	blockOpt = $.extend({},blockOpt , window.parent.webRtcPanel.options.data);
	$('#mainbody').layout(blockOpt.layoutPanelShow ? 'show' :'hidden' ,'south'); 
	
	serverConnection = blockOpt.serverConnection;
	baseContainer = $("#video-container");
	initBodyEvent();
	BlockUtil.changeLayout(blockOpt.defaultblockCount);
	console.log(blockOpt);
	if(blockOpt.onPageReady){
		(blockOpt.onPageReady)();
	}
});
function initBodyEvent(){
	$(window).on("focus",function(){
		(window !== top.WebRtcServer.reqPage) && top.WebRtcServer.setReqPage(window);
	});
}
function unloadWindow(){
	for(var i = 0;i < BlockCacher.blockCache.length;i++){
		if(BlockCacher.blockCache[i].fdId && BlockCacher.blockCache[i].channelId != null){
			BlockUtil.stopMonitor(i);
		}
	}
	LOG("已捕获到销毁wnidow窗口事件....");
}