var windowId,proName = window.location.pathname.split("/")[1],sysUrl = "http://"+window.location.host+"/"+proName;
var recordstateid = $.getUrlParam("recordstateid");
var videonum = $.getUrlParam("videonum");
var channelnum = $.getUrlParam("channelnum");
var channelname = $.getUrlParam("channelname");
var proName = window.location.pathname.split("/")[1];
var sysUrl = "http://"+window.location.host+"/"+proName;
$(function(){
	initDetailTab();
});


function initDetailTab(){
	detailtab = $("#detailtab").tabs({
		onSelect:function(title,index){
//			console.log("title 和 index",title,index);
			setTimeout(function(){choseSrc(index)},500);
		}
	});
}



// 点击 左侧 查询右侧信息
function setchecked(){
	
	var choseId = $('#detailtab').tabs('getSelected').find("iframe").attr("id");
//	console.log("choseId: ===========",choseId);
	if("normalInfo" == choseId){
		choseSrc(0);
	}else if("recordCount" == choseId){
		choseSrc(1);
	}else if("lxbf"==choseId){
		choseSrc(2);
	}
}


function choseSrc(index){
//	console.log("choseSrc：",index);
//	console.log("recordstateid: ",recordstateid);	
	var lxbfUrl=sysUrl+"/yw/repairmanage/ywrepairjobRecord/ywrepairjobRecord.jsp?videonum="+videonum+"&channelnum="+channelnum+"&channelname="+encodeURI(channelname);
//	if("0" == index){      // 常规信息
		//$("#normalInfo").prop("src",'ywrecordvideostatedetail.jsp?channelnum='+channelnum+"&videonum="+videonum);		
//	}else 
	if('0' == index){			// 录像时长统计
		$("#recordCount").prop("src",'ywrecordvideocount.jsp?recordstateid='+recordstateid);			
	}else if('1' == index){			// 录像时长统计
		//console.log("lxbfUrl",lxbfUrl)
		$("#lxbf").prop("src",lxbfUrl);			
	}
}



function playVideo(videonum, channelnum){
	windowId = top.$.createWin({
		title	: 	' ',
		width	:  	690,
		height	: 	400,  
		url	:	sysUrl+"/yw/recordalarm/ywrecordcurrentstate/recordvideo/playrecordvideo.jsp?videonum="+videonum+"&channelnum="+channelnum
	 });
}

