"use strict";function open_share_popup(c,e,b,d){var a=(window.screen.width-b)/2,f=(window.screen.height-d)/2;window.open(c,e,"width="+b+",height="+d+",left="+a+",top="+f+",status=1,resizable=0")}function init_help_button(){$("#help-button").click(function(){$("#helpbox").slideToggle("fast")});$("#helpbox").click(function(){$(this).slideUp("fast")})}function dropbox_push(b,a){$.getScript("https://www.dropbox.com/static/api/2/dropins.js").done(function(c,e){Dropbox.appKey=dropbox_app_key;var d={files:[{url:b,filename:a},],success:function(){alert("done")},error:function(f){alert(f)}};Dropbox.save(d)})}function fb_post_to_feed(a,e,c,b){var d={method:"feed",redirect_uri:"http://www.gutenberg.org/fb_redirect.html",link:a,picture:b,name:e,caption:a,description:c,ref:"bibrec"};function f(g){}FB.ui(d,f)}function get_logo_token(){var b=$("#logo .icon"),a=b.attr("id");$.cookie("bonus",a,{path:"/",domain:"gutenberg.org"})}function init_search_dropdown(){function b(c){return c.split(/\s+/).pop()}var a=$("#search-input");a.attr("placeholder",a.attr("title"));a.autocomplete({minLength:4,delay:500,source:function(d,c){$.ajax({url:json_search,data:{query:d.term},dataType:"json",cache:false,xhrFields:{withCredentials:true}}).done(function(e){c(e[1])})},search:function(){var c=b(this.value);if(c.length<4){return false}},focus:function(){return false},position:{my:"left top",at:"left bottom",of:"#search-input-cell"}});a.bind("keydown",function(c){if(c.keyCode===$.ui.keyCode.TAB&&$(this).data("autocomplete").menu.active){c.preventDefault()}});a.focus(function(){$("#search form").addClass("focused")});a.blur(function(){$("#search form").removeClass("focused")})}function printpage(){$("#tabs").tabs("destroy");$(".noprint").hide();$(".noscreen").show();window.print()}function screen_mode(){$(".noprint").show();$(".noscreen").hide();$("#tabs").tabs();if(window.location.hash){$("#tabs").tabs("select",window.location.hash)}}$(document).ready(function(){get_logo_token();screen_mode();init_help_button();init_search_dropdown();if(dialog_message!==""){var a=$("#dialog");if(a){a.append("
"+dialog_message+"
");a.dialog({title:dialog_title,resizable:false,modal:true,buttons:{Ok:function(){$(this).dialog("close")}}})}}});