


<div id="detailConTumsGB" class="detailCon extent">
	<ul class="line lineL lineLWide">
		<li class="line lineG">
			<label id="tumsSwitchDes" class="des desC">{%btn.enable%}</label>
			<div id="tumsSwitch" class="switchCon">
				<i class="switchBg"></i>
				<i class="switchBall"></i>
			</div>
		</li>

		<li class="line lineG">
			<label class="des desC">{%menuStr.tums%}</label>
			<i name="tumsTypeCheck" id="tumsType" value="tums" checked="true"></i>
			<label id="tumsTypeLable" for="forbid" class="des desH filterCheckCon">{%label.tumsName%}</label>
			<i name="tumsTypeCheck" id="gb28181Type" value="gb28181" checked="false"></i>
			<label id="gb28181TypeLable" for="forbid" class="des desH filterCheckCon">{%label.gb28181Name%}</label>
			<i name="tumsTypeCheck" id="gat1400Type" value="gat1400" checked="false"></i>
			<label id="gat1400TypeLable" for="forbid" class="des desH filterCheckCon">{%label.gat1400Name%}</label>
		</li>
		<li class="line lineG">
			<label class="des desC">{%label.tumsRegisterStatus%}</label>
			<label id="tumsStatus" class="des desH noMargin">{%label.tumsOffline%}</label>
		</li>
	</ul>

	<ul class="line lineL lineLWide" id="tums">
		<li class="line lineG">
			<label class="des desC">{%label.ipAddrDoname%}</label>
			<input id="svrIp" class="textInput text textA1" maxlength="64"/><i class="tip"></i>
		</li>
		<li class="line lineG">
			<label class="des desC">{%label.port%}</label>
			<input id="svrPort" class="textInput text textA1" maxlength="5"/><i class="tip"></i>
		</li>
		<li class="line lineG">
			<label class="des desC">{%label.mfrsId%}</label>
			<input id="mfrsId" class="textInput text textA1" maxlength="64"/><i class="tip"></i>
			<label class="desA range">{%label.optional%}</label>
		</li>
		<li class="line lineG">
			<label class="des desC">{%label.remark%}</label>
			<input id="remark" class="textInput text textA1" maxlength="64"/><i class="tip"></i>
			<label class="desA range">{%label.optional%}</label>
		</li>
	</ul>

	<ul class="line lineL" style="display:none" id="gb28181">
		<li class="line lineG">
			<label class="des desC">{%label.gb28181ClientPort%}</label>
			<input id="clientPort" class="textInput text textA3"/><i class="tip"></i>
		</li>
		<li class="line lineG">
			<label class="des desC">{%label.gb28181ServerId%}</label>
			<input id="serverId" class="textInput text textA3"/><i class="tip"></i>
		</li>
		<li class="line lineG">
			<label class="des desC">{%label.gb28181ServerDomain%}</label>
			<input id="serverDomain" class="textInput text textA3"/><i class="tip"></i>
		</li>
		<li class="line lineG">
			<label class="des desC">{%label.gb28181ServerAddr%}</label>
			<input id="serverAddr" class="textInput text textA3"/><i class="tip"></i>
		</li>
		<li class="line lineG">
			<label class="des desC">{%label.gb28181ServerPort%}</label>
			<input id="serverPort" class="textInput text textA3"/><i class="tip"></i>
		</li>
		<li class="line lineG" id="username_li">
			<label class="des desC">{%label.gb28181Username%}</label>
			<input id="username" class="textInput text textA3"/><i class="tip"></i>
		</li>
		<li class="line lineG" id="userAuthId_li">
			<label class="des desC">{%label.gb28181UserAuthId%}</label>
			<input id="userAuthId" class="textInput text textA3"/><i class="tip"></i>
		</li>
		<li class="line lineG">
			<label class="des desC">{%label.gb28181Password%}</label>
			<input id="password" type="password" class="textInput text textA3"/><i class="tip"></i>
		</li>
		<li class="line lineG">
			<label class="des desC">{%label.gb28181Expires%}</label>
			<input id="expires" class="textInput text textA3"/>
			<label class="des suffix">{%label.gb28181Second%}</label>
			<i class="tip"></i>
		</li>
		<li class="line lineG">
			<label class="des desC">{%label.gb28181HeartbeatPeriod%}</label>
			<input id="heartbeatPeriod" class="textInput text textA3"/>
			<label class="des suffix">{%label.gb28181Second%}</label>
			<i class="tip"></i>
		</li>
		<li class="line lineG" id="streamCodeIdxSel_li">
			<label class="des desC">{%label.gb28181CodeStreamIndex%}</label>
			<span class="selCon">
				<span id="streamCodeIdxSel" class="select">
					<span class="value hsValueC"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>
		<li class="line lineG" id="broadcastTypeIdxSel_li">
			<label class="des desC">{%label.gb28181BroadcastTypeIndex%}</label>
			<span class="selCon">
				<span id="broadcastTypeIdxSel" class="select">
					<span class="value hsValueC"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>
		<li class="line lineG">
			<label class="des desC">{%label.gb28181MaxHeartBeat%}</label>
			<input id="maxHeartBeat" class="textInput text textA3"/><i class="tip"></i>
		</li>
	</ul>

	<div class="tableCon floatF" id="gb28181VideoChTable">
		<ul class="line">
			<li class="line lineG">
				<label class="des desC">{%label.gb28181ChannType%}</label>
				<i name="gb28181ChTypeCheck" id="videoType" value="video" checked="true"></i>
				<label id="videoTypeLable" for="forbid" class="des desH filterCheckCon">{%label.gb28181VideoChann%}</label>
				<i name="gb28181ChTypeCheck" id="audioType" value="audio" checked="false"></i>
				<label id="audioTypeLable" for="forbid" class="des desH filterCheckCon">{%label.gb28181AudioChann%}</label>
				<i name="gb28181ChTypeCheck" id="alarmType" value="alarm" checked="false"></i>
				<label id="alarmTypeLable" for="forbid" class="des desH filterCheckCon">{%label.gb28181AlarmChann%}</label>
			</li>
		</ul>
		<div class="tableBorderCon"><table id="videoChannTbl" class="dataGrid"></table></div>
		<ul id="tableToolBar" class="gridToolBar"></ul>
		<div id="tableEditCon" class="tableEditLyCon ">
			<div class="tableEditCon tableEditConA">
				<div class="innerCon">
					<h4 id="popUpTitle" class="title">{%label.gb28181VideoChannId%}</h4>
					<ul class="line">
						<li class="line lineF">
							<input id="videoChannInput" class="text textA3" maxLength="32" />
						</li>
					</ul>
					<div class="tablePopUpToolBar tablePopUpToolBarA"></div>
				</div>
			</div>
		</div>
	</div>

	<ul class="line lineL3" style="display:none" id="gat1400">
		<li class="lineG2 floatLeft">
			<label class="des desC">{%label.gat1400ServerIP%}</label>
			<input id="gat1400ServerIP" class="textInput text textA3"/><i class="tip"></i>
		</li>
		<li class="lineG2 floatRight">
			<label class="des desC rightIndent">{%label.gat1400ServerPort%}</label>
			<input id="gat1400ServerPort" class="textInput text textA3"/><i class="tip"></i>
		</li>
		<li class="lineG2 floatLeft">
			<label class="des desC">{%label.gat1400HeartPeriod%}</label>
			<input id="gat1400HeartPeriod" class="textInput text textA3"/>
			<label class="des suffix">{%label.second%}</label>
			<i class="tip"></i>
		</li>
		<li class="lineG2 floatRight">
			<label class="des desC rightIndent">{%label.gat1400MaxHeartTime%}</label>
			<input id="gat1400MaxHeartTime" class="textInput text textA3"/>
			<i class="tip"></i>
		</li>

		<li class="line lineG">
			<hr>
		</li>

		<li class="line lineG">
			<label class="des desC">{%label.gat1400DeviceId%}</label>
			<input id="gat1400DeviceId" class="textInput text textA3"/><i class="tip"></i>
		</li>
		<li class="lineG2 floatLeft">
			<label class="des desC">{%label.gat1400UserName%}</label>
			<input id="gat1400UserName" class="textInput text textA3"/><i class="tip"></i>
		</li>
		<li class="lineG2 floatRight">
			<label class="des desC rightIndent">{%label.gat1400Password%}</label>
			<input id="gat1400Password" type="password" class="textInput text textA3">
			<i class="tip"></i>
		</li>

		<li class="line lineG">
			<hr>
		</li>

		<li class="lineG2 floatLeft">
			<label class="des desC">{%label.gat1400AcceseCode%}</label>
			<span class="selCon">
				<span id="gat1400AcceseCode" class="select">
					<span class="value hsValueE"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>
		<li class="lineG2 floatRight">
			<label class="des desC rightIndent">{%label.gat1400RegisterGap%}</label>
			<input id="gat1400RegisterGap" type="textInput text textA3" class="textInput text textA3"/>
			<label class="des secondSuffix">{%label.second%}</label>
			<i class="tip"></i>
		</li>
		<li class="lineG2 floatLeft">
			<label class="des desC">{%label.gat1400Chanel%}</label>
			<span class="selCon">
				<span id="gat1400Chanel" class="select">
					<span class="value hsValueE"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>
		<li class="lineG2 floatRight">
			<label class="des desC rightIndent">{%label.gat1400ChanelId%}</label>
			<input id="gat1400ChanelId" type="textInput text textA3" class="textInput text textA3"/><i class="tip"></i>
		</li>
		<li class="line lineE">
			<label class="des desC">{%label.gat1400Pickup%}</label>
			<i name="showInfo" class="chObj" id="GAT1400FssCheck" value="1" checked="false"></i>
			<label class="des desA">{%label.gat1400Face%}</label>
			<i name="showInfo" class="chObj chObjCheck" id="GAT1400PicCheck" value="2" checked="false"></i>
			<label class="des desA">{%label.gat1400Pic%}</label>
			<i name="showInfo" class="chObj chObjCheck" id="GAT1400MotorVehicleCheck" value="3" checked="false" style="display:none"></i>
			<label class="des desA" style="display:none" id="GAT1400MotorVehicleDesc">{%label.gat1400MotorVehicle%}</label>
		</li>
	</ul>

	<div class="funcBtnCon">
		<input id="save" type="button" value="{%btn.save%}" class="subBtn btnA" />
	</div>
</div>
<script type="text/javascript">function init(){function p(a){var b="";closeNoteAll();switch(a){case ENONE:return!0;case IPCPRTUPORTERR:b=errStr.ipcPrtUportErr;break;case IPCSYSRPARAERR:b=errStr.ipcSysRparaErr;break;case IPC_GB_PORT_ERR:b=errStr.gbPortErr;break;case IPC_GB_SIP_SERVER_ID_ERR:b=errStr.gbIdErr;break;case IPC_GB_SIP_SERVER_DOMAIN_ERR:b=errStr.gbServerDomainErr;break;case IPC_GB_SIP_SERVER_IP_ERR:b=errStr.gbServerIpErr;break;case IPC_GB_SIP_SERVER_PORT_ERR:b=errStr.gbPortErr;break;case IPC_GB_DEV_ID_ERR:b=errStr.gbIdErr;
break;case IPC_GB_AUTH_ID_ERR:b=errStr.gbAuthIdErr;break;case IPC_GB_PASSWORD_ERR:b=errStr.gbPasswordErr;break;case IPC_GB_EXPIRE_TIME_ERR:b=errStr.gbExpireTimeErr;break;case IPC_GB_KEEPALIVE_CYCLE_ERR:b=errStr.gbKeepaliveCycleErr;break;case IPC_GB_STREAM_TYPE_ERR:b=errStr.gbStreamTypeErr;break;case IPC_GB_MAX_KEEPALIVE_FAIL_ERR:b=errStr.gbMaxKeepaliveFailErr;break;case IPC_GB_ALARM_INPUT_ID_ERR:b=errStr.gbIdErr;break;case GAT1400_SERVER_IP_ERR:b=errStr.gat1400ServerIPErr;break;case GAT1400_SERVER_PORT_ERR:b=
errStr.gat1400ServerPortErr;break;case GAT1400_KEEPALIVE_PERIOD_ERR:b=errStr.gat1400KeepalivePeriodErr;break;case GAT1400_MAX_KEEPALIVE_TIME_ERR:b=errStr.gat1400MaxHeartTimeErr;break;case GAT1400_DEVICEID_ERR:b=errStr.gat1400DeviceIdErr;break;case GAT1400_USER_NAME_ERR:b=errStr.gat1400UserNameErr;break;case GAT1400_USER_PASSWD_ERR:b=errStr.gat1400UserPasswdErr;break;case GAT1400_ACCESS_CODE_ERR:b=errStr.gat1400AcceseCodeErr;break;case GAT1400_REGISTER_INTERVAL_ERR:b=errStr.gat1400RegisterGapErr;break;
case GAT1400_CHANEL_ERR:b=errStr.gat1400ChanelErr;break;case GAT1400_CHANEL_ID_ERR:b=errStr.gat1400ChanelIdErr;break;default:b=errStr.unknown+a}showAlert(b);return!1}function ia(a,b){var k="";switch(a){case ENONE:return!0;case EINVIP:k=errStr.ipAddrErr;break;case EINVGROUPIP:k=errStr.ipAddrGroupErr;break;case EINVIPFMT:k=errStr.ipAddrFmtErr;break;case EINVLOOPIP:k=errStr.ipAddrLoopErr;break;case EINVNET:k=errStr.ipAddrNetErr;break;case EINDOMAIN:k=errStr.domainErr}showNote(b,k);return!1}function B(a,
b){if(id(a).value.length<=b)return!0;showNote(a,label.gb28181LengthTips+String(b));return!1}function ja(a,b){if(id(a).value.length<=b)return!0;showNote(a,label.gb28181DomainLengthTips+String(b));return!1}function m(a,b,k){var c=id(a).value;if(null!=c.match(/^(\d+)$/)&&parseInt(c)>=b&&parseInt(c)<=k)return!0;showNote(a,label.gb28181IllagelTips+String(b)+" - "+String(k));return!1}function ka(a,b){if(id(a).value.length<=b)return!0;showNote(a,label.gb28181ServerLengthTips+String(b));return!1}function la(a){var b=
!0;B("serverId",20)&&B("username",20)&&B("userAuthId",20)&&ja("serverDomain",10)&&ka("serverAddr",63)||(b=!1,$(".switchBg").css("background","linear-gradient(#A7A9AE, #B8BBC0)"),$(".switchBall").css("left","-9px"));m("clientPort",1024,65535)&&m("serverPort",1024,65535)&&m("expires",3600,1E5)&&m("heartbeatPeriod",5,255)&&m("maxHeartBeat",3,255)||(b=!1,$(".switchBg").css("background","linear-gradient(#A7A9AE, #B8BBC0)"),$(".switchBall").css("left","-9px"));O&&b&&(b={},b[g]={},b[g][h]={},b[g][h][e.enable]=
a?C.on:C.off,$.modify(b,function(b){!0==p(b[ERR_CODE])&&(z=a,1==I&&1==z&&(t=!0,ma(0)),!1==t?showToast("success"):t=!1)}))}function Ma(a,b,k){a=na.value;var c;c=id("videoChannInput").value;20>=c.length&&null!=c.match(/^(\d+)$/)?c=!0:(null==c.match(/^(\d+)$/)?showNote("videoChannInput",errStr.gbIdErr):showNote("videoChannInput",label.gb28181LengthTips+"20"),c=!1);c?(c={},"video"==A?(q[b].id=a,c.number=q[b].number):"audio"==A?(u[b].id=a,c.number=u[b].number):(v[b].id=a,c.number=v[b].number),c.id=a,k(!0,
c)):k(!1)}function Na(a,b,c){700>P.offsetHeight&&(P.style.height="700px",basicPHAutoFit());na.value="video"==A?q[b].id:"audio"==A?u[b].id:v[b].id;tableEditCon.style.top="0px"}function Oa(a){var b="";q=[];u=[];v=[];for(var c=1;5>c;c++){b=J?"video_channel_id_"+c:"alarm_input_id_"+c;if(b in a){var d={};d.number=String(c);d.id=a[b];q.push(d)}b="audio_output_channel_id_"+c;b in a&&(d={},d.number=String(c),d.id=a[b],u.push(d));b="alarm_input_channel_id_"+c;b in a&&(d={},d.number=String(c),d.id=a[b],v.push(d))}}
function Pa(a){var b=a[Q][oa];a=a[g][h];pa.value=a[e.clientSipPort];qa.value=a[e.sipServerId];ra.value=a[e.sipServerDomain];sa.value=a[e.sipServerAddr];ta.value=a[e.sipServerPort];ua.value=a[e.password];va.value=a[e.expires];wa.value=a[e.sipUsername];xa.value=a[e.sipUserAuthId];selectInit("streamCodeIdxSel",[{str:label.gb28181CodeStreamMain,value:0},{str:label.gb28181CodeStreamMinor,value:1}],parseInt(a[e.codeStreamIndex]));selectInit("broadcastTypeIdxSel",[{str:label.gb28181BroadcastTypeUDP,value:0},
{str:label.gb28181BroadcastTypeActiveTCP,value:1},{str:label.gb28181BroadcastTypePassiveTCP,value:2}],parseInt(a[e.broadcastTypeIndex]));parseInt(a[e.regStatus])?(id("tumsStatus").innerHTML=label.gb28181OnLine,$(r).css("color","#325FE0")):(id("tumsStatus").innerHTML=label.gb28181OffLine,$(r).css("color","#FF5500"));ya.value=a[e.heartbeatPeriod];za.value=a[e.maxHeartBeat];D=new Switch("tumsSwitch",a[e.enable]==C.on?1:0,la);z=a[e.enable]==C.on?1:0;J=Qa&&1==parseInt(b.channel_separate_support)?!0:!1;
J||(id("audioType").style.display="none",id("audioTypeLable").style.display="none",id("alarmType").style.display="none",id("alarmTypeLable").style.display="none");Oa(a);Aa?E.setDataSource(q):E.init({id:"videoChannTbl",data:q,hasID:!1,edit:!0,head:[{field:label.gb28181ChannNum,width:30},{field:label.gb28181ChannId,width:60}],list:[{name:"number"},{name:"id"}],popUpBar:{id:"tableEditCon",save:Ma,cancel:function(a,b,c){P.style.height="";basicPHAutoFit();c(!0)}},toolBar:{id:"tableToolBar",popUp:Na,asyn:!0}});
Aa=O=!0;showDetailCon()}function Ra(){var a=!0;B("serverId",20)&&B("username",20)&&B("userAuthId",20)&&ja("serverDomain",10)&&ka("serverAddr",63)||(a=!1);m("clientPort",1024,65535)&&m("serverPort",1024,65535)&&m("expires",3600,1E5)&&m("heartbeatPeriod",5,255)&&m("maxHeartBeat",3,255)||(a=!1);if(a){var a={},b="";a[g]={};a[g][h]={};a[g][h][e.enable]=D.state?C.on:C.off;a[g][h][e.clientSipPort]=pa.value;a[g][h][e.sipServerId]=qa.value;a[g][h][e.sipServerDomain]=ra.value;a[g][h][e.sipServerAddr]=sa.value;
a[g][h][e.sipServerPort]=ta.value;a[g][h][e.password]=ua.value;a[g][h][e.expires]=va.value;a[g][h][e.heartbeatPeriod]=ya.value;a[g][h][e.maxHeartBeat]=za.value;a[g][h][e.sipUsername]=wa.value;a[g][h][e.sipUserAuthId]=xa.value;a[g][h][e.codeStreamIndex]=String(Sa.value);a[g][h][e.broadcastTypeIndex]=String(Ta.value);for(var c=0;c<q.length;c++)b=(J?"video_channel_id_":"alarm_input_id_")+q[c].number,a[g][h][b]=q[c].id;for(c=0;c<u.length;c++)b="audio_output_channel_id_"+u[c].number,a[g][h][b]=u[c].id;
for(c=0;c<v.length;c++)b="alarm_input_channel_id_"+v[c].number,a[g][h][b]=v[c].id;$.modify(a,function(a){!0==p(a[ERR_CODE])&&showToast("success")})}}function Ba(){K.onclick=L;var a={};a[Q]={};a[Q][NAME]=[oa];a[g]={};a[g][NAME]=[h];$.query(a,function(a){!0==p(a[ERR_CODE])&&Pa(a)},!1)}function Ca(){return B("gat1400DeviceId",20)&&m("gat1400ServerPort",0,65534)&&m("gat1400HeartPeriod",1,1E3)?!0:($(".switchBg").css("background","linear-gradient(#A7A9AE, #B8BBC0)"),$(".switchBall").css("left","-9px"),
!1)}function Da(a){if(Ca()&&R){var b={};b[d]={};b[d][f]={};b[d][f][c.isEnable]=a?F.on:F.off;b[d][f][c.serverIP]=S.value;b[d][f][c.deviceId]=T.value;b[d][f][c.userId]=U.value;b[d][f][c.password]=V.value;b[d][f][c.accessId]=W.value;b[d][f][c.serverPort]=X.value;b[d][f][c.keepalivePeriod]=Y.value;b[d][f][c.maxKeepaliveFT]=Z.value;b[d][f][c.registerInterval]=aa.value;b[d][f][c.channel]=ba.value;gat1400Objects="00000000000000000000000000";gat1400Objects=null!=id("GAT1400MotorVehicleCheck").getAttribute("checked")&&
"true"==id("GAT1400MotorVehicleCheck").getAttribute("checked").toString()?gat1400Objects+"1":gat1400Objects+"0";gat1400Objects=null!=id("GAT1400FssCheck").getAttribute("checked")&&"true"==id("GAT1400FssCheck").getAttribute("checked").toString()?gat1400Objects+"1":gat1400Objects+"0";gat1400Objects=null!=id("GAT1400PicCheck").getAttribute("checked")&&"true"==id("GAT1400PicCheck").getAttribute("checked").toString()?gat1400Objects+"0010":gat1400Objects+"0000";b[d][f][c.gatobjects]=gat1400Objects;$.modify(b,
function(b){!0==p(b[ERR_CODE])&&(gat1400SwitchLast=a,1==I&&1==z&&1==gat1400SwitchLast&&(t=!0,Da(0)),!1==t?showToast("success"):t=!1)})}}function Ua(){K.onclick=L;var a={};a[d]={};a[d][NAME]=[f];$.query(a,function(a){!0==p(a[ERR_CODE])&&(a=a[d][f],S.value=a[c.serverIP],T.value=a[c.deviceId],U.value=a[c.userId],V.value=a[c.password],W.value=a[c.accessId],X.value=a[c.serverPort],Y.value=a[c.keepalivePeriod],Z.value=a[c.maxKeepaliveFT],aa.value=a[c.registerInterval],ba.value=a[c.channelId],$.smartDetection&&
1==parseInt($.smartDetection.ebike_detection)&&(id("GAT1400MotorVehicleCheck").style.display="inline-block",id("GAT1400MotorVehicleDesc").style.display="inline-block","1"==a[c.gatobjects].substring(26,27)?(id("GAT1400MotorVehicleCheck").setAttribute("checked","true"),id("GAT1400MotorVehicleCheck").className="chObj chObjCheck"):(id("GAT1400MotorVehicleCheck").setAttribute("checked","false"),id("GAT1400MotorVehicleCheck").className="chObj")),"1"==a[c.gatobjects].substring(27,28)?(id("GAT1400FssCheck").setAttribute("checked",
"true"),id("GAT1400FssCheck").className="chObj chObjCheck"):(id("GAT1400FssCheck").setAttribute("checked","false"),id("GAT1400FssCheck").className="chObj"),"1"==a[c.gatobjects].substring(30,31)?(id("GAT1400PicCheck").setAttribute("checked","true"),id("GAT1400PicCheck").className="chObj chObjCheck"):(id("GAT1400PicCheck").setAttribute("checked","false"),id("GAT1400PicCheck").className="chObj"),selectInit("gat1400AcceseCode",[{str:"0",value:"0"},{str:"1",value:"1"},{str:"2",value:"2"},{str:"3",value:"3"},
{str:"4",value:"4"},{str:"5",value:"5"},{str:"6",value:"6"},{str:"9",value:"9"},{str:"16",value:"16"},{str:"18",value:"18"}],"1"),selectInit("gat1400Chanel",[{str:"0",value:"0"},{str:"1",value:"1"}],"1"),D=new Switch("tumsSwitch",a[c.isEnable]==F.on?1:0,Da),gat1400SwitchLast=a[c.isEnable]==F.on?1:0,R=!0,showDetailCon())},!1);a={};a[d]={};a[d][NAME]=[ca];$.query(a,function(a){!0==p(a[ERR_CODE])&&Ea(a)},!1)}function da(a,b){if("string"!=typeof a)return!1;if(0==a.length)return showNote(b,errStr.TUMSInvLetter),
!1;if(/[^\d.]/g.test(a)){if(!1==ia(checkDomain(a),b))return!1}else if(!1==ia(checkIp(a),b))return!1;return!0}function Ea(a){"on"==a[d][ca][c.isOnline]?(r.innerText=label.gat1400Online,$(r).css("color","#325FE0")):(r.innerText=label.gat1400Offline,$(r).css("color","#FF5500"));clearTimeout(G);G=$.setTimeout(Va,Fa)}function Va(){var a={};a[d]={};a[d][NAME]=[ca];$.query(a,function(a){!0==p(a[ERR_CODE])&&Ea(a)},!1)}function ea(a,b,c,d){return 1>a.length?(showNote(d,errStr.noPortInputErr),!1):!1==checkNum(a)?
(showNote(d,errStr.portIllegalErr),!1):!1==checkNumRange(parseInt(a,10),b,c)?(showNote(d,errStr.invPortErr),!1):!0}function Wa(a){switch(parseInt(a[uciCloudConfig.optName.vmsConnectStatus])){case TUMS_STATUS_CONNECTED:r.innerText=label.tumsOnline;$(r).css("color","#325FE0");break;default:r.innerText=label.tumsOffline,$(r).css("color","#FF5500")}clearTimeout(G);G=$.setTimeout(Ga,Fa)}function Ga(){var a={};a[uciCloudConfig.fileName]={};a[uciCloudConfig.fileName][uciCloudConfig.actionName.getVmsStatus]=
null;$.action(a,Wa)}function Xa(a){!1!=p(a[ERR_CODE])&&(a=(a[l]||{})[s]||{},D=new Switch("tumsSwitch",a[n.enable]==H.onOff.on?1:0,ma),I=a[n.enable]==H.onOff.on?1:0,w.value=a[n.server]||"",x.value=a[n.port]||"",Ha.value=a[n.mfrsId]||"",Ia.value=a[n.comment]||"",M||(M=!0,showDetailCon()),Ga())}function ma(a){if(M){if(!da(w.value,"svrIp")||!ea(x.value,fa,ga,"svrPort"))return $(".switchBg").css("background","linear-gradient(#A7A9AE, #B8BBC0)"),$(".switchBall").css("left","-9px"),!1;var b={};b[l]={};b[l][s]=
{};b[l][s][n.enable]=a?H.onOff.on:H.onOff.off;showToast();$.modify(b,function(b){!0==p(b[ERR_CODE])?(I=a,1==I&&1==z&&(t=!0,la(0)),!1==t?showToast("success"):t=!1):closeToast()})}}function L(){"tums"==y?Ya():"gb28181"==y?Ra():Ja&&Za()}function N(){closeNoteAll();da(w.value,"svrIp");ea(x.value,fa,ga,"svrPort")}function Ya(){if(!da(w.value,"svrIp")||!ea(x.value,fa,ga,"svrPort"))return!1;var a={};a[l]={};a[l][s]={};a[l][s][n.enable]=D.state?H.onOff.on:H.onOff.off;a[l][s][n.server]=w.value;a[l][s][n.port]=
x.value;a[l][s][n.mfrsId]=Ha.value;a[l][s][n.comment]=Ia.value;showToast();$.modify(a,function(a){!0==p(a[ERR_CODE])?showToast("success"):closeToast()})}function Za(){if(Ca()){var a={};a[d]={};a[d][f]={};a[d][f][c.isEnable]=D.state?F.on:F.off;a[d][f][c.serverIP]=S.value;a[d][f][c.deviceId]=T.value;a[d][f][c.userId]=U.value;a[d][f][c.password]=V.value;a[d][f][c.accessId]=W.value;a[d][f][c.serverPort]=X.value;a[d][f][c.keepalivePeriod]=Y.value;a[d][f][c.maxKeepaliveFT]=Z.value;a[d][f][c.registerInterval]=
aa.value;a[d][f][c.channel]=ba.value;gat1400Objects="00000000000000000000000000";gat1400Objects=null!=id("GAT1400MotorVehicleCheck").getAttribute("checked")&&"true"==id("GAT1400MotorVehicleCheck").getAttribute("checked").toString()?gat1400Objects+"1":gat1400Objects+"0";gat1400Objects=null!=id("GAT1400FssCheck").getAttribute("checked")&&"true"==id("GAT1400FssCheck").getAttribute("checked").toString()?gat1400Objects+"1":gat1400Objects+"0";gat1400Objects=null!=id("GAT1400PicCheck").getAttribute("checked")&&
"true"==id("GAT1400PicCheck").getAttribute("checked").toString()?gat1400Objects+"0011":gat1400Objects+"0001";a[d][f][c.gatobjects]=gat1400Objects;showToast();$.modify(a,function(a){!0==p(a[ERR_CODE])?showToast("success"):closeToast()})}}function Ka(){K.onclick=L;w.onblur=N;x.onblur=N;w.onfocus=closeNoteAll;x.onfocus=closeNoteAll;var a={};a[l]={};a[l][NAME]=[s];$.query(a,Xa)}var D=id("tumsSwitch"),r=id("tumsStatus"),w=id("svrIp"),x=id("svrPort"),Ha=id("mfrsId"),Ia=id("remark"),K=id("save"),M=!1,fa=
65535,ga=1,Q=uciGb28181Capability.fileName,oa=uciGb28181Capability.secName.capability,l=uciTumsConfig.fileName,s=uciTumsConfig.secName.tumsInfo,n=uciTumsConfig.optName,H=uciTumsConfig.optValue,y,g=uciGb28181Cfg.fileName,h=uciGb28181Cfg.secName.gb28181Cfg,e=uciGb28181Cfg.optName,C=uciGb28181Cfg.optValue,d=uciGAT1400Cfg.fileName,f=uciGAT1400Cfg.secName.GAT1400Cfg,ca=uciGAT1400Cfg.secName.GAT1400StatusCfg,c=uciGAT1400Cfg.optName,F=uciGAT1400Cfg.optValue,R=!1,Qa=1==parseInt($.moduleSpec.gb28181_capability)?
!0:!1,La=1==parseInt($.moduleSpec.gb28181)?!0:!1,ha=1==parseInt($.moduleSpec.tums_msg_push)?!0:!1,Ja=1==parseInt($.moduleSpec.gat1400)?!0:!1,J,P=id("detailConTumsGB"),pa=id("clientPort"),qa=id("serverId"),ra=id("serverDomain"),sa=id("serverAddr"),ta=id("serverPort"),ua=id("password"),va=id("expires"),ya=id("heartbeatPeriod"),za=id("maxHeartBeat"),wa=id("username"),xa=id("userAuthId"),Sa=id("streamCodeIdxSel"),Ta=id("broadcastTypeIdxSel"),na=id("videoChannInput"),A,E=new DataGrid,O=!1,q=[],u=[],v=
[],Fa=2E3,G,Aa=!1,I=0,z=0,t=!1,$a=0<=$.inArray("speaker",$.moduleSpec[uciFunction.optName.audio])&&0<=$.inArray("microphone",$.moduleSpec[uciFunction.optName.audio])?!0:!1,S=id("gat1400ServerIP"),X=id("gat1400ServerPort"),Y=id("gat1400HeartPeriod"),Z=id("gat1400MaxHeartTime"),T=id("gat1400DeviceId"),U=id("gat1400UserName"),V=id("gat1400Password"),W=id("gat1400AcceseCode"),aa=id("gat1400RegisterGap");id("gat1400Chanel");var ba=id("gat1400ChanelId");a:{K.onclick=L;w.onblur=N;x.onblur=N;w.onfocus=closeNoteAll;
x.onfocus=closeNoteAll;initRadioInput("tumsTypeCheck",function(){y!=getRadioChs("tumsTypeCheck")&&(y=getRadioChs("tumsTypeCheck"),"tums"==y?(id("tums").style.display="block",id("gb28181").style.display="none",id("gb28181VideoChTable").style.display="none",id("gat1400").style.display="none",M=!1,Ka()):"gb28181"==y?(id("tums").style.display="none",id("gb28181").style.display="block",id("gb28181VideoChTable").style.display="block",id("gat1400").style.display="none",clearTimeout(G),O=!1,Ba()):(id("tums").style.display=
"none",id("gb28181").style.display="none",id("gb28181VideoChTable").style.display="none",id("gat1400").style.display="block",clearTimeout(G),R=!1,Ua()))});initRadioInput("gb28181ChTypeCheck",function(){A=getRadioChs("gb28181ChTypeCheck");"video"==A?(E.setDataSource(q),id("popUpTitle").innerHTML=label.gb28181VideoChannId):"audio"==A?(E.setDataSource(u),id("popUpTitle").innerHTML=label.gb28181AudioChannId):(E.setDataSource(v),id("popUpTitle").innerHTML=label.gb28181AlarmChannId);E.refresh(1)});y="gb28181";
Ja||(id("gat1400Type").style.display="none",id("gat1400TypeLable").style.display="none");A="video";if(La){Ba();if(!1==ha||1==z)id("gb28181").style.display="block",id("gb28181VideoChTable").style.display="block",id("gb28181Type").setAttribute("checked","true"),id("gb28181Type").className+=" rdObjCheck";if(!1==ha&&(id("tumsType").style.display="none",id("tumsTypeLable").style.display="none",id("tums").style.display="none",0==z))break a;if(1==z){id("tums").style.display="none";id("tumsType").setAttribute("checked",
"false");id("tumsType").className="rdObj";break a}!1==$a&&(id("broadcastTypeIdxSel_li").style.display="none")}ha&&!1==La&&(y="tums",id("gb28181Type").style.display="none",id("gb28181TypeLable").style.display="none",id("gb28181VideoChTable").style.display="none");y="tums";Ka();id("gb28181VideoChTable").style.display="none"}}init();
</script><style type="text/css">label.range{margin-left:4px}ul.lineLWide{width:80%}li.line label.noMargin{margin-left:0}label.filterCheckCon{margin:0 24px 0 8px}div.detailCon.extent{width:760px}label.suffix{font-size:14px;color:#a0a0a0;margin-left:10px}label.secondSuffix{font-size:14px;color:#a0a0a0;margin-left:10px;margin-top:5px}ul.line li.lineG2{margin-bottom:8px;padding:5px 0}ul.line li.floatLeft{float:left;width:50%}ul.line li.floatRight{float:right;width:50%}ul.lineL3{float:left;width:808px}label.rightIndent{display:inline-block;margin-left:38px}span.select span.hsValueE{color:#333;width:175px;line-height:28px;height:28px}div.tableCon.floatF{float:left}div#tableEditCon{position:fixed;margin-top:10%}div#tableEditCon div.tableEditConA{width:420px}div#tableEditCon div.innerCon{padding:54px 70px 30px}div#tableEditCon h4.title{width:262px;color:#a0a0a0;text-align:left}div#tableEditCon div.tablePopUpToolBarA{text-align:center;margin:25px 0 0 0}div#tableEditCon #videoChannInput{width:260px}</style>