(function(){var r=document;var l=function(){};var q={source:"finderfox_preview"};var a="http://smarterfox.com/widget/";var p=function(t,u){var v=navigator.language?navigator.language:navigator.userLanguage;var t=t.replace(/{searchTerms}/g,encodeURIComponent(u));t=t.replace(/{language}/g,v);return t};var k="http://smarterfox.com/wikisearch/search?q={searchTerms}&locale={language}";var c="http://www.oneriot.com/search?p=smarterfox&ssrc="+q.source+"_popup_bubble&spid=8493c8f1-0b5b-4116-99fd-f0bcb0a3b602&q={searchTerms}";var i="http://yandex.ru/yandsearch?text={searchTerms}&clid=127504";var d="http://delicious.com/search?p={searchTerms}";var f="http://search.twitter.com/search?q={searchTerms}";var e="http://twitter.com/home?status={searchTerms}";var m="http://www.bing.com/search?q={searchTerms}";var h="http://www.baidu.com/s?wd={searchTerms}";var o="http://www.reddit.com/search?q={searchTerms}";var g="http://www.youtube.com/results?search_query={searchTerms}";var s="http://en.wiktionary.org/wiki/Special:Search?search={searchTerms}&go=Define";var b="http://www.google.com/search?q={searchTerms}";var n=function(t,v){var u=$('<a class="preview-popup-bubble preview-popup-bubble-lite preview-popup-bubble-active" href="'+p(k,v)+'"></a>',r);if(t.openNewTab){u.attr("target","_blank")}return u};var j=function(x,G){var z=$('<span class="preview-popup-bubble preview-popup-bubble-active"></span>',r);var w=$('<span class="preview-popup-bubble-links smarterwiki-clearfix"></span>',r).appendTo($('<span class="preview-popup-bubble-body"></span>',r).appendTo(z));var F=function(I){var J=$('<a href="'+a+'" class="'+I+'"></a>',r);if(x.openNewTab){J.attr("target","_blank")}l(J,{name:"homepage_visited",source:x.source});return J};var u=($('<span class="preview-popup-bubble-tip"></span>',r)).appendTo(z);var v=[];var t=function(L,K,I){var J=$('<a class="preview-popup-bubble-link"></a>',r).attr("href",I).attr("title",L).append($('<img alt="" class="preview-popup-bubble-link-favicon" />',r).attr("src",K));if(x.openNewTab){J.attr("target","_blank")}l(J,{name:"popup_bubble_searched",search_engine_title:L,source:x.source});v.push(J);return J};if(x.searchWikipedia){t("Search Wikipedia","http://static.smarterfox.com/media/wiki-favicon-sharpened.png",p(k,G))}for(var H=0;H<x.customSearchEngines.length;H++){t(x.customSearchEngines[H][0],x.customSearchEngines[H][1],p(x.customSearchEngines[H][2],G))}if(x.searchOneRiot){t("Search OneRiot","http://static.smarterfox.com/media/popup_bubble/oneriot-favicon.ico",p(c,G))}if(x.searchDelicious){t("Search Delicious","http://delicious.com/favicon.ico",p(d,G))}if(x.searchTwitter){t("Search Twitter","http://twitter.com/favicon.ico",p(f,G))}if(x.tweetThis){t("Tweet This!","http://static.smarterfox.com/media/finderfox/tweet_this.png",p(e,'"'+G+'" - '+r.location.href))}if(x.searchBing){t("Search Bing","http://www.bing.com/favicon.ico",p(m,G))}if(x.searchBaidu){t("Search Baidu","http://www.baidu.com/favicon.ico",p(h,G))}if(x.searchReddit){t("Search Reddit","http://www.reddit.com/favicon.ico",p(o,G))}if(x.searchYouTube){t("Search YouTube","http://www.youtube.com/favicon.ico",p(g,G))}if(x.searchWiktionary){t("Search Wiktionary","http://en.wiktionary.org/favicon.ico",p(s,G))}if(x.searchGoogle){t("Search Google","http://www.google.com/favicon.ico",p(b,G))}if(x.searchYandex){t("Search Yandex","http://www.yandex.ru/favicon.ico",p(i,G))}if(x.showHomepageLink){var y=t("What is this?","http://static.smarterfox.com/media/img/smarterfox-logo.png",a);l(y,{name:"homepage_visited",source:x.source})}var B=x.forceSingleRow?1:Math.floor(Math.sqrt(v.length));var A=Math.ceil(v.length/B);v.reverse();var D=v[0];while(v.length){var C=$('<span class="preview-popup-bubble-links-row smarterwiki-clearfix"></span>',r).prependTo(w);for(var E=0;E<A;E++){if(v.length){C.append(v.pop())}else{break}}}z.css("margin-left","-"+(3*2+3*2+A*18+(A-1)*3)+"px");z.css("margin-top","-"+(3*2+3*2+B*18+(B-1)*3+6)+"px");return z};window.buildPopupSearchBubbleLite=n;window.buildPopupSearchBubbleFull=j}());