"use strict";function Spinner(b,e,a,f,c,d){this.elem=b;this.no_of_frames=d;this.x_squares=c;this.y_squares=Math.floor(d/c)+1;this.img_url=e;this.x_step=a/this.x_squares;this.y_step=f/this.y_squares}Spinner.prototype.show=function(a){this.elem.css("background-position","-"+(a%this.x_squares)*this.x_step+"px -"+Math.floor(a/this.x_squares)*this.y_step+"px")};Spinner.prototype.step=function(){this.cur_frame=(this.cur_frame%this.no_of_frames)+1;this.show(this.cur_frame)};Spinner.prototype.start=function(a){this.elem.css("background-image",'url("'+this.img_url+'")');this.elem.css("width",this.x_step);this.elem.css("height",this.y_step);this.elem.css("display","block");this.show(this.cur_frame=1);var b=this;this.id=setInterval(function(){b.step()},a)};Spinner.prototype.stop=function(){this.elem.css("display","none");clearInterval(this.id);this.show(this.cur_frame=0)};jQuery.fn.extend({scrollTo:function(a,b,c){return this.each(function(){var d=$(this).offset().top;setTimeout(function(){$("html, body").animate({scrollTop:d},b,c)},a)})}});function sanitize_headers(){var b,a="";$("li.header").each(function(){b=$(this).text();if(b===a){$(this).remove()}a=b})}function bind_more(){var b=$("li.more a"),a=b.attr("href");b.removeAttr("href");$("span.title",b).text(msg_load_more);b.bind("click",{href:a},function(d){var c=new Spinner($("span.spinner",b),"/pics/24/gnome-spinner.png",176,88,8,31);b.css({"background-color":"rgba(0,0,255,0.4)"});c.start(50);$.ajax({url:d.data.href}).done(function(f){c.stop();get_logo_token(f);var e=$("li.booklink, li.more",f).clone();e.appendTo(b.parent().parent());b.parent().remove();sanitize_headers();bind_more()})})}function clear_suggestions(a){$(".suggestion").slideUp("fast",function(){$(".suggestion").remove();$("#searchlist").scrollTo(0,"fast")})}function get_suggestions(a){var b=a.target.value;if(b!==a.target.old_value){a.target.old_value=a.target.value;clear_suggestions(a);if(b.length>=4){$.ajax({url:json_search,data:{query:b},dataType:"json",cache:false,xhrFields:{withCredentials:true}}).done(function(e){if(e[0]===a.target.value){var d,c=e[1];for(d=c.length-1;d>=0;--d){$("#searchlist").after('