function GenCheckGroup(l,f,e,h,c,t){var p=0;var d=0;var m=4;var n=20;if(c!=null){m=c}var q=(l.rows.length==1);var g="";var o="";if(q){g=l.rows[0].cells[1].className;o=l.rows[0].cells[1].cssText;l.deleteRow(l.rows[0])}while(l.rows.length>0){l.deleteRow(l.rows[0])}var b=e.length;if((parseInt(b/m)>0)&&(b%m!=0)){b=parseInt(b/m)*m+m}var k=Math.ceil(e.length/m);var r=0;for(i=0;i<k;i++){var a=l.insertRow(i);a.style.cssText="text-align:left;";if(e.length>1){r=1;var s=a.insertCell(0);if(f){if(l.id=="other_alarm_trigger_out"){s.style.cssText="border:0px;"}else{s.style.cssText="border-right:solid 1px gray;"}}else{s.style.cssText="border-right:solid 1px #000;"}s.innerHTML="<input type='checkbox' style='width:20px;' onclick='var "+l.id+' = document.getElementById("'+l.id+'");CheckGroup('+l.id+","+i+")'/>";if((typeof t)!="undefined"){s.childNodes[0].onchange=t}}for(j=r;(j-r<m)&&((j-r+i*m)<b);j++){if((j-r+i*m)>=e.length){s=a.insertCell(j);s.className=g;s.cssText=o;s.disabled=true;continue}s=a.insertCell(j);s.className=g;s.cssText=o;if(l.id=="other_alarm_trigger_out"){s.style.cssText="border:0px;"}s.innerHTML="<input type='checkbox' name='"+h+"'value = '"+e[j+i*m-r].optionValue+"' style='width:"+n+"px;' onclick='var "+l.id+' = document.getElementById("'+l.id+'");CheckItem('+l.id+","+i+")'/>"+(j+1-r+(i*m));if((typeof t)!="undefined"){s.childNodes[0].onchange=t}}}}function GenCheckGroup_NoTdBorder(c,d,h,e,n,l){var f=0;var q=0;var p=4;var b=20;if(n!=null){p=n}var g=(c.rows.length==1);var k="";var s="";if(g){k=c.rows[0].cells[1].className;s=c.rows[0].cells[1].cssText;c.deleteRow(c.rows[0])}var r=Math.ceil(h.length/p);var a=0;for(i=0;i<r;i++){var o=c.insertRow(i);o.style.cssText="text-align:left;";if(h.length>1){a=1;var m=o.insertCell(0);m.innerHTML="<input type='checkbox' style='width:20px;' onclick='var "+c.id+' = document.getElementById("'+c.id+'");CheckGroup('+c.id+","+i+")'/>";if((typeof l)!="undefined"){m.childNodes[0].onchange=l}}for(j=a;(j-a<p)&&((j-a+i*p)<h.length);j++){m=o.insertCell(j);m.className=k;m.cssText=s;m.innerHTML="<input type='checkbox' name='"+e+"'value = '"+h[j+i*p-a].optionValue+"' style='width:"+b+"px;' onclick='var "+c.id+' = document.getElementsById("'+c.id+'");CheckItem('+c.id+","+i+")'/>"+(j+1-a+(i*p));if((typeof l)!="undefined"){m.childNodes[0].onchange=l}}}}function Bchange(){g_bChange=true}function Btrigger(){bTrigger=true}function CheckGroup(c,d){var a=c.rows[d].getElementsByTagName("input");for(var b=1;b<c.rows[d].cells.length;b++){if(b>=a.length){continue}if(a[b].disabled){a[b].checked=false}else{a[b].checked=a[0].checked}}}function CheckItem(c,d){var a=c.rows[d].getElementsByTagName("input");if(a.length>1){for(var b=1;b<c.rows[d].cells.length;b++){if(c.rows[d].cells[b].disabled){continue}if(!a[b].checked){a[0].checked=false;return}}a[0].checked=true}}function UpdateCheckItems(c){var a=c.getElementsByTagName("input");for(var b=0;b<c.rows.length;b++){CheckItem(c,b)}}function GenSelectList(e,d,a){e.length=0;for(var c=0;c<d.length;c++){if(d[c]==""){continue}var b=new Option(d[c],a[c]);e.options.add(b)}}function GenCpList(d,b,a){d.length="";var c=document.createElement("option");c.value="All";c.innerHTML=all_string;d.appendChild(c);for(j=0;j<a.length;j++){if(j!=b){var c=document.createElement("option");c.value=a[j].optionValue;c.innerHTML=a[j].optionName;d.appendChild(c)}continue}}function GenLiveTable(h){var f=false;var a=8;if(g_ch_num%8&&g_ch_num<=16){a=4;var f=true}var g=Math.ceil(g_ch_num/a);for(var e=0;e<g;e++){var d=h.insertRow(e);for(var c=0;c<a;c++){var b=d.insertCell(c);if((e*a+c+1)<=g_ch_num){b.innerHTML=e*a+c+1}else{b.innerHTML=""}b.style.cssText="width:20px;";if(f){b.style.cssText="width:40px;"}}}};