var g_curSelectRowIndex=-1;function CreateListCtrl(g,a,b,k){var c=/msie/i.test(navigator.userAgent);listCtrl=new Object();listCtrl.colNum=a;listCtrl.htmlObj=g;listCtrl.colHeaders=b;listCtrl.bEnable=true;listCtrl.AddOneItem=AddOneItem;listCtrl.DelOneItem=DelOneItem;listCtrl.GetItemCount=GetItemCount;listCtrl.GetCurSel=GetCurSel;listCtrl.ChangeItem=ChangeItem;listCtrl.GetItem=GetItem;listCtrl.Clear=ClearList;var h="<table id='table_user'  class='main_table' style='width: 750px;'>";h+="<tbody>";h+="<tr class = 'table_head_bgcolor'>";for(var e=0;e<a;e++){h+="<td style = 'width:250px;'>"+b[e]+"</td>"}h+="</tr>";for(var e=1;e<k+1;e++){h+="<tr onclick='OnClick_"+g.id+"_Item(this)'>";for(var d=0;d<a;d++){h+="<td></td>"}h+="</tr>"}h+="</tbody></table>";if(c){var f=g.parentElement}else{var f=g.parentNode}f.innerHTML=h;listCtrl.htmlObj=f.childNodes[0];return listCtrl}function AddOneItem(a){var f=/msie/i.test(navigator.userAgent);var d=this.htmlObj.rows;for(var c=1;c<d.length;c++){if(f){var e=d[c].cells[0].innerText}else{var e=d[c].cells[0].textContent}if(e==""){for(var b=0;b<a.length;b++){if(f){d[c].cells[b].innerText=a[b]}else{d[c].cells[b].textContent=a[b]}}break}}}function DelOneItem(b){var f=/msie/i.test(navigator.userAgent);b+=1;var d=this.htmlObj.rows;if(f){var e=d[b].cells[0].innerText}else{var e=d[b].cells[0].textContent}if(e==""){return}for(var a=0;a<this.colNum;a++){if(f){d[b].cells[a].innerText=""}else{d[b].cells[a].textContent=""}}if(f){for(var c=b;(c+1<d.length)&&(d[c+1].cells[0].innerText!="");c++){for(var a=0;a<this.colNum;a++){d[c].cells[a].innerText=d[c+1].cells[a].innerText}}}else{for(var c=b;(c+1<d.length)&&(d[c+1].cells[0].textContent!="");c++){for(var a=0;a<this.colNum;a++){d[c].cells[a].textContent=d[c+1].cells[a].textContent}}}for(var a=0;a<this.colNum;a++){if(f){d[c].cells[a].innerText=""}else{d[c].cells[a].textContent=""}}}function GetItemCount(){var e=/msie/i.test(navigator.userAgent);var c=0;var b=this.htmlObj.rows;for(var a=1;a<b.length;a++){if(e){var d=b[a].cells[0].innerText}else{var d=b[a].cells[0].textContent}if(d==""){break}c++}return c}function GetCurSel(){var b=/msie/i.test(navigator.userAgent);var c=this.htmlObj.rows;for(var a=1;a<c.length;a++){if(b){if(c[a].style.backgroundColor.toUpperCase()==ptz_pincruise_sel_bg){return a-1}}else{if(g_curSelectRowIndex>0&&g_curSelectRowIndex==a){return a-1}}}return -1}function ChangeItem(b,e){var d=/msie/i.test(navigator.userAgent);b+=1;var c=this.htmlObj.rows;for(var a=0;a<this.colNum;a++){if(d){c[b].cells[a].innerText=e[a]}else{c[b].cells[a].textContent=e[a]}}}function GetItem(c){var e=/msie/i.test(navigator.userAgent);c+=1;var d=this.htmlObj.rows;var a=new Array(this.colNum);for(var b=0;b<this.colNum;b++){if(e){a[b]=d[c].cells[b].innerText}else{a[b]=d[c].cells[b].textContent}}return a}function ClearList(){var e=/msie/i.test(navigator.userAgent);var c=this.htmlObj.rows;for(var b=1;b<c.length;b++){if(e){var d=c[b].cells[0].innerText}else{var d=c[b].cells[0].textContent}if(d==""){break}for(var a=0;a<c[b].cells.length;a++){if(e){c[b].cells[a].innerText=""}else{c[b].cells[a].textContent=""}}c[b].style.backgroundColor="";c[b].style.color=userListColor}}function OnClickItem(b){var d=/msie/i.test(navigator.userAgent);var a=b.parentNode;for(i=1;i<a.rows.length;i++){a.rows[i].style.background=ptz_pincruise_unsel_bg;a.rows[i].style.color=ptz_pincruise_unsel_color}if(d){var c=b.cells[0].innerText}else{var c=b.cells[0].innerText}if(c!=""){b.style.background=ptz_pincruise_sel_bg;b.style.color=ptz_pincruise_sel_color;g_curSelectRowIndex=b.rowIndex}}function OnClick_table_user_Item(c){g_curSelectRowIndex=-1;if(!g_userListCtrl.bEnable){return}var b=document.getElementById("user_info_pane");var d=document.getElementById("btn_group_modify");var a=document.getElementById("modify_password");var b=document.getElementById("user_info_pane");OnClickItem(c);if(((b.style.display!="none")&&(d.style.display!="none"))||(a.style.display!="none")){if(g_userListCtrl.GetCurSel()==-1){OnUserCancel();OnModPwdCancel();return}if(d.style.display==""){OnModifyUser()}if(a.style.display==""){OnModPwd()}}};