$(window).load(function() {
	
	/* SZOKIEMELES */
	jQuery.fn.highlight = function (str) {
		var regex = new RegExp(str, "gi");
		return this.each(function () {
			$(this).contents().filter(function() {
				return this.nodeType == 3 && regex.test(this.nodeValue);
			}).replaceWith(function() {
				return (this.nodeValue || "").replace(regex, function(match) {
					return "<span style=\"font-weight:bold;\">" + match + "</span>";
				});
			});
		});
	};
	
	/* KERESESI KIFEJEZES KIEMELESE */
	jQuery.fn.highlight_search = function (str) {
		var regex = new RegExp(str, "gi");
		return this.each(function () {
			$(this).contents().filter(function() {
				return this.nodeType == 3 && regex.test(this.nodeValue);
			}).replaceWith(function() {
				return (this.nodeValue || "").replace(regex, function(match) {
					return "<span style=\"font-weight:bold; text-decoration:underline;\">" + match + "</span>";
				});
			});
		});
	};
	
	/* SZOVEGKIEMELESEK */
	$(".inner_text *").highlight("Bonduelle", "highlight");
	$(".main *").highlight("Bonduelle", "highlight");
	
});

