

<div class="detailCon">
	<div class="configDiv" id="configDiv">
		<ul class="line">
			<li class="Line lineE">
				<label class="des desA">{%label.soundAlarm%}</label>
				<div id="alarmSwitch" class="switchCon">
					<i class="switchBg"></i>
					<i class="switchBall"></i>
				</div>
				<label id="alarmSwitchDes" class="des desH">{%btn.close%}</label>
			</li>
			<li class="Line lineE soundTypeCon" id="soundTypeArea">
				<label class="des desA">{%label.soundType%}</label>
				<span class="selCon">
					<span id="soundTypeSelect" class="select">
						<span class="value hsValueA"></span>
						<i class="arrow"></i>
					</span>
				</span>
			</li>
		</ul>
		<div class="height"></div>
	</div>
	<div style="position:relative;*z-index:1;">
		<div id="hidebg"></div>
	</div>
	<div class="actionBarDiv">
		<div class="actionTitleDiv">
			<label class="actionTitle">{%label.defenceTime%}</label>
			<div class="actionTitleArrowDiv">
				<label class="actionArrowTitle" id="recordArrowText">{%label.slideUp%}</label>
				<i class="arrowUp" title= {%label.slideUp%} id="recordArrow"></i>
			</div>
		</div>
		<div id="timeSchedule">
			<ul class="line">
				<li class="line linePlan">
					<span class="clearAll" id="clearAll">{%label.clear%}</span>
					<label class="tips">{%label.audioAlarmTipsDT%}</label>
				</li>
			</ul>
			<div class="armingSchedule" id="armingSchedule">
				<div id="recPlanGrid" class="test"></div>
			</div>
		</div>
	</div>

	<div class="funcBtnCon">
		<input id="save" type="button" class="subBtn btnA" value="{%btn.save%}" />
	</div>
</div>
<script type="text/javascript">function init(){function q(a,b){var c="";switch(parseInt(a)){case ENONE:return!0;case IPCUMGUESTNAUTH:c=errStr.invPermissionDenied;break;case IPCMSGALARMENERR:c=errStr.ipcMsgAlarmEnErr;break;case IPCMSGALARMPLANENERR:c=errStr.ipcMsgAlarmPlanEnErr;break;case IPCMSGALARMPLANSETERR:c=errStr.ipcMsgAlarmPlanSetErr;break;case IPCMSGALARMGETERR:c=errStr.ipcMsgAlarmGetErr;break;default:c=errStr.invRequestFail}closeToast();showAlert(c,b);return!1}function E(a){var b,c=[];if(void 0==a)return c.push('"0000-0000:0"'),
c;a instanceof Array||(a=a.match(/\d{4}-\d{4}/g));for(var u=0;u<a.length;u++){b=a[u];var d=b.split(/[-]/,2);b=parseInt(d[0],10);d=parseInt(d[1],10);0==b&&0==d?c.push(f._getString(b,d,0)):c.push(f._getString(b,d,1))}return c}function F(){var a={};f.getTimeVal();var b=uciMsgAlarmPlan.secName.ArmingScheduleAudio;a[d]={};a[d][uciMsgAlarm.secName.chn1MsgAlarmInfo]={};a[d][uciMsgAlarm.secName.chn1MsgAlarmInfo].sound_alarm_enabled=g;!1==r&&(a[d][uciMsgAlarm.secName.chn1MsgAlarmInfo].alarm_type=s);a[e]={};
a[e][b]={};a[e][b]=G();g==x&&p?showConfirmIpc(label.confirmAlarmDeviceOffTip,function(b){!0==b&&(showToast(),$.modify(a,function(a){!0==q(a[ERR_CODE])&&showToast("success")}))}):(showToast(),$.modify(a,function(a){!0==q(a[ERR_CODE])&&showToast("success")}))}function H(){var a,b={},c=uciMsgAlarmPlan.secName.ArmingScheduleAudio;b[e]={};b[e][NAME]=c;$.query(b,function(b){if(!0==q(b[ERR_CODE]))for(f.reset(),a=0;a<t.length;a++)f.setTimeVal(t[a],E(b[e][c][y[a]]))})}function G(){var a,b=f.getTimeVal(),c=
{};for(a=0;a<t.length;a++){var d=c,e=y[a],k;k=b[t[a]];var g=void 0,h=void 0,m=void 0,l=void 0,n=void 0,n=l=void 0;if(void 0==k)k="";else{void 0==g&&(g=6);h="[";if(1>k.length)h+='"0000-0000"';else for(m=0;m<k.length&&m<g;m++)l=k[m].toString(),n=l.split(/[-,:]/,3),l=parseInt(n[0],10),n=parseInt(n[1],10),l=f._getStringWithoutType(l,n),0<m&&(h+=","),h+='"'+l+'"';k=h+="]"}d[e]=k}return c}function z(){v?(id("recordArrow").className="arrowDown",id("recordArrow").title=label.slideDown,id("recordArrowText").innerHTML=
label.slideDown,A.style.display="none",v=!1):(id("recordArrow").className="arrowUp",id("recordArrow").title=label.slideUp,id("recordArrowText").innerHTML=label.slideUp,A.style.display="",v=!0)}function B(a){I.innerHTML=1==a?btn.enableN:btn.close;g=1==a?C:x;var b=document.getElementById("hidebg");0==a?(b.style.display="block",b.style.height=getoffset(id("save")).top-getoffset(id("recordArrowText")).top+"px"):b.style.display="none"}function J(a){s=a}var C=uciMsgAlarm.optValue.enableVal.on,x=uciMsgAlarm.optValue.enableVal.off,
g,I=id("alarmSwitchDes"),e=uciMsgAlarmPlan.fileName,d=uciMsgAlarm.fileName,p,t=[label.Mon,label.Tue,label.Wen,label.Thu,label.Fri,label.Sta,label.Sun],y=[uciMsgAlarmPlan.optName.mon,uciMsgAlarmPlan.optName.tue,uciMsgAlarmPlan.optName.wed,uciMsgAlarmPlan.optName.thu,uciMsgAlarmPlan.optName.fri,uciMsgAlarmPlan.optName.sat,uciMsgAlarmPlan.optName.sun],f,r=!1,s;parseInt($.moduleSpec.personalized_audio_alarm);if(1==parseInt($.audioAlarmCapability[uciAlarmAudioTypeCapability.optName.usrDefAudioAlarmSupport])||
1==parseInt($.audioAlarmCapability[uciAlarmAudioTypeCapability.optName.eventSeparateAudioAlarmSupport]))r=!0,id("soundTypeArea").style.display="none";if(!1==r){var K=id("soundTypeSelect"),w=[{str:label.alarmSound,value:0},{str:label.warningSound,value:1},{str:label.waringZone,value:2},{str:label.dangerZone,value:3},{str:label.noParking,value:4},{str:label.monitorArea,value:5},{str:label.helloWelcome,value:6},{str:label.noTouching,value:7},{str:label.privateZone,value:8},{str:label.dangerWater,value:9},
{str:label.dangerHeight,value:10},{str:label.gabbageClassify,value:11},{str:label.intoWorkshop,value:12},{str:label.ebikeForbid,value:13},{str:label.tempWarning,value:14},{str:label.maskWorn,value:15},{str:label.maskRequest,value:16},{str:label.ebikeForbid1,value:17},{str:label.ebikeForbid2,value:18},{str:label.ebikeForbid3,value:19}],D=[];for(i=0;i<w.length;i++)0<=$.inArray(w[i].value.toString(),$.audioAlarmCapability[uciAlarmAudioTypeCapability.optName.alarmType])&&D.push(w[i])}(function(){f=new PlanSet("recPlanGrid",
{curType:1});H();var a={};p=0;a[d]={};a[d][NAME]=uciMsgAlarm.secName.chn1MsgAlarmInfo;a[e]={};a[e][NAME]=uciMsgAlarmPlan.secName.ArmingScheduleAudio;$.query(a,function(a){!0==q(a[ERR_CODE])&&(g=a[d][uciMsgAlarm.secName.chn1MsgAlarmInfo].sound_alarm_enabled,p=g==C?1:0,new Switch("alarmSwitch",p,B),!1==r&&(selectInit("soundTypeSelect",D,0,J,"18"),s=a[d][uciMsgAlarm.secName.chn1MsgAlarmInfo].alarm_type,K.changeSel(s)),B(p),showDetailCon())});id("save").onclick=F})();var v=!0,A=id("timeSchedule");id("recordArrow").onclick=
z;id("recordArrowText").onclick=z;id("clearAll").onclick=function(a){f.reset()}}init();
</script><style type="text/css">div.peCol span.select{font-size:0!important}span.peSelect{width:124px!important;_width:116px!important;font-size:14px!important}#orgDC{width:662px}.displayNone{display:none!important}div.peCon{left:136px;top:190px;_left:-30px;_top:-10px}div.peCon div.peConDetail div.peCol4{display:none}div.configDiv label.title{display:inline-block;height:30px;line-height:30px;font-size:12px;color:#7a8999;width:66px;margin:0 4px}input.textClock{background:url(../web-static/images/clock.png) no-repeat 160px 5px #fff;cursor:pointer;text-align:left}div.timePickerCon{width:167px}div.timeFunc{width:145px}label.desColon{width:16px;font-size:13px;line-height:30px;text-align:center}ul.line li.lineE{margin-bottom:4px}</style>