$(function(){
	// get all tr tags in the current table
	var $table = $('#leadsTable tr td');
	// the "clear" function call
	$('form a').click(function(){
		$('#filter').val('');
		$table.parent('tr').removeAttr('class','hiddenTR');
		return false;
	});
	// the on keyDown event handler
	$('#filter').keyup(function(){
		// get the current value of the text field
		var string = $(this).val().toUpperCase();
		// loop over each item in $table
		$table.each(function(){
			// set a string equal to the contents of the cell
			var contents = $(this).html().toUpperCase();
			var $row = $(this).parent('tr');
			// check the string against that cell
			var value = (!contents.match('^' + string)) ? $row.attr('class','hiddenTR') : $row.removeAttr('class','hiddenTR');
		});
	});
});
