You are on page 1of 10

var defaultViewManager="scroll";var adjacentLoadPages=3;var adjacentFontLoadPage s=8;var ie6_pngfix_shim="/images/4gen/trans_1x1.gif";var pagePadding=30;var extr asWidth=315;var fontLoaderStrategy;var FONT_LOADER_EOT=1;var FONT_LOADER_CSS_TTF =2;var FONT_LOADER_MULTI_SVG=3;var FONT_SERV_VERSION=12;if(!window.

console){wind ow.console={log:function(){}}}var DocumentManager=(function(){var r={_keyStr:"AB CDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",decode:function (I){var G="";var P,N,L;var O,M,K,J;var H=0;I=I.replace(/[^A-Za-z0-9\+\/\=]/g,"") ;while(H<I.length){O=this._keyStr.indexOf(I.charAt(H++));M=this._keyStr.indexOf( I.charAt(H++));K=this._keyStr.indexOf(I.charAt(H++));J=this._keyStr.indexOf(I.ch arAt(H++));P=(O<<2)|(M>>4);N=((M&15)<<4)|(K>>2);L=((K&3)<<6)|J;G=G+String.fromCh arCode(P);if(K!=64){G=G+String.fromCharCode(N)}if(J!=64){G=G+String.fromCharCode (L)}}G=r._utf8_decode(G);return G},_utf8_decode:function(G){var H="";var J=0;var L=0;var K=0;var I=0;while(J<G.length){L=G.charCodeAt(J);if(L<128){H+=String.fro mCharCode(L);J++}else{if((L>191)&&(L<224)){I=G.charCodeAt(J+1);H+=String.fromCha rCode(((L&31)<<6)|(I&63));J+=2}else{I=G.charCodeAt(J+1);c3=G.charCodeAt(J+2);H+= String.fromCharCode(((L&15)<<12)|((I&63)<<6)|(c3&63));J+=3}}}return H}};function j(G){}j.prototype.initEventHelper=function(){this.eventListenerEnabled=true;thi s.eventListeners={};for(var G=0;G<this.possibleEvents.length;G++){this.eventList eners[this.possibleEvents[G]]={}}};j.prototype.addEvent=function(G,H){if(!this.e ventListeners[G]){throw G+" is not a valid type of event"}if(!this.eventListener s[G].next_uid){this.eventListeners[G].next_uid=1}if(!H._event_listener_uid){H._e vent_listener_uid=this.eventListeners[G].next_uid;this.eventListeners[G].next_ui d++}this.eventListeners[G][H._event_listener_uid]=H};j.prototype.removeEvent=fun ction(G,H){delete this.eventListeners[G][H._event_listener_uid]};j.prototype.fir eEvent=function(J,K){if(!this.eventListenerEnabled){return}var G=this.eventListe ners[J];var H=[];if(arguments.length>1){H[arguments.length-2]=null;for(var L=1;L <arguments.length;L++){H[L-1]=arguments[L]}}var I=this;function M(O){O.apply(I,H )}for(var N in G){if(N!="next_uid"&&G.hasOwnProperty(N)){M(G[N])}}};function p(H ,G){H.prototype.addEvent=j.prototype.addEvent;H.prototype.removeEvent=j.prototyp e.removeEvent;H.prototype.fireEvent=j.prototype.fireEvent;H.prototype.initEventH elper=j.prototype.initEventHelper;H.prototype.possibleEvents=G}var k="font_prelo ad_bed";var d="\uF8FF";var F=function(){return !document.styleSheets[0].insertRu le};var s=function(G,H){if(F()){var I=G.innerHTML;G.href=H;if(G.innerHTML!=I){G. innerHTML=I}}else{G.href=H}};var i=(function(){var G=navigator.userAgent.toLower Case();return G.search("android 2.2")>-1})();var e=(function(){var G=navigator.u serAgent.toLowerCase();return(G.search("mobile")>-1&&G.search("safari")>-1&&!i)} )();var A=navigator.userAgent.indexOf("AppleWebKit/")>-1;fontLoaderStrategy=(fun ction(){if(F()){return FONT_LOADER_EOT}else{if(e){return FONT_LOADER_CSS_TTF}els e{return FONT_LOADER_CSS_TTF}}})();if(F()){adjacentFontLoadPages=5;adjacentLoadP ages=2}if(i){adjacentFontLoadPages=1;adjacentLoadPages=1}function E(L,J,H,K,I,G) {this.id=L;this.shortstyle=J;this.family=H;this.fallback=K;this.weight=I;this.st yle=G}E.prototype.eotCssRule=function(G){var H="src: url("+G+this.family+".eot); font-family: "+this.family+"; font-weight: "+this.weight+"; font-style: "+this. style;return"@font-face {"+H+"}"};E.prototype.ttfCssRule=function(G){var H="src: url("+G+this.family+".ttf) format('truetype'); font-family: "+this.family+"; fo nt-weight: "+this.weight+"; font-style: "+this.style;return"@font-face {"+H+"}"} ;E.prototype.svgCssRule=function(G){var H="src: url("+G+"#"+this.family+") forma t('svg'); font-family: "+this.family+"; font-weight: "+this.weight+"; font-style : "+this.style;return"@font-face {"+H+"}"};E.prototype.createPreloadElem=functio n(){return"<span style='font-family: "+this.family+"'>scribd.</span> "};function B(G){this.fonts=[];this.docManager=G;this._cssRuleQueue=[];this._fontLoadQueue= []}B.prototype._makeNewStyleBlock=function(){var H=document.createElement("style ");if(!window.createPopup){H.appendChild(document.createTextNode(""))}var G=docu ment.getElementsByTagName("head")[0];G.appendChild(H);return H};B.prototype._ins ertCssRule=function(G){this._cssRuleQueue.push(G)};B.prototype._flushCssRuleQueu e=function(I){if(this._cssRuleQueue.length>0){var H=(I&&document.getElementById( I))||this._makeNewStyleBlock();var G=this._cssRuleQueue.join("\n");if(F()){H.sty leSheet.cssText=G}else{if(!window.createPopup){H.appendChild(document.createText Node(G))}else{H.innerHTML=G}}this._cssRuleQueue=[]}};B.prototype.getFontAggregat orHostForFonts=function(J){var I=[];for(var H=0;H<J.length;H++){I.push(J[H].shor

tstyle+J[H].id)}I.sort();var G=this.docManager.nextFontAggregatorHost()+"/"+this .docManager.assetPrefix+"/"+I.join(",")+"/"+FONT_SERV_VERSION+"/";switch(fontLoa derStrategy){case FONT_LOADER_EOT:break;case FONT_LOADER_CSS_TTF:if(!i){G+="ttfs .css"}break;case FONT_LOADER_MULTI_SVG:G+="fonts.svg";break}return G};B.prototyp e._addTTFRules=function(J,H){for(var I=0;I<J.length;I++){var G=J[I];this._insert CssRule(G.ttfCssRule(H))}};B.prototype._addSVGRules=function(J,H){for(var I=0;I< J.length;I++){var G=J[I];this._insertCssRule(G.svgCssRule(H))}};B.prototype._add EOTRules=function(J,H){for(var I=0;I<J.length;I++){var G=J[I];this._insertCssRul e(G.eotCssRule(H))}};B.prototype._nextPreloadId=function(){if(!this._preloadId){ this._preloadId=0}var G="preload_bed"+this._preloadId;this._preloadId+=1;return G};B.prototype._addCSSWebkit=function(N,H){var Q=this;var K=document.createEleme nt("iframe");function R(){var S=document.createElement("div");var T=Q._nextPrelo adId();S.innerHTML=O;var U=document.getElementById(k);var V=window.setInterval(f unction(){if(K.contentDocument.styleSheets.length>0){window.clearInterval(V);K.c ontentDocument.body.getBoundingClientRect();U.appendChild(S);window.setTimeout(f unction(){K.contentDocument.body.getBoundingClientRect();Q._addCSSLink(H)},500)} },0)}var P=this._nextPreloadId();K.id=P;var O="";for(var J=0;J<N.length;J++){var G=N[J];O+=G.createPreloadElem()}var I=this._makeNewStyleBlock();K.addEventListe ner("load",function(){R()},false);K.style.display="none";document.body.appendChi ld(K);K.contentDocument.body.innerHTML=O;var M=K.contentDocument.createElement(" link");M.href=H;M.rel="stylesheet";M.type="text/css";M.media="screen";var L=K.co ntentDocument.getElementsByTagName("head")[0];L.appendChild(M)};B.prototype._add CSSLink=function(G){var I=document.createElement("link");I.href=G;I.rel="stylesh eet";I.type="text/css";var H=document.getElementsByTagName("head")[0];H.appendCh ild(I)};B.prototype.flushFontQueue=function(){if(this._fontLoadQueue.length===0) {return}if(this.docManager.displayType=="rasterize"){return}var G=this._fontLoad Queue;this._fontLoadQueue=[];var H=this.getFontAggregatorHostForFonts(G);switch( fontLoaderStrategy){case FONT_LOADER_EOT:this._addEOTRules(G,H);break;case FONT_ LOADER_CSS_TTF:if(i){this._addTTFRules(G,H)}else{if(A){this._addCSSWebkit(G,H)}e lse{this._addCSSLink(H)}}break;case FONT_LOADER_MULTI_SVG:this._addSVGRules(G,H) ;break}this._flushCssRuleQueue()};B.prototype.addFontToQueue=function(H){var G=t his.fonts[H];if(!G._loadQueued){G._loadQueued=true;this._fontLoadQueue.push(G)}} ;B.prototype.addFont=function(M,K,I,L,J,H){var G=new E(M,K,I,L,J,H);this.fonts[M ]=G};B.prototype.setNumFonts=function(G){for(var H=0;H<G;H++){this.fonts[H]=new E(H,"","ff"+H,"sans-serif","normal","normal")}};B.prototype._initHidersCSS=funct ion(){var G=[];for(var H=0;H<this.fonts.length;H++){G.push("."+this.fonts[H].fam ily)}this._insertCssRule(G.join(", ")+" {display: none;}\n")};B.prototype._initF amilyCSS=function(){for(var G=0;G<this.fonts.length;G++){var I=this.fonts[G].fam ily;var K=this.fonts[G].fallback;var J=this.fonts[G].weight;var H=this.fonts[G]. style;if(F()){this._insertCssRule("."+I+" {font-family: "+I+";\n}")}else{this._i nsertCssRule("."+I+" {font-family: "+I+", "+K+"; font-weight: "+J+"; font-style: "+H+";\n}")}}};B.prototype.initStyles=function(G){if(this.docManager.displayTyp e=="rasterize"){return}this._initFamilyCSS();switch(fontLoaderStrategy){case FON T_LOADER_EOT:break;case FONT_LOADER_CSS_TTF:if(!i){this._initHidersCSS()}break;c ase FONT_LOADER_MULTI_SVG:break}this._flushCssRuleQueue("preload_styler")};B.pro totype.setupTestElements=function(){if(fontLoaderStrategy!=FONT_LOADER_CSS_TTF|| A||this.docManager.displayType=="rasterize"){return}var J="";for(var I=0;I<this. fonts.length;I++){var G=this.fonts[I];J+=G.createPreloadElem()}var H=document.ge tElementById(k);H.innerHTML=J;document.body.appendChild(H);this._insertCssRule(" #"+k+" span {display: block; visibility: hidden}");this._flushCssRuleQueue()};fu nction a(G,H){this.pages=[];this.loaded=false;this.fonts={};this.numFonts=0;this .fontLoader=H;this.groupNum=G||0}a.prototype.addPage=function(I){for(var H=0;H<I .fonts.length;H++){var G=I.fonts[H];if(this.fonts[G]===undefined){this.fonts[G]= true;this.numFonts+=1}}this.pages.push(I)};a.prototype.isFull=function(){var I=t his.pages.length;var H=this.groupNum;var G=this.numFonts;if(fontLoaderStrategy== FONT_LOADER_EOT){return(this.hasLoaded||G>50||(G>=20&&((H===0&&I>=adjacentFontLo adPages+3)||(I>=15))))}else{if(fontLoaderStrategy==FONT_LOADER_MULTI_SVG||i){ret urn(this.hasLoaded||(G>=5&&I>=adjacentFontLoadPages))}else{return(this.hasLoaded ||G>100||(G>=20&&((H===0&&I>=adjacentFontLoadPages+3)||(I>=100))))}}};a.prototyp e.load=function(H){if(this.hasLoaded){return}this.hasLoaded=true;var G=this;func

tion I(){for(var J in G.fonts){if(G.fonts.hasOwnProperty(J)){G.fontLoader.addFon tToQueue(J)}}G.fontLoader.flushFontQueue()}if(H){window.setTimeout(function(){I( )},H)}else{I()}};a.prototype.newNextGroup=function(){return new a(this.groupNum+ 1,this.fontLoader)};var t=1;var D=2;var b=3;var C=4;var v=(function(){if(documen t.documentElement.style.WebkitTransform!==undefined){return t}else{if(document.d ocumentElement.style.MozTransform!==undefined){return D}else{if(document.documen tElement.style.OTransform!==undefined){return C}else{return b}}}})();function o( J){for(var H in this._defaultParams){if(this._defaultParams.hasOwnProperty(H)){t his[H]=J[H]||this._defaultParams[H]}}for(var G=0;G<this._requiredParams.length;G ++){var I=this._requiredParams[G];if(!this[I]){throw"Missing required Page param : "+I}}if(!this.contentUrl&&!this.innerPageElem){throw"Must initialize a page wi th either a contentUrl or innerPageElem element"}if(this.containerElem.boundToPa geObj===true){throw"Container Elem is already bound to a page. We shouldn't get here"}this.containerElem.boundToPageObj=true;this._targetWidth=null;this._inner PageVisible=!!this.innerPageElem;this._imagesTurnedOn=false;this.boundingRect=nu ll;this.isVisible=false;this.displayDirty=true;this.displayOn=null;this.loadHasS tarted=!!this.innerPageElem}o.prototype._defaultParams={containerElem:null,inner PageElem:null,contentUrl:null,origWidth:null,origHeight:null,fonts:null,docManag er:null,pageNum:null};o.prototype._requiredParams=["origWidth","origHeight","fon ts","docManager","containerElem","pageNum"];o.prototype._updateBoundingRect=func tion(){var L,K,J,H;if(this.containerElem.getBoundingClientRect){var I=this.conta inerElem.getBoundingClientRect();var G=this.docManager.viewportManager.viewRect; K=I.left+G.left;L=I.top+G.top;J=I.right-I.left;H=I.bottom-I.top;this.boundingRec t={left:K,top:L,bottom:L+H,right:K+J,width:J,height:H}}else{L=this.containerElem .offsetTop;K=this.containerElem.offsetLeft;J=this.containerElem.offsetWidth;H=th is.containerElem.offsetHeight;this.boundingRect={left:K,top:L,bottom:L+H,right:K +J,width:J,height:H}}};o.prototype._setContainerContents=function(I){var H=/<nos cript *><img[^<>]*\/><\/noscript *>/g;this.containerElem.innerHTML=I.replace(H," ")+this.containerElem.innerHTML;var G=this;this.innerPageElem=this.containerElem .children[0];this.turnOnLinks();this.turnOnImages();this.fixSVGFonts();this.disp layDirty=true;if(this.displayOn){this.display()}else{this.hide()}};o.prototype.f ixSVGFonts=function(){if(this._svgFontsFixed){throw"Already fixed the svg fonts" }if(!this.innerPageElem){return}if(e){var H=function(L){if(L.nodeType==document. TEXT_NODE){var I=L.textContent.search(/[ \n][^ \n ]/);if(I>=0){H(L.splitText(I+ 1))}}else{var K=L.childNodes;for(var J=0;J<K.length;J++){H(K[J])}}};var G=functi on(K){var J=K.childNodes;for(var I=0;I<J.length;I++){var M=J[I];if(M.nodeType==d ocument.ELEMENT_NODE){G(M)}else{var L=J[I+1];if(L&&L.nodeName=="#text"){K.insert Before(document.createElement("span"),L)}}}};H(this.innerPageElem);G(this.innerP ageElem)}this._svgFontsFixed=true};o.prototype.imagePageContent=function(G){str= "<img src='"+G+"'></img>";return str};o.prototype.load=function(){this.currently Loading=true;this.loadHasStarted=true;if(this.innerPageElem){throw"We already ha ve loaded this page, but it looks like you called loadPage again"}this.loadFonts ();var J="page"+this.pageNum+"_callback";if(window[J]){try{delete window[J]}catc h(I){window[J]=undefined}}if(this.docManager.displayType=="rasterize"){delete th is.currentlyLoading;this._setContainerContents(this.imagePageContent(this.conten tUrl));return}var H=document.createElement("script");var G=this;window[J]=functi on(L){document.body.removeChild(H);var M=L[0];delete G.currentlyLoading;G._setCo ntainerContents(M);G.docManager.fireEvent("pageLoaded",G.containerElem);try{dele te window[J]}catch(K){window[J]=undefined}};H.src=this.contentUrl;H.type="text/j avascript";H.charset="UTF-8";document.body.appendChild(H)};o.prototype.remove=fu nction(){if(this.innerPageElem){var G=this.innerPageElem.parentNode;G.removeChil d(this.innerPageElem);delete this.innerPageElem;delete this.currentLoading;delet e this.loadHasStarted;this._linksTurnedOn=false;this._imagesTurnedOn=false;this. _svgFontsFixed=false}};o.prototype.display=function(H,G){if(this.displayOn&&!thi s.displayDirty){return}this.displayOn=true;if(this.currentlyLoading){return}else {if(!this.innerPageElem){if(this.loadHasStarted){return}else{if(H){this.load();r eturn}else{return}}}}this.displayDirty=false;if(!G){if(!this._linksTurnedOn){thi s.turnOnLinks()}if(!this._imagesTurnedOn){this.turnOnImages()}if(!this._svgFonts Fixed){this.fixSVGFonts()}}this.loadFonts();if(this._innerPageVisible){return}th is.containerElem.className=this.containerElem.className.replace(/placeholder|not

_visible/g,"");this._innerPageVisible=true;if(!G){this._fitContentsToWidth();thi s.innerPageElem.style.display="block"}};o.prototype.hide=function(){if(!this.dis playOn&&!this.displayDirty){return}this.displayOn=false;if(!this.innerPageElem){ return}this.displayDirty=false;this.containerElem.className=this.containerElem.c lassName+" not_visible";this._innerPageVisible=false;this.innerPageElem.style.di splay="none"};o.prototype.setLoadFontGroup=function(G){G.addPage(this);this.load FontGroup=G};o.prototype.loadFonts=function(){this.loadFontGroup.load()};var q=! !(document.all&&(/msie 6./i).test(navigator.appVersion)&&window.ActiveXObject);o .prototype._setZoomScale=function(I){var H=this.innerPageElem;switch(v){case t:H .style.WebkitTransform="scale("+I+")";H.style.WebkitTransformOrigin="top left";b reak;case D:H.style.MozTransform="scale("+I+")";H.style.MozTransformOrigin="top left";break;case C:H.style.OTransform="scale("+I+")";H.style.OTransformOrigin="t op left";break;case b:if(!H.originalZoom){H.originalZoom=H.currentStyle.zoom=="n ormal"?1:parseFloat(H.currentStyle.zoom)/100;if(q&&!this.docManager._isEmbed){H. originalZoom*=1.35}}H.style.zoom=(H.originalZoom*I*100)+"%";if(q){var G=this.inn erPageElem;setTimeout(function(){G.style.marginLeft=G.style.marginLeft===""?0:"" },500)}break;default:throw"Unknown scale method "+v}};o.prototype._fitContentsTo Width=function(){if(this._targetWidth&&this.innerPageElem&&this._innerPageVisibl e){var G=this._targetWidth/this.origWidth;this._setZoomScale(G);this._targetWidt h=null}};o.prototype.setWidth=function(H){var G=Math.ceil((H/this.origWidth)*thi s.origHeight);this.containerElem.style.width=H+"px";this.containerElem.style.hei ght=G+"px";this._targetWidth=H;this._fitContentsToWidth()};o.prototype.setBounds =function(H,G){if(this.origWidth/this.origHeight>H/G){G=Math.ceil((H/this.origWi dth)*this.origHeight)}else{H=Math.ceil((G/this.origHeight)*this.origWidth)}this. containerElem.style.width=H+"px";this.containerElem.style.height=G+"px";this._ta rgetWidth=H;this._fitContentsToWidth()};o.prototype.turnOnImages=function(){if(! this.innerPageElem){throw"Can't turn on images for a page that's not loaded"}if( this._imagesTurnedOn){throw"Images have already been turned on for this document "}this._imagesTurnedOn=true;var I=this.innerPageElem.getElementsByTagName("img") ;for(var H=0;H<I.length;H++){var G=I[H];if(G.className.toLowerCase().search("abs img")>-1){if(!G.src){var J=this.docManager.subImageSrc(G.getAttribute("orig"));i f(this.docManager.enablePNGHack){G.style.filter="progid:DXImageTransform.Microso ft.AlphaImageLoader(src='"+J+"', sizingMethod='scale')";G.src=ie6_pngfix_shim}el se{G.src=J}G.removeAttribute("orig");G.style.display="block"}}}};o.prototype.tur nOnLinks=function(){if(!this.innerPageElem){throw"Can't turn on links for a page that's not loaded"}if(this._linksTurnedOn){throw"Links have already been turned on for this document"}this._linksTurnedOn=true;var J=this.innerPageElem.getElem entsByTagName("a");for(var I=0;I<J.length;I++){var G=J[I];if(G.className.toLower Case().search("ll")>-1){if(!G.href){var K=G.getAttribute("orig");if(K){var H=r.d ecode(K).replace(/^j[\W]*a[\W]*v[\W]*a[\W]*s[\W]*c[\W]*r[\W]*i[\W]*p[\W]*t[\W]*: |^f[\W]*i[\W]*l[\W]*e[\W]*:/ig,"");if(H.search(/^page/)>-1){G.onclick=(function( L){return function(){window.location.hash="#outer_page_"+L.substring(4)}})(H)}el se{if(H.search(/^mailto:/)>=0){}else{if(H.search(/^(http|ftp)/)<0){H="http://"+H }}G.target="_blank";s(G,H);G.rel="nofollow"}}}}}};function z(){this.initEventHel per();this.viewRect=null;this.enabled=false;var G=this;this._scrollCallback=func tion(){G._eventHandler("scroll")};this._resizeCallback=function(H){G._eventHandl er("resize")}}p(z,["vertical","horizontal","either","resize"]);z.prototype._make ViewRect=function(){if(this.container===window){var M=document.documentElement;v ar L=window.scrollY||window.pageYOffset||M.scrollTop;var K=window.scrollX||windo w.pageXOffset||M.scrollLeft;var J=window.innerWidth||M.clientWidth;var G=window. innerHeight||M.clientHeight}else{var L=this.container.scrollTop;var K=this.conta iner.scrollLeft;var J=this.container.clientWidth;var G=this.container.clientHeig ht}var I=K+J;var H=L+G;return{top:L,left:K,right:I,bottom:H,width:J,height:G}};z .prototype._updateViewRect=function(){var I=this.viewRect;this.viewRect=this._ma keViewRect();var H=!I||I.left!=this.viewRect.left||I.width!=this.viewRect.width; var G=!I||I.top!=this.viewRect.top||I.height!=this.viewRect.height;return{xChang ed:H,yChanged:G}};z.prototype._eventHandler=function(G){var H=this._updateViewRe ct();if((G=="resize"||G=="both")&&(H.xChanged||H.yChanged)){this.fireEvent("resi ze",this.viewRect)}if(H.xChanged||H.yChanged){this.fireEvent("either",this.viewR ect)}if(H.xChanged){this.fireEvent("horizontal",this.viewRect)}if(H.yChanged){th

is.fireEvent("vertical",this.viewRect)}};z.prototype.enable=function(G){if(this. enabled){throw"ViewportManager has already been enabled"}this.enabled=true;this. container=G||window;this._eventHandler("both");if(window.addEventListener){windo w.addEventListener("resize",this._resizeCallback,false);if(this.container===wind ow){window.document.addEventListener("scroll",this._scrollCallback,false)}else{t his.container.addEventListener("scroll",this._scrollCallback,false)}}else{if(win dow.attachEvent){window.attachEvent("onresize",this._resizeCallback);if(this.con tainer===window){window.attachEvent("onscroll",this._scrollCallback)}else{this.c ontainer.attachEvent("onscroll",this._scrollCallback)}}}};z.prototype.disable=fu nction(){if(!this.enabled){throw"ViewportManager is already been enabled"}this.e nabled=false;if(this.container.removeEventListener){window.removeEventListener(" resize",this._resizeCallback,false);this.container.removeEventListener("scroll", this._scrollCallback,false)}else{if(window.detatchEvent){window.detatchEvent("on resize",this._resizeCallback);this.container.detatchEvent("onscroll",this._scrol lCallback)}}};function u(H,I,J){this.initEventHelper();this.viewManager=H;this.p age=I;this.oldPage=J==I?null:J;this.pretty=false;var G=this;this._animateCssForw ardCallback=function(){G.oldPage.containerElem.style.display="none";G.oldPage.hi de();$(G.oldPage.containerElem).removeClassName("pageflipForward");G.oldPage.con tainerElem.removeEventListener("webkitAnimationEnd",G._animateCssForwardCallback );G.fireEvent("afterAnimation","css");G.page._updateBoundingRect();G.oldPage._up dateBoundingRect()};this._animateCssBackwardCallback=function(){G.oldPage.contai nerElem.style.display="none";G.oldPage.hide();$(G.page.containerElem).removeClas sName("pageflipBackward");G.page.containerElem.removeEventListener("webkitAnimat ionEnd",G._animateCssBackwardCallback);G.fireEvent("afterAnimation","css");G.pag e._updateBoundingRect();G.oldPage._updateBoundingRect()}}p(u,["afterDisplay","be foreAnimation","afterAnimation"]);var f=1;var m=2;var h=3;u.prototype._detectAni mationType=function(){var G=this.page.containerElem.style;if(G.WebkitAnimationNa me!==undefined){return f}else{if(G.WebkitTransform!==undefined||G.MozTransform!= =undefined||G.transform!==undefined){return m}else{return h}}};u.prototype._cssF orward=function(){this.oldPage.isVisible=false;this.oldPage.containerElem.addEve ntListener("webkitAnimationEnd",this._animateCssForwardCallback);this.fireEvent( "beforeAnimation","css");$(this.oldPage.containerElem).addClassName("pageflipFor ward")};u.prototype._cssBackward=function(){this.page.isVisible=true;this.page.c ontainerElem.addEventListener("webkitAnimationEnd",this._animateCssBackwardCallb ack);this.fireEvent("beforeAnimation","css");$(this.page.containerElem).addClass Name("pageflipBackward")};u.prototype._animateCss=function(){this.page.container Elem.style.display="";if(this.oldPage.pageNum<this.page.pageNum){this._cssForwar d()}else{this._cssBackward()}};u.prototype._jsForward=function(){var L=null;var K=this.oldPage.containerElem;var I=this;var J;var H;$(K).addClassName("basicPage flipForward");this.page.containerElem.style.display="";this.fireEvent("beforeAni mation","js");function G(){var O=new Date().valueOf();var M=(O-J)/(H-J);var N="s caleX("+(1-M/2*2)+") skewY("+-Math.sin(((1-M/2)*Math.PI))/5+"rad)";K.style.Webki tTransform=N;K.style.MozTransform=N;if(M>1){window.clearInterval(L);$(K).removeC lassName("basicPageflipForward");K.style.display="none";K.style.WebkitTransform= "";K.style.MozTransform="";I.fireEvent("afterAnimation","js");return}}J=new Date ().valueOf();H=J+600;L=window.setInterval(G,1)};u.prototype._jsBackward=function (){var M=null;var K=this.page.containerElem;var L=this.oldPage.containerElem;var I=this;var J;var H;this.fireEvent("beforeAnimation","js");$(K).addClassName("ba sicPageflipBackward");function G(){var P=new Date().valueOf();var N=(P-J)/(H-J); var O="scaleX("+(N/2*2)+") skewY("+-Math.sin(((0.5+N/2)*Math.PI))/5+"rad)";K.sty le.WebkitTransform=O;K.style.MozTransform=O;K.style.display="";if(N>1){window.cl earInterval(M);$(K).removeClassName("basicPageflipBackward");K.style.WebkitTrans form="";K.style.MozTransform="";L.style.display="none";I.fireEvent("afterAnimati on","js");return}}J=new Date().valueOf();H=J+600;M=window.setInterval(G,1)};u.pr ototype._animateJs=function(){if(this.oldPage.pageNum<this.page.pageNum){this._j sForward()}else{this._jsBackward()}};u.prototype._basic=function(){this.page.con tainerElem.style.display="";if(this.oldPage){this.oldPage.isVisible=false;this.o ldPage.containerElem.style.display="none";this.oldPage.hide()}};u.prototype.widt h=function(){return this.viewManager._zoomedPageWidth()};u.prototype.go=function (){if(!(this.pretty&&this.oldPage)){this._basic()}else{switch(this._detectAnimat

ionType()){case f:this._animateCss();break;case m:this._animateJs();break;case h :this._basic()}}this.page.display(true);this.page.isVisible=true;if(this.oldPage ){this.oldPage._updateBoundingRect()}this.page._updateBoundingRect();this.fireEv ent("afterDisplay")};function y(){}y.prototype.name=function(){return this._name };y.prototype.register=function(H,G){if(this.registered){throw"This ViewManager is already registered"}this.registered=true;this.documentManager=H;this.viewport Manager=G;this._currentPageWidth=defaultViewWidth;this._currentZoomMultiplier=1; this._updatePageWidths();var I=this.documentManager.firstVisiblePage;this._regis ter(H,G);if(I){this.documentManager.gotoPage(I.pageNum,{pretty:false})}};y.proto type._zoomedPageWidth=function(){return this._currentPageWidth*this._currentZoom Multiplier};y.prototype._updatePageWidths=function(){this.documentManager.setPag eWidths(this._zoomedPageWidth())};y.prototype.isTopPageInView=function(){return true};y.prototype._register=function(H,G){};y.prototype.unregister=function(){if (!this.registered){throw"This ViewManager is already unregistered"}if(this.isFul lscreen){this.exitFullscreen()}this._checkBodyWidth();this._unregister();this.re gistered=false;delete this.documentManager;delete this.viewportManager};y.protot ype._unregister=function(){};y.prototype.gotoPage=function(H,G){if(!this.registe red){throw"ViewManager must be registerd to call gotoPage"}this._gotoPage(H,G)}; y.prototype._gotoPage=function(H,G){};y.prototype._fireHideExtras=function(){thi s.documentManager._fireHideExtras();this._extrasHidden=true};y.prototype._fireSh owExtras=function(){this.documentManager._fireShowExtras();this._extrasHidden=fa lse};y.prototype.enterFullscreen=function(){if(this.isFullscreen){throw"Fullscre en is already set"}this._checkBodyWidth();this.viewportManager.addEvent("resize" ,this._fullscreenResizedCallback);this._fireHideExtras();this.resetZoom();this._ enterFullscreen();this._fullscreenResized(this.viewportManager.viewRect);this._c urrentPageWidth=this.viewportManager.viewRect.width;this.isFullscreen=true;var G =this.documentManager.firstVisiblePage;if(G){this.documentManager.gotoPage(G.pag eNum,{pretty:false})}this.documentManager._fireEnteredFullscreen()};y.prototype. exitFullscreen=function(){if(!this.isFullscreen){throw"Fullscreen is not set"}th is.viewportManager.removeEvent("resize",this._fullscreenResizedCallback);this._f ireShowExtras();this.resetZoom();this._exitFullscreen();this.isFullscreen=false; var G=this.documentManager.firstVisiblePage;if(G){this.documentManager.gotoPage( G.pageNum,{pretty:false})}this.documentManager._fireExitedFullscreen()};y.protot ype._viewBarWidth=function(){if(this._extrasHidden){return 0}else{return this.do cumentManager.options.extrasWidth}};y.prototype._enterFullscreen=function(){};y. prototype._exitFullscreen=function(){};y.prototype._fullscreenResized=function(G ){};y.prototype._scrollWithZoom=function(G,H){window.scrollTo(0,G.top*H)};y.prot otype.zoom=function(H){var G=this.viewportManager.viewRect;this._currentZoomMult iplier*=H;this._checkBodyWidth();this._updatePageWidths();this.documentManager.s etIsScrolling(true);this._scrollWithZoom(G,H);this._zoomed();this.documentManage r.setIsScrolling(false);this.documentManager._fireZoomed(H)};y.prototype._zoomed =function(){};y.prototype.resetZoom=function(){this._currentZoomMultiplier=1;thi s._checkBodyWidth();this._updatePageWidths();this._zoomed()};y.prototype._checkB odyWidth=function(G){var I=document.documentElement.clientWidth;var H=this._zoom edPageWidth()+this._viewBarWidth();globalHeader=document.getElementById("global_ header");if(H>I){document.body.style.width=H+"px";if(globalHeader){globalHeader. style.width=I+"px"}}else{document.body.style.width="100%";if(globalHeader){globa lHeader.style.width="100%"}}};function l(){this._name="book";this.currentPageId= null;var G=this;this._fullscreenResizedCallback=function(H){G._fullscreenResized (H)}}l.prototype=new y();l.prototype._register=function(H,G){this._prepareDispla y()};l.prototype._unregister=function(){for(var G in this.documentManager.pages) {if(this.documentManager.pages.hasOwnProperty(G)){var H=this.documentManager.pag es[G];H.containerElem.style.display=""}}};l.prototype._prepareDisplay=function() {for(var G in this.documentManager.pages){if(this.documentManager.pages.hasOwnPr operty(G)){var H=this.documentManager.pages[G];H.hide();H.containerElem.style.zI ndex=this.documentManager.maximumPageNumber()-H.pageNum;H.containerElem.style.di splay="none"}}this.documentManager.setPageMissingModulesVisible(false);this.docu mentManager.gotoPage(this.documentManager.currentPageNum()||1)};l.prototype._zoo med=function(){var G=this.documentManager.pages[this.currentPageId];this.documen tManager._firePageFlip(this._zoomedPageWidth(),G.boundingRect.height)};l.prototy

pe._gotoPage=function(G,H){if(!this.documentManager.pages.hasOwnProperty(G)){ret urn}var K=this.currentPageId?this.documentManager.pages[this.currentPageId]:null ;var J=this.documentManager.pages[G];var I=new u(this,J,K);I.pretty=H.pretty;thi s.documentManager._preparePageFlip(I);I.go();this.currentPageId=G;this.documentM anager.visiblePagesChanged()};l.prototype._setWidth=function(G){this._currentPag eWidth=G;this.documentManager.setPageWidths(G)};l.prototype._fullscreenResized=f unction(G){this._setWidth(G.width-pagePadding)};l.prototype._enterFullscreen=fun ction(){this._previousPageWidth=this._currentPageWidth||defaultViewWidth;var G=t his.viewportManager.container;if(G===window){new Effect.ScrollTo(this.documentMa nager.pages[this.currentPageId].containerElem,{duration:0.3})}else{var H=G.scrol lTop,I=page.boundingRect.top-this.pages[1].boundingRect.top;new Effect.Tween(G,H ,I,{duration:0.3},"scrollTop")}};l.prototype._exitFullscreen=function(){this._se tWidth(defaultViewWidth);this._checkBodyWidth()};function x(){this._name="slides how";this.currentPageId=null;var G=this;this._fullscreenResizedCallback=function (H){G._fullscreenResized(H)}}x.prototype=new y();x.prototype._register=function( H,G){this._prepareDisplay()};x.prototype._unregister=function(){};x.prototype._p repareDisplay=function(){for(var G in this.documentManager.pages){if(this.docume ntManager.pages.hasOwnProperty(G)){var H=this.documentManager.pages[G];H.contain erElem.style.display="none";H.hide()}}this.documentManager.setPageMissingModules Visible(false);this.documentManager.gotoPage(this.documentManager.currentPageNum ()||1)};x.prototype._setPageBounds=function(G){var H=this.documentManager.pages[ this.currentPageId];if(H){H.setBounds(G.width,G.height)}};x.prototype._gotoPage= function(G,H){if(!this.documentManager.pages.hasOwnProperty(G)){return}var I;if( this.currentPageId){I=this.documentManager.pages[this.currentPageId];if(I){I.isV isible=false;I.containerElem.style.display="none";I.hide()}}this.currentPageId=G ;I=this.documentManager.pages[G];if(this.isFullscreen){this._setPageBounds(this. viewportManager.viewRect)}I.isVisible=true;I.display(true);I.containerElem.style .display="";this.documentManager.visiblePagesChanged()};x.prototype._setWidth=fu nction(G){this._currentPageWidth=G;this.documentManager.setPageWidths(G)};x.prot otype._fullscreenResized=function(G){this._setPageBounds(G)};x.prototype._enterF ullscreen=function(){this._previousPageWidth=this._currentPageWidth||defaultView Width;var G=this.viewportManager.container;if(G===window){new Effect.ScrollTo(th is.documentManager.pages[this.currentPageId].containerElem,{duration:0.3})}else{ var H=G.scrollTop,I=page.boundingRect.top-this.pages[1].boundingRect.top;new Eff ect.Tween(G,H,I,{duration:0.3},"scrollTop")}};x.prototype._exitFullscreen=functi on(){this._setWidth(defaultViewWidth);this._checkBodyWidth()};function c(){this. _name="scroll";var G=this;this._verticalPositionChangeCallback=function(){G._ver ticalPositionChanged()};this._fullscreenResizedCallback=function(){G._fullscreen Resized()}}c.prototype=new y();c.prototype._updateInViewport=function(I){var G=t his.viewportManager.viewRect;var H=I.boundingRect;var J=I.isVisible;if(!G||!H){I .isVisible=false}else{I.isVisible=(H.left<G.right&&H.right>G.left&&H.top<G.botto m&&H.bottom>G.top)}this.adjacentVisiblePages=2;return J!=I.isVisible};c.prototyp e._verticalPositionChanged=function(){var H=false;for(var J in this.pages){if(th is.pages.hasOwnProperty(J)){var I=this.pages[J];var G=this._updateInViewport(I); H=H||G}}if(H){this.documentManager.visiblePagesChanged()}else{this.documentManag er.scheduleLogPageView()}this._updateDisplayOnPages()};c.prototype._updateDispla yOnPages=function(){if(this.documentManager.firstVisiblePage&&this.documentManag er.lastVisiblePage){var J=this.documentManager.firstVisiblePage.pageNum-this.adj acentVisiblePages;var I=this.documentManager.lastVisiblePage.pageNum+this.adjace ntVisiblePages;for(var H in this.pages){if(this.pages.hasOwnProperty(H)){var G=t his.pages[H];if(G){if(G.pageNum>=J&&G.pageNum<=I){G.display()}else{G.hide();this .documentManager.fireEvent("pageHide",G)}}}}}};c.prototype._zoomed=function(){th is._verticalPositionChanged()};c.prototype._register=function(J,H){this.pages=J. pages;this.viewportManager.addEvent("vertical",this._verticalPositionChangeCallb ack);for(var G in this.pages){if(this.pages.hasOwnProperty(G)){var I=this.docume ntManager.pages[G];I.containerElem.style.display=""}}this.documentManager.setPag eMissingModulesVisible(true);this.documentManager._updatePageBoundingRects();thi s._verticalPositionChanged()};c.prototype.isTopPageInView=function(){if(this._is Scrolling){return true}var G=this.documentManager.firstVisiblePage;if(G){if(this .documentManager._expectedFirstPageNum>G.pageNum){return true}return G.boundingR

ect.top+5>=this.viewportManager.viewRect.top}else{return true}};c.prototype._unr egister=function(){if(this._isScrolling){this._scrollEffect.cancel();delete this ._isScrolling;delete this._scrollEffect;this.documentManager.setIsScrolling(fals e)}this.viewportManager.removeEvent("vertical",this._verticalPositionChangeCallb ack);delete this.pages};c.prototype._gotoPage=function(I,P){if(!this.pages.hasOw nProperty(I)){return}var N=this.documentManager.pages[I],H=this.viewportManager. container;if(P.pretty){var M=0;if(this._isScrolling){var L=this._scrollEffect.cu rrentFrame/this._scrollEffect.totalFrames*2;M=L<0.5?L:1-L;this._scrollEffect.can cel()}this.documentManager.setIsScrolling(true);var O=this,K={duration:0.4,fps:1 00,startOn:M,afterFinish:function(){O.documentManager.setIsScrolling(false);O.do cumentManager.visiblePagesChanged();delete O._isScrolling;delete O._scrollEffect }};if(H===window){this._scrollEffect=new Effect.ScrollTo(N.containerElem,K)}else {var J=H.scrollTop,G=N.boundingRect.top-this.pages[1].boundingRect.top;this._scr ollEffect=new Effect.Tween(H,J,G,K,"scrollTop")}}else{if(this._isScrolling){this ._scrollEffect.cancel()}this.documentManager.setIsScrolling(true);N._updateBound ingRect();if(H===window){scrollTo(N.boundingRect.left,N.boundingRect.top)}else{H .scrollTop=N.boundingRect.top-this.pages[1].boundingRect.top}this.documentManage r.setIsScrolling(false);this.documentManager.visiblePagesChanged()}return N.page Num};c.prototype._gotoNextPage=function(){if(!this.documentManager.firstVisibleP age){return}this.documentManager.gotoPage(this.documentManager.firstVisiblePage. pageNum+1,{direction:1})};c.prototype._gotoPreviousPage=function(){if(!this.docu mentManager.firstVisiblePage){return}this.documentManager.gotoPage(this.document Manager.firstVisiblePage.pageNum-1,{direction:-1})};c.prototype._setWidth=functi on(G){this._currentPageWidth=G;this._updatePageWidths();this._checkBodyWidth()}; c.prototype._fullscreenResized=function(){this._setWidth((window.innerWidth||doc ument.documentElement.clientWidth)-pagePadding)};c.prototype._enterFullscreen=fu nction(){this._previousPageWidth=this._currentWidth||defaultViewWidth};c.prototy pe._exitFullscreen=function(){this._setWidth(this._previousPageWidth)};function n(I,H,G){this.options=G||{};this.options.extrasWidth=this.options.extrasWidth||e xtrasWidth;this.defaultViewMode=(I||"scroll");this.mobile=(H||false);this.initEv entHelper();this.pages={};this._pageWidths=null;this._fontLoader=new B(this);thi s.viewManagers={scroll:new c(),slideshow:new x(),book:new l()};this.viewportMana ger=new z();this._currentFontAggregatorHostIdx=0;this.visiblePages=[];this.first VisiblePage=null;this.lastVisiblePage=null;this.currentFontGroup=new a(0,this._f ontLoader);this._isScrolling=false}p(n,["expectedFirstPageChanged","viewmodeChan ged","enteredFullscreen","exitedFullscreen","hideExtras","showExtras","preparePa geFlip","zoomed","pageHide","pageLoaded","allPagesAdded","pageView"]);n.prototyp e._fireZoomed=function(G){this.fireEvent("zoomed",G)};n.prototype.nextFontAggreg atorHost=function(){this._currentFontAggregatorHostIdx=(this._currentFontAggrega torHostIdx+1)%this.fontAggregatorHosts.length;return this.fontAggregatorHosts[th is._currentFontAggregatorHostIdx]};n.prototype._preparePageFlip=function(G){this .fireEvent("preparePageFlip",G)};n.prototype._fireHideExtras=function(){this.fir eEvent("hideExtras")};n.prototype._fireShowExtras=function(){this.fireEvent("sho wExtras")};n.prototype._firePageFlip=function(H,G){this.fireEvent("pageFlip",H,G )};n.prototype.currentPageNum=function(){return this._expectedFirstPageNum};n.pr ototype.setupTestElements=function(){this._fontLoader.setupTestElements()};n.pro totype.pageCount=function(){if(this.hasOwnProperty("_pageCount")){return this._p ageCount}var G=0;for(var H in this.pages){if(this.pages.hasOwnProperty(H)){G++}} this._pageCount=G;return this._pageCount};n.prototype.setupPaidDocument=function (I,H){this.allowedPages=I;this.originalPageCount=H;this._allowedPagesHash=[];thi s._maximumAllowedPage=Math.max.apply(null,this.allowedPages);this._minimumAllowe dPage=Math.min.apply(null,this.allowedPages);this._isPaidDocument=true;this._pag eMissingElements=[];for(var G=0;G<I.length;G++){this._allowedPagesHash[I[G]]=tru e;if((G>0&&I[G]>I[G-1]+1)||(G===0&&I[G]!=1)){this._pageMissingElements.push("pag e_missing_explanation_"+I[G].toString())}}if(this._maximumAllowedPage!=this.orig inalPageCount){this._pageMissingElements.push("page_missing_explanation_"+(this. originalPageCount+1).toString())}};n.prototype.maximumPageNumber=function(){if(t his.allowedPages){return this.originalPageCount}else{return this.pageCount()}};n .prototype.getClosestPageNumber=function(H,I){if(this.allowedPages){if(this._all owedPagesHash[H]){return H}else{if(H>=this._maximumAllowedPage){return this._max

imumAllowedPage}else{if(H<=this._minimumAllowedPage){return this._minimumAllowed Page}}for(var G=1;G<=this.originalPageCount;G++){if(I<=0&&this._allowedPagesHash [H-G]===true){return H-G}else{if(I>=0&&H+G<this.originalPageCount&&this._allowed PagesHash[H+G]===true){return H+G}}}}}else{return H}};n.prototype.setPageMissing ModulesVisible=function(H){if(!this._isPaidDocument){return}for(var G=0;G<this._ pageMissingElements.length;G++){var I=$(this._pageMissingElements[G]);if(I){if(H ){I.show()}else{I.hide()}}}};n.prototype.getNextAvailablePage=function(G){return getClosestPageNumber(G,1)};n.prototype.getPreviousAvailablePage=function(G){ret urn getClosestPageNumber(G,-1)};n.prototype.flushFontQueue=function(){this._font Loader.flushFontQueue()};n.prototype.visiblePagesChanged=function(){var J=[];for (var I in this.pages){if(this.pages.hasOwnProperty(I)){var H=this.pages[I];if(H. isVisible){J.push(H)}}}J.sort(function(L,K){if(L.pageNum<K.pageNum){return -1}el se{return 1}});this.visiblePages=J;var G=this.firstVisiblePage;this.firstVisible Page=J.length>0?J[0]:null;this.lastVisiblePage=J.length>0?J[J.length-1]:null;if( !this._isScrolling){this._loadAdjacentFonts();this._loadAdjacentPages()}if((this .firstVisiblePage!==G&&(!this.firstVisiblePage||!G))||this.firstVisiblePage.page Num!=G.pageNum){if(!this._isScrolling&&this.firstVisiblePage){this._updateExpect edFirstPage(this.firstVisiblePage.pageNum)}}this.scheduleLogPageView()};function w(H,I,G){return Math.min(G,Math.max(I,H))}n.prototype.boundingRatioForPage=func tion(K){var G=this.viewportManager.viewRect;var I=K.boundingRect;var J=I.bottomI.top;var H=I.right-I.left;return{left:(G.left-I.left)/H,right:(G.right-I.right) /H+1,top:w((G.top-I.top)/J+K.pageNum,K.pageNum,K.pageNum+1),bottom:w((G.bottom-I .bottom)/J+K.pageNum+1,K.pageNum,K.pageNum+1)}};n.prototype.scheduleLogPageView= function(){if(this.logPageViewTimout){window.clearTimeout(this.logPageViewTimout )}var G=this;this.logPageViewTimout=window.setTimeout(function(){G.logPageView() ;G.logPageViewTimout=null},1000)};function g(G){return Math.floor(G*100)/100}n.p rototype.getVisibleBBox=function(){var G={};if(this.firstVisiblePage){var I=this .boundingRatioForPage(this.firstVisiblePage);G.left=I.left;G.right=I.right;G.top =I.top}if(this.lastVisiblePage){var H=this.boundingRatioForPage(this.lastVisible Page);G.bottom=H.bottom}return G};n.prototype.logPageView=function(){var J=this. getVisibleBBox();for(var G in J){if(J.hasOwnProperty(G)){J[G]=g(J[G])}}var H=win dow.$rat;if(H){var I;if(window.RAT_API_VERSION=="2"){I=[[J.left,J.top],[J.right, J.bottom]]}else{I="("+J.left+" "+J.top+") ("+J.right+" "+J.bottom+")"}H("fourgen .viewchange",I)}this.fireEvent("pageView");return J};n.prototype._updateExpected FirstPage=function(G){this._expectedFirstPageNum=G;this.fireEvent("expectedFirst PageChanged",this._expectedFirstPageNum)};n.prototype._loadAdjacentFonts=functio n(){if(this.firstVisiblePage&&this.lastVisiblePage){var K=[];var G=this.firstVis iblePage.pageNum-adjacentFontLoadPages;var I=this.lastVisiblePage.pageNum+adjace ntFontLoadPages;for(var H=G;H<=I;H++){var J=this.pages[H];if(J){J.loadFonts()}}} };n.prototype._loadAdjacentPages=function(){if(this.firstVisiblePage&&this.lastV isiblePage){var K=[];var G=this.firstVisiblePage.pageNum-adjacentLoadPages;var I =this.lastVisiblePage.pageNum+adjacentLoadPages;for(var H=G;H<=I;H++){var J=this .pages[H];if(J&&!J.loadHasStarted){J.load();if(this.mobile){J.setWidth(this._pag eWidths)}}}if(this.mobile){this._removeUnusedPages()}}};n.prototype._removeUnuse dPages=function(){var H=this.firstVisiblePage.pageNum-adjacentLoadPages;var J=th is.lastVisiblePage.pageNum+adjacentLoadPages;var G=this.pages;var I=adjacentLoad Pages+1;while(G[I]){if(I<H||I>J){G[I].remove()}I++}};n.prototype._updatePageBoun dingRects=function(){for(var G in this.pages){if(this.pages.hasOwnProperty(G)){t his.pages[G]._updateBoundingRect()}}};n.prototype.addPage=function(H){if(H.pageN um===undefined){throw"must have pageNum param"}H.docManager=this;var G=new o(H); this.pages[H.pageNum]=G;if(this._pageWidths){G.setWidth(this._pageWidths)}if(thi s.currentFontGroup.isFull()){this.currentFontGroup=this.currentFontGroup.newNext Group()}G.setLoadFontGroup(this.currentFontGroup);return G};n.prototype.setIsScr olling=function(G){this._isScrolling=G};n.prototype.setViewManager=function(G){i f(this._currentViewManager){this._currentViewManager.unregister()}var H=this._cu rrentViewManager;this._currentViewManager=this.viewManagers[G];this._currentView Manager.register(this,this.viewportManager);this.fireEvent("viewmodeChanged",thi s._currentViewManager.name(),H?H.name():null)};n.prototype.setDefaultWidth=funct ion(G){this._currentViewManager._currentPageWidth=G;this._currentViewManager._cu rrentZoomMultiplier=1;this._currentViewManager._updatePageWidths()};n.prototype.

subImageSrc=function(I){var H,G=0;for(H=0;H<I.length;H++){G+=I.charCodeAt(H)}var J=this._imageDomainSubstitutionList[G%this._imageDomainSubstitutionList.length] ;return I.replace(this._imageDomainSubstitutionFrom,J)};n.prototype.allPagesAdde d=function(){if(this._allPagesAddedCalled){throw"can only call allPagesAdded onc e"}if(window.document){this.viewportManager.enable(window.document.getElementByI d("scroll_wrap"))}else{this.viewportManager.enable(null)}this._updatePageBoundin gRects();this.setViewManager(this.defaultViewMode);this.fireEvent("allPagesAdded ")};n.prototype.setEmbeddedDoc=function(G){this._isEmbed=(G==="True")};n.prototy pe.setPageWidths=function(G){this._pageWidths=G;for(var H in this.pages){if(this .pages.hasOwnProperty(H)){this.pages[H].setWidth(this._pageWidths)}}this._update PageBoundingRects()};n.prototype.addFont=function(L,J,H,K,I,G){this._fontLoader. addFont(L,J,H,K,I,G)};n.prototype.setNumFonts=function(G){this._fontLoader.setNu mFonts(G)};n.prototype.initStyles=function(){this._fontLoader.initStyles()};n.pr ototype.gotoPage=function(G,H){if(!H){H={}}if(H.pretty===undefined){H.pretty=tru e}var J=H.direction||0;var I=this.pages[G];if(I===undefined&&this._isPaidDocumen t){G=this.getClosestPageNumber(G,J);I=this.pages[G]}if(this.pages[G]){this._upda teExpectedFirstPage(G);this._currentViewManager.gotoPage(this._expectedFirstPage Num,H);if(this.mobile){this.pages[G].setWidth(this._pageWidths)}}};n.prototype.g otoPreviousPage=function(){if(this._currentViewManager.isTopPageInView()){this.g otoPage(this._expectedFirstPageNum-1,{direction:-1})}else{this.gotoPage(this._ex pectedFirstPageNum,{direction:-1})}};n.prototype.gotoNextPage=function(){this.go toPage(this._expectedFirstPageNum+1,{direction:1})};n.prototype.enterFullscreen= function(){this._currentViewManager.enterFullscreen()};n.prototype.exitFullscree n=function(){this._currentViewManager.exitFullscreen()};n.prototype._fireEntered Fullscreen=function(){this.fireEvent("enteredFullscreen")};n.prototype._fireExit edFullscreen=function(){this.fireEvent("exitedFullscreen")};n.prototype.viewMode =function(){if(this._currentViewManager){return this._currentViewManager.name()} return null};n.prototype.zoom=function(G){this._currentViewManager.zoom(G)};n.pr ototype.resetZoom=function(){this._currentViewManager.resetZoom()};n.prototype.s etImageDomainSubstitution=function(G,H){this._imageDomainSubstitutionFrom=G;this ._imageDomainSubstitutionList=H};n.prototype.disableViewManagerResizeWidth=funct ion(){y.prototype._checkBodyWidth=function(){}};n.prototype.disable=function(){i f(!this.disabled){this.disabled=true;this.viewportManager.disable()}};return n}) ();window.DocumentManager=DocumentManager;

You might also like