var blockOpt = {
	peerConnection:null,
	baseContainer:null,
	serverConnection:top.serverConnection,
	defaultblockCount:4,
	blockCache:[],
	monitorGrid:null,
	historyGrid:null,
	detailtab: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 = $("#record-container");
	initBodyEvent();
	BlockUtil.changeLayout(blockOpt.defaultblockCount);
});
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.stopPlayback(i);
		}
	}
	LOG("已捕获到销毁wnidow窗口事件....");
}
