jQuery.fn.highlight=function(c){var b=typeof(c)==="string"?new RegExp(c,"i"):c;function a(f,k){var n=0;if(f.nodeType===3){var l=f.data.search(b);if(l>=0&&f.data.length>0){var j=f.data.match(b);var m=document.createElement("span");m.className="highlight";var g=f.splitText(l);var e=g.splitText(j[0].length);var d=g.cloneNode(true);m.appendChild(d);g.parentNode.replaceChild(m,g);n=1}}else{if(f.nodeType===1&&f.childNodes&&!/(script|style)/i.test(f.tagName)){for(var h=0;h<f.childNodes.length;h++){h+=a(f.childNodes[h],k)}}}return n}return this.each(function(){a(this,c)})};jQuery.fn.removeHighlight=function(){return this.find("span.highlight").each(function(){this.parentNode.firstChild.nodeName;with(this.parentNode){replaceChild(this.firstChild,this);normalize()}}).end()};
