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");

$(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");
	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;
//	if("0" == index){      // 常规信息
//		$("#normalInfo").prop("src",'ywrecordhistorystatedetail.jsp?channelnum='+channelnum+"&videonum="+videonum);		
//	}else 
	if('0' == 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
	 });
}

