$(function(){jQuery.highlight=document.body.createTextRange?function(a,b){var r=document.body.createTextRange();r.moveToElementText(a);for(var i=0;r.findText(b);i++){r.pasteHTML('<span class="highlight">'+r.text+'<\/span>');r.collapse(false)}}:function(a,b){var c,skip,spannode,middlebit,endbit,middleclone;skip=0;if(a.nodeType==3){c=a.data.toUpperCase().indexOf(b);if(c>=0){spannode=document.createElement('span');spannode.className='highlight';middlebit=a.splitText(c);endbit=middlebit.splitText(b.length);middleclone=middlebit.cloneNode(true);spannode.appendChild(middleclone);middlebit.parentNode.replaceChild(spannode,middlebit);skip=1}}else if(a.nodeType==1&&a.childNodes&&!/(script|style)/i.test(a.tagName)){for(var i=0;i<a.childNodes.length;++i){i+=$.highlight(a.childNodes[i],b)}}return skip}});jQuery.fn.removeHighlight=function(){this.find("span.highlight").each(function(){with(this.parentNode){replaceChild(this.firstChild,this);normalize()}});return this};
