



<div class="detailCon">
     <ul class="line lineL">
        <li class="line lineI">
            <label class="des desF">{%label.alarmOutDev%}</label>
            <div id="alarmOutSwitch" class="switchCon">
                <i class="switchBg"></i>
                <i class="switchBall"></i>
            </div>
            <label class="des desH"></label>
            <input id="manualAlarm" type="button" class="subBtnB btnA" style="margin-left: 24px;" value="{%btn.manualAlarm%}" />
        </li>
        <div style="position:relative;*z-index:2;">
            <div id="hidebg"></div>
        </div>
        <li class="line lineI" id="alarmNameLi">
            <label class="des desF desLogType">{%label.alarmOutDevNum%}:</label>
            <span class="selCon alarmName">
                <span id="alarmNameSel" class="select">
                    <span class="value hsValueA"></span>
                    <i class="arrow"></i>
                </span>
            </span>
            <label id="showingDevNum" class="des desLogType"></label>
        </li>
        <li class="line lineI">
            <label class="des desF">{%label.alarmOutAlias%}:</label>
            <input id="alias" type="text" class="text textA1" maxlength="63" />
            <label id="aliasTipStr" for="alias">{%label.alarmOutDevTip%}</label>
        </li>
        <div style="position:relative;*z-index:1;" id="alarmTypeDiv">
            <li class="line lineI">
                <label class="des desF">{%label.alarmType%}</label>
                    <span class="selCon">
                        <span id="alarmTypeSel" class="select">
                            <span class="value hsValueA"></span>
                            <i class="arrow"></i>
                        </span>
                    </span>
            </li>
        </div>
        <li class="line lineI">
            <label class="des desF">{%label.alarmDuration%}</label>
        </li>
        <li class="line lineI lineBottom">
            <label class="des desF">{%label.outputDuration%}:</label>
            <input id="alarmTime" type="text" class="text textA1 textA4" maxLength="3" />
            <span class="tip">{%label.second%}</span><span class="tip">(5-600s)</span>
        </li>
    </ul>

    <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.alarmOutTips%}</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 p(a,b){var c="";switch(parseInt(a)){case ENONE:return!0;case IPCENERR:c=errStr.IPCParamInvalid;break;case IPCALARMALIASERR:c=errStr.alarmOutAliasErr;break;case IPCALAOUTDURERR:c=errStr.alarmOutTimeInputErr;break;case IPCUBUSCONNFAIL:c=errStr.ipcUbusConnFail;break;case IPCUBUSCALLERR:c=errStr.ipcUbusCallErr;break;case IPCUMGUESTNAUTH:c=errStr.invPermissionDenied;break;case IPCTIMEMINERR:c=errStr.ePlanTimeMinErr;break;case IPCTIMECOVERERR:c=errStr.ePlanTimeCoverErr;break;case IPCTIMEMAXERR:c=
errStr.ePlanTimeMaxErr;break;case IPCTYPEERR:c=errStr.ePlanTypeErr;break;default:c=errStr.invRequestFail}closeToast();showAlert(c,b);return!1}function Q(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 d=0;d<a.length;d++){b=a[d];var e=b.split(/[-]/,2);b=parseInt(e[0],10);e=parseInt(e[1],10);0==b&&0==e?c.push(k._getString(b,e,0)):c.push(k._getString(b,e,1))}return c}function R(){var a,b=k.getTimeVal(),c={};for(a=0;a<q.length;a++){var d=
c,e=x[a],f;f=b[q[a]];var h=void 0,l=void 0,g=void 0,m=void 0,n=void 0,n=m=void 0;if(void 0==f)f="";else{void 0==h&&(h=6);l="[";if(1>f.length)l+='"0000-0000"';else for(g=0;g<f.length&&g<h;g++)m=f[g].toString(),n=m.split(/[-,:]/,3),m=parseInt(n[0],10),n=parseInt(n[1],10),m=k._getStringWithoutType(m,n),0<g&&(l+=","),l+='"'+m+'"';f=l+="]"}d[e]=f}return c}function y(){var a,b={},c=z+f;b[d]={};b[d][NAME]=c;$.query(b,function(b){if(!0==p(b[ERR_CODE]))for(k.reset(),a=0;a<q.length;a++)k.setTimeVal(q[a],Q(b[d][c][x[a]]))})}
function A(){s?(id("recordArrow").className="arrowDown",id("recordArrow").title=label.slideDown,id("recordArrowText").innerHTML=label.slideDown,B.style.display="none",s=!1):(id("recordArrow").className="arrowUp",id("recordArrow").title=label.slideUp,id("recordArrowText").innerHTML=label.slideUp,B.style.display="",s=!0)}function S(a){f=g[a];y();C()}function T(a){D=E;g=[];for(var b=1;b<=E;b++)g.push("AO"+b.toString());F.push(1);if(1==D)$(".alarmName").hide(),$("#showingDevNum").show(),f=g[0],U.innerHTML=
f;else{$("#showingDevNum").hide();$(".alarmName").show();f=g[0];for(var c=[],d={},b=0;b<g.length;b++)d={},d.str=g[b],d.value=b,c[b]=d;selectInit("alarmNameSel",c,0,S)}a()}function G(a){var b=document.getElementById("hidebg");if(0==a){b.style.display="block";$("div.tableDiv").css({"z-index":"-1"});a=getoffset(id("save")).top-getoffset(id("alarmNameLi")).top-id("alarmNameLi").offsetHeight;b.style.marginTop=id("alarmNameLi").offsetHeight+"px";if(0==$("#peCon").length||"none"==$("#peCon").css("display"))b.style.height=
a+"px";else{var c=getoffset(id("peCon")).top-getoffset(id("alarmNameLi")).top-id("alarmNameLi").offsetHeight+id("peCon").offsetHeight;b.style.height=(a>c?a:c)+"px"}id("manualAlarm").style.display="none"}else b.style.display="none",$("div.tableDiv").css({"z-index":"0"}),id("manualAlarm").style.display="inline-block"}function C(){var a={},b=H+f;a[d]={};a[d][NAME]=b;$.query(a,function(a){!0==p(a[ERR_CODE])&&(!0==$.local?(t=new Switch("alarmOutSwitch",0,G),e.value=label.alarmInDevTip,h.value="10"):(u=
0,I=a[d][b][J],u=I==K?1:0,t=new Switch("alarmOutSwitch",u,G),e.value=a[d][b][L],e.value="undefined"==e.value?"":e.value,v.style.display=0!=e.value.length?"none":"inline",w&&(selectInit("alarmTypeSel",[{str:label.alarmLevelHigh,value:"normally_open"},{str:label.alarmLevelLow,value:"normally_closed"}],"normally_open"),M=a[d][b][N],$("#alarmTypeSel")[0].resetSel(M)),h.value=a[d][b][O],showDetailCon()))})}var d=uciAlarmOut.fileName,H=uciAlarmOut.secName.alarmOutPrefix,z=uciAlarmOut.secName.planPrefix,
J=uciAlarmOut.optName.enabled,O=uciAlarmOut.optName.alarmTime,L=uciAlarmOut.optName.alias,N=uciAlarmOut.optName.alarmType,K=uciAlarmOut.optValue.enableVal.on,V=uciAlarmOut.optValue.enableVal.off,r=uciAlarmOut.secName.manualAlarm,W=uciAlarmOut.optName.action,P=uciAlarmOut.optName.deviceNumbers,t=null,I,u,M,s=!0,w,D,g=[],f,F=[],e=id("alias"),v=id("aliasTipStr"),U=id("showingDevNum"),h=id("alarmTime"),B=id("timeSchedule"),q=[label.Mon,label.Tue,label.Wen,label.Thu,label.Fri,label.Sta,label.Sun],x=[uciAlarmOut.optName.mon,
uciAlarmOut.optName.tue,uciAlarmOut.optName.wed,uciAlarmOut.optName.thu,uciAlarmOut.optName.fri,uciAlarmOut.optName.sat,uciAlarmOut.optName.sun],k,E=isNaN(parseInt($.moduleSpec.alarm_out_num))?1:parseInt($.moduleSpec.alarm_out_num);(function(){k=new PlanSet("recPlanGrid",{curType:1});T(function(){y();C()});alarmTypeDiv.style.display="none";if(w=$.moduleSpec&&1==parseInt($.moduleSpec[uciFunction.optName.alarmIoCapability])&&1==parseInt($.alarmIoCapability[uciAlarmIoCapability.optName.alarm_output_type]))alarmTypeDiv.style.display=
""})();e.onclick=function(){v.style.display="none"};e.onblur=function(){0==this.value.length&&(v.style.display="inline")};h.onblur=function(){!0==checkNum(this.value)&&!0==checkNumRange(parseInt(this.value),600,5)?(showToast("loading"),closeToast()):showNote("alarmTime",errStr.alarmOutTimeInputErr)};id("save").onclick=function(){var a={};k.getTimeVal();var b=H+f,c=z+f;a[d]={};a[d][b]={};a[d][c]={};a[d][b][J]=1==t.state?K:V;a[d][b][L]=e.value;w&&(a[d][b][N]=$("#alarmTypeSel")[0].value);!1==checkNum(h.value)||
!1==checkNumRange(parseInt(h.value),600,5)?showAlert(errStr.alarmOutTimeInputErr):(a[d][b][O]=h.value,a[d][c]=R(),showToast(),$.modify(a,function(a){!0==p(a[ERR_CODE])&&showToast("success")}))};id("recordArrow").onclick=A;id("recordArrowText").onclick=A;id("clearAll").onclick=function(a){k.reset()};id("manualAlarm").onclick=function(){var a={};a[d]={};a[d][r]={};a[d][r][W]="1";a[d][r][P]=[];a[d][r][P]=F;!1==checkNum(h.value)||!1==checkNumRange(parseInt(h.value),600,5)?showAlert(errStr.alarmOutTimeInputErr):
$.action(a,function(a){!0==p(a[ERR_CODE])&&showToast("success")})}}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}i.peTypeRd{width:25px!important;height:25px!important}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}#mdtLabel{margin-right:347px;*margin-right:340px;display:inline-block;*display:inline;*zoom:1}label.typeSeled{color:#fff!important}div.peCon{left:136px;top:190px;_left:-30px;_top:-10px}div.peCon div.peConDetail div.peCol4{display:none}label.desLogType{font-size:13px;color:#666;line-height:32px}#aliasTipStr{color:#666;font-size:13px;left:160px;line-height:30px!important;position:absolute;top:169px;*top:173px}ul.line li.lineI{margin-bottom:8px;width:410px;padding:5px 0}ul.line{font-size:0;list-style:none;width:720px}ul.line li.lineR{display:inline-block;*display:inline;*zoom:1;height:100%;font-size:0;vertical-align:middle;float:right}input.btnA{border-radius:2px;font-size:13px;*padding:0 28px;padding:2px 13px 1px;height:30px}</style>