// Title: Tigra Tables PRO
// URL: http://www.softcomplex.com/products/tigra_tables_pro/
// Version: 2.0
// Date: 11-11-2003 (mm-dd-yyyy)
// Technical Support: support@softcomplex.com (specify product title and order ID)
// Notes: Registration needed to use this script legally.
//	Visit official site for details.
// ----------------------------------------------------------------------------------
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,TTP0N){if(typeof(TTPJ)!='function')return TTPH+'';if(TTP0N)return TTPJ(TTP0N,TTPH);else return TTPJ('Y-m-d',TTPH)}function TCastCURRENCY(TTPH){return TTPH.replace(/[^0-9\-\.]/g,'')*1}function TTP0O(l,h){if(this.TTPc && !this.TTPc.length)return true;var TTP0P=this.TTP0Q[(h+l)>>1][this.TTPo.TTPp],i=l,TTPR=h,TTP0R=[];do{while(i<=h&&(this.TTP0Q[i][this.TTPo.TTPp]<TTP0P))i++;while(TTPR>=l&&(TTP0P<this.TTP0Q[TTPR][this.TTPo.TTPp]))TTPR--;if(i<=TTPR){TTP0R=this.TTPa[i];this.TTPa[i]=this.TTPa[TTPR];this.TTPa[TTPR]=TTP0R;TTP0R=this.TTP0Q[i];this.TTP0Q[i]=this.TTP0Q[TTPR];this.TTP0Q[TTPR]=TTP0R;i++;TTPR--}}while(i<TTPR);if(l<TTPR)this.TTP0S(l,TTPR);if(i<h)this.TTP0S(i,h)}function TTable(TTPY,TTPb,TTP0T){var TTPU=0,filters=['substring','match','regexp'],i,TTP0U=['main','captCell','captText','head','foot','pagnCell','pagnText','pagnPict','filtCell','filtPatt','filtSelc'];this.TTPY=[];this.TTP0V=[];this.TTPa=[];this.TTP0W=[],this.TTP0X=[];this.TTP0Q=[],this.TTPb=[],this.TTP0Y=0;this.TTP0Z=['Capt()','HdFt("head")','Body()','HdFt("foot")','Page()','Filt()'];this.id=TTablePRO.length;TTablePRO[this.id]=this;this.TTPl=null;this.TTPm='';this.TTPx='';this.TTPy='';this.TTP0a=[];this.TTP0b=[];this.TTP0J=[];this.changeCont=TTP0c;this.buildCapt=TTP0d;this.buildHdFt=TTP0e;this.buildBody=TTPP;this.buildPage=TTP0f;this.buildFilt=TTP0g;this.build=TTP0h;this.TTP02=TTPw;this.buildCell=TTP0i;this.exeSort=TTP0j;this.TTP0S=TTP0O;this.exePage=TTP0k;this.exeFilt=TTP0l;this.TTPt=TTP0m;this.TTPu=TTP0n;this.attachForm=TTP0o;this.TTP0p=TTPr;this.TTPe=[];this.TTP0q='';this.TTP0r=false;this.TTP0D=TTP0T.onclick;this.TTP0F=TTP0T.key||0;with(TTP0T){for(i in TTP0U)this.TTPe[TTP0U[i]]=css!=null&&css[TTP0U[i]]?' class="'+css[TTP0U[i]]+'"':'';this.TTPe.body=[];this.TTP0s=params[0]||0;this.TTP0t=params[1]||0;this.TTPX=colors||{};this.TTPv=structure;if(!paging)var paging=[];this.TTPT={'TTP19':paging.pf||'&laquo;&laquo;','TTP1A':paging.pp||'&laquo;','TTP1C':paging.pn||'&raquo;','TTP1D':paging.pl||'&raquo;&raquo;','TTP1B':paging.tt||'&nbsp;','TTP18':paging.sh,'TTPV':paging.by&&paging.by>0?paging.by:TTPb.length,'TTPU':0};if(!sorting)var sorting=[];this.TTPo={'s_as':sorting.as||'','s_ds':sorting.ds||'','s_no':sorting.no||'','TTPp':sorting.cl,'TTPq':sorting.or};this.btn_ok=filter.btn_ok||'filter';this.btn_no=filter.btn_no||'clear';this.TTP0u=filters;this.filter=filter.type;this.TTP0v=3;for(i=filters.length-1;i>=0;i--){if(!((1<<i)&filter.type)){this.TTP0u[i]=0;this.TTP0v--}else this.TTPn=i}if(this.filter==0)this.TTPn='';var TTP0w=freeze[0]*1,TTP0x=freeze[1]*1}this.TTP09=TTP0T.multy_mark;this.TTPW=TTPb.length-TTP0w-TTP0x;this.TTPd=TTPY.length;for(var i in TTPY){this.TTPe.body[i]=!TTP0T.css||!TTP0T.css.body?'':typeof(TTP0T.css.body)!='object'?TTP0T.css.body:TTP0T.css.body[i]?' class="'+TTP0T.css.body[i]+'"':'';this.TTP0W[i]={'name':TTPY[i].name.replace(/<[^>]+>/ig,'')};this.TTPY[i]={'name':TTPY[i].name,'TTP16':TTPY[i].hide_filter,'type':TTPY[i].type,'TTPZ':TTPY[i].hide,'TTP10':typeof(window['TCast'+TTPY[i].type])=='function'?window['TCast'+TTPY[i].type]:typeof(TTPY[i].type)=='function'?TTPY[i].type:function(TTPH){return TTPH},'f_css':typeof(TTPY[i].format)=='function'?TTPY[i].format:function(){return null}};if(TTPY[i].hide)this.TTP0Y++;if(TTPY[i].type==DATE){if(!this.TTP0r){this.TTP0y=(typeof(TTPB)=='function'?TTPB:function(TTPH){return TTPH+''});this.TTP0r=true};this.TTPY[i].format_input=TTPY[i].format_input||'';this.TTPY[i].format_output=TTPY[i].format_output||''}}for(i=0;i<TTPb.length;i++)for(TTPR=0;TTPR<TTPb[0].length;TTPR++)if(TTPb[i][TTPR]+''==''||TTPb[i][TTPR]==null)TTPb[i][TTPR]='&nbsp;';for(i=0;i<TTP0w;i++)this.TTP0V[i]=TTPb[TTPU++];for(i=0;i<this.TTPW;i++){this.TTP0Q[i]=[];for(var TTP0z=0;TTP0z<this.TTPd;TTP0z++){var TTPH=TTPb[TTPU][TTP0z]+'';if(this.TTPY[TTP0z]['type']==DATE){this.TTP0Q[i][TTP0z]=this.TTPY[TTP0z].TTP10(TTPH,this.TTPY[TTP0z].format_input);TTPb[i][TTP0z]=this.TTP0y(this.TTP0Q[i][TTP0z],this.TTPY[TTP0z].format_output)}else this.TTP0Q[i][TTP0z]=this.TTPY[TTP0z].TTP10(TTPH)}this.TTPa[i]=TTPb[TTPU++];this.TTPb[i]=this.TTP0Q[i];this.TTPa[i][this.TTPa[i].length]=i}for(i=0;i<TTP0x;i++)this.TTP0X[i]=TTPb[TTPU++];this.TTP0p()}function TTP0c(TTPb,TTP11){var TTPU=0;this.TTPb=[];this.TTP0Q=[];this.TTPa=[];this.TTP0a=[];this.TTPo.TTPp=null;this.TTPc=[];this.TTPT.TTPV=TTP11&&TTP11>0?TTP11:TTPb.length;this.TTPT.TTPU=0;if(this.TTPT.TTPV>TTPb.length)this.TTPT.TTPV=TTPb.length;this.TTPW=TTPb.length-this.TTP0V.length-this.TTP0X.length;for(i=0;i<TTPb.length;i++)for(TTPR=0;TTPR<TTPb[0].length;TTPR++)if(TTPb[i][TTPR]+''==''||TTPb[i][TTPR]==null)TTPb[i][TTPR]='&nbsp;';for(i=0;i<this.TTP0V.length;i++)this.TTP0V[i]=TTPb[TTPU++];for(i=0;i<this.TTPW;i++){this.TTP0Q[i]=[];this.TTPa[i]=[];for(var TTP0z=0;TTP0z<this.TTPd;TTP0z++){var TTPH=TTPb[TTPU][TTP0z]+'';if(this.TTPY[TTP0z]['type']==DATE){this.TTP0Q[i][TTP0z]=this.TTPY[TTP0z].TTP10(TTPH,this.TTPY[TTP0z].format_input);TTPb[i][TTP0z]=this.TTP0y(this.TTP0Q[i][TTP0z],this.TTPY[TTP0z].format_output)}else this.TTP0Q[i][TTP0z]=this.TTPY[TTP0z].TTP10(TTPH);this.TTPa[i][TTP0z]=TTPb[TTPU][TTP0z]}TTPU++;this.TTPb[i]=this.TTP0Q[i];this.TTPa[i][this.TTPa[i].length]=i}for(i=0;i<this.TTP0X.length;i++)this.TTP0X[i]=TTPb[TTPU++];this.TTP02()}function TTP0d(){var TTP06=['<tr>'],i,TTP12,TTP13,TTP14=1;for(i in this.TTPY)if(!this.TTPY[i].TTPZ)if(this.TTPY[i].type){TTP12=Boolean(this.TTPo.TTPp==i&&this.TTPo.TTPq!=1);TTP13=this.TTPo[this.TTPo.TTPp!=i?'s_no':this.TTPo.TTPq?'s_ds':'s_as'];TTP15='TTablePRO['+this.id+'].exeSort('+i+','+TTP12+')';TTP06[TTP14++]=this.buildCell(['<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr valign="middle">','<td width="99%"',this.TTPe.captText,'><a title="Sort this column" href="javascript:',TTP15,'"',this.TTPe.captText,'>',this.TTPY[i].name,'</a></td><td><a href="javascript:',TTP15,'">',TTP13,'</a></td></tr></table>'].join(''),this.TTPe.captCell)}else TTP06[TTP14++]=this.buildCell(['<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr valign="middle"><td width="99%"',this.TTPe.captText,'>',this.TTPY[i].name,'</td></tr></table>'].join(''),this.TTPe.captCell);TTP06[TTP14++]='</tr>';return TTP06.join('')}function TTP0g(){if(this.TTP0q)return this.TTP0q;if(this.TTP0v==0)return '';var TTP06=['<tr><td',this.TTPe.filtCell,' colspan="',this.TTPd-this.TTP0Y,'" ><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.TTPe.filtCell,' align=right nowrap>use <input',this.TTPe.filtPatt,' type="text" name="filtPatt" size="10',this.TTPm?'" value="'+this.TTPm:'','"> as '],TTP14=13;if(this.TTP0v>1){TTP06[TTP14++]='<select'+this.TTPe.filtSelc+' name="filtType">';for(var i=0;i<this.TTP0u.length;i++)if(this.TTP0u[i])TTP06[TTP14++]=['<option value=',i,(i==this.TTPn*1?' selected':''),">",this.TTP0u[i]].join('');TTP06[TTP14++]="</select>"}else TTP06[TTP14++]=this.TTP0u[this.TTPn];TTP06[TTP14++]=' on column <select'+this.TTPe.filtSelc+' name="filtCol">';for(var i in this.TTPY)if(!this.TTPY[i].TTPZ&&!this.TTPY[i].TTP16)TTP06[TTP14++]='<option value='+i+(this.TTPl*1==i?' selected':'')+">"+this.TTP0W[i].name;TTP06[TTP14++]='</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.TTP0q=TTP06.join('');return this.TTP0q}function TTP0f(){var TTP17=Math.ceil(this.TTPW/this.TTPT.TTPV)-1;if(TTP17<=0&&!this.TTPT.TTP18)return '';var TTP06=['<tr><td colspan=',this.TTPd-this.TTP0Y,this.TTPe.pagnCell,'><table cellspacing="0" cellpadding="0" border="0" width="100%"><tr>'],TTP14=4;this.TTPT.TTPU=this.TTPT.TTPU*1;var TTPH='<td nowrap><a'+this.TTPe.pagnPict+' href="javascript:TTablePRO['+this.id+'].exePage(';if(this.TTPT.TTPU>0){if(this.TTPT.TTP19)TTP06[TTP14++]=TTPH+'0)" title="First page">'+this.TTPT.TTP19+'</a></td>';if(this.TTPT.TTP1A)TTP06[TTP14++]=TTPH+(this.TTPT.TTPU-1)+')" title="Previous page">'+this.TTPT.TTP1A+'</a></td>'}TTP06[TTP14++]='<td width="99%"'+this.TTPe.pagnText+'>'+this.TTPT.TTP1B.replace('%ind',this.TTPT.TTPU+1).replace('%pgs',TTP17+1).replace('%rcs',this.TTPW)+'</td>';if(this.TTPT.TTPU<TTP17){if(this.TTPT.TTP1C)TTP06[TTP14++]=TTPH+(this.TTPT.TTPU+1)+')" title="Next page">'+this.TTPT.TTP1C+'</a></td>';if(this.TTPT.TTP1D)TTP06[TTP14++]=TTPH+TTP17+')" title="Last page">'+this.TTPT.TTP1D+'</a></td>'}TTP06[TTP14++]='</tr></table></td></tr>';return TTP06.join('')}function TTP0i(value,TTP1E,TTP1F){return '<td'+TTP1E+(TTP1F?' '+TTP1F:'')+'>'+value+'</td>'}function TTP0e(TTP1G){var TTPH='',i,TTPR,TTP06={'head':this.TTP0V,'foot':this.TTP0X};;for(i in TTP06[TTP1G]){TTPH+='<tr>';for(TTPR in this.TTPY)if(!this.TTPY[TTPR].TTPZ)TTPH+=this.buildCell(TTP06[TTP1G][i][TTPR],this.TTPe[TTP1G]);TTPH+='</tr>'}return TTPH}function TTP0h(){var i,TTPH="<table cellpadding="+this.TTP0s+" cellspacing="+this.TTP0t+this.TTPe.main+" width=100% border=0>";for(i in this.TTPv)TTPH+=eval('this.build'+this.TTP0Z[this.TTPv[i]]);TTPH+="</table>";return TTPH}function TTP0o(TTP1H,filtCol,filtPatt,filtType){this.TTP1H=TTP1H;this.filtCol=TTP1H.elements[filtCol];this.filtPatt=TTP1H.elements[filtPatt];this.filtType=TTP1H.elements[filtType]}function TTP0l(TTP1I){if(TTP1I){if(!this.TTP1H)return false;this.TTPl=!this.filtCol?0:this.filtCol.type.indexOf('select-')>-1?this.filtCol.options[this.filtCol.selectedIndex].value:this.filtCol.value;this.TTPm=this.filtPatt.value;this.TTPn=this.filtType&&this.filtType.type.indexOf('select-')>-1?this.filtType.options[this.filtType.selectedIndex].value:this.TTPn}else{this.TTPl=null;this.TTPm=''}this.TTPT.TTPU=0;this.TTP02();return false}function TTP0k(TTPV){this.TTPT.TTPU=TTPV;this.TTP02()}function TTP0j(TTPp,TTP1J){var TTP05=this.TTPo.TTPp;this.TTPo.TTPp=TTPp;this.TTPo.TTPq=TTP1J;this.TTPT.TTPU=0;this.TTP02(true,TTP05)}function TTP0n(TTP05){var i,TTPR=0;if(TTP05==this.TTPo.TTPp){this.TTPa=this.TTPa.reverse();this.TTP0Q=this.TTP0Q.reverse()}else{if(!this.TTP0a[this.TTPo.TTPp]){this.TTP0S(0,this.TTP0Q.length-1);this.TTP0a[this.TTPo.TTPp]=[];this.TTP0b[this.TTPo.TTPp]=[];for(i=0;i<this.TTPa.length;i++){this.TTP0a[this.TTPo.TTPp][i]=this.TTPa[i];this.TTP0b[this.TTPo.TTPp][i]=this.TTP0Q[i]}this.TTP0a[this.TTPo.TTPp]['TTPq']=this.TTPo.TTPq}else{if(this.TTP0a[this.TTPo.TTPp]['TTPq']!=this.TTPo.TTPq){this.TTPa=this.TTP0a[this.TTPo.TTPp].reverse();this.TTP0Q=this.TTP0b[this.TTPo.TTPp].reverse()}else{this.TTPa=this.TTP0a[this.TTPo.TTPp];this.TTP0Q=this.TTP0b[this.TTPo.TTPp]}}if(this.TTPo.TTPq){this.TTPa=this.TTPa.reverse();this.TTP0Q=this.TTP0Q.reverse()}}}function TTP0m(){if(!this.TTPm||this.TTPl==null)return this.TTPa;var TTPa=[],TTPH;if(this.TTPn==2)var TTP1K=eval('/'+this.TTPm+'/');for(i=0;i<this.TTPa.length;i++){if(this.TTPY[this.TTPl]==DATE)TTPH=this.TTPa[i][this.TTPl]+'';else TTPH=this.TTP0Q[i][this.TTPl]+'';if((this.TTPn==2&&TTPH.search(TTP1K)!=-1)||(this.TTPn==1&&TTPH==this.TTPm)||(this.TTPn==0&&TTPH.indexOf(this.TTPm)!=-1))TTPa[TTPa.length]=this.TTPa[i]}return TTPa}d.write('<SC','RIPT LANGUAGE="JavaScript" src="',path_to_files,'table.do.',d.implementation||d.styleSheets?'ok':'no','.js"></SCR','IPT>')

