var cwindowId,proName = window.location.pathname.split("/")[1],sysUrl = "http://"+window.location.host+"/"+proName,toEdit;
var winId	= $.getUrlParam("winId");
/*var id = top.$("#"+winId).panel("options").data;*/
var videonum = $.getUrlParam("videonum");
var channelnum = $.getUrlParam("channelnum");
var channelname = $.getUrlParam("channelname");
var videodata = {videonum:videonum,channelnum:channelnum,channelname:channelname};
var record = {};
var recordblock;
/*console.log("faultdeviceid",videonum)
console.log("channelnum",channelnum)
console.log("faultdevicename",channelname)
*/
$(function(){
	//初始化视频播放控件
	initRecordBlock();
	$("#searchDate").datebox("setValue",$.getTodayStart(0,"00:00:00"));
	var myDate = new Date();
	var currDate = myDate.getFullYear()+"-"+(myDate.getMonth()+1)+"-"+myDate.getDate();
	var startTime = currDate+" 00:00:00";
	var endTime = currDate+" 23:59:59";
	(window !== top.WebRtcServer.reqPage) && top.WebRtcServer.setReqPage(window);
	unloadWindow();
	ProgressBar.init({
		startTime:new Date(startTime),
		endTime:new Date(endTime),
		totalSecond:86400
	});
	setTimeout(function(){
	    webrtc_startRecord( videonum, channelnum,channelname, startTime, endTime);
	},1000)
});
function searchVideo(){
	var serdate = $('#searchDate').val();
	var startTime = serdate + " 00:00:00";
	var endTime = serdate + " 23:59:59";
	ProgressBar.init({
		startTime:new Date(startTime),
		endTime:new Date(endTime),
		totalSecond:86400
	});
	unloadWindow();
	webrtc_startRecord( videonum, channelnum,channelname, startTime, endTime);
}
function formatter1(date){
	if (!date){return '';}
	return $.fn.datebox.defaults.formatter.call(this, date);
}
function parser1(s){
	if (!s){return null;}
	return $.fn.datebox.defaults.parser.call(this, s);
}