jQuery.fn.liveUpdate = function(list,contentchild){
	list = jQuery(list);

	if ( list.length ) {
		var rows = list.children(contentchild),
			cache = rows.map(function(){
				return $(this).text().toLowerCase();
			});
			
		this
			.keypress(function(e){
			  if(e.which == 13){
				$(document.body).removeClass("home");
				list.hide();
				filter.call(this);
			}	
			}).parents('form').submit(function(){
				return false;
			});
		
		this	.keyup(function(){
			  if(jQuery(this).val() === ""){ rows.parent().hide();}
			});
	}
		
	return this;
		
	function filter(){
		var term = jQuery.trim( jQuery(this).val().toLowerCase() ), scores = [];
		
		if ( term ) {
			var searchRegEx = new RegExp('.*'+term+'+.*','gi');

			cache.each(function(i){
				var score = (this.match(searchRegEx)!==null)? 1.0 : 0.0;
				if (score > 0.65) { scores.push([score, i]); }
			});

			jQuery.each(scores.sort(function(a, b){return b[0] - a[0];}), function(){
				jQuery(rows[ this[1] ]).parent().show();
			});
		}
	}
};

