jQuery(document).ready(function($){var _greeting_box_vars={init_timeout:15000,timeout:3000,block:'#greet_block',_timer:0};jQuery.fn.fadeThenSlide=function(){return this.fadeTo(4500,0).slideUp(500);};if(!$(_greeting_box_vars.block).css("display")!=="none"){_greeting_box_vars._timer=setTimeout("jQuery(function($){$('"+_greeting_box_vars.block+"').fadeThenSlide()});",_greeting_box_vars.init_timeout);}
$(_greeting_box_vars.block).hover(function(){if($(this).css("opacity")!=="0"){clearTimeout(_greeting_box_vars._timer);$(_greeting_box_vars.block).stop().stop().fadeTo(300,1);}},function(){_greeting_box_vars._timer=setTimeout("jQuery(function($){$('"+_greeting_box_vars.block+"').fadeThenSlide()});",_greeting_box_vars.timeout);});var _translate_box_vars={init_timeout:3000,timeout:1500,button:'#translate_btn',window:'#translate_post',_timer:0};$(_translate_box_vars.button).click(function(e){if(!$(_translate_box_vars.window).is(':visible')){clearTimeout(_translate_box_vars._timer);leftVal=e.pageX-($(_translate_box_vars.window).width()/2)+"px";topVal=(e.pageY+4)+"px";$(_translate_box_vars.window).css({left:leftVal,top:topVal}).fadeIn(300);_translate_box_vars._timer=setTimeout("jQuery(function($){$('"+_translate_box_vars.window+"').css({left:leftVal,top:topVal}).fadeOut(300)});",_translate_box_vars.init_timeout);}
e.stopPropagation();});$(_translate_box_vars.window).hover(function(){clearTimeout(_translate_box_vars._timer);},function(){_translate_box_vars._timer=setTimeout("jQuery(function($){$('"+_translate_box_vars.window+"').css({left:leftVal,top:topVal}).fadeOut(300)});",_translate_box_vars.timeout);});$('body').click(function(e){if(!$(e.target).is(_translate_box_vars.window)){$(_translate_box_vars.window).fadeOut(300);clearTimeout(_translate_box_vars._timer);}});$.fn.highlightSearchTerms=function(options){var o=$.extend({},$.fn.highlightSearchTerms.defaults,options);$.merge(o.referrerPatterns,$.fn.highlightSearchTerms.builtinReferrerPatterns);var ref=o.referrer||document.referrer;if(ref){var terms=extractSearchTerms(ref,o);var tc=1;if(terms!==""){terms=new RegExp("("+terms+")","gi");var highlighted="<span class=\""+encodeEntities(o.className)+"\">$1</span>";this.find(":not(iframe, option, script, textarea)").contents().each(function(){if(this.nodeType===3){var s=encodeEntities(this.nodeValue).replace(terms,highlighted);$(this).replaceWith(s);}});}}
return this;};function extractSearchTerms(ref,o){var terms="";$.each(o.referrerPatterns,function(){var pattern=new RegExp(this,"i");if(pattern.exec(ref)){var unsafe=new RegExp(o.unsafeChars,"g");terms=decodeURIComponent(RegExp.$1).replace(unsafe,"+").replace(/^\+*(.*?)\+*$/,"$1").replace(/\++/g,"|");return false;}});return terms;}
function encodeEntities(s){return $("<u/>").text(s).html();}
$.fn.highlightSearchTerms.defaults={className:"highlight",referrerPatterns:[],unsafeChars:"[!-*,-/:-@[-`{-~]"};$.fn.highlightSearchTerms.builtinReferrerPatterns=["^http://www\.google\.com.+[&?]q=([^&]+).*$","^http://www\.google\.co\.[a-z]{2}.+[&?]q=([^&]+).*$","^http://search\.yahoo\.com.+[&?]p=([^&]+).*$","^http://search\.yahoo\.co\.[a-z]{2}.+[&?]p=([^&]+).*$","^http://www\.bing\.com.+[&?]q=([^&]+).*$"];$('body').highlightSearchTerms();});