
	function quickfilter_create( objId, tableId, rowOffset, cellOffset )
	{
		obj = document.getElementById( objId );
		if( !obj )
		{
			return;
		}
		
		oTable = document.getElementById( tableId );
		if( !oTable )
		{
			return;
		}
		
		obj.innerHTML = "<input type='text' onKeyUp=\"quickfilter_filter('" + tableId + "', '" + rowOffset + "', '" + cellOffset + "', this.value);\">";

	}
	
	function quickfilter_genHtmlContentString( element )
	{
		ret = "";
		if( element && element != null )
		{
			childElements = element.getElementsByTagName("*");
			
			if( childElements && childElements != null && childElements.length > 0 )
			{
				for( n=0; n < childElements.length; n++ )
				{
					childElement = childElements.item(n);
					if( childElement && childElement != null )
					{
						ret += quickfilter_genHtmlContentString( childElement );
					}
				}
			}
			else
			{
				ret = element.innerHTML;
			}
		}
		return ret;
	}
	
	
	function quickfilter_filter( tableId, rowOffset, cellOffset, filterText )
	{
		oTable = document.getElementById( tableId );
		if( !oTable || oTable == null || typeof(oTable) == "undefined" )
		{
			return;
		}
		
		myRe = new RegExp ("(" + filterText + ")", "i");
		
		tableRows = oTable.firstChild;	// tbody
		tableRow = tableRows.firstChild;	// rows in tbody
		nCurrRow = 0;
		do
		{
			if( nCurrRow++ < rowOffset )
			{
				continue;
			}
			tableCell = tableRow.firstChild;
			nCurrCell = 0;
			do
			{
				if( nCurrCell++ == cellOffset )
				{
					if( filterText.length > 0 )
					{
						// check if match
						matchText = quickfilter_genHtmlContentString( tableCell );
						regexpResult = myRe.exec( matchText );
						if( regexpResult && regexpResult != null )
						{
							//alert("show");
							tableRow.style.display = "";
						}
						else
						{
							//alert("hide");
							tableRow.style.display = "none";
						}
					}
					else
					{
						// just show
						//alert("show");
						tableRow.style.display = "";
					}
					
					break;
				}
				
			} while( tableCell = tableCell.nextSibling );

		} while( tableRow = tableRow.nextSibling );
			
	}
