$(document.body).click(function(a){});jQuery.fn.liveSearch=function(b){var a=jQuery.extend({ajaxURL:"/mod/search-results.php?q="},b);return this.each(function(){var c=jQuery(this);var f=c.offset();var d={left:f.left,top:f.top,width:c.outerWidth(),height:c.outerHeight()};var e=jQuery('<div class="live-search-results"></div>').appendTo(document.body).hide().slideUp(0);var g=parseInt(e.css("paddingLeft"),10)+parseInt(e.css("paddingRight"),10)+parseInt(e.css("borderLeftWidth"),10)+parseInt(e.css("borderRightWidth"),10);d.topNHeight=d.top+d.height;e.css({position:"absolute",left:d.left+"px",top:d.topNHeight+"px"});c.keyup(function(){if(this.value!=this.lastValue&&this.value.trim().length>minCheckLength){c.addClass("ajax-loading");var j=this.value.trim().toLowerCase();var i=j.split(" ");var k="";for(xx=0;xx<i.length;xx++){var h=i[xx].replace(/[.]+/g,"dfichi").replace(/[@]+/g,"efichj").replace(/[^a-zA-Z 0-9]+/g,"ffichk");k+=h}j=k;if(this.timer){clearTimeout(this.timer)}this.timer=setTimeout(function(){jQuery.get(a.ajaxURL+j,function(l){c.removeClass("ajax-loading");if(l.length){$("#liveCheck").html(l);$("#liveCheck").show();if(c.attr("id")=="pfinder"){$("#liveCheck .tippedpp").tooltip({showURL:false});$("#liveCheck .dragEntity").draggable({revert:"invalid",helper:"clone"})}}else{$("#liveCheck").hide()}})},200);this.lastValue=this.value}else{$("#liveCheck").hide()}})})};