var EPUBJSR=EPUBJSR||{};EPUBJSR.app={},EPUBJSR.app.init=function(e){"use strict";function s(n){var s=window.location.search.match(/book=(.*)/),n=n||(s?s[1]:"moby-dick");i=e(window).width(),i>550?e("#main").width(i-r):e("#main").width(i),t=new EPUBJS.Book(n),t.on("book:online",c),t.on("book:offline",h),t.getMetadata().then(o),t.getToc().then(u),t.ready.all.then(l),t.renderTo("area"),e(function(){d()})}function o(t){var n=t.bookTitle,r=t.creator,i=e("#book-title"),s=e("#chapter-title"),o=e("#title-seperator");document.title=n+" – "+r,i.html(n),s.html(r),o.show()}function u(n){var r=e("#toc"),i,s;r.empty(),s=f(n,1),r.append(s),i=e(".toc_link"),i.on("click",function(n){var r=e(this),i=r.data("url");e(".openChapter").removeClass("openChapter"),r.parents("li").addClass("openChapter"),t.goto(i),n.preventDefault()})}function a(){var n="";localStorage.getItem("fontSize")?n=localStorage.getItem("fontSize"):(n="medium",localStorage.setItem("fontSize",n));var r=e("#settingsPanel");r.append("");var i=e("
  • "),s=e("Extra Small
    Small
    Medium
    Large
    Extra Large");i.find("h3").text("Font Size").after(s),r.find("ul").append(i);var o=e('input[name="fontSize"]');o.each(function(){e(this).attr("value")==n&&e(this).attr("checked","checked"),e(this).on("click",function(){localStorage.setItem("fontSize",e(this).attr("value")),t.iframe.contentDocument.location.reload(!0)})})}function f(t,n){var r=e("