AW.Formats.XMLString=AW.System.Format.subclass();AW.Formats.XMLString.create=function(){var jrz=this.prototype;var qqc=this.superclass.prototype;jrz.init=function(){qqc.init.call(this);};jrz.dataToText=function(cntb){return(lkgb(cntb));};jrz.dataToValue=function(cntb){return(this.dataToText(cntb).toLowerCase());};jrz.comparator=jwh;};function lgp(vdbb,rrdb,bcz,fxb,cnl,rnl,ctd){var cng=new AW.UI.SUBasicGrid(vdbb,rrdb,bcz);if(cng!=undefined){if(ctd!=true){cng.m_XMLTable=new AW.XML.GridTable(cnl);cng.setCellModel(cng.m_XMLTable);}cng.onRowDoubleClicked=rnl;cng.refresh();if((typeof(fxb)!="undefined")&&(fxb!="")){cng.setTimeout(function(){this.Update(fxb,true);},0);}}return(cng);}function tbv(cng){var element=document.getElementById(cng.getId());element.style.backgroundPosition="50%";element.style.backgroundRepeat="no-repeat";element.style.backgroundImage="url("+rngb+"BusyGrid.gif)";}AW.XML.GridTable=AW.XML.Table.subclass();AW.XML.GridTable.create=function(){var jrz=this.prototype;var qqc=this.superclass.prototype;jrz.init=function(cnl){qqc.init.call(this);if((typeof(cnl)!="undefined")&&(cnl!=""))this.setTable("//"+cnl);};jrz.responseDef=jrz.response;jrz.response=function(llpb){var yyz=true;if((this.$owner)&&(typeof(this.$owner.PreUpdate)!="undefined"))yyz=this.$owner.PreUpdate();if(yyz){this.responseDef(llpb);if(this.$owner.m_bFilterMode)this.$owner.FilterGrid(this.$owner.m_sSearchVal,this.$owner.m_nColPos,true,this.$owner.m_bAllowEmpty);if((this.$owner)&&(typeof(this.$owner.PostUpdate)!="undefined"))this.$owner.PostUpdate();}};jrz.requestDef=jrz.request;jrz.request=function(ntfb){if((this.$owner)&&(ntfb))tbv(this.$owner);this.requestDef();};jrz.setData=function(nfrb,cny,vrn){var ycf=this.getNode(cny,vrn);nfrb=encodeURIComponent(nfrb);if(AW.ie)ycf.text=nfrb;else ycf.textContent=nfrb;};jrz.setURLDef=jrz.setURL;jrz.setURL=function(lhr){var nfb=new Date();this.setURLDef(kwr+lhr+"&sync="+nfb.getTime());};jrz.selectNodes=function(spn,xyw){var ykr=new Array();if(xyw==undefined)xyw=this.getXML();if(AW.ie){var fljb=xyw.selectNodes(spn);for(var lpf=0;lpf<fljb.length;lpf++)ykr[lpf]=fljb[lpf];}else{var lpf=0;var fljb=this.getXML().evaluate(spn,xyw,null,XPathResult.ANY_TYPE,null);var jnm=fljb.iterateNext();while(jnm){ykr[lpf++]=jnm;jnm=fljb.iterateNext();}}return(ykr);};};AW.UI.SUBasicGrid=AW.UI.Grid.subclass();AW.UI.SUBasicGrid.create=function(){var jrz=this.prototype;var qqc=this.superclass.prototype;jrz.init=function(vdbb,rrdb,bcz){qqc.init.call(this);this.setId(vdbb);this.setHeaderText(rrdb);this.setColumnCount(rrdb.length);this.setSelectionMode("multi-row");this.setSelectionMultiple(true);this.setStyle("width","100%");this.setStyle("height","297");this.setCellTemplate(new AW.Templates.ImageText,0);this.setStyle("position","static");var gbm=new Array();for(var lpf=0;lpf<bcz.length;lpf++){gbm[lpf]=new AW.Formats.XMLString;this.setColumnWidth(bcz[lpf],lpf);}this.setCellFormat(gbm);this.m_dateLastSearch=0;this.m_sSearchStr="";};jrz.UpdateText=function(zyy,cny,vrn){this.m_XMLTable.setData(zyy,cny,vrn);this.setCellText(undefined,cny,vrn);};jrz.Update=function(lhr,ntfb,pnqb){qrpb=false;this.setCellModel(this.m_XMLTable);this.m_bKeepState=(pnqb)?true:false;this.m_XMLTable.setURL(lhr);this.m_XMLTable.request(ntfb);};jrz.PreUpdate=function(){this.m_nSortCol=this.getSortColumn();this.m_sSortDir=this.getSortDirection(this.m_nSortCol);if(typeof(this.m_fnPreUpdate)!="undefined")this.m_fnPreUpdate.call(this);return(true);};jrz.PostUpdate=function(){this.setVirtualMode(this.getRowCount()>=100);if(this.m_nSortCol>=0)this.sort(this.m_nSortCol,this.m_sSortDir);this.ResetCurrentRow();if(typeof(this.m_fnPostUpdate)!="undefined"){this.m_fnPostUpdate.call(this);}};jrz.ResetCurrentRow=function(){this.getRowIndices()?this.setCurrentRow(this.getRowIndices()[0]):this.setCurrentRow(0);this.setScrollTop(0);};jrz.setCellModelDef=jrz.setCellModel;jrz.setCellModel=function(dzcb){this.setCellModelDef.call(this,dzcb);function ycsb(hntb,hdn){var cntb=this.getCellData(hntb,hdn);var jmy=this.getCellFormat(hntb,hdn);return jmy?jmy.dataToText(cntb,this,hntb,hdn):cntb;};function kgd(hntb,hdn){var cntb=this.getCellData(hntb,hdn);var jmy=this.getCellFormat(hntb,hdn);return jmy?jmy.dataToValue(cntb,this,hntb,hdn):cntb;};this.setCellText(ycsb);this.setCellValue(kgd);};jrz.onHeaderClicked=function(Event,lpf){var nky;if((lpf==this.getSortColumn())&&((nky=this.getRowIndices())!="")){this.setSortDirection((this.getSortDirection(lpf)=="ascending")?"descending":"ascending",lpf);nky.reverse();this.setRowIndices(nky);return(true);}else return(false);};jrz.setEvent("onkeydown",function(event){var vkh=String.fromCharCode(event.keyCode||event.charCode);if(vkh.toUpperCase()=="A"&&event.ctrlKey&&this.getSelectionMode()=="multi-row"){this.setRowSelected(true);this.setRowState("selected");var hntb,vlsb=[],qjtb=this.getRowCount();for(hntb=0;hntb<qjtb;hntb++){vlsb.push(hntb);}this.setSelectedRows(vlsb);}});jrz.onKeyPress=function(event){var jd=String.fromCharCode(event.keyCode||event.charCode).toLocaleLowerCase();var rtfb=new Date().getTime();var lfv=this.getSortColumn();var gqz=this.getCellFormat(lfv);if((jd!="")&&(lfv>=0)&&((!gqz)||(gqz.dataToValue("&",this,lfv,0)!="0"))){var gzx=this.getRowIndices();var dgw=0,sfj=this.getCurrentRow();var tfk=false;var fdj="";if(sfj>=0){for(var lpf in gzx){if(gzx[lpf]==sfj){dgw=parseInt(lpf);break;}}}if((rtfb-this.m_dateLastSearch)>750){this.m_sSearchStr=jd;if(dgw)dgw++;}else this.m_sSearchStr+=jd;this.m_dateLastSearch=rtfb;if((!this.ItemSearch(this.m_sSearchStr,lfv,gzx,dgw,this.getRowCount()))&&(dgw>0))this.ItemSearch(this.m_sSearchStr,lfv,gzx,0,dgw);}else{this.m_sSearchStr="";this.m_dateLastSearch=0;}};jrz.ItemSearch=function(mplb,lfv,gzx,tkkb,zbwb){var tfk=false;for(var lpf=tkkb;lpf<zbwb;lpf++){var fdj=this.getCellText(lfv,gzx[lpf]).substring(0,mplb.length).toLocaleLowerCase();if(fdj==mplb){this.setSelectedRows([gzx[lpf]]);this.setCurrentRow(gzx[lpf]);tfk=true;break;}}return(tfk);};};function jwh(ywjb,qhlb,ltcb,equal,ptgb){return(function(hntb,hdn){try{var xc=ywjb[hntb];var twnb=ywjb[hdn];var smmb=false;var fcvb;if(isNaN(xc)&&isNaN(twnb)){xc=xc.toLocaleLowerCase();twnb=twnb.toLocaleLowerCase();fcvb=xc.localeCompare(twnb);}else smmb=true;if(!smmb){if(fcvb>0){return qhlb}if(fcvb<0){return ltcb}return equal(hntb,hdn);}else{if(xc>twnb){return qhlb}if(xc<twnb){return ltcb}return equal(hntb,hdn);}}catch(jtz){return ptgb(hntb,hdn,jtz);}});}
