

<div class="detailCon">
	<div class="configDiv" id="configDiv">
		<ul class="line">
			<li class="Line lineE">
				<label class="des desA">{%label.lightAlarm%}</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>
		</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.lightAlarmTipsDT%}</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 A(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 s=0;s<a.length;s++){b=a[s];var d=b.split(/[-]/,2);b=parseInt(d[0],10);d=parseInt(d[1],10);0==b&&0==d?c.push(e._getString(b,d,0)):c.push(e._getString(b,d,1))}return c}function B(){var a={};e.getTimeVal();var b=uciMsgAlarmPlan.secName.ArmingScheduleLight;a[h]={};a[h][uciMsgAlarm.secName.chn1MsgAlarmInfo]={};a[h][uciMsgAlarm.secName.chn1MsgAlarmInfo][uciMsgAlarm.optName.lightEnabled]=f;a[d]={};a[d][b]={};a[d][b]=C();f==u&&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 D(){var a,b={},c=uciMsgAlarmPlan.secName.ArmingScheduleLight;b[d]={};b[d][NAME]=c;$.query(b,function(b){if(!0==q(b[ERR_CODE]))for(e.reset(),a=0;a<r.length;a++)e.setTimeVal(r[a],A(b[d][c][v[a]]))})}function C(){var a,b=e.getTimeVal(),c={};for(a=0;a<r.length;a++){var d=c,h=v[a],k;k=b[r[a]];var f=void 0,g=void 0,
m=void 0,l=void 0,n=void 0,n=l=void 0;if(void 0==k)k="";else{void 0==f&&(f=6);g="[";if(1>k.length)g+='"0000-0000"';else for(m=0;m<k.length&&m<f;m++)l=k[m].toString(),n=l.split(/[-,:]/,3),l=parseInt(n[0],10),n=parseInt(n[1],10),l=e._getStringWithoutType(l,n),0<m&&(g+=","),g+='"'+l+'"';k=g+="]"}d[h]=k}return c}function w(){t?(id("recordArrow").className="arrowDown",id("recordArrow").title=label.slideDown,id("recordArrowText").innerHTML=label.slideDown,x.style.display="none",t=!1):(id("recordArrow").className=
"arrowUp",id("recordArrow").title=label.slideUp,id("recordArrowText").innerHTML=label.slideUp,x.style.display="",t=!0)}function y(a){E.innerHTML=1==a?btn.enableN:btn.close;f=1==a?z:u;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"}var z=uciMsgAlarm.optValue.enableVal.on,u=uciMsgAlarm.optValue.enableVal.off,f,E=id("alarmSwitchDes"),d=uciMsgAlarmPlan.fileName,h=uciMsgAlarm.fileName,
p,r=[label.Mon,label.Tue,label.Wen,label.Thu,label.Fri,label.Sta,label.Sun],v=[uciMsgAlarmPlan.optName.mon,uciMsgAlarmPlan.optName.tue,uciMsgAlarmPlan.optName.wed,uciMsgAlarmPlan.optName.thu,uciMsgAlarmPlan.optName.fri,uciMsgAlarmPlan.optName.sat,uciMsgAlarmPlan.optName.sun],e;(function(){e=new PlanSet("recPlanGrid",{curType:1});D();var a={};p=0;a[h]={};a[h][NAME]=uciMsgAlarm.secName.chn1MsgAlarmInfo;a[d]={};a[d][NAME]=uciMsgAlarmPlan.secName.ArmingScheduleLight;$.query(a,function(a){!0==q(a[ERR_CODE])&&
(f=a[h][uciMsgAlarm.secName.chn1MsgAlarmInfo][uciMsgAlarm.optName.lightEnabled],p=f==z?1:0,new Switch("alarmSwitch",p,y),y(p),showDetailCon())});id("save").onclick=B})();var t=!0,x=id("timeSchedule");id("recordArrow").onclick=w;id("recordArrowText").onclick=w;id("clearAll").onclick=function(a){e.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>