function FlippingBook(){this.pages=[];this.contents=[];this.stageWidth="640";this.stageHeight="480";this.settings={bookWidth:640,bookHeight:480,pagesSet:this.pages,scaleContent:true,preserveProportions:false,centerContent:true,hardcover:false,hardcoverThickness:3,hardcoverEdgeColor:16777215,highlightHardcover:true,frameWidth:0,frameColor:16777215,frameAlpha:100,firstPageNumber:2,autoFlipSize:50,navigationFlipOffset:30,flipOnClick:true,handOverCorner:true,handOverPage:true,alwaysOpened:true,staticShadowsType:"Asymmetric",staticShadowsDepth:1,staticShadowsLightColor:16777215,staticShadowsDarkColor:0,dynamicShadowsDepth:1,dynamicShadowsLightColor:16777215,dynamicShadowsDarkColor:0,moveSpeed:2,closeSpeed:3,gotoSpeed:3,rigidPageSpeed:5,flipSound:"",hardcoverSound:"",preloaderType:"Thin",pageBackgroundColor:16777215,loadOnDemand:true,allowPagesUnload:true,showUnderlyingPages:false,playOnDemand:true,freezeOnFlip:false,darkPages:false,smoothPages:false,rigidPages:false,flipCornerStyle:"manually",flipCornerPosition:"bottom-right",flipCornerAmount:50,flipCornerAngle:20,flipCornerRelease:true,flipCornerVibrate:true,flipCornerPlaySound:false,zoomEnabled:false,zoomPath:"",zoomImageWidth:900,zoomImageHeight:1165,zoomOnClick:false,zoomUIColor:9412262,zoomHint:"Double click for zooming.",centerBook:true,useCustomCursors:true,dropShadowEnabled:true,dropShadowHideWhenFlipping:true,backgroundColor:16777215,backgroundImage:"/img/blank.gif",backgroundImagePlacement:"top",printEnabled:true,printTitle:"Print Pages",downloadURL:"",downloadTitle:"Download PDF",downloadSize:"Size: 4.7 Mb",downloadComplete:"Complete",extXML:""};this.containerId="fbContainer";this.forwardButtonId="fbForwardButton";this.backButtonId="fbBackButton";this.zoomButtonId="fbZoomButton";this.printButtonId="fbPrintButton";this.downloadButtonId="fbDownloadButton";this.currentPagesId="fbCurrentPages";this.totalPagesId="fbTotalPages";this.contentsMenuId="fbContentsMenu";}FlippingBook.prototype.create=function(){this.settings.pagesSet=this.pages;this.addLoadEvent(this.onWindowLoad);swfobject.embedSWF("/swf/FlippingBook.swf",this.containerId,this.stageWidth,this.stageHeight,"8.0.0","js/hardiegrant/expressInstall.swf",this.settings,{allowScriptAccess:"always",bgcolor:"#"+this.settings.backgroundColor.toString(16)});};FlippingBook.prototype.getFlippingBookReference=function(){return this.getObjectReference(this.containerId);};FlippingBook.prototype.getObjectReference=function(a){return document.getElementById(a);};FlippingBook.prototype.flipForward=function(){flippingBook.getFlippingBookReference().flipForward();};FlippingBook.prototype.flipBack=function(){flippingBook.getFlippingBookReference().flipBack();};FlippingBook.prototype.zoomButtonClick=function(){if(flippingBook.getFlippingBookReference().isZoomedIn()){flippingBook.zoomOut();}else{flippingBook.zoomIn();}};FlippingBook.prototype.zoomIn=function(){this.getFlippingBookReference().zoomIn();};FlippingBook.prototype.zoomOut=function(){this.getFlippingBookReference().zoomOut();};FlippingBook.prototype.print=function(){flippingBook.getFlippingBookReference().print();};FlippingBook.prototype.downloadFile=function(){if(flippingBook.settings.downloadURL){flippingBook.getFlippingBookReference().downloadFile();}};FlippingBook.prototype.onWindowLoad=function(){var a=flippingBook.getObjectReference(flippingBook.forwardButtonId);if(a){a.style.cursor="pointer";a.onclick=flippingBook.flipForward;}var e=flippingBook.getObjectReference(flippingBook.backButtonId);if(e){e.style.cursor="pointer";e.onclick=flippingBook.flipBack;}var c=flippingBook.getObjectReference(flippingBook.zoomButtonId);if(c){c.style.cursor="pointer";c.onclick=flippingBook.zoomButtonClick;}var d=flippingBook.getObjectReference(flippingBook.printButtonId);if(d){d.style.cursor="pointer";d.onclick=flippingBook.print;}var b=flippingBook.getObjectReference(flippingBook.downloadButtonId);if(b){b.style.cursor="pointer";b.onclick=flippingBook.downloadFile;}flippingBook.buildContentsMenu();};FlippingBook.prototype.onPutPage=function(a,b){this.updatePagination(a,b);this.updateContentsMenu(a,b);};FlippingBook.prototype.updatePagination=function(b,c){var a=(b!=undefined);var e=(c!=undefined);var d=b+"-"+c;if(!a){d=c;}if(!e){d=b;}this.getObjectReference(this.currentPagesId).innerHTML=d;this.getObjectReference(this.totalPagesId).innerHTML=" / "+this.getFlippingBookReference().totalPages();};FlippingBook.prototype.buildContentsMenu=function(){var a=this.getObjectReference(this.contentsMenuId);if(a){for(var b=0;b<this.contents.length;b++){a.options[b]=new Option(this.contents[b][0],this.contents[b][1]);}a.onchange=this.onContentsChange;}};FlippingBook.prototype.onContentsChange=function(){var a=flippingBook.getObjectReference(flippingBook.contentsMenuId);var b=a.options[a.selectedIndex].value;if(b){flippingBook.getFlippingBookReference().flipGotoPage(b);}};FlippingBook.prototype.updateContentsMenu=function(e,d){var g=flippingBook.getObjectReference(flippingBook.contentsMenuId);if(g){for(var c=0;c<this.contents.length-1;c++){var b=g.options[c].value;var f=g.options[c+1].value;var h=false;var a=false;if(e){h=(Number(e)>=b&&Number(e)<=f);}else{h=true;}if(d){a=(Number(d)>=b&&Number(d)<=f);}else{a=true;}if(h&&a){break;}}g.selectedIndex=c;}};FlippingBook.prototype.getWindowHeight=function(){var a=0;if(typeof(window.innerHeight)=="number"){a=window.innerHeight;}else{if(document.documentElement&&document.documentElement.clientHeight){a=document.documentElement.clientHeight;}else{if(document.body&&document.body.clientHeight){a=document.body.clientHeight;}}}return a;};FlippingBook.prototype.addLoadEvent=function(a){if(typeof window.addEventListener!="undefined"){window.addEventListener("load",a,false);}else{if(typeof document.addEventListener!="undefined"){document.addEventListener("load",a,false);}else{if(typeof window.attachEvent!="undefined"){window.attachEvent("onload",a);}else{if(typeof window.onload=="function"){var b=window.onload;window.onload=function(){b();a();};}else{window.onload=a;}}}}};FlippingBook.prototype.handleWheel=function(a){this.getFlippingBookReference().onWheelScroll(a);};flippingBook=new FlippingBook();function wheel(b){var a=0;if(!b){b=window.event;}if(b.wheelDelta){a=b.wheelDelta/120;if(window.opera){a=-a;}}else{if(b.detail){a=-b.detail/3;}}if(a){flippingBook.handleWheel(a);}if(b.preventDefault){b.preventDefault();}b.returnValue=false;}if(window.addEventListener){window.addEventListener("DOMMouseScroll",wheel,false);}window.onmousewheel=document.onmousewheel=wheel;
