var bm={installed:!1,isBm:!1,isAdd:!0,isSelect:!1,shiftSpeed:300,init:function(){if(!bm.installed){for(var a in bookData.BM.bmElement);if(void 0!=a)bm.isBm=!0,bm.rasterize.init();bm.installed=!0}},showList:function(){if(bm.isBm)if("hide"==ctrlEngine.state)ctrlEngine.mode="bm",ctrlEngine.display();else if(bm.isEdit=!1,bm.isSelect=!1,"bm"==ctrlEngine.mode)ctrlEngine.hide();else if("toc"==ctrlEngine.mode||"search"==ctrlEngine.mode)ctrlEngine.mode="bm",ctrlEngine.change()},addButton:{action:function(){bm.isAdd?
bm.addButton.addBM(pageMediator.getPage()):onePageBook.installed||zoomBook.installed?(bm.rasterize.remFx(pageMediator.getPage()),bookData.BM.rem(pageMediator.getPage()),bm.addButton.remBM()):twoPageBook.installed&&(0<twoPageBook.currentPage.left&&bookData.page[twoPageBook.currentPage.left].mark&&(bm.rasterize.remFx(twoPageBook.currentPage.left),bookData.BM.rem(twoPageBook.currentPage.left)),twoPageBook.currentPage.right<=bookData.pageCount&&bookData.page[twoPageBook.currentPage.right].mark&&(bm.rasterize.remFx(twoPageBook.currentPage.right),
bookData.BM.rem(twoPageBook.currentPage.right)),bm.addButton.remBM())},addBM:function(a){bm.isBm||bm.rasterize.imgLoaded||bm.rasterize.init();test=function(){var b="",b=system.device.publisher.isOn?"Bookmark "+a:prompt("Enter bookmark name:","Bookmark "+a);if(""!=b&&null!=b){if(!bm.isBm)bm.isBm=!0,buttons.bm.check();ctrlEngine.edit.addBM(a,b);bm.isAdd=!1;buttons.addBm.check();if("hide"!=ctrlEngine.state){"bm"!=ctrlEngine.mode?(ctrlEngine.mode="bm",ctrlEngine.change()):"bm"==ctrlEngine.mode&&ctrlEngine.redraw();
for(var b=el.id("menuBM"),c=0;c<b.childNodes.length;c++)if(b.childNodes[c].getAttribute("page")==a){b=b.childNodes[c];b.setAttribute("select",!0);b.style.background="#bbbbbb";bm.isSelect=!0;break}}bm.rasterize.addFx(a)}a=null};window.setTimeout(test,50)},remBM:function(){bm.isAdd=!0;buttons.addBm.check();for(var a in bookData.BM.bmElement);if(void 0==a)bm.isBm=!1,"hide"!=ctrlEngine.state&&ctrlEngine.hide(),buttons.bm.check();if("hide"!=ctrlEngine.state)"bm"!=ctrlEngine.mode?(ctrlEngine.mode="bm",
ctrlEngine.change()):"bm"==ctrlEngine.mode&&ctrlEngine.redraw()}},rasterize:{timeStep:10,imgLoaded:!1,imgBm:{},imgData:{},width:40,height:85,init:function(){bm.rasterize.imgBm=new Image;bm.rasterize.imgBm.src=null===dir?bookmark_img:STYLES_SRC+"bookmark.png";bm.rasterize.imgLoaded=!0},draw:function(a,b){var c=a.canvas.width,d=0.06*c/40;bm.rasterize.width=40*d;bm.rasterize.height=85*d;d*=60;bm.rasterize.getImg(a,b,c,d,0);bm.rasterize.drawImg(a,b,c,d,0)},addFx:function(a){var b=el.id("canvas"+a),c=
b.getContext("2d"),d=b.width,b=0.06*d/40;bm.rasterize.width=40*b;bm.rasterize.height=85*b;var e=60*b,f=8.5*b,b=null;bm.rasterize.getImg(c,a,d,e,0);var h=0,g=-bm.rasterize.height,b=function(){bm.rasterize.putImg(c,a,d,e,0);bm.rasterize.drawImg(c,a,d,e,g);g=1*g+1*f;0<=g&&(clearInterval(h),a=c=d=e=f=g=h=null)};system.device.android?(bm.rasterize.drawImg(c,a,d,e,0),h=null):h=window.setInterval(b,bm.rasterize.timeStep);b=null},remFx:function(a){var b=el.id("canvas"+a),c=b.getContext("2d"),d=b.width,b=
0.06*d/40;bm.rasterize.width=40*b;bm.rasterize.height=85*b;var e=60*b,f=8.5*b,b=null,h=0,g=0,b=function(){bm.rasterize.putImg(c,a,d,e,0);bm.rasterize.drawImg(c,a,d,e,g);g=1*g-1*f;g<-bm.rasterize.height&&(clearInterval(h),bm.rasterize.putImg(c,a,d,e,0),a=c=d=e=f=g=h=null)};system.device.android?(onePageBook.destroyPage(a),onePageBook.drawPage(a),h=null):h=window.setInterval(b,bm.rasterize.timeStep);b=null},putImg:function(a,b,c,d,e){onePageBook.installed||zoomBook.installed?a.putImageData(bm.rasterize.imgData[b],
c-d-bm.rasterize.width,e,bm.rasterize.width,bm.rasterize.height):bookData.rightToLeftMode?twoPageBook.installed&&1!=1*b%2?a.putImageData(bm.rasterize.imgData[b],c-d-bm.rasterize.width,e,bm.rasterize.width,bm.rasterize.height):a.putImageData(bm.rasterize.imgData[b],d,e,bm.rasterize.width,bm.rasterize.height):twoPageBook.installed&&1==1*b%2?a.putImageData(bm.rasterize.imgData[b],c-d-bm.rasterize.width,e,bm.rasterize.width,bm.rasterize.height):a.putImageData(bm.rasterize.imgData[b],d,e,bm.rasterize.width,
bm.rasterize.height)},getImg:function(a,b,c,d,e){bm.rasterize.imgData[b]=onePageBook.installed||zoomBook.installed?a.getImageData(c-d-bm.rasterize.width,e,bm.rasterize.width,bm.rasterize.height):bookData.rightToLeftMode?twoPageBook.installed&&1!=1*b%2?a.getImageData(c-d-bm.rasterize.width,e,bm.rasterize.width,bm.rasterize.height):a.getImageData(d,e,bm.rasterize.width,bm.rasterize.height):twoPageBook.installed&&1==1*b%2?a.getImageData(c-d-bm.rasterize.width,e,bm.rasterize.width,bm.rasterize.height):
a.getImageData(d,e,bm.rasterize.width,bm.rasterize.height)},drawImg:function(a,b,c,d,e){onePageBook.installed||zoomBook.installed?a.drawImage(bm.rasterize.imgBm,c-d-bm.rasterize.width,e,bm.rasterize.width,bm.rasterize.height):bookData.rightToLeftMode?twoPageBook.installed&&1!=1*b%2?a.drawImage(bm.rasterize.imgBm,c-d-bm.rasterize.width,e,bm.rasterize.width,bm.rasterize.height):a.drawImage(bm.rasterize.imgBm,d,e,bm.rasterize.width,bm.rasterize.height):twoPageBook.installed&&1==1*b%2?a.drawImage(bm.rasterize.imgBm,
c-d-bm.rasterize.width,e,bm.rasterize.width,bm.rasterize.height):a.drawImage(bm.rasterize.imgBm,d,e,bm.rasterize.width,bm.rasterize.height)}}},bookChoice={getType:function(){return bookData.singlePageMode?"one":system.platform.ios?"landscape"===orientationObserver.getOrientation()?system.device.ipad?"two":"one":"portrait"===orientationObserver.getOrientation()?"one":"two":"one"}},bookData={loaded:!1,background:"",load:function(a){var b=new XML.ObjTree;b.attr_prefix="@";a=b.parseDOM(a);a=a["#document"];
this.size={};this.size.width=a.Properties.bookProperties.bookWidth?a.Properties.bookProperties.bookWidth["@value"]:600;this.size.height=a.Properties.bookProperties.bookHeight?a.Properties.bookProperties.bookHeight["@value"]:800;bookData.background={};bookData.background.src=a.Properties.bookProperties.bookBG["@src"];bookData.background.scale=a.Properties.bookProperties.bookBG["@scale"];bookData.background.color=a.Properties.bookProperties.bookBG["@color"];bookData.background.width=a.Properties.bookProperties.bookBG["@width"];
bookData.background.height=a.Properties.bookProperties.bookBG["@height"];bookData.name=a.Properties.bookProperties.bookName["@value"]?a.Properties.bookProperties.bookName["@value"]:"";bookData.ident=a.Properties.bookProperties.bookId["@value"]?a.Properties.bookProperties.bookId["@value"]:"";bookData.tocVisible=ALBM?!1:"true"==a.Properties.bookProperties.tocVisible["@value"]?!0:!1;bookData.bookmarksVisible=ALBM?!1:"true"==a.Properties.bookProperties.bookmarksVisible["@value"]?!0:!1;bookData.slideshowVisible=
ALBM?!0:"true"==a.Properties.bookProperties.slideshowVisible["@value"]?!0:!1;bookData.slideshowLoop=!0;bookData.searchVisible=!1;bookData.navigationVisible=ALBM?!0:"true"==a.Properties.bookProperties.navigationVisible["@value"]?!0:!1;bookData.singlePageMode=ALBM?!1:"true"==a.Properties.bookProperties.singlePageMode["@value"]?!0:!1;bookData.rightToLeftMode=ALBM?!1:"true"==a.Properties.bookProperties.rightToLeftMode["@value"]?!0:!1;bookData.sessionRestore=ALBM?!1:"true"==a.Properties.bookProperties.sessionRestore["@value"]?
!0:!1;bookData.hardCover={};bookData.hardCover.en=ALBM?!1:a.Properties.bookProperties.hardCover["@value"];bookData.hardCover.border=ALBM?!1:a.Properties.bookProperties.hardCover["@border"];bookData.hardCover.color=ALBM?!1:a.Properties.bookProperties.hardCover["@color"];bookData.hardCover.width=ALBM?!1:a.Properties.bookProperties.hardCover["@width"];bookData.hardCover.height=ALBM?!1:a.Properties.bookProperties.hardCover["@height"];bookData.skin=ALBM?"DarkWood":a.Properties.bookProperties.skin["@style"];
bookData.skinColor=ALBM?!1:!1;if("DarkWood"!=bookData.skin&&"ClassicGrey"!=bookData.skin&&"DarkSkyBlue"!=bookData.skin)bookData.skin="DarkWood";if(!ALBM){var c=function(a){var b={},f,h=1;if(a.length)for(f in a){f=a[f];b[h]={};if(f.title)b[h].name=f.title["@value"];if(f.pageNumber)b[h].page=f.pageNumber["@value"];if(f.children)b[h].children={},b[h].children.tocElement=c(f.children.tocData);h++}else{b[1]={};if(a.title)b[1].name=a.title["@value"];if(a.pageNumber)b[1].page=a.pageNumber["@value"];if(a.children)b[1].children=
{},b[1].children.tocElement=c(a.children.tocData)}return b};bookData.TOC={};if(a.Properties.tableOfContent.tocData.children)bookData.TOC.tocElement={},bookData.TOC.tocElement=c(a.Properties.tableOfContent.tocData.children.tocData)}this.page={};b=0;for(itemNum in a.Properties.bookProperties.pages.elements.page)if("links"!=itemNum&&"format"!=itemNum&&"BGColor"!=itemNum&&"slideshowDelay"!=itemNum&&"width"!=itemNum&&"height"!=itemNum){b++;itemNum="id"===itemNum?a.Properties.bookProperties.pages.elements.page:
a.Properties.bookProperties.pages.elements.page[itemNum];bookData.page[b]={};bookData.page[b].width=itemNum.width?itemNum.isWide&&"true"==itemNum.isWide["@value"]?itemNum.width["@value"]/2:itemNum.width["@value"]:itemNum.isWide&&"true"==itemNum.isWide["@value"]?a.Properties.bookProperties.pages.defaultValue.width["@value"]/2:a.Properties.bookProperties.pages.defaultValue.width["@value"];bookData.page[b].height=itemNum.height?itemNum.height["@value"]:a.Properties.bookProperties.pages.defaultValue.height["@value"];
bookData.page[b].proportions=(bookData.page[b].width/bookData.page[b].height-0.0010).toFixed(2);bookData.page[b].BGColor=itemNum.BGColor?itemNum.BGColor["@value"]:a.Properties.bookProperties.pages.defaultValue.BGColor["@value"];bookData.page[b].slideDelay=itemNum.slideshowDelay?1*itemNum.slideshowDelay["@value"]:1*a.Properties.bookProperties.pages.defaultValue.slideshowDelay["@value"];bookData.page[b].stub=itemNum.isStub?!0:!1;bookData.page[b].format=itemNum.format?itemNum.format["@value"]:"jpg";
if(itemNum.isWide&&"true"==itemNum.isWide["@value"]){bookData.page[b+1]={};bookData.page[b+1].height=bookData.page[b].height;bookData.page[b+1].BGColor=bookData.page[b].BGColor;bookData.page[b+1].slideDelay=bookData.page[b].slideDelay;bookData.page[b+1].width=bookData.page[b].width;bookData.page[b+1].stub=bookData.page[b].stub;bookData.page[b+1].proportions=bookData.page[b].proportions;bookData.page[b].wide=!0;bookData.page[b+1].wide=!0;itemNum.format?(bookData.page[b].format=itemNum.format["@value"],
bookData.page[b+1].format=itemNum.format["@value"]):(bookData.page[b].format="jpg",bookData.page[b+1].format="jpg");bookData.page[b].src=images.getImagePath(itemNum.id["@value"],bookData.page[b].format,"stand",!0,1);bookData.page[b+1].src=images.getImagePath(itemNum.id["@value"],bookData.page[b].format,"stand",!0,2);bookData.page[b].srcZoom=images.getImagePath(itemNum.id["@value"],bookData.page[b].format,"zoom",!0,1);bookData.page[b+1].srcZoom=images.getImagePath(itemNum.id["@value"],bookData.page[b].format,
"zoom",!0,2);if(itemNum.links)bookData.page[b].links={},this.linksImport(itemNum,b);b++}else if(bookData.page[b].src=images.getImagePath(itemNum.id["@value"],bookData.page[b].format),bookData.page[b].srcZoom=images.getImagePath(itemNum.id["@value"],bookData.page[b].format,"zoom"),bookData.page[b].wide=!1,itemNum.links)bookData.page[b].links={},this.linksImport(itemNum,b);bookData.page[b].mark=!1}this.pageCount=b;b=null;bookData.BM={bmElement:{},load:function(){if(!system.device.publisher.isOn)for(var a in window.localStorage)if(a.substring(0,
bookData.ident.length)==bookData.ident)a.substring(bookData.ident.length)<=bookData.pageCount?(bookData.BM.bmElement[a.substring(bookData.ident.length)]=window.localStorage[a],bookData.page[a.substring(bookData.ident.length)].mark=!0):"local"!=a.substring(bookData.ident.length)&&bookData.BM.clear()},add:function(a,b){system.device.publisher.isOn||(window.localStorage[bookData.ident+a]=b);bookData.BM.bmElement[a]=b;bookData.page[a].mark=!0},change:function(a,b){system.device.publisher.isOn||(window.localStorage[bookData.ident+
a]=b);bookData.BM.bmElement[a]=b},rem:function(a){system.device.publisher.isOn||window.localStorage.removeItem(bookData.ident+a);delete bookData.BM.bmElement[a];bookData.page[a].mark=!1},clear:function(){if(!system.device.publisher.isOn){for(var a in window.localStorage)a.substring(0,bookData.ident.length);a=null;bookData.BM.bmElement={};for(a in bookData.page)bookData.page[a].mark=!1}}};ALBM||bookData.BM.load();bookData.lastLocation={load:function(){if(!system.device.publisher.isOn)for(var a in window.localStorage)if(a.substring(0,
bookData.ident.length+5)==bookData.ident+"local")return a.substring(bookData.ident.length+5)<=bookData.pageCount?window.localStorage[a]:!1},save:function(a){system.device.publisher.isOn||(window.localStorage[bookData.ident+"local"]=a)}};this.size.proportions=(bookData.size.width/bookData.size.height-0.0010).toFixed(2);this.loaded=!0},linksImport:function(a,b,c){for(var c=c||"normal",a=a.links.link[0]?a.links.link:[a.links.link],d=0;d<a.length;d++){bookData.page[b].links[d]=[];"wide"==c?(bookData.page[b+
1].links[d]=[],1*a[d].x["@value"]>1*bookData.size.width?(bookData.page[b+1].links[d].x=a[d].x["@value"]-1*bookData.size.width,bookData.page[b].links[d].width=a[d].width["@value"]):1*a[d].x["@value"]<1*bookData.size.width&&1*a[d].x["@value"]+1*a[d].width["@value"]>1*bookData.size.width?(bookData.page[b].links[d].x=a[d].x["@value"],bookData.page[b+1].links[d].x=0,bookData.page[b].links[d].width=1*a[d].width["@value"]-1*a[d].x["@value"],bookData.page[b+1].links[d].width=1*a[d].x["@value"]+1*a[d].width["@value"]-
1*bookData.size.width):(bookData.page[b].links[d].x=a[d].x["@value"],bookData.page[b].links[d].width=a[d].width["@value"]),bookData.page[b].links[d].y=a[d].y["@value"]):(bookData.page[b].links[d].x=a[d].x["@value"],bookData.page[b].links[d].y=a[d].y["@value"],bookData.page[b].links[d].width=a[d].width["@value"]);bookData.page[b].links[d].height=a[d].height["@value"];if(a[d].page["@id"])bookData.page[b].links[d].page=a[d].page["@id"];if(a[d].urls)if(bookData.page[b].links[d].urls=[],a[d].urls.url[0])for(var e=
0;e<a[d].urls.url.length;e++)bookData.page[b].links[d].urls[e]=a[d].urls.url[e].src;else bookData.page[b].links[d].urls[0]=a[d].urls.url["@src"]}}},bookWidthFx={widthChangeL:"none",widthChangeR:"none",widthChangeB:"none",widthStateL:"thin",widthStateR:"fat",twoPageState:"Landscape",shiftL:0,init:function(){if(el.id("bookWidth"))el.id("bookWidth");else{var a=el.add("div");a.id="bookWidth";if(onePageBook.installed)a.style.position="absolute",a.style.width=onePageBook.bookWidth+"px",a.style.height=onePageBook.bookHeight+
"px",a.style.top=onePageBook.bookTop+"px",a.style.left=onePageBook.bookLeft+"px";else if(twoPageBook.installed)a.style.position="absolute",a.style.width=twoPageBook.bookWidth+"px",a.style.height=twoPageBook.bookHeight+"px",a.style.top=twoPageBook.bookTop+"px",a.style.left=twoPageBook.bookLeft+"px";el.id("mainFrame").appendChild(a)}},destroy:function(){el.del("bookWidth")},checkChange:function(a){var b;if(onePageBook.installed)bookWidthFx.widthStateL="thin",bookWidthFx.widthChangeL="none",b=a;else if(twoPageBook.installed){b=
a.right;if(6>a.left){if("fat"==bookWidthFx.widthStateL&&"toThin"!=bookWidthFx.widthChangeL)bookWidthFx.widthChangeL="toThin";else if("thin"==bookWidthFx.widthStateL&&"toThin"==bookWidthFx.widthChangeL)bookWidthFx.widthChangeL="none";bookWidthFx.widthStateL="thin";bookWidthFx.shiftL=-9}else{if("thin"==bookWidthFx.widthStateL&&"toFat"!=bookWidthFx.widthChangeL)bookWidthFx.widthChangeL="toFat";else if("fat"==bookWidthFx.widthStateL&&"toFat"==bookWidthFx.widthChangeL)bookWidthFx.widthChangeL="none";bookWidthFx.widthStateL=
"fat";bookWidthFx.shiftL=-18}1==a.right?(bookWidthFx.widthChangeB="right"!=bookWidthFx.twoPageState&&"toRight"!=bookWidthFx.widthChangeB?"toRight":"none",bookWidthFx.twoPageState="right"):0==bookData.pageCount%2&&a.left==bookData.pageCount?(bookWidthFx.widthChangeB="left"!=bookWidthFx.twoPageState&&"left"!=bookWidthFx.widthChangeB?"toLeft":"none",bookWidthFx.twoPageState="left"):(bookWidthFx.widthChangeB="Landscape"!=bookWidthFx.twoPageState&&"toLandscape"!=bookWidthFx.widthChangeB?"toLandscape":
"none",bookWidthFx.twoPageState="Landscape")}if(3>bookData.pageCount-b&&onePageBook.installed){if("fat"==bookWidthFx.widthStateR&&"toThin"!=bookWidthFx.widthChangeR)bookWidthFx.widthChangeR="toThin";else if("thin"==bookWidthFx.widthStateR&&"toThin"==bookWidthFx.widthChangeR)bookWidthFx.widthChangeR="none";bookWidthFx.widthStateR="thin"}else if(6>bookData.pageCount-b&&twoPageBook.installed){if("fat"==bookWidthFx.widthStateR&&"toThin"!=bookWidthFx.widthChangeR)bookWidthFx.widthChangeR="toThin";else if("thin"==
bookWidthFx.widthStateR&&"toThin"==bookWidthFx.widthChangeR)bookWidthFx.widthChangeR="none";bookWidthFx.widthStateR="thin"}else{if("thin"==bookWidthFx.widthStateR&&"toFat"!=bookWidthFx.widthChangeR)bookWidthFx.widthChangeR="toFat";else if("fat"==bookWidthFx.widthStateR&&"toFat"==bookWidthFx.widthChangeR)bookWidthFx.widthChangeR="none";bookWidthFx.widthStateR="fat"}onePageBook.installed?window.setTimeout(bookWidthFx.changeState,onePageBook.flipSpeed):twoPageBook.installed&&("right"==bookWidthFx.twoPageState?
bookWidthFx.changeState():"left"==bookWidthFx.twoPageState?bookWidthFx.changeState():window.setTimeout(bookWidthFx.changeState,twoPageBook.flipSpeed))},changeState:function(){if(el.id("bookWidthBG1")){var a;if("toFat"==bookWidthFx.widthChangeL)a=el.id("bookWidthBG1"),a.style.width="18px",a.style.left=bookWidthFx.shiftL+"px",a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_03.png")',a=el.id("bookWidthBG2"),a.style.width="18px",a.style.left=bookWidthFx.shiftL+"px",a.style.background='url("'+
STYLES_SRC+'bookWidth/bookWidth_07.png")',a=el.id("bookWidthBG3"),a.style.width="18px",a.style.left=bookWidthFx.shiftL+"px",a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_11.png")';else if("toThin"==bookWidthFx.widthChangeL)a=el.id("bookWidthBG1"),a.style.width="9px",a.style.left=bookWidthFx.shiftL+"px",a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_03Thin.png")',a=el.id("bookWidthBG2"),a.style.width="9px",a.style.left=bookWidthFx.shiftL+"px",a.style.background='url("'+STYLES_SRC+
'bookWidth/bookWidth_07Thin.png")',a=el.id("bookWidthBG3"),a.style.width="9px",a.style.left=bookWidthFx.shiftL+"px",a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_11Thin.png")';if("toFat"==bookWidthFx.widthChangeR)a=el.id("bookWidthBG5"),a.style.width="18px",a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_05.png")',a=el.id("bookWidthBG6"),a.style.width="18px",a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_08.png")',a=el.id("bookWidthBG7"),a.style.width="18px",a.style.background=
'url("'+STYLES_SRC+'bookWidth/bookWidth_14.png")';else if("toThin"==bookWidthFx.widthChangeR)a=el.id("bookWidthBG5"),a.style.width="9px",a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_05Thin.png")',a=el.id("bookWidthBG6"),a.style.width="9px",a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_08Thin.png")',a=el.id("bookWidthBG7"),a.style.width="9px",a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_14Thin.png")';var b=1*twoPageBook.bookWidth/2,b=b.toFixed();if("toLeft"==
bookWidthFx.widthChangeB)a=el.id("bookWidthBG1"),a.style.left=bookWidthFx.shiftL+"px",a=el.id("bookWidthBG2"),a.style.left=bookWidthFx.shiftL+"px",a=el.id("bookWidthBG3"),a.style.left=bookWidthFx.shiftL+"px",a=el.id("bookWidthBG4"),a.style.left="0px",a.style.width=b+"px",a=el.id("bookWidthBG5"),a.style.left=b+"px",a=el.id("bookWidthBG6"),a.style.left=b+"px",a=el.id("bookWidthBG7"),a.style.left=b+"px";else if("toRight"==bookWidthFx.widthChangeB)a=el.id("bookWidthBG1"),a.style.left=1*b+1*bookWidthFx.shiftL+
"px",a=el.id("bookWidthBG2"),a.style.left=1*b+1*bookWidthFx.shiftL+"px",a=el.id("bookWidthBG3"),a.style.left=1*b+1*bookWidthFx.shiftL+"px",a=el.id("bookWidthBG4"),a.style.left=b+"px",a.style.width=1*twoPageBook.bookWidth-1*b+"px",a=el.id("bookWidthBG5"),a.style.left=twoPageBook.bookWidth+"px",a=el.id("bookWidthBG6"),a.style.left=twoPageBook.bookWidth+"px",a=el.id("bookWidthBG7"),a.style.left=twoPageBook.bookWidth+"px";else if("toLandscape"==bookWidthFx.widthChangeB)a=el.id("bookWidthBG1"),a.style.left=
bookWidthFx.shiftL+"px",a=el.id("bookWidthBG2"),a.style.left=bookWidthFx.shiftL+"px",a=el.id("bookWidthBG3"),a.style.left=bookWidthFx.shiftL+"px",a=el.id("bookWidthBG4"),a.style.left="0px",a.style.width=1*twoPageBook.bookWidth+"px",a=el.id("bookWidthBG5"),a.style.left=1*twoPageBook.bookWidth+"px",a=el.id("bookWidthBG6"),a.style.left=1*twoPageBook.bookWidth+"px",a=el.id("bookWidthBG7"),a.style.left=1*twoPageBook.bookWidth+"px"}else bookWidthFx.draw()},draw:function(){if(onePageBook.installed){var a=
el.add("div");a.id="bookWidthBG1";a.style.zIndex="-1";a.style.width="9px";a.style.height="8px";a.style.left="-9px";a.style.top="0px";a.style.position="absolute";a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_03Thin.png")';el.id("bookWidth").appendChild(a);a=el.add("div");a.id="bookWidthBG2";a.style.zIndex="-1";a.style.width="9px";a.style.height=1*onePageBook.bookHeight-8+"px";a.style.left="-9px";a.style.top="8px";a.style.position="absolute";a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_07Thin.png")  repeat-y';
el.id("bookWidth").appendChild(a);a=el.add("div");a.id="bookWidthBG3";a.style.zIndex="-1";a.style.width="9px";a.style.height="13px";a.style.left="-9px";a.style.top=1*onePageBook.bookHeight+"px";a.style.position="absolute";a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_11Thin.png")';el.id("bookWidth").appendChild(a);a=el.add("div");a.id="bookWidthBG4";a.style.zIndex="-1";a.style.width=onePageBook.bookWidth+"px";a.style.height="13px";a.style.left="0px";a.style.top=1*onePageBook.bookHeight+
"px";a.style.position="absolute";a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_12.png") repeat-x';el.id("bookWidth").appendChild(a);if("fat"==bookWidthFx.widthStateR)a=el.add("div"),a.id="bookWidthBG5",a.style.zIndex="-1",a.style.width="18px",a.style.height="8px",a.style.left=1*onePageBook.bookWidth+"px",a.style.top="0px",a.style.position="absolute",a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_05.png")',el.id("bookWidth").appendChild(a),a=el.add("div"),a.id="bookWidthBG6",
a.style.zIndex="-1",a.style.width="18px",a.style.height=1*onePageBook.bookHeight-8+"px",a.style.left=1*onePageBook.bookWidth+"px",a.style.top="8px",a.style.position="absolute",a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_08.png") repeat-y',el.id("bookWidth").appendChild(a),a=el.add("div"),a.id="bookWidthBG7",a.style.zIndex="-1",a.style.width="18px",a.style.height="13px",a.style.left=1*onePageBook.bookWidth+"px",a.style.top=1*onePageBook.bookHeight+"px",a.style.position="absolute",a.style.background=
'url("'+STYLES_SRC+'bookWidth/bookWidth_14.png")',el.id("bookWidth").appendChild(a);else if("thin"==bookWidthFx.widthStateR)a=el.add("div"),a.id="bookWidthBG5",a.style.zIndex="-1",a.style.width="9px",a.style.height="8px",a.style.left=1*onePageBook.bookWidth+"px",a.style.top="0px",a.style.position="absolute",a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_05Thin.png")',el.id("bookWidth").appendChild(a),a=el.add("div"),a.id="bookWidthBG6",a.style.zIndex="-1",a.style.width="9px",a.style.height=
1*onePageBook.bookHeight-8+"px",a.style.left=1*onePageBook.bookWidth+"px",a.style.top="8px",a.style.position="absolute",a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_08Thin.png") repeat-y',el.id("bookWidth").appendChild(a),a=el.add("div"),a.id="bookWidthBG7",a.style.zIndex="-1",a.style.width="9px",a.style.height="13px",a.style.left=1*onePageBook.bookWidth+"px",a.style.top=1*onePageBook.bookHeight+"px",a.style.position="absolute",a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_14Thin.png")',
el.id("bookWidth").appendChild(a)}else if(twoPageBook.installed){var b=0,c=0,d=0,e=twoPageBook.bookWidth,a=1*twoPageBook.bookWidth/2,a=a.toFixed(),d="right"==bookWidthFx.twoPageState?a:0;"right"==bookWidthFx.twoPageState?b=a:"Landscape"==bookWidthFx.twoPageState&&(b=0);"left"==bookWidthFx.twoPageState?c=a:"Landscape"==bookWidthFx.twoPageState&&(c=0);e="Landscape"==bookWidthFx.twoPageState?1*twoPageBook.bookWidth:1*twoPageBook.bookWidth-a;if("fat"==bookWidthFx.widthStateL)a=el.add("div"),a.id="bookWidthBG1",
a.style.zIndex="-1",a.style.width="18px",a.style.height="8px",a.style.left=b-18+"px",a.style.top="0px",a.style.position="absolute",a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_03.png")',el.id("bookWidth").appendChild(a),a=el.add("div"),a.id="bookWidthBG2",a.style.zIndex="-1",a.style.width="18px",a.style.height=1*twoPageBook.bookHeight-8+"px",a.style.left=b-18+"px",a.style.top="8px",a.style.position="absolute",a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_07.png") repeat-y',
el.id("bookWidth").appendChild(a),a=el.add("div"),a.id="bookWidthBG3",a.style.zIndex="-1",a.style.width="18px",a.style.height="13px",a.style.left=b-18+"px",a.style.top=1*twoPageBook.bookHeight+"px",a.style.position="absolute",a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_11.png")',el.id("bookWidth").appendChild(a);else if("thin"==bookWidthFx.widthStateL)a=el.add("div"),a.id="bookWidthBG1",a.style.zIndex="-1",a.style.width="9px",a.style.height="8px",a.style.left=b-9+"px",a.style.top="0px",
a.style.position="absolute",a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_03Thin.png")',el.id("bookWidth").appendChild(a),a=el.add("div"),a.id="bookWidthBG2",a.style.zIndex="-1",a.style.width="9px",a.style.height=1*twoPageBook.bookHeight-8+"px",a.style.left=b-9+"px",a.style.top="8px",a.style.position="absolute",a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_07Thin.png") repeat-y',el.id("bookWidth").appendChild(a),a=el.add("div"),a.id="bookWidthBG3",a.style.zIndex="-1",a.style.width=
"9px",a.style.height="13px",a.style.left=b-9+"px",a.style.top=1*twoPageBook.bookHeight+"px",a.style.position="absolute",a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_11Thin.png")',el.id("bookWidth").appendChild(a);if("fat"==bookWidthFx.widthStateR)a=el.add("div"),a.id="bookWidthBG5",a.style.zIndex="-1",a.style.width="18px",a.style.height="8px",a.style.left=1*twoPageBook.bookWidth+c+"px",a.style.top="0px",a.style.position="absolute",a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_05.png")',
el.id("bookWidth").appendChild(a),a=el.add("div"),a.id="bookWidthBG6",a.style.zIndex="-1",a.style.width="18px",a.style.height=1*twoPageBook.bookHeight-8+"px",a.style.left=1*twoPageBook.bookWidth+c+"px",a.style.top="8px",a.style.position="absolute",a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_08.png") repeat-y',el.id("bookWidth").appendChild(a),a=el.add("div"),a.id="bookWidthBG7",a.style.zIndex="-1",a.style.width="18px",a.style.height="13px",a.style.left=1*twoPageBook.bookWidth+c+"px",
a.style.top=1*twoPageBook.bookHeight+"px",a.style.position="absolute",a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_14.png")',el.id("bookWidth").appendChild(a);else if("thin"==bookWidthFx.widthStateR)a=el.add("div"),a.id="bookWidthBG5",a.style.zIndex="-1",a.style.width="9px",a.style.height="8px",a.style.left=1*twoPageBook.bookWidth+c+"px",a.style.top="0px",a.style.position="absolute",a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_05Thin.png")',el.id("bookWidth").appendChild(a),
a=el.add("div"),a.id="bookWidthBG6",a.style.zIndex="-1",a.style.width="9px",a.style.height=1*twoPageBook.bookHeight-8+"px",a.style.left=1*twoPageBook.bookWidth+c+"px",a.style.top="8px",a.style.position="absolute",a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_08Thin.png") repeat-y',el.id("bookWidth").appendChild(a),a=el.add("div"),a.id="bookWidthBG7",a.style.zIndex="-1",a.style.width="9px",a.style.height="13px",a.style.left=1*twoPageBook.bookWidth+c+"px",a.style.top=1*twoPageBook.bookHeight+
"px",a.style.position="absolute",a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_14Thin.png")',el.id("bookWidth").appendChild(a);a=el.add("div");a.id="bookWidthBG4";a.style.zIndex="-1";a.style.width=e+"px";a.style.height="13px";a.style.left=d+"px";a.style.top=1*twoPageBook.bookHeight+"px";a.style.position="absolute";a.style.background='url("'+STYLES_SRC+'bookWidth/bookWidth_12.png") repeat-x';el.id("bookWidth").appendChild(a)}}},buttons={bgImg:"#000",bgImgOnclick:"#ccc",height:20,margin:10,
fieldWidth:40,fieldHeight:30,infoWidth:25,infoHeight:25,infoMargin:15,navigation:{parentNodeId:"",installed:!1,draw:function(a){var b=el.add("span");b.className="navigationField";b.id="navigationField";a.appendChild(b);buttons.navigation.first.draw(b);buttons.navigation.prev.draw(b);"navigationField"==buttons.slideShow.parentNodeId&&bookData.slideshowVisible&&buttons.slideShow.draw(b);buttons.navigation.next.draw(b);buttons.navigation.last.draw(b);buttons.navigation.installed=!0},first:{srcActive:STYLES_SRC+
"navigation/activefirst.png",srcInActive:STYLES_SRC+"navigation/inactivefirst.png",installed:!1,draw:function(a){var b=el.add("img");b.id="keyFirst";b.className="navigationButtons";b.src=buttons.navigation.first.srcInActive;b.style.height=buttons.navigation.height+"px";b.style.border=buttons.navigation.margin+"px solid transparent";buttons.navigation.first.events(b);buttons.navigation.first.installed=!0;a.appendChild(b)},check:function(a){if(buttons.navigation.first.installed)if(0==a)el.id("keyFirst").src=
buttons.navigation.first.srcInActive;else if(1==a)el.id("keyFirst").src=buttons.navigation.first.srcActive},down:function(a){a.stopPropagation();if(!slideShow.active&&-1==el.id("keyFirst").src.indexOf("inactive"))el.id("keyFirst").style.backgroundColor=buttons.bgImgOnclick},up:function(a){a.stopPropagation();el.id("keyFirst").style.backgroundColor=buttons.bgImg},action:function(a){a.stopPropagation();bookData.rightToLeftMode?slideShow.active||pageMediator.goToPage(bookData.pageCount):slideShow.active||
pageMediator.goToPage(1)},events:function(a){!1==eventManager.touchInterface?(a.addEventListener("mouseup",buttons.navigation.first.up),a.addEventListener("mouseup",buttons.navigation.first.action),a.addEventListener("mousedown",buttons.navigation.first.down)):(a.addEventListener("touchstart",buttons.navigation.first.down),a.addEventListener("touchend",buttons.navigation.first.up),a.addEventListener("touchend",buttons.navigation.first.action),a.addEventListener("touchmove",buttons.lockMove))}},prev:{srcActive:STYLES_SRC+
"navigation/activeprev.png",srcInActive:STYLES_SRC+"navigation/inactiveprev.png",installed:!1,draw:function(a){var b=el.add("img");b.id="keyPrev";b.className="navigationButtons";b.src=buttons.navigation.prev.srcInActive;b.style.height=buttons.navigation.height+"px";b.style.border=buttons.navigation.margin+"px solid transparent";buttons.navigation.prev.events(b);buttons.navigation.prev.installed=!0;a.appendChild(b)},check:function(a){if(buttons.navigation.prev.installed)if(0==a)el.id("keyPrev").src=
buttons.navigation.prev.srcInActive;else if(1==a)el.id("keyPrev").src=buttons.navigation.prev.srcActive},down:function(a){a.stopPropagation();if(!slideShow.active&&-1==el.id("keyPrev").src.indexOf("inactive"))el.id("keyPrev").style.backgroundColor=buttons.bgImgOnclick},up:function(a){a.stopPropagation();el.id("keyPrev").style.backgroundColor=buttons.bgImg},action:function(a){a.stopPropagation();bookData.rightToLeftMode?slideShow.active||pageMediator.next():slideShow.active||pageMediator.prev()},events:function(a){!1==
eventManager.touchInterface?(a.addEventListener("mouseup",buttons.navigation.prev.up),a.addEventListener("mouseup",buttons.navigation.prev.action),a.addEventListener("mousedown",buttons.navigation.prev.down)):(a.addEventListener("touchstart",buttons.navigation.prev.down),a.addEventListener("touchend",buttons.navigation.prev.up),a.addEventListener("touchend",buttons.navigation.prev.action),a.addEventListener("touchmove",buttons.lockMove))}},next:{srcActive:STYLES_SRC+"navigation/activenext.png",srcInActive:STYLES_SRC+
"navigation/inactivenext.png",installed:!1,draw:function(a){var b=el.add("img");b.id="keyNext";b.className="navigationButtons";b.src=buttons.navigation.next.srcInActive;b.style.height=buttons.navigation.height+"px";b.style.border=buttons.navigation.margin+"px solid transparent";buttons.navigation.next.events(b);buttons.navigation.next.installed=!0;a.appendChild(b)},check:function(a){if(buttons.navigation.next.installed)if(0==a)el.id("keyNext").src=buttons.navigation.next.srcInActive;else if(1==a)el.id("keyNext").src=
buttons.navigation.next.srcActive},down:function(a){a.stopPropagation();if(!slideShow.active&&-1==el.id("keyNext").src.indexOf("inactive"))el.id("keyNext").style.backgroundColor=buttons.bgImgOnclick},up:function(a){a.stopPropagation();el.id("keyNext").style.backgroundColor=buttons.bgImg},action:function(a){a.stopPropagation();bookData.rightToLeftMode?slideShow.active||pageMediator.prev():slideShow.active||pageMediator.next()},events:function(a){!1==eventManager.touchInterface?(a.addEventListener("mouseup",
buttons.navigation.next.up),a.addEventListener("mouseup",buttons.navigation.next.action),a.addEventListener("mousedown",buttons.navigation.next.down)):(a.addEventListener("touchstart",buttons.navigation.next.down),a.addEventListener("touchend",buttons.navigation.next.up),a.addEventListener("touchend",buttons.navigation.next.action),a.addEventListener("touchmove",buttons.lockMove))}},last:{srcActive:STYLES_SRC+"navigation/activelast.png",srcInActive:STYLES_SRC+"navigation/inactivelast.png",installed:!1,
draw:function(a){var b=el.add("img");b.id="keyLast";b.className="navigationButtons";b.src=buttons.navigation.last.srcInActive;b.style.height=buttons.navigation.height+"px";b.style.border=buttons.navigation.margin+"px solid transparent";buttons.navigation.last.events(b);buttons.navigation.last.installed=!0;a.appendChild(b)},check:function(a){if(buttons.navigation.last.installed)if(0==a)el.id("keyLast").src=buttons.navigation.last.srcInActive;else if(1==a)el.id("keyLast").src=buttons.navigation.last.srcActive},
down:function(a){a.stopPropagation();if(!slideShow.active&&-1==el.id("keyLast").src.indexOf("inactive"))el.id("keyLast").style.backgroundColor=buttons.bgImgOnclick},up:function(a){a.stopPropagation();el.id("keyLast").style.backgroundColor=buttons.bgImg},action:function(a){a.stopPropagation();bookData.rightToLeftMode?slideShow.active||pageMediator.goToPage(1):slideShow.active||pageMediator.goToPage(bookData.pageCount)},events:function(a){!1==eventManager.touchInterface?(a.addEventListener("mouseup",
buttons.navigation.last.up),a.addEventListener("mouseup",buttons.navigation.last.action),a.addEventListener("mousedown",buttons.navigation.last.down)):(a.addEventListener("touchstart",buttons.navigation.last.down),a.addEventListener("touchend",buttons.navigation.last.up),a.addEventListener("touchend",buttons.navigation.last.action),a.addEventListener("touchmove",buttons.lockMove))}}},slideShow:{parentNodeId:"",srcActive:STYLES_SRC+"navigation/activeslideshow.png",srcInActive:STYLES_SRC+"navigation/inactiveslideshow.png",
srcPaused:STYLES_SRC+"navigation/slideshowpause.png",installed:!1,draw:function(a){var b=el.add("img");b.id="keySlideShow";b.className="navigationButtons";if(bookData.rightToLeftMode)buttons.slideShow.srcActive=STYLES_SRC+"navigation/activeslideshowleft.png";if(bookData.rightToLeftMode)buttons.slideShow.srcInActive=STYLES_SRC+"navigation/inactiveslideshowleft.png";b.src=buttons.slideShow.srcActive;b.style.height=buttons.navigation.height+"px";b.style.border=buttons.navigation.margin+"px solid transparent";
buttons.slideShow.events(b);buttons.slideShow.installed=!0;a.appendChild(b)},check:function(a){if(buttons.slideShow.installed)zoomBook.installed?el.id("keySlideShow").src=buttons.slideShow.srcInActive:0==a?el.id("keySlideShow").src=buttons.slideShow.srcPaused:el.id("keySlideShow").src=buttons.slideShow.srcActive},down:function(a){a.stopPropagation();if(-1==el.id("keySlideShow").src.indexOf("inactive"))el.id("keySlideShow").style.backgroundColor=buttons.bgImgOnclick},up:function(a){a.stopPropagation();
el.id("keySlideShow").style.backgroundColor=buttons.bgImg},action:function(a){a.stopPropagation();zoomBook.installed||(slideShow.toGo(),buttons.check())},events:function(a){!1==eventManager.touchInterface?(a.addEventListener("mouseup",buttons.slideShow.up),a.addEventListener("mouseup",buttons.slideShow.action),a.addEventListener("mousedown",buttons.slideShow.down)):(a.addEventListener("touchstart",buttons.slideShow.down),a.addEventListener("touchend",buttons.slideShow.up),a.addEventListener("touchend",
buttons.slideShow.action),a.addEventListener("touchmove",buttons.lockMove))}},toc:{parentNodeId:"",src:STYLES_SRC+"buttons/toc.png",installed:!1,width:30,height:30,marginTop:0,marginLeft:5,draw:function(a){var b=el.add("span");b.id="tocField";b.className="buttonsField";b.style.width=buttons.fieldWidth+"px";b.style.height=buttons.fieldHeight+"px";a.appendChild(b);a=el.add("img");a.id="imgTocButton";a.className="imgTocButton";a.style.height=buttons.toc.height+"px";a.style.width=buttons.toc.width+"px";
a.style.margin=buttons.toc.marginTop+"px "+buttons.toc.marginLeft+"px ";a.src=buttons.toc.src;a.style.opacity=toc.isToc?"1":"0.5";b.appendChild(a);buttons.toc.events(b);buttons.toc.installed=!0},check:function(a){if(buttons.toc.installed){var b=el.id("imgTocButton");if(toc.isToc){b.style.opacity="1";if(0==a)b.parentNode.style.backgroundColor=buttons.bgImg;if(1==a)b.parentNode.style.backgroundColor=buttons.bgImgOnclick}else b.style.opacity="0.5"}},down:function(a){a.stopPropagation();if(toc.isToc&&
!slideShow.active)el.id("imgTocButton").parentNode.style.backgroundColor=buttons.bgImgOnclick},up:function(a){a.stopPropagation();if(toc.isToc)el.id("imgTocButton").parentNode.style.backgroundColor=buttons.bgImg},action:function(a){a.stopPropagation();!slideShow.active&&"input"!=pager.state&&toc.showFirstMenu()},events:function(a){!1==eventManager.touchInterface?(a.addEventListener("mouseup",buttons.toc.action),a.addEventListener("mousedown",buttons.toc.down),a.addEventListener("mouseup",buttons.toc.up)):
(a.addEventListener("touchend",buttons.toc.action),a.addEventListener("touchstart",buttons.toc.down),a.addEventListener("touchend",buttons.toc.up))}},back:{parentNodeId:"contentBorder",color:"#ccc",colorOn:"#000",installed:!1,draw:function(){var a=el.add("div");a.className="backButton";a.id="backButton";a.style.paddingTop=5*bookData.skinScale+"px";a.style.paddingLeft=8*bookData.skinScale+"px";a.style.paddingBottom=5*bookData.skinScale+"px";a.style.paddingRight=8*bookData.skinScale+"px";a.style.marginTop=
7*bookData.skinScale+"px";a.style.marginLeft=10*bookData.skinScale+"px";var b=el.add("span");b.className="backFont";b.id="backText";b.style.fontSize=14*bookData.skinScale+"px";b.appendChild(document.createTextNode("back"));a.appendChild(b);el.id(buttons.back.parentNodeId).appendChild(a);buttons.back.events(a);buttons.back.installed=!0},clear:function(){if(buttons.back.installed)el.del("backButton"),buttons.back.installed=!1},down:function(a){a.stopPropagation();if(2<=toc.level.length)el.id("backText").parentNode.style.border=
"1px solid #aaa"},check:function(){2<=toc.level.length?buttons.back.installed?el.id("backText").parentNode.style.border="none":buttons.back.draw():buttons.back.clear()},action:function(a){a.stopPropagation();!slideShow.active&&"input"!=pager.state&&toc.showPrevMenu()},events:function(a){el.id("backButton")&&(!1==eventManager.touchInterface?(a.addEventListener("mouseup",buttons.back.action),a.addEventListener("mousedown",buttons.back.down),a.addEventListener("mouseup",buttons.back.check)):(a.addEventListener("touchend",
buttons.back.action),a.addEventListener("touchstart",buttons.back.down),a.addEventListener("touchend",buttons.back.check),a.addEventListener("touchmove",buttons.lockMove)))}},bm:{src:STYLES_SRC+"buttons/bm.png",installed:!1,width:30,height:30,marginTop:0,marginLeft:5,draw:function(a){var b=el.add("span");b.id="bmField";b.className="buttonsField";b.style.width=buttons.fieldWidth+"px";b.style.height=buttons.fieldHeight+"px";a.appendChild(b);a=el.add("img");a.id="imgBmButton";a.className="imgBmButton";
a.style.height=buttons.bm.height+"px";a.style.width=buttons.bm.width+"px";a.style.margin=buttons.bm.marginTop+"px "+buttons.bm.marginLeft+"px ";a.src=buttons.bm.src;a.style.opacity=bm.isBm?"1":"0.5";b.appendChild(a);buttons.bm.events(b);buttons.bm.installed=!0;imgTocButton=null},check:function(a){if(buttons.bm.installed){var b=el.id("imgBmButton");if(bm.isBm){b.style.opacity="1";if(0==a)b.parentNode.style.backgroundColor=buttons.bgImg;if(1==a)b.parentNode.style.backgroundColor=buttons.bgImgOnclick}else b.style.opacity=
"0.5"}},down:function(a){a.stopPropagation();if(bm.isBm&&!slideShow.active)el.id("imgBmButton").parentNode.style.backgroundColor=buttons.bgImgOnclick},up:function(a){a.stopPropagation();if(bm.isBm)el.id("imgBmButton").parentNode.style.backgroundColor=buttons.bgImg},action:function(a){a.stopPropagation();!slideShow.active&&"input"!=pager.state&&bm.showList()},events:function(a){!1==eventManager.touchInterface?(a.addEventListener("mouseup",buttons.bm.action),a.addEventListener("mousedown",buttons.bm.down),
a.addEventListener("mouseup",buttons.bm.up)):(a.addEventListener("touchend",buttons.bm.action),a.addEventListener("touchstart",buttons.bm.down),a.addEventListener("touchend",buttons.bm.up),a.addEventListener("touchmove",buttons.lockMove))}},addBm:{parentNodeId:"",srcAdd:STYLES_SRC+"addbm.png",srcRem:STYLES_SRC+"rembm.png",installed:!1,width:30,height:30,marginTop:0,marginLeft:5,draw:function(a){var b=el.add("span");b.id="addField";b.className="buttonsField";b.style.width=buttons.fieldWidth+"px";b.style.height=
buttons.fieldHeight+"px";a.appendChild(b);a=el.add("img");a.id="imgAddButton";a.className="imgAddButton";a.style.height=buttons.addBm.height+"px";a.style.width=buttons.addBm.width+"px";a.style.margin=buttons.addBm.marginTop+"px "+buttons.addBm.marginLeft+"px ";a.src=bm.isAdd?buttons.addBm.srcAdd:buttons.addBm.srcRem;b.appendChild(a);buttons.addBm.events(b);buttons.addBm.installed=!0},check:function(){if(buttons.addBm.installed){elem=el.id("imgAddButton");if(onePageBook.installed||zoomBook.installed)bookData.page[pageMediator.getPage()].mark?
(bm.isAdd=!1,elem.src=buttons.addBm.srcRem):(bm.isAdd=!0,elem.src=buttons.addBm.srcAdd);else if(twoPageBook.installed)bookData.page[pageMediator.getPage()].mark||!bookData.rightToLeftMode&&(pageMediator.getPage("right")==bookData.pageCount?0:bookData.page[pageMediator.getPage("right")].mark)||"true"==bookData.rightToLeftMode&&(pageMediator.getPage("left")==bookData.pageCount?0:bookData.page[pageMediator.getPage("left")].mark)?(bm.isAdd=!1,elem.src=buttons.addBm.srcRem):(bm.isAdd=!0,elem.src=buttons.addBm.srcAdd);
elem=null}},down:function(a){a.stopPropagation();if(!slideShow.active)el.id("imgAddButton").parentNode.style.backgroundColor=buttons.bgImgOnclick},up:function(a){a.stopPropagation();el.id("imgAddButton").parentNode.style.backgroundColor=buttons.bgImg},action:function(a){a.stopPropagation();!slideShow.active&&"input"!=pager.state&&bm.addButton.action()},events:function(a){!1==eventManager.touchInterface?(a.addEventListener("mouseup",buttons.addBm.up),a.addEventListener("mouseup",buttons.addBm.action),
a.addEventListener("mousedown",buttons.addBm.down)):(a.addEventListener("touchstart",buttons.addBm.down),a.addEventListener("touchend",buttons.addBm.up),a.addEventListener("touchend",buttons.addBm.action),a.addEventListener("touchmove",buttons.lockMove))}},search:{parentNodeId:"",src:STYLES_SRC+"buttons/search.png",installed:!1,width:30,height:30,marginTop:0,marginLeft:5,draw:function(a){var b=el.add("span");b.id="searchField";b.className="buttonsField";b.style.width=buttons.fieldWidth+"px";b.style.height=
buttons.fieldHeight+"px";a.appendChild(b);a=el.add("img");a.id="imgSearchButton";a.className="imgSearchButton";a.style.height=buttons.search.height+"px";a.style.width=buttons.search.width+"px";a.style.margin=buttons.search.marginTop+"px "+buttons.search.marginLeft+"px ";a.src=buttons.search.src;b.appendChild(a);buttons.search.events(b);buttons.search.installed=!0},check:function(a){if(buttons.search.installed){var b=el.id("imgSearchButton");if(0==a)b.parentNode.style.backgroundColor=buttons.bgImg;
if(1==a)b.parentNode.style.backgroundColor=buttons.bgImgOnclick}},down:function(a){a.stopPropagation();if(!slideShow.active)el.id("imgSearchButton").parentNode.style.backgroundColor=buttons.bgImgOnclick},up:function(a){a.stopPropagation();el.id("imgSearchButton").parentNode.style.backgroundColor=buttons.bgImg},action:function(a){a.stopPropagation();!slideShow.active&&"input"!=pager.state&&ctrlEngine.search.action()},events:function(a){!1==eventManager.touchInterface?(a.addEventListener("mouseup",
buttons.search.action),a.addEventListener("mousedown",buttons.search.down),a.addEventListener("mouseup",buttons.search.up)):(a.addEventListener("touchend",buttons.search.action),a.addEventListener("touchstart",buttons.search.down),a.addEventListener("touchend",buttons.search.up),a.addEventListener("touchmove",buttons.lockMove))}},stopSearch:{parentNodeId:"",src:STYLES_SRC+"buttons/exit.png",draw:function(a){var b=el.add("span");b.className="exitField";b.id="stopSearch";b.style.height=30*bookData.skinScale+
"px";b.style.width=30*bookData.skinScale+"px";b.style.right=5*bookData.skinScale+"px";b.style.top=5*bookData.skinScale+"px";a.appendChild(b);a=el.add("img");a.id="imgExitButton";a.className="imgExitButton";a.style.height=30*bookData.skinScale+"px";a.style.width=30*bookData.skinScale+"px";a.src=buttons.exit.src;b.appendChild(a);buttons.stopSearch.events(b)},action:function(a){a.stopPropagation();el.id("imgExitButton").parentNode.style.border="none";if(search.active){"search"==ctrlEngine.mode&&ctrlEngine.hide();
for(tb in bookData.toolbar)tb=bookData.toolbar[tb],"navigationToolbar"==tb.id&&toolbar.transform(tb,-1),"searchToolbar"==tb.id&&toolbar.transform(tb,0);ctrlEngine.search.clearResults()}},down:function(a){a.stopPropagation();el.id("imgExitButton").parentNode.style.border="1px solid #aaa"},events:function(a){!1==eventManager.touchInterface?(a.addEventListener("mouseup",buttons.stopSearch.action),a.addEventListener("mousedown",buttons.stopSearch.down)):(a.addEventListener("touchend",buttons.stopSearch.action),
a.addEventListener("touchstart",buttons.stopSearch.down))}},edit:{},info:{parentNodeId:"",src:STYLES_SRC+"buttons/info.png",isShow:!1,width:25,height:25,margin:0,imgWidth:25,imgHeight:25,draw:function(a){var b=el.add("span");b.id="infoField";b.className="infoField";b.style.width=buttons.info.width+"px";b.style.height=buttons.info.height+"px";b.style.margin=buttons.info.margin+"px";a.appendChild(b);a=el.add("img");a.id="imgInfoButton";a.className="imgInfoButton";a.style.width=buttons.info.imgWidth+
"px";a.style.height=buttons.info.imgHeight+"px";a.src=buttons.info.src;b.appendChild(a);buttons.info.events(b);buttons.info.installed=!0},action:function(a){a.stopPropagation();if(!slideShow.active&&(el.id("imgInfoButton").parentNode.style.backgroundColor=buttons.info.bgImg,toolbar.toogle(),eventManager.lock=!0,"hide"==ctrlEngine.state))ctrlEngine.mode="info",ctrlEngine.display()},down:function(a){a.stopPropagation();if(!slideShow.active)el.id("imgInfoButton").parentNode.style.backgroundColor=buttons.info.bgImgOnclick},
events:function(a){!1==eventManager.touchInterface?(a.addEventListener("mouseup",buttons.info.action),a.addEventListener("mousedown",buttons.info.down)):(a.addEventListener("touchend",buttons.info.action),a.addEventListener("touchstart",buttons.info.down),a.addEventListener("touchmove",buttons.lockMove))}},exit:{parentNodeId:"",src:STYLES_SRC+"buttons/exit.png",draw:function(a){var b=el.add("span");b.className="exitField";b.id="exitField";b.style.height=30*bookData.skinScale+"px";b.style.width=30*
bookData.skinScale+"px";b.style.right=5*bookData.skinScale+"px";b.style.top=5*bookData.skinScale+"px";a.appendChild(b);a=el.add("img");a.id="imgExitButton";a.className="imgExitButton";a.style.height=30*bookData.skinScale+"px";a.style.width=30*bookData.skinScale+"px";a.src=buttons.exit.src;b.appendChild(a);buttons.exit.events(b)},action:function(a){a.stopPropagation();el.id("imgExitButton").parentNode.style.border="none";if("info"==ctrlEngine.mode)ctrlEngine.hide(),eventManager.lock=!1,toolbar.toogle();
if("notification"==ctrlEngine.mode)ctrlEngine.notification.hide(),eventManager.lock=!1;("search"==ctrlEngine.mode||"toc"==ctrlEngine.mode||"bm"==ctrlEngine.mode)&&ctrlEngine.hide()},down:function(a){a.stopPropagation();el.id("imgExitButton").parentNode.style.border="1px solid #aaa"},events:function(a){!1==eventManager.touchInterface?(a.addEventListener("mouseup",buttons.exit.action),a.addEventListener("mousedown",buttons.exit.down)):(a.addEventListener("touchend",buttons.exit.action),a.addEventListener("touchstart",
buttons.exit.down))}},share:{},check:function(){var a=pageMediator.getPage();slideShow.active?(buttons.navigation.first.check(0),buttons.navigation.prev.check(0),buttons.slideShow.check(0),buttons.navigation.next.check(0),buttons.navigation.last.check(0)):(buttons.slideShow.check(1),bookData.rightToLeftMode?(pageMediator.isLastPage()?(buttons.navigation.first.check(0),buttons.navigation.prev.check(0)):(buttons.navigation.first.check(1),buttons.navigation.prev.check(1)),1==a?(buttons.navigation.next.check(0),
buttons.navigation.last.check(0)):(buttons.navigation.next.check(1),buttons.navigation.last.check(1))):(1==a?(buttons.navigation.first.check(0),buttons.navigation.prev.check(0)):(buttons.navigation.first.check(1),buttons.navigation.prev.check(1)),pageMediator.isLastPage()?(buttons.navigation.next.check(0),buttons.navigation.last.check(0)):(buttons.navigation.next.check(1),buttons.navigation.last.check(1))));buttons.addBm.check()},lockMove:function(a){a.preventDefault();a.stopPropagation()}},ctrlEngine=
{state:"hide",mode:"toc",init:function(){toc.init();bm.init();toolbar.draw()},border:{width:350,height:390,orientation:"top",left:0,top:0,isFx:!0,draw:function(){switch(ctrlEngine.mode){case "info":ctrlEngine.border.width=system.device.width()-10<ctrlEngine.border.wInfo?system.device.width()-10:ctrlEngine.border.wInfo;ctrlEngine.border.height=system.device.height();break;case "notification":ctrlEngine.border.width=system.device.width()-10<ctrlEngine.border.wInfo?system.device.width()-10:ctrlEngine.border.wInfo;
ctrlEngine.border.height=system.device.height()/2;break;default:ctrlEngine.border.width=system.device.width()-ctrlEngine.border.left-ctrlEngine.border.right<ctrlEngine.border.wMain?system.device.width()-ctrlEngine.border.left-ctrlEngine.border.right:ctrlEngine.border.wMain,ctrlEngine.border.height=0.8*system.device.height()}var a=el.add("div");a.className="contentBorder";a.id="contentBorder";a.style.height=ctrlEngine.border.height+"px";a.style.width=ctrlEngine.border.width+"px";if("top"==ctrlEngine.border.orientation)ctrlEngine.border.isFx?
(a.style.top=-(ctrlEngine.border.height+ctrlEngine.border.top+2)+"px",window.setTimeout(ctrlEngine.border.toogle,50)):a.style.top=ctrlEngine.border.top+"px",a.style.left="info"==ctrlEngine.mode||"notification"==ctrlEngine.mode?(system.device.width()-ctrlEngine.border.width)/2+"px":ctrlEngine.border.left+"px";ctrlEngine.events.lock(a);var b="";if("toc"==ctrlEngine.mode)b=buttons.toc.parentNodeId,buttons.exit.draw(a);if("bm"==ctrlEngine.mode)b=buttons.bm.parentNodeId,buttons.exit.draw(a);if("search"==
ctrlEngine.mode)b=buttons.bm.parentNodeId,buttons.exit.draw(a);"info"==ctrlEngine.mode&&(b="infoToolbar",buttons.exit.draw(a));"notification"==ctrlEngine.mode&&(b="infoToolbar");var c={},c=el.id(b);c.appendChild(a);b=el.add("div");b.className="contentBorderInner";b.id="content";b.style.margin=40*bookData.skinScale+"px "+5*bookData.skinScale+"px "+5*bookData.skinScale+"px "+5*bookData.skinScale+"px";b.style.height=ctrlEngine.border.height-ctrlEngine.border.hHeader-ctrlEngine.border.margin+"px";b.style.width=
ctrlEngine.border.width-2*ctrlEngine.border.margin+"px";a.appendChild(b)},toogle:function(){var a=el.id("contentBorder");"display"==ctrlEngine.state&&ctrlEngine.border.transform(a,1);"hide"==ctrlEngine.state&&ctrlEngine.border.transform(a,0)},transform:function(a,b){var c=0;"top"==ctrlEngine.border.orientation&&(c="info"==ctrlEngine.mode?(ctrlEngine.border.height+ctrlEngine.border.top+2)*b+14:"notification"==ctrlEngine.mode?(ctrlEngine.border.height+2*ctrlEngine.border.margin)*b+14:(ctrlEngine.border.height+
ctrlEngine.border.top+2)*b-2,html5lib.duration(a,ctrlEngine.border.speed),html5lib.translate(a,0,c,100))}},label:{draw:function(a){var b=el.add("div");b.className="contentLabel";b.id="contentLabel";b.style.marginTop=10*bookData.skinScale+"px";b.style.height=20*bookData.skinScale+"px";var c=el.add("h1");c.className="labelFont";c.style.marginTop=2*bookData.skinScale+"px";c.style.fontSize=16*bookData.skinScale+"px";var d="";"toc"==ctrlEngine.mode?d=document.createTextNode("Table of Contents"):"bm"==
ctrlEngine.mode?d=document.createTextNode("Bookmarks"):"notification"==ctrlEngine.mode?d=document.createTextNode(a):"info"==ctrlEngine.mode?d=document.createTextNode("Help"):"search"==ctrlEngine.mode&&(d=document.createTextNode("Search Results"));c.appendChild(d);b.appendChild(c);el.id("contentBorder").appendChild(b)},clear:function(){el.del("contentLabel")}},content:{init:function(){var a=el.add("div");a.style.width=ctrlEngine.border.width-2*ctrlEngine.border.margin+"px";a.id="contentInner";a.style.position=
"absolute";if("notification"!=ctrlEngine.mode)a.style.webkitUserSelect="none";a.style.webkitTransitionDuration=toc.shiftSpeed;el.id("content").appendChild(a);"notification"!=ctrlEngine.mode&&ctrlEngine.events.scroll(a)},clear:function(){el.del("contentInner")},generateList:{toc:function(a,b,c){if(a){var d=el.add("ul");d.id="menu"+b;d.className="tocUL";d.style.width=ctrlEngine.border.width-2*ctrlEngine.border.margin+"px";d.style.left=b*ctrlEngine.border.width+"px";c?el.id("contentInner").appendChild(d):
el.id("contentInner").insertBefore(d,el.id("menu"+(b+1)));for(var e in a.tocElement){b=el.add("li");b.className="tocLI";b.style.paddingTop=10*bookData.skinScale+"px";b.style.paddingBottom=10*bookData.skinScale+"px";b.style.width=ctrlEngine.border.width-2*ctrlEngine.border.margin+"px";b.setAttribute("page",a.tocElement[e].page);b.setAttribute("position",e);b.setAttribute("child",a.tocElement[e].children?"yes":"no");c=el.add("span");c.className="tocContent";c.style.width=ctrlEngine.border.width-57*
bookData.skinScale+"px";c.style.fontSize=12*bookData.skinScale+"px";c.appendChild(document.createTextNode(a.tocElement[e].name));b.appendChild(c);if("yes"==b.getAttribute("child"))c=el.add("img"),c.className="tocContent",c.style.width=22*bookData.skinScale+"px",c.src=STYLES_SRC+"subtoc.png",b.appendChild(c);d.appendChild(b)}}},bm:function(){var a=el.add("ul");a.style.width=ctrlEngine.border.width-2*ctrlEngine.border.margin+"px";a.id="menuBM";a.className="bmUL";el.id("contentInner").appendChild(a);
for(var b in bookData.BM.bmElement){var c=el.add("li");c.className="bmLI";c.id="liBM"+b;c.style.paddingTop=10*bookData.skinScale+"px";c.style.paddingBottom=10*bookData.skinScale+"px";c.setAttribute("page",b);c.setAttribute("name",bookData.BM.bmElement[b]);c.setAttribute("select",!1);var d=el.add("span");d.className="bmContent";d.style.width=ctrlEngine.border.width-85*bookData.skinScale+"px";d.style.fontSize=12*bookData.skinScale+"px";d.appendChild(document.createTextNode(bookData.BM.bmElement[b]));
c.appendChild(d);d=el.add("span");d.className="bmContent";d.style.width="50px";d.style.fontSize=12*bookData.skinScale+"px";d.appendChild(document.createTextNode("p. "+b));c.appendChild(d);a.appendChild(c)}},search:function(){var a=el.add("ul");a.style.width=ctrlEngine.border.width-2*ctrlEngine.border.margin+"px";a.id="menuSearch";a.className="searchUL";el.id("contentInner").appendChild(a);for(var b in search.result){var c=el.add("li");c.className="searchLI";c.id="liSearch"+b;c.style.paddingTop=10*
bookData.skinScale+"px";c.style.paddingBottom=10*bookData.skinScale+"px";c.setAttribute("page",search.result[b].id);c.setAttribute("select",!1);var d=el.add("span");d.className="searchContent";d.style.width=ctrlEngine.border.width-85*bookData.skinScale+"px";d.style.fontSize=12*bookData.skinScale+"px";d.innerHTML=search.result[b].text;c.appendChild(d);d=el.add("span");d.className="searchContent";d.style.width="50px";d.style.fontSize=12*bookData.skinScale+"px";d.appendChild(document.createTextNode("p. "+
search.result[b].id));c.appendChild(d);a.appendChild(c)}},info:function(){var a=el.add("div");a.className="infoBG";a.id="infoBG";a.style.width=system.device.width()+"px";a.style.height=system.device.height()+50+"px";el.id("infoToolbar").style.zIndex="1000";el.id("infoToolbar").style.zIndex="1000";el.id("infoToolbar").appendChild(a);infoOut=function(){event.stopPropagation();event.preventDefault();ctrlEngine.hide();eventManager.lock=!1;toolbar.toogle()};!1==eventManager.touchInterface?a.addEventListener("mousedown",
infoOut):(a.addEventListener("gesturestart",infoOut),a.addEventListener("gesturechange",infoOut),a.addEventListener("touchmove",infoOut),a.addEventListener("touchstart",infoOut));var a=null,b=el.add("ul");b.id="gesture List";b.style.width=ctrlEngine.border.width-2*ctrlEngine.border.margin+"px";b.id="menuInfo";b.className="infoUL";b.style.marginTop=5*bookData.skinScale+"px";b.style.marginBottom=5*bookData.skinScale+"px";el.id("contentInner").appendChild(b);var c=el.add("span");c.className="infoCategoryFont";
c.style.margin=10*bookData.skinScale+"px";c.style.fontSize=18*bookData.skinScale+"px";var d=document.createTextNode("Gestures");c.appendChild(d);d=null;b.appendChild(c);c=null;d=0;for(d in bookData.info.gestures){var e=el.add("li");e.className="infoLI";c=el.add("img");c.className="infoContent";c.style.margin=5*bookData.skinScale+"px "+5*bookData.skinScale+"px";c.src=bookData.info.gestures[d].src;e.appendChild(c);c=null;a=el.add("div");a.className="infoContent";a.style.margin=15*bookData.skinScale+
"px 0 0 0";c=el.add("span");c.className="infoNameFont";c.style.fontSize=16*bookData.skinScale+"px";c.style.padding=5*bookData.skinScale+"px";c.appendChild(document.createTextNode(bookData.info.gestures[d].h1));a.appendChild(c);c=null;c=el.add("span");c.className="infoDescriptionFont";c.style.fontSize=14*bookData.skinScale+"px";c.style.padding=5*bookData.skinScale+"px";c.appendChild(document.createTextNode(bookData.info.gestures[d].p));a.appendChild(c);c=null;e.appendChild(a);a=null;b.appendChild(e);
e=null}d=b=null;b=el.add("ul");b.id="toolbar options";b.style.width=ctrlEngine.border.width-2*ctrlEngine.border.margin+"px";b.id="menuInfo";b.className="infoUL";el.id("contentInner").appendChild(b);c=el.add("span");c.className="infoCategoryFont";c.style.margin=10*bookData.skinScale+"px";c.style.fontSize=18*bookData.skinScale+"px";d=document.createTextNode("Toolbar options");c.appendChild(d);d=null;b.appendChild(c);c=null;d=0;for(d in bookData.info.toolbar)e=el.add("li"),e.className="infoLI",c=el.add("img"),
c.className="infoContent",c.src=bookData.info.toolbar[d].src,c.style.margin=5*bookData.skinScale+"px "+25*bookData.skinScale+"px",c.style.height=40*bookData.skinScale+"px",e.appendChild(c),c=null,a=el.add("div"),a.className="infoContent",a.style.margin=10*bookData.skinScale+"px 0 0 0",c=el.add("span"),c.className="infoDescriptionFont",c.style.fontSize=14*bookData.skinScale+"px",c.style.padding=5*bookData.skinScale+"px",c.appendChild(document.createTextNode(bookData.info.toolbar[d].p)),a.appendChild(c),
c=null,e.appendChild(a),a=null,b.appendChild(e),e=null;b=d=null;b=el.add("ul");b.id="navigation";b.style.width=ctrlEngine.border.width-2*ctrlEngine.border.margin+"px";b.id="menuInfo";b.className="infoUL";el.id("contentInner").appendChild(b);c=el.add("span");c.className="infoCategoryFont";c.style.margin=10*bookData.skinScale+"px";c.style.fontSize=18*bookData.skinScale+"px";d=document.createTextNode("Navigation");c.appendChild(d);d=null;b.appendChild(c);c=null;d=0;for(d in bookData.info.navigation)e=
el.add("li"),e.className="infoLI",c=el.add("img"),c.className="infoContent",c.src=bookData.info.navigation[d].src,c.style.margin=5*bookData.skinScale+"px "+35*bookData.skinScale+"px",c.style.height=25*bookData.skinScale+"px",e.appendChild(c),c=null,a=el.add("div"),a.className="infoContent",a.style.margin=5*bookData.skinScale+"px 0 0 0",c=el.add("span"),c.className="infoDescriptionFont",c.style.fontSize=14*bookData.skinScale+"px",c.style.padding=5*bookData.skinScale+"px",c.appendChild(document.createTextNode(bookData.info.navigation[d].p)),
a.appendChild(c),c=null,e.appendChild(a),a=null,b.appendChild(e),e=null;b=d=null},notification:function(a,b){if(!b){var c=el.add("div");c.className="infoBG";c.id="infoBG";c.style.width=system.device.width()+"px";c.style.height=system.device.height()+50+"px";el.id("infoToolbar").appendChild(c);notificationOut=function(){event.stopPropagation();event.preventDefault();ctrlEngine.notification.hide();eventManager.lock=!1};ctrlEngine.events.lock(c);c=null}c=el.add("div");c.id="message";c.style.fontSize=
"20px";c.style.lineHeight="36px";c.style.zIndex="5";c.innerHTML=a;for(var d=0;d<c.childNodes.length;d++){var e=c.childNodes[d];if("A"==e.tagName&&e.hasAttribute("href"))e.className="noteFont",url=e.getAttribute("href"),e.addEventListener("touchstart",function(){window.open(url)});e=null}d=null;c.style.webkitUserSelection=!0;el.id("contentInner").appendChild(c);el.id("contentInner").style.position="relative";el.id("contentInner").style.padding="10px";el.id("contentInner").style.webkitBoxSizing="border-box";
el.id("content").style.height="auto";b?(el.id("contentBorder").style.height=el.id("content").offsetHeight+2*ctrlEngine.border.margin+"px",el.id("content").style.margin=ctrlEngine.border.margin+"px"):el.id("contentBorder").style.height=el.id("content").offsetHeight+ctrlEngine.border.hHeader+ctrlEngine.border.margin+"px"}},remove:function(a){el.del("menu"+a)},draw:function(){ctrlEngine.content.init();switch(ctrlEngine.mode){case "toc":var a=toc.parseLevel(toc.level.length);ctrlEngine.content.generateList.toc(a,
0,!0);break;case "bm":ctrlEngine.content.generateList.bm();break;case "info":ctrlEngine.content.generateList.info();break;case "search":ctrlEngine.content.generateList.search()}},subToc:function(a){var b=toc.level.length,c=toc.parseLevel(b);toc.tocLock=!0;toc.pageNum=a.getAttribute("page");if("yes"==a.getAttribute("child")){a.style.background="#888888";ctrlEngine.content.rightShift(b);toc.level[b]=a.getAttribute("position");ctrlEngine.content.generateList.toc(c.tocElement[toc.level[b]].children,b,
!0);var d=function(){2<toc.level.length&&ctrlEngine.content.remove(toc.level.length-3);delete d};window.setTimeout(d,toc.shiftSpeed+50);var e=function(){pageMediator.goToPage(toc.pageNum);delete e};window.setTimeout(e,toc.shiftSpeed+50);buttons.back.check()}else pageMediator.goToPage(toc.pageNum);c=b=a=null},rightShift:function(a){el.id("contentInner").style.webkitTransform="translate3d("+a*-ctrlEngine.border.width+"px, 0px,0px)"},leftShift:function(a){el.id("contentInner").style.webkitTransform=
"translate3d("+a*-ctrlEngine.border.width+"px, 0px,0px)"}},display:function(){if(!slideShow.active)ctrlEngine.state="display",ctrlEngine.border.draw(),ctrlEngine.label.draw(),ctrlEngine.content.draw();window.addEventListener("orientationchange",ctrlEngine.hide,!1)},notification:function(a){ctrlEngine.notification.hide=function(){a.tip||el.del("infoBG");ctrlEngine.state="hide";el.del("contentBorder")};if(!slideShow.active)ctrlEngine.mode="notification",ctrlEngine.state="display",ctrlEngine.border.draw(),
a.tip||(ctrlEngine.label.draw(a.name),buttons.exit.draw(el.id("contentBorder"))),ctrlEngine.content.init(),ctrlEngine.content.generateList.notification(a.text,a.tip),a.tip&&window.setTimeout(function(){var a=el.id("contentBorder");html5lib.translate(a,0,0,0);window.setTimeout(function(){ctrlEngine.notification.hide()},300)},a.time),window.addEventListener("orientationchange",ctrlEngine.notification.hide,!1)},change:function(){"bm"==ctrlEngine.mode?(ctrlEngine.label.clear(),buttons.back.clear(),ctrlEngine.content.clear()):
"search"==ctrlEngine.mode?(ctrlEngine.label.clear(),buttons.back.clear(),ctrlEngine.content.clear()):"toc"==ctrlEngine.mode&&(ctrlEngine.label.clear(),ctrlEngine.content.clear());ctrlEngine.label.draw();ctrlEngine.content.draw()},hide:function(){if("display"==ctrlEngine.state)"info"==ctrlEngine.mode&&el.del("infoBG"),"toc"==ctrlEngine.mode&&buttons.back.clear(),ctrlEngine.state="hide",el.del("contentBorder")},edit:{draw:function(){},addBM:function(a,b){bookData.BM.add(a,b)},addNewBM:function(a){bookData.BM.add(a,
"Bookmark "+a)},enterName:function(a){ctrlEngine.input.draw(a);ctrlEngine.input.enable(a)},changeName:function(a){var b=el.id("inputLi").parentNode;b.parentNode.setAttribute("name",a);var c=b.parentNode.getAttribute("page");bookData.BM.change(c,a);ctrlEngine.input.state&&ctrlEngine.input.cancel(b);bm.isEdit=!1}}};
ctrlEngine.events={touchInterface:!1,downCLk:!1,moveCLk:!1,startY:0,currY:0,deltaY:0,offset:0,scrollSpeed:"0s",lock:function(a){!1==eventManager.touchInterface?(a.addEventListener("mousedown",ctrlEngine.events.stop),a.addEventListener("mouseup",ctrlEngine.events.stop),a.addEventListener("mouseout",ctrlEngine.events.stop),a.addEventListener("mousemove",ctrlEngine.events.stop)):(a.addEventListener("touchstart",ctrlEngine.events.stop),a.addEventListener("touchend",ctrlEngine.events.stop),a.addEventListener("touchcancel",
ctrlEngine.events.stop),a.addEventListener("touchmove",ctrlEngine.events.stop),a.addEventListener("gesturestart",ctrlEngine.events.stop),a.addEventListener("gesturechange",ctrlEngine.events.stop),a.addEventListener("gestureend",ctrlEngine.events.stop))},stop:function(a){a.stopPropagation();a.preventDefault()},scroll:function(a){!1==eventManager.touchInterface?(a.addEventListener("mousedown",ctrlEngine.events.down),a.addEventListener("mouseup",ctrlEngine.events.up),a.addEventListener("mousemove",ctrlEngine.events.move)):
(a.addEventListener("touchstart",ctrlEngine.events.down),a.addEventListener("touchend",ctrlEngine.events.up),a.addEventListener("touchmove",ctrlEngine.events.move))},getId:function(a){if(void 0==a.tagName)a=a.parentNode;if(!a.hasAttribute("page")&&(a=a.parentNode,!a.hasAttribute("page")))a=a.parentNode,a=a.hasAttribute("page")?a:a.parentNode;return a},getIdContentInner:function(a){if(void 0==a.tagName)a=a.parentNode;if("contentInner"!=a.id&&(a=a.parentNode,"contentInner"!=a.id&&(a=a.parentNode,"contentInner"!=
a.id)))a=a.parentNode,a="contentInner"==a.id?a:a.parentNode;return a},down:function(a){a.stopPropagation();a.preventDefault();if("toc"==ctrlEngine.mode){var b=ctrlEngine.events.getId(a.target);if(timer.check("fx"))b.style.background="#bbbbbb";if(b.getAttribute("position")!=toc.mark&&0<toc.mark)b.parentNode.getElementsByTagName("LI")[toc.mark-1].style.background="",toc.mark=0}else if("bm"==ctrlEngine.mode){if(bm.isEdit&&!bm.isSelect||!bm.isEdit){a.preventDefault();var b=ctrlEngine.events.getId(a.target),
c=b.parentNode.childNodes;for(i=0;i<c.length;i++)c[i].setAttribute("select",!1),c[i].style.background="";if(timer.check("fx"))b.style.background="#bbbbbb";b.setAttribute("select",!0);i=null}}else if("search"==ctrlEngine.mode&&search.active){a.preventDefault();b=ctrlEngine.events.getId(a.target);c=b.parentNode.childNodes;for(i=0;i<c.length;i++)c[i].setAttribute("select",!1),c[i].style.background="";if(timer.check("fx"))b.style.background="#bbbbbb";b.setAttribute("select",!0);i=null}ctrlEngine.events.downClk=
!0;"toc"==ctrlEngine.mode?ctrlEngine.events.getId(a.target):ctrlEngine.events.getIdContentInner(a.target);ctrlEngine.events.startY=!1==eventManager.touchInterface?a.pageY-ctrlEngine.events.offset:a.targetTouches[0].clientY-ctrlEngine.events.offset;ctrlEngine.events.deltaY=0},up:function(a){a.stopPropagation();a.preventDefault();if("toc"==ctrlEngine.mode){if(a=ctrlEngine.events.getId(a.target),a.style.background="",0==ctrlEngine.events.deltaY&&timer.check("fx"))ctrlEngine.content.subToc(a),toc.mark=
0}else if("bm"==ctrlEngine.mode){if(bm.isEdit&&!bm.isSelect||!bm.isEdit)bm.isSelect=!0,a=ctrlEngine.events.getId(a.target),0==ctrlEngine.events.deltaY&&timer.check("fx")&&pageMediator.goToPage(a.getAttribute("page"))}else if("search"==ctrlEngine.mode&&search.active)ctrlEngine.search.isSelect=!0,a=ctrlEngine.events.getId(a.target),0==ctrlEngine.events.deltaY&&timer.check("fx")&&pageMediator.goToPage(a.getAttribute("page"));ctrlEngine.events.downClk=!1},move:function(a){a.stopPropagation();a.preventDefault();
if(!0==ctrlEngine.events.downClk){if("info"==ctrlEngine.mode)var b=ctrlEngine.events.getIdContentInner(a.target);else if(b=ctrlEngine.events.getId(a.target),b.style.background="","bm"==ctrlEngine.mode)b=ctrlEngine.events.getIdContentInner(a.target);else if("toc"==ctrlEngine.mode)b=b.parentNode;ctrlEngine.events.currY=!1==eventManager.touchInterface?a.pageY:a.targetTouches[0].clientY;ctrlEngine.events.deltaY=ctrlEngine.events.currY-ctrlEngine.events.startY;a="toc"==ctrlEngine.mode?b.parentNode.parentNode.offsetHeight-
b.scrollHeight:b.parentNode.offsetHeight-b.scrollHeight;if(0<=ctrlEngine.events.deltaY+b.offsetTop)b.style.top="0px",ctrlEngine.events.offset=0;else if(ctrlEngine.events.deltaY>=a)b.style.top=ctrlEngine.events.deltaY+"px",prefix=ctrlEngine.events.deltaY,ctrlEngine.events.offset=prefix,prefix=null}}};
var eventManager={touchInterface:!1,leftAndRightArea:0.15,gesture:!1,touchStartCoordinate:{x:0,y:0},clickStartCoordinate:{x:0,y:0},click:!1,clickCount:0,doubleClickTime:250,lock:!1,start:function(){"createTouch"in document?(eventManager.touchInterface=!0,eventManager.loadTouchEvents(el.id("mainFrame"))):(eventManager.touchInterface=!1,eventManager.loadClickEvents(el.id("mainFrame")))},loadTouchEvents:function(a){var b=function(a){eventManager.gesture=!0;a.target=a.target?a.target:a.srcElement;a.preventDefault?
a.preventDefault():a.returnValue=!1;twoPageBook.installed&&!zoomBook.installed?twoPageBook.events.gestureStart(a):onePageBook.installed&&!zoomBook.installed?onePageBook.events.gestureStart(a):zoomBook.installed&&zoomBook.events.gestureStart(a);delete b},c=function(a){a.target=a.target?a.target:a.srcElement;a.preventDefault?a.preventDefault():a.returnValue=!1;twoPageBook.installed&&!zoomBook.installed?twoPageBook.events.gestureChange(a):onePageBook.installed&&!zoomBook.installed?onePageBook.events.gestureChange(a):
zoomBook.installed&&zoomBook.events.gestureChange(a);delete c},d=function(a){a.target=a.target?a.target:a.srcElement;a.preventDefault?a.preventDefault():a.returnValue=!1;twoPageBook.installed&&!zoomBook.installed?twoPageBook.events.gestureEnd(a):onePageBook.installed&&!zoomBook.installed?onePageBook.events.gestureEnd(a):zoomBook.installed&&zoomBook.events.gestureEnd(a);window.setTimeout(function(){eventManager.gesture=!1},100);delete d};a.addEventListener("gesturestart",b,!1);a.addEventListener("gesturechange",
c,!1);a.addEventListener("gestureend",d,!1);var e=function(a){if(!eventManager.gesture)a.target=a.target?a.target:a.srcElement,"input"==pager.state&&pager.cancelInput(),eventManager.touchStartCoordinate.x=a.targetTouches[0].pageX,eventManager.touchStartCoordinate.y=a.targetTouches[0].pageY,twoPageBook.installed&&!zoomBook.installed?twoPageBook.events.touchStart(a):onePageBook.installed&&!zoomBook.installed?onePageBook.events.touchStart(a):zoomBook.installed&&zoomBook.events.touchStart(a),a.preventDefault?
a.preventDefault():a.returnValue=!1;delete e},f=function(a){if(!eventManager.gesture)a.target=a.target?a.target:a.srcElement,twoPageBook.installed&&!zoomBook.installed?twoPageBook.events.touchMove(a):onePageBook.installed&&!zoomBook.installed?onePageBook.events.touchMove(a):zoomBook.installed&&zoomBook.events.touchMove(a),a.preventDefault?a.preventDefault():a.returnValue=!1;delete f},h=function(a){if(!eventManager.gesture)a.target=a.target?a.target:a.srcElement,twoPageBook.installed&&!zoomBook.installed?
twoPageBook.events.touchEnd(a):onePageBook.installed&&!zoomBook.installed?onePageBook.events.touchEnd(a):zoomBook.installed&&zoomBook.events.touchEnd(a),a.preventDefault?a.preventDefault():a.returnValue=!1;delete h};a.addEventListener("touchstart",e,!1);a.addEventListener("touchmove",f,!1);a.addEventListener("touchend",h,!1);a=null},loadClickEvents:function(a){var b=function(a){a.target=a.target?a.target:a.srcElement;a.preventDefault?a.preventDefault():a.returnValue=!1;eventManager.click=!0;"input"==
pager.state&&pager.cancelInput();eventManager.clickStartCoordinate.x=a.pageX;eventManager.clickStartCoordinate.y=a.pageY;twoPageBook.installed&&!zoomBook.installed?twoPageBook.events.mousedown(a):onePageBook.installed&&!zoomBook.installed?onePageBook.events.mousedown(a):zoomBook.installed&&zoomBook.events.mousedown(a);delete b},c=function(a){a.target=a.target?a.target:a.srcElement;a.preventDefault?a.preventDefault():a.returnValue=!1;eventManager.click=!1;twoPageBook.installed&&!zoomBook.installed?
twoPageBook.events.mouseup(a):onePageBook.installed&&!zoomBook.installed?onePageBook.events.mouseup(a):zoomBook.installed&&zoomBook.events.mouseup(a);delete c},d=function(a){a.target=a.target?a.target:a.srcElement;a.preventDefault?a.preventDefault():a.returnValue=!1;eventManager.click&&(twoPageBook.installed&&!zoomBook.installed?twoPageBook.events.mousemove(a):onePageBook.installed&&!zoomBook.installed?onePageBook.events.mousemove(a):zoomBook.installed&&zoomBook.events.mousemove(a));delete d};a.addEventListener("mousedown",
b,!1);a.addEventListener("mousemove",d,!1);a.addEventListener("mouseup",c,!1);a=null},linkClick:function(a,b,c,d){if(eventManager.touchInterface)var e=a.changedTouches[0].pageX-a.target.getBoundingClientRect().left,f=a.changedTouches[0].pageY-a.target.getBoundingClientRect().top;else e=a.clientX-a.target.getBoundingClientRect().left,f=a.clientY-a.target.getBoundingClientRect().top;for(linkI in bookData.page[b].links){var h=bookData.page[b].links[linkI];if(e>=h.x*c&&e<=h.x*c+h.width*c&&f>=1*(h.y*d).toFixed(0)&&
f<=1*(1*(h.y*d).toFixed(0)+h.height*d).toFixed(0)){a.preventDefault?a.preventDefault():a.returnValue=!1;a.stopPropagation?a.stopPropagation():a.cancelBubble=!0;var g=h.x*c,j=h.y*d;if(eventManager.touchInterface){var k=a.target.getContext("2d"),m=k.getImageData(g,j,h.width*c+10,h.height*d+10);k.fillStyle="rgba(0,0,0,0.4)";k.fillRect(h.x*c,h.y*d,h.width*c,h.height*d);(function(b){a.target.addEventListener("touchend",function(){k.putImageData(m,g,j);b.page&&pageMediator.goToPage(b.page);if(b.urls)for(var a=
0;a<b.urls.length;a++)window.open(b.urls[a])})})(h)}else if(h.page&&pageMediator.goToPage(h.page),h.urls)for(var l=0;l<h.urls.length;l++)window.open(h.urls[l])}}}};function HighlightItem(a,b,c,d){this.word=a[0];this.top=a[1]/10;this.left=a[2]/10;this.angle=a[3]/1E3;this.height=a[4]/10;this.startPos=0===c?c:c-1;this.stopPos=c+d-1;this.chars=b}
var highlight={load:function(a,b,c){this.query=strUtils.split(c||"",3);this.Xratio=b.width/bookData.size.width;this.Yratio=b.height/bookData.size.height;b=new XMLHttpRequest;b.open("GET","../assets/search/search"+strUtils.getNum(a)+".xml");b.onload=function(){var a=this.responseText.split("\n");for(word in a){word=a[word];for(var b=0,c=0;c<=highlight.query.length-1;c++){var h=highlight.query[c];if(-1!=(b=word.toLowerCase().indexOf(h))){var g=word.split(String.fromCharCode(2)),j=g[5].split(String.fromCharCode(3)),
b=new HighlightItem(g,j,b,h.length);console.log(b);highlight.light(b)}}}};b.onerror=function(){console.log(this)};b.send();delete b},light:function(a){var b=el.id("canvas1").getContext("2d");b.fillStyle="rgba(0,0,0,0.3)";var c=a.chars[a.startPos]/10*this.Xratio;b.fillRect(a.top*this.Xratio+c,a.left*this.Yratio,a.chars[a.stopPos]/10*this.Xratio-c,a.height*this.Yratio)}},html5lib={init:function(){switch(system.browser.name){case "safari":this.browserPrefix="webkit";break;case "firefox":this.browserPrefix=
"Moz";break;case "opera":this.browserPrefix="O";break;case "ie":this.browserPrefix="ms";break;case "chrome":this.browserPrefix="webkit";break;case "unknown":this.browserPrefix="webkit"}},transform:function(a,b){var c="";b.translate&&(c=Modernizr.csstransforms3d?c+(" translate3d("+b.translate.x+"px,"+b.translate.y+"px,"+b.translate.z+"px)"):c+(" translate("+b.translate.x+"px,"+b.translate.y+"px)"));b.scale&&(c=Modernizr.csstransforms3d?c+(" scale3d("+b.scale.x+","+b.scale.y+","+b.scale.z+")"):c+(" scale("+
b.scale.x+","+b.scale.y+")"));a.style[this.browserPrefix+"Transform"]=c},translate:function(a,b,c,d){b=b||0;c=c||0;a.style[this.browserPrefix+"Transform"]=Modernizr.csstransforms3d?"translate3d("+b+"px,"+c+"px,"+(d||0)+"px)":"translate("+b+"px,"+c+"px)"},duration:function(a,b){a.style[this.browserPrefix+"TransitionDuration"]=b+"ms"},perspective:function(a,b){a.style[this.browserPrefix+"Transform"]="perspective("+b+")"},scale:function(a,b,c,d){b=b||0;c=c||0;a.style[this.browserPrefix+"Transform"]=
Modernizr.csstransforms3d?"scale3d("+b+","+c+","+(d||0)+")":"scale("+b+","+c+")"},rotate:function(a,b,c){c=c||0;a.style[this.browserPrefix+"Transform"]=Modernizr.csstransforms3d?"rotate3d("+c+","+c+","+c+","+b+"deg)":"rotate("+b+"deg)"},backfaceVisibility:function(a,b){a.style[this.browserPrefix+"BackfaceVisibility"]=b},boxShadow:function(a,b){a.style[this.browserPrefix+"BoxShadow"]=b},getTransform:function(a){return a.style[this.browserPrefix+"Transform"]}},images={image:new Image,imageStack:[],
processing:!1,getImagePath:function(a,b,c,d,e){b=b||"jpg";d=d||!1;e=e||0;bookData.rightToLeftMode&&(1==e?e=2:2==e&&(e=1));var f="000"+a;9<a&&(f="00"+a);99<a&&(f="0"+a);999<a&&(f=""+a);PUBL&&(PATH_TO_PROPERTIES=photographer_img);if("zoom"===(c||"")||system.device.pc||system.device.other)return d?PATH_TO_PROPERTIES+"page"+f+"_i2_"+e+"."+b+"?id="+1E5*Math.random().toFixed(5)+PS+"&":PATH_TO_PROPERTIES+"page"+f+"_i2."+b+"?id="+1E5*Math.random().toFixed(5)+PS+"&";if(system.device.iphone||system.device.android||
system.device.ipad)return d?PATH_TO_PROPERTIES+"page"+f+"_i1_"+e+"."+b+"?id="+1E5*Math.random().toFixed(5)+PS+"&":PATH_TO_PROPERTIES+"page"+f+"_i1."+b+"?id="+1E5*Math.random().toFixed(5)+PS+"&"},init:function(){this.image.onload=this.loadImage},loadImage:function(){var a=this.id;if(el.id("canvas"+a)){preloader.deletePreloader(1*a);var b=el.id("canvas"+a),b=b.getContext("2d");if(twoPageBook.installed&&!zoomBook.installed)var c=twoPageBook.bookWidth/2,d=twoPageBook.bookHeight;else if(onePageBook.installed&&
!zoomBook.installed)c=onePageBook.bookWidth,d=onePageBook.bookHeight;else if(zoomBook.installed)c=zoomBook.pageWidth,d=zoomBook.pageHeight;b.fillStyle=bookData.page[a].BGColor;b.fillRect(0,0,c,d);if(bookData.page[a].proportions>=bookData.size.proportions){var e=c,f=(e/bookData.page[a].proportions).toFixed(0);b.drawImage(images.image,0,(d-f)/2,e,f)}else f=d,e=(f*bookData.page[a].proportions).toFixed(0),d=(c-e)/2,bookData.page[a].wide&&0==a%2&&!bookData.rightToLeftMode?d=c-e:bookData.page[a].wide&&
!bookData.rightToLeftMode?d=0:bookData.page[a].wide&&0==a%2&&bookData.rightToLeftMode?d=0:bookData.page[a].wide&&bookData.rightToLeftMode&&(d=c-e),b.drawImage(images.image,d,0,e,f);bookData.page[a].mark&&bm.rasterize.draw(b,a);1!=a&&a!=bookData.pageCount&&twoPageBook.installed&&!zoomBook.installed?images.drawShadow(b,a):a==bookData.pageCount&&0!=a%2&&!zoomBook.installed&&images.drawShadow(b,a);if(onePageBook.installed&&zoomBook.installed&&onePageBook.currentPage==a)onePageBook.installed=!1,window.setTimeout(function(){preloader.delSimplePreloader();
el.del("tmpDiv");zoomLock.unLock()},300);if(twoPageBook.installed&&zoomBook.installed&&zoomBook.currentPage==a)twoPageBook.installed=!1,window.setTimeout(function(){preloader.delSimplePreloader();el.del("tmpDiv");zoomLock.unLock()},300);if(zoomBook.innerZoomState&&zoomBook.currentPage==a)zoomBook.innerZoomState=!1,window.setTimeout(function(){preloader.delSimplePreloader();el.del("exZoomBook");zoomLock.unLock()},300);b=d=f=e=d=c=null}0<images.imageStack.length?images.shiftImage():images.processing=
!1},drawShadow:function(a,b){if(0==b%2&&!bookData.rightToLeftMode||0!=b%2&&bookData.rightToLeftMode){var c=a.createLinearGradient(twoPageBook.bookWidth/2-twoPageBook.bookWidth/10,0,twoPageBook.bookWidth/2,0);c.addColorStop(0,"rgba(0,0,0,0.0)");c.addColorStop(0.4,"rgba(0,0,0,0.05)");c.addColorStop(0.8,"rgba(0,0,0,0.20)");c.addColorStop(1,"rgba(0,0,0,0.15)")}else c=a.createLinearGradient(twoPageBook.bookWidth/20,0,0,0),c.addColorStop(0,"rgba(0,0,0,0)"),c.addColorStop(0.6,"rgba(0,0,0,0.1)"),c.addColorStop(0.95,
"rgba(0,0,0,0.2)"),c.addColorStop(1,"rgba(0,0,0,0.65)");a.fillStyle=c;0==b%2&&!bookData.rightToLeftMode||0!=b%2&&bookData.rightToLeftMode?(a.fillRect(twoPageBook.bookWidth/2-twoPageBook.bookWidth/4,0,twoPageBook.bookWidth/4,twoPageBook.bookHeight),a.beginPath(),a.moveTo(twoPageBook.bookWidth/2,0),a.lineTo(twoPageBook.bookWidth/2,twoPageBook.bookHeight),a.strokeStyle="rgba(0,0,0,0.1)",a.stroke()):a.fillRect(0,0,twoPageBook.bookWidth/10,twoPageBook.bookHeight)},shiftImage:function(){if(0<this.imageStack.length){this.processing=
!0;var a=this.imageStack.shift();this.image.id=a;this.image.src=zoomBook.installed?bookData.page[a].srcZoom+1E5*Math.random().toFixed(5):bookData.page[a].src+1E5*Math.random().toFixed(5)}},push:function(a){this.imageStack.push(a);this.processing||this.shiftImage()},deleteImageFromStack:function(a){a=images.imageStack.indexOf(a);-1!=a&&images.imageStack.splice(a,1)}},links={currStorage:"",currCanvas:"",currX:0,currY:0,currGoPage:0,isLinkBool:!1,currURLs:0,drawRect:function(a){links.clearRect();if(onePageBook.installed)var b=
onePageBook.currentPage;else if(twoPageBook.installed)if(a.target.id=="canvas"+twoPageBook.currentPage.left)b=twoPageBook.currentPage.left;else{if(a.target.id=="canvas"+twoPageBook.currentPage.right)b=twoPageBook.currentPage.right}else if(zoomBook.installed)b=zoomBook.currentPage;var c=a.target.width/bookData.size.width,d=a.target.height/bookData.size.height;if(eventManager.touchInterface)var e=eventManager.touchStartCoordinate.x-a.target.getBoundingClientRect().left,f=eventManager.touchStartCoordinate.y-
a.target.getBoundingClientRect().top;else e=a.clientX-a.target.getBoundingClientRect().left,f=a.clientY-a.target.getBoundingClientRect().top;if(bookData.page[b])for(linkI in bookData.page[b].links){var h=bookData.page[b].links[linkI];links.isLinkBool=!1;if(e>=h.x*c&&e<=h.x*c+h.width*c&&f>=1*(h.y*d).toFixed(0)&&f<=1*(1*(h.y*d).toFixed(0)+h.height*d).toFixed(0)){links.currX=h.x*c;links.currY=h.y*d;b=a.target.getContext("2d");links.currCanvas=a.target.id;links.currStorage=b.getImageData(links.currX,
links.currY,h.width*c+10,h.height*d+10);b.fillStyle="rgba(0,0,0,0.3)";b.fillRect(h.x*c,h.y*d,h.width*c,h.height*d);links.currGoPage=h.page?h.page:0;links.currURLs=h.urls?h.urls:0;links.isLinkBool=!0;break}}},clearRect:function(){if(el.id(links.currCanvas))el.id(links.currCanvas).getContext("2d").putImageData(links.currStorage,links.currX,links.currY),links.isLinkBool=!1}},main=function(){function a(a){system.init();"one"===bookChoice.getType()?onePageBook.draw(a):twoPageBook.draw(a);if(system.device.publisher.isOn)el.id("scaler").style.position=
"absolute",el.id("scaler").style.overflow="hidden",el.id("scaler").style.width=window.innerWidth+"px",el.id("scaler").style.height=window.innerHeight+"px",el.id("body").style.webkitTransform="  scale("+1/system.browser.scale+") translate("+system.device.width()*(1-system.browser.scale)/2+"px,"+system.device.height()*(1-system.browser.scale)/2+"px)"}window.GAEnable||(GAEnable=!1);var b=function(){system.init();preloader.init();eventManager.start();bookData.load(this.responseXML);images.init();workspace.draw();
ctrlEngine.init();pager.draw();orientationObserver.start();html5lib.init();var c=bookData.lastLocation.load();if(window.location.hash){var e=window.location.hash.substring(1,window.location.hash.length),e=parseInt(e);if(-10===e&&c&&bookData.sessionRestore)e=c;else if(0>=e)e=1;else if(e>bookData.pageCount)e=bookData.pageCount;a(1*e)}else c&&bookData.sessionRestore?a(c):a(1);c=el.id("mainFrame");if(void 0===bookData.background.src)c.style.backgroundColor=bookData.background.color;else if("image/grey-inner.jpg"!=
bookData.background.src&&"image/grey-outer.jpg"!=bookData.background.src&&"image/dark-wood-inner.jpg"!=bookData.background.src&&"image/dark-wood-outer.jpg"!=bookData.background.src&&"image/sky-blue-inner.jpg"!=bookData.background.src&&"image/sky-blue-outer.jpg"!=bookData.background.src)c.style.backgroundImage="url(../"+assetsFolder+"/"+bookData.background.src+")";else{if("DarkWood"==bookData.skin)c.style.backgroundImage="url("+STYLES_SRC+"dark-wood-inner.jpg)",c.style.backgroundRepeat="no-repeat",
c.style.backgroundPosition="center",c.style.backgroundSize="cover";if("ClassicGrey"==bookData.skin)c.style.background="-webkit-linear-gradient(top, #d0d9e2, #63696e)";if("DarkSkyBlue"==bookData.skin)c.style.background="-webkit-linear-gradient(top, #d2deec, #839cb2)"}"single"==bookData.background.scale?(c.style.backgroundRepeat="no-repeat",c.style.backgroundPosition="center",c.style.backgroundSize="auto"):"fill"==bookData.background.scale?(c.style.backgroundRepeat="no-repeat",c.style.backgroundPosition=
"center",c.style.backgroundSize="cover"):"fit"==bookData.background.scale?(c.style.backgroundRepeat="no-repeat",c.style.backgroundPosition="center",c.style.backgroundSize="contain"):"scale"==bookData.background.scale?(c.style.backgroundRepeat="no-repeat",c.style.backgroundPosition="center",c.style.backgroundSize="100% 100%"):c.style.backgroundRepeat="repeat";delete b};if(PUBL){var c=new XMLHttpRequest;c.open("GET",xml_dir+"properties.xml?1"+PS);c.onload=function(){var a=new XMLHttpRequest;a.open("GET",
this.responseText);a.onload=b;a.onerror=function(){console.log("Error: can`t load xml")};a.send();delete a};c.onerror=function(){console.log(this)}}else c=new XMLHttpRequest,c.open("GET",PATH_TO_PROPERTIES+"properties.xml"),c.onload=b,c.onerror=function(){document.write("Error: can`t load xml3")};c.send();delete c;delete main};
null==dir?(PATH_TO_PROPERTIES=photographer_dir,STYLES_SRC=photographer_src,PUBL=!0,ALBM=!1,PUBLDOMAIN=document.referrer,main()):("./<%=FilesFolderName%>/"==dir&&(dir="files"),PATH_TO_PROPERTIES="../"+assetsFolder+"/mobile/",ALBM=PUBL=!1,PS="",document.addEventListener("DOMContentLoaded",main,!1));
var el={id:function(a){return document.getElementById(a)},tag:function(a){return document.getElementsByTagName(a)[0]},tags:function(a){return document.getElementsByTagName(a)},add:function(a){return document.createElement(a)},del:function(a){el.id(a).parentNode.removeChild(el.id(a))},Class:function(){return document.getElementsByClassName(tag)}};
window.Modernizr=function(a,b,c){function d(a,b){for(var d in a)if(j[a[d]]!==c)return"pfx"==b?a[d]:!0;return!1}function e(a,b,e){var f=a.charAt(0).toUpperCase()+a.substr(1),g=(a+" "+l.join(f+" ")+f).split(" ");if("string"===typeof b||"undefined"===typeof b)b=d(g,b);else{g=(a+" "+q.join(f+" ")+f).split(" ");a:{var a=g,h;for(h in a)if(f=b[a[h]],f!==c){b=!1===e?a[h]:"function"===typeof f?f.bind(e||b):f;break a}b=!1}}return b}var f={},h=b.documentElement,g=b.createElement("modernizr"),j=g.style,k={}.toString,
m=" -webkit- -moz- -o- -ms- ".split(" "),l="Webkit Moz O ms".split(" "),q="webkit moz o ms".split(" "),g={},o=[],n=o.slice,p,u=function(a,c,d,e){var f,g,j,k=b.createElement("div"),l=b.body,m=l?l:b.createElement("body");if(parseInt(d,10))for(;d--;)j=b.createElement("div"),j.id=e?e[d]:"modernizr"+(d+1),k.appendChild(j);return f=["&#173;<style>",a,"</style>"].join(""),k.id="modernizr",(l?k:m).innerHTML+=f,m.appendChild(k),l||(m.style.background="",h.appendChild(m)),g=c(k,a),l?k.parentNode.removeChild(k):
m.parentNode.removeChild(m),!!g},r={}.hasOwnProperty,s;"undefined"!==typeof r&&"undefined"!==typeof r.call?s=function(a,b){return r.call(a,b)}:s=function(a,b){return b in a&&"undefined"===typeof a.constructor.prototype[b]};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this;if("function"!=typeof b)throw new TypeError;var c=n.call(arguments,1),d=function(){if(this instanceof d){var e=function(){};e.prototype=b.prototype;var e=new e,f=b.apply(e,c.concat(n.call(arguments)));return Object(f)===
f?f:e}return b.apply(a,c.concat(n.call(arguments)))};return d});(function(a,b){var c=a.join(""),d=b.length;u(c,function(a){for(var a=a.childNodes,b={};d--;)b[a[d].id]=a[d];f.csstransforms3d=9===(b.csstransforms3d&&b.csstransforms3d.offsetLeft)&&3===b.csstransforms3d.offsetHeight},d,b)})([,["@media (",m.join("transform-3d),("),"modernizr){#csstransforms3d{left:9px;position:absolute;height:3px;}}"].join("")],[,"csstransforms3d"]);g.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&
!!a.getContext("2d")};g.postmessage=function(){return!!a.postMessage};g.websockets=function(){for(var b=-1,c=l.length;++b<c;)if(a[l[b]+"WebSocket"])return!0;return"WebSocket"in a};g.boxshadow=function(){return e("boxShadow")};g.textshadow=function(){return""===b.createElement("div").style.textShadow};g.opacity=function(){var a=m.join("opacity:.55;")+"";j.cssText=a;return/^0.55$/.test(j.opacity)};g.cssanimations=function(){return e("animationName")};g.csstransforms=function(){return!!e("transform")};
g.csstransforms3d=function(){var a=!!e("perspective");return a&&"webkitPerspective"in h.style&&(a=f.csstransforms3d),a};g.csstransitions=function(){return e("transition")};g.localstorage=function(){try{return localStorage.setItem("modernizr","modernizr"),localStorage.removeItem("modernizr"),!0}catch(a){return!1}};g.webworkers=function(){return!!a.Worker};g.svg=function(){return!!b.createElementNS&&!!b.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect};g.inlinesvg=function(){var a=
b.createElement("div");return a.innerHTML="<svg/>","http://www.w3.org/2000/svg"==(a.firstChild&&a.firstChild.namespaceURI)};g.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(k.call(b.createElementNS("http://www.w3.org/2000/svg","clipPath")))};for(var t in g)s(g,t)&&(p=t.toLowerCase(),f[p]=g[t](),o.push((f[p]?"":"no-")+p));j.cssText="";return g=null,f._version="2.5.3",f._prefixes=m,f._domPrefixes=q,f._cssomPrefixes=l,f.testProp=function(a){return d([a])},f.testAllProps=e,f.testStyles=
u,f}(this,this.document);
var onePageBook={currentPage:0,installed:!1,nextPageBuffer:2,prevPageBuffer:2,flipSpeed:600,triggerStopTime:700,bookWidth:0,bookHeight:0,bookTop:0,bookLeft:0,padding:10,draw:function(a){preloader.stopAll();bookData.size.proportions<system.device.proportions()?(onePageBook.bookHeight=(system.device.height()-onePageBook.padding).toFixed(0),onePageBook.bookWidth=(onePageBook.bookHeight*bookData.size.proportions).toFixed(0)):(onePageBook.bookWidth=(system.device.width()-onePageBook.padding).toFixed(0),onePageBook.bookHeight=
(onePageBook.bookWidth/bookData.size.proportions).toFixed(0));onePageBook.bookTop=((system.device.height()-onePageBook.bookHeight)/2).toFixed(0);onePageBook.bookLeft=((system.device.width()-onePageBook.bookWidth)/2).toFixed(0);if(el.id("bookPortrait"))el.id("bookPortrait");else{var b=el.add("div");b.id="bookPortrait";html5lib.perspective(b,3E3);b.style.position="absolute";b.style.width=onePageBook.bookWidth+"px";b.style.height=onePageBook.bookHeight+"px";b.style.top=onePageBook.bookTop+"px";b.style.left=
onePageBook.bookLeft+"px";b.style.webkitBackfaceVisibility="hidden";b.style.zIndex="2";html5lib.backfaceVisibility(b,"hidden");html5lib.boxShadow(b,"0px 0px 3px #000");el.id("mainFrame").appendChild(b)}onePageBook.installed=!0;onePageBook.currentPage=a;pager.change();onePageBook.drawPage(this.currentPage);for(b=a-onePageBook.prevPageBuffer;b<=1*a+onePageBook.nextPageBuffer;b++)b!==this.currentPage&&onePageBook.drawPage(b)},drawPage:function(a){if(0<a&&a<=bookData.pageCount&&!el.id("canvas"+a)){var b=
el.add("canvas");b.id="canvas"+a;b.className="canvasBook";b.width=onePageBook.bookWidth;b.height=onePageBook.bookHeight;b.style.position="absolute";b.style.left=bookData.rightToLeftMode?a<onePageBook.currentPage?system.device.width()+"px":"":a<onePageBook.currentPage?-system.device.width()+"px":"";b.style.zIndex=bookData.pageCount-a+"";var c=b.getContext("2d");c.fillStyle="rgb(255,255,255)";c.fillRect(0,0,onePageBook.bookWidth,onePageBook.bookHeight);el.id("bookPortrait").appendChild(b);bookData.page[a].stub?
(b=el.id("canvas"+a),c=b.getContext("2d"),c.fillStyle=bookData.page[a].BGColor,c.fillRect(0,0,b.width,b.height)):(images.push(a),preloader.add(a))}},destroyPage:function(a){el.id("canvas"+a)&&el.del("canvas"+a);preloader.deletePreloader(a)},next:function(){if(zoomLock.check()&&onePageBook.installed&&onePageBook.currentPage<bookData.pageCount&&timer.check("fx")){onePageBook.slideFxPage(onePageBook.currentPage);if(5==el.id("bookPortrait").childNodes.length){var a=onePageBook.currentPage-onePageBook.prevPageBuffer;
images.deleteImageFromStack(a);onePageBook.destroyPage(a);delete bm.rasterize.imgData[a];preloader.deletePreloader(a);(system.device.iphone||system.device.ipod)&&window.scrollTo(0,1)}onePageBook.currentPage++;onePageBook.drawPage(1*onePageBook.currentPage+1*onePageBook.nextPageBuffer);pager.change();timer.setBlockTime(twoPageBook.flipSpeed/2,twoPageBook.flipSpeed)}},prev:function(){if(zoomLock.check()&&onePageBook.installed&&1<onePageBook.currentPage&&timer.check("fx")){onePageBook.slideFxPage(onePageBook.currentPage-
1);if(5==el.id("bookPortrait").childNodes.length){var a=1*onePageBook.currentPage+1*onePageBook.nextPageBuffer;images.deleteImageFromStack(a);onePageBook.destroyPage(a);delete bm.rasterize.imgData[a];(system.device.iphone||system.device.ipod)&&window.scrollTo(0,1)}onePageBook.currentPage--;onePageBook.drawPage(onePageBook.currentPage-onePageBook.prevPageBuffer);pager.change();timer.setBlockTime(twoPageBook.flipSpeed/2,twoPageBook.flipSpeed)}},slideFxPage:function(a){if(a<onePageBook.currentPage)var b=
bookData.rightToLeftMode?1*-onePageBook.bookWidth-2*onePageBook.bookLeft:2*onePageBook.bookLeft+1*onePageBook.bookWidth;else a==onePageBook.currentPage&&(b=bookData.rightToLeftMode?1*onePageBook.bookWidth+2*onePageBook.bookLeft:0-(2*onePageBook.bookLeft+1*onePageBook.bookWidth));a=el.id("canvas"+a);html5lib.duration(a,onePageBook.flipSpeed);""===html5lib.getTransform(a)||"translateX(0px)"===html5lib.getTransform(a)||"translate3d(0px, 0px, 0px)"===html5lib.getTransform(a)?html5lib.translate(a,b,0,
0):html5lib.translate(a,0,0,0)},goToPage:function(a){if(0>a)a=1;else if(a>bookData.pageCount)a=bookData.pageCount;if(a==onePageBook.currentPage)pageMediator.change();else if(a==1*onePageBook.currentPage+1)onePageBook.next();else if(a==1*onePageBook.currentPage-1)onePageBook.prev();else if(0<a&&a<=bookData.pageCount&&zoomLock.check()&&timer.check("fx")){if(1*a>1*onePageBook.currentPage)var b=1*onePageBook.currentPage+1,c=onePageBook.currentPage;else c=b=onePageBook.currentPage-1;bm.rasterize.imgData=
{};var d=el.id("canvas"+b).getContext("2d");d.fillStyle="rgb(255,255,255)";d.fillRect(0,0,onePageBook.bookWidth,onePageBook.bookHeight);preloader.add(b);preloader.setSpecial(b);this.slideFxPage(c);this.currentPage=a;pager.change();var e=function(){onePageBook.destroy();onePageBook.draw(a);(system.device.iphone||system.device.ipod)&&window.scrollTo(0,1);delete e},d=null;window.setTimeout(e,onePageBook.flipSpeed);b=c=null}},destroyOtherPages:function(){for(var a=1*onePageBook.currentPage+1*onePageBook.nextPageBuffer,
b=onePageBook.currentPage-onePageBook.prevPageBuffer;b<=a;b++)b!=onePageBook.currentPage&&0<b&&b<=bookData.pageCount&&el.del("canvas"+b)},goToZoom:function(){if(zoomLock.check()){this.destroyOtherPages();var a=screen.height/onePageBook.bookWidth;system.platform.ios&&2===window.devicePixelRatio&&(a=Math.sqrt(52E5/(this.bookWidth*this.bookHeight)));if(system.device.ipad&&1===window.devicePixelRatio||system.device.other)a*=1.4;system.device.iphone&&2===window.devicePixelRatio&&(a/=1.4);var b=el.id("canvas"+
onePageBook.currentPage);if(b.style.left||"0px"==b.style.left)html5lib.duration(b,0),html5lib.translate(b,0,0,0),b.style.left="0px";window.setTimeout(function(){html5lib.duration(b,zoomBook.zoomIOSpeed);html5lib.scale(b,a,a,1)},1);var c=function(){el.id("canvas"+onePageBook.currentPage).id="zoomedPage";zoomBook.draw(onePageBook.currentPage,a);delete c};if(GAEnable){var d=window.location.pathname.split("/");_trackEvent(d[d.length-4]+"","Zooming","page"+onePageBook.currentPage)}window.setTimeout(c,
zoomBook.zoomIOSpeed+10)}},gestureZoom:function(a){if(zoomLock.check()){var b=el.id("canvas"+onePageBook.currentPage);html5lib.duration(b,0);if(b.style.left||"0px"==b.style.left)html5lib.translate(b,0,0,0),b.style.left="0px";1<a.scale&&html5lib.scale(b,1+(a.scale-1)/3,1+(a.scale-1)/3,1+(a.scale-1)/3)}},gestureStop:function(a){if(zoomLock.check()){var b=el.id("canvas"+onePageBook.currentPage),a=1+(a.scale-1)/3,c=Math.sqrt(52E5/(this.bookWidth*this.bookHeight));if(a>c){if(b.style.left||"0px"==b.style.left)html5lib.duration(b,
0),html5lib.translate(b,0,0,0),b.style.left="0px";html5lib.duration(b,300);html5lib.scale(b,c,c,c);b.id="zoomedPage";zoomBook.draw(onePageBook.currentPage,c)}else 1.2>a?(b.style.webkitTransitionDuration="200ms",b.style.webkitTransform=""):(b.id="zoomedPage",zoomBook.draw(onePageBook.currentPage,a));zoomFacrot=null}},destroy:function(){preloader.stopAll();el.del("bookPortrait");onePageBook.installed=!1}};
onePageBook.events={tapCount:0,clickCount:0,doubleTapTime:250,doubleClickTime:250,leftAndRightArea:0.15,gestureX:0,gestureY:0,touchCancel:!1,gestureTarget:0,touchStart:function(a){"CANVAS"==a.target.tagName&&links.drawRect(a)},touchMove:function(a){if(links.isLinkBool){var b=a.targetTouches[0].pageY-eventManager.touchStartCoordinate.y;(10<Math.abs(a.targetTouches[0].pageX-eventManager.touchStartCoordinate.x)||10<Math.abs(b))&&links.clearRect()}delete a},touchEnd:function(a){!zoomBook.installed&&!eventManager.gesture&&
(-50>eventManager.touchStartCoordinate.x-a.changedTouches[0].pageX?onePageBook.events.flipRight():50<eventManager.touchStartCoordinate.x-a.changedTouches[0].pageX?onePageBook.events.flipLeft():onePageBook.events.touchManger(a))},touchCancel:function(){links.isLinkBool&&links.clearRect()},gestureStart:function(a){if(!slideShow.active)this.gestureTarget=a.target},gestureChange:function(a){slideShow.active||onePageBook.gestureZoom(a)},gestureEnd:function(a){slideShow.active||onePageBook.gestureStop(a)},
touchManger:function(a){if(links.isLinkBool&&links.currURLs){if(links.clearRect(),links.currURLs)for(var b=0;b<links.currURLs.length;b++)window.open(links.currURLs[b])}else if(onePageBook.events.tapCount++,1==onePageBook.events.tapCount){var c=function(){if(1==onePageBook.events.tapCount)onePageBook.events.singleTap(a),onePageBook.events.tapCount=0;delete c};window.setTimeout(c,onePageBook.events.doubleTapTime)}else onePageBook.events.doubleTap(a),onePageBook.events.tapCount=0},mousedown:function(a){"CANVAS"==
a.target.tagName&&links.drawRect(a)},mouseup:function(a){if(!zoomBook.installed){var b=a.pageX;-50>eventManager.clickStartCoordinate.x-b?onePageBook.events.flipRight():50<eventManager.clickStartCoordinate.x-b?onePageBook.events.flipLeft():onePageBook.events.clickManger(a)}},mousemove:function(a){if(links.isLinkBool){var b=a.pageY-eventManager.clickStartCoordinate.y;(10<Math.abs(a.pageX-eventManager.clickStartCoordinate.x)||10<Math.abs(b))&&links.clearRect()}delete a},clickManger:function(a){if(links.isLinkBool&&
links.currURLs){if(links.clearRect(),links.currURLs)for(var b=0;b<links.currURLs.length;b++)window.open(links.currURLs[b])}else if(onePageBook.events.clickCount++,1==onePageBook.events.clickCount){var c=function(){if(1==onePageBook.events.clickCount)onePageBook.events.singleClick(a),onePageBook.events.clickCount=0;delete c};window.setTimeout(c,onePageBook.events.doubleClickTime)}else onePageBook.events.doubleClick(a),onePageBook.events.clickCount=0},singleTap:function(a){links.isLinkBool?(links.clearRect(),
links.currGoPage&&onePageBook.goToPage(links.currGoPage)):a.changedTouches[0].pageX<system.device.width()*onePageBook.events.leftAndRightArea/system.browser.scale?onePageBook.events.flipRight():a.changedTouches[0].pageX>system.device.width()*(1-onePageBook.events.leftAndRightArea)/system.browser.scale?onePageBook.events.flipLeft():toolbar.toogle();delete a},doubleTap:function(){slideShow.active||(links.isLinkBool&&links.clearRect(),onePageBook.goToZoom())},singleClick:function(a){if(links.isLinkBool){if(links.clearRect(),
links.currGoPage&&onePageBook.goToPage(links.currGoPage),links.currURLs)for(a=0;a<links.currURLs.length;a++)window.open(links.currURLs[a])}else a.x<system.device.width()*onePageBook.events.leftAndRightArea/system.browser.scale?onePageBook.events.flipRight():a.x>system.device.width()*(1-onePageBook.events.leftAndRightArea)/system.browser.scale?onePageBook.events.flipLeft():toolbar.toogle(),delete a},doubleClick:function(){slideShow.active||(links.isLinkBool&&links.clearRect(),onePageBook.goToZoom())},
flipLeft:function(){bookData.rightToLeftMode?onePageBook.prev():onePageBook.next()},flipRight:function(){bookData.rightToLeftMode?onePageBook.next():onePageBook.prev()}};
var orientationObserver={start:function(){if(system.device.publisher.isOn)return system.device.publisher.orientation;if(system.platform.android){PUBL||window.addEventListener("resize",workspace.reDraw,!1);var a=function(){onePageBook.installed&&(onePageBook.destroy(),onePageBook.draw(onePageBook.currentPage));delete a};PUBL||window.addEventListener("resize",a,!1)}else PUBL||window.addEventListener("orientationchange",workspace.reDraw,!1),a=function(){if(system.device.ipad&&!bookData.singlePageMode)if("portrait"==
orientationObserver.getOrientation()){if(twoPageBook.installed){var b=pageMediator.getPage();twoPageBook.destroy();onePageBook.draw(b)}}else"landscape"==orientationObserver.getOrientation()&&onePageBook.installed&&(onePageBook.destroy(),twoPageBook.draw(onePageBook.currentPage));else onePageBook.installed&&(onePageBook.destroy(),onePageBook.draw(onePageBook.currentPage));delete a},PUBL||window.addEventListener("orientationchange",a,!1)},stop:function(){system.platform.android?window.removeEventListener("resize",
workspace.reDraw,!1):window.removeEventListener("orientationchange",workspace.reDraw,!1)},getOrientation:function(){if(system.device.publisher.isOn)return system.device.publisher.orientation;if(system.platform.android||PUBL){if(window.innerWidth>window.innerHeight)return"landscape";if(window.innerWidth<window.innerHeight)return"portrait"}else{if(0===Math.abs(window.orientation)||180===Math.abs(window.orientation))return"portrait";if(90===Math.abs(window.orientation))return"landscape"}}},pageMediator=
{next:function(){slideShow.active||(onePageBook.installed&&!zoomBook.installed?(onePageBook.next(),ctrlEngine.hide()):twoPageBook.installed&&!zoomBook.installed?twoPageBook.next():zoomBook.installed&&zoomBook.next())},prev:function(){slideShow.active||(onePageBook.installed&&!zoomBook.installed?(onePageBook.prev(),ctrlEngine.hide()):twoPageBook.installed&&!zoomBook.installed?twoPageBook.prev():zoomBook.installed&&zoomBook.prev())},change:function(){slideShow.active||pager.change()},goToPage:function(a){if(0>
a)a=1;else if(a>bookData.pageCount)a=bookData.pageCount;onePageBook.installed&&!zoomBook.installed?(onePageBook.goToPage(a),!1==toc.tocLock&&ctrlEngine.hide(),toc.tocLock=!1):twoPageBook.installed&&!zoomBook.installed?twoPageBook.goToPage(a):zoomBook.installed&&zoomBook.goToPage(a)},getPage:function(a){var a=a||"left",b=1;onePageBook.installed?b=onePageBook.currentPage:zoomBook.installed?b=zoomBook.currentPage:twoPageBook.installed&&(b=1==1*twoPageBook.currentPage.right?twoPageBook.currentPage.right:
pageMediator.isLastPage(twoPageBook.currentPage.left)?twoPageBook.currentPage.left:pageMediator.isLastPage(twoPageBook.currentPage.right)?twoPageBook.currentPage.right:"left"===a?twoPageBook.currentPage.left:twoPageBook.currentPage.right);if(b>bookData.pageCount)b=bookData.pageCount;return b},getCurrentPage:function(){if(onePageBook.installed)return onePageBook.currentPage;if(zoomBook.installed)return zoomBook.currentPage;if(twoPageBook.installed)return twoPageBook.currentPage},isLastPage:function(){return onePageBook.installed&&
bookData.pageCount===onePageBook.currentPage?!0:zoomBook.installed&&bookData.pageCount===zoomBook.currentPage?!0:twoPageBook.installed&&(twoPageBook.currentPage.right===bookData.pageCount||twoPageBook.currentPage.left===bookData.pageCount)?!0:!1},isLastNum:function(){if(bookData.rightToLeftMode)return onePageBook.installed&&1==onePageBook.currentPage?!0:zoomBook.installed&&1==zoomBook.currentPage?!0:twoPageBook.installed&&(1==twoPageBook.currentPage.right||1==twoPageBook.currentPage.left)?!0:!1;pageMediator.isLastPage()}},
pager={installed:!1,state:"show",fontSize:14,fontMarginTop:10,fontMarginLeft:10,draw:function(){if(el.id("pagerToolbar")){if(!pager.installed){var a=el.add("span");a.className="pagerField";a.id="pagerField";el.id("pagerToolbar").appendChild(a);pager.event(a);var b=el.add("span");b.className="pagerFont";b.style.margin=pager.fontMarginTop+"px "+pager.fontMarginLeft+"px";b.style.fontSize=pager.fontSize+"px";b.appendChild(document.createTextNode("Page  "));a.appendChild(b);b=el.add("span");b.id="pagerCurrentPage";
b.className="pagerFont";b.style.margin=pager.fontMarginTop+"px 0 0 0";b.style.fontSize=pager.fontSize+"px";b.innerHTML="0";a.appendChild(b);b=el.add("span");b.className="pagerFont";b.style.margin=pager.fontMarginTop+"px "+pager.fontMarginLeft+"px";b.style.fontSize=pager.fontSize+"px";b.appendChild(document.createTextNode(" / "+bookData.pageCount));a.appendChild(b)}pager.installed=!0}},change:function(){buttons.check();var a=window.location.pathname.split("/");if(el.id("pagerToolbar")){(system.device.iphone||
system.device.ipod)&&window.scrollTo(0,1);"input"==pager.state&&pager.cancelInput();if(onePageBook.installed&&!zoomBook.installed){var b=el.id("pagerCurrentPage");b.removeChild(b.childNodes[0]);nTe=document.createTextNode(onePageBook.currentPage);b.appendChild(nTe);window.location.hash="#"+onePageBook.currentPage;GAEnable&&_trackPageview(a[a.length-4]+"-"+onePageBook.currentPage);bookData.lastLocation.save(onePageBook.currentPage)}else if(twoPageBook.installed&&!zoomBook.installed)if(bookData.rightToLeftMode)if(0<
twoPageBook.currentPage.right&&twoPageBook.currentPage.left<=bookData.pageCount)b=el.id("pagerCurrentPage"),b.removeChild(b.childNodes[0]),nTe=document.createTextNode(twoPageBook.currentPage.left+"-"+twoPageBook.currentPage.right),b.appendChild(nTe),window.location.hash="#"+twoPageBook.currentPage.left,GAEnable&&_trackPageview(a[a.length-4]+"-"+twoPageBook.currentPage.left),bookData.lastLocation.save(twoPageBook.currentPage.left);else if(0>=twoPageBook.currentPage.right)b=el.id("pagerCurrentPage"),
b.removeChild(b.childNodes[0]),nTe=document.createTextNode(twoPageBook.currentPage.left),b.appendChild(nTe),window.location.hash="#"+twoPageBook.currentPage.left,GAEnable&&_trackPageview(a[a.length-4]+"-"+twoPageBook.currentPage.left),bookData.lastLocation.save(twoPageBook.currentPage.left);else{if(twoPageBook.currentPage.left>bookData.pageCount)b=el.id("pagerCurrentPage"),b.removeChild(b.childNodes[0]),nTe=document.createTextNode(twoPageBook.currentPage.right),b.appendChild(nTe),window.location.hash=
"#"+twoPageBook.currentPage.right,GAEnable&&_trackPageview(a[a.length-4]+"-"+twoPageBook.currentPage.left),bookData.lastLocation.save(twoPageBook.currentPage.right)}else if(0<twoPageBook.currentPage.left&&twoPageBook.currentPage.right<=bookData.pageCount)b=el.id("pagerCurrentPage"),b.removeChild(b.childNodes[0]),nTe=document.createTextNode(twoPageBook.currentPage.left+"-"+twoPageBook.currentPage.right),b.appendChild(nTe),window.location.hash="#"+twoPageBook.currentPage.left,GAEnable&&_trackPageview(a[a.length-
4]+"-"+twoPageBook.currentPage.left),bookData.lastLocation.save(twoPageBook.currentPage.left);else if(0>=twoPageBook.currentPage.left)b=el.id("pagerCurrentPage"),b.removeChild(b.childNodes[0]),nTe=document.createTextNode(twoPageBook.currentPage.right),b.appendChild(nTe),window.location.hash="#"+twoPageBook.currentPage.right,GAEnable&&_trackPageview(a[a.length-4]+"-"+twoPageBook.currentPage.right),bookData.lastLocation.save(twoPageBook.currentPage.right);else{if(twoPageBook.currentPage.right>bookData.pageCount)b=
el.id("pagerCurrentPage"),b.removeChild(b.childNodes[0]),nTe=document.createTextNode(twoPageBook.currentPage.left),b.appendChild(nTe),window.location.hash="#"+twoPageBook.currentPage.left,GAEnable&&_trackPageview(a[a.length-4]+"-"+twoPageBook.currentPage.left),bookData.lastLocation.save(twoPageBook.currentPage.left)}else if(zoomBook.installed)b=el.id("pagerCurrentPage"),b.removeChild(b.childNodes[0]),nTe=document.createTextNode(zoomBook.currentPage),b.appendChild(nTe),window.location.hash="#"+zoomBook.currentPage,
GAEnable&&_trackPageview(a[a.length-4]+"-"+twoPageBook.currentPage.left+"/zoomed");if(PUBL)parent.window.location=PUBLDOMAIN+window.location.hash}},enableInput:function(a){a.stopPropagation();if(!slideShow.active){a.target=a.target?a.target:a.srcElement;a.preventDefault();pager.state="input";a=el.add("input");a.className="inputPage";a.id="inputPage";a.type="number";a.style.height=pager.fontSize+"px";a.style.width="100px";a.style.fontSize=pager.fontSize-1+"px";a.style.margin=pager.fontMarginTop+"px "+
pager.fontMarginLeft+"px";a.value=pageMediator.getPage();if(el.id("pagerCurrentPage")){var b=el.id("pagerCurrentPage");b.parentNode.replaceChild(a,b)}pager.inputEvent(a);a.focus();a.select()}},cancelInput:function(){var a=el.add("span");a.id="pagerCurrentPage";a.className="pagerFont";a.style.margin=pager.fontMarginTop+"px 0 0 0";a.style.fontSize=pager.fontSize+"px";if(onePageBook.installed)var b=onePageBook.currentPage;else twoPageBook.installed?(b="",0<twoPageBook.currentPage.left&&twoPageBook.currentPage.left<=
bookData.pageCount&&(b=b+twoPageBook.currentPage.left+"-"),0<twoPageBook.currentPage.right&&twoPageBook.currentPage.right<=bookData.pageCount&&(b+=twoPageBook.currentPage.right)):b=zoomBook.installed?zoomBook.currentPage:"0";b=document.createTextNode(b);a.appendChild(b);a.addEventListener("click",pager.enableInput);b=el.id("inputPage");b.parentNode.replaceChild(a,b);pager.state="show"},event:function(a){a.addEventListener("click",pager.enableInput,!1)},inputEvent:function(a){event.stopPropagation();
event.preventDefault();if(pager.installed&&"input"==pager.state&&!slideShow.active){var b=function(a){a.target=a.target?a.target:a.srcElement;13==a.keyCode&&(pager.change(),pageMediator.goToPage(a.target.value));delete b};a.addEventListener("keydown",b,!1)}a=null}},preloader={image:new Image,interval:null,preloadersStack:[],imageLoad:!1,angle:0,special:0,init:function(){this.image.src=PUBL?preloader_img:STYLES_SRC+"progress.png";this.image.onload=function(){preloader.imageLoad=!0;if(0<preloader.preloadersStack.length){for(var a=
0;a<preloader.preloadersStack.length;a++){var b=el.id("canvas"+preloader.preloadersStack[a]);preloader.draw(b);var c=b.getContext("2d");c.save();c.translate(b.width/2,b.height/2);c.drawImage(preloader.image,-20,-20,40,40);c.restore()}preloader.startInterval()}}},add:function(a){a*=1;el.id("canvas"+a)&&(preloader.imageLoad&&preloader.draw(el.id("canvas"+a)),this.preloadersStack.push(a),1==preloader.preloadersStack.length&&preloader.imageLoad&&preloader.startInterval())},draw:function(a){var b=a.getContext("2d");
b.save();b.translate(a.width/2,a.height/2);b.drawImage(preloader.image,-20,-20,40,40);b.restore()},setSpecial:function(a){psNum=1*a;preloader.special=a},startInterval:function(){clearInterval(preloader.interval);var a=function(){var b,c;0==preloader.preloadersStack.length&&preloader.stopInterval();preloader.angle+=6;if(360==preloader.angle)preloader.angle=0;if(onePageBook.installed)c=b=onePageBook.currentPage;else if(twoPageBook.installed)b=twoPageBook.currentPage.left,c=twoPageBook.currentPage.right;
else if(zoomBook.installed)c=b=zoomBook.currentPage;for(var d=0;d<preloader.preloadersStack.length;d++)if(preloader.preloadersStack[d]==b||preloader.preloadersStack[d]==c||preloader.preloadersStack[d]==preloader.special){var e=el.id("canvas"+preloader.preloadersStack[d]),f=e.getContext("2d");f.save();f.translate(e.width/2,e.height/2);f.rotate(preloader.angle*(Math.PI/180));f.fillStyle="rgb(255,255,255)";f.fillRect(-30,-30,60,60);f.drawImage(preloader.image,-20,-20,40,40);f.restore()}delete a};preloader.interval=
window.setInterval(a,45)},stopInterval:function(){clearInterval(preloader.interval)},deletePreloader:function(a){var a=1*a,b=preloader.preloadersStack.indexOf(1*a);if(el.id("canvas"+a)){var a=el.id("canvas"+a),c=a.getContext("2d");c.save();c.translate(a.width/2,a.height/2);c.fillStyle="rgb(255,255,255)";c.fillRect(-30,-30,60,60);c.restore()}-1!=b&&(preloader.preloadersStack.splice(b,1),0==preloader.preloadersStack.length&&preloader.stopInterval())},stopAll:function(){preloader.preloadersStack=[]},
insertSimpleLoader:function(a,b,c){var d=el.add("img"),d=this.image;d.id="simpleLoader";d.style.zIndex=1E3;d.className="preloaderZ";d.style.left=b+"px";d.style.top=c+"px";html5lib.translate(d,0,0,10);a.appendChild(d)},delSimplePreloader:function(){el.del("simpleLoader")}};function SearchResult(a,b,c,d,e){this.pageNum=a;this.relevant=b;this.startPos=c;this.stopPos=d;this.fullText=e}
var search={active:!1,result:[{id:9,text:"\u0442\u0440\u043e\u043b\u043e\u043b\u043e <b>dfgh</b> \u0430\u0432\u0430\u043f\u043b\u0432\u043e\u0440\u0430\u043f"},{id:5,text:"dds df fhs  <b>dfgh</b> sdfslkfjksjhdfk"}],buildIndexes:function(a,b,c){for(var d=[],e=0;e<b;e++){for(var f=[],h=a[e],g=-3;-1!=g;)g=c.indexOf(h,g+3),-1!=g&&f.push(g);0<f.length&&d.push(f)}return d},searchFullCoincidence:function(a,b,c,d){for(var e=-1,f=-1;0<=(e=b.indexOf(a,e+1));)if(f=e,!(0<e&&e<b.length-1&&(!strUtils.isSplitter(b.charAt(e-
1))||!strUtils.isSplitter(b.charAt(e+a.length)))))return this.result.push(new SearchResult(c,d?0:1,e,e+a.length,d)),!0;return 0<=f?(this.result.push(new SearchResult(c,d?2:3,f,f+a.length,d)),!0):!1},searchPartiallyCoincidence:function(a,b,c,d){a=this.buildIndexes(a,d,b);if(null==a||0==a.length)return!1;for(var b=0,e=Array(a.length),f=0;f<a.length;f++)e[f]=a[f][0];for(f=0;f<a.length-1;f++){var h=1E3,g=a[f],j=a[f+1];if(null==g||null==j)break;for(var k=g.length,m=j.length,l=0;l<k;l++)for(var q=0;q<m;q++){var o=
g[l],n=j[q],p=(n>o?n-o:o-n)*(n>o?1:2);p<h&&(e[f]=o,e[f+1]=n,h=p)}b+=h}f=1E4;for(g=h=0;null!=e&&g<e.length;g++)f=Math.min(f,e[g]),h=Math.max(h,e[g]);b+=1E3*(d-a.length);this.result.push(new SearchResult(c,b+4,f,h,!1))},search:function(a,b){this.result=[];var c=strUtils.split(a,3);queryArrayLength=c.length;for(page in b.pages)page=b.pages[page],null==page.content||search.searchFullCoincidence(a,page.content,page.id,!0)||(1<queryArrayLength?this.searchPartiallyCoincidence(c,page.content,page.id,queryArrayLength,
a.length):1===queryArrayLength&&this.searchFullCoincidence(c[0],page.content,page.id,!1));return this.result}},strUtils={SPLITTERS:[",",";","."," ","?","!","'",'"',"",String.fromCharCode(10),String.fromCharCode(13),String.fromCharCode(8211),String.fromCharCode(8212),String.fromCharCode(8722),String.fromCharCode(8209),String.fromCharCode(8208)],split:function(a,b){for(var c=a.split(" "),d=[],e=0;e<c.length;e++)c[e].length>=b&&d.push(c[e]);return d},isSplitter:function(a){for(var b=0;b<this.SPLITTERS.length;b++)if(a==
this.SPLITTERS[b])return!0;return!1},getNum:function(a){var b="000"+a;9<a&&(b="00"+a);99<a&&(b="0"+a);999<a&&(b=""+a);return b}},skin=function(){var a=document.createElement("link");a.type="text/css";a.rel="stylesheet";a.href=STYLES_SRC+"skinstyle_"+bookData.skin.toLowerCase()+".css";document.getElementsByTagName("head")[0].appendChild(a);bookData.skinScale=system.device.android?1.7:window.devicePixelRatio;bookData.toolbar={};bookData.toolbar[0]={};bookData.toolbar[0].id="navigationToolbar";bookData.toolbar[0].orientation=
"bottom";bookData.toolbar[0].className="navigationToolbar";bookData.toolbar[0].height=40*bookData.skinScale;bookData.toolbar[0].width="100%";bookData.toolbar[0].bottom=20*bookData.skinScale;bookData.toolbar[0].left=0;bookData.toolbar[0].speed=300;bookData.toolbar[1]={};bookData.toolbar[1].id="leftToolbar";bookData.toolbar[1].orientation="left";bookData.toolbar[1].className="leftToolbar";bookData.toolbar[1].width=40*bookData.skinScale;bookData.toolbar[1].bottom=0;bookData.toolbar[1].top=0;bookData.toolbar[1].left=
0;bookData.toolbar[1].speed=300;bookData.toolbar[2]={};bookData.toolbar[2].id="rightToolbar";bookData.toolbar[2].orientation="right";bookData.toolbar[2].className="rightToolbar";bookData.toolbar[2].width=40*bookData.skinScale;bookData.toolbar[2].bottom=0;bookData.toolbar[2].top=28*bookData.skinScale;bookData.toolbar[2].right=0;bookData.toolbar[2].speed=300;bookData.toolbar[3]={};bookData.toolbar[3].id="pagerToolbar";bookData.toolbar[3].orientation="top";bookData.toolbar[3].className="pagerToolbar";
bookData.toolbar[3].height=30*bookData.skinScale;bookData.toolbar[3].top=0;bookData.toolbar[3].right=-1;bookData.toolbar[3].speed=300;pager.fontSize=14*bookData.skinScale;pager.fontMarginTop=8*bookData.skinScale;pager.fontMarginLeft=8*bookData.skinScale;bookData.toolbar[4]={};bookData.toolbar[4].id="infoToolbar";bookData.toolbar[4].orientation="top";bookData.toolbar[4].className="infoToolbar";bookData.toolbar[4].height=0;bookData.toolbar[4].top=0;bookData.toolbar[4].left=0;bookData.toolbar[4].speed=
0;ctrlEngine.border.orientation="top";ctrlEngine.border.top=0;ctrlEngine.border.left=40*bookData.skinScale;ctrlEngine.border.right=40*bookData.skinScale;ctrlEngine.border.bottom=80*bookData.skinScale;ctrlEngine.border.speed=300;ctrlEngine.border.isFx=!0;ctrlEngine.border.wMain=350*bookData.skinScale;ctrlEngine.border.wInfo=450*bookData.skinScale;ctrlEngine.border.hHeader=40*bookData.skinScale;ctrlEngine.border.margin=5*bookData.skinScale;buttons.fieldWidth=40*bookData.skinScale;buttons.fieldHeight=
36*bookData.skinScale;buttons.info.width=25*bookData.skinScale;buttons.info.height=25*bookData.skinScale;buttons.info.margin=bookData.toolbar[2].width-buttons.info.width;buttons.info.imgWidth=buttons.info.width;buttons.info.imgHeight=buttons.info.height;buttons.navigation.parentNodeId=bookData.toolbar[0].id;buttons.navigation.en=bookData.navigationVisible;buttons.navigation.height=20*bookData.skinScale;buttons.navigation.margin=10*bookData.skinScale;buttons.slideShow.parentNodeId="navigationField";
buttons.slideShow.en=bookData.slideShowVisible;if("DarkWood"==bookData.skin)buttons.bgImg="#000",buttons.bgImgOnclick="#555";if("ClassicGrey"==bookData.skin)buttons.bgImg="#91989f",buttons.bgImgOnclick="#555";if("DarkSkyBlue"==bookData.skin)buttons.bgImg="-webkit-gradient(linear, 0% 0, 0% 100%, from(#839cb2), color-stop(0.39, #19233e), color-stop(0.4, #161a1f), to(#161a1f))",buttons.bgImgOnclick="-webkit-gradient(linear, 0% 0, 0% 100%, from(#d2deec), color-stop(0.39, #19233e), color-stop(0.4, #839cb2), to(#839cb2))";
buttons.toc.parentNodeId=bookData.toolbar[1].id;buttons.toc.en=bookData.tocVisible;buttons.toc.src=STYLES_SRC+"buttons/toc.png";buttons.toc.height=30*bookData.skinScale;buttons.toc.width=30*bookData.skinScale;buttons.toc.marginTop=(buttons.fieldHeight-buttons.toc.height)/2;buttons.toc.marginLeft=(buttons.fieldWidth-buttons.toc.width)/2;buttons.bm.parentNodeId=bookData.toolbar[1].id;buttons.bm.src=STYLES_SRC+"buttons/bm.png";buttons.bm.en=bookData.bookmarksVisible;buttons.bm.height=30*bookData.skinScale;
buttons.bm.width=30*bookData.skinScale;buttons.bm.marginTop=(buttons.fieldHeight-buttons.bm.height)/2;buttons.bm.marginLeft=(buttons.fieldWidth-buttons.bm.width)/2;buttons.addBm.parentNodeId=bookData.toolbar[2].id;buttons.addBm.en=bookData.bookmarksVisible;buttons.addBm.srcAdd=STYLES_SRC+"buttons/addbm.png";buttons.addBm.srcRem=STYLES_SRC+"buttons/rembm.png";buttons.addBm.height=30*bookData.skinScale;buttons.addBm.width=30*bookData.skinScale;buttons.addBm.marginTop=(buttons.fieldHeight-buttons.addBm.height)/
2;buttons.addBm.marginLeft=(buttons.fieldWidth-buttons.addBm.width)/2;buttons.search.parentNodeId=bookData.toolbar[1].id;buttons.search.src=STYLES_SRC+"buttons/search.png";buttons.search.en=bookData.searchVisible;buttons.search.height=30*bookData.skinScale;buttons.search.width=30*bookData.skinScale;buttons.search.marginTop=(buttons.fieldHeight-buttons.search.height)/2;buttons.search.marginLeft=(buttons.fieldWidth-buttons.search.width)/2;buttons.info.parentNodeId=bookData.toolbar[2].id;buttons.info.src=
STYLES_SRC+"buttons/info.png";if("DarkWood"==bookData.skin)buttons.info.bgImg="#000",buttons.info.bgImgOnclick="#555";if("ClassicGrey"==bookData.skin)buttons.info.bgImg="#000",buttons.info.bgImgOnclick="#555";buttons.back.color="#ccc";buttons.back.colorOn="#000";bookData.info={};bookData.info.gestures={};bookData.info.gestures[0]={};bookData.info.gestures[0].src=STYLES_SRC+"info/slide.png";bookData.info.gestures[0].h1="Slide:";bookData.info.gestures[0].p="Flip pages to the left / to the right";bookData.info.gestures[1]=
{};bookData.info.gestures[1].src=STYLES_SRC+"info/singletapside.png";bookData.info.gestures[1].h1="Single Tap (side):";bookData.info.gestures[1].p="Flip pages to the left / to the right";bookData.info.gestures[2]={};bookData.info.gestures[2].src=STYLES_SRC+"info/singletapcenter.png";bookData.info.gestures[2].h1="Single Tap (center):";bookData.info.gestures[2].p="Show / hide on-screen control toolbar";bookData.info.gestures[3]={};bookData.info.gestures[3].src=STYLES_SRC+"info/doubletap.png";bookData.info.gestures[3].h1=
"Double Tap:";bookData.info.gestures[3].p="Zoom in / zoom out";bookData.info.gestures[4]={};bookData.info.gestures[4].src=STYLES_SRC+"info/pinch.png";bookData.info.gestures[4].h1="Pinch:";bookData.info.gestures[4].p="Zoom in / zoom out";bookData.info.gestures[5]={};bookData.info.gestures[5].src=STYLES_SRC+"info/move.png";bookData.info.gestures[5].h1="Move:";bookData.info.gestures[5].p="Move page in zoom mode";bookData.info.gestures[6]={};bookData.info.gestures[6].src=STYLES_SRC+"info/rotate.png";
bookData.info.gestures[6].h1="Rotate:";bookData.info.gestures[6].p="Change device orientation";bookData.info.toolbar={};a=0;if(bookData.tocVisible)bookData.info.toolbar[a]={},bookData.info.toolbar[a].src=STYLES_SRC+"buttons/toc.png",bookData.info.toolbar[a].p="View Table of Contents",a+=1;if(bookData.bookmarksVisible)bookData.info.toolbar[a]={},bookData.info.toolbar[a].src=STYLES_SRC+"buttons/bm.png",bookData.info.toolbar[a].p="View Bookmark List",a+=1,bookData.info.toolbar[a]={},bookData.info.toolbar[a].src=
STYLES_SRC+"buttons/addbm.png",bookData.info.toolbar[a].p="Add/remove Bookmark",a+=1;if(bookData.searchVisible)bookData.info.toolbar[a]={},bookData.info.toolbar[a].src=STYLES_SRC+"buttons/search.png",bookData.info.toolbar[a].p="Search by kayword";bookData.info.navigation={};a=0;if(bookData.slideshowVisible&&bookData.navigationVisible)bookData.info.navigation[a]={},bookData.info.navigation[a].src=STYLES_SRC+"navigation/activeslideshow.png",bookData.info.navigation[a].p="Start/stop Slide Show",a+=1;
if(bookData.navigationVisible)bookData.info.navigation[a]={},bookData.info.navigation[a].src=STYLES_SRC+"navigation/activenext.png",bookData.info.navigation[a].p="Flip to Next Page",a+=1,bookData.info.navigation[a]={},bookData.info.navigation[a].src=STYLES_SRC+"navigation/activeprev.png",bookData.info.navigation[a].p="Flip to Previose Page",a+=1,bookData.info.navigation[a]={},bookData.info.navigation[a].src=STYLES_SRC+"navigation/activelast.png",bookData.info.navigation[a].p="Flip to Last Page",a+=
1,bookData.info.navigation[a]={},bookData.info.navigation[a].src=STYLES_SRC+"navigation/activefirst.png",bookData.info.navigation[a].p="Flip to First Page"},slideShow={active:!1,interval:function(){var a=twoPageBook.installed?2*twoPageBook.triggerStopTime:onePageBook.installed?2*onePageBook.triggerStopTime:zoomBook.installed?2*zoomBook.slideSpeed:2E3;if(onePageBook.installed||zoomBook.installed)if(1==pageMediator.getPage())var b=2*bookData.page[pageMediator.getPage()].slideDelay,b=2E3>b?2E3:b;else b=
bookData.page[pageMediator.getPage()].slideDelay,b=b<a?a:b;else b=1===pageMediator.getPage("right")?2*bookData.page[pageMediator.getPage("right")].slideDelay:1===pageMediator.getPage("left")?2*bookData.page[pageMediator.getPage("left")].slideDelay:pageMediator.getPage("right")===bookData.pageCount?2*bookData.page[pageMediator.getPage("right")].slideDelay:pageMediator.getPage("left")===bookData.pageCount?2*bookData.page[pageMediator.getPage("left")].slideDelay:1*bookData.page[pageMediator.getPage("left")].slideDelay+
1*bookData.page[pageMediator.getPage("right")].slideDelay,b=b<a?a:b;return b},play:function(){function a(){slideShow.active&&(pageMediator.isLastPage()?(bookData.slideshowLoop||slideShow.stop(),pageMediator.goToPage(1)):slideShow.next(),pager.change(),interval=slideShow.interval(),slideShow.active&&setTimeout(a,interval))}slideShow.active=!0;"display"==ctrlEngine.state&&ctrlEngine.hide();interval=slideShow.interval();setTimeout(a,interval)},next:function(){zoomBook.installed||(onePageBook.installed?
onePageBook.next():twoPageBook.installed&&twoPageBook.next())},stop:function(){slideShow.active=!1},toGo:function(){slideShow.active?slideShow.stop():slideShow.active||slideShow.play()}};
system={ua:"",isInit:!1,isMobile:!1,browser:{},platform:{},device:{publisher:{}},init:function(){this.ua=navigator.userAgent.toLowerCase();var a=navigator.platform.toLowerCase(),b=this.ua.match(/(opera|ie|firefox|chrome|version)[\s\/:]([\w\d\.]+)?.*?(safari|version[\s\/:]([\w\d\.]+)|$)/)||[null,"unknown",0];this.browser.name="version"==b[1]?b[3]:b[1];this.browser[this.browser.name]=!0;mode="ie"==b[1]&&document.documentMode;this.browser.version=mode||parseFloat("opera"==b[1]&&b[4]?b[4]:b[2]);this.platform.name=
this.ua.match(/ip(?:ad|od|hone)/)?"ios":this.ua.match(/(?:msie 9)/)?"wphone":(this.ua.match(/(?:webos|android|bada|symbian|palm|blackberry)/)||a.match(/mac|win|linux/)||["other"])[0];this.platform[this.platform.name]=!0;this.device.publisher.deviceName=this.ua.match(/ipad/)?"ipad":this.ua.match(/iphone/)?"iphone":this.ua.match(/android/)?"android":!1;this.device.publisher.orientation=this.ua.match(/portrait/)?"portrait":this.ua.match(/landscape/)?"landscape":!1;this.device.publisher.isOn=this.ua.match(/(?:preview_publisher)/)?
!0:!1;if(this.platform.android)b=document.createElement("meta"),b.name="viewport",b.content="user-scalable=0; target-densitydpi=device-dpi",document.getElementsByTagName("head")[0].appendChild(b);this.device.name=this.ua.match(/ipad/)?"ipad":this.ua.match(/ipad/)?"ipad":this.ua.match(/ipod/)?"ipod":this.ua.match(/iphone/)?"iphone":this.ua.match(/android/)?"android":a.match(/mac|win|linux/)?"pc":"other";this.device[this.device.name]=!0;this.platform.ios&&!PUBL&&document.getElementById("viewMeta").setAttribute("content",
"width=device-width, initial-scale="+1/(window.devicePixelRatio||1)+", maximum-scale="+1/(window.devicePixelRatio||1));if(this.platform.android){if(window.innerWidth>window.innerHeight)this.device.orientation="landscape";if(window.innerWidth<window.innerHeight)this.device.orientation="portrait"}else if(this.platform.ios){if(0===Math.abs(window.orientation)||180===Math.abs(window.orientation))this.device.orientation="portrait";if(90===Math.abs(window.orientation))this.device.orientation="landscape"}else this.device.orientation=
!1;if(this.device.publisher.isOn){if("ipad"==this.device.publisher.deviceName)system.browser.scale="portrait"==this.device.publisher.orientation?1024/window.innerHeight:1024/window.innerWidth;if("iphone"==this.device.publisher.deviceName)system.browser.scale="portrait"==this.device.publisher.orientation?600/window.innerHeight:600/window.innerWidth;if("android"==this.device.publisher.deviceName)system.browser.scale="portrait"==this.device.publisher.orientation?1024/window.innerHeight:1024/window.innerWidth}else system.browser.scale=
1;this.device.width=function(){return system.device.publisher.isOn?window.innerWidth*system.browser.scale:window.innerWidth};this.device.height=function(){return system.device.publisher.isOn?window.innerHeight*system.browser.scale:this.iphone||this.ipod?1<window.innerWidth/window.innerHeight?200<window.innerHeight&&210>window.innerHeight?270:410<window.innerHeight&&420>window.innerHeight?540:window.innerHeight:350<window.innerHeight&&360>window.innerHeight?417:710<window.innerHeight&&730>window.innerHeight?
834:window.innerHeight:window.innerHeight};this.device.proportions=function(){return(system.device.width()/system.device.height()).toFixed(2)};this.isInit=!0;if(system.platform.ios||system.platform.android)this.isMobile=!0},route:function(){this.isInit||this.init()}};
timer={state:!0,blockTime:0,endFX:0,startTime:Date.now(),setBlockTime:function(a,b){this.endFX=b||a;this.blockTime=a;this.startTime=Date.now()},check:function(a){a=a||"standart";if("standart"==a)return Date.now()-this.startTime>this.blockTime?!0:!1;if("high"==a)return!0;if("fx"==a)return Date.now()-this.startTime>this.endFX?!0:!1}};
var toc={installed:!1,isToc:!1,mark:0,pageNum:0,level:[],tocLock:!1,shiftSpeed:500,parseLevel:function(a){var b;for(i=0;i<a;i++)b=0==i?bookData.TOC:b.tocElement[toc.level[i]].children;return b},init:function(){if(!toc.installed){if(bookData.TOC)toc.isToc=!0;toc.installed=!0}},showFirstMenu:function(){if(toc.isToc)if("hide"==ctrlEngine.state)ctrlEngine.mode="toc",toc.level=[],toc.level[0]=0,ctrlEngine.display();else if("toc"==ctrlEngine.mode)ctrlEngine.hide(),toc.level=[];else if("bm"==ctrlEngine.mode||
"search"==ctrlEngine.mode)ctrlEngine.mode="toc",toc.level=[],toc.level[0]=0,ctrlEngine.change()},showPrevMenu:function(){var a=toc.level.length;toc.mark=toc.level[a-1];if(1<a){if(3<=a){var b=toc.parseLevel(a-2);ctrlEngine.content.generateList.toc(b,a-3,!1);var b=el.id("menu"+(a-3)),c=b.getElementsByTagName("LI")[toc.level[a-2]-1],d=el.id("content"),e=d.offsetHeight/(3*c.offsetHeight);if(toc.level[a-2]>e&&0>d.offsetHeight-b.offsetHeight)b.style.top=(e.toFixed()-toc.level[a-2])*c.offsetHeight<d.offsetHeight-
b.offsetHeight?d.offsetHeight-b.offsetHeight+"px":(e.toFixed()-toc.level[a-2])*c.offsetHeight+"px";c.style.background="#888888";b=b=c=e=d=null}ctrlEngine.content.leftShift(a-2);var f=function(){ctrlEngine.content.remove(toc.level.length);delete f};window.setTimeout(f,toc.shiftSpeed+50);toc.level=toc.level.slice(0,a-1);buttons.back.check();event=null}a=null}},toolbar={status:"hide",installed:!1,draw:function(){if(!toolbar.installed){skin();for(tb in bookData.toolbar){tb=bookData.toolbar[tb];var a=
el.add("div");a.className=tb.className;a.id=tb.id;a.style.height="100%"!=tb.height?tb.height+"px":tb.height;a.style.width="100%"!=tb.width?tb.width+"px":tb.width;if(tb.top)a.style.top=tb.top+"px";if(tb.left)a.style.left=tb.left+"px";if(tb.right)a.style.right=tb.right+"px";if(tb.bottom)a.style.bottom=tb.bottom+"px";"pagerToolbar"!=tb.id&&"searchToolbar"!=tb.id&&(!1==eventManager.touchInterface?eventManager.loadClickEvents(a):eventManager.loadTouchEvents(a));toolbar.backShift(a,tb);el.id("body").appendChild(a);
buttons.navigation.parentNodeId==tb.id&&bookData.navigationVisible&&buttons.navigation.draw(a);buttons.slideShow.parentNodeId==tb.id&&bookData.slideshowVisible&&buttons.slideShow.draw(a);buttons.toc.parentNodeId==tb.id&&buttons.toc.en&&buttons.toc.draw(a);buttons.bm.parentNodeId==tb.id&&buttons.bm.en&&buttons.bm.draw(a);buttons.search.parentNodeId==tb.id&&buttons.search.en&&buttons.search.draw(a);buttons.addBm.parentNodeId==tb.id&&buttons.addBm.en&&buttons.addBm.draw(a);buttons.info.parentNodeId==
tb.id&&buttons.info.draw(a);if(!toolbar.installed)toolbar.installed=!0}tb=null}},backShift:function(a,b){if("top"==b.orientation)a.style.top=-12-b.height+"px";if("bottom"==b.orientation)a.style.bottom=-10-b.height+"px";if("left"==b.orientation)a.style.left=-12-b.width+"px";if("right"==b.orientation)a.style.right=-10-b.width+"px"},toogle:function(){if(toolbar.installed){"input"==pager.state&&pager.cancelInput();if("show"==this.status){for(tb in bookData.toolbar)tb=bookData.toolbar[tb],toolbar.transform(tb,
0);toolbar.status="hide";ctrlEngine.hide()}else{for(tb in bookData.toolbar)tb=bookData.toolbar[tb],search.active?"navigationToolbar"!=tb.id&&toolbar.transform(tb,-1):"searchToolbar"!=tb.id&&toolbar.transform(tb,-1);toolbar.status="show"}tb=null}},transform:function(a,b){var c=0,d=el.id(a.id);"top"==a.orientation&&(c=-(a.height+a.top+9)*b-10*(b+1),html5lib.duration(d,a.speed),html5lib.translate(d,0,c,100));"bottom"==a.orientation&&(c=(a.height+a.bottom+9)*b+10*(b+1),html5lib.duration(d,a.speed),html5lib.translate(d,
0,c,100));"left"==a.orientation&&(c=-(a.width+a.left+9)*b-10*(b+1),html5lib.duration(d,a.speed),html5lib.translate(d,c,0,100));"right"==a.orientation&&(c=(a.width+a.right+9)*b+10*(b+1),html5lib.duration(d,a.speed),html5lib.translate(d,c,0,100))}},twoPageBook={currentPage:{left:0,right:0},installed:!1,nextPageBuffer:2,prevPageBuffer:2,flipSpeed:800,triggerStopTime:850,bookWidth:0,bookHeight:0,bookTop:0,bookLeft:0,padding:10,gesturePending:!1,gestureStore:{left:"",webkit:"",zIndex:"",parent:""},pageConverter:function(a){bookData.rightToLeftMode?
0!=a%2?(twoPageBook.currentPage.left=a,twoPageBook.currentPage.right=a-1):(twoPageBook.currentPage.left=1*a+1,twoPageBook.currentPage.right=a):0!=a%2?(twoPageBook.currentPage.left=a-1,twoPageBook.currentPage.right=a):(twoPageBook.currentPage.left=a,twoPageBook.currentPage.right=1*a+1);twoPageBook.currentPage.left*=1;twoPageBook.currentPage.right*=1},draw:function(a){preloader.stopAll();twoPageBook.pageConverter(a);2*bookData.size.proportions<system.device.proportions()?(twoPageBook.bookWidth=((system.device.height()-
twoPageBook.padding)*2*bookData.size.proportions).toFixed(0),twoPageBook.bookHeight=(system.device.height()-twoPageBook.padding).toFixed(0)):(twoPageBook.bookWidth=system.device.width()-twoPageBook.padding,twoPageBook.bookHeight=((system.device.width()-twoPageBook.padding)/(2*bookData.size.proportions)).toFixed(0));twoPageBook.bookTop=((system.device.height()-twoPageBook.bookHeight)/2).toFixed(0);twoPageBook.bookLeft=((system.device.width()-twoPageBook.bookWidth)/2).toFixed(0);el.id("bookLandscape")?
a=el.id("bookLandscape"):(a=el.add("div"),a.id="bookLandscape",a.style.webkitPerspective="3000",a.style.position="absolute",a.style.width=twoPageBook.bookWidth+"px",a.style.height=twoPageBook.bookHeight+"px",a.style.top=twoPageBook.bookTop+"px",a.style.left=twoPageBook.bookLeft+"px",html5lib.backfaceVisibility(a,"hidden"),a.style.zIndex="200",el.id("mainFrame").appendChild(a));twoPageBook.installed=!0;if(bookData.rightToLeftMode){for(b=1*twoPageBook.currentPage.left;b<twoPageBook.currentPage.left+
2*twoPageBook.prevPageBuffer;b+=2)twoPageBook.drawPage(b,a,"left");for(b=1*twoPageBook.currentPage.right;b>1*twoPageBook.currentPage.right-2*twoPageBook.nextPageBuffer;b-=2)twoPageBook.drawPage(b,a,"right")}else{for(var b=1*twoPageBook.currentPage.left;b>twoPageBook.currentPage.left-2*twoPageBook.prevPageBuffer;b-=2)twoPageBook.drawPage(b,a,"left");for(b=1*twoPageBook.currentPage.right;b<1*twoPageBook.currentPage.right+2*twoPageBook.nextPageBuffer;b+=2)twoPageBook.drawPage(b,a,"right")}pager.change();
twoPageBook.shadow.draw();delete a},drawPage:function(a,b,c){if(bookData.rightToLeftMode)"right"==c?(d=a-1+"x"+a,e=a-1,f=system.device.android?"rotateY(0deg)":"rotate3d(0, -1, 0, 0deg)",h=a):"left"==c&&(d=a+"x"+(1*a+1),e=1*a+1,f=system.device.android?"rotateY(0deg)":"rotate3d(0, 1, 0, 0deg)",h=bookData.pageCount-a);else if("left"==c)var d=a-1+"x"+a,e=a-1,f=system.device.android?"rotateY(0deg)":"rotate3d(0, -1, 0, 0deg)",h=a;else"right"==c&&(d=a+"x"+(1*a+1),e=1*a+1,f=system.device.android?"rotateY(0deg)":
"rotate3d(0, 1, 0, 0deg)",h=bookData.pageCount-a);if(!el.id(d)){if(0<a&&a<=bookData.pageCount){var g=el.add("div");g.id=d;g.style.position="absolute";g.style.cssFloat=c;if("right"==c)g.style.left=twoPageBook.bookWidth/2+"px";g.style.width=twoPageBook.bookWidth/2+"px";g.style.height=twoPageBook.bookHeight+"px";g.style.webkitTransformStyle="preserve-3d";g.style.webkitTransition="-webkit-transform 1s";g.style.webkitTransform=f;g.style.zIndex=h+"";b.appendChild(g);twoPageBook.drawCanvasPage(a,g,"front")}0<
e&&e<=bookData.pageCount&&twoPageBook.drawCanvasPage(e,g,"back");delete b}},drawCanvasPage:function(a,b,c){var d=el.add("canvas");d.id="canvas"+a;d.className="canvasBook";d.width=twoPageBook.bookWidth/2;d.height=twoPageBook.bookHeight;d.style.position="absolute";d.style.webkitBackfaceVisibility="hidden";d.style.webkitTransform="front"==c?"":"rotateY(180deg)";d.style.zIndex="front"==c?"1":"-1";c=d.getContext("2d");c.fillStyle="rgb(255,255,255)";c.fillRect(0,0,twoPageBook.bookWidth/2,twoPageBook.bookHeight);
1==a||a==bookData.pageCount&&0==a%2||images.drawShadow(c,a);b.appendChild(d);bookData.page[a].stub?(b=el.id("canvas"+a),c=b.getContext("2d"),c.fillStyle=bookData.page[a].BGColor,c.fillRect(0,0,b.width,b.height)):(images.push(a),preloader.add(a))},next:function(){if(zoomLock.check()&&twoPageBook.installed&&twoPageBook.currentPage.right<bookData.pageCount&&timer.check("fx")&&!bookData.rightToLeftMode){twoPageBook.flipFxCurrentPage(twoPageBook.currentPage.right);if(4==el.id("bookLandscape").childNodes.length){var a=
1*twoPageBook.currentPage.left-(2*twoPageBook.nextPageBuffer-1),b=twoPageBook.currentPage.right-(2*twoPageBook.nextPageBuffer-1);images.deleteImageFromStack(a);images.deleteImageFromStack(b);el.del(a+"x"+b);delete bm.rasterize.imgData[a];preloader.deletePreloader(a);preloader.deletePreloader(b)}twoPageBook.currentPage.left+=2;twoPageBook.currentPage.right+=2;twoPageBook.shadow.reDraw("next");a=1*twoPageBook.currentPage.left+(twoPageBook.nextPageBuffer+1);el.id(a)||twoPageBook.drawPage(a,el.id("bookLandscape"),
"right");pageMediator.change();timer.setBlockTime(twoPageBook.flipSpeed/2,twoPageBook.flipSpeed)}else zoomLock.check()&&twoPageBook.installed&&twoPageBook.currentPage.left<bookData.pageCount&&timer.check("fx")&&bookData.rightToLeftMode&&(twoPageBook.flipFxCurrentPage(twoPageBook.currentPage.left),4==el.id("bookLandscape").childNodes.length&&(b=1*twoPageBook.currentPage.left-(2*twoPageBook.nextPageBuffer-1),a=twoPageBook.currentPage.right-(2*twoPageBook.nextPageBuffer-1),images.deleteImageFromStack(a),
images.deleteImageFromStack(b),el.del(a+"x"+b),delete bm.rasterize.imgData[a],preloader.deletePreloader(a),preloader.deletePreloader(b)),twoPageBook.currentPage.left+=2,twoPageBook.currentPage.right+=2,twoPageBook.shadow.reDraw("next"),a=1*twoPageBook.currentPage.right+(twoPageBook.nextPageBuffer+1),el.id(a)||twoPageBook.drawPage(a,el.id("bookLandscape"),"left"),pageMediator.change(),timer.setBlockTime(twoPageBook.flipSpeed/2,twoPageBook.flipSpeed))},prev:function(){if(zoomLock.check()&&twoPageBook.installed&&
0<twoPageBook.currentPage.left&&timer.check("fx")&&!bookData.rightToLeftMode){twoPageBook.flipFxCurrentPage(twoPageBook.currentPage.left);if(4==el.id("bookLandscape").childNodes.length){var a=1*twoPageBook.currentPage.left+(2*twoPageBook.prevPageBuffer-1),b=1*twoPageBook.currentPage.right+(2*twoPageBook.prevPageBuffer-1);images.deleteImageFromStack(a);images.deleteImageFromStack(b);el.del(a+"x"+b);delete bm.rasterize.imgData[a];preloader.deletePreloader(a);preloader.deletePreloader(b)}twoPageBook.currentPage.left-=
2;twoPageBook.currentPage.right-=2;twoPageBook.shadow.reDraw("prev");a=1*twoPageBook.currentPage.left-twoPageBook.prevPageBuffer;el.id(a)||twoPageBook.drawPage(a,el.id("bookLandscape"),"left");pageMediator.change();timer.setBlockTime(twoPageBook.flipSpeed/2,twoPageBook.flipSpeed)}else zoomLock.check()&&twoPageBook.installed&&0<twoPageBook.currentPage.right&&timer.check("fx")&&bookData.rightToLeftMode&&(twoPageBook.flipFxCurrentPage(twoPageBook.currentPage.right),4==el.id("bookLandscape").childNodes.length&&
(b=1*twoPageBook.currentPage.left+(2*twoPageBook.prevPageBuffer-1),a=1*twoPageBook.currentPage.right+(2*twoPageBook.prevPageBuffer-1),images.deleteImageFromStack(a),images.deleteImageFromStack(b),el.del(a+"x"+b),delete bm.rasterize.imgData[a],preloader.deletePreloader(a),preloader.deletePreloader(b)),twoPageBook.currentPage.left-=2,twoPageBook.currentPage.right-=2,twoPageBook.shadow.reDraw("prev"),a=1*twoPageBook.currentPage.right-twoPageBook.prevPageBuffer,el.id(a)||twoPageBook.drawPage(a,el.id("bookLandscape"),
"right"),pageMediator.change(),timer.setBlockTime(twoPageBook.flipSpeed/2,twoPageBook.flipSpeed))},goToPage:function(a){if(0>a)a=1;else if(a>bookData.pageCount)a=bookData.pageCount;if(bookData.rightToLeftMode)if(a==twoPageBook.currentPage.left||a==twoPageBook.currentPage.right)pageMediator.change();else if(a==1*twoPageBook.currentPage.left+1||a==1*twoPageBook.currentPage.left+2)twoPageBook.next();else if(a==1*twoPageBook.currentPage.right-1||a==1*twoPageBook.currentPage.right-2)twoPageBook.prev();
else{if(0<a&&a<=bookData.pageCount&&zoomLock.check()&&timer.check("fx")){bm.rasterize.imgData={};if(a>twoPageBook.currentPage.left){if(a==bookData.pageCount&&0==a%2){b=1;for(c=2*twoPageBook.nextPageBuffer;b<c;b+=2)d=1*twoPageBook.currentPage.left+1*b+1+"x"+(1*twoPageBook.currentPage.left+1*b+2),el.id(d)&&el.del(d),d=null;c=el.id("canvas"+(1*twoPageBook.currentPage.left+1));c=c.getContext("2d");c.fillStyle="rgb(255,255,255)";c.fillRect(0,0,twoPageBook.bookWidth/2,twoPageBook.bookHeight);c=null;preloader.add(1*
twoPageBook.currentPage.left+1);preloader.setSpecial(1*twoPageBook.currentPage.left+1)}else for(b=1;2>=b;b++)c=el.id("canvas"+(1*twoPageBook.currentPage.left+b)),c=c.getContext("2d"),c.fillStyle="rgb(255,255,255)",c.fillRect(0,0,twoPageBook.bookWidth/2,twoPageBook.bookHeight),images.drawShadow(c,1*twoPageBook.currentPage.left+b),c=null,preloader.add(1*twoPageBook.currentPage.left+b),preloader.setSpecial(1*twoPageBook.currentPage.left+b);twoPageBook.flipFxCurrentPage(twoPageBook.currentPage.left);
twoPageBook.pageConverter(a);twoPageBook.shadow.reDraw("prev");pageMediator.change()}else if(a<twoPageBook.currentPage.right){if(1==a){b=1;for(c=2*twoPageBook.prevPageBuffer;b<c;b+=2)d=1*twoPageBook.currentPage.right-(1*b+2)+"x"+(1*twoPageBook.currentPage.right-(1*b+1)),el.id(d)&&el.del(d),d=null;c=el.id("canvas"+(1*twoPageBook.currentPage.right-1));c=c.getContext("2d");c.fillStyle="rgb(255,255,255)";c.fillRect(0,0,twoPageBook.bookWidth/2,twoPageBook.bookHeight);preloader.add(1*twoPageBook.currentPage.right-
1);preloader.setSpecial(1*twoPageBook.currentPage.right-1);c=c=null}else for(b=1;2>=b;b++)c=el.id("canvas"+(twoPageBook.currentPage.right-b)),c=c.getContext("2d"),c.fillStyle="rgb(255,255,255)",c.fillRect(0,0,twoPageBook.bookWidth/2,twoPageBook.bookHeight),images.drawShadow(c,twoPageBook.currentPage.right-b),preloader.add(twoPageBook.currentPage.right-b),preloader.setSpecial(twoPageBook.currentPage.right-b),c=c=null;twoPageBook.flipFxCurrentPage(twoPageBook.currentPage.right);twoPageBook.pageConverter(a);
twoPageBook.shadow.reDraw("next");pageMediator.change()}window.setTimeout(function(){preloader.stopAll();el.del("bookLandscape");twoPageBook.draw(a)},twoPageBook.flipSpeed+100);timer.setBlockTime(twoPageBook.flipSpeed/2,twoPageBook.flipSpeed)}}else if(a==twoPageBook.currentPage.left||a==twoPageBook.currentPage.right)pageMediator.change();else if(a==1*twoPageBook.currentPage.right+1||a==1*twoPageBook.currentPage.right+2)twoPageBook.next();else if(a==1*twoPageBook.currentPage.left-1||a==1*twoPageBook.currentPage.left-
2)twoPageBook.prev();else if(0<a&&a<=bookData.pageCount&&zoomLock.check()&&timer.check("fx")){bm.rasterize.imgData={};if(a>twoPageBook.currentPage.right){if(a==bookData.pageCount&&0==a%2){for(var b=1,c=2*(twoPageBook.nextPageBuffer-1);b<c;b+=2){var d=1*twoPageBook.currentPage.right+1*b+1+"x"+(1*twoPageBook.currentPage.right+1*b+2);el.del(d);d=null}c=el.id("canvas"+(1*twoPageBook.currentPage.right+1));c=c.getContext("2d");c.fillStyle="rgb(255,255,255)";c.fillRect(0,0,twoPageBook.bookWidth/2,twoPageBook.bookHeight);
c=null;preloader.add(1*twoPageBook.currentPage.right+1);preloader.setSpecial(1*twoPageBook.currentPage.right+1)}else for(b=1;2>=b;b++)c=el.id("canvas"+(1*twoPageBook.currentPage.right+b)),c=c.getContext("2d"),c.fillStyle="rgb(255,255,255)",c.fillRect(0,0,twoPageBook.bookWidth/2,twoPageBook.bookHeight),images.drawShadow(c,1*twoPageBook.currentPage.right+b),c=null,preloader.add(1*twoPageBook.currentPage.right+b),preloader.setSpecial(1*twoPageBook.currentPage.right+b);twoPageBook.flipFxCurrentPage(twoPageBook.currentPage.right);
twoPageBook.pageConverter(a);twoPageBook.shadow.reDraw("next");pageMediator.change()}else if(a<twoPageBook.currentPage.left){if(1==a){b=1;for(c=2*twoPageBook.prevPageBuffer;b<c;b+=2)d=1*twoPageBook.currentPage.left-(1*b+2)+"x"+(1*twoPageBook.currentPage.left-(1*b+1)),el.id(d)&&el.del(d),d=null;c=el.id("canvas"+(1*twoPageBook.currentPage.left-1));c=c.getContext("2d");c.fillStyle="rgb(255,255,255)";c.fillRect(0,0,twoPageBook.bookWidth/2,twoPageBook.bookHeight);preloader.add(1*twoPageBook.currentPage.left-
1);preloader.setSpecial(1*twoPageBook.currentPage.left-1);c=c=null}else for(b=1;2>=b;b++)c=el.id("canvas"+(twoPageBook.currentPage.left-b)),c=c.getContext("2d"),c.fillStyle="rgb(255,255,255)",c.fillRect(0,0,twoPageBook.bookWidth/2,twoPageBook.bookHeight),images.drawShadow(c,twoPageBook.currentPage.left-b),preloader.add(twoPageBook.currentPage.left-b),preloader.setSpecial(twoPageBook.currentPage.left-b),c=c=null;twoPageBook.flipFxCurrentPage(twoPageBook.currentPage.left);twoPageBook.pageConverter(a);
twoPageBook.shadow.reDraw("prev");pageMediator.change()}window.setTimeout(function(){preloader.stopAll();el.del("bookLandscape");twoPageBook.draw(a)},twoPageBook.flipSpeed+100);timer.setBlockTime(twoPageBook.flipSpeed/2,twoPageBook.flipSpeed)}},flipFxCurrentPage:function(a){if(bookData.rightToLeftMode)0!=a%2&&twoPageBook.installed&&twoPageBook.currentPage.left<bookData.pageCount?(system.device.android?(b=el.id(this.currentPage.left+"x"+(1*this.currentPage.left+1)),"rotateY(0deg)"==b.style.webkitTransform?
(c=a==bookData.pageCount-1?"rotateY(179."+(1E4-(bookData.pageCount-a))+"deg)":"rotateY(-179."+(1E4-a)+"deg)",d="0% 0%"):(c="rotateY(0deg)",d="100% 100%")):(b=el.id(this.currentPage.left+"x"+(1*this.currentPage.left+1)),"rotate3d(0, -1, 0, 0deg)"==b.style.webkitTransform||"rotate3d(0, 1, 0, 0deg)"==b.style.webkitTransform?(c=1==a?"rotate3d(0, 1, 0, 180deg)":"rotate3d(0, 1, 0, 179."+(1E4-(bookData.pageCount+a))+"deg)",d="100% 100%"):(c="rotate3d(0, 1, 0, 0deg)",d="0% 0%")),e=1*twoPageBook.currentPage.left+
1):twoPageBook.installed&&0<twoPageBook.currentPage.right&&(system.device.android?(b=el.id(this.currentPage.right-1+"x"+this.currentPage.right),"rotateY(0deg)"==b.style.webkitTransform?(c=2==a||a==bookData.countPages?"rotateY(179."+(1E4-(bookData.pageCount+a))+"deg)":"rotateY( 179."+(1E4-(bookData.pageCount+a))+"deg)",d="100% 100%"):(c="rotateY(0deg)",d="0% 0%")):(b=el.id(this.currentPage.right-1+"x"+this.currentPage.right),"rotate3d(0, 1, 0, 0deg)"==b.style.webkitTransform||"rotate3d(0, -1, 0, 0deg)"==
b.style.webkitTransform?(c="rotate3d(0, -1, 0, 179."+(1E4+a)+"deg)",d="0% 0%"):(c="rotate3d(0, -1, 0, 0deg)",d="100% 100%")),e=bookData.pageCount-this.currentPage.right);else if(0!=a%2&&twoPageBook.installed&&twoPageBook.currentPage.right<bookData.pageCount){if(system.device.android){var b=el.id(this.currentPage.right+"x"+(1*this.currentPage.right+1));if("rotateY(0deg)"==b.style.webkitTransform)var c=a==bookData.pageCount-1?"rotateY(-179."+(1E4-a)+"deg)":"rotateY(-179."+(1E4-a)+"deg)",d="0% 0%";else c=
"rotateY(0deg)",d="100% 100%"}else b=el.id(this.currentPage.right+"x"+(1*this.currentPage.right+1)),"rotate3d(0, 1, 0, 0deg)"==b.style.webkitTransform||"rotate3d(0, -1, 0, 0deg)"==b.style.webkitTransform?(c="rotate3d(0, -1, 0, 179."+(1E4-a)+"deg)",d="0% 0%"):(c="rotate3d(0, -1, 0, 0deg)",d="100% 100%");var e=1*twoPageBook.currentPage.right+1}else twoPageBook.installed&&0<twoPageBook.currentPage.left&&(system.device.android?(b=el.id(this.currentPage.left-1+"x"+this.currentPage.left),"rotateY(0deg)"==
b.style.webkitTransform?(c=2==a||a==bookData.pageCount?"rotateY(180deg)":"rotateY( 179."+(1E4-(bookData.pageCount-a))+"deg)",d="100% 100%"):(c="rotateY(0deg)",d="0% 0%")):(b=el.id(this.currentPage.left-1+"x"+this.currentPage.left),"rotate3d(0, -1, 0, 0deg)"==b.style.webkitTransform||"rotate3d(0, 1, 0, 0deg)"==b.style.webkitTransform?(c=a==bookData.pageCount?"rotate3d(0, 1, 0, 180deg)":"rotate3d(0, 1, 0, 179."+(1E4-(bookData.pageCount-a))+"deg)",d="100% 100%"):(c="rotate3d(0, 1, 0, 0deg)",d="0% 0%")),
e=bookData.pageCount-this.currentPage.left);b.style.webkitTransform=c+"";b.style.webkitTransformOrigin=d+"";b.style.webkitTransitionTimingFunction="cubic-bezier(0, 0, 1, 0.95)";b.style.webkitTransitionDuration=this.flipSpeed+"ms";var f=function(){b.style.zIndex=e+"";for(var a=b.getElementsByTagName("*"),g=0;g<a.length;g++)a[g].style.zIndex="1"===a[g].style.zIndex?"-1":"1";delete b;e=c=d=b=null;delete f};window.setTimeout(f,twoPageBook.flipSpeed/2);a=null},destroy:function(){preloader.stopAll();el.del("bookLandscape");
twoPageBook.installed=!1},goToZoom:function(a){if(zoomLock.check()){var b=a.target.id;if(b=="canvas"+twoPageBook.currentPage.left)var c=twoPageBook.currentPage.left,d=0,e=twoPageBook.bookWidth/4;else if(b=="canvas"+twoPageBook.currentPage.right)c=twoPageBook.currentPage.right,d=twoPageBook.bookWidth/2,e=-(twoPageBook.bookWidth/4);var f=system.device.width()/(twoPageBook.bookWidth/2),b=Math.sqrt(52E5/(twoPageBook.bookWidth/2*twoPageBook.bookHeight)),h=a.target,f=f>b?b:f;h.style.left=d+"px";el.id("bookLandscape").appendChild(h);
if("rotateY(180deg)"==h.style.webkitTransform)h.style.webkitTransform="rotateY(0deg)";h.style.zIndex="500";var g=function(){h.style.webkitTransitionDuration=zoomBook.zoomIOSpeed+"ms";h.style.webkitTransform=system.device.android?"translate("+e+"px, 0px) scale("+f+","+f+")":"translate3d("+e+"px, 0px, 2px) scale3d("+f+","+f+",1)";delete g};window.setTimeout(g,1);var j=function(){el.id("canvas"+c).id="zoomedPage";zoomBook.draw(c,f,twoPageBook.bookWidth/2,twoPageBook.bookHeight);delete j};GAEnable&&(a=
window.location.pathname.split("/"),_trackEvent(a[a.length-4]+"","Zooming","page"+c));window.setTimeout(j,zoomBook.zoomIOSpeed+10)}},gestureStart:function(a){if(!this.gesturePending)this.gesturePending=!0,a=a.target,twoPageBook.gestureStore.element=a.id,twoPageBook.gestureStore.left=a.style.left,twoPageBook.gestureStore.zIndex=a.style.zIndex,twoPageBook.gestureStore.webkit=a.style.webkitTransform,twoPageBook.gestureStore.parent=a.parentNode.id},gestureZoom:function(a){if(zoomLock.check()){var b=twoPageBook.gestureStore.element;
if(b=="canvas"+twoPageBook.currentPage.left)var c=0;else b=="canvas"+twoPageBook.currentPage.right&&(c=twoPageBook.bookWidth/2);a=1+(a.scale-1)/3;b=el.id(twoPageBook.gestureStore.element);b.style.left=c+"px";b.style.zIndex=5E3;el.id("bookLandscape").appendChild(b);if("rotateY(180deg)"==b.style.webkitTransform)b.style.webkitTransform="rotateY(0deg)";b.style.webkitTransitionDuration="0ms";if(1<a)b.style.webkitTransform="scale3d("+a+","+a+",1) translate3d(0px, 0px, 2px)"}},gestureStop:function(a){if(zoomLock.check()&&
this.gesturePending){this.gesturePending=!1;var b=twoPageBook.gestureStore.element;if(b=="canvas"+twoPageBook.currentPage.left)var c=twoPageBook.currentPage.left,d=twoPageBook.bookWidth/4;else if(b=="canvas"+twoPageBook.currentPage.right)c=twoPageBook.currentPage.right,d=-(twoPageBook.bookWidth/4);var e=1+(a.scale-1)/3,f=el.id(twoPageBook.gestureStore.element),h=Math.sqrt(52E5/(twoPageBook.bookWidth/2*twoPageBook.bookHeight));e>h?(html5lib.duration(f,200),html5lib.transform(f,{translate:{x:d,y:0,
z:2},scale:{x:h,y:h,z:h}}),window.setTimeout(function(){el.id("canvas"+c).id="zoomedPage";zoomBook.draw(c,h,twoPageBook.bookWidth/2,twoPageBook.bookHeight)},200)):1.2>e?(html5lib.duration(f,200),html5lib.scale(f,1,1,1),window.setTimeout(function(){f.style.left=twoPageBook.gestureStore.left;f.style.zIndex=twoPageBook.gestureStore.zIndex;f.style.webkitTransform=twoPageBook.gestureStore.webkit;el.id(twoPageBook.gestureStore.parent).appendChild(f)},200)):(html5lib.duration(f,200),html5lib.transform(f,
{translate:{x:d,y:0,z:2},scale:{x:e,y:e,z:e}}),window.setTimeout(function(){el.id("canvas"+c).id="zoomedPage";zoomBook.draw(c,1*e,twoPageBook.bookWidth/2,twoPageBook.bookHeight)},200))}}};
twoPageBook.shadow={shadowSize:3,draw:function(){if(!system.device.publisher.isOn)if(bookData.rightToLeftMode)if(1==twoPageBook.currentPage.left){if(el.id("3x4"))el.id("3x4").style.webkitBoxShadow="0px 0px "+this.shadowSize+"px #000"}else if(twoPageBook.currentPage.right==bookData.pageCount){if(a=bookData.pageCount-3+"x"+(bookData.pageCount-2),el.id(a))el.id(a).style.webkitBoxShadow="0px 0px "+this.shadowSize+"px #000"}else{if(el.id("bookLandscape"))el.id("bookLandscape").style.webkitBoxShadow="0px 0px "+
this.shadowSize+"px #000"}else if(1==twoPageBook.currentPage.right){if(el.id("3x4"))el.id("3x4").style.webkitBoxShadow="0px 0px "+this.shadowSize+"px #000"}else if(twoPageBook.currentPage.left==bookData.pageCount){var a=bookData.pageCount-3+"x"+(bookData.pageCount-2);if(el.id(a))el.id(a).style.webkitBoxShadow="0px 0px "+this.shadowSize+"px #000"}else if(el.id("bookLandscape"))el.id("bookLandscape").style.webkitBoxShadow="0px 0px "+this.shadowSize+"px #000"},erase:function(){if(!system.device.publisher.isOn){if(el.id("3x4"))el.id("3x4").style.webkitBoxShadow=
"0px 0px 0px #000";var a=bookData.pageCount-3+"x"+(bookData.pageCount-2);if(el.id(a))el.id(a).style.webkitBoxShadow="0px 0px 0px #000";if(el.id("bookLandscape"))el.id("bookLandscape").style.webkitBoxShadow="0px 0px 0px #000"}},reDraw:function(a){if(bookData.rightToLeftMode)if(2==twoPageBook.currentPage.right)"next"==a?window.setTimeout(function(){twoPageBook.shadow.erase();twoPageBook.shadow.draw()},twoPageBook.flipSpeed):"prev"==a&&(5<bookData.pageCount?(this.erase(),this.draw()):window.setTimeout(function(){twoPageBook.shadow.erase();
twoPageBook.shadow.draw()},twoPageBook.flipSpeed));else if(twoPageBook.currentPage.right+2==bookData.pageCount)"prev"==a?window.setTimeout(function(){twoPageBook.shadow.erase();twoPageBook.shadow.draw()},twoPageBook.flipSpeed):"next"==a&&(this.erase(),this.draw());else{if(1==twoPageBook.currentPage.left||twoPageBook.currentPage.right==bookData.pageCount)this.erase(),this.draw()}else if(2==twoPageBook.currentPage.left)"next"==a?window.setTimeout(function(){twoPageBook.shadow.erase();twoPageBook.shadow.draw()},
twoPageBook.flipSpeed):"prev"==a&&(5<bookData.pageCount?(this.erase(),this.draw()):window.setTimeout(function(){twoPageBook.shadow.erase();twoPageBook.shadow.draw()},twoPageBook.flipSpeed));else if(twoPageBook.currentPage.left+2==bookData.pageCount)"prev"==a?window.setTimeout(function(){twoPageBook.shadow.erase();twoPageBook.shadow.draw()},twoPageBook.flipSpeed):"next"==a&&(this.erase(),this.draw());else if(1==twoPageBook.currentPage.right||twoPageBook.currentPage.left==bookData.pageCount)this.erase(),
this.draw()}};
twoPageBook.events={tapCount:0,clickCount:0,doubleTapTime:250,doubleClickTime:250,leftAndRightArea:0.15,gesturePending:!1,touchPending:!1,touchStart:function(a){this.touchPending="bookLandscape"!=a.target.parentNode.parentNode.id?!0:!1;this.gesturePending||("CANVAS"==a.target.tagName&&links.drawRect(a),delete a)},touchMove:function(a){if(links.isLinkBool&&!this.gesturePending){var b=a.targetTouches[0].pageY-eventManager.touchStartCoordinate.y;(10<Math.abs(a.targetTouches[0].pageX-eventManager.touchStartCoordinate.x)||10<
Math.abs(b))&&links.clearRect()}delete a},touchEnd:function(a){this.touchPending=!1;this.gesturePending||(-50>eventManager.touchStartCoordinate.x-a.changedTouches[0].pageX?twoPageBook.events.flipRight():50<eventManager.touchStartCoordinate.x-a.changedTouches[0].pageX?twoPageBook.events.flipLeft():twoPageBook.events.touchManger(a));delete a},gestureStart:function(a){if(!slideShow.active&&!this.gesturePending&&!this.touchPending)this.gesturePending=!0,this.gestureTarget=a.target,twoPageBook.gestureStart(a)},
gestureChange:function(a){!slideShow.active&&!this.touchPending&&twoPageBook.gestureZoom(a)},gestureEnd:function(a){if(!slideShow.active&&!this.touchPending)twoPageBook.gestureStop(a),this.gesturePending=!1},mousedown:function(a){"CANVAS"==a.target.tagName&&links.drawRect(a);delete a},mousemove:function(a){if(links.isLinkBool){var b=a.pageY-eventManager.clickStartCoordinate.y;(10<Math.abs(a.pageX-eventManager.clickStartCoordinate.x)||10<Math.abs(b))&&links.clearRect()}delete a},mouseup:function(a){-50>
eventManager.clickStartCoordinate.x-a.pageX?twoPageBook.events.flipRight():50<eventManager.clickStartCoordinate.x-a.pageX?twoPageBook.events.flipLeft():twoPageBook.events.clickManger(a);delete a},touchManger:function(a){if(links.isLinkBool&&links.currURLs){if(links.clearRect(),links.currURLs)for(var b=0;b<links.currURLs.length;b++)window.open(links.currURLs[b])}else if(twoPageBook.events.tapCount++,1==twoPageBook.events.tapCount){var c=function(){if(1==twoPageBook.events.tapCount)twoPageBook.events.singleTap(a),
twoPageBook.events.tapCount=0;delete c};window.setTimeout(c,twoPageBook.events.doubleTapTime)}else twoPageBook.events.doubleTap(a),twoPageBook.events.tapCount=0},clickManger:function(a){if(links.isLinkBool&&links.currURLs){if(links.clearRect(),links.currURLs)for(var b=0;b<links.currURLs.length;b++)window.open(links.currURLs[b])}else if(twoPageBook.events.clickCount++,1==twoPageBook.events.clickCount){var c=function(){if(1==twoPageBook.events.clickCount)twoPageBook.events.clickCount=0,twoPageBook.events.singleClick(a);
delete c};window.setTimeout(c,twoPageBook.events.doubleClickTime)}else twoPageBook.events.doubleClick(a),twoPageBook.events.clickCount=0},singleTap:function(a){links.isLinkBool?(links.clearRect(),links.currGoPage&&twoPageBook.goToPage(links.currGoPage)):a.changedTouches[0].pageX<system.device.width()*twoPageBook.events.leftAndRightArea/system.browser.scale?bookData.rightToLeftMode?twoPageBook.next():twoPageBook.prev():a.changedTouches[0].pageX>system.device.width()*(1-twoPageBook.events.leftAndRightArea)/
system.browser.scale?bookData.rightToLeftMode?twoPageBook.prev():twoPageBook.next():toolbar.toogle();delete a},doubleTap:function(a){slideShow.active||(links.isLinkBool&&links.clearRect(),"CANVAS"==a.target.tagName&&twoPageBook.goToZoom(a))},singleClick:function(a){links.isLinkBool?(links.clearRect(),links.currGoPage&&twoPageBook.goToPage(links.currGoPage)):(a.x<system.device.width()*twoPageBook.events.leftAndRightArea/system.browser.scale?bookData.rightToLeftMode?twoPageBook.next():twoPageBook.prev():
a.x>system.device.width()*(1-twoPageBook.events.leftAndRightArea)/system.browser.scale?bookData.rightToLeftMode?twoPageBook.prev():twoPageBook.next():toolbar.toogle(),delete a,a=null);delete a},doubleClick:function(a){slideShow.active||(links.isLinkBool&&links.clearRect(),"CANVAS"==a.target.tagName&&twoPageBook.goToZoom(a))},flipLeft:function(){bookData.rightToLeftMode?twoPageBook.prev():twoPageBook.next()},flipRight:function(){bookData.rightToLeftMode?twoPageBook.next():twoPageBook.prev()}};
var workspace={draw:function(){var a=system.device.width()+"px",b=system.device.height()+"px";el.id("mainFrame").style.width=a;el.id("mainFrame").style.height=b;el.id("body").style.width=a;el.id("body").style.height=b},reDraw:function(){if(slideShow.active)slideShow.active=!1;workspace.draw()}};"undefined"==typeof XML&&(XML=function(){});XML.ObjTree=function(){return this};XML.ObjTree.prototype.xmlDecl='<?xml version="1.0" encoding="UTF-8" ?>\n';XML.ObjTree.prototype.attr_prefix="-";
XML.ObjTree.prototype.overrideMimeType="text/xml";XML.ObjTree.prototype.parseXML=function(a){var b;if(window.DOMParser){b=new DOMParser;a=b.parseFromString(a,"application/xml");if(!a)return;b=a.documentElement}else if(window.ActiveXObject)b=new ActiveXObject("Microsoft.XMLDOM"),b.async=!1,b.loadXML(a),b=b.documentElement;return!b?void 0:this.parseDOM(b)};
XML.ObjTree.prototype.parseHTTP=function(a,b,c){var d={},e;for(e in b)d[e]=b[e];if(!d.method)d.method="undefined"==typeof d.postBody&&"undefined"==typeof d.postbody&&"undefined"==typeof d.parameters?"get":"post";if(c){d.asynchronous=!0;var f=this,h=d.onComplete;d.onComplete=function(a){var b;a&&a.responseXML&&a.responseXML.documentElement?b=f.parseDOM(a.responseXML.documentElement):a&&a.responseText&&(b=f.parseXML(a.responseText));c(b,a);h&&h(a)}}else d.asynchronous=!1;var g;if("undefined"!=typeof HTTP&&
HTTP.Request){if(d.uri=a,a=new HTTP.Request(d))g=a.transport}else if("undefined"!=typeof Ajax&&Ajax.Request&&(a=new Ajax.Request(a,d)))g=a.transport;if(c)return g;if(g&&g.responseXML&&g.responseXML.documentElement)return this.parseDOM(g.responseXML.documentElement);if(g&&g.responseText)return this.parseXML(g.responseText)};
XML.ObjTree.prototype.parseDOM=function(a){if(a){this.__force_array={};if(this.force_array)for(var b=0;b<this.force_array.length;b++)this.__force_array[this.force_array[b]]=1;b=this.parseElement(a);this.__force_array[a.nodeName]&&(b=[b]);if(11!=a.nodeType){var c={};c[a.nodeName]=b;b=c}return b}};
XML.ObjTree.prototype.parseElement=function(a){if(7!=a.nodeType){if(3==a.nodeType||4==a.nodeType)return null==a.nodeValue.match(/[^\x00-\x20]/)?void 0:a.nodeValue;var b,c={};if(a.attributes&&a.attributes.length){b={};for(var d=0;d<a.attributes.length;d++){var e=a.attributes[d].nodeName;if("string"==typeof e){var f=a.attributes[d].nodeValue;f&&(e=this.attr_prefix+e,"undefined"==typeof c[e]&&(c[e]=0),c[e]++,this.addNode(b,e,c[e],f))}}}if(a.childNodes&&a.childNodes.length){e=!0;b&&(e=!1);for(d=0;d<a.childNodes.length&&
e;d++)f=a.childNodes[d].nodeType,3==f||4==f||(e=!1);if(e){b||(b="");for(d=0;d<a.childNodes.length;d++)b+=a.childNodes[d].nodeValue}else{b||(b={});for(d=0;d<a.childNodes.length;d++)if(e=a.childNodes[d].nodeName,"string"==typeof e&&(f=this.parseElement(a.childNodes[d])))"undefined"==typeof c[e]&&(c[e]=0),c[e]++,this.addNode(b,e,c[e],f)}}return b}};
XML.ObjTree.prototype.addNode=function(a,b,c,d){this.__force_array[b]?(1==c&&(a[b]=[]),a[b][a[b].length]=d):1==c?a[b]=d:2==c?a[b]=[a[b],d]:a[b][a[b].length]=d};XML.ObjTree.prototype.writeXML=function(a){return this.xmlDecl+this.hash_to_xml(null,a)};
XML.ObjTree.prototype.hash_to_xml=function(a,b){var c=[],d=[],e;for(e in b)if(b.hasOwnProperty(e)){var f=b[e];e.charAt(0)!=this.attr_prefix?c[c.length]="undefined"==typeof f||null==f?"<"+e+" />":"object"==typeof f&&f.constructor==Array?this.array_to_xml(e,f):"object"==typeof f?this.hash_to_xml(e,f):this.scalar_to_xml(e,f):d[d.length]=" "+e.substring(1)+'="'+this.xml_escape(f)+'"'}d=d.join("");e=c.join("");"undefined"==typeof a||null==a||(e=0<c.length?e.match(/\n/)?"<"+a+d+">\n"+e+"</"+a+">\n":"<"+
a+d+">"+e+"</"+a+">\n":"<"+a+d+" />\n");return e};XML.ObjTree.prototype.array_to_xml=function(a,b){for(var c=[],d=0;d<b.length;d++){var e=b[d];c[c.length]="undefined"==typeof e||null==e?"<"+a+" />":"object"==typeof e&&e.constructor==Array?this.array_to_xml(a,e):"object"==typeof e?this.hash_to_xml(a,e):this.scalar_to_xml(a,e)}return c.join("")};XML.ObjTree.prototype.scalar_to_xml=function(a,b){return"#text"==a?this.xml_escape(b):"<"+a+">"+this.xml_escape(b)+"</"+a+">\n"};
XML.ObjTree.prototype.xml_escape=function(a){return(""+a).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")};
var zoomBook={currentPage:0,installed:!1,verticalScroll:!1,horizontalScroll:!1,noFreeze:!1,pageAreaWidth:0,pageAreaHeight:0,pageWidth:0,pageHeight:0,topShift:0,leftShift:0,innerShift:10,translateScrollX:0,translateScrollY:0,zoomFactor:0,currentPage:0,nextPageBuffer:1,prevPageBuffer:1,slideSpeed:800,zoomIOSpeed:800,sourcePageHeight:0,sourcePageWidth:0,innerZoomState:!1,initSizes:function(a,b,c,d){this.zoomFactor=a;this.currentPage=d;this.pageWidth=b.toFixed(0);this.pageHeight=c.toFixed(0);this.pageAreaWidth=
b>system.device.width()?b+this.innerShift:system.device.width()+this.innerShift;this.pageAreaHeight=c>system.device.height()?c:system.device.height();this.pageAreaWidth=this.pageAreaWidth;this.translateScrollY=((this.pageAreaHeight-system.device.height())/2).toFixed(0);this.translateScrollX=((this.pageAreaWidth-system.device.width())/2).toFixed(0);this.topShift=((system.device.height()-c)/2).toFixed(0);this.leftShift=((system.device.width()-b)/2).toFixed(0);b.toFixed(0)>=system.device.width()?(this.horizontalScroll=
!0,this.leftShift=0):(this.horizontalScroll=!1,this.translateScrollX=0);c.toFixed(0)>system.device.height()?(this.verticalScroll=!0,this.topShift=0):(this.verticalScroll=!1,this.translateScrollY=0);this.translateX=this.pageAreaWidth*(this.currentPage-1)+1*this.translateScrollX},draw:function(a,b,c,d,e,f){preloader.stopAll();zoomBook.noFreeze?zoomBook.noFreeze=!1:zoomLock.lock();b=b||this.zoomFactor;bookData.size.proportions<system.device.proportions()?(onePageBook.bookHeight=(system.device.height()-
onePageBook.padding).toFixed(0),onePageBook.bookWidth=(onePageBook.bookHeight*bookData.size.proportions).toFixed(0)):(onePageBook.bookWidth=system.device.width()-onePageBook.padding,onePageBook.bookHeight=(onePageBook.bookWidth/bookData.size.proportions).toFixed(0));this.sourcePageWidth=c||onePageBook.bookWidth;this.sourcePageHeight=d||onePageBook.bookHeight;pageWidth=this.sourcePageWidth*b;pageHeight=this.sourcePageHeight*b;this.initSizes(b,pageWidth,pageHeight,a);if(void 0!=e&&void 0!=f)this.translateScrollY=
f,this.translateScrollX=e+this.innerShift/2;if(!el.id("zoomBook"))b=el.add("div"),b.id="zoomBook",html5lib.perspective(b,3E3),b.style.position="absolute",b.style.width=this.pageAreaWidth+"px",b.style.height=this.pageAreaHeight+"px",b.style.zIndex=10,html5lib.backfaceVisibility(b,"hidden"),html5lib.translate(b,-(1*this.translateScrollX-this.innerShift/2),-this.translateScrollY,0),el.id("mainFrame").appendChild(b);zoomBook.installed=!0;pager.change();zoomBook.drawPage(this.currentPage);for(b=a-zoomBook.prevPageBuffer;b<=
1*a+zoomBook.nextPageBuffer;b++)b!=this.currentPage&&zoomBook.drawPage(b);buttons.slideShow.check()},drawPage:function(a){if(onePageBook.installed&&a==onePageBook.currentPage){var b=el.add("div");b.id="tmpDiv";b.className="canvasZoom";b.style.width=zoomBook.pageWidth+"px";b.style.height=zoomBook.pageHeight+"px";b.style.left=zoomBook.leftShift+"px";b.style.position="absolute";b.style.zIndex="100";html5lib.backfaceVisibility(b,"hidden");var c=bookData.rightToLeftMode?(-a+zoomBook.currentPage)*zoomBook.pageAreaWidth:
(a-zoomBook.currentPage)*zoomBook.pageAreaWidth;html5lib.translate(b,c,0,0);el.id("zoomBook").appendChild(b);b.appendChild(el.id("zoomedPage"));el.del("bookPortrait");el.id("zoomedPage").style.left=1*onePageBook.bookLeft+1*this.translateScrollX-zoomBook.innerShift/2+"px";el.id("zoomedPage").style.top=1*onePageBook.bookTop+1*this.translateScrollY+"px";preloader.insertSimpleLoader(el.id("mainFrame"),system.device.width()/2-20,system.device.height()/2-20)}if(twoPageBook.installed&&a==zoomBook.currentPage)b=
el.add("div"),b.id="tmpDiv",b.className="canvasZoom",b.style.width=zoomBook.pageWidth+"px",b.style.height=zoomBook.pageHeight+"px",b.style.left=zoomBook.leftShift+"px",b.style.position="absolute",b.style.zIndex="100",c=(a-zoomBook.currentPage)*zoomBook.pageAreaWidth,html5lib.backfaceVisibility(b,"hidden"),html5lib.translate(b,c,0,2),el.id("zoomBook").appendChild(b),b.appendChild(el.id("zoomedPage")),el.del("bookLandscape"),c=twoPageBook.bookWidth/2*zoomBook.zoomFactor<system.device.width()?(system.device.width()-
twoPageBook.bookWidth/2*zoomBook.zoomFactor)/2:0,bookData.rightToLeftMode?0==a%2?el.id("zoomedPage").style.left=1*twoPageBook.bookLeft+twoPageBook.bookWidth/2-1*c+1*this.translateScrollX-zoomBook.innerShift/2+"px":el.id("zoomedPage").style.left=1*twoPageBook.bookLeft-1*c+1*this.translateScrollX-zoomBook.innerShift/2+"px":0==a%2?el.id("zoomedPage").style.left=1*twoPageBook.bookLeft-1*c+1*this.translateScrollX-zoomBook.innerShift/2+"px":el.id("zoomedPage").style.left=1*twoPageBook.bookLeft+twoPageBook.bookWidth/
2-1*c+1*this.translateScrollX-zoomBook.innerShift/2+"px",el.id("zoomedPage").style.top=1*twoPageBook.bookTop+1*this.translateScrollY+"px",preloader.insertSimpleLoader(el.id("mainFrame"),system.device.width()/2-20,system.device.height()/2-20);if(0<a&&a<=bookData.pageCount)b=el.add("canvas"),b.id="canvas"+a,b.className="canvasZoom",b.width=zoomBook.pageWidth,b.height=zoomBook.pageHeight,b.style.left=zoomBook.leftShift+"px",b.style.top=zoomBook.topShift+"px",b.style.position="absolute",c=bookData.rightToLeftMode?
-(+a-zoomBook.currentPage)*zoomBook.pageAreaWidth:(a-zoomBook.currentPage)*zoomBook.pageAreaWidth,html5lib.backfaceVisibility(b,"hidden"),html5lib.translate(b,c,0,0),html5lib.boxShadow(b,"0px 0px 3px #000"),c=b.getContext("2d"),c.fillStyle="rgb(255,255,255)",c.fillRect(0,0,zoomBook.pageWidth,zoomBook.pageHeight),el.id("zoomBook").appendChild(b),bookData.page[a].stub?(b=el.id("canvas"+a),c=b.getContext("2d"),c.fillStyle=bookData.page[a].BGColor,c.fillRect(0,0,b.width,b.height)):images.push(a)},moveFX:function(a){for(var b=
1*zoomBook.currentPage-zoomBook.prevPageBuffer;b<=1*zoomBook.currentPage+zoomBook.nextPageBuffer;b++)if(0<b&&b<=bookData.pageCount){if(el.id("tmpDiv")&&b==zoomBook.currentPage){var c=el.id("tmpDiv"),d=1*-a*zoomBook.pageAreaWidth;html5lib.duration(c,zoomBook.slideSpeed);html5lib.translate(c,d,0,0);window.setTimeout(function(){el.del("tmpDiv")},zoomBook.slideSpeed+10);c=d=null}el.id("canvas"+b)&&(c=el.id("canvas"+b),d=bookData.rightToLeftMode?(-b+zoomBook.currentPage-1*a)*zoomBook.pageAreaWidth:(b-
zoomBook.currentPage-1*a)*zoomBook.pageAreaWidth,html5lib.duration(c,zoomBook.slideSpeed),html5lib.translate(c,d,0,0),c=d=null);this.adjustmentFX()}},adjustmentFX:function(){this.translateScrollX=this.translateScrollY=0;var a=el.id("zoomBook");html5lib.duration(a,zoomBook.slideSpeed);html5lib.translate(a,-this.translateScrollX,-this.translateScrollY,0)},next:function(){if(zoomLock.check()&&zoomBook.currentPage<bookData.pageCount&&timer.check("fx")){bookData.rightToLeftMode?zoomBook.moveFX(-1):zoomBook.moveFX(1);
zoomBook.currentPage++;pager.change();var a=function(){var b=zoomBook.currentPage-zoomBook.prevPageBuffer-1;el.id("canvas"+b)&&el.del("canvas"+b);images.deleteImageFromStack(b);preloader.deletePreloader(b);delete a;zoomBook.drawPage(1*zoomBook.currentPage+zoomBook.nextPageBuffer)};window.setTimeout(a,zoomBook.slideSpeed);timer.setBlockTime(zoomBook.slideSpeed/2,zoomBook.slideSpeed)}},prev:function(){if(zoomLock.check()&&1<zoomBook.currentPage&&timer.check("fx")){bookData.rightToLeftMode?zoomBook.moveFX(1):
zoomBook.moveFX(-1);zoomBook.currentPage--;pager.change();var a=function(){var b=1*zoomBook.currentPage+1*zoomBook.nextPageBuffer+1;el.id("canvas"+b)&&el.del("canvas"+b);images.deleteImageFromStack(b);preloader.deletePreloader(b);delete a;zoomBook.drawPage(1*zoomBook.currentPage-zoomBook.prevPageBuffer)};window.setTimeout(a,zoomBook.slideSpeed);timer.setBlockTime(zoomBook.slideSpeed/2,zoomBook.slideSpeed)}},destroy:function(){preloader.stopAll();el.del("zoomBook")},goToPage:function(a){if(0>a)a=1;
else if(a>bookData.pageCount)a=bookData.pageCount;if(a==zoomBook.currentPage)pageMediator.change();else if(a==1*zoomBook.currentPage+1)bookData.rightToLeftMode?zoomBook.prev():zoomBook.next();else if(a==1*zoomBook.currentPage-1)bookData.rightToLeftMode?zoomBook.next():zoomBook.prev();else if(0<a&&a<=bookData.pageCount&&zoomLock.check()&&timer.check("fx")){zoomBook.noFreeze=!0;if(1*a>1*zoomBook.currentPage){var b=1*zoomBook.currentPage+1,c=el.id("canvas"+b).getContext("2d"),b=null;c.fillStyle="rgb(255,255,255)";
c.fillRect(0,0,zoomBook.pageWidth,zoomBook.pageHeight);preloader.add(1*zoomBook.currentPage+1);preloader.setSpecial(1*zoomBook.currentPage+1);bookData.rightToLeftMode?zoomBook.moveFX(-1):zoomBook.moveFX(1)}else b=1*zoomBook.currentPage-1,c=el.id("canvas"+b).getContext("2d"),b=null,c.fillStyle="rgb(255,255,255)",c.fillRect(0,0,zoomBook.pageWidth,zoomBook.pageHeight),preloader.add(1*zoomBook.currentPage-1),preloader.setSpecial(1*zoomBook.currentPage-1),bookData.rightToLeftMode?zoomBook.moveFX(1):zoomBook.moveFX(-1);
zoomBook.currentPage=a;pager.change();var d=function(){zoomBook.destroy();zoomBook.draw(a,zoomBook.zoomFactor,zoomBook.sourcePageWidth,zoomBook.sourcePageHeight);zoomBook.adjustmentFX();delete d},c=null;window.setTimeout(d,zoomBook.slideSpeed)}},scroll:function(a,b){if(zoomLock.check()){if(this.horizontalScroll)if(this.translateScrollX-a>this.pageWidth-system.device.width())var c=this.pageWidth-system.device.width()-this.translateScrollX,a=-(c-(a+c)/2);else 0>this.translateScrollX-a&&(a=1*this.translateScrollX-
(1*this.translateScrollX-a)/3);else a=0;this.verticalScroll?this.translateScrollY-b>this.pageHeight-system.device.height()?(c=this.pageHeight-system.device.height()-this.translateScrollY,b=-(c-(b+c)/2)):0>this.translateScrollY-b&&(b=1*this.translateScrollY-(1*this.translateScrollY-b)/3):b=0;c=el.id("zoomBook");html5lib.duration(c,0);html5lib.translate(c,1*-this.translateScrollX+1*a,1*-this.translateScrollY+1*b,0)}},scrollEnd:function(a,b){if(zoomLock.check()){var c=this.horizontalScroll?system.device.ipad?
-300:-125:system.device.ipad?-130:-50;if(this.translateScrollX-a>this.pageWidth-system.device.width()&&a<c&&this.currentPage!=bookData.pageCount)bookData.rightToLeftMode?zoomBook.prev():zoomBook.next();else if(0>this.translateScrollX-a&&1!=this.currentPage&&1*this.translateScrollX-a<c)bookData.rightToLeftMode?zoomBook.next():zoomBook.prev();else{if(this.verticalScroll)this.translateScrollY=this.translateScrollY-b>this.pageHeight-system.device.height()?this.pageHeight-system.device.height():0>this.translateScrollY-
b?0:this.translateScrollY-b;if(this.horizontalScroll)this.translateScrollX=this.translateScrollX-a>this.pageWidth-system.device.width()?this.pageWidth-system.device.width():0>this.translateScrollX-a?0:this.translateScrollX-a;c=el.id("zoomBook");html5lib.duration(c,300);html5lib.translate(c,-this.translateScrollX,-this.translateScrollY,0)}maxDeltaX=null}},zoomOutOnePage:function(a,b){bookData.size.proportions<system.device.proportions()?(onePageBook.bookHeight=(system.device.height()-onePageBook.padding).toFixed(0),
onePageBook.bookWidth=(onePageBook.bookHeight*bookData.size.proportions).toFixed(0)):(onePageBook.bookWidth=system.device.width()-onePageBook.padding,onePageBook.bookHeight=(onePageBook.bookWidth/bookData.size.proportions).toFixed(0));var c=onePageBook.bookWidth/zoomBook.pageWidth,d=zoomBook.verticalScroll?(zoomBook.pageHeight-system.device.height())/2:0,e=zoomBook.horizontalScroll?(zoomBook.pageWidth-system.device.width())/2:0;zoomEl=el.id("canvas"+zoomBook.currentPage);html5lib.duration(el.id("zoomBook"),
zoomBook.zoomIOSpeed);"standart"===b&&html5lib.translate(el.id("zoomBook"),-e,-d,0);html5lib.duration(zoomEl,zoomBook.zoomIOSpeed);"standart"===b&&html5lib.scale(zoomEl,c,c,1);var f=function(){zoomBook.destroyOtherPages();el.id("zoomBook").id="exZoomBook";el.id("exZoomBook").style.zIndex=1E4;el.id("canvas"+zoomBook.currentPage).id="sd";preloader.insertSimpleLoader(el.id("mainFrame"),system.device.width()/2-20,system.device.height()/2-20);zoomBook.innerZoomState=!0;zoomBook.installed=!1;buttons.slideShow.check();
onePageBook.draw(zoomBook.currentPage);delete f},d=e=c=null;window.setTimeout(f,zoomBook.zoomIOSpeed+50)},zoomOutTwoPage:function(a,b){2*bookData.size.proportions<system.device.proportions()?(twoPageBook.bookWidth=((system.device.height()-twoPageBook.padding)*2*bookData.size.proportions).toFixed(0),twoPageBook.bookHeight=(system.device.height()-twoPageBook.padding).toFixed(0)):(twoPageBook.bookWidth=system.device.width()-twoPageBook.padding,twoPageBook.bookHeight=((system.device.width()-twoPageBook.padding)/
(2*bookData.size.proportions)).toFixed(0));var c=twoPageBook.bookWidth/2/zoomBook.pageWidth,d=zoomBook.verticalScroll?(zoomBook.pageHeight-system.device.height())/2:0,e=zoomBook.horizontalScroll?(zoomBook.pageWidth-system.device.width())/2:0,e=0==zoomBook.currentPage%2&&!bookData.rightToLeftMode?e+twoPageBook.bookWidth/4:0==zoomBook.currentPage%2&&bookData.rightToLeftMode?e-twoPageBook.bookWidth/4:bookData.rightToLeftMode?e+twoPageBook.bookWidth/4:e-twoPageBook.bookWidth/4;zoomEl=el.id("canvas"+zoomBook.currentPage);
zoomBook.destroyOtherPages();html5lib.duration(el.id("zoomBook"),zoomBook.zoomIOSpeed);"standart"===b?html5lib.translate(el.id("zoomBook"),-e,-d,0):html5lib.translate(el.id("zoomBook"),-e,-zoomBook.translateScrollY,0);html5lib.duration(zoomEl,zoomBook.zoomIOSpeed);"standart"===b&&html5lib.scale(zoomEl,c,c,1);el.id("zoomBook").style.zIndex=1E4;var f=function(){el.id("zoomBook").id="exZoomBook";el.id("canvas"+zoomBook.currentPage).id="sd";zoomBook.innerZoomState=!0;zoomBook.installed=!1;buttons.slideShow.check();
twoPageBook.draw(zoomBook.currentPage);var a=2*bookData.size.proportions<system.device.proportions()?((system.device.height()-twoPageBook.padding)*2*bookData.size.proportions).toFixed(0):system.device.width()-twoPageBook.padding;0!=zoomBook.currentPage%2&&(a=-a);preloader.insertSimpleLoader(el.id("mainFrame"),system.device.width()/2-a/4-20,system.device.height()/2-20);delete f};window.setTimeout(f,zoomBook.zoomIOSpeed+50);d=e=c=null},zoomOut:function(a,b){zoomLock.check()&&(zoomLock.lock(),b=b||"standart",
preloader.stopAll(),"one"===bookChoice.getType()?zoomBook.zoomOutOnePage(a,b):zoomBook.zoomOutTwoPage(a,b))},destroyOtherPages:function(){for(var a=1*zoomBook.currentPage+1*zoomBook.nextPageBuffer,b=zoomBook.currentPage-zoomBook.prevPageBuffer;b<=a;b++)b!=zoomBook.currentPage&&0<b&&b<=bookData.pageCount&&el.del("canvas"+b)},gestureStart:function(){if(zoomLock.check()){this.xScale=(system.device.width()/2+1*zoomBook.translateScrollX-this.innerShift/2).toFixed(0);this.yScale=(system.device.height()/
2+1*zoomBook.translateScrollY).toFixed(0);if(system.device.width()>this.pageWidth)this.xScale=(this.pageWidth/2).toFixed(0);if(system.device.height()>this.pageHeight)this.yScale=(this.pageHeight/2).toFixed(0)}},gestureZoom:function(a){if(zoomLock.check()){var b=el.id("canvas"+zoomBook.currentPage),a=(1+(a.scale-1)/2).toFixed(2);html5lib.duration(b,0);b.style.webkitTransformOrigin=this.xScale+"px "+this.yScale+"px";html5lib.scale(b,a,a,1)}},gestureStop:function(a){if(zoomLock.check()&&a.target.id==
"canvas"+zoomBook.currentPage){var b="one"===bookChoice.getType()?1.15:1.55,c=Math.sqrt(5E6/(this.pageWidth*this.pageHeight));if("two"===bookChoice.getType())if(bookData.size.proportions*bookData.size.proportions<system.device.proportions())var d=(system.device.height()-twoPageBook.padding).toFixed(0),d=d/this.pageHeight;else d=(system.device.width()-(twoPageBook.bookWidth/2+twoPageBook.padding)).toFixed(0),d/=this.pageWidth;else bookData.size.proportions<system.device.proportions()?(d=(system.device.height()-
onePageBook.padding).toFixed(0),d/=this.pageHeight):(d=(system.device.width()-onePageBook.padding).toFixed(0),d/=this.pageWidth);var e=el.id("canvas"+zoomBook.currentPage),f=this.xScale,h=this.yScale,g=(1+(a.scale-1)/2).toFixed(2);g>c?g=c:g/d<b&&(g=d);if(this.pageWidth*g<system.device.width())var a=f*g-system.device.width()/2+(system.device.width()-this.pageWidth*g)/2,j=0;else this.pageWidth*g>=system.device.width()&&0>f*g-system.device.width()/2?(a=f*g-system.device.width()/2,j=0):this.pageWidth*
g>=system.device.width()&&0<system.device.width()-(this.pageWidth*g-(f*g-system.device.width()/2))?(a=system.device.width()-(this.pageWidth*g-(f*g-system.device.width()/2)),j=f*g-system.device.width()/2-a):(a=0,j=f*g-system.device.width()/2);if(this.pageHeight*g<system.device.height())var c=h*g-system.device.height()/2+(system.device.height()-this.pageHeight*g)/2,k=0;else this.pageHeight*g>=system.device.height()&&0>h*g-system.device.height()/2?(c=h*g-system.device.height()/2,k=0):this.pageHeight*
g>=system.device.height()&&0<system.device.height()-(this.pageHeight*g-(h*g-system.device.height()/2))?(c=system.device.height()-(this.pageHeight*g-(h*g-system.device.height()/2)),k=h*g-system.device.height()/2-c):(c=0,k=h*g-system.device.height()/2);0!=c&&0!=a&&(a+=5);html5lib.duration(e,150);html5lib.transform(e,{translate:{x:a,y:c,z:0},scale:{x:g,y:g,z:1}});var m=function(){zoomBook.destroyOtherPages();el.id("zoomBook").id="exZoomBook";el.id("exZoomBook").style.zIndex=1E4;preloader.insertSimpleLoader(el.id("mainFrame"),
system.device.width()/2-20,system.device.height()/2-20);el.id("canvas"+zoomBook.currentPage).id="sd";zoomBook.innerZoomState=!0;zoomBook.draw(zoomBook.currentPage,g,zoomBook.pageWidth,zoomBook.pageHeight,j,k);delete m};(g*this.pageWidth).toFixed(0)!=this.pageWidth?g/d<b?zoomBook.zoomOutFinger():window.setTimeout(m,200):g===d&&zoomBook.zoomOutFinger()}},zoomOutFinger:function(){window.setTimeout(function(){zoomBook.zoomOut(event,"inner")},200)}};
zoomBook.events={tapCount:0,clickCount:0,doubleTapTime:250,doubleClickTime:250,leftAndRightArea:0.15,gestureTarget:0,gestureStart:function(a){this.gestureTarget=a.target;zoomBook.gestureStart(a)},gestureChange:function(a){zoomBook.gestureZoom(a)},gestureEnd:function(a){zoomBook.gestureStop(a)},touchStart:function(a){"CANVAS"==a.target.tagName&&links.drawRect(a);delete a},touchMove:function(a){var b=a.targetTouches[0].pageX-eventManager.touchStartCoordinate.x,c=a.targetTouches[0].pageY-eventManager.touchStartCoordinate.y;
links.isLinkBool&&(2<Math.abs(b)||2<Math.abs(c))&&links.clearRect();zoomBook.scroll(b,c);delete a},touchEnd:function(a){2<Math.abs(eventManager.touchStartCoordinate.x-a.changedTouches[0].pageX)||2<Math.abs(eventManager.touchStartCoordinate.y-a.changedTouches[0].pageY)?zoomBook.scrollEnd(a.changedTouches[0].pageX-eventManager.touchStartCoordinate.x,a.changedTouches[0].pageY-eventManager.touchStartCoordinate.y):zoomBook.events.touchManger(a)},mousedown:function(a){"CANVAS"==a.target.tagName&&links.drawRect(a);
delete a},mousemove:function(a){var b=a.pageX-eventManager.clickStartCoordinate.x,c=a.pageY-eventManager.clickStartCoordinate.y;links.isLinkBool&&(2<Math.abs(b)||2<Math.abs(c))&&links.clearRect();zoomBook.scroll(b,c);delete a},mouseup:function(a){2<Math.abs(eventManager.clickStartCoordinate.x-a.pageX)||2<Math.abs(eventManager.clickStartCoordinate.y-a.pageY)?zoomBook.scrollEnd(a.pageX-eventManager.clickStartCoordinate.x,a.pageY-eventManager.clickStartCoordinate.y):zoomBook.events.clickManger(a)},touchManger:function(a){if(links.isLinkBool&&
links.currURLs){if(links.clearRect(),links.currURLs){for(var b=0;b<links.currURLs.length;b++)window.open(links.currURLs[b]);b=null}}else if(zoomBook.events.tapCount++,1==zoomBook.events.tapCount){var c=function(){if(1==zoomBook.events.tapCount)zoomBook.events.singleTap(a),zoomBook.events.tapCount=0;delete c};window.setTimeout(c,zoomBook.events.doubleTapTime)}else zoomBook.events.doubleTap(a),zoomBook.events.tapCount=0},clickManger:function(a){if(links.isLinkBool&&links.currURLs){if(links.clearRect(),
links.currURLs)for(var b=0;b<links.currURLs.length;b++)window.open(links.currURLs[b])}else if(zoomBook.events.clickCount++,1==zoomBook.events.clickCount){var c=function(){if(1==zoomBook.events.clickCount)zoomBook.events.singleClick(a),zoomBook.events.clickCount=0;delete c};window.setTimeout(c,zoomBook.events.doubleClickTime)}else zoomBook.events.doubleClick(a),zoomBook.events.clickCount=0},singleTap:function(a){links.isLinkBool?(links.clearRect(),links.currGoPage&&zoomBook.goToPage(links.currGoPage)):
a.changedTouches[0].pageX<system.device.width()*zoomBook.events.leftAndRightArea/system.browser.scale?bookData.rightToLeftMode?zoomBook.next():zoomBook.prev():a.changedTouches[0].pageX>system.device.width()*(1-zoomBook.events.leftAndRightArea)/system.browser.scale?bookData.rightToLeftMode?zoomBook.prev():zoomBook.next():toolbar.toogle();delete a},doubleTap:function(){links.isLinkBool&&links.clearRect();zoomBook.zoomOut()},singleClick:function(a){if(links.isLinkBool)links.clearRect(),links.currGoPage&&
zoomBook.goToPage(links.currGoPage);else{var b=system.device.publisher.isOn?system.device.width()/2:system.device.width();a.x<b*twoPageBook.events.leftAndRightArea/system.browser.scale?bookData.rightToLeftMode?zoomBook.next():zoomBook.prev():a.x>b*(1-twoPageBook.events.leftAndRightArea)/system.browser.scale?bookData.rightToLeftMode?zoomBook.prev():zoomBook.next():toolbar.toogle()}delete a},doubleClick:function(a){links.isLinkBool&&links.clearRect();zoomBook.zoomOut(a)},flipLeft:function(){bookData.rightToLeftMode?
zoomBook.prev():zoomBook.next()},flipRight:function(){bookData.rightToLeftMode?zoomBook.next():zoomBook.prev()}};var zoomLock={status:!0,lock:function(){this.status=!1},unLock:function(){this.status=!0},check:function(){return zoomLock.status}};
