function fontify(what, size, fg, bg, wrap) {
	$(what).each(function() {
		var me = $(this);
		var input = $.trim($(this).text());

		me.empty().addClass("fontified");

		if (wrap == true) {
			var txt = input.split(" ");
			$.each(txt, function(i, val) {
				txt[i] = txt[i] + " ";
			});
		} else {
			var txt = new Array();
			txt.push(input);
		}

		$.each(txt, function() {
			var thisOne = encodeURIComponent(this);
			thisOne = thisOne.replace(/\%2B/g, "(percentu)002B"); // +
			thisOne = thisOne.replace(/\%23/g, "(percentu)0023"); // #
			thisOne = thisOne.replace(/\%26/g, "(percentu)0026"); // &
			thisOne = thisOne.replace(/\%u/g,"(percentu)");
			img = $("<img>").attr("src", "/magic/replace/" + size + "/" + fg + "/" + bg + "/" + thisOne).attr("alt", $(thisOne).text());
			me.append(img);
		});
	});
}

$(function() {
	fontify("div.post h2 a", 24, "006699", "FAEEA0");
	fontify("#sidebar h2", 18, "006699", "FAEEA0");
});