﻿jQuery.fn.SearchPanel = function(searchWithinPanel) {
	var txt = jQuery(this);
	txt.live("keyup", function() {
		var searchOn = txt.val();
		searchWithinPanel.find(".search-result").each(function() {
			var isMatch = false;
			$(this).find(".search-key").each(function() {
				var searchKey = $(this).html().toLowerCase();
				isMatch = isMatch || (searchKey.substring(searchOn.length, 0).toLowerCase() == searchOn);
			});

			if (isMatch) { $(this).show(); } else { $(this).hide(); }
		});
	});
};