$(document).ready(function() {
	if (!document.referrer) return;
	var matches = document.referrer.match(/[?&][pq]=([^&]*)/);
	if (!matches) return;
	var terms = unescape(matches[1].replace(/\+/g, ' '));
	var re = new RegExp().compile('(' + terms + ')', 'i');
	$("body *").each(function() {
		if ($(this).children().size() > 0) return;
		if ($(this).is("xmp, pre")) return;
		var html = $(this).html();
		var newhtml = html.replace(re, '<span class="keywordhighlight">$1</span>');
		$(this).html(newhtml);
	});
});
