// Product title: Gurt JavaScript Table
// Product version details: 1.0, 02-20-2006 (mm-dd-yyyy)
// Product URL: http://gurtom.com/products/tables/js
// Contact info: feedback@gurtom.com (specify product title in subject line)
// Notes: This script is free. Feel free to copy, use and change this script as 
// long as this head part remains unchanged. Visit official site for details.
// Copyright: (c) 2006 by Gurtom.Com

var _t2H=[],_t2D=document.getElementById?function(_t2k){return document.getElementById(_t2k)}:function(_t2k){return document.all[_t2k]};function gTable(_t23,_t2U){var _t20=this,i,_t24=['table','caption','paging','filter','markedRow','hoveredRow','rowIndex'];_t20._t2U=_t2U;_t20.id=_t2H.length;_t20._t2Q=0;_t20._t2P=0;_t20._t2V={};_t20._t23=[];_t20._t2O;_t20._t2W={'_t2a':'','_t2A':null};_t20._t21=_t23.length?_t23[0]:null;_t20._t2I=_t2U.onClick;_t20._t2S=_t23.length-1;if(!_t2U.paging)_t2U.paging=[];with(_t2U){for(i=0;i<_t24.length;i++)_t20._t2V[_t24[i]]=css&&css[_t24[i]]?css[_t24[i]]:'';_t20._t2V.content=[];_t20._t2U={'paging':{'_t29':paging[0]||_t20._t2S,'_t2d':paging[1]||'&laquo;','_t2c':paging[2]||'&raquo;','_t2b':paging[3]||false}};for(i=0;i<_t20._t21.length;i++)_t20._t2V.content[i]=css&&css.content&&css.content[i]?css.content[i]:'';}_t20._t2U._t27=_t2U.showRecordIndex||false;_t20._t2U._t2K=_t2U.cellpadding||0;_t20._t2U._t2L=_t2U.cellspacing||0;_t20._t2U._t2N=_t2U.mark||1;_t20._t2M=_t20._t21.length;for(i=1;i<_t23.length;i++)_t20._t23[_t20._t23.length]=_t23[i];_t20._t2P=_t20._t2U.paging._t29==0?0:Math.ceil(_t20._t2S/_t20._t2U.paging._t29);_t2H[_t20.id]=_t20;document.write('<span id="GurtTableContainer'+_t20.id+'">Gurt Table rendering Error!</span>');_t2G(_t20.id);}function _t2F(id,_t2Q){var _t2o=_t2H[id];_t2o._t2Q=_t2Q*1;_t2G(id);}function _t2E(id,_t2Z){var _t2o=_t2H[id],i;var _t2R=_t2Z.id.match(/([0-9]+)$/)[0];if(_t2o._t2I)_t2o._t2I(_t2o._t23[_t2R]);if(_t2o._t2U._t2N==0||!_t2o._t2V.markedRow)return;if(_t2Z.className.indexOf(_t2o._t2V.markedRow)!=-1){_t2B(_t2Z,_t2o._t2V.markedRow,false);for(i=0;i<_t2Z.cells.length;i++)if(_t2Z.cells[i])_t2B(_t2Z.cells[i],_t2o._t2V.markedRow,false,true,_t2o._t2U._t27?1:0);_t2o._t23[_t2R][_t2o._t2M]=0;}else{_t2o._t23[_t2R][_t2o._t2M]=1;if(_t2o._t2U._t2N==1){if(_t2o._t2O){var _t2_=_t2D('gurtTable'+id+'Row'+_t2o._t2O);if(_t2_){_t2B(_t2_,_t2o._t2V.markedRow,false);for(i=0;i<_t2_.cells.length;i++)if(_t2_.cells[i])_t2B(_t2_.cells[i],_t2o._t2V.markedRow,false,true,_t2o._t2U._t27?1:0);}_t2o._t23[_t2o._t2O][_t2o._t2M]=0;}_t2o._t2O=_t2R;}_t2B(_t2Z,_t2o._t2V.markedRow,true);for(i=0;i<_t2Z.cells.length;i++)if(_t2Z.cells[i])_t2B(_t2Z.cells[i],_t2o._t2V.markedRow,true,true,_t2o._t2U._t27?1:0);}}function _t2C(id,_t28){var _t2o=_t2H[id],i,j,_t2g='',_t2X=document.forms['GurtTableFilterForm'+id],_t2e;if(!_t2X)return false;if(_t28){_t2o._t2W._t2a=_t2X.elements['filtPat'].value;_t2o._t2W._t2A=_t2X.elements['filtCol'].options[_t2X.elements['filtCol'].selectedIndex].value;if(!_t2o._t2W._t2a||_t2o._t2W._t2a=='')return false;_t2e=eval('/'+_t2o._t2W._t2a+'/i');for(i=0;i<_t2o._t23.length;i++){_t2m=_t2o._t23[i][_t2o._t2W._t2A];if(_t2m.search(_t2e)!=-1){_t2o._t23[i][_t2o._t2M]=1;var _t2_=_t2D('gurtTable'+id+'Row'+i);if(_t2_){_t2B(_t2_,_t2o._t2V.markedRow,true);for(j=0;j<_t2_.cells.length;j++)if(_t2_.cells[j])_t2B(_t2_.cells[j],_t2o._t2V.markedRow,true,true,_t2o._t2U._t27?1:0);}}else{_t2o._t23[i][_t2o._t2M]=0;var _t2_=_t2D('gurtTable'+id+'Row'+i);if(_t2_){_t2B(_t2_,_t2o._t2V.markedRow,false);for(j=0;j<_t2_.cells.length;j++)if(_t2_.cells[j])_t2B(_t2_.cells[j],_t2o._t2V.markedRow,false,true,_t2o._t2U._t27?1:0);}}}}else{for(i=0;i<_t2o._t23.length;i++){if(_t2o._t23[i][_t2o._t2M]==1){_t2o._t23[i][_t2o._t2M]=0;var _t2_=_t2D('gurtTable'+id+'Row'+i);if(_t2_){_t2B(_t2_,_t2o._t2V.markedRow,false);for(j=0;j<_t2_.cells.length;j++)if(_t2_.cells[j])_t2B(_t2_.cells[j],_t2o._t2V.markedRow,false,true,_t2o._t2U._t27?1:0);}}}}return false;}function _t2B(_t2Y,className,_t26,_t2f,_t2n){var _t2h;if(_t2Y)_t2h=_t2Y.className+'';else return;if(!_t2n)_t2n=0;if(_t26){if(_t2h.indexOf(className)==-1){_t2Y.className=_t2h+' '+className;if(_t2Y.cells&&_t2f)for(j=_t2n;j<_t2Y.cells.length;j++)if(_t2Y.cells[j])_t2Y.cells[j].className=_t2Y.cells[j].className+' '+className;}}else{_t2Y.className=_t2h.replace(className,'');if(_t2Y.cells&&_t2f)for(j=_t2n;j<_t2Y.cells.length;j++)if(_t2Y.cells[j])_t2Y.cells[j].className=_t2Y.cells[j].className.replace(className,'');}}function _t2G(id){var _t2o=_t2H[id],_t22=_t2D('GurtTableContainer'+id),_t25=['<table cellpadding="',_t2o._t2U._t2K,'" cellspacing="',_t2o._t2U._t2L,'" width="100%" border="0" class="',_t2o._t2V.table,'"><tr>'],_t2J=7,i;var _t2T=Math.min((_t2o._t2Q*1+1)*_t2o._t2U.paging._t29,_t2o._t2S),_t2l,_t2i=' onclick=_t2E('+id+',this)',_t2j;if(_t2o._t2V.hoveredRow)_t2l=' onmouseover="_t2B(this,\''+_t2o._t2V.hoveredRow+'\',true,true)" onmouseout="_t2B(this,\''+_t2o._t2V.hoveredRow+'\',false,true)"';if(_t2o._t2U._t27)_t25[_t2J++]=['<td class="',_t2o._t2V.rowIndex,'">#</td>'].join('');for(i=0;i<_t2o._t21.length;i++)_t25[_t2J++]=['<td class="',_t2o._t2V.caption,'">',_t2o._t21[i],'</td>'].join('');_t25[_t2J++]='</tr>';for(j=_t2o._t2Q*_t2o._t2U.paging._t29;j<_t2T;j++){_t25[_t2J++]=['<tr id="gurtTable',id,'Row',j,'"',(_t2l!=null?_t2l:''),_t2j?' bgcolor='+_t2j:'',_t2i?_t2i:'',_t2o._t23[j][_t2o._t2M]?' class="'+_t2o._t2V.markedRow+'"':'','>'].join('');if(_t2o._t2U._t27)_t25[_t2J++]=['<td class="',_t2o._t2V.rowIndex,_t2o._t23[j][_t2o._t2M]?_t2o._t2V.markedRow:'','">',j+1,'</td>'].join('');for(i=0;i<_t2o._t21.length;i++)_t25[_t2J++]='<td class="'+_t2o._t2V.content[i]+' '+(_t2o._t23[j][_t2o._t2M]?_t2o._t2V.markedRow:'')+'">'+_t2o._t23[j][i]+'</td>';_t25[_t2J++]='</tr>';}if(_t2o._t2U.paging._t29<_t2o._t2S){_t25[_t2J++]=['<tr><td colspan="',_t2o._t2M+(_t2o._t2U._t27?1:0),'" class="',_t2o._t2V.paging,'" style="padding:0px;"><table width="100%" cellpadding="2" cellspacing="0" border="0"><tr><td width="5%" class="',_t2o._t2V.paging,'">',_t2o._t2Q>0?'<a href="javascript:_t2F('+id+','+(_t2o._t2Q-1)+')" class="'+_t2o._t2V.paging+'" title="Jump to previous page">'+_t2o._t2U.paging._t2d+'</a>':'&nbsp;','</td>'].join('');_t25[_t2J++]=['<td width="90%" class="',_t2o._t2V.paging,'" valign="top">Records '].join('');if(_t2o._t2U.paging._t2b){_t25[_t2J++]=['<select class="',_t2o._t2V.paging,'" onchange="_t2F(',id,',this.options[this.selectedIndex].value)">'].join('');for(i=0;i<_t2o._t2P;i++){_t2T=Math.min((i*1+1)*_t2o._t2U.paging._t29,_t2o._t2S);_t25[_t2J++]=['<option value="',i,'" ',_t2o._t2Q==i?' selected':'','>',i*_t2o._t2U.paging._t29+1,' - ',_t2T,'</option>'].join('');}_t25[_t2J++]='</select>';}_t25[_t2J++]=['</td><td width="5%" class="',_t2o._t2V.paging,'">',(_t2o._t2Q+1)<_t2o._t2P?'<a href="javascript:_t2F('+id+','+(_t2o._t2Q+1)+')" class="'+_t2o._t2V.paging+'" title="Jump to next page">'+_t2o._t2U.paging._t2c+'</a>':'&nbsp;','</td></tr></table></td></tr>'].join('');}if(_t2o._t2U._t2N>1){_t25[_t2J++]=['<tr><td colspan="',_t2o._t2M+(_t2o._t2U._t27?1:0),'" class="',_t2o._t2V.filter,'" style="padding:0px;"><form name="GurtTableFilterForm',id,'"><table width="100%" cellpadding="2" cellspacing="0" border="0"><tr><td width="80%" class="',_t2o._t2V.filter,'">'].join('');_t25[_t2J++]=['Rows where &nbsp;</td><td class="',_t2o._t2V.filter,'"><select name="filtCol" class="',_t2o._t2V.filter,'">'].join('');for(i=0;i<_t2o._t21.length;i++)_t25[_t2J++]=['<option value="',i,'" ',_t2o._t2W._t2A==i?' selected':'','>',_t2o._t21[i],'</option>'].join('');_t25[_t2J++]=['</select><td class="',_t2o._t2V.filter,'" nowrap>&nbsp; contains &nbsp;</td>'].join('');_t25[_t2J++]=['</td><td class="',_t2o._t2V.filter,'"><input type="text" name="filtPat" value="',_t2o._t2W._t2a,'" class="',_t2o._t2V.filter,'"></td><td width="15%" class="',_t2o._t2V.filter,'" nowrap>&nbsp;<a href="#" onclick="return _t2C(',id,',true)" title="Select Rows _t29 Filter" class="',_t2o._t2V.filter,'">mark</a> <a href="#" onclick="return _t2C(',id,',false)"title="Deselect all rows" class="',_t2o._t2V.filter,'">unmark</a>'].join('');_t25[_t2J++]='&nbsp;</td></tr></form></table></td></tr>';}_t25[_t2J++]='</table>';_t22.innerHTML=_t25.join('');}