(function(d){var c;var b={};var a={init:function(f){c=this;b={token:false,query_param:"query"};if(f){d.extend(b,f)}if(!b.token||b.query_param==""){return this}d.getJSON("http://tapirgo.com/api/1/search.json?token="+b.token+"&query="+e(b.query_param)+"&callback=?",function(g){if(b.complete){b.complete()}if(g.length>0){c.empty()}d.each(g,function(h,i){if(b.process){i=b.process(i)}c.append('<div class="result"><h3><a href="'+i.link+'">'+i.title+"</a></h3><p>"+i.summary+"</p></div>")})});return this}};function e(f){var g=new RegExp("[\\?&]"+f+"=([^&#]*)").exec(window.location.href);return g?g[1]:false}d.fn.tapir=function(f){if(a[f]){return a[f].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof f==="object"||!f){return a.init.apply(this,arguments)}else{d.error("Method "+f+" does not exist on jQuery.tapir")}}}})(jQuery);
