// Created 12/11/2013 12:56:16 PM
var Background=function(a){this.div=el.id(a.divID);if(workspace.needIosSkin)if(-1!=a.src.indexOf("inner_bg.jpg")||-1!=a.src.indexOf("grey-inner.jpg")||-1!=a.src.indexOf("brown-outer.jpg")||-1!=a.src.indexOf("sky-blue-outer.jpg")||-1!=a.src.indexOf("woodwide.jpg")||-1!=a.src.indexOf("grunge-outer.jpg")||-1!=a.src.indexOf("jeans-outer.jpg")||-1!=a.src.indexOf("wood_inner.jpg")||""===a.src||-1!=a.src.indexOf("nature_bg.jpg")){if(-1!=a.src.indexOf("woodwide.jpg")||-1!=a.src.indexOf("wood_inner.jpg"))this.setPlacement(a.placement),
this.setImage(STYLES_FOLDER+"/darkwood/wood.jpg")}else this.setPlacement(a.placement),this.setImage(a.src);else this.setColor(a.color)};Background.prototype.setColor=function(a){this.div.style.backgroundColor=a};Background.prototype.setImage=function(a){this.div.style.backgroundImage="url("+a+")"};Background.prototype.setPlacement=function(a){var b={fit:"contain",fill:"cover",scale:"100% 100%",single:"auto",tile:"auto"};this.div.style.backgroundSize=b[a];this.div.style.webkitBackgroundSize=b[a]};
Background.prototype.setPosition=function(a){this.div.style.backgroundPosition=a.vertical+" "+a.horisontal};Background.prototype.setRepeat=function(a){this.div.style.backgroundRepeat=a.repeatX+" "+a.repeatY};
var bm={bmContent:{number:0,length:0,children:{},add:function(a){var b={};b.name=a.name;b.page=pageTable.getCaption(a.page);b.realID=a.page;this.children[this.number++]=b;this.length++;delete null},remove:function(a){for(var b in this.children)if(this.children[b].realID==a){delete this.children[b];break}this.length--;delete null}},isEmpty:function(){return!this.bmContent.length},isBookmark:function(a){for(var b in this.bmContent.children)if(this.bmContent.children[b].realID==a)return!0;return!1},
loadAllBmFromStorage:function(){var a=RegExp(publicationData.ident+"(\\d+)"),b;for(b in window.localStorage){var c=a.exec(b);c&&this.bmContent.add({page:c[1],name:window.localStorage.getItem(b)})}delete null;delete null},remBm:function(a){this.bmContent.remove(a);window.localStorage.removeItem(publicationData.ident+a);customEvents.fireEvent(REMOVE_BM)},addBm:function(a){this.bmContent.add({page:a.page,name:a.name});window.localStorage.setItem(publicationData.ident+a.page,a.name);customEvents.fireEvent(ADD_BM)}},
Button=function(a){"undefined"!=typeof a.able?this.able=a.able:this.able=!0;this.isVisible=!0;this.div=el.id(a.id);"undefined"!=typeof this.div&&null!=this.div||console.log("DIV named "+a.id+" NOT FOUND IN DOM. please check your HTML file.");this.field=el.id(a.field);workspace.addCssClass(this.div,"button");"undefined"!=typeof a.fontImage&&workspace.addCssClass(this.div,"fontImage");"undefined"!=typeof a.cssClassName&&workspace.addCssClass(this.div,a.cssClassName);workspace.addCssClass(this.div,a.id);
setClickEvents(this.div,"m");"undefined"!=typeof a.event&&this.addAction(a.event);a.pressing&&this.changePressingState(!0);this.able||this.makeDisable()};Button.prototype.makeAble=function(){this.able||(this.able=!0,workspace.delCssClass(this.div,"disable"),this.changePressingState(!0))};Button.prototype.makeDisable=function(){workspace.delCssClass(this.div,"active");workspace.addCssClass(this.div,"disable");this.able=!1;this.changePressingState(!1)};
Button.prototype.addAction=function(a,b){var c=this;if("undefined"==typeof b){var e=this.div.id;this.div.addEventListener(a,function(a){return c.able?buttonsActions[e+"Action"](a,c):!1},!1)}else this.div.addEventListener(a,function(a){if(!c.able)return!1;b(a)},!1)};
Button.prototype.changePressingState=function(a){a?(this.div.addEventListener(DOWN_EVENT,this.handlePressingStart,!1),this.div.addEventListener(MOVE_EVENT,this.handlePressingStop,!1),workspace.needIosSkin&&workspace.isTablet?!0!={shareButton:!0,downloadButton:!0,searchButton:!0,moreButton:!0,listButton:!0}[this.div.id]&&this.div.addEventListener(UP_EVENT,this.handlePressingStop,!1):this.div.addEventListener(UP_EVENT,this.handlePressingStop,!1)):(this.div.removeEventListener(DOWN_EVENT,this.handlePressingStart,
!1),this.div.removeEventListener(MOVE_EVENT,this.handlePressingStop,!1),this.div.removeEventListener(UP_EVENT,this.handlePressingStop,!1))};Button.prototype.handlePressingStart=function(){workspace.addCssClass(this,"active")};Button.prototype.handlePressingStop=function(){workspace.delCssClass(this,"active")};Button.prototype.disablePressing=function(){this.div.removeEventListener("click",arguments.callee,!1)};
Button.prototype.hide=function(){workspace.addCssClass(this.div,"invisible");this.isVisible=!1};Button.prototype.show=function(){workspace.delCssClass(this.div,"invisible");this.isVisible=!0};Button.prototype.changeTextInsideButton=function(a){for(;0<this.div.childNodes.length;)this.div.removeChild(this.div.childNodes[0]);this.div.innerHTML='<span class="'+this.div.id+'Text">'+a+"</span>"};
Button.create=function(a){var b=workspace.createElement({type:a.type,id:a.id,parent:el.id(a.field),insertBefore:a.insertBefore});"undefined"!=typeof a.text&&(b.innerHTML='<span class="'+a.id+'Text">'+a.text+"</span>");delete null;return new Button({id:a.id,field:a.field,fontImage:a.fontImage,pressing:a.pressing,cssClassName:a.cssClassName,able:a.able,event:a.event})};
var buttonsActions={closeButtonAction:function(a){},listButtonAction:function(){if(!0==workspace.popovers.tocPopover.isVisible)return!1;with(workspace.popovers.tocPopover)workspace.popovers.tocPopover.twoTabs&&"toc"!=state&&changeState("toc"),changeVisibility()},tocOverTocButtonAction:function(){with(workspace.popovers.tocPopover)"toc"!=state&&changeState("toc")},tocOverBmButtonAction:function(){with(workspace.popovers.tocPopover)"bm"!=state&&changeState("bm")},tocOverBottomMenuTocButtonAction:function(){with(workspace.popovers.tocPopover)"toc"!=
state&&changeState("toc")},tocOverBottomMenuBmButtonAction:function(){with(workspace.popovers.tocPopover)"bm"!=state&&changeState("bm")},searchButtonAction:function(){with(workspace.popovers.searchPopover)show()},cartButtonAction:function(){cartWindow.show()},prevResultButtonAction:function(){var a=publicationData.rtlMode?popoverContent.search.getNextResultPageNumber(popoverContent.search.searchResults):popoverContent.search.getPrevResultPageNumber(popoverContent.search.searchResults);0!=a&&pageMediator.goToPage(a)},
nextResultButtonAction:function(){var a=publicationData.rtlMode?popoverContent.search.getPrevResultPageNumber(popoverContent.search.searchResults):popoverContent.search.getNextResultPageNumber(popoverContent.search.searchResults);0!=a&&pageMediator.goToPage(a)},closeResultButtonAction:function(){workspace.popovers.searchPopover.redrawContent();with(workspace.toolbars.list.searchToolbar)workspace.setText(resultCount.id),workspace.setText(currentResultNumber.id);with(workspace.toolbars)list.searchToolbar.isActive=
!1,list.searchToolbar.hide(),workspace.delCssClass(list.pagerToolbar.div,"forSearch");customEvents.fireEvent(CANCEL_SEARCH)},infoButtonAction:function(){if("undefined"!=typeof workspace.popovers.helpOver){if(!0==workspace.popovers.helpOver.isVisible)return!1;workspace.existInDOM("helpOver")&&el.del("helpOver");workspace.popovers.helpOver=null;delete workspace.popovers.helpOver}workspace.popovers.helpOver=new Popover({id:"helpOver",parent:"body",horisontalPosition:"center",state:"help",deleteAfterClose:!0});
with(workspace.popovers.helpOver)addLabel({text:LOCALS.HELP,back:!1}),addContent(),workspace.isTablet&&workspace.addCssClass(div,"tablet"),reposition();window.setTimeout(function(){workspace.popovers.helpOver.show()},100)},downloadButtonAction:function(){if("undefined"!=typeof workspace.popovers.downloadOver){if(!0==workspace.popovers.downloadOver.isVisible)return!1;workspace.popovers.downloadOver=null;delete workspace.popovers.downloadOver}workspace.popovers.downloadOver=new Popover({parent:"body",
id:"downloadOver",horisontalPosition:"left",state:"download",deleteAfterClose:!0});with(workspace.popovers.downloadOver)addLabel({text:LOCALS.DOWNLOAD,back:!1}),addContent();window.setTimeout(function(){workspace.popovers.downloadOver.show()},0)},shareButtonAction:function(){if("undefined"!=typeof workspace.popovers.shareOver){if(!0==workspace.popovers.shareOver.isVisible)return!1;workspace.popovers.shareOver=null;delete workspace.popovers.shareOver}workspace.popovers.shareOver=new Popover({parent:"body",
id:"shareOver",horisontalPosition:"left",state:"share",deleteAfterClose:!0});with(workspace.popovers.shareOver)addLabel({text:LOCALS.SHARE,back:!1}),addContent();window.setTimeout(function(){workspace.popovers.shareOver.show()},0)},moreButtonAction:function(){if("undefined"!=typeof workspace.popovers.moreOver){if(!0==workspace.popovers.moreOver.isVisible)return!1;workspace.popovers.moreOver=null;delete workspace.popovers.moreOver}workspace.popovers.moreOver=new Popover({parent:"body",id:"moreOver",
horisontalPosition:"left",state:"more",deleteAfterClose:!0});with(workspace.popovers.moreOver)addLabel({text:LOCALS.MORE,back:!1}),addContent();window.setTimeout(function(){workspace.popovers.moreOver.show()},0)},addButtonAction:function(a){bm.isBookmark(pageMediator.page)?bm.remBm(pageMediator.page):setTimeout(function(){var a=system.publisher.isOn?a=LOCALS.BOOKMARK+" "+pageTable.getCaption(pageMediator.page):prompt(LOCALS.BOOKMARK_ALERT,LOCALS.BOOKMARK+" "+pageTable.getCaption(pageMediator.page));
a&&bm.addBm({page:pageMediator.page,name:fbUtils.screening(a)})},50)},slideShowButtonAction:function(){workspace.popovers.hideAll();workspace.slideShow.turnOnOff()},zoomInButtonAction:function(){customEvents.fireEvent(ZOOMIN_FROM_WORKSPACE)},zoomOutButtonAction:function(){customEvents.fireEvent(ZOOMOUT_FROM_WORKSPACE)}},Popover=function(a){this.isVisible=!1;this.shiftLevel=0;this.state=a.state;this.horisontalPosition=a.horisontalPosition||"center";this.deleteAfterClose=a.deleteAfterClose||!1;this.noAnimation=
!workspace.needIosSkin&&workspace.isTablet?!0:!1;this.submenuList=[];"undefined"!=typeof a.horisontalPosition&&(this.div=workspace.createElement({type:"div",id:a.id,cssClassName:"popover",parent:el.id(a.parent)}));workspace.isTablet&&(workspace.addCssClass(this.div,"tablet"),this.setRelatedButton(),this.drawTriangle());outerDiv=workspace.createElement({type:"div",id:a.id+"ContentOuter",cssClassName:"contentOuter",parent:this.div});workspace.isTablet&&(workspace.addCssClass(this.div,"fixedWidth"),
"help"==this.state||"notify"==this.state||workspace.needIosSkin||(workspace.addCssClass(this.div,"fixedHeightForToolbar"),workspace.needZoomTolbar()&&workspace.addCssClass(this.div,"withZoom")));this.contentDiv=workspace.createElement({type:"div",id:a.id+"ContentInner",cssClassName:"contentInner",parent:outerDiv});workspace.needIosSkin?(workspace.isMobile&&"notify"!=this.state&&workspace.addCssClass(this.div,"mobile leftShiftAnimation"),workspace.isTablet&&(workspace.addCssClass(this.div,"tablet"),
"center"==a.horisontalPosition&&workspace.addCssClass(this.div,"topAnimation"))):(workspace.isMobile&&workspace.addCssClass(this.div,"topAnimation"),workspace.isTablet&&("center"!=a.horisontalPosition?workspace.addCssClass(this.div,"leftAnimation"):workspace.addCssClass(this.div,"topAnimation")));"center"==a.horisontalPosition&&(workspace.addCssClass(this.div,"centered"),this.reposition());workspace.isMobile&&!workspace.needIosSkin&&"undefined"==typeof a.noCloseButton&&this.addCloseButton();system.publisher.isOn&&
workspace.addCssClass(this.div,"preview hide")};
Popover.prototype.addCloseButton=function(){this.closeButton=Button.create({id:this.div.id+"CloseButton",text:LOCALS.CLOSE_BUTTON,cssClassName:"closeButton",field:this.div.id,pressing:!0,insertBefore:this.div.firstChild});var a=this;this.closeButton.addAction(DOWN_EVENT,function(a){});this.closeButton.addAction(SINGLE_CLICK,function(b){a.hide()});setClickEvents(this.div,"dm");this.contentDiv.addEventListener(DOWN_EVENT,function(b){b.target.id!=a.closeButton.div.id&&a.closeButton.hide()},!1);this.contentDiv.addEventListener(UP_EVENT,
function(){a.closeButton.show()},!1);this.contentDiv.addEventListener("touchcancel",function(){a.closeButton.show()},!1);this.contentDiv.addEventListener("mouseout",function(){a.closeButton.show()},!1)};
Popover.prototype.addBlackOutDiv=function(){var a=this;this.blackout=workspace.createElement({id:"popoverBlackout",cssClassName:"popoverBlackout",parent:workspace.leftShiftContainer||el.id("body"),insertBefore:el.id("mainFrame").nextSibling});"help"==this.state&&workspace.needIosSkin&&workspace.addCssClass(this.blackout,"dark");setClickEvents(a.blackout,"dm");this.blackout.addEventListener(UP_EVENT,function(b){a.delBlackOutDiv();a.hide()})};
Popover.prototype.delBlackOutDiv=function(){"undefined"!=typeof this.blackout&&(el.del(this.blackout.id),this.blackout=null,delete this.blackout)};Popover.prototype.del=function(){var a=this.div.id;if(this.noAnimation)return el.del(a),this.delContent(),!1;var b=["transitionend","OTransitionEnd","webkitTransitionEnd"],c;for(c in b)this.div.addEventListener(b[c],function(){el.del(a)},!1);delete null};
Popover.prototype.changeLabel=function(a,b){var c={share:LOCALS.SHARE,more:LOCALS.MORE,toc:LOCALS.TOC,bm:LOCALS.BOOKMARKS};"toc"==a?(workspace.addCssClass(this.label.tocButton.div,"opened"),"undefined"!=typeof b&&this.label.tocButton.changeTextInsideButton(b),workspace.delCssClass(this.label.bmButton.div,"opened"),workspace.delCssClass(this.label.bmButton.div,"active"),workspace.addCssClass(this.label.bmButton.div,"bmButton"),workspace.delCssClass(this.label.tocButton.div,"tocButton"),workspace.needIosSkin&&
(this.label.lastChild.data=c[a]||b)):"bm"==a?(workspace.delCssClass(this.label.tocButton.div,"opened"),workspace.delCssClass(this.label.tocButton.div,"active"),"undefined"!=typeof b&&this.label.bmButton.changeTextInsideButton(b),workspace.addCssClass(this.label.bmButton.div,"opened"),workspace.addCssClass(this.label.tocButton.div,"tocButton"),workspace.delCssClass(this.label.bmButton.div,"bmButton"),workspace.needIosSkin&&(this.label.lastChild.data=c[a]||b)):(this.label.lastChild.data=c[a]||b,"undefined"!=
typeof this.labelImage&&(this.labelImage.className=this.labelImage.className.replace(/\s(\S+Button)\s/i," "+a+"Button ")))};Popover.prototype.changeState=function(a){this.state=a;this.changeLabel(a,{toc:LOCALS.TOC,bm:LOCALS.BOOKMARKS}[a]);this.delContent();this.addContent()};
Popover.prototype.addLabel=function(a){this.label=el.add("h3");this.label.setAttribute("id",this.div.id+"Label");this.label.className="buttonsField contentLabel";workspace.addCssClass(this.div,"withLabel");this.div.insertBefore(this.label,this.contentDiv.parentNode);if(!0=={share:workspace.isTablet&&!workspace.needIosSkin,download:workspace.isTablet&&!workspace.needIosSkin,search:workspace.isTablet&&!workspace.needIosSkin,help:workspace.isTablet||workspace.isMobile&&workspace.needIosSkin,bm:workspace.isTablet&&
!workspace.needIosSkin,toc:workspace.isTablet&&!workspace.needIosSkin}[this.state]){var b=this;this.label.closeButton=Button.create({id:this.div.id+"Close",cssClassName:"fontImage labelCloseButton ",field:this.label.id,pressing:!0});this.label.closeButton.addAction(UP_EVENT,function(a){b.delBlackOutDiv();b.hide()});a.twoTabs&&!bm.isEmpty()&&this.label.closeButton.hide()}!0!={share:!0,download:!0,search:!0,more:!0,bm:!a.twoTabs||workspace.needIosSkin&&workspace.isMobile,toc:!a.twoTabs||workspace.needIosSkin&&
workspace.isMobile}[this.state]||workspace.needIosSkin&&workspace.isTablet||(workspace.addCssClass(this.label,"left"),this.labelImage=workspace.createElement({type:"div",id:this.label.id+"Img",cssClassName:"button "+this.state+"Button fontImage labelImage",parent:this.label}));setClickEvents(this.label,"p");b=this;!0=={share:!0,download:!1,search:!0,more:!0,bm:!1,toc:!0}[this.state]&&workspace.needIosSkin&&(this.label.backButton=Button.create({id:this.div.id+"Back",cssClassName:"backButton",text:LOCALS.BACK,
field:this.label.id,pressing:!0,able:!1}),this.label.backButton.addAction(DOWN_EVENT,function(a){b.shiftSubmenus("back")}));if("undefined"!=typeof a.twoTabs&&a.twoTabs){this.twoTabs=!0;if(workspace.needIosSkin){workspace.addCssClass(this.div,"withBottomMenu");this.label.appendChild(document.createTextNode(""));workspace.isMobile&&workspace.createElement({id:this.div.id+"bottomMenuBg",cssClassName:"bottomMenuBg",parent:this.div}).id;a=workspace.createElement({id:this.div.id+"bottomMenu",cssClassName:"bottomMenu",
parent:this.div}).id;var c=this.div.id+"BottomMenu",e=LOCALS.BOOKMARKS}else a=this.label.id,c=this.div.id,e="";this.label.tocButton=Button.create({id:c+"TocButton",cssClassName:c+"LabelButton opened",text:LOCALS.TOC,field:a,pressing:!0,able:!0});this.label.tocButton.addAction(DOWN_EVENT);this.label.bmButton=Button.create({id:c+"BmButton",cssClassName:c+"LabelButton bmButton",text:e,field:a,pressing:!0,able:!bm.isEmpty()});this.label.bmButton.addAction(DOWN_EVENT);var f=this.label.bmButton;customEvents.addListener(ADD_BM,
function(){f.makeAble();b.changeState("bm");b.label.closeButton&&b.label.closeButton.hide()});customEvents.addListener(REMOVE_BM,function(){bm.isEmpty()?(f.makeDisable(),b.changeState("toc"),b.label.closeButton&&b.label.closeButton.show()):"bm"==b.state&&b.redrawContent()});workspace.needIosSkin&&this.changeLabel(this.state)}else this.twoTabs=!1,"undefined"!=typeof a.text&&this.label.appendChild(document.createTextNode(a.text));delete b;this.hasLabel=!0};
Popover.prototype.show=function(){if(this.isVisible)return!1;var a=this;with(workspace.popovers){if(oneOfPopoversIsVisible)return hideAll(),window.setTimeout(function(){a.show()},workspace.needIosSkin?0:300),!1;"notify"!=this.state&&(oneOfPopoversIsVisible=!0)}document.activeElement.blur();(workspace.isTablet||workspace.needIosSkin)&&"notify"!=this.state&&this.addBlackOutDiv();workspace.delCssClass(this.div,"hide");workspace.addCssClass(this.div,"show");workspace.leftShiftContainer&&"help"!=this.state&&
"notify"!=this.state&&workspace.addCssClass(workspace.leftShiftContainer,"shift");this.relatedButton&&workspace.addCssClass(this.relatedButton.div,"pressed");system.platform.android&&workspace.isMobile&&workspace.addCssClass(resources.MAIN_FRAME,"invisible");"help"!=this.state||workspace.needIosSkin||window.setTimeout(function(){"undefined"!=typeof a.label&&(a.label.style.top="0px")},1E3);this.isVisible=!0};
Popover.prototype.hide=function(){this.relatedButton&&(workspace.delCssClass(this.relatedButton.div,"pressed"),workspace.delCssClass(this.relatedButton.div,"active"));system.platform.android&&workspace.isMobile&&workspace.delCssClass(resources.MAIN_FRAME,"invisible");"notify"!=this.state&&(workspace.popovers.oneOfPopoversIsVisible=!1);document.activeElement.blur();workspace.delCssClass(this.div,"show");workspace.addCssClass(this.div,"hide");workspace.leftShiftContainer&&workspace.delCssClass(workspace.leftShiftContainer,
"shift");(workspace.isTablet||workspace.needIosSkin)&&"notify"!=this.state&&this.delBlackOutDiv();!0==this.deleteAfterClose&&this.del();this.isVisible=!1};Popover.prototype.changeVisibility=function(){!0==this.isVisible?this.hide():this.show()};Popover.prototype.showForAWhile=function(a){this.show();var b=this;window.setTimeout(function(){b.hide()},a)};Popover.prototype.reposition=function(){this.div.style.marginLeft=~~(-this.div.offsetWidth/2)+"px"};
Popover.prototype.SubMenu=function(a){a.scroll="undefined"==typeof a.scroll?!0:a.scroll;a.scroll?(a.parent.submenuList[a.parent.submenuNumber]=this,this.div=workspace.createElement({type:"div",id:a.parent.div.id+"SubMenuField"+a.parent.submenuNumber,cssClassName:"subMenu",parent:a.parent.contentDiv}),this.ul=workspace.createElement({type:"ul",id:a.parent.div.id+"SubMenuUl"+a.parent.submenuNumber,cssClassName:"buttonsField subMenuUl",parent:this.div}),this.div.style[HTML5lib.browserPrefix+"Transform"]=
"translate3d(0"+100*a.parent.submenuNumber+"%, 0px, 200px)"):(this.div=workspace.createElement({type:"div",id:a.parent.div.id+"SubMenuField"+a.parent.submenuNumber,cssClassName:"subMenu",parent:a.parent.contentDiv}),this.ul=workspace.createElement({type:"ul",id:a.parent.div.id+"SubMenuUl"+a.parent.submenuNumber,cssClassName:"buttonsField subMenuUl",parent:this.div}));a.parent.submenuNumber++;1<a.parent.submenuNumber&&!workspace.needIosSkin&&this.addSubMenuElement({content:{name:""},i:0,rightElement:"arrowL",
foo:function(){a.parent.shiftSubmenus("back")}});var b=this;a.scroll&&(workspace.needNativeScroll?(workspace.addCssClass(this.div,"nativeScroll"),b.scroll={},b.scroll.refresh=function(){},b.scroll.destroy=function(){},this.div.addEventListener("touchstart",function(a){b.scroll.lastY=a.touches[0].clientY},!0),this.div.addEventListener("touchmove",function(a){if(b.div.offsetHeight>b.ul.offsetHeight)return a.preventDefault(),!1;b.scroll.currentY=a.touches[0].clientY;if(b.scroll.currentY>b.scroll.lastY){if(0==
b.div.scrollTop)return a.preventDefault(),!1}else if(0==b.ul.offsetHeight-b.div.offsetHeight-b.div.scrollTop)return a.preventDefault(),!1},!0)):window.setTimeout(function(){b.scroll=new iScroll(b.div.id,{hScrollbar:!1,vScrollbar:!1,shrinkScrollbar:!1,checkDOMChanges:!1,fadeScrollbar:!1})},0));"undefined"!=typeof a.limit?(this.limitedContent=this.separateContent(a.content,a.limit),!1!=this.limitedContent?(a.content=this.limitedContent[0],this.limitedContent.currUL=0,this.addULContent({parent:a.parent,
content:this.limitedContent[this.limitedContent.currUL],rightElement:a.rightElement}),this.addSubMenuElement({content:{name:LOCALS.SEARCH_NEXT},i:"0next",cssClass:"limitationElement",foo:function(){b.showNextLimited({parent:a.parent,rightElement:a.rightElement})}})):this.addULContent({parent:a.parent,content:a.content,rightElement:a.rightElement})):this.addULContent({parent:a.parent,content:a.content,rightElement:a.rightElement});a.scroll&&window.setTimeout(function(){b.scroll.refresh()},0)};
Popover.prototype.SubMenu.prototype.addULContent=function(a){var b=1,c=this;if("undefined"!=typeof a.content)for(var e in a.content.children)"undefined"!=typeof a.content.children[e].children?this.addSubMenuElement({content:a.content.children[e],i:b++,rightElement:"arrowR",foo:function(b,e){new a.parent.SubMenu({parent:a.parent,rightElement:a.rightElement,content:b});"undefined"!=typeof c.pressedElementID&&workspace.delCssClass(el.id(c.pressedElementID),"pressed");c.pressedElementID=e;a.parent.shiftSubmenus("forvard");
delete null}}):this.addSubMenuElement({content:a.content.children[e],i:b++,rightElement:a.rightElement,foo:function(){"undefined"!=typeof c.pressedElementID&&workspace.delCssClass(el.id(c.pressedElementID),"pressed");a.parent.delBlackOutDiv();a.parent.hide()}})};
Popover.prototype.SubMenu.prototype.addSubMenuElement=function(a){"undefined"==typeof a.ulID&&(a.ulID=this.ul.id);"undefined"==typeof a.type&&(a.type="li");var b=Button.create({type:a.type,id:a.ulID+"el"+a.i,field:a.ulID,pressing:!0,cssClassName:"subMenuElement",text:a.content.name});if("undefined"!=typeof a.rightElement){workspace.addCssClass(b.div,"withRightField");var c=workspace.createElement({type:"div",id:this.ul.id+"el"+a.i+"Right",cssClassName:"subMenuElementRightField",parent:b.div,insertBefore:b.div.firstChild});
c.innerHTML="page"==a.rightElement?LOCALS.PAGE_NUMBER+" "+a.content[a.rightElement]:"undefined"!=typeof a.content[a.rightElement]?a.content[a.rightElement]:"";"arrowR"==a.rightElement&&workspace.addCssClass(c,"arrowR");"arrowL"==a.rightElement&&workspace.addCssClass(c,"arrowL");delete c}"undefined"!=typeof a.leftElement&&(workspace.addCssClass(b.div,"withLeftField"),c=workspace.createElement({type:"div",id:this.ul.id+"el"+a.i+"Left",cssClassName:"subMenuElementLeftField",parent:b.div,insertBefore:b.div.firstChild}),
c.innerHTML="undefined"!=typeof a.content[a.leftElement]?a.content[a.leftElement]:"","image"==a.leftElement&&workspace.addCssClass(c,"image"),"undefined"!=typeof a.css&&workspace.addCssClass(c,a.css),delete c);if("a"==a.type)return a.foo(b.div),!1;"undefined"!=typeof a.foo&&b.addAction(SINGLE_CLICK,function(b){a.foo(a.content,b.target.id)});if("undefined"!=typeof a.content.page&&"undefined"==typeof a.content.children){var e="undefined"!=typeof a.content.realID?a.content.realID:pageTable.getFileIDFromUserID(a.content.page);
b.addAction(SINGLE_CLICK,function(){window.setTimeout(function(){pageMediator.goToPage(e)},500)});delete e}"undefined"!=typeof a.cssClass&&workspace.addCssClass(b.div,a.cssClass);delete null};Popover.prototype.SubMenu.prototype.clear=function(){for(;this.ul.hasChildNodes();)this.ul.removeChild(this.ul.lastChild);var a=this.div.childNodes,b;for(b in a)"object"==typeof a[b]&&-1==a[b].id.indexOf("SubMenu")&&this.div.removeChild(a[b])};
Popover.prototype.SubMenu.prototype.showNextLimited=function(a){for(var b=this;this.ul.hasChildNodes();)this.ul.removeChild(this.ul.lastChild);this.limitedContent.currUL+=1;this.addSubMenuElement({content:{name:LOCALS.SEARCH_PREV},i:this.limitedContent.currUL+"prev",cssClass:"limitationElement",foo:function(){b.showPrevLimited({parent:a.parent,rightElement:a.rightElement})}});this.addULContent({parent:a.parent,content:this.limitedContent[this.limitedContent.currUL],rightElement:a.rightElement});"undefined"!=
typeof this.limitedContent[this.limitedContent.currUL+1]&&this.addSubMenuElement({content:{name:LOCALS.SEARCH_NEXT},i:this.limitedContent.currUL+"next",cssClass:"limitationElement",foo:function(){b.showNextLimited({parent:a.parent,rightElement:a.rightElement})}});window.setTimeout(function(){b.scroll.refresh();b.scroll.scrollTo(0,1,50)},200)};
Popover.prototype.SubMenu.prototype.showPrevLimited=function(a){for(var b=this;this.ul.hasChildNodes();)this.ul.removeChild(this.ul.lastChild);this.limitedContent.currUL-=1;0<this.limitedContent.currUL&&this.addSubMenuElement({content:{name:LOCALS.SEARCH_PREV},i:this.limitedContent.currUL+"prev",cssClass:"limitationElement",foo:function(){b.showPrevLimited({parent:a.parent,rightElement:a.rightElement})}});this.addULContent({parent:a.parent,content:this.limitedContent[this.limitedContent.currUL],rightElement:a.rightElement});
this.addSubMenuElement({content:{name:LOCALS.SEARCH_NEXT},i:this.limitedContent.currUL+"next",cssClass:"limitationElement",foo:function(){b.showNextLimited({parent:a.parent,rightElement:a.rightElement})}});window.setTimeout(function(){b.scroll.scrollToPage(0,30,50);b.scroll.refresh()},200)};
Popover.prototype.SubMenu.prototype.separateContent=function(a,b){var c={},e=Object.keys(a.children).length;if(e<b)return!1;c.countUL=(e-e%b)/b;for(var f=0;f<c.countUL;f++){c[f]={children:{}};for(var d=b*f;d<b*(f+1);d++)c[f].children[d]=a.children[d]}for(d=b*f;d<e;d++)c[c.countUL-1].children[d]=a.children[d];this.countUL++;return c};
Popover.prototype.shiftSubmenus=function(a){var b=this;switch(a){case "forvard":this.shiftLevel++;"undefined"!=typeof b.submenuList[b.shiftLevel-1].pressedElementID&&workspace.addCssClass(el.id(b.submenuList[b.shiftLevel-1].pressedElementID),"pressed");window.setTimeout(function(){0<b.shiftLevel&&(b.submenuList[b.shiftLevel-1].div.style.visibility="hidden")},1E3);break;case "back":this.shiftLevel--;this.deleteLastSubmenu();"more"==this.state&&this.changeLabel(this.state);this.submenuList[this.shiftLevel].div.style.visibility=
"visible";break;case "home":this.shiftLevel=0}translation=100*-this.shiftLevel;this.contentDiv.style[HTML5lib.browserPrefix+"Transform"]="translate3d("+translation+"%, 0px, 0px)";workspace.needIosSkin&&(0==this.shiftLevel?(this.label.backButton.makeDisable(),workspace.isMobile&&workspace.isMobile&&workspace.delCssClass(this.labelImage,"invisible")):(this.label.backButton.makeAble(),workspace.isMobile&&workspace.addCssClass(this.labelImage,"invisible")))};
Popover.prototype.deleteLastSubmenu=function(a){if(0>this.submenuList.length)return!1;var b=this;a="undefined"!=typeof a&&"undefined"!=typeof a.delay?a.delay:400;window.setTimeout(function(){b.submenuList[b.submenuList.length-1].scroll.destroy();b.submenuList[b.submenuList.length-1].scroll=null;el.del(b.submenuList[b.submenuList.length-1].div.id);b.submenuList.splice(-1,1)},a);this.submenuNumber--;delete a};
Popover.prototype.deleteTheOnlySubmenu=function(a){this.submenuList[this.submenuList.length-1].scroll.destroy();this.submenuList[this.submenuList.length-1].scroll=null;el.del(this.submenuList[this.submenuList.length-1].div.id);this.submenuList.splice(-1,1);this.submenuNumber--};Popover.prototype.getSubmenuList=function(){var a=this.contentDiv.childNodes,b=[],c;for(c in a)"object"==typeof a[c]&&-1!=a[c].id.indexOf("SubMenuField")&&b.push(a[c].id);return b};Popover.prototype.addContent=function(){popoverContent[this.state](this)};
Popover.prototype.delContent=function(){for("undefined"!=typeof this.subMenu&&0<this.shiftLevel&&this.shiftSubmenus("home");this.contentDiv.hasChildNodes();)this.contentDiv.removeChild(this.contentDiv.lastChild);for(;1<this.contentDiv.parentNode.childNodes.length;)this.contentDiv.parentNode.removeChild(this.contentDiv.parentNode.firstChild);workspace.delCssClass(this.contentDiv.parentNode,"withSearch");this.submenuNumber=0;this.subMenu=null;delete this.subMenu};
Popover.prototype.redrawContent=function(){this.delContent();this.addContent()};Popover.prototype.setRelatedButton=function(){var a={share:"shareButton",download:"downloadButton",search:"searchButton",more:"moreButton",help:!1,bm:"listButton",toc:"listButton"}[this.state];this.relatedButton=workspace.buttons.list[a]||!1;delete a};
Popover.prototype.getRelatedButtonPosition=function(){if(!this.relatedButton)return!1;var a=/(left|right)Field/.exec(this.relatedButton.field.className)[1];if("left"==a)var b=this.relatedButton.div.offsetLeft+this.relatedButton.div.offsetWidth/2,b=b-b%4;else"right"==a&&(b=el.id("body").offsetWidth-(this.relatedButton.div.offsetLeft+this.relatedButton.div.offsetWidth/2),b+=b%4);return{align:a,offset:b}};
Popover.prototype.drawTriangle=function(){var a=this.getRelatedButtonPosition();if(!a)return!1;workspace.addCssClass(this.div,a.align);var b=parseInt(document.defaultView.getComputedStyle(this.div,null).getPropertyValue(a.align));this.triangle=workspace.createElement({type:"div",id:this.div.id+"Triangle",cssClassName:"triangle",parent:this.div});this.triangle.style[a.align]=a.offset-b+"px";delete null};
var popoverContent={help:function(a){var b={0:{category:LOCALS.GESTURES_HELP_LABEL,relyOn:!0},1:{caption:LOCALS.SLIDE_HELP_LABEL,explanation:LOCALS.SLIDE_HELP_TEXT,image:STYLES_FOLDER+"/info/slide.png"},2:{caption:LOCALS.SINGLETAP_HELP_LABEL,explanation:LOCALS.SINGLETAP_HELP_TEXT,image:STYLES_FOLDER+"/info/singletapside.png",relyOn:!0},3:{caption:LOCALS.CENTERTAP_HELP_LABEL,explanation:LOCALS.CENTERTAP_HELP_TEXT,image:STYLES_FOLDER+"/info/singletapcenter.png"},4:{caption:LOCALS.DOUBLETAP_HELP_LABEL,
explanation:LOCALS.DOUBLETAP_HELP_TEXT,image:STYLES_FOLDER+"/info/doubletap.png",relyOn:!0==system.platform.ios||!0},5:{caption:LOCALS.PINCH_HELP_LABEL,explanation:LOCALS.PINCH_HELP_TEXT,image:STYLES_FOLDER+"/info/pinch.png",relyOn:!workspace.needZoomTolbar()},6:{caption:LOCALS.MOVE_HELP_LABEL,explanation:LOCALS.MOVE_HELP_TEXT,image:STYLES_FOLDER+"/info/move.png"},7:{caption:LOCALS.ROTATE_HELP_LABEL,explanation:LOCALS.ROTATE_HELP_TEXT,image:STYLES_FOLDER+"/info/rotate.png"},8:{category:LOCALS.TOOLBAR_HELP_LABEL,
relyOn:!0},9:{explanation:LOCALS.VIEW_TOC_HELP_LABEL,fontImage:"tocButton",relyOn:publicationData.visibility.toc||publicationData.visibility.bookmarks},10:{explanation:LOCALS.ADD_BOOKMARK_HELP_LABEL,fontImage:"addButton",relyOn:publicationData.visibility.bookmarks},11:{explanation:LOCALS.SEARCH_BY_KEY_HELP_LABEL,fontImage:"searchButton",relyOn:publicationData.visibility.search},12:{explanation:LOCALS.START_SLIDESHOW_HELP_LABEL,fontImage:"slideShowButton",relyOn:publicationData.visibility.slideshow},
13:{explanation:LOCALS.DOWNLOAD_HELP_LABEL,fontImage:"downloadButton",relyOn:publicationData.visibility.downloads},14:{explanation:LOCALS.SHARE_HELP_LABEL,fontImage:"shareButton",relyOn:publicationData.visibility.share},15:{explanation:LOCALS.MORE_HELP_LABEL,fontImage:"moreButton",relyOn:!!workspace.buttons.list.moreButton}};a.submenuNumber=0;a.subMenu=new a.SubMenu({parent:a,scroll:!0});for(var c in b)"undefined"==typeof b[c].relyOn||b[c].relyOn||system.platform.publisher||delete b[c];for(c in b)if("undefined"!=
typeof b[c].category){var e=workspace.createElement({type:"h4",id:a.div.id+"HelpCategory"+c,cssClassName:"helpCategory",parent:a.subMenu.ul});e.innerHTML=b[c].category}else{e=workspace.createElement({type:"figure",id:a.div.id+"HelpElement"+c,cssClassName:"helpElement",parent:a.subMenu.ul});if("undefined"!=typeof b[c].fontImage){var f=workspace.createElement({type:"div",id:a.div.id+"HelpImg"+c,cssClassName:"helpImg button",parent:e});workspace.addCssClass(f,"fontImage "+b[c].fontImage);workspace.addCssClass(e,
"withFontImage")}"undefined"!=typeof b[c].image&&(f=workspace.createElement({type:"img",id:a.div.id+"HelpImg"+c,cssClassName:"helpImg",parent:e}),f.src=b[c].image);"undefined"!=typeof b[c].caption&&(e=workspace.createElement({type:"figurecaption",id:a.div.id+"HelpCaption"+c,cssClassName:"helpCaption",parent:e}),e.innerHTML=b[c].caption+":<br/>");e=workspace.createElement({type:"div",id:a.div.id+"HelpExplanation"+c,cssClassName:"helpExplanation",parent:e});e.innerHTML=b[c].explanation}publicationData.visibility.copyright&&
((workspace.needIosSkin||workspace.isTablet)&&workspace.addCssClass(a.div,"withCr"),b=workspace.needIosSkin||workspace.isTablet?a.div:a.subMenu.ul,b=workspace.createElement({type:"a",id:a.div.id+"Cr",cssClassName:"cr",parent:b}),workspace.createElement({type:"span",id:a.div.id+"crText",cssClassName:"crText",text:publicationData.copyrightURL.text,parent:b}),b.setAttribute("href",publicationData.copyrightURL.url),b.setAttribute("target",publicationData.copyrightURL.window),delete null,delete null);
window.setTimeout(function(){"undefined"!=typeof a.subMenu&&a.subMenu.scroll.refresh()},2E3);delete null;delete null;delete null;delete null},toc:function(a){a.submenuNumber=0;a.subMenu=new a.SubMenu({parent:a,content:publicationData.toc})},bm:function(a){a.subMenu=new a.SubMenu({parent:a,content:bm.bmContent,rightElement:"page"})},search:function(a){arguments.callee.handleSearchStart=function(b){a.subMenu.clear();workspace.preloader.add(a.contentDiv);c.blur()};arguments.callee.getNextResultPageNumber=
function(a){for(var b in a)if(a[b].realID==pageMediator.page&&"undefined"!=typeof a[1*b+1])return a[1*b+1].realID;return a[0].realID};arguments.callee.getPrevResultPageNumber=function(a){for(var b in a)if(a[b].realID==pageMediator.page&&"undefined"!=typeof a[1*b-1])return a[1*b-1].realID;return a[Object.keys(a).length-1].realID};arguments.callee.handleSearchResults=function(b){popoverContent.search.searchResults=b.data.children;workspace.preloader.del(a.contentDiv);var c=system.platform.ios?70:15;
LOCALS.SEARCH_PREV=LOCALS.SEARCH_PREV.replace("{0}",c);LOCALS.SEARCH_NEXT=LOCALS.SEARCH_NEXT.replace("{0}",c);a.deleteTheOnlySubmenu();a.subMenu=new a.SubMenu({parent:a,content:b.data,rightElement:"page",limit:c});if("undefined"==typeof b.data.children[0]){workspace.createElement({type:"span",id:"noResultsText",cssClassName:"searchMessage",text:LOCALS.SEARCH_EMPTY_TEXT,parent:a.subMenu.div});workspace.delCssClass(a.startSearchField,"underline");with(workspace.toolbars)list.searchToolbar.isActive=
!1,list.searchToolbar.hide(),workspace.delCssClass(list.pagerToolbar.div,"forSearch")}else{workspace.addCssClass(a.startSearchField,"underline");with(workspace.toolbars)workspace.addCssClass(list.pagerToolbar.div,"forSearch"),list.searchToolbar.isActive=!0,list.searchToolbar.show()}var d=function(a,b){for(var c in a)if(a[c].realID==b)return 1*c+1;return 0};with(workspace.toolbars.list.searchToolbar)workspace.setText(resultCount.id,Object.keys(b.data.children).length),workspace.setText(currentResultNumber.id,
d(b.data.children,pageMediator.page));pageMediator.addListener(function(a){workspace.setText(currentResultNumber.id,d(b.data.children,a))})};workspace.addCssClass(a.contentDiv.parentNode,"withSearch");var b=function(){document.activeElement.blur();c.blur();window.focus();window.blur();c.focus();c.select();document.activeElement.blur();c.blur();return c.value.length<publicationData.search.lim?(LOCALS.SEARCH_NOTE_TEXT=LOCALS.SEARCH_NOTE_TEXT.replace("3",publicationData.search.lim),a.subMenu.clear(),
workspace.delCssClass(a.startSearchField,"underline"),workspace.createElement({type:"span",id:"noResultsText",cssClassName:"searchMessage",text:LOCALS.SEARCH_NOTE_TEXT,parent:a.subMenu.div}),!1):!0};a.startSearchField=workspace.createElement({type:"div",id:a.div.id+"startSearchField",cssClassName:"buttonsField startSearchField",parent:a.contentDiv.parentNode,insertBefore:a.contentDiv});workspace.needIosSkin||Button.create({id:"startSearchButton",text:LOCALS.FIND_BUTTON,field:a.startSearchField.id,
pressing:!0,able:!0}).addAction(UP_EVENT,function(){b()&&customEvents.fireEvent(START_SEARCH,{data:c.value})});var c=workspace.createElement({type:"input",id:a.div.id+"inputSearch",cssClassName:"inputSearch ableSelectText ableEditText ",parent:a.startSearchField});c.blur();c.setAttribute("type","search");system.publisher.isOn||c.setAttribute("results","5");c.setAttribute("placeholder",LOCALS.SEARCH_TEXT+"..");c.addEventListener("keydown",function(){var a=event;a.target=a.target?a.target:a.srcElement;
window.focus();c.focus();13==a.keyCode&&b()&&customEvents.fireEvent(START_SEARCH,{data:c.value})});setClickEvents(c,"dm");c.addEventListener(SINGLE_CLICK,function(b){33>c.offsetWidth+a.div.offsetLeft-b.x&&(c.value="",c.focus())});workspace.needIosSkin&&workspace.createElement({id:a.div.id+"inputSearchIcon",cssClassName:"fontImage inputSearchIcon ",parent:a.startSearchField});a.submenuNumber=0;a.subMenu=new a.SubMenu({parent:a,rightElement:"page"})},download:function(a,b){var c=0,e="undefined"!=typeof workspace.buttons.list.moreButton?
"image":void 0;a.submenuNumber=0;a.subMenu=new a.SubMenu({parent:a,scroll:b||!1});if(PUBL&&system.platform.ios&&6<=system.platform.version[0]){var f="publ:id="+properties.book;try{var d=new Date;d.setMonth(d.getMonth()+6);localStorage.setItem("bookID",properties.book);(function(a,b,c,e,d){if(!a||!b)return!1;a=a+"="+encodeURIComponent(b);c&&(a+="; expires="+c.toGMTString());e&&(a+="; domain="+e);d&&(a+="; secure");document.cookie=a;return!0})("bookID",properties.book,d,".publ.com")}catch(q){console.log(q)}var r=
function(a){return function(){var b=+new Date;setTimeout(function(){2E3>+new Date-b&&(window.location=a)},500)}},d=function(a){a.setAttribute("href",f);a.addEventListener(SINGLE_CLICK,function(){r("https://itunes.apple.com/app/publ/id579598589?mt=8&uo=4")()})};a.subMenu.addSubMenuElement({content:{name:LOCALS.OPEN_IN_APP},i:c++,leftElement:"normalImage",css:"fontImage openInAppButton",type:"a",foo:d})}else PUBL&&system.device.model&&system.platform.android&&2<system.device.version&&(d=function(a){a.setAttribute("href",
"http://publ.com/__android/com.publ.reader/"+properties.book)},a.subMenu.addSubMenuElement({content:{name:LOCALS.OPEN_IN_APP},i:c++,leftElement:"normalImage",css:"fontImage openInAppButton",type:"a",foo:d}));var d=function(a){var b=" "+LOCALS.BYTE;1024<a&&(a=(a/1024).toFixed(1),b=" "+LOCALS.KILO_BYTE,1024<a&&(a=(a/1024).toFixed(1),b=" "+LOCALS.MEGA_BYTE,1024<a&&(a=(a/1024).toFixed(1),b=" "+LOCALS.GIGA_BYTE)));return a+b},h=function(a,b){""!=PS&&void 0!=PS&&(b=b+"?password="+PS);""!=USERID&&void 0!=
USERID&&(b=b+"?loginTicket="+USERID);var c=new XMLHttpRequest;with(c)open("GET",b),onload=function(){b=this.responseText;a.addEventListener(SINGLE_CLICK,function(){"android"===system.device.name?window.open(a.getAttribute("data-href"),"_self"):window.open(a.getAttribute("data-href"),"_blank")});a.setAttribute("data-href",b);a.setAttribute("target","_blank")},onerror=function(){},send();delete c};if(!0==publicationData.downloads.publicationDownload){var l=COMMON_FOLDER+"/../"+publicationData.downloads.url;
a.subMenu.addSubMenuElement({content:{name:"download"==a.state?LOCALS.DOWNLOAD_PUBLICATION:LOCALS.MORE_DOWNLOAD_PUBLICATION,size:d(publicationData.downloads.size)},i:c++,rightElement:"size",leftElement:e,css:"fontImage downloadButton",type:"a",foo:function(a){PUBL?h(a,l):(a.addEventListener(SINGLE_CLICK,function(){"android"===system.device.name?window.open(a.getAttribute("data-href"),"_self"):window.open(a.getAttribute("data-href"),"_blank")}),a.setAttribute("data-href",l),a.setAttribute("target",
"_blank"))}})}if(!0==publicationData.downloads.pageDownload){var g="undefined"!=typeof book&&2==book.type&&publicationData.page[pageMediator.page].wide;if("undefined"!=typeof book&&2==book.type&&!g){var g=pageTable.getFileIDFromUserID(book.twoPage.currentPage.left),k=pageTable.getFileIDFromUserID(book.twoPage.currentPage.right);if(0<g&&publicationData.downloads.page[g]){var m=COMMON_FOLDER+"/../"+publicationData.downloads.page[g].url;a.subMenu.addSubMenuElement({content:{name:"download"==a.state?
LOCALS.DOWNLOAD_CURRENT_LEFT_PAGE:LOCALS.MORE_DOWNLOAD_CURRENT_LEFT_PAGE,size:d(publicationData.downloads.page[g].size)},i:c++,rightElement:"size",leftElement:e,css:"fontImage downloadButton",type:"a",foo:function(a){PUBL?h(a,m):(a.addEventListener(SINGLE_CLICK,function(){"android"===system.device.name?window.open(a.getAttribute("data-href"),"_self"):window.open(a.getAttribute("data-href"),"_blank")}),a.setAttribute("data-href",m),a.setAttribute("target","_blank"))}})}if(k<=publicationData.pageCount&&
publicationData.downloads.page[k]){var n=COMMON_FOLDER+"/../"+publicationData.downloads.page[k].url;a.subMenu.addSubMenuElement({content:{name:"download"==a.state?LOCALS.DOWNLOAD_CURRENT_RIGHT_PAGE:LOCALS.MORE_DOWNLOAD_CURRENT_RIGHT_PAGE,size:d(publicationData.downloads.page[k].size)},i:c++,rightElement:"size",leftElement:e,css:"fontImage downloadButton",type:"a",foo:function(a){PUBL?h(a,n):(a.addEventListener(SINGLE_CLICK,function(){"android"===system.device.name?window.open(a.getAttribute("data-href"),
"_self"):window.open(a.getAttribute("data-href"),"_blank")}),a.setAttribute("data-href",n),a.setAttribute("target","_blank"))}})}}else if(!publicationData.page[pageMediator.page].stub){var p=COMMON_FOLDER+"/../"+publicationData.downloads.page[pageMediator.page].url;a.subMenu.addSubMenuElement({content:{name:"download"==a.state?LOCALS.DOWNLOAD_CURRENT_PAGE:LOCALS.MORE_DOWNLOAD_CURRENT_PAGE,size:d(publicationData.downloads.page[pageMediator.page].size)},i:c++,rightElement:"size",leftElement:e,css:"fontImage downloadButton",
type:"a",foo:function(a){PUBL?h(a,p):(a.addEventListener(SINGLE_CLICK,function(){"android"===system.device.name?window.open(a.getAttribute("data-href"),"_self"):window.open(a.getAttribute("data-href"),"_blank")}),a.setAttribute("data-href",p),a.setAttribute("target","_blank"))}})}}},shareList:function(a,b){var c=window.location.href;PUBL||(c=c.replace(RegExp("^(.*)(/"+FILES_FOLDER+"?).*(#.*)","i"),"$1/index.html$3"));b||(c=/(.*)#.*/.exec(c)[1]);var c=encodeURIComponent(c),e=encodeURIComponent(publicationData.name),
f={0:{name:LOCALS.FACEBOOK,fontImage:"facebookShare",url:"https://m.facebook.com/sharer.php?u="+c.replace(encodeURIComponent("#"),encodeURIComponent("?p=")),disable:workspace.isLocal},1:{name:LOCALS.TWITTER,fontImage:"twitterShare",url:"https://twitter.com/intent/tweet?text="+e+"&url="+c},2:{name:LOCALS.GOOGLEPLUS,fontImage:"googleShare",url:"https://plus.google.com/share?url="+c},3:{name:LOCALS.LINKEDIN,fontImage:"linkedinShare",url:"http://www.linkedin.com/shareArticle?mini=true&url="+c.replace(encodeURIComponent("#"),
encodeURIComponent("?p="))+"&title="+e+"&summary="+e+"&source="+c.replace(encodeURIComponent("#"),encodeURIComponent("?p="))},4:{name:LOCALS.TUMBLR,fontImage:"tumblrShare",url:"http://www.tumblr.com/share/link?url="+c+"&name="+e+"&description="},5:{name:LOCALS.VK,fontImage:"vkShare",url:"http://vk.com/share.php?url="+c+"&title="+e+"&image="+ASSETS_FOLDER+"/thumb.jpg&description="},6:{name:LOCALS.EMAIL,fontImage:"mailShare",url:"mailto:?subject="+e+"&body="+c}},c=1;a.changeLabel("share");a.subMenu=
new a.SubMenu({parent:a,scroll:!0});for(var d in f)f[d].disable||a.subMenu.addSubMenuElement({content:{name:f[d].name},i:c++,leftElement:"image",type:"a",foo:function(a){a.addEventListener(SINGLE_CLICK,function(){a.getAttribute("data-href").indexOf("mailto:")+1||"android"===system.device.name?window.open(a.getAttribute("data-href"),"_self"):window.open(a.getAttribute("data-href"),"_blank")});a.setAttribute("data-href",f[d].url);a.setAttribute("target","_blank");f[d].fontImage&&workspace.addCssClass(a.firstChild,
"fontImage shareImage "+f[d].fontImage)}})},share:function(a){var b=1;a.submenuNumber=0;a.subMenu=new a.SubMenu({parent:a,scroll:!0});var c=this;a.subMenu.addSubMenuElement({content:{name:LOCALS.SHARE_PUBLICATION},i:b++,rightElement:"arrowR",foo:function(b){c.shareList.call(c,a,!1);a.shiftSubmenus("forvard")}});a.subMenu.addSubMenuElement({content:{name:LOCALS.SHARE_CURRENT_PAGE},i:b++,rightElement:"arrowR",foo:function(b){c.shareList.call(c,a,!0);a.shiftSubmenus("forvard")}})},more:function(a){var b=
10;publicationData.visibility.downloads&&!workspace.buttons.list.downloadButton?this.download(a,!0):(a.submenuNumber=0,a.subMenu=new a.SubMenu({parent:a,scroll:!0}));if(publicationData.visibility.share&&!workspace.buttons.list.shareButton){var c=this;a.subMenu.addSubMenuElement({content:{name:LOCALS.MORE_SHARE_PUBLICATION},i:b++,rightElement:"arrowR",leftElement:"image",css:"fontImage shareButton",foo:function(b){c.shareList.call(c,a,!1);a.shiftSubmenus("forvard")}});a.subMenu.addSubMenuElement({content:{name:LOCALS.MORE_SHARE_CURRENT_PAGE},
i:b++,rightElement:"arrowR",leftElement:"image",css:"fontImage shareButton",foo:function(b){c.shareList.call(c,a,!0);a.shiftSubmenus("forvard")}})}publicationData.visibility.slideshow&&a.subMenu.addSubMenuElement({content:{name:"object"!=typeof workspace.buttons.list.slideShowButton?LOCALS.SHOW_SLIDESHOW_BUTTON:LOCALS.HIDE_SLIDESHOW_BUTTON},i:b++,leftElement:"image",css:"fontImage slideShowButton",foo:function(){a.hide();"object"!=typeof workspace.buttons.list.slideShowButton?workspace.slideShow.addSlideShowButton():
workspace.slideShow.delSlideShowButton()}});workspace.buttons.list.infoButton||a.subMenu.addSubMenuElement({content:{name:LOCALS.HELP},i:b++,leftElement:"image",css:"fontImage infoButton",foo:function(){if("undefined"!=typeof workspace.popovers.helpOver){if(!0==workspace.popovers.helpOver.isVisible)return!1;workspace.existInDOM("helpOver")&&el.del("helpOver");workspace.popovers.helpOver=null;delete workspace.popovers.helpOver}workspace.popovers.helpOver=new Popover({id:"helpOver",parent:"body",horisontalPosition:"center",
state:"help",deleteAfterClose:!0});with(workspace.popovers.helpOver)addLabel({text:LOCALS.HELP,back:!1}),addContent(),workspace.isTablet&&workspace.addCssClass(div,"tablet"),reposition();window.setTimeout(function(){workspace.popovers.helpOver.show()},100)}})}},Slider=function(a,b,c,e){this.able=!0;this.bar=el.id(a);this.p=el.id(b);this.pDelta=this.p.offsetWidth/2;this.pCorrection=0;this.barWidth=this.bar.offsetWidth;this.off=Math.round(7+this.p.offsetWidth/2);this.pageCount=publicationData.pageCount;
2!==orientationObserver.getType()||orientationObserver.zoom||this.handleChangingBookType();this.speed=220;this.stepAnimation=system.platform.android&&/^3|4$/.test(system.device.version)?!0:!1;this.needLastStep=!0;this.alignByGrid=system.platform.ios;system.platform.android&&/^3|4$/.test(system.device.version)?(this.animationSpeed=400,this.animationClass="slow"):(this.animationSpeed=system.platform.ios?10:5,this.animationClass="fast");workspace.addCssClass(this.p,this.animationClass);if(this.isPagerInsideSlider=
c)this.sliderLabel=el.id(e);this.isDraggingNow=!1;this.localTouchCoordinateX=this.getNewCoordinateFromPageNumber(pageMediator.page);if(workspace.needIosSkin){a=document.defaultView.getComputedStyle(this.bar,null).getPropertyValue("background-image");try{this.barColor=a.match(/.*from\(rgba\(([^\)]*)\).*/)[1].match(/(.*),[^,]*$/)[1]}catch(f){this.barColor="233,233,233"}delete null}else this.barColor="233,233,233";var d=this;setClickEvents(this.bar);with(this.bar.parentNode)Modernizr.touch?(addEventListener("touchstart",
function(){d.handleTouchStart(event)},!1),addEventListener("touchmove",function(){d.handleTouchMove(event)},!1),addEventListener("touchend",function(){d.handleTouchEnd(event)},!1)):(addEventListener("mousedown",function(){d.handleTouchStart(event)},!1),addEventListener("mouseup",function(){d.handleTouchEnd(event)},!1),addEventListener("mousemove",function(){d.handleTouchMove(event)},!1),addEventListener("mouseout",function(){d.handleTouchEnd(event)},!1),addEventListener("mouseleave",function(){d.handleTouchEnd(event)},
!1));d.stepAnimation?pageMediator.addListener(function(a){d.doPagerTranslate(d.getNewCoordinateFromPageNumber(a))}):(pageMediator.addListener(function(a){d.needLastStep?d.doPagerTranslate(d.getNewCoordinateFromPageNumber(a)):d.needLastStep=!0;d.alignByGrid&&d.alignToGrid(a)}),customEvents.addListener(BOOK_FLIPPING_START,function(){d.able=!1}),customEvents.addListener(BOOK_FLIPPING_END,function(){d.able=!0;d.alignByGrid&&d.alignToGrid(pageMediator.page)}));customEvents.addListener(CHANGE_BOOK_TYPE,
function(a){d.handleChangingBookType()});customEvents.addListener(ROTATE_DEVICE,function(a){d.handleChangingBookType()});system.platform.ios?this.handleResize():window.setTimeout(function(){d.handleResize()},1E3)};
Slider.prototype.handleTouchStart=function(a){with(workspace.pager)isEdit&&hideInputField();if(!this.able)return!1;a=a||window.event;var b=this;this.isDraggingNow=!0;a="mousedown"!=a.type&&"mouseout"!=a.type?a.touches[0].pageX:a.pageX;this.clientX=Math.round(a);this.barWidth=this.bar.offsetWidth;this.pCorrection=this.localTouchCoordinateX;this.localTouchCoordinateX=this.clientX-this.bar.parentNode.offsetLeft;this.pCorrection-=this.localTouchCoordinateX;Math.abs(this.pCorrection)>this.pDelta?this.pCorrection=
0:this.clientX+=this.pCorrection;this.changeDestinationByTimer.active=!0;this.timeout=window.setTimeout(function(){b.changeDestinationByTimer()},b.speed);window.setTimeout(function(){b.animationByInterval.call(b)},0);b.interval=window.setInterval(function(){b.animationByInterval.call(b)},b.animationSpeed);delete null};
Slider.prototype.handleTouchMove=function(a){if(!this.isDraggingNow)return!1;a=a||window.event;this.clientX=a="touchmove"==a.type?a.touches[0].pageX:a.pageX;0<Math.abs(this.pCorrection)&&(this.clientX+=this.pCorrection);delete null;delete null};
Slider.prototype.animationByInterval=function(){this.localTouchCoordinateX=this.clientX-this.bar.parentNode.offsetLeft;var a=Math.round(this.p.offsetWidth/2+7);this.localTouchCoordinateX<a?this.localTouchCoordinateX=a:this.localTouchCoordinateX>=this.barWidth-a&&(this.localTouchCoordinateX=this.barWidth-1-a);if(this.stepAnimation){a=this.getDestinationPageNumber();if(a==this.prevDestinationPage)return!1;this.doPagerTranslate(this.getNewCoordinateFromPageNumber(a));this.prevDestinationPage=a}else this.doPagerTranslate(this.localTouchCoordinateX)};
Slider.prototype.handleTouchEnd=function(a){if(!this.isDraggingNow)return!1;window.clearTimeout(this.timeout);this.changeDestinationByTimer.active=!1;window.clearInterval(this.interval);this.needLastStep=!1;this.alignByGrid&&this.alignToGrid(this.getDestinationPageNumber());pageMediator.goToPage(this.getDestinationPageNumber());this.isDraggingNow=!1};
Slider.prototype.doPagerTranslate=function(a){this.p.style.webkitAnimationPlayState="paused";a="undefined"!=typeof a?Math.round(a):0;this.p.style[HTML5lib.browserPrefix+"Transform"]="translate3d("+a+"px, 0px, 0px)";if(this.isPagerInsideSlider){var b=Math.round(this.sliderLabel.offsetWidth/3.5);workspace.needIosSkin&&(this.sliderLabel.style.marginLeft=-Math.round(this.sliderLabel.offsetWidth/2-this.pDelta)+"px");this.sliderLabel.style[HTML5lib.browserPrefix+"Transform"]=0>a-b?"translate3d("+b+"px, 0px, 0px)":
a>this.barWidth-b?"translate3d("+-b+"px, 0px, 0px)":"translate3d(0px, 0px, 0px)"}workspace.needIosSkin&&this.setGradient(a/this.barWidth,0);this.p.style.webkitAnimationPlayState="running";delete a};Slider.prototype.setGradient=function(a,b){this.bar.style.backgroundImage="-webkit-gradient(linear,left top,right top,color-stop(0, rgba("+this.barColor+",0.85)),color-stop("+a+", rgba(233,233,233,0.85)),color-stop("+a+", rgba(233,233,233,0)),color-stop(1, rgba(0,0,0,0)))"};
Slider.prototype.getDestinationPageNumber=function(){var a=(this.barWidth-2*this.off)/this.pageCount,b=this.localTouchCoordinateX-this.off,a=Math.round((b-b%a)/a+1);a>this.pageCount&&(a=this.pageCount);publicationData.rtlMode&&(a=this.pageCount-a+1);2!==orientationObserver.getType()||orientationObserver.zoom||(a=pageTable.doubleFlipList[a-1]);return a};
Slider.prototype.getNewCoordinateFromPageNumber=function(a){a="undefined"!=typeof a?a:pageMediator.page;2!==orientationObserver.getType()||orientationObserver.zoom||(fbUtils.findArr(pageTable.doubleFlipList,a)?a=fbUtils.findArr(pageTable.doubleFlipList,a):fbUtils.findArr(pageTable.doubleFlipList,a-1)&&(a=fbUtils.findArr(pageTable.doubleFlipList,a-1)),a=1*a+1);var b=(this.barWidth-2*this.off)/(this.pageCount-1);return publicationData.rtlMode?a==this.pageCount&&b>this.off?this.off:1==a&&b>this.off?
this.barWidth-this.off:~~(this.barWidth-(this.off+(a-1)*b)):a==this.pageCount&&b>this.off?this.barWidth-this.off:1==a&&b>this.off?this.off:~~(this.off+(a-1)*b)};Slider.prototype.handleResize=function(){this.barWidth=this.bar.offsetWidth;this.doPagerTranslate(this.getNewCoordinateFromPageNumber())};
Slider.prototype.handleChangingBookType=function(a){2!==orientationObserver.getType()||orientationObserver.zoom?this.pageCount=1*publicationData.pageCount:this.pageCount=pageTable.doubleFlipList.length;this.handleResize()};
Slider.prototype.alignToGrid=function(a){"slow"!=this.animationClass&&workspace.shiftCssClasses(this.p,"fast","slow");this.localTouchCoordinateX=this.getNewCoordinateFromPageNumber(a);this.doPagerTranslate(this.localTouchCoordinateX);var b=this;window.setTimeout(function(){"slow"!=b.animationClass&&workspace.shiftCssClasses(b.p,"slow","fast")},300)};
Slider.prototype.changeDestinationByTimer=function(){var a=this.getDestinationPageNumber();customEvents.fireEvent(SLIDER_TO_PAGER_CHANGE_LABEL,{page:a});var b=this;window.clearTimeout(b.timeout);this.changeDestinationByTimer.active&&(this.timeout=window.setTimeout(function(){b.changeDestinationByTimer.call(b)},b.speed));delete null};
var Notifications={isInit:!1,list:{},counter:0,add:function(a){this.isInit||this.init();this.list[this.counter]=new Notify({type:a.type,id:"notification"+this.counter,time:a.time,title:a.title,message:a.message,callback:a.callback});this.counter++},init:function(){this.container=workspace.createElement({type:"div",id:"notificationContainer",cssClassName:"notificationContainer",parent:el.id("body")});this.isInit=!0}},Notify=function(a){this.div=workspace.createElement({type:"div",id:a.id,cssClassName:"notification "+
a.type,parent:Notifications.container});workspace.createElement({type:"div",id:a.id+"img",cssClassName:"notificationImg "+a.type,parent:this.div});workspace.createElement({type:"div",id:a.id+"Title",cssClassName:"notificationText notificationTitle",parent:this.div,text:a.title});workspace.createElement({type:"div",id:a.id+"Message",cssClassName:"notificationText notificationMessage",parent:this.div,text:a.message});a.callback&&a.callback.call(this,this.div);this.show();if("undefined"!=typeof a.time){var b=
this;window.setTimeout(function(){b.hide()},a.time);window.setTimeout(function(){b.del()},a.time+300)}};Notify.prototype={show:function(){workspace.addCssClass(this.div,"show")},hide:function(){workspace.addCssClass(this.div,"hide")},del:function(){el.del(this.div.id);Notifications.list[this.id]=null;delete Notifications.list[this.id]}};
workspace={isInit:!1,flipArea:0.1,flipAreaIOS:0.15,needIosSkin:!1,needNativeScroll:!1,init:function(a,b){if(!workspace.isInit){this.isTablet="undefined"!=typeof b?"tablet"==b?!0:!1:!1;this.isMobile=!this.isTablet;this.setWorkspaceSize();this.isPrivateIosBrowsing()&&publicationData.visibility.bookmarks&&window.setTimeout(function(){Notifications.add({type:"privateMode",time:5E3,title:LOCALS.PRIVATE_TITLE,message:LOCALS.PRIVATE_MESSAGE})},2E3);publicationData.visibility.bookmarks&&(this.isLocalStorageSupported()?
bm.loadAllBmFromStorage():publicationData.visibility.bookmarks=!1);system.platform.ios&&1!=window.IPADVER&&(this.needIosSkin=!0);this.leftShiftContainer=this.existInDOM("leftShiftContainer")?el.id("leftShiftContainer"):!1;this.deleteUnnecessaryHTML();if(system.platform.ios&&1!=window.IPADVER){var c=!1,e=function(a){("undefined"===typeof a.target.id||""===a.target.id&&"link"!==a.target.className||"mainFrame"===a.target.id)&&setTimeout(function(){c?c=!1:a.gesture.center.pageX<window.innerWidth/10?pageMediator.left():
a.gesture.center.pageX>9*window.innerWidth/10?pageMediator.right():workspace.clickControl(a)},300)};Hammer(a,{prevent_default:!0,stop_browser_behavior:!0}).on("tap",function(a){e(a)});Hammer(a,{prevent_default:!0,stop_browser_behavior:!0}).on("doubletap",function(){c=!0})}else a.addEventListener(SINGLE_CLICK,function(a){workspace.clickControlSimple(a)}),a.addEventListener(DOUBLE_CLICK,function(a){workspace.clickControlSimple(a)});with(workspace)preloader.init(),storagePage.init(),toolbars.init(),
buttons.init(),pager.init(),setPublicationTitle(),insertCssRules();window.addEventListener&&(this.needNativeScroll?window.addEventListener("touchmove",function(a){/subMenuElement|helpCategory|helpElement/i.test(a.target.className)||a.preventDefault()},!0):window.addEventListener("touchmove",function(a){a.preventDefault()},!0));/^3|4$/.test(system.device.version)&&(el.id("body").style.webkitTransformStyle="preserve-3d");3==system.device.version&&workspace.addCssClass(el.id("body"),"android3");changeUrlWhenPubl(BACKGROUND_FOLDER+
"/flash/"+publicationData.background.src,function(a){new Background({divID:"bgDiv",color:publicationData.background.color,src:a,placement:publicationData.background.scale});delete null});this.needZoomTolbar()?(workspace.isMobile&&el.del("pagerField"),workspace.slider=new Slider("sliderBar","sliderThumb",!1)):workspace.slider=workspace.isMobile?new Slider("sliderBar","sliderThumb",!0,"pagerField"):new Slider("sliderBar","sliderThumb",!1);workspace.popovers.init();window.addEventListener("resize",function(){workspace.handleResize()},
!1);this.detectFirstRun()&&window.setTimeout(function(){workspace.toolbars.toggle();workspace.isTablet&&workspace.publicationTitle.showForAWhile(workspace.publicationTitle.time)},1E3);publicationData.slideshowAutostart&&("object"!=typeof workspace.buttons.list.slideShowButton&&workspace.slideShow.addSlideShowButton(),window.setTimeout(function(){workspace.slideShow.turnOnOff()},1E3));workspace.isLocal=/((.*\.local$)|(.*localhost.*)|(^192\.168(\.\d+){2})|(127\.0\.0\.1)|(^10(\.\d+){3})|(^172\.(1[6-9]|2\d+|3[0-1])(\.\d+){2}))/i.test(document.location.hostname);
workspace.isInit=!0}},toolbars:{isHide:!0,list:{},init:function(){for(var a=0,b=document.getElementsByClassName("toolbar");a<b.length;)this.list[b[a].id]=new Toolbar({divID:b[a].id}),a++;b=null;this.list.topToolbar.isActive=!0;this.list.pagerToolbar.isActive=!0;workspace.needZoomTolbar()&&(workspace.isMobile&&(this.list.zoomToolbar=Toolbar.create({divID:"zoomToolbar",isActive:!0,position:"bottom"}),workspace.createElement({id:"zoomOutField",cssClassName:"buttonsField horizontalField zoomField zoomOutField",
parent:this.list.zoomToolbar.div}),workspace.createElement({id:"zoomInField",cssClassName:"buttonsField horizontalField zoomField zoomInField",parent:this.list.zoomToolbar.div})),workspace.isTablet&&(this.list.zoomToolbar=Toolbar.create({divID:"zoomToolbar",isActive:!0,position:"right"}),workspace.createElement({id:"zoomInField",cssClassName:"buttonsField horizontalField zoomField zoomInField",parent:this.list.zoomToolbar.div}),workspace.createElement({id:"zoomOutField",cssClassName:"buttonsField horizontalField zoomField zoomOutField",
parent:this.list.zoomToolbar.div}),workspace.addCssClass(this.list.zoomToolbar.div,"tablet")),workspace.isMobile&&(this.list.zoomToolbar.zoomPager=PagerLite.create({parent:this.list.zoomToolbar.div,insertBefore:this.list.zoomToolbar.div.firstChild,connectSlider:!0})));workspace.isTablet&&(workspace.addCssClass(this.list.topToolbar.div,"tablet"),workspace.addCssClass(this.list.pagerToolbar.div,"tablet"));workspace.isMobile&&workspace.addCssClass(this.list.pagerToolbar.div,"mobile");publicationData.visibility.search&&
(a=el.id("resultField"),b=workspace.createElement({id:"resultInner",cssClassName:"resultInner",parent:a}),this.list.searchToolbar.currentResultNumber=workspace.createElement({id:"currentResultNumber",cssClassName:"currentResultNumber",parent:b}),b.innerHTML+=" / ",this.list.searchToolbar.resultCount=workspace.createElement({id:"resultCount",cssClassName:"resultCount",parent:b}),b.innerHTML+=" "+LOCALS.COINCEDENCES,delete a,workspace.isTablet&&(delete PagerLite.create({parent:this.list.searchToolbar.div,
insertBefore:this.list.searchToolbar.div.firstChild,connectSlider:!1}),workspace.addCssClass(this.list.searchToolbar.div,"tablet")));var c=this;customEvents.addListener(IOS_FULLSCREEN,function(a){"in"==a.data.state||520==window.innerHeight?c.enterFullScreenMode():"out"==a.data.state&&c.leaveFullScreenMode()});system.device.iphone&&!system.publisher.isOn&&520==window.innerHeight&&window.setTimeout(function(){c.enterFullScreenMode();system.browser.fullscreen=!0;c.prevWidth=window.innerWidth;c.prevHeight=
window.innerHeight},500)},enterFullScreenMode:function(){for(var a in this.list)workspace.checkCssClass(this.list[a].div,"bottom")&&(workspace.addCssClass(this.list[a].div,"fullscreen"),this.list[a].div.style.top=window.innerHeight-el.id("pagerToolbar").offsetHeight+"px");workspace.slider.handleResize()},leaveFullScreenMode:function(){for(var a in this.list)workspace.checkCssClass(this.list[a].div,"bottom")&&(workspace.delCssClass(this.list[a].div,"fullscreen"),this.list[a].div.style.top="");workspace.slider.handleResize()},
toggle:function(){for(var a in this.list)this.list[a].isActive&&this.list[a].toggle();workspace.toolbars.isHide=workspace.toolbars.isHide?!1:!0}},buttons:{list:{},init:function(){if(publicationData.visibility.toc||publicationData.visibility.bookmarks)this.list.listButton=new Button({id:"listButton",field:"listField",fontImage:!0,pressing:!0,able:!0,event:SINGLE_CLICK}),publicationData.visibility.bookmarks&&!publicationData.visibility.toc&&workspace.shiftCssClasses(this.list.listButton.div,"listButton",
"bmButton");if(publicationData.shopInfo&&publicationData.shopInfo.usePublicationCart){this.list.cartButton=new Button({id:"cartButton",field:"cartField",fontImage:!0,pressing:!0,able:!0,event:SINGLE_CLICK});this.cartButtonCheckState();cart.on("change",this.cartButtonCheckState,this);var a=1}else a=0;if(publicationData.visibility.bookmarks&&(this.list.addButton=new Button({id:"addButton",field:"addField",fontImage:!0,pressing:!0,able:!0,event:SINGLE_CLICK}),customEvents.addListener(ADD_BM,function(){workspace.buttons.addBmButtonCheckState()}),
customEvents.addListener(REMOVE_BM,function(){workspace.buttons.addBmButtonCheckState()}),!publicationData.visibility.toc)){var b=this.list.listButton;bm.isEmpty()&&b.makeDisable();customEvents.addListener(ADD_BM,function(){b.makeAble()});customEvents.addListener(REMOVE_BM,function(){bm.isEmpty()&&b.makeDisable()})}publicationData.visibility.search&&(this.list.searchButton=new Button({id:"searchButton",field:"searchField",fontImage:!0,pressing:!0,able:!0,event:SINGLE_CLICK}),this.list.closeResultButton=
new Button({id:"closeResultButton",field:"closeResultField",fontImage:!0,pressing:!0,able:!0,event:SINGLE_CLICK}),this.list.prevResultButton=new Button({id:"prevResultButton",field:"prevResultField",fontImage:!0,pressing:!0,able:!0,event:SINGLE_CLICK}),this.list.nextResultButton=new Button({id:"nextResultButton",field:"nextResultField",fontImage:!0,pressing:!0,able:!0,event:SINGLE_CLICK}));workspace.isMobile||(this.list.infoButton=new Button({id:"infoButton",field:"infoField",fontImage:!0,pressing:!0,
able:!0,event:SINGLE_CLICK}));with(publicationData.visibility)if(workspace.isTablet&&(downloads&&(this.list.downloadButton=new Button({id:"downloadButton",field:"downloadField",fontImage:!0,pressing:!0,able:!0,event:SINGLE_CLICK})),share&&(this.list.shareButton=new Button({id:"shareButton",field:"shareField",fontImage:!0,pressing:!0,able:!0,event:SINGLE_CLICK})),slideshow&&(this.list.slideShowButton=new Button({id:"slideShowButton",field:"navigationField",fontImage:!0,pressing:!0,able:!0,event:SINGLE_CLICK}),
customEvents.addListener(ZOOM_ANIMATION_START,function(){workspace.slideShow.stop()}))),workspace.isMobile)if(1<downloads+share+slideshow+1){var a=5-(toc||bookmarks)-bookmarks-search-a,c=0>a-slideshow-downloads-share-1;c&&(a-=1);0<a&&(workspace.createElement({id:"infoField",cssClassName:"buttonsField horizontalField rightField infoField",parent:workspace.toolbars.list.topToolbar.div}),this.list.infoButton=Button.create({id:"infoButton",field:"infoField",fontImage:!0,pressing:!0,able:!0,event:SINGLE_CLICK}),
a-=1);0<a&&downloads&&(workspace.createElement({id:"downloadField",cssClassName:"buttonsField horizontalField rightField downloadField",parent:workspace.toolbars.list.topToolbar.div}),this.list.downloadButton=Button.create({id:"downloadButton",field:"downloadField",fontImage:!0,pressing:!0,able:!0,event:SINGLE_CLICK}),a-=1);0<a&&share&&(workspace.createElement({id:"shareField",cssClassName:"buttonsField horizontalField rightField shareField",parent:workspace.toolbars.list.topToolbar.div}),this.list.shareButton=
Button.create({id:"shareButton",field:"shareField",fontImage:!0,pressing:!0,able:!0,event:SINGLE_CLICK}),a-=1);0<a&&slideshow&&(workspace.createElement({id:"slideShowField",cssClassName:"buttonsField horizontalField rightField slideShowField",parent:workspace.toolbars.list.topToolbar.div,insertBefore:el.id("moreField")}),this.list.slideShowButton=Button.create({id:"slideShowButton",field:"slideShowField",fontImage:!0,pressing:!0,able:!0,event:SINGLE_CLICK}),customEvents.addListener(ZOOM_ANIMATION_START,
function(){workspace.slideShow.stop()}),a-=1);c?this.list.moreButton=new Button({id:"moreButton",field:"moreField",fontImage:!0,pressing:!0,able:!0,event:SINGLE_CLICK}):el.del("moreField")}else 1==downloads+share+slideshow+1&&(workspace.createElement({id:"infoField",cssClassName:"buttonsField horizontalField rightField infoField",parent:workspace.toolbars.list.topToolbar.div}),this.list.infoButton=Button.create({id:"infoButton",field:"infoField",fontImage:!0,pressing:!0,able:!0,event:SINGLE_CLICK}),
downloads&&(this.list.downloadButton=new Button({id:"downloadButton",field:"moreField",fontImage:!0,pressing:!0,able:!0,event:SINGLE_CLICK})),share&&(this.list.shareButton=new Button({id:"shareButton",field:"moreField",fontImage:!0,pressing:!0,able:!0,event:SINGLE_CLICK})),slideshow&&(this.list.slideShowButton=new Button({id:"slideShowButton",field:"moreField",fontImage:!0,pressing:!0,able:!0,event:SINGLE_CLICK}),customEvents.addListener(ZOOM_ANIMATION_START,function(){workspace.slideShow.stop()})));
"undefined"!=typeof workspace.toolbars.list.zoomToolbar&&(this.list.zoomInButton=Button.create({id:"zoomInButton",field:"zoomInField",fontImage:!0,pressing:!0,able:!0,event:SINGLE_CLICK}),this.list.zoomOutButton=Button.create({id:"zoomOutButton",field:"zoomOutField",fontImage:!0,pressing:!0,able:!1,event:SINGLE_CLICK}),customEvents.addListener(ZOOM_LEVEL_CHANGED_FOR_WORKSPACE,function(a){a=a.data;with(workspace.buttons.list)a.isLargest?zoomInButton.makeDisable():zoomInButton.makeAble(),a.isSmallest?
zoomOutButton.makeDisable():zoomOutButton.makeAble()}));this.pageTurnHandler(pageMediator.page)},pageTurnHandler:function(a){publicationData.visibility.bookmarks&&this.addBmButtonCheckState();workspace.isTablet&&("undefined"!=typeof workspace.popovers.downloadOver&&!0==workspace.popovers.downloadOver.isVisible&&workspace.popovers.downloadOver.redrawContent(),"undefined"!=typeof workspace.popovers.shareOver&&!0==workspace.popovers.shareOver.isVisible&&workspace.popovers.shareOver.redrawContent())},
addBmButtonCheckState:function(){bm.isBookmark(pageMediator.page)?workspace.addCssClass(workspace.buttons.list.addButton.div,"remButton"):workspace.delCssClass(workspace.buttons.list.addButton.div,"remButton")},cartButtonCheckState:function(){0===cart.length()?(workspace.buttons.list.cartButton.makeDisable(),workspace.delCssClass(workspace.buttons.list.cartButton.div,"fullCartButton")):(workspace.buttons.list.cartButton.makeAble(),workspace.addCssClass(workspace.buttons.list.cartButton.div,"fullCartButton"))}},
popovers:{oneOfPopoversIsVisible:!1,hideAll:function(a){for(var b in this)this[b]instanceof Popover&&"notify"!=this[b].state&&this[b].isVisible&&this[b].hide()},init:function(){this.tocPopover=new Popover({id:"tocOver",parent:"body",horisontalPosition:"left",state:"toc"});with(this.tocPopover)publicationData.visibility.toc!=publicationData.visibility.bookmarks?(publicationData.visibility.bookmarks&&(this.tocPopover.state="bm"),addLabel({twoTabs:!1,text:{toc:LOCALS.TOC,bm:LOCALS.BOOKMARKS}[state]}),
customEvents.addListener(ADD_BM,function(){(state="bm")&&redrawContent()}),customEvents.addListener(REMOVE_BM,function(){(state="bm")&&redrawContent()})):addLabel({twoTabs:!0}),addContent();this.searchPopover=new Popover({id:"searchOver",parent:"body",horisontalPosition:"left",state:"search"});customEvents.addListener(START_SEARCH,function(a){popoverContent.search.handleSearchStart(a.data)});customEvents.addListener(SHOW_SEARCH_RESULTS,function(a){popoverContent.search.handleSearchResults(a.data)});
with(this.searchPopover)workspace.needIosSkin&&workspace.isMobile||addLabel({text:LOCALS.SEARCH,back:!1}),addContent()}},slideShow:{isActive:!1,time:3E3,startTimer:function(a){pageMediator.isLast()?!0==publicationData.slideShowLoop?this.timeout=window.setTimeout(function(){pageMediator.goToPage(1)},a):this.turnOnOff():this.timeout=window.setTimeout(function(){publicationData.rtlMode?pageMediator.left():pageMediator.right()},a)},stopTimer:function(){window.clearTimeout(this.timeout)},animationEndHandler:function(a){this.isActive&&
(this.stopTimer(),this.startTimer("undefined"!=typeof publicationData.page[pageMediator.page].slideDelay?1E3*publicationData.page[pageMediator.page].slideDelay:1E3*publicationData.page.defaults.slideDelay))},animationStartHandler:function(a){this.isActive&&this.stopTimer()},start:function(){this.isActive||this.turnOnOff()},stop:function(){this.isActive&&this.turnOnOff()},turnOnOff:function(){function a(){c.animationStartHandler.call(c)}this.isActive=!this.isActive;for(var b in workspace.buttons.list)"slideShowButton"==
b||"listButton"==b&&!publicationData.visibility.toc&&bm.isEmpty()||(this.isActive?workspace.buttons.list[b].makeDisable():workspace.buttons.list[b].makeAble());"undefined"!=typeof workspace.buttons.list.slideShowButton&&(workspace.changeCssClass(workspace.buttons.list.slideShowButton.div,"slideShowPauseButton"),workspace.changeCssClass(workspace.buttons.list.slideShowButton.div,"slideShowButton"));var c=this;b=function(){c.animationEndHandler.call(c,event)};this.isActive?(customEvents.addListener(PAGE_CONTENT_DISPLAYED,
b),this.pageEventNumber=pageMediator.addListener(a,!0),c.startTimer("undefined"!=typeof publicationData.page[pageMediator.page].slideDelay?1E3*publicationData.page[pageMediator.page].slideDelay:1E3*publicationData.page.defaults.slideDelay)):(customEvents.removeListener(PAGE_CONTENT_DISPLAYED,b),pageMediator.removeListener(a),c.stopTimer())},addSlideShowButton:function(){var a=workspace.createElement({id:"slideShowField",cssClassName:"buttonsField horizontalField leftField slideShowField",parent:workspace.toolbars.list.pagerToolbar.div,
insertBefore:workspace.toolbars.list.pagerToolbar.div.firstChild});workspace.buttons.list.slideShowButton=Button.create({id:"slideShowButton",fontImage:!0,field:a.id,pressing:!0,able:!0,event:SINGLE_CLICK});customEvents.addListener(ZOOM_ANIMATION_START,function(){workspace.slideShow.stop()});workspace.slider.handleResize();delete null},delSlideShowButton:function(){el.del(workspace.buttons.list.slideShowButton.field.id);workspace.buttons.list.slideShowButton=null;delete workspace.buttons.list.slideShowButton;
workspace.slider.handleResize()}},preloader:{init:function(){system.platform.ios||(document.styleSheets[0].insertRule("@-webkit-keyframes preloaderMove {from {-webkit-transform: rotate(0deg);}  to {-webkit-transform: rotate(360deg);} }",1),delete "@-webkit-keyframes preloaderMove ",delete "{from {-webkit-transform: rotate(0deg);}  to {-webkit-transform: rotate(360deg);} }")},add:function(a){var b=system.platform.ios?"preloader ios":"preloader android";"undefined"!=typeof a?workspace.createElement({type:"div",
id:a.id+"Preloader",cssClassName:b,parent:a}):workspace.createElement({type:"div",id:"bodyPreloader",cssClassName:b,parent:el.id("body")})},del:function(a){"undefined"!=typeof a?el.del(a.id+"Preloader"):el.del("bodyPreloader")}},pager:{isEdit:!1,init:function(){this.pagerDiv=el.id("pagerField");if("undefined"==typeof this.pagerDiv)return!1;this.labelField=el.id("pagerCurrentPage");this.inputField=el.id("inputPage");this.lastPage=el.id("lastPage");var a="medium";switch((publicationData.pageUserCount+
"").length){case 1:a="small";break;case 3:a="large";break;case 4:a="larger"}workspace.addCssClass(this.pagerDiv,a);this.inputField.setAttribute("type",system.platform.ios?"number":"text");this.inputField.setAttribute("autofocus","autofocus");this.labelField.innerHTML=pageTable.getCaption(pageMediator.page);var b=this,a=function(){"undefined"!=typeof b.labelField&&(b.labelField.innerHTML=pageTable.getCaption(pageMediator.page));b.isEdit&&b.hideInputField()};customEvents.addListener(ROTATE_DEVICE,a);
customEvents.addListener(CHANGE_BOOK_TYPE,a);this.lastPage.innerHTML="/ "+publicationData.pageUserCount;system.platform.ios?this.inputField.addEventListener("keydown",function(){b.handleKeydown.call(b,event)}):this.inputField.addEventListener("keypress",function(){b.handleKeydown.call(b,event)});pageMediator.addListener(function(a){workspace.pager.changeLabel.call(b,a)});customEvents.addListener(SLIDER_TO_PAGER_CHANGE_LABEL,function(a){b.changeLabel(a.data.page)});setClickEvents(b.pagerDiv,!1);this.pagerDiv.addEventListener(UP_EVENT,
function(a){b.showInputField.call(b,a)});this.inputField.addEventListener("focusout",function(){b.hideInputField()})},handleKeydown:function(a){a.target=a.target?a.target:a.srcElement;13==a.keyCode?(a=parseInt(a.target.value),isNaN(a)||(a>publicationData.pageUserCount&&(a=publicationData.pageUserCount),a=pageTable.getFileIDFromUserID(a),pageMediator.goToPage(a)),this.hideInputField(),this.inputField.blur()):system.platform.ios&&window.self!=window.top&&(a.preventDefault(),this.inputField.value+=String.fromCharCode(a.keyCode))},
changeLabel:function(a){this.labelField.firstChild.data=pageTable.getCaption(a);this.isEdit&&this.hideInputField()},showInputField:function(a){workspace.delCssClass(this.inputField,"invisible");workspace.addCssClass(this.labelField,"invisible");this.inputField.removeAttribute("readonly","readonly");this.inputField.removeAttribute("disabled","true");this.inputField.value="";this.inputField.select();this.inputField.focus();this.isEdit=!0;if(!system.platform.ios){this.isBlocked=!0;var b=this;window.setTimeout(function(){b.isBlocked=
!1;b.inputField.select();b.inputField.focus()},1E3)}},hideInputField:function(){if(this.isBlocked)return this.inputField.select(),this.inputField.focus(),!1;workspace.addCssClass(this.inputField,"invisible");this.inputField.value="";workspace.delCssClass(this.labelField,"invisible");this.inputField.setAttribute("readonly","readonly");this.inputField.setAttribute("disabled","true");this.inputField.blur();this.isEdit=!1}},notification:function(a){arguments.callee.count=arguments.callee.count||0;arguments.callee.count++;
var b=new Popover({parent:"body",id:"notifyOver"+arguments.callee.count,horisontalPosition:"center",state:"notify",deleteAfterClose:!0,noCloseButton:!0});with(b)a.tip||addLabel({text:a.name,back:!1});this.addCssClass(b.div,"notify");this.addCssClass(b.contentDiv,"notificationText");b.contentDiv.innerHTML=a.text;b.reposition();window.setTimeout(function(){b.show()},0);"undefined"!=typeof a.time&&window.setTimeout(function(){b.hide()},a.time);return b},setPublicationTitle:function(){document.title=
window.PUBLICATION_NAME;workspace.isTablet&&(this.publicationTitle=new Popover({parent:"body",id:"publicationTitle",horisontalPosition:"center",state:"notify",deleteAfterClose:!1,noCloseButton:!0}),this.publicationTitle.time=1500,this.addCssClass(this.publicationTitle.div,"notify"),3==system.device.version&&this.addCssClass(this.publicationTitle.div,"V3"),this.addCssClass(this.publicationTitle.contentDiv,"notificationText"),this.publicationTitle.contentDiv.innerHTML=window.PUBLICATION_NAME,this.publicationTitle.reposition())},
insertCssRules:function(){var a="#bgDiv, .pagerFont, .sliderBar, .sliderLabel, .popover.fixedHeightForToolbar, .popover.fixedHeightForToolbar:after, .closeButton.invisible, #publicationTitle, #publicationTitle *, .preloader ";this.buttons.needIosSkin&&(a+=", #pagerToolbar > #pagerField, #searchToolbar > #pagerField, #pagerCurrentPage, #lastPage, .sliderLabel > input.inputPage.invisible ");var b;document.styleSheets[0].insertRule(a+"{pointer-events: none;}",1);a=".buttonsField, .popover, .contentLabel, .contentLabel > .tocOverLabelButton, .contentLabel > .labelImage, .contentOuter ";
this.buttons.needIosSkin&&(a+=",input.inputPage, input.inputPage.invisible, .popover ");document.styleSheets[0].insertRule(a+"{pointer-events: auto;}",1);document.styleSheets[0].insertRule("input[type='search'].inputSearch::-webkit-input-placeholder { display: inline; color: rgba(225,225,225,0.2); font-size: inherit; line-height: 140%; text-shadow: none; }",1);a="input[type='search'].inputSearch::-webkit-search-cancel-button ";b=workspace.needIosSkin?"{-webkit-appearance: none; position: absolute; display: inline-block; width: 1em; height: 1em; top: 50%; right: 0px; bottom: 0px; margin: -0.5em 0.5em 0px 0px; padding: 0px;border-radius: 100%; background: url('"+
STYLES_FOLDER+"/buttons/exit.png'); background-repeat: no-repeat;background-position: center center; background-size: 100%; background-color: rgba(103,103,103,0.2);}":"{-webkit-appearance: none; position: absolute; display: inline-block; width: 2em; height: 1.5em; top: -1px; right: helppx; bottom: 0px; margin: 0px; padding: 0px;border-left: 1px solid rgb(134,125,125); border-radius: 4px; -webkit-border-radius: 4px; background: url('"+STYLES_FOLDER+"/buttons/exit.png'); background-repeat: no-repeat;background-position: center center; background-size: auto 100%; background-color: rgba(103,103,103,0.2); }";
document.styleSheets[0].insertRule(a+b,1);delete a;delete b},clickControl:function(a){a.x<system.device.width*workspace.flipAreaIOS?pageMediator.left():a.x>system.device.width*(1-workspace.flipAreaIOS)?pageMediator.right():(workspace.toolbars.toggle(),workspace.isTablet&&!workspace.toolbars.isHide&&workspace.publicationTitle.showForAWhile(workspace.publicationTitle.time))},clickControlSimple:function(a){var b=mainFrame.getBoundingClientRect();a.x-b.left<b.width*workspace.flipArea?(pageMediator.left(),
a.type==DOUBLE_CLICK&&pageMediator.left()):a.x-b.left>b.width*(1-workspace.flipArea)?(pageMediator.right(),a.type==DOUBLE_CLICK&&pageMediator.right()):a.type==SINGLE_CLICK?(workspace.toolbars.toggle(),workspace.isTablet&&!workspace.toolbars.isHide&&workspace.publicationTitle.showForAWhile(workspace.publicationTitle.time)):a.type==DOUBLE_CLICK&&customEvents.fireEvent(DOUBLE_TAP_FROM_WORKSPACE,a);delete null},storagePage:{init:function(a){if(!workspace.isLocalStorageSupported())return!1;var b=this;
publicationData.restoreSession&&(this.number=window.localStorage.getItem(publicationData.ident+"currentPage")||pageMediator.page,window.setTimeout(function(){pageMediator.goToPage(b.number)},0));pageMediator.addListener(function(a){b.set(a)})},set:function(a){window.localStorage.removeItem(publicationData.ident+"currentPage");window.localStorage.setItem(publicationData.ident+"currentPage",a)}},isLocalStorageSupported:function(){try{window.localStorage.setItem("localStorageIsSupported","true"),window.localStorage.removeItem("localStorageIsSupported")}catch(a){if(a.code==
DOMException.QUOTA_EXCEEDED_ERR)return!1}return!0},isPrivateIosBrowsing:function(){return system.platform.ios&&!this.isLocalStorageSupported()},detectFirstRun:function(){if(!this.isLocalStorageSupported())return!0;var a=publicationData.ident+"PreviouslyOpened",b;for(b in window.localStorage)if(b==a)return!1;window.localStorage.setItem(publicationData.ident+"PreviouslyOpened","true");return!0},checkOrientation:function(){return window.orientation!==this.previousOrientation?(this.previousOrientation=
window.orientation,!0):!1},handleResize:function(){!workspace.needIosSkin&&workspace.isTablet&&this.checkOrientation()&&(workspace.popovers.hideAll(),this.previousOrientation=window.orientation);for(var a in workspace.popovers)if("undefined"!=typeof workspace.popovers[a].isVisible){"center"==workspace.popovers[a].horisontalPosition&&workspace.popovers[a].reposition();var b=workspace.popovers[a].submenuList,c;for(c in b)"undefined"!=typeof b[c].scroll&&b[c].scroll.refresh()}this.slider.handleResize();
"undefined"!=typeof workspace.publicationTitle&&workspace.publicationTitle.reposition();this.slideShow.isActive&&this.slideShow.turnOnOff()},changeCssClass:function(a,b){-1==a.className.indexOf(b)?a.className=a.className+" "+b:a.className=a.className.replace(" "+b,"")},addCssClass:function(a,b){"undefined"!=a&&null!=a||console.log("element for CSS class "+b+" doesnt exist");null!=a.className?-1==a.className.indexOf(b)&&(a.className=a.className+" "+b):a.className=b},delCssClass:function(a,b){-1!=a.className.indexOf(b)&&
(a.className=a.className.replace(" "+b,""))},shiftCssClasses:function(a,b,c){-1!=a.className.indexOf(b)&&(a.className=a.className.replace(b,c))},checkCssClass:function(a,b){return-1!=a.className.indexOf(b)},createElement:function(a){a.type=a.type||"div";var b=el.add(a.type);"undefined"==typeof a.id?console.log("ERROR while adding child to "+a.parent.id):b.setAttribute("id",a.id);"undefined"!=typeof a.cssClassName&&(b.className=a.cssClassName);"undefined"==typeof a.insertBefore?a.parent.appendChild(b):
a.parent.insertBefore(b,a.insertBefore);"undefined"!=typeof a.text&&b.appendChild(document.createTextNode(a.text));return el.id(b.id)},setText:function(a,b){for(var c=el.id(a);c.lastChild;)c.removeChild(c.lastChild);"undefined"!=typeof b&&c.appendChild(document.createTextNode(b));delete null},existInDOM:function(a){a=el.id(a);return"undefined"!=typeof a&&null!=a?!0:!1},deleteUnnecessaryHTML:function(){!publicationData.visibility.downloads||publicationData.downloads.publicationDownload||publicationData.downloads.pageDownload||
PUBL&&system.device.model&&system.platform.android&&2<system.device.version||PUBL&&system.platform.ios&&6<=system.platform.version[0]||(publicationData.visibility.downloads=!1);with(publicationData.visibility)if(toc||bookmarks||!workspace.existInDOM("listField")||el.del("listField"),!bookmarks&&workspace.existInDOM("addField")&&el.del("addField"),downloads&&!workspace.isMobile||!workspace.existInDOM("downloadField")||el.del("downloadField"),search||(workspace.existInDOM("searchField")&&el.del("searchField"),
workspace.existInDOM("searchToolbar")&&el.del("searchToolbar")),slideshow&&!workspace.isMobile||!workspace.existInDOM("slideShowField")||el.del("slideShowField"),share&&!workspace.isMobile||!workspace.existInDOM("shareField")||el.del("shareField"),(!(downloads||share||slideshow)||workspace.isTablet)&&workspace.existInDOM("moreField"))el.del("moreField");else if(1==downloads+share+slideshow+1&&workspace.existInDOM("moreField")){var a=el.id("moreButton"),b=(downloads?"download":share?"share":"slideShow")+
"Button";a.setAttribute("id",b);workspace.delCssClass(a,"moreButton");workspace.addCssClass(a,b)}},setWorkspaceSize:function(){window.setTimeout(function(){var a=parseInt(document.defaultView.getComputedStyle(el.id("body"),null).getPropertyValue("font-size"));if(20<=a){var b=Math.sqrt(window.outerWidth*window.outerHeight)/1500*window.devicePixelRatio,a=Math.ceil(5*(a/2)*b/4);10>a&&(a=12);el.id("body").style.fontSize=a+"px"}},1E3)},needZoomTolbar:function(){return system.publisher.isOn?!1:"undefined"!=
typeof WORKSPACE_ZOOM?WORKSPACE_ZOOM:!1}};
