var winId	= $.getUrlParam("winId");
var machinestate = top.$("#"+winId).panel("options").data;

$(function(){
	initDetailTab();
});


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



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


function choseSrc(index){
 	var machineid = machinestate.machineid;
 	var xh = machinestate.xh;
	if("0" == index){      // 详情
		$("#detailInfo").prop("src",'nhywjtxhdglDetail.jsp?xh='+machineid+'&xh='+xh);
	}else if('1' == index){			// 历史信息
		$("#historystate").prop("src",'ywxhdhistorystate.jsp?xh='+xh);
	}
}



