function ScrollTable(srcId,sr,w,h,onScroll,fillUp,cw,ch,onClick){this.lastTop=0;this.eRow=null;this.sr=sr;this.w=w;this.h=h;this.srcId=srcId;this.onScroll=onScroll;this.onClick=onClick;this.fillUp=fillUp;this.bNoScroll=false;this.selectedRow=null;this.maxH=200;this.minH=50;this.ignoreScroll=false;this.scrollTop=0;this._dx=0;this._dy=0;this.tc1="\043\u0046F\u0046FF\u0046";this.tc2="\043F\u0037F7\u00467";this.process=false;this.cw=cw?cw:120;this.ch=ch?ch:20;this.firstRow=sr;this.lastRow=sr;}ScrollTable.prototype.init=function(){var t=document.getElementById(this.srcId);if(!t){if(this.srcId.toLowerCase().indexOf("ht\164p\u003a\057/")>-1){this.loadRemote(this.srcId);return;}alert("\103\141n't find the \u0073ou\u0072c\u0065 \u0074a\142l\u0065");return;}t.style.display="\u006eon\u0065";var bd=document.getElementsByTagName("\142\157dy")[0];var d=document.createElement("\144i\166");d.id="\164\151l\145Di\u0076";d.style.backgroundColor="l\151ghtgr\u0065\171";d.style.width=scrollTable.w+25;d.style.height="1\u0030\060\u0025";var dd="\074d\151v\040\u0069d\075'h\145\u0061d\u0065\u0072\u0044i\u0076' \163tyle='\u006f\u0076er\146l\157w:hi\144d\u0065n;\u0077\u0069d\164h\u003a"+scrollTable.w+";\u0062\u0061ck\u0067\162oun\144-c\u006fl\157r:#\u00638cfd\064\u003b \160\141d\u0064i\156\u0067:0p\170;\040\u006dar\u0067in: \u0030\u0070x\u0027\u003e";dd+="<ta\u0062\154e i\u0064\u003d'heade\162\124able\047\040\143l\141\163s='\u0068eaderTabl\145' \u0062o\162\u0064e\162\u003d1\040c\u0065ll\163p\141ci\156g\u003d\060 c\145\u006clp\141dding=\060></\164able\076\074/\144\151\u0076>";dd+="<div o\u006eS\143\162\u006fll='sc\u0072oll\u0054\u0061b\154\u0065.s\u0079n\u0063hr\u006fni\172eScr\157ll()'\u0020\u0069d\075\047b\157\144y\u0044i\u0076'\u0020st\171le=\u0027\u006fve\162fl\u006fw\u003aauto; wi\u0064\164\150\072"+(scrollTable.w+20)+"; \150eigh\164\u003a"+scrollTable.h+";p\141d\144ing\u003a0\160\170; m\141rgin:\0400p\u0078;b\u0061\143\153g\162ound-c\157\154or:lig\u0068tg\162e\u0079\u003b\u0043\125\u0052\u0053OR: H\u0041ND;'\u003e";dd+="\u003ct\u0061b\u006c\145\040i\144\u003d\047l\u0069\163t\u0054ab\u006ce'\u0020\u0063la\163\163\075'l\151stTab\154\u0065\u0027 bo\u0072\u0064er=1 c\u0065\u006cl\u0073\u0070a\143\151\156\u0067=0 ce\154lpa\144d\u0069\u006e\u0067=0 s\u0074y\u006c\u0065\u003d\u0027ba\143k\u0067r\u006f\165nd-co\154or\u003a\043\u0065eee\u0065\u0065;color:#1B\u0033D\u0034B'\u003e\074/ta\142le\u003e\u003c\u002f\144i\166>";d.innerHTML=dd;t.insertAdjacentElement("after\u0045n\u0064",d);var ch=this.findRows(t);var r=0;this.t1=document.getElementById("\150\145\141\144erTab\154e");this.t2=document.getElementById("\u006c\u0069\u0073t\u0054\141\u0062\154e");this.d1=document.getElementById("\u0068\u0065\141\u0064\u0065\u0072D\u0069\u0076");this.d2=document.getElementById("bod\171Div");var rc=0;this.rowH=this.cloneRow(this.t1,ch[0],"\162c_\150",true);for(var i=1;i<ch.length;i++){if(!ch[i].tagName||ch[i].tagName.toLowerCase()!="t\u0072")continue;this.cloneRow(this.t2,ch[i],"r_"+(rc+this.sr));rc++;}this.lastRow=this.sr-1+rc;this.nRowMax=Math.round(this.d2.scrollHeight/this.rowH);if(this.onScroll)this.makeEmptyRows(this.t1,this.t2,10);t.parentNode.removeChild(t);};ScrollTable.prototype.synchronizeScroll=function(){this.d1.scrollLeft=this.d2.scrollLeft;if(this.onScroll)this.onScroll();};ScrollTable.prototype.cloneRow=function(t,r,id,isHead){var row=r.cloneNode(true);var tb=t.children;if(tb)tb=tb[0];else{tb=t.childNodes[0];}if(tb==null){tb=document.createElement("\164bo\144y");t.appendChild(tb);}tb.appendChild(row);var ch=row.children;if(!ch)ch=row.childNodes;for(var i=0;i<ch.length;i++){ch[i].innerHTML="<div\u0020no\u0077\u0072\u0061\u0070\076"+ch[i].innerHTML+"<\057\u0064iv\u003e";if(ch[i].setAttribute){ch[i].style.width=this.cw;ch[i].style.height=this.ch;ch[i].style.whiteSpace="\u006eowr\141\u0070";}else{ch[i].className="\164\u0064";}}if(isHead){var td=document.createElement("\164\144");td.style.width=20;row.appendChild(td);return row.offsetHeight;}else{row.id=id;if(this.onClick)row.onclick=this.onClick;}};ScrollTable.prototype.makeEmptyRows=function(t1,t2,n){var m=0;var chr=this.findRows(t1);if(chr.length<1)return;var ch=this.getChildren(chr[0]);for(var i=0;i<ch.length;i++){if(!ch[i].tagName||ch[i].tagName.toLowerCase()!="\164\u0068")continue;m++;}var tb2=this.findTb(t2);for(var i=0;i<n;i++){var nr=document.createElement("t\u0072");for(var j=0;j<m;j++){var nc=document.createElement("\164d");var nd=document.createElement("di\u0076");nd.innerHTML="\046nbsp\u003b";nc.appendChild(nd);nr.appendChild(nc);}tb2.appendChild(nr);}if(this.sr>0){var fr=this.getFirstRow();for(var i=0;i<n;i++){var nr=document.createElement("t\162");for(var j=0;j<m;j++){var nc=document.createElement("td");var nd=document.createElement("\u0064iv");nd.innerHTML="&nbsp;";nc.appendChild(nd);nr.appendChild(nc);}fr.insertAdjacentElement("b\u0065\146or\u0065\u0042\u0065\u0067\151n",nr);}this.ignoreScroll=true;this.d2.scrollTop=n*this.rowH;}this.scrollTop=this.d2.scrollTop;};ScrollTable.prototype.resizeCells=function(ct,nt){var i,colwidth,check;if(nt!=null){for(i=0;i<nt.rows.item(0).cells.length;i++){colwidth=this.max(this.maxColWidth(nt,i),this.maxColWidth(ct,i));this.resizeColumn(nt,i,colwidth);this.resizeColumn(ct,i,colwidth);check=this.max(this.maxColWidth(nt,i),this.maxColWidth(ct,i));if(check!=colwidth){alert("Check\u0020!= \u0063\u006flwidth\u0020for\u0020col\u0075\155\156\u003a\u0020"+i);this.resizeColumn(nt,i,check);this.resizeColumn(ct,i,check);}}}};ScrollTable.prototype.max=function(a,b){return a>b?a:b;};ScrollTable.prototype.maxColWidth=function(t,j){var maxwidth=this.getWidth(t.rows.item(0).cells.item(j).firstChild);for(var i=1;i<t.rows.length;i++)maxwidth=this.max(maxwidth,this.getWidth(t.rows.item(i).cells.item(j).firstChild));return maxwidth;};ScrollTable.prototype.resizeColumn=function(t,j,s){if(t==null)return;for(var i=0;i<t.rows.length;i++){this.setWidth(t.rows.item(i).cells.item(j).firstChild,s);}};ScrollTable.prototype.checkColumnWidths=function(t1,t2){var width1,width2;for(var j=0;j<t1.rows.item(0).cells.length;j++){if((width1=this.getWidth(t1.rows.item(0).cells.item(j).firstChild))!=(width2=getWidth(t2.rows.item(0).cells.item(j).firstChild))){alert("t1\u005b\060]["+j+"].wi\u0064th = "+width1+"\nt2\133\u0030\u005d\133"+j+"\135.w\u0069\u0064th \u003d "+width2);return;}}};ScrollTable.prototype.compareObjects=function(o1,o2){var s='';if(!o1)return false;if(!o2)return false;for(prop in o1)if(o1.currentStyle[prop]!=o2.currentStyle[prop]){s='';s=o1.id?o1.id:o1.name;s=s+'\u002ecurrentS\164yl\u0065['+prop+']:\u0020'+o1.currentStyle[prop]+"\n";s=s+(o2.id?o2.id:o2.name);s=s+'\u002ecu\162\162e\u006e\u0074Styl\145\u005b'+prop+']: '+o2.currentStyle[prop];alert(s);}};ScrollTable.prototype.getWidth=function(obj){var display=this.getEffectiveValue(obj,'di\u0073play');var width=this.getEffectiveValue(obj,'wid\u0074\u0068');if(typeof(width)=='num\142\145r'){if(navigator.userAgent.indexOf('O\160er\u0061')!=-1)return obj.clientWidth;else return width;}if(width==''||width=='au\164o'||width.indexOf('\u0025')!=-1){if(typeof(obj.offsetWidth)=='number'){width=obj.offsetWidth+'\160x';}else if(typeof(obj.scrollHeight)=='n\u0075\155b\145r'){width=obj.scrollWidth+'\u0070\170';}}width=this.toInt(width);return width;};ScrollTable.prototype.setWidth=function(obj,width){if(typeof(obj.style.width)=='num\142e\162')obj.style.width=width;else obj.style.width=width+'p\170';};ScrollTable.prototype.getEffectiveValue=function(obj,propname){var value=null;if(window.document.defaultView&&window.document.defaultView.getComputedStyle){var capIndex;var cappropname=propname;while((capIndex=cappropname.search(/[A-Z]/))!=-1){if(capIndex!=-1){cappropname=cappropname.substring(0,capIndex)+'-'+cappropname.substring(capIndex,capIndex+1).toLowerCase()+cappropname.substr(capIndex+1);}}value=window.document.defaultView.getComputedStyle(obj,'').getPropertyValue(cappropname);if(!value&&obj.style[propname]){value=obj.style[propname];}}else if(typeof(obj.style[propname])=='u\u006ed\u0065\146ine\u0064'){value='';}else if(typeof(obj.currentStyle)!='\165\u006edefi\156ed'){value=obj.currentStyle[propname];if(!value){value=obj.style[propname];}if(propname=='cl\u0069p'&&!value){value='\u0072\145ct('+obj.currentStyle.clipTop+', '+obj.currentStyle.clipRight+'\u002c '+obj.currentStyle.clipBottom+'\054 '+obj.currentStyle.clipLeft+')';}}else{value=obj.style[propname];}return value;};ScrollTable.prototype.toInt=function(s){var i=parseInt(s,10);if(isNaN(i))i=0;return i;};ScrollTable.prototype.alignTables=function(hTable,bTable){var nHeadingsTable=document.getElementById(hTable);var mainTable=document.getElementById(bTable);if(mainTable==null){return;}var ch=this.findRows(mainTable);if(ch.length==0){return;}this.resizeCells(nHeadingsTable,mainTable);};ScrollTable.prototype.fillUpFrame=function(w,wo,ho,hm,dx,dy,dw){if(dx==null){dx=this._dx;}if(dy==null){dy=this._dy;}if(dw==null)dw=0;var dh=parseInt(hm.offsetHeight);var ww=0;var hh=0;if(w.frameElement!=null){ww=Math.max(w.frameElement.offsetWidth-5-dw,0);if(ww==0)ww=Math.max(w.frameElement.document.body.clientWidth,0);hh=Math.max(w.frameElement.offsetHeight-4,0);if(hh==0)hh=Math.max(w.frameElement.document.body.clientHeight,0);}else if(w.external!=null){var ttt=w.external.dialogWidth;if(ttt==null){return;}ww=Math.max(parseInt(ttt)-24,0);ttt=w.external.dialogHeight;if(ttt==null){return;}hh=parseInt(ttt);}else{return;}this.resizeTable(ww,hh,wo,ho,dx,dy);};ScrollTable.prototype.resizeTable=function(ww,hh,wo,ho,dx,dy){if(dx==null){dx=this._dx;}if(dy==null){dy=this._dy;}for(var i=0;i<wo.length;i++){this._setWidth(wo[i],ww-1-dx);}var hhh;if(ho){if(window.frameElement!=null){hhh=hh-dy-27;hhh=Math.min(hhh,this.maxH);}else{hhh=this.maxH;}hhh=Math.max(hhh,this.minH);}this._setHeight(ho,hhh);};ScrollTable.prototype.adjustTablesCommon=function(){var dw1=0;var dw2=0;if(this.bNoScroll){dw1=40;dw2=40+24+1;}var wo=new Array();wo[0]=document.getElementById("\u0074il\145D\u0069v");wo[1]=document.getElementById("\150\u0065aderD\u0069v");wo[2]=document.getElementById("hea\144e\162\124\u0061\142le");wo[3]=document.getElementById("bodyDiv");wo[4]=document.getElementById("lis\u0074Ta\u0062l\u0065");ho=document.getElementById("\u0062o\144y\104iv");hm=document.getElementById("\150ea\u0064e\162T\141b\u006ce");this.alignTables("\150eaderTa\u0062\154e","listT\141\142\u006ce");if(this.fillUp)this.fillUpFrame(window,wo,ho,hm,null,null,dw1);this.alignTables("\u0068eade\162\124\141ble","li\u0073\u0074\124a\142\154e");};ScrollTable.prototype._setWidth=function(obj,w){if(obj==null){return;}if(typeof(obj.style.width)=='\156umber')obj.style.width=w;else obj.style.width=w+'px';};ScrollTable.prototype._setHeight=function(obj,h){if(obj==null){return;}if(typeof(obj.style.height)=='\156\u0075mb\145\162')obj.style.height=h;else obj.style.height=h+'\160\170';};ScrollTable.prototype.doResize=function(){this.adjustTablesCommon();this.synchronizeScroll();};ScrollTable.prototype.adjustTable=function(){this.alternColorTable(document.getElementById("l\u0069st\124\u0061\u0062\u006c\145"));this.adjustTablesCommon();};var rh;ScrollTable.prototype.alternColorTable=function(t){if(t==null){return;}var ch=this.findRows(t);if(ch.length<1)return;var j=0;for(var i=0;i<ch.length;i++){if(!ch[i].tagName||ch[i].tagName.toLowerCase()!="tr")continue;if(j==0){ch[i].style.backgroundColor=this.tc2;}else{ch[i].style.backgroundColor=this.tc1;}ch[i].altern=j;j=1-j;}rh=ch[i-1].offsetHeight;};ScrollTable.prototype.insertRow=function(s,n,id,where){var r0=this.getFirstRow();if(!r0){alert("n\157\040row\u0020\u0066ound");return;}var rn=r0.cloneNode(true);var cells=s.split("<");var ch=this.getChildren(rn);for(var i=0;i<ch.length;i++){if(!ch[i].tagName||ch[i].tagName.toLowerCase()!="t\u0064")continue;var ch2;ch2=this.getChildren(ch[i]);ch2[0].innerHTML=unescape(cells[i]);}rn.id=id;n.insertAdjacentElement(where,rn);return rn;};ScrollTable.prototype.getFirstRow=function(){return document.getElementById("\162\u005f"+this.firstRow);};ScrollTable.prototype.getLastRow=function(){return document.getElementById("\162_"+this.lastRow);};var scrollTable;ScrollTable.prototype.loadRemote=function(url){};function loadFromTable(srcId,sr,w,h,onScroll,fillUp,cw,ch,onClick){scrollTable=new ScrollTable(srcId,sr,w,h,onScroll,fillUp,cw,ch,onClick);scrollTable.init();scrollTable.adjustTable();}ScrollTable.prototype.findTb=function(t){var ch=t.children;var ie=ch!=null;var tb;if(!ie){for(var i=0;i<t.childNodes.length;i++){if(t.childNodes[i].nodeName.toLowerCase()=="\164b\157dy"){tb=t.childNodes[i];break;}}}else tb=ch[0];return tb;};ScrollTable.prototype.findRows=function(t){var tb=this.findTb(t);ch=tb.children;if(ch)return ch;return tb.childNodes;};ScrollTable.prototype.getChildren=function(p){if(p.children)return p.children;return p.childNodes;};ScrollTable.prototype.doReplace=function(s,s1,s2){var ss=s.toLowerCase();var i=0;var j;var res="";while(true){j=ss.indexOf(s1,i);if(j<0)break;res+=s.substring(i,j)+s2;i=j+s1.length;}res+=s.substring(i);return res;};
