(function(l){l.fn.tipuesearch=function(B){var d=l.extend({contextBuffer:60,contextLength:60,contextStart:90,debug:!1,descriptiveWords:25,footerPages:3,highlightTerms:!0,imageZoom:!0,minimumLength:3,newWindow:!1,show:10,showContext:!0,showRelated:!0,showTime:!0,showTitleCount:!0,showURL:!0,wholeWords:!0},B);return this.each(function(){function z(d){d=((new RegExp("[?|&]"+d+"=([^&;]+?)(&|#|;|$)")).exec(location.search)||[,""])[1].replace(/\+/g,"%20");try{d=decodeURIComponent(d)}catch(w){d=unescape(d)}return d|| null}function x(u,w){window.scrollTo(0,0);var e="",t=!1,k=!1,p=!0,n=0,g=[],m=l("#tipue_search_input").val();m=m.replace(/\+/g," ").replace(/\s\s+/g," ");m=l.trim(m);var h=m.toLowerCase();if(h.match('^"')&&h.match('"$')||h.match("^'")&&h.match("'$"))p=!1;var c=h.split(" ");if(p){h="";for(var a=0;a= d.minimumLength){if(p){if(w){var r=h;for(a=0;a'+tipuesearch_string_4:(a=n.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","),e+='
'+a+" "+tipuesearch_string_5);d.showTime&&(a=((new Date).getTime()-startTimer)/1E3,e+=" ("+a.toFixed(2)+ " "+tipuesearch_string_14+")",d.showTime=!1);e+="
";if(d.showRelated&&p){c="";for(a=b=0;a'+tipuesearch_string_10+": "),t&&(m=h),c+=''+tipuesearch_related.Related[a].related+", ",b++);b&&(c=c.slice(0, -2),e+=c+".")}t&&(e+='
'+tipuesearch_string_2+" "+h+". "+tipuesearch_string_3+' '+r+"
");g.sort(function(a,b){return b.score-a.score});t=0;d.imageZoom&&(e+='
');for(a=0;a= u&&t';e+='";d.debug&&(e+='
Score: '+g[a].score+"
");d.showURL&&(b=g[a].url.toLowerCase(),0==b.indexOf("http://")&&(b=b.slice(7)),e+='");g[a].img&&(e=d.imageZoom?e+('
'+g[a].title+'
'):e+('
'+g[a].title+'
'));if(g[a].desc){m=g[a].desc;d.showContext&&(c=h.split(" "),b=g[a].desc.toLowerCase().indexOf(c[0]),b>d.contextStart&&(c=m.substr(b-d.contextBuffer),c=c.indexOf(" "),c=m.substr(b-d.contextBuffer+c),c=l.trim(c),c.length>d.contextLength&&(m="... "+c)));if(p)for(c=h.split(" "),b=0;b$1"));else d.highlightTerms&&(r=new RegExp("("+h+")","gi"),m=m.replace(r,'$1'));c="";r=m.split(" ");if(r.length'+c+""}g[a].note&& (e+='
'+g[a].note+"
");e+=""}t++}if(n>d.show){p=Math.ceil(n/d.show);n=u/d.show;3>d.footerPages&&(d.footerPages=3);e+='
"}}else e+='
'+tipuesearch_string_8+"
"}else e=k?e+('
'+tipuesearch_string_8+" "+tipuesearch_string_9+"
"):1==d.minimumLength?e+('
'+ tipuesearch_string_11+"
"):e+('
'+tipuesearch_string_12+" "+d.minimumLength+" "+tipuesearch_string_13+"
");l("#tipue_search_content").hide().html(e).slideDown(200);l("#tipue_search_replaced").click(function(){x(0,!1)});l(".tipue_search_related_btn").click(function(){l("#tipue_search_input").val(l(this).attr("id"));x(0,!0)});l(".tipue_search_image_zoom").click(function(){l("#tipue_search_image_modal").fadeIn(300);l("#tipue_search_zoom_img").attr("src",this.src); var a=l(this).attr("data-url");l("#tipue_search_zoom_url").attr("href",a);a=this.alt+'";l("#tipue_search_zoom_text").html(a)});l(".tipue_search_image_close").click(function(){l("#tipue_search_image_modal").fadeOut(300)});l(".tipue_search_foot_box").click(function(){var a=l(this).attr("id").split("_");x(parseInt(a[0]),a[1])})}var A=0,y= "";d.newWindow&&(y=' target="_blank"');z("q")&&(l("#tipue_search_input").val(z("q")),x(0,!0));l(this).keyup(function(d){"13"==d.keyCode&&x(0,!0)})})}})(jQuery);