

<div class="detailCon">
	<ul class="line">
		<li class="line lineD">
			<label id="exSwitchDes" class="des desA">{%menuStr.videoEnabled%}</label>
			<div id="exSwitch" class="switchCon">
				<i class="switchBg"></i>
				<i class="switchBall"></i>
			</div>
			<label class="des desH">ON</label>
		</li>
		<div style="position:relative;*z-index:1;">
			<div id="hidebg"></div>
		</div>
		<li class="line linePlan">
			<span class="clearAll" id="clearAll">{%label.clear%}</span>
			<i name="recModeChk" id="timingRadio" value="1" class="peTypeRd timeSeled" checked="true"></i>
			<label id="timingLabel" class="des typeSeled">{%label.timeVedio%}</label>

			<i name="recModeChk" id="motDetRadio" value="2" class="peTypeRd mdtUnSeled" checked="false"></i>
			<label id="mdtLabel" class="des">{%label.eventVedio%}</label>
		</li>
	</ul>
	<div class="armingSchedule" id="armingSchedule">
		<div id="recPlanGrid"></div>
	</div>
	<div class="actionBarDiv">
		<div class="actionTitleDiv" id="recordParaTitle">
			<label class="actionTitle">{%menuStr.videoParameter%}</label>
			<div class="actionTitleArrowDiv">
				<label class="actionArrowTitle" id="recordParaArrowText">{%label.slideUp%}</label>
				<i class="arrowUp" title= {%label.slideUp%} id="recordParaArrow"></i>
			</div>
		</div>
		<div class="handleWay" id="recordPara">
			<ul class="Line">
				<li class="line lineA" id="StreamSelCon">
					<label class="des desECEE">{%label.storageStream%}</label>
					<span class="selCon">
						<span id="storageStream" class="select">
							<span class="value hsValueA"></span>
							<i class="arrow"></i>
						</span>
					</span>
				</li-->
				<li class="line lineA">
					<label class="des desECEE">{%label.kinescopePrePerid%}</label>
					<input id="kcPP" type="text" class="text textA1" maxlength="2" />
					<span class="tip">{%label.second%}</span><span class="tip">(5-30)（实际预录时间随码率略有调整）</span>
				</li>
				<li class="line lineA">
					<label class="des desECEE" for="kcDP">{%label.kinescopeDelayPeriod%}</label>
					<input id="kcDP" type="text" class="text textA1" maxlength="3" />
					<span class="tip">{%label.second%}</span><span class="tip">(0-600)</span>
				</li>
			</ul>
		</div>
		<div class="height"></div>
	</div>

	<div class="actionBarDiv">
		<div class="actionTitleDiv">
			<label class="actionTitle">{%label.eventVedio%}</label>
			<div class="actionTitleArrowDiv">
				<label class="actionArrowTitle" id="eventListArrowText">{%label.slideUp%}</label>
				<i class="arrowUp" title= {%label.slideUp%} id="eventListArrow"></i>
			</div>
		</div>
		<div class="handleWay" id="eventList">
			<ul class="Line">
				<li class="Line lineFirst event" id="mdLine">
					<i name="showInfo" id="md" class="chObj" value="101"></i>
					<label class="des desA">{%menuStr.motionDetection%}</label>
				</li>
				<li class="Line lineE event" id="ppdLine">
					<i name="showInfo" id="ppd" class="chObj" value="102"></i>
					<label class="des desA">{%menuStr.peopleDetection%}</label>
				</li>
				<li class="Line lineE event" id="vdLine">
					<i name="showInfo" id="vd" class="chObj" value="103"></i>
					<label class="des desA">{%menuStr.vehicleDetection%}</label>
				</li>
				<li class="Line lineE event" id="cdLine">
					<i name="showInfo" id="cd" class="chObj" value="104"></i>
					<label class="des desA">{%menuStr.lineCrossingDetection%}</label>
				</li>
				<li class="Line lineE event" id="idLine">
					<i name="showInfo" id="id" class="chObj" value="105"></i>
					<label class="des desA">{%menuStr.intrusionDetection%}</label>
				</li>
				<li class="Line lineE event" id="erLine">
					<i name="showInfo" id="er" class="chObj" value="106"></i>
					<label class="des desA">{%menuStr.regionEntranceDetection%}</label>
				</li>
				<li class="Line lineE event" id="lrLine">
					<i name="showInfo" id="lr" class="chObj" value="107"></i>
					<label class="des desA">{%menuStr.regionExitingDetection%}</label>
				</li>
				<li class="Line lineE event" id="hdLine">
					<i name="showInfo" id="hd" class="chObj" value="108"></i>
					<label class="des desA">{%menuStr.loiteringDetection%}</label>
				</li>
				<li class="Line lineE event" id="gdLine">
					<i name="showInfo" id="gd" class="chObj" value="109"></i>
					<label class="des desA">{%menuStr.gatheringDetection%}</label>
				</li>
				<li class="Line lineE event" id="fmLine">
					<i name="showInfo" id="fm" class="chObj" value="110"></i>
					<label class="des desA">{%menuStr.fastMovingDetection%}</label>
				</li>
				<li class="Line lineE event" id="pdLine">
					<i name="showInfo" id="pd" class="chObj" value="111"></i>
					<label class="des desA">{%menuStr.parkingDetection%}</label>
				</li>
				<li class="Line lineE event" id="lfLine">
					<i name="showInfo" id="lf" class="chObj" value="112"></i>
					<label class="des desA">{%menuStr.objectRemoveDetection%}</label>
				</li>
				<li class="Line lineE event" id="tkLine">
					<i name="showInfo" id="tk" class="chObj" value="113"></i>
					<label class="des desA">{%menuStr.abandonandTakenDetection%}</label>
				</li>
				<li class="Line lineE event" id="aodLine">
					<i name="showInfo" id="aod" class="chObj" value="114"></i>
					<label class="des desA">{%menuStr.unattendedBaggageDetection%}</label>
				</li>
				<li class="Line lineE event" id="aaLine">
					<i name="showInfo" id="aa" class="chObj" value="115"></i>
					<label class="des desA">{%menuStr.audioAbnormal%}</label>
				</li>
				<li class="Line lineE event" id="scLine">
					<i name="showInfo" id="sc" class="chObj" value="116"></i>
					<label class="des desA">{%menuStr.sceneChangeDetection%}</label>
				</li>
				<li class="Line lineE event" id="fdLine">
					<i name="showInfo" id="fd" class="chObj" value="117"></i>
					<label class="des desA">{%menuStr.faceDetection%}</label>
				</li>
				<li class="Line lineE event" id="ebdLine">
					<i name="showInfo" id="ebd" class="chObj" value="118"></i>
					<label class="des desA">{%menuStr.ebikeDetection%}</label>
				</li>
				<li class="Line lineE event" id="dmgLine">
					<i name="showInfo" id="dmg" class="chObj" value="119"></i>
					<label class="des desA">{%menuStr.damageDetection%}</label>
				</li>
			</ul>
		</div>
	</div>

	<!-- 功能按钮 -->
	<div class="funcBtnCon">
		<input id="cancel" type="button" value="{%btn.gridCancel%}" class="subBtnB btnA"/>
		<input id="save" type="button" value="{%btn.save%}" class="subBtn btnA"/>
	</div>
</div>

<script type="text/javascript">function init(){function C(a){var d="";switch(parseInt(a)){case ENONE:return!0;case IPCTIMEMINERR:d=errStr.ePlanTimeMinErr;break;case IPCTIMECOVERERR:d=errStr.ePlanTimeCoverErr;break;case IPCTIMEMAXERR:d=errStr.ePlanTimeMaxErr;break;case IPCTYPEERR:d=errStr.ePlanTypeErr;break;case IPCUBUSCONNFAIL:d=errStr.ipcUbusConnFail;break;case IPCUBUSCALLERR:d=errStr.ipcUbusCallErr;break;case EINVARG:d=errStr.IPCParamInvalid;break;case IPCUMGUESTNAUTH:showStr=errStr.invPermissionDenied;break;default:d=errStr.unknown+
a}closeToast();showAlert(d);return!1}function D(a){var d=$.linkageCapability[uciLinkageCapability.optName.record_capability];return a>d.length?!1:"1"==d[d.length-a]?!0:!1}function Q(){var a=getRadioChs("recModeChk");m.addClass("peTypeRd");n.addClass("peTypeRd");1==a?(m.removeClass("timeUnSeled"),m.addClass("timeSeled"),n.removeClass("mdtSeled"),n.addClass("mdtUnSeled"),R.addClass("typeSeled"),S.removeClass("typeSeled")):(m.removeClass("timeSeled"),m.addClass("timeUnSeled"),n.removeClass("mdtUnSeled"),
n.addClass("mdtSeled"),R.removeClass("typeSeled"),S.addClass("typeSeled"));q.curType=a}function fa(){ga()}function ha(){var a,d=q.getTimeVal();b={};b[x]={};b[x][E]={};b[x][E][F]="true"==id(T).getAttribute("checked")?G:U;if($.linkageCapability)for(a=0;a<k.length;a++)D(H[a])&&(b[k[a]]={},b[k[a]][I]={},b[k[a]][I][F]="true"==id(y[a]).getAttribute("checked")?G:U);b[f]={};b[f][l]={};for(a=0;a<u.length;a++)b[f][l][J[a]]=ia(d[u[a]]);b[f][l][V]=z.state?uciRecordPlan.optValue.on:uciRecordPlan.optValue.off;
showToast();$.modify(b,function(a){if(!0==C(a[ERR_CODE])){if(!W("kcPP")||!X("kcDP")){closeToast();return}c={};c[h]={};c[h][r]={};c[h][r][K]=s.value;c[h][r][L]=t.value;M&&(c[h][r][A]=id("storageStream").value?uciPlanAdv.optValue.minor:uciPlanAdv.optValue.main);$.modify(c,function(a){!0==C(a[ERR_CODE])&&showToast("success")})}showDetailCon()})}function ga(){b={};b[f]={};b[f][KEY_NAME]=l;b[h]={};b[h][NAME]=r;$.query(b,function(a){if(!0==C(a[ERR_CODE])){q.reset();for(p=0;p<u.length;p++)q.setTimeVal(u[p],
a[f][l][J[p]]);a[f][l][V]==uciRecordPlan.optValue.on?(z.setState(1),B(1)):(z.setState(0),B(0));c=a[h][r];s.value=c[K];t.value=c[L];(M=Boolean(c[A]))?selectInit("storageStream",Y,Z[c[A]]):$("#StreamSelCon").hide()}})}function ia(a,d){var b,e,c;if(void 0==a)return"";void 0==d&&(d=6);b="[";if(1>a.length)b+='"0000-0000:0"';else for(e=0;e<a.length&&e<d;e++)c=a[e].toString(),0<e&&(b+=","),b+='"'+c+'"';return b+"]"}function aa(a){N?(id("eventListArrow").className="arrowDown",id("eventListArrow").title=label.slideDown,
id("eventListArrowText").innerHTML=label.slideDown,ba.style.display="none",N=!1):(id("eventListArrow").className="arrowUp",id("eventListArrow").title=label.slideUp,id("eventListArrowText").innerHTML=label.slideUp,ba.style.display="",N=!0)}function ca(a){O?(id("recordParaArrow").className="arrowDown",id("recordParaArrow").title=label.slideDown,id("recordParaArrowText").innerHTML=label.slideDown,da.style.display="none",O=!1):(id("recordParaArrow").className="arrowUp",id("recordParaArrow").title=label.slideUp,
id("recordParaArrowText").innerHTML=label.slideUp,da.style.display="",O=!0)}function B(a){var b=document.getElementById("hidebg");if(0==a)if(b.style.display="block",$("div.tableDiv").css({"z-index":"-1"}),a=getoffset(id("save")).top-getoffset(id("timingRadio")).top,0==$("#peCon").length||"none"==$("#peCon").css("display"))b.style.height=a+"px";else{var c=getoffset(id("peCon")).top-getoffset(id("timingRadio")).top+id("peCon").offsetHeight;b.style.height=(a>c?a:c)+"px"}else b.style.display="none",$("div.tableDiv").css({"z-index":"0"})}
function W(a){var b=id(a),c=b.value,e=!0;if(!checkNum(b.value))showNote(a,errStr.inputNumErr),e=!1;else if(30<c||5>c)showNote(a,errStr.preRecordTimeErr),e=!1;return e}function X(a){var b=id(a),c=b.value,e=!0;if(!checkNum(b.value))showNote(a,errStr.inputNumErr),e=!1;else if(600<c||0>c)showNote(a,errStr.delayRecordTimeErr),e=!1;return e}function ea(){!0==/^\d+$/.test(s.value)&&(s.value=s.value.replace(/^[0]+/,""));""==s.value&&(s.value=0);W("kcPP");!0==/^\d+$/.test(t.value)&&(t.value=t.value.replace(/^[0]+/,
""));""==t.value&&(t.value=0);X("kcDP")}var m=$("#timingRadio"),n=$("#motDetRadio"),R=$("#timingLabel"),S=$("#mdtLabel"),q,f=uciRecordPlan.fileName,h=uciPlanAdv.fileName,l="chn1_channel",V=uciRecordPlan.optName.enabled,r=uciPlanAdv.secName.planAdv,K=uciPlanAdv.optName.preRecord,A=uciPlanAdv.optName.stream_type,L=uciPlanAdv.optName.delayRecord,M=!1,Z={main:0,minor:1,third:2},Y=[{str:label.mCodeStream,value:0},{str:label.cCodeStream,value:1}],u=[label.Mon,label.Tue,label.Wen,label.Thu,label.Fri,label.Sta,
label.Sun],J=[uciRecordPlan.optName.mon,uciRecordPlan.optName.tue,uciRecordPlan.optName.wed,uciRecordPlan.optName.thu,uciRecordPlan.optName.fri,uciRecordPlan.optName.sat,uciRecordPlan.optName.sun],b,c,p,z=null,s=id("kcPP"),t=id("kcDP"),k="people_detection vehicle_detection linecrossing_detection intrusion_detection regionentrance_detection regionexiting_detection loitering_detection gathering_detection fastmoving_detection parking_detection objectremove_detection abandonandtaken_detection unattendedbaggage_detection audioexception_detection scenechange_detection face_detection ebike_detection damage_detection".split(" "),
H=[18,19,3,4,5,6,7,8,9,10,12,13,11,16,15,17,46,53],y="ppd vd cd id er lr hd gd fm pd lf tk aod aa sc fd ebd dmg".split(" "),T="md",x=uciMotionDetection.fileName,E=uciMotionDetection.secName.motionNotifList,I=uciIntrusionDetection.secName.notifyList,F=uciIntrusionDetection.optName.recordEnabled,G=uciIntrusionDetection.optValue.enableVal.on,U=uciIntrusionDetection.optValue.enableVal.off,N=!0,O=!0,ba=id("eventList"),da=id("recordPara"),g=0,v,P=["md"];(function(){q=new PlanSet("recPlanGrid",{curType:1});
initCheckInput("showInfo",null);if($.linkageCapability){for(var a=0;a<k.length;a++){var d=D(H[a]);d?g+=1:id(y[a]+"Line").style.display="none"}g+=1}6>g&&0<g?(v=1,$(".event").addClass("oneColumn")):9>g&&6<=g?(v=2,$(".event").addClass("twoColumns")):9<=g&&(v=3,$(".event").addClass("threeColumns"));for(a=0;a<y.length;a++)"none"!=id(y[a]+"Line").style.display&&P.push(y[a]);for(a=0;a<P.length;a++)a%v==v-1&&(id(P[a]+"Line").style.marginRight="0px");z=new Switch("exSwitch",0,B);initRadioInput("recModeChk",
Q);b={};b[f]={};b[f][KEY_NAME]=l;b[h]={};b[h][NAME]=r;b[x]={};b[x][NAME]=E;if($.linkageCapability)for(a=0;a<k.length;a++)if(d=D(H[a]))b[k[a]]={},b[k[a]][NAME]=I;$.query(b,function(a){if(!0==C(a[ERR_CODE])){q.reset();for(b=0;b<u.length;b++)q.setTimeVal(u[b],a[f][l][J[b]]);"on"==a[f][l].enabled?(z.setState(1),B(1)):(z.setState(0),B(0));changeCheckInput(id(T),G==a[x][E][F]);if($.linkageCapability)for(var b=0;b<k.length;b++)D(H[b])&&changeCheckInput(id(y[b]),G==a[k[b]][I][F]);for(var d=0,g=0,m,w="",n=
0,b=0;b<u.length;b++){m=a[f][l][J[b]].match(/\d{4}-\d{4}:\d/g);for(var p=0,v=m.length;p<v;p++)w=m[p],n=parseInt(w[10]),w=parseInt(w.slice(5,10))-parseInt(w.slice(0,4)),1==n?g+=w:2==n&&(d+=w)}g<d&&id("motDetRadio").click();c=a[h][r];s.value=c[K];t.value=c[L];(M=Boolean(c[A]))?selectInit("storageStream",Y,Z[c[A]]):$("#StreamSelCon").hide()}showDetailCon()});Q();id("kcPP").onblur=ea;id("kcDP").onblur=ea;id("kcPP").onfocus=closeNoteAll;id("kcDP").onfocus=closeNoteAll;id("eventListArrowText").onclick=
aa;id("eventListArrow").onclick=aa;id("recordParaArrowText").onclick=ca;id("recordParaArrow").onclick=ca})();(function(){id("clearAll").onclick=function(a){q.reset()};id("cancel").onclick=fa;id("save").onclick=ha})()}init();
</script><style type="text/css">label.desECEE{font-size:13px;color:#666;height:40px;line-height:40px;margin-right:4px;width:70px}ul.line li.lineD{margin-bottom:20px}div#recordParaTitle{margin-top:40px}input.textA1{width:98px}span.select span.hsValueA{width:74px}div.funcBtnCon{padding-top:20px}div.handleWay ul.Line li.event{display:inline-block;margin-right:24px}div.handleWay ul.Line li.oneColumn{width:720px}div.handleWay ul.Line li.twoColumns{width:348px}div.handleWay ul.Line li.threeColumns{width:224px}div.handleWay ul.Line label.desA{width:198px}</style><style type="text/css">div.peCon{width:700px}div.peCon label.peTitle{margin-right:476px}div.peCon label.peLabel{margin-right:32px}label.peInvalidNameLabel{margin-right:32px}div.peCol span.select{font-size:0!important}span.peSelect{width:76px!important;_width:66px!important;font-size:14px!important}#orgDC{width:662px}.displayNone{display:none!important}i.peTypeRd{margin-right:4px}i.timeSeled{background:url(../web-static/images/timeSeled.png) center no-repeat!important}i.timeUnSeled{background:url(../web-static/images/timeUnSeled.png) center no-repeat!important}i.mdtUnSeled{background:url(../web-static/images/mdtUnSeled.png) center no-repeat!important}i.mdtSeled{background:url(../web-static/images/mdtSeled.png) center no-repeat!important}#timingLabel{margin-right:35px;display:inline-block;*display:inline;*zoom:1}label.typeSeled{color:#000!important}#pcSelAll{margin-left:209px}#pcCancel{margin-left:115px}#pcSave{margin-left:12px}</style>