function GenCheckGroup(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);if(d){m.style.cssText="border-right:solid 1px gray;"}else{m.style.cssText="border-right:solid 1px #000;"}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.getElementById("'+c.id+'");CheckItem('+c.id+","+i+")'/>"+(j+1-a+(i*p));if((typeof l)!="undefined"){m.childNodes[0].onchange=l}}}}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(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(!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_channelList.length%8){a=4;var f=true}var g=Math.ceil(g_channelList.length/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);b.innerHTML=e*a+c+1;b.style.cssText="width:20px;";if(f){b.style.cssText="width:40px;"}}}};