var cfg_alarmout_header=new Array("",str_alarmoutname,str_holdtimes);function OnLoadCfgAlarmout(){var h=document.getElementById("alarm_out_all_cfg");var e=document.getElementById("id_alarm_out");var g=document.getElementById("id_alarm_out_all");ApplyXmlLang("cfg_alarmout.xml");CreateListAlarmout(e,3,cfg_alarmout_header,g_alarmoutList.length);GenSelectListEx(document.getElementsByName("buzzer_hold_time")[0],g_alarmOutHoldTime);GenSelectListEx(document.getElementsByName("all_alarmout_hold_time")[0],g_alarmOutHoldTime);var d=CreateConfigReqXml(alarmout_config_array);var a=WebClient.ExcuteCmd(d);if(a==""){return false}if(g_xmlDoc!=null){delete g_xmlDoc;g_xmlDoc=null}g_xmlDoc=FormatToXmlDOM(a);g_xmlDoc.async=false;var f=g_xmlDoc.documentElement.getElementsByTagName("command")[0].getElementsByTagName("parameter");UpdateValues(f,true);if(g_supportFunctions.IsNotSupportAlarm()){var c=document.getElementById("alarm_out_label");var b=document.getElementById("alarmout_all_label");c.style.display="none";document.getElementById("id_alarm_out").style.display="none";b.style.display="none";g.style.display="none"}BuzzerEnable(document.getElementsByName("buzzer_enable")[0]);cfgCopy2All(h,e,g);document.getElementsByName("all_alarmout_hold_time")[0].value=10;Align()}function LoadDefaultCfgAlarmout(){if(GetDefaultCfg(alarmout_config_array)){var d=document.getElementById("alarm_out_all_cfg");var a=document.getElementById("id_alarm_out");var c=document.getElementById("id_alarm_out_all");var b=g_xmlDoc.documentElement.getElementsByTagName("command")[0].getElementsByTagName("parameter");UpdateValues(b,true);BuzzerEnable(document.getElementsByName("buzzer_enable")[0]);cfgCopy2All(d,a,c);g_bChange=true;Align()}}function CreateListAlarmout(g,a,b,j){var f=/msie/i.test(navigator.userAgent);var h=g.outerHTML.toLowerCase();var c=h.indexOf("</tbody>");h=h.substr(0,c);h+="<tr class = 'table_head_bgcolor'>";for(var d=0;d<a;d++){h+='<td style = "text-align:center">'+b[d]+"</td>"}h+="</tr>";for(var d=1;d<j+1;d++){h+="<tr>";h+='<td style = "width:50px;text-align:center;">'+d+"</td>";h+='<td><input style = "width:363px" type = "text" name = "alarmout_name" onkeydown = "return LenCheck(this,event,const_alarmout_name_max_len);" onkeyup = "return KeyupCheck(this,const_alarmout_name_max_len);"  onchange = "g_bChange = true;"/></td>';h+='<td><select style = "width:300px" name = "alarmout_hold_time" onchange = "g_bChange = true;"></select></td>';h+="</tr>"}h+="</tbody></table>";if(f){var e=g.parentElement}else{var e=g.parentNode}e.innerHTML=h;for(var d=1;d<j+1;d++){GenSelectListEx(document.getElementsByName("alarmout_hold_time")[d-1],g_alarmOutHoldTime)}g=e.childNodes[0]}function ConstAlarmoutlen(){var e="";var d="";var c=true;var b=document.getElementsByName("alarmout_name");var a=document.getElementById("alarmoutconfig_errortips");for(i=0;i<g_alarmoutList.length;i++){if(g_alarmoutList.length>1){alarmout_name_len=b[i].value.length}else{alarmout_name_len=b[0].value.length}if(alarmout_name_len>const_alarmout_name_max_len){e=str_alarmout_name+cannot_more_than_tip+const_alarmout_name_max_len+character;c=false}if(alarmout_name_len==0){d=str_alarmout_name+str_empty_tip;c=false}}if(!c){a.style.color="red";a.innerHTML=save_error_tip+e+d;g_bChange=false;return false}a.innerHTML="";a.display="none";return true};