// Title: Tigra Tables PRO
// URL: http://www.softcomplex.com/products/tigra_tables_pro/
// Version: 2.1
// Date: 03-09-2004 (mm-dd-yyyy)
// Notes: Registration needed to use this script legally.
//	Visit official site for details.
// ----------------------------------------------------------------------------------

//Code prepared by Tigra Javascript Scrambler version 1.0 (http://www.softcomplex.com/)

var path_to_files='ttp_files/';var d=document,TTablePRO=[],NUM='NUM',STR='STR',DATE='DATE',CURRENCY='CURRENCY';function TCastSTR(TTPH){return TTPH.replace(/<[^>]+>/ig,'')+'';}function TCastNUM(TTPH){if(isNaN(TTPH*1))return 0;else return TTPH*1;}function TCastDATE(TTPH,TTPP){if(typeof(TTPJ)!='function')return TTPH+'';if(TTPP)return TTPJ(TTPP,TTPH);else return TTPJ('Y-m-d',TTPH);}function TCastCURRENCY(TTPH){return TTPH.replace(/[^0-9\-\.]/g,'')*1;}function TTPQ(l,h){if(this.TTPR&&!this.TTPR.length)return true;var x=this.TTPS[(h+l)>>1][this.TTPT.TTPU],i=l,TTPV=h,TTPW=[];do{while(i<=h&&(this.TTPS[i][this.TTPT.TTPU]<x))i++;while(TTPV>=l&&(x<this.TTPS[TTPV][this.TTPT.TTPU]))TTPV--;if(i<=TTPV){TTPW=this.TTPX[i];this.TTPX[i]=this.TTPX[TTPV];this.TTPX[TTPV]=TTPW;TTPW=this.TTPS[i];this.TTPS[i]=this.TTPS[TTPV];this.TTPS[TTPV]=TTPW;i++;TTPV--}}while(i<TTPV);if(l<TTPV)this.TTPY(l,TTPV);if(i<h)this.TTPY(i,h);}function TTable(TTPZ,TTP_,TTPa){var TTPb=0,filters=['substring','match','regexp','substr case ins'],i,TTPc=['main','captCell','captText','head','foot','pagnCell','pagnText','pagnPict','filtCell','filtPatt','filtSelc'];this.TTPZ=[];this.TTPd=[];this.TTPX=[];this.TTPe=[],this.TTPf=[];this.TTPS=[],this.TTP_=[],this.TTPg=0;this.TTPh=['Capt()','HdFt("head")','Body()','HdFt("foot")','Page()','Filt()'];this.id=TTablePRO.length;TTablePRO[this.id]=this;this.TTPi=null;this.TTPj='';this.TTPk='';this.TTPl='';this.TTPm=[];this.TTPn=[];this.TTPo=[];this.TTPp='';this.TTPq=0;this.changeCont=TTPr;this.buildCapt=TTPs;this.buildHdFt=TTPt;this.buildBody=TTPu;this.buildPage=TTPv;this.buildFilt=TTPw;this.build=TTPx;this.TTPy=TTPz;this.buildCell=TTP00;this.exeSort=TTP01;this.TTPY=TTPQ;this.exePage=TTP02;this.exeFilt=TTP03;this.TTP04=TTP05;this.TTP06=TTP07;this.attachForm=TTP08;this.go=TTP09;this.TTP0A=[];this.TTP0B='';this.TTP0C=false;this.TTP0D=TTPa.onclick;this.TTP0E=TTPa.key||0;with(TTPa){for(i in TTPc)this.TTP0A[TTPc[i]]=css!=null&&css[TTPc[i]]?' class="'+css[TTPc[i]]+'"':'';this.TTP0A.body=[];this.TTP0F=params[0]||0;this.TTP0G=params[1]||0;this.TTP0H=colors||{};this.TTP0I=structure;if(!paging)var paging=[];this.TTP0J={'TTP0j':paging.pf||'First&nbsp;Page','TTP0k':paging.pp||'&laquo;','TTP0m':paging.pn||'&raquo;','TTP0n':paging.pl||'Last&nbsp;Page','TTP0l':paging.tt||'&nbsp;','TTP0i':paging.sh,'TTP0Y':paging.by&&paging.by>0?paging.by:TTP_.length,'TTPb':0};if(!sorting)var sorting=[];this.TTPT={'s_as':sorting.as||'','s_ds':sorting.ds||'','s_no':sorting.no||'','TTPU':sorting.cl,'TTP0e':sorting.or};this.btn_ok=filter.btn_ok||'filter';this.btn_no=filter.btn_no||'clear';this.TTP0K=filters;this.filter=filter.type;this.TTP0L=4;for(i=filters.length-1;i>=0;i--){if(!((1<<i)&filter.type)){this.TTP0K[i]=0;this.TTP0L--;}else this.TTP0M=i;}if(this.filter==0)this.TTP0M='';var TTP0N=freeze[0]*1,TTP0O=freeze[1]*1;}this.TTP0P=TTPa.multy_mark;this.TTP0Q=TTP_.length-TTP0N-TTP0O;this.TTP0R=TTPZ.length;for(var i in TTPZ){this.TTP0A.body[i]=!TTPa.css||!TTPa.css.body?'':typeof(TTPa.css.body)!='object'?TTPa.css.body:TTPa.css.body[i]?' class="'+TTPa.css.body[i]+'"':'';this.TTPe[i]={'name':TTPZ[i].name.replace(/<[^>]+>/ig,'')};this.TTPZ[i]={'name':TTPZ[i].name,'TTP0g':TTPZ[i].TTP0S,'type':TTPZ[i].type,'TTP0d':TTPZ[i].hide,'TTP0W':typeof(window['TCast'+TTPZ[i].type])=='function'?window['TCast'+TTPZ[i].type]:typeof(TTPZ[i].type)=='function'?TTPZ[i].type:function(TTPH){return TTPH},'f_css':typeof(TTPZ[i].format)=='function'?TTPZ[i].format:function(){return null}};if(TTPZ[i].hide)this.TTPg++;if(TTPZ[i].type==DATE){if(!this.TTP0C){this.TTP0T=(typeof(TTPB)=='function'?TTPB:function(TTPH){return TTPH+'';});this.TTP0C=true;};this.TTPZ[i].format_input=TTPZ[i].format_input||'';this.TTPZ[i].format_output=TTPZ[i].format_output||'';}}for(i=0;i<TTP_.length;i++)for(TTPV=0;TTPV<TTP_[0].length;TTPV++)if(TTP_[i][TTPV]+''==''||TTP_[i][TTPV]==null)TTP_[i][TTPV]='&nbsp;';var TTP0U=[];for(i=0;i<TTP_.length;i++){TTP0U=[];for(var TTP0V=0;TTP0V<this.TTP0R;TTP0V++){var TTPH=TTP_[i][TTP0V]+'';if(this.TTPZ[TTP0V]['type']==DATE){TTP0U[TTP0V]=this.TTPZ[TTP0V].TTP0W(TTPH,this.TTPZ[TTP0V].format_input);TTP_[i][TTP0V]=this.TTP0T(TTP0U[TTP0V],this.TTPZ[TTP0V].format_output);}else TTP0U[TTP0V]=this.TTPZ[TTP0V].TTP0W(TTPH);}if(i<TTP0N){this.TTPd[this.TTPd.length]=TTP_[i];}else if(i>=TTP0N&&i<TTP0N+this.TTP0Q){this.TTPS[(i-TTP0N)]=TTP0U;this.TTPX[(i-TTP0N)]=TTP_[i];this.TTP_[(i-TTP0N)]=this.TTPS[(i-TTP0N)];this.TTPX[(i-TTP0N)][this.TTPX[(i-TTP0N)].length]=(i-TTP0N);}else{this.TTPf[this.TTPf.length]=TTP_[i];}}this.go();}function TTPr(TTP_,TTPq){var TTPb=0;if(!d.implementation&&!d.styleSheets&&!this.TTPp){this.TTPp=TTP_;this.TTPq=TTPq;TTP0X(this.id);return;}TTP_=window[TTP_];this.TTP_=[];this.TTPS=[];this.TTPX=[];this.TTPm=[];this.TTPT.TTPU=null;this.TTPR=[];this.TTP0J.TTP0Y=TTPq&&TTPq>0?TTPq:TTP_.length;this.TTP0J.TTPb=0;if(this.TTP0J.TTP0Y>TTP_.length)this.TTP0J.TTP0Y=TTP_.length;this.TTP0Q=TTP_.length-this.TTPd.length-this.TTPf.length;for(i=0;i<TTP_.length;i++)for(TTPV=0;TTPV<TTP_[0].length;TTPV++)if(TTP_[i][TTPV]+''==''||TTP_[i][TTPV]==null)TTP_[i][TTPV]='&nbsp;';for(i=0;i<this.TTPd.length;i++)this.TTPd[i]=TTP_[TTPb++];for(i=0;i<this.TTP0Q;i++){this.TTPS[i]=[];this.TTPX[i]=[];for(var TTP0V=0;TTP0V<this.TTP0R;TTP0V++){var TTPH=TTP_[TTPb][TTP0V]+'';var TTP0Z=0;if(this.TTPZ[TTP0V]['type']==DATE){this.TTPS[i][TTP0V]=this.TTPZ[TTP0V].TTP0W(TTPH,this.TTPZ[TTP0V].format_input);TTP0Z=this.TTP0T(this.TTPS[i][TTP0V],this.TTPZ[TTP0V].format_output);}else this.TTPS[i][TTP0V]=this.TTPZ[TTP0V].TTP0W(TTPH);this.TTPX[i][TTP0V]=TTP0Z?TTP0Z:TTP_[i][TTP0V];}TTPb++;this.TTP_[i]=this.TTPS[i];this.TTPX[i][this.TTPX[i].length]=i;}for(i=0;i<this.TTPf.length;i++)this.TTPf[i]=TTP_[TTPb++];if(d.implementation||d.styleSheets)this.TTPy();}function TTPs(){var TTP0_=['<tr>'],i,TTP0a,TTP0b,TTP0c=1;for(i in this.TTPZ)if(!this.TTPZ[i].TTP0d)if(this.TTPZ[i].type){TTP0a=Boolean(this.TTPT.TTPU==i&&this.TTPT.TTP0e!=1);TTP0b=this.TTPT[this.TTPT.TTPU!=i?'s_no':this.TTPT.TTP0e?'s_ds':'s_as'];TTP0f='TTablePRO['+this.id+'].exeSort('+i+','+TTP0a+')';TTP0_[TTP0c++]=this.buildCell(['<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr valign="middle">','<td width="99%"',this.TTP0A.captText,'><a title="Sort this column" href="javascript:',TTP0f,'"',this.TTP0A.captText,'>',this.TTPZ[i].name,'</a></td><td><a href="javascript:',TTP0f,'">',TTP0b,'</a></td></tr></table>'].join(''),this.TTP0A.captCell);}else TTP0_[TTP0c++]=this.buildCell(['<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr valign="middle"><td width="99%"',this.TTP0A.captText,'>',this.TTPZ[i].name,'</td></tr></table>'].join(''),this.TTP0A.captCell);TTP0_[TTP0c++]='</tr>';return TTP0_.join('');}function TTPw(){if(this.TTP0B)return this.TTP0B;if(this.TTP0L==0)return'';var TTP0_=['<tr><td',this.TTP0A.filtCell,' colspan="',this.TTP0R-this.TTPg,'" ><form id="TTForm'+this.id+'" name="TTForm'+this.id+'" onsubmit="return TTablePRO[',this.id,'].exeFilt(1);"><table border=0 cellpadding=0 cellspacing=0 width=100%><tr><td',this.TTP0A.filtCell,' align=right nowrap>use <input',this.TTP0A.filtPatt,' type="text" name="filtPatt" size="10',this.TTPj?'" value="'+this.TTPj:'','"> as '],TTP0c=13;if(this.TTP0L>1){TTP0_[TTP0c++]='<select'+this.TTP0A.filtSelc+' name="filtType">';for(var i=0;i<this.TTP0K.length;i++)if(this.TTP0K[i])TTP0_[TTP0c++]=['<option value=',i,(i==this.TTP0M*1?' selected':''),">",this.TTP0K[i]].join('');TTP0_[TTP0c++]="</select>";}else TTP0_[TTP0c++]=this.TTP0K[this.TTP0M];TTP0_[TTP0c++]=' on column <select'+this.TTP0A.filtSelc+' name="filtCol">';for(var i in this.TTPZ)if(!this.TTPZ[i].TTP0d&&!this.TTPZ[i].TTP0g)TTP0_[TTP0c++]='<option value='+i+(this.TTPi*1==i?' selected':'')+">"+this.TTPe[i].name;TTP0_[TTP0c++]='</select><a href="#" onclick="javascript:TTablePRO['+this.id+'].exeFilt(1)">'+this.btn_ok+'</a> <a href="#" onclick="javascript:TTablePRO['+this.id+'].exeFilt()">'+this.btn_no+'</a></td></tr></table></td></form></tr>';this.TTP0B=TTP0_.join('');return this.TTP0B;}function TTPv(){var TTP0h=Math.ceil(this.TTP0Q/this.TTP0J.TTP0Y)-1;if(TTP0h<=0&&!this.TTP0J.TTP0i)return'';var TTP0_=['<tr><td colspan=',this.TTP0R-this.TTPg,this.TTP0A.pagnCell,'><table cellspacing="0" cellpadding="0" border="0" width="100%"><tr>'],TTP0c=4;this.TTP0J.TTPb=this.TTP0J.TTPb*1;var TTPH='<td nowrap><a'+this.TTP0A.pagnPict+' href="javascript:TTablePRO['+this.id+'].exePage(';if(this.TTP0J.TTPb>0){if(this.TTP0J.TTP0j)TTP0_[TTP0c++]=TTPH+'0)" title="First page">'+this.TTP0J.TTP0j+'</a>&nbsp;</td>';if(this.TTP0J.TTP0k)TTP0_[TTP0c++]=TTPH+(this.TTP0J.TTPb-1)+')" title="Previous page">'+this.TTP0J.TTP0k+'</a></td>';}TTP0_[TTP0c++]='<td width="99%"'+this.TTP0A.pagnText+'>'+this.TTP0J.TTP0l.replace('%ind',this.TTP0J.TTPb+1).replace('%pgs',TTP0h+1).replace('%rcs',this.TTP0Q)+'</td>';if(this.TTP0J.TTPb<TTP0h){if(this.TTP0J.TTP0m)TTP0_[TTP0c++]=TTPH+(this.TTP0J.TTPb+1)+')" title="Next page">'+this.TTP0J.TTP0m+'</a>&nbsp;</td>';if(this.TTP0J.TTP0n)TTP0_[TTP0c++]=TTPH+TTP0h+')" title="Last page">'+this.TTP0J.TTP0n+'</a></td>';}TTP0_[TTP0c++]='</tr></table></td></tr>';return TTP0_.join('');}function TTP00(value,TTP0o,TTP0p){return'<td'+TTP0o+(TTP0p?' '+TTP0p:'')+'>'+value+'</td>';}function TTPt(TTP0q){var TTPH='',i,TTPV,TTP0_={'head':this.TTPd,'foot':this.TTPf};;for(i in TTP0_[TTP0q]){TTPH+='<tr>';for(TTPV in this.TTPZ)if(!this.TTPZ[TTPV].TTP0d)TTPH+=this.buildCell(TTP0_[TTP0q][i][TTPV],this.TTP0A[TTP0q]);TTPH+='</tr>';}return TTPH;}function TTPx(){var i,TTPH="<table cellpadding="+this.TTP0F+" cellspacing="+this.TTP0G+this.TTP0A.main+" width=100% border=0>";for(i in this.TTP0I)TTPH+=eval('this.build'+this.TTPh[this.TTP0I[i]]);TTPH+="</table>";return TTPH;}function TTP08(TTP0r,filtCol,filtPatt,filtType){this.TTP0r=TTP0r;this.filtCol=TTP0r.elements[filtCol];this.filtPatt=TTP0r.elements[filtPatt];this.filtType=TTP0r.elements[filtType];}function TTP03(TTP0s){if(TTP0s){if(!this.TTP0r)return false;this.TTPi=!this.filtCol?0:this.filtCol.type.indexOf('select-')>-1?this.filtCol.options[this.filtCol.selectedIndex].value:this.filtCol.value;this.TTPj=this.filtPatt.value;this.TTP0M=this.filtType&&this.filtType.type.indexOf('select-')>-1?this.filtType.options[this.filtType.selectedIndex].value:this.TTP0M;}else{this.TTPi=null;this.TTPj='';}this.TTP0J.TTPb=0;this.TTPy();return false;}function TTP02(TTP0Y){this.TTP0J.TTPb=TTP0Y;this.TTPy();}function TTP01(TTPU,TTP0t){var TTP0u=this.TTPT.TTPU;this.TTPT.TTPU=TTPU;this.TTPT.TTP0e=TTP0t;this.TTP0J.TTPb=0;this.TTPy(true,TTP0u);}function TTP07(TTP0u){var i,TTPV=0;if(TTP0u==this.TTPT.TTPU){this.TTPX=this.TTPX.reverse();this.TTPS=this.TTPS.reverse();}else{if(!this.TTPm[this.TTPT.TTPU]){this.TTPY(0,this.TTPS.length-1);this.TTPm[this.TTPT.TTPU]=[];this.TTPn[this.TTPT.TTPU]=[];for(i=0;i<this.TTPX.length;i++){this.TTPm[this.TTPT.TTPU][i]=this.TTPX[i];this.TTPn[this.TTPT.TTPU][i]=this.TTPS[i];}this.TTPm[this.TTPT.TTPU]['TTP0e']=this.TTPT.TTP0e;}else{if(this.TTPm[this.TTPT.TTPU]['TTP0e']!=this.TTPT.TTP0e){this.TTPX=this.TTPm[this.TTPT.TTPU].reverse();this.TTPS=this.TTPn[this.TTPT.TTPU].reverse();}else{this.TTPX=this.TTPm[this.TTPT.TTPU];this.TTPS=this.TTPn[this.TTPT.TTPU];}}if(this.TTPT.TTP0e){this.TTPX=this.TTPX.reverse();this.TTPS=this.TTPS.reverse();}}}function TTP05(){if(!this.TTPj||this.TTPi==null)return this.TTPX;var TTPX=[],TTPH;if(this.TTP0M==2)var TTP0v=eval('/'+this.TTPj+'/');for(i=0;i<this.TTPX.length;i++){if(this.TTPZ[this.TTPi]==DATE)TTPH=this.TTPX[i][this.TTPi]+'';else TTPH=this.TTPS[i][this.TTPi]+'';if((this.TTP0M==2&&TTPH.search(TTP0v)!=-1)||(this.TTP0M==1&&TTPH==this.TTPj)||(this.TTP0M==0&&TTPH.indexOf(this.TTPj)!=-1))TTPX[TTPX.length]=this.TTPX[i];}return TTPX;}d.write('<SC','RIPT LANGUAGE="JavaScript" src="',path_to_files,'table.do.',d.implementation||d.styleSheets?'ok':'no','.js"></SCR','IPT>')