var IDRViewer=function(){var u={View:{MultiFile:0,SplitSpreads:1,SingleFile:2,IDR:3}},p=1,t=0,v=0,c=0,q=0,sa=0,f,m,r,k,P=[],C,Z=!1,I=!1,aa,A,ja=!0,ta,F,n=u.View,ba=n.MultiFile,z,D,ka,Q,la,ua,L,ca,ea,fa,G,M,va,wa,xa,ya,ma,R,S,T,ga,za,w;u.makeNavBar=function(a,b,c,d,l,x,u,g,na){aa=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);/iPhone|iPad|iPod/i.test(navigator.userAgent);F=!na;w=g;m=h("contentContainer");r=h("mainContent");C=h("left");q=a;t=c;v=d;k=l;h("pgCount").innerHTML=
"/"+q;m.style.width=t+"px";m.style.height=v+"px";z=h("goBtn");D=h("zoomBtn");ka=h("btnFullscreen");Q=h("btnOutlines");la=h("btnThumbnails");ua=h("btnPrev");h("btnNext");L=h("btnMove");ca=h("btnSelect");ea=h("btnZoomIn");fa=h("btnZoomOut");R=0;S=1;M=0;va=1;wa=2;xa=3;ya=4;A=ma=5;f=h("jpedal");H.setup(b,x,u);document.fullscreenEnabled||document.msFullscreenEnabled||document.mozFullScreenEnabled||document.webkitFullscreenEnabled?(U("fullscreenchange",document,da),U("MSFullscreenChange",document,da),U("mozfullscreenchange",
document,da),U("webkitfullscreenchange",document,da)):ka.parentNode.removeChild(ka);this.setSelectMode(R);a=Ea("page");""!=a?ha(parseInt(a)):ha(1);if(aa){D.parentNode.removeChild(D);L.parentNode.removeChild(L);ca.parentNode.removeChild(ca);ea.parentNode.removeChild(ea);fa.parentNode.removeChild(fa);r.style.overflow="hidden";N.setup();var Aa=window.innerWidth,Ba=window.innerHeight;g=function(){setTimeout(function(){if(Aa!==window.innerWidth||Ba!==window.innerHeight)m.innerHTML="",p=1,Aa=window.innerWidth,
Ba=window.innerHeight,N.setup()},300)};window.onorientationchange=g;window.onresize=g}else{for(a=0;a<q;a++)if(g[a][0]!=g[0][0]||g[a][1]!=g[0][1]){ja=!1;break}ja&&!ta&&(G=document.createElement("select"),G.id="viewBtn",g=document.createElement("option"),g.text="Single Pages",G.appendChild(g),g=document.createElement("option"),g.text="Magazine",G.appendChild(g),g=document.createElement("option"),g.text="Continuous",G.appendChild(g),G.onchange=Fa,h("mainNav").appendChild(G),G.selectedIndex=ba);ja&&ba===
n.SplitSpreads?O.setup():ja&&ba===n.SingleFile?V.setup():W.setup();A=ma;D.selectedIndex=A;window.onresize=E}};var H=function(){var a={},b=[],e=0,d,l;a.setup=function(a,c,e){d=document.getElementById("leftContent");l=e;x(c);for(c=0;c<q;c++)b[c]=!1;a=h("thumb"+a);a.className="thumbnail currentPageThumbnail";d.scrollTop=a.getBoundingClientRect().top-80;I=Z=!1;U("scroll",d,f);a=document.createElement("script");a.setAttribute("src","bookmarks/bookmarks.js");a.setAttribute("onload","IDRViewer.setBookmarks(bookmarks);");
a.onreadystatechange=function(){"complete"==this.readyState&&IDRViewer.setBookmarks(bookmarks)};(document.head||document.getElementsByTagName("head")[0]).appendChild(a)};a.toggleThumbnails=function(){Z?(C.style.width="0",C.style.left="-20px"):(g(-1),C.style.width="200px",C.style.left="0",f());Z=!Z};a.toggleOutlines=function(a){I&&!a?(h("thumbnailPanel").style.display="inline",h("outlinePanel").style.display="none",d.scrollTop=h("thumb"+c).getBoundingClientRect().top-80,I=!I,la.className="inactive navBtn",
Q.className="navBtn"):a&&"inactive navBtn"!=Q.className&&(h("thumbnailPanel").style.display="none",h("outlinePanel").style.display="inline",I=!I,la.className="navBtn",Q.className="inactive navBtn")};var x=function(a){for(var b,c=0,e=0,g=1;g<=q;g++){0>a[e]&&0>=c?(c=Math.abs(a[e])-1,e++):0<c?c--:(b=a[e],e++);var h=document.createElement("a");h.style.height=b+"px";h.className="thumbnail";k==n.IDR&&(h.href="?page="+g);h.id="thumb"+g;h.setAttribute("onclick","IDRViewer.goToPage("+g+"); return false;");
h.setAttribute("title","Page "+g);h.innerHTML='<img src="assets/loading.gif"/>';d.children[0].appendChild(h)}},f=function(a){var b=d.scrollTop;e=b;setTimeout(function(){g(b)},500)},g=function(a){if(a==e||-1==a)for(a=0;a<q;a++)if(!b[a]){var c=d.children[0].children[a];if(c.offsetTop>d.scrollTop+d.clientHeight)break;c.offsetTop+c.clientHeight>d.scrollTop&&(c=a,b[c]||(d.children[0].children[c].children[0].setAttribute("src","thumbnails/"+(c+1)+l),b[c]=!0))}};a.scrollToPage=function(a){a=h("thumb"+a);
if("thumbnail currentPageThumbnail"!=a.className){for(var b=1;b<=q;b++)h("thumb"+b).className="thumbnail";a.className="thumbnail currentPageThumbnail";d.scrollTop=d.scrollTop+a.getBoundingClientRect().top-80}};return a}(),Ca=function(){z.style.width="65px";z.innerHTML="";var a=document.createElement("option");a.value=1;a.innerHTML="1";z.appendChild(a);for(var b,e=2;e<=q;e+=2)a=document.createElement("option"),a.value=e,b=e!==q||1===q%2?String(e+"-"+(e+1)):String(e),a.innerHTML=b,z.appendChild(a);
z.selectedIndex=c/2},qa=function(){z.innerHTML="";for(var a=1;a<=q;a++){var b=document.createElement("option");b.value=a;b.innerHTML=String(a);z.appendChild(b)}z.selectedIndex=c-1},B={applyTransform:function(a,b){a.style.webkitTransform=b;a.style.mozTransform=b;a.style.msTransform=b;a.style.oTransform=b;a.style.transform=b},applyTransformOrigin:function(a,b){a.style.webkitTransformOrigin=b;a.style.mozTransformOrigin=b;a.style.msTransformOrigin=b;a.style.oTransformOrigin=b;a.style.transformOrigin=
b},applyTransitionDuration:function(a,b){a.style.webkitTransitionDuration=b;a.style.mozTransitionDuration=b;a.style.msTransitionDuration=b;a.style.oTransitionDuration=b;a.style.transitionDuration=b}},O=function(){var a={},b,e,d,l,x;a.setup=function(){k=n.SplitSpreads;Ca();t=w[0][0];v=w[0][1];b=t;window.onpopstate=function(b){a.goToPage(b.state.page,!1)};a.goToPage(c,!1)};a.goToPage=function(a,e){a>q&&(a=q);1!==a&&0!==a%2&&--a;f.parentNode.removeChild(f);l=d=void 0;ha(a);H.scrollToPage(c);t=b;1<c&&
c<q&&(t*=2);m.style.width=t+"px";var g="container"+c;z.selectedIndex=c/2;e&&window.history.pushState({page:c},null,"?page="+c);f=document.createElement("div");f.id=g;f.style.width=t+"px";m.appendChild(f);B.applyTransformOrigin(f,"top left");f.style.margin="0";E();if(F)d=document.createElement("object"),d.setAttribute("width",""+b),d.setAttribute("height",""+v),d.setAttribute("data",c+".svg"),d.setAttribute("type","image/svg+xml"),f.appendChild(d),E();else{var n=function(){x||(p(),x=!0);var a=document.createElement("iframe");
a.setAttribute("src",c+".html");a.setAttribute("style","width: "+b+"px; height: "+v+"px; position: absolute; border: 0;");a.onload=function(){d=a};f.appendChild(a)};$.ajax({url:c+".html",success:function(a){try{var b=$("<div />").html(a).find("#jpedal").attr("id","page"+c).css({position:"absolute"});$(f).append(b);setTimeout(function(){var a=function(){window["load"+c]()};setTimeout(a,1E3);a();if("file:"==window.location.protocol){var a=h("fonts"+c),b=document.createElement("style");b.setAttribute("type",
"text/css");b.innerHTML=a.innerHTML;f.appendChild(b)}},1)}catch(e){n()}},error:n})}if(1!=c&&c!=q)if(F)l=document.createElement("object"),l.setAttribute("width",""+b),l.setAttribute("height",""+v),l.setAttribute("data",c+1+".svg"),l.setAttribute("type","image/svg+xml"),l.setAttribute("style","position: absolute; left: "+b+"px;"),f.appendChild(l),E();else{var r=function(){x||(p(),x=!0);var a=document.createElement("iframe");a.setAttribute("src",c+1+".html");a.setAttribute("style","width: "+b+"px; height: "+
v+"px; position: absolute; border: 0; left: "+b+"px;");a.onload=function(){l=a};f.appendChild(a)};$.ajax({url:c+1+".html",success:function(a){try{var e=$("<div />").html(a).find("#jpedal").attr("id","page"+(c+1)).css({position:"absolute",left:b});$(f).append(e);setTimeout(function(){var a=function(){window["load"+(c+1)]()};setTimeout(a,1E3);a();if("file:"==window.location.protocol){var a=h("fonts"+(c+1)),b=document.createElement("style");b.setAttribute("type","text/css");b.innerHTML=a.innerHTML;f.appendChild(b)}},
1)}catch(d){r()}},error:r})}};var p=function(){X.currentSelectMode==S?a.enablePanning():a.enableTextSelection()};a.enableTextSelection=function(){if(x||F)g(),e.style.visibility="hidden"};a.enablePanning=function(){if(x||F)"undefined"!=typeof d&&Y(d.contentWindow),"undefined"!=typeof l&&Y(l.contentWindow),g(),e.style.visibility="visible"};var g=function(){"undefined"==typeof e&&(e=document.createElement("div"),e.id="jpedalOverlay",e.setAttribute("style","width: inherit; height: inherit; position: absolute; z-index: 10; visibility: hidden;"),
m.insertBefore(e,m.firstChild))};return a}(),W=function(){var a={},b,e,d;a.setup=function(){k=n.MultiFile;qa();window.onpopstate=function(b){a.goToPage(b.state.page,!1)};a.goToPage(c,!1)};a.goToPage=function(e,l){f.parentNode.removeChild(f);b=void 0;ha(e);H.scrollToPage(c);t=w[c-1][0];v=w[c-1][1];m.style.width=t+"px";m.style.height=v+"px";r.scrollTop=0;z.selectedIndex=c-1;l&&window.history.pushState({page:c},null,"?page="+c);if(F)f=document.createElement("object"),f.setAttribute("width",""+t),f.setAttribute("height",
""+v),f.setAttribute("data",c+".svg"),f.setAttribute("type","image/svg+xml"),f.setAttribute("id","jpedal"),m.appendChild(f),b=f,B.applyTransformOrigin(f,"top left"),E();else{var g=function(){d||(X.currentSelectMode==S?a.enablePanning():a.enableTextSelection(),d=!0);f=document.createElement("iframe");f.setAttribute("id","jpedal");f.setAttribute("src",c+".html");f.setAttribute("style","width: "+t+"px; height: "+v+"px; position: relative; border: 0;");f.onload=function(){b=f};m.appendChild(f);B.applyTransformOrigin(f,
"top left");E()};$.ajax({url:c+".html",success:function(a){try{var b=$("<div />").html(a).find("#jpedal").css({margin:"0",overflow:"hidden",position:"relative"});$(m).append(b);setTimeout(function(){f=h("jpedal");B.applyTransformOrigin(f,"top left");E();var a=function(){window["load"+c]()};setTimeout(a,1E3);a();if("file:"==window.location.protocol){var a=h("fonts"+c),b=document.createElement("style");b.setAttribute("type","text/css");b.innerHTML=a.innerHTML;a.parentNode.removeChild(a);h("jpedal").appendChild(b)}},
1)}catch(e){g()}},error:g})}};a.enableTextSelection=function(){if(d||F)l(),e.style.visibility="hidden"};a.enablePanning=function(){if(d||F)"undefined"!=typeof b&&Y(b.contentWindow),l(),e.style.visibility="visible"};var l=function(){"undefined"==typeof e&&(e=document.createElement("div"),e.id="jpedalOverlay",e.setAttribute("style","width: inherit; height: inherit; position: absolute; z-index: 10; visibility: hidden;"),m.insertBefore(e,m.firstChild))};return a}(),V=function(){var a={},b=[],e=0,d,l,
x;a.setup=function(){k=n.SingleFile;qa();d=[];window.onpopstate=function(b){a.goToPage(b.state.page,!1)};B.applyTransformOrigin(f,"top left");v=0;t=w[0][0];for(var e=0;e<q;e++){b[e]=!1;var g=document.createElement("div");g.id="page"+(e+1);g.setAttribute("style","position:relative; width:990px; height:1185px; overflow: hidden; background-color: white; margin: 0 auto 10px;");f.appendChild(g);v+=w[e][1]+10}m.style.height=v+"px";r.onscroll=p;a.goToPage(c,!1)};var p=function(a){var d=window.pageYOffset;
e=d;setTimeout(function(){if(d==e){if(0<h("page1").getBoundingClientRect().top)ha(1),z.selectedIndex=c-1;else for(var a=1;a<=q;a++){var l=h("page"+a).getBoundingClientRect(),f=l.top,l=l.bottom-l.top;if(f<=.25*l&&f>.5*-l){ha(a);z.selectedIndex=c-1;break}}H.scrollToPage(c);for(a=1;a<=q;a++)b[a]||(l=document.getElementById("page"+a),f=l.getBoundingClientRect().top,f<=l.clientHeight&&f>=-l.clientHeight&&g(a))}},250)};a.goToPage=function(a,c){r.scrollTop=r.scrollTop+h("page"+a).getBoundingClientRect().top-
45;b[a]||g(a)};var g=function(c){b[c]=!0;if(F){var e=document.createElement("object");e.setAttribute("width",""+w[c-1][0]);e.setAttribute("height",""+w[c-1][1]);e.setAttribute("data",c+".svg");e.setAttribute("type","image/svg+xml");d[c-1]=e;h("page"+c).appendChild(e)}else{var g=function(){l||(X.currentSelectMode==S?a.enablePanning():a.enableTextSelection(),l=!0);var b=document.createElement("iframe");b.setAttribute("src",c+".html");b.setAttribute("style","width: "+w[c-1][0]+"px; height: "+w[c-1][1]+
"px; position: relative; border: 0;");d[c-1]=b;h("page"+c).appendChild(b)};$.ajax({url:c+".html",success:function(a){try{var b=$("<div />").html(a).find("#jpedal").html();$("#page"+c).html(b);setTimeout(function(){var a=function(){window["load"+c]()};setTimeout(a,1E3);a();if("file:"==window.location.protocol){var a=h("fonts"+c),b=document.createElement("style");b.setAttribute("type","text/css");b.innerHTML=a.innerHTML;a.parentNode.removeChild(a);h("jpedal").appendChild(b)}},1)}catch(e){g()}},error:g})}};
a.enableTextSelection=function(){if(l||F)na(),x.style.visibility="hidden"};a.enablePanning=function(){if(l||F){for(var a=0;a<d.length;a++)"undefined"!=typeof d[a]&&Y(d[a].contentWindow);na();x.style.visibility="visible"}};var na=function(){"undefined"==typeof x&&(x=document.createElement("div"),x.id="jpedalOverlay",x.setAttribute("style","width: inherit; height: inherit; position: absolute; z-index: 10; visibility: hidden;"),m.insertBefore(x,m.firstChild))};return a}(),N=function(){var a={},b=[],
e=[],d=[],l,f,n,g=0,k=0,u,v,A=0,C,D,E,G,y,I=!1;a.next=function(){this.goToPage(y?c+2:c+1,!0,!0)};a.prev=function(){this.goToPage(c-1,!0,!0)};a.setup=function(){var oa;m.removeAttribute("style");m.style.overflow="visible";m.style.padding="0";m.style.margin="0";m.style.webkitBackfaceVisibility="hidden";m.style.webkitPerspective="1000";I||(r.addEventListener("touchstart",ka),r.addEventListener("touchmove",la),r.addEventListener("touchend",ma),I=!0);y=window.innerWidth>window.innerHeight;ja||(y=!1);y?
Ca():qa();for(oa=1;oa<=q;oa++)b[oa]=!1;window.onpopstate=function(b){b.state&&a.goToPage(b.state.page,b.state.slide,!1)};setTimeout(function(){a.goToPage(c,!1,!1)},0)};var M=!1,H=!1,ia,Q,L=!1,ca,R,S,T,U,N,O,V,W,X,Y,P,J,K,Z,aa,ba,ka=function(a){C=M=!1;1!==a.touches.length||L||1!==p||(Q=a.touches[0].clientX,R=a.touches[0].clientX,S=a.touches[0].clientY,T=R,U=S,M=!0,ca=Date.now());Z&&(aa=!0);1===a.touches.length&&1<p&&(D=a.touches[0].clientX,E=a.touches[0].clientY,G=!0,N=k,O=g,V=N,W=O,X=Date.now(),Y=
Date.now(),P||(P=setInterval(function(){N=V;O=W;V=k;W=g;Y=X;X=Date.now()},200)));if(2===a.touches.length&&!H){C=!0;G=!1;fa(c);var b=a.touches[0].clientX-l,e=a.touches[1].clientX-l,d=a.touches[0].clientY;a=a.touches[1].clientY;n=Math.sqrt(Math.pow(Math.abs(b-e),2)+Math.pow(Math.abs(d-a),2));u=b-(b-e)/2;v=d-(d-a)/2}},la=function(a){a.preventDefault();a.stopPropagation();if(1===a.touches.length&&M&&1===p){H=!0;var b=Q-a.touches[0].clientX;0!==b&&(Q=a.touches[0].clientX,T=a.touches[0].clientX,U=a.touches[0].clientY,
ia-=b,B.applyTransform(m,"translate3d("+ia+"px, 0, 0)"))}else if(1===a.touches.length&&G){ba=!0;b=a.touches[0].clientX;a=a.touches[0].clientY;var c=a-E;k+=b-D;g+=c;D=b;E=a;da();requestAnimationFrame(function(){pa(k,g,p,!0)},h("main"))}else if(2===a.touches.length&&!L&&a.cancelable&&C&&!H&&(A=(A+1)%2,1!==A)){var e=a.touches[0].clientX-l,d=a.touches[1].clientX-l,c=a.touches[0].clientY,f=a.touches[1].clientY;a=Math.sqrt(Math.pow(Math.abs(e-d),2)+Math.pow(Math.abs(c-f),2));b=a/n;1>p*b&&(p=b=1);4<p*b&&
(b=1);p*=b;e-=(e-d)/2;c-=(c-f)/2;k=k+e-u;g=g+c-v;d=-k+e;k-=d*b-d;d=-g+c;g-=d*b-d;da();u=e;v=c;requestAnimationFrame(function(){pa(k,g,p,!0)},h("main"));n=a}},ma=function(b){var e;if(0===b.touches.length){if(H){var d=H=!1;300>Date.now()-ca&&(b=R-T,e=S-U,100<Math.abs(b)&&Math.abs(b)>.25*Math.abs(e)&&(d=!0,0<b?a.next():a.prev()));d||(b=-window.innerWidth*(c-1),y&&(b=-window.innerWidth*Math.floor(c/2)),ia>b+window.innerWidth/2?a.prev():ia<b-window.innerWidth/2?a.next():a.goToPage(c,!0,!1))}clearInterval(P);
P=null;ba&&(ba=!1,d=Date.now()-Y,b=N-k,e=O-g,J=b/(d/16),K=e/(d/16),.5>Math.abs(J)&&(J=0),.5>Math.abs(K)&&(K=0),0===J&&0===K||window.requestAnimationFrame(ga,h("main")))}},ga=function(){Z=!0;!aa&&(-.5>J||.5<J||-.5>K||.5<K)?(k-=J,g-=K,J*=.95,K*=.95,da(),pa(k,g,p,!0),window.requestAnimationFrame(ga,h("main"))):aa=Z=!1},da=function(){0<k&&(J=k=0);0<g&&(K=g=0);var a=w[c-1][0]*d[c];y&&(a*=2);var b=a*p;k<a-b&&(k=a-b,J=0);a=w[c-1][1]*d[c];b=a*p;g<a-b&&(g=a-b,K=0)},pa=function(a,b,g,f){a=Math.round(2*a)/2;
b=Math.round(2*b)/2;a=f?"translate3d("+(a+e[c])+"px, "+b+"px, 0) scale("+g*d[c]+")":"translateX("+(a+e[c])+"px) translateY("+b+"px) scale("+g*d[c]+")";b=h("page"+c);B.applyTransform(b,a)},ea=function(a){if(!b[a]){var c=document.createElement("div");c.setAttribute("id","page"+a);c.style.width=y&&1!=a&&(a<q||1===q%2)?2*t+"px":w[a-1][0]+"px";c.style.height=w[a-1][1]+"px";fa(a);e[a]=y&&1!=a?window.innerWidth*Math.floor(a/2)+l:window.innerWidth*(a-1)+l;B.applyTransform(c,"translate3d("+e[a]+"px, 0, 0) scale("+
d[a]+")");B.applyTransformOrigin(c,"top left");c.style.marginTop=f+"px";c.style.position="absolute";m.appendChild(c)}b[a]||(F?(b[a]=!0,c=document.createElement("div"),c.setAttribute("style","position: absolute"),h("page"+a).appendChild(c),$(c).load(a+".svg")):$.ajax({url:a+".html",success:function(c){b[a]||(b[a]=!0,c=$("<div />").html(c).find("#jpedal").css("position","absolute"),$("#page"+a).append(c),setTimeout(function(){var b=function(){window["load"+a]()};setTimeout(b,1E3);b()},1))}}));y&&1!=
a&&!b[a+1]&&a!=q&&(F?(b[a+1]=!0,c=document.createElement("div"),c.setAttribute("style","position: absolute; left: "+t+"px"),h("page"+a).appendChild(c),$(c).load(a+1+".svg")):$.ajax({url:a+1+".html",success:function(c){b[a+1]||(b[a+1]=!0,c=$("<div />").html(c).find("#jpedal").css("position","absolute"),(a<q||1===q%2)&&c.css("left",t),$("#page"+a).append(c),setTimeout(function(){var b=function(){window["load"+(a+1)]()};setTimeout(b,1E3);b()},1))}}))},fa=function(a){var b;b=y&&1!=a&&(a<q||1===q%2)?(window.innerWidth-
20)/(2*t):(window.innerWidth-20)/w[a-1][0];var c=(window.innerHeight-40-20)/w[a-1][1];b<c?(d[a]=b,l=10):(d[a]=c,l=(window.innerWidth-20-(y&&1!=a&&(a<q||1===q%2)?2*t*d[a]:w[a-1][0]*d[a]))/2+10);return f=(window.innerHeight-40-w[a-1][1]*d[a])/2};a.goToPage=function(e,d,g){if(1<p)p=1,requestAnimationFrame(function(){pa(0,0,p,!0);a.goToPage(e,d,g)},h("main"));else{L=!0;y&&1!==e&&1===e%2&&--e;e>q&&(e=q);fa(e);b[e]||ea(e);ia=y?-(window.innerWidth*Math.floor(e/2)):-(window.innerWidth*(e-1));d&&B.applyTransitionDuration(m,
"200ms");B.applyTransform(m,"translate3d("+ia+"px, 0, 0)");y&&1!==e&&1===e%2&&--e;ha(e);g&&window.history.pushState({page:c,slide:d},null,"?page="+c);z.selectedIndex=y?Math.floor(c/2):c-1;var f=function(){var a;L=!1;a=e;y&&1===a&&(a=0);var d=a-1,g=a+1;y&&(--d,g+=1,2===a&&(d=1));1<=d&&!b[d]&&ea(d);g<=q&&!b[g]&&ea(g);B.applyTransitionDuration(m,"");m.removeEventListener("transitionend",f,!1);m.removeEventListener("webkitTransitionEnd",f,!1);if(y)for(d=2;d<=q;d+=2)b[d]&&(d<c-2||d>c+2)&&(b[d]=!1,a=h("page"+
d),a.parentNode.removeChild(a),d<q&&(b[d+1]=!1));else for(d=1;d<=q;d++)b[d]&&(d<c-1||d>c+1)&&(b[d]=!1,a=h("page"+d),a.parentNode.removeChild(a))};d?(m.addEventListener("transitionend",f,!1),m.addEventListener("webkitTransitionEnd",f,!1)):f()}};return a}();u.setBookmarks=function(a){h("leftContent").style.top="40px";h("leftNav").style.display="block";Da(h("outlinePanel"),a);I?la.className="navBtn":Q.className="navBtn"};var Da=function(a,b){for(var c=document.createElement("ul"),d=0;d<b.length;d++)(function(){var a=
b[d],f=document.createElement("li");f.setAttribute("title","Page "+a.page);f.innerHTML=a.title;f.onclick=function(){IDRViewer.goToPage(parseInt(a.page))};c.appendChild(f);"undefined"!=typeof a.children&&Da(c,a.children)})();a.appendChild(c)};u.setDefaultViewMode=function(a){if(a===n.MultiFile||a===n.SplitSpreads||a===n.SingleFile)ba=a};u.setFirstPageName=function(a){};var Ea=function(a){for(var b=document.URL,c=b.toString().indexOf("?"),b=-1!=c?b.substr(c+1).split("&"):"",c=0;c<b.length;c++)if(b[c]=
b[c].split("="),b[c][0]==a)return b[c][1];return""};u.toggleOutlines=H.toggleOutlines;var Y=function(a){a.getSelection?a.getSelection().empty?a.getSelection().empty():a.getSelection().removeAllRanges&&a.getSelection().removeAllRanges():a.document.selection&&a.document.selection.empty()},X=function(){var a={},b,c,d=!1,f=!!window.opera||0<=navigator.userAgent.indexOf(" OPR/"),f=!!window.chrome&&!f;"undefined"!==typeof InstallTrigger?(T="-moz-grab",ga="-moz-grabbing"):f?(T="-webkit-grab",ga="-webkit-grabbing"):
ga=T="all-scroll";a.currentSelectMode=R;a.enableTextSelection=function(){this.currentSelectMode=R;ca.className="inactive navBtn";L.className="navBtn";r.style.cursor="";var a=function(a){};r.onmousedown=a;document.onmouseup=a;r.onmousemove=a;k===n.MultiFile?W.enableTextSelection():k===n.SplitSpreads?O.enableTextSelection():k===n.SingleFile&&V.enableTextSelection()};a.enablePanning=function(){this.currentSelectMode=S;ca.className="navBtn";L.className="inactive navBtn";Y(window);r.style.cursor=T;r.onmousedown=
function(a){a=a||window.event;r.style.cursor=ga;b=a.clientX;c=a.clientY;d=!0;return!1};document.onmouseup=function(a){r.style.cursor=T;d=!1};r.onmousemove=function(a){if(d)return a=a||window.event,r.scrollLeft=r.scrollLeft+b-a.clientX,r.scrollTop=r.scrollTop+c-a.clientY,b=a.clientX,c=a.clientY,!1};k===n.MultiFile?W.enablePanning():k===n.SplitSpreads?O.enablePanning():k===n.SingleFile&&V.enablePanning()};return a}();u.setSelectMode=function(a){aa||(a==R?X.enableTextSelection():X.enablePanning())};
var Ga=function(){var a=0;self.innerHeight?a=self.innerWidth:document.documentElement&&document.documentElement.clientHeight?a=document.documentElement.clientWidth:document.body&&(a=document.body.clientWidth);return a},ra=function(){var a=r.scrollTop,b=m.offsetHeight;A===M&&(D.selectedIndex=M);4<p?p=4:.25>p&&(p=.25);"undefinded"!==typeof isIE&&isIE&&(f.style.zoom=p);B.applyTransform(f,"translateX(0px) translateY(0px) scale("+p+")");m.style.width=t*p+"px";m.style.height=v*p+"px";var c=Math.floor(100*
p);aa||(D.options[0].innerHTML=c+"%");k==n.SingleFile&&(f.style.width=Math.floor(100/c*100)+"%");r.scrollTop=m.offsetHeight/b*a;sa++;1===sa%2&&E()};u.zoomIn=function(){A=M;p*=1.2;ra()};var Fa=function(){var a=G.selectedIndex;a!=k&&(k===n.SingleFile&&(r.onscroll=function(a){},D.style.display=""),k=n.IDR,m.innerHTML="",m.setAttribute("style",""),f=document.createElement("div"),f.id="jpedal",m.appendChild(f),A=ma,D.selectedIndex=A,a===n.MultiFile?W.setup():a===n.SplitSpreads?O.setup():a===n.SingleFile&&
(D.style.display="none",V.setup(),E()))};u.zoomUpdate=function(){A=D.selectedIndex;A!=M&&E()};var E=function(){var a,b,e,d,f,h=function(){a=r.clientWidth;k===n.SingleFile&&(t=P[c].width);p=(a-6)/t},m=function(){a=r.clientWidth;b=r.clientHeight;k==n.SingleFile&&(t=P[c].width,f=P[c].height);d=k!=n.SplitSpreads||1!==c&&c!==q?(a-6)/t:(a-6)/(2*t);e=(b-6)/v;k==n.SingleFile&&(e=(b-6)/f);p=d>e?e:d};switch(A){case ma:var g=t;k!==n.SplitSpreads||1!==c&&c!==q||(g=2*t);g>v&&v>r.clientHeight?m():g>Ga()&&ja?h():
p=1;break;case wa:h();break;case xa:b=r.clientHeight;e=(b-6)/v;k==n.SingleFile&&(f=P[c].height,e=(b-6)/f);p=e;break;case ya:m();break;case va:p=1}ra()};u.zoomOut=function(){A=M;p/=1.2;ra()};u.goToPage=function(a){0===a&&(a=parseInt(z.options[z.selectedIndex].value));k===n.IDR?N.goToPage(a,!1,!0):k===n.SplitSpreads?O.goToPage(a,!0):k===n.MultiFile?W.goToPage(a,!0):k===n.SingleFile&&V.goToPage(a,!0)};u.next=function(){k===n.IDR?N.next():k===n.SplitSpreads?c+1<=q&&this.goToPage(c+2):c<q&&this.goToPage(c+
1)};u.prev=function(){k===n.IDR?N.prev():1<c&&this.goToPage(c-1)};var U=function(a,b,c){if(b.addEventListener)b.addEventListener(a,c,!1);else if(b.attachEvent)return b.attachEvent("on"+a,c)},h=function(a){return document.getElementById(a)};u.toggleThumbnails=H.toggleThumbnails;var da=function(){ka.className=document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement?"navBtn open":"navBtn closed"};u.toggleFullScreen=function(){document.fullscreenElement||
document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement?document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen():document.body.requestFullscreen?document.body.requestFullscreen():document.body.msRequestFullscreen?document.body.msRequestFullscreen():document.body.mozRequestFullScreen?document.body.mozRequestFullScreen():
document.body.webkitRequestFullscreen&&document.body.webkitRequestFullscreen()};u.addToolBarHyperlink=function(a,b){var c=new Image;c.src=a;var d=document.createElement("a");d.href=b;d.className="customNavLink";d.appendChild(c);d.setAttribute("target","_blank");h("mainNav").insertBefore(d,ua)};u.disableViewModeSwitching=function(){ta=!0};u.on=function(a,b){"pagechange"===a&&(za=b)};var ha=function(a){if(a!=c){var b=za;b&&b({page:a});c=a}};return u}();