!function(a){"use strict";function b(){var a=-1;if("Microsoft Internet Explorer"==navigator.appName){var b=navigator.userAgent,c=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");null!=c.exec(b)&&(a=parseFloat(RegExp.$1))}else if("Netscape"==navigator.appName){var b=navigator.userAgent,c=new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})");null!=c.exec(b)&&(a=parseFloat(RegExp.$1))}return a}function c(){function c(b){var c=a.document.cookie.match(new RegExp("(?:^|; )"+b.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return c?decodeURIComponent(c[1]):void 0}this.isMobile=!1,this.isFlash=!1,this.isBasic=!1,this.ua=navigator.userAgent.toLowerCase();var d="undefined",e="object",f="Shockwave Flash",g="ShockwaveFlash.ShockwaveFlash",h="application/x-shockwave-flash",i=[0,0,0],j=navigator.platform.toLowerCase(),k=this.ua.match(/(opera|ie|firefox|chrome|version)[\s\/:]([\w\d\.]+)?.*?(safari|version[\s\/:]([\w\d\.]+)|$)/)||[null,"unknown",0];if(typeof navigator.plugins!==d&&typeof navigator.plugins[f]===e){var l=navigator.plugins[f].description;if(l&&(typeof navigator.mimeTypes==d||!navigator.mimeTypes[h]||navigator.mimeTypes[h].enabledPlugin)){var m=!1;l=l.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),i[0]=parseInt(l.replace(/^(.*)\..*$/,"$1"),10),i[1]=parseInt(l.replace(/^.*\.(.*)\s.*$/,"$1"),10),i[2]=/[a-zA-Z]/.test(l)?parseInt(l.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else if(typeof window.ActiveXObject!==d)try{var n=new ActiveXObject(g);n&&(l=n.GetVariable("$version"),l&&(m=!0,l=l.split(" ")[1].split(","),i=[parseInt(l[0],10),parseInt(l[1],10),parseInt(l[2],10)]))}catch(o){}0===i[0]&&0===i[1]&&0===i[2]?this.flash=!1:this.flash=!0,this.publisher={},this.publisher.isOn="undefined"!=typeof c("publisher"),this.browser={},this.platform={},this.device={},this.browser.name="version"==k[1]?k[3]:k[1],this.browser.name="unknown"==this.browser.name?"safari":this.browser.name,this.browser[this.browser.name]=!0;var p="ie"==k[1]&&document.documentMode;if(this.browser.version=p||parseFloat("opera"==k[1]&&k[4]?k[4]:k[2]),this.platform.name=this.ua.match(/ip(?:ad|od|hone)/)?"ios":this.ua.match(/(?:trident)/)?"win":(this.ua.match(/(?:webos|android|bada|symbian|palm|blackberry)/)||j.match(/mac|win|linux/)||["other"])[0],("ontouchstart"in window||navigator.MaxTouchPoints>0||navigator.msMaxTouchPoints>0)&&"win"===this.platform.name&&(this.platform.name="wphone"),this.platform[this.platform.name]=!0,this.platform.version=0,this.platform.mac){var q=this.ua.match(/os\sx\s(\d+[\._]*\d*[\._]*\d*)/);this.platform.version="[object Array]"===Object.prototype.toString.call(q)&&q.length>1?q[1].split(/[\._]/):0}else if(this.platform.ios){var q=this.ua.match(/os\s(\d+_*\d*_*\d*)/);this.platform.version="[object Array]"===Object.prototype.toString.call(q)&&q.length>1?q[1].split("_"):0}else if(this.platform.android){var q=this.ua.match(/android\s(\d+\.*\d*\.*\d*)/);this.platform.version="[object Array]"===Object.prototype.toString.call(q)&&q.length>1?q[1].split("."):0}switch(this.platform.verCheck=function(a){return 1*this.platform.version===1*a?0:1*a>1*this.platform.version?-1:1},this.device.name=this.ua.match(/ipad/)?"ipad":this.ua.match(/ipad/)?"ipad":this.ua.match(/iphone/)?"iphone":this.ua.match(/android/)?"android":j.match(/mac|win|linux/)?"pc":"other","wphone"===this.platform.name&&(this.device.name="wphone"),this.device[this.device.name]=!0,this.device.version=this.platform.version[0],this.device.type=this.ua.match(/(mobile\ssafari)|iphone|ipod/)?"mobile":"tablet",this.queryString=function(){var a={},b=window.location.search.substring(1);if(""===b)return a;for(var c=b.split("&"),d=0;d4||4===parseInt(this.platform.version[0],10)&&parseInt(this.platform.version[1],10)>=1),t=r&&this.browser.safari&&-1===b(),u=s&&this.browser.chrome&&-1===b();if(this.isBasic||this.isMobile||this.isFlash||((r||s)&&"undefined"==typeof COMPATIBLE?this.isMobile=!0:t||u?this.isMobile=!0:this.flash&&this.device.pc&&(i[0]>10||10===i[0]&&i[1]>=3)?this.isFlash=!0:this.isBasic=!0),this._loadVersion(),this.device.android&&!this.browser.chrome){for(var v=document.getElementsByTagName("meta"),w=0;wb._getWindowHeight.call(b)||b.currentWindowWidth>b.currentWindowHeight&&b._getWindowWidth.call(b)d;d++){var f=c[d];f.href=f.href+"?v=basic"}}b.prototype._popUp=function(){var a=function(){document.getElementById("infoPopUp").style.display="none",document.getElementById("popUp").style.display="none"},b=function(){document.getElementById("infoPopUp").style.display="block",document.getElementById("popUp").style.display="block"};this._addEvent(document.getElementById("infoPopUp"),"click",a),this._addEvent(document.getElementById("closeButton"),"click",a),this._addEvent(document.getElementById("verContainer"),"click",b)},b.prototype._mobileMenu=function(){if(document.getElementById("mobileMenuButton")){var b=this;"ontouchstart"in document.documentElement&&(!a.detector.platform.android||a.detector.browser.chrome||a.detector.browser.opera||a.detector.browser.firefox)?(document.getElementById("mobileMenuButton").addEventListener("touchstart",function(a){a.preventDefault(),a.stopPropagation()}),document.getElementById("mobileMenuButton").addEventListener("touchend",function(a){a.stopPropagation(),a.preventDefault(),"close"===b.mobileMenu?b._mobileMenuOpen.call(b):b._mobileMenuClose.call(b)}),document.getElementById("mainFrame").addEventListener("touchend",function(){event.stopPropagation(),"close"!==b.mobileMenu&&b._mobileMenuClose.call(b)})):(this._addEvent(document.getElementById("mobileMenuButton"),"click",function(){event.stopPropagation(),event.preventDefault(),"close"===b.mobileMenu?b._mobileMenuOpen.call(b):b._mobileMenuClose.call(b)}),this._addEvent(document.getElementById("mainFrame"),"click",function(){"close"!==b.mobileMenu&&b._mobileMenuClose.call(b)}))}},b.prototype._mobileMenuOpen=function(){document.getElementById("mainFrame").className="mainFrame openMenu",this.mobileMenu="open"},b.prototype._mobileMenuClose=function(){document.getElementById("mainFrame").className="mainFrame closeMenu",this.mobileMenu="close"},b.prototype._socialButtons=function(b){var c=a.FILES_FOLDER||"files",d=a.MAIN_PAGE||"index.html";if(document.getElementById("facebookShare")){if("undefined"==typeof b){b=window.location.href;var e=new RegExp("/"+c+"/.*","i");b=b.replace(e,"/"+d)}b=encodeURIComponent(b);var f=encodeURIComponent(a.PUBLICATION_NAME);document.getElementById("facebookShare").setAttribute("href","//m.facebook.com/sharer.php?u="+b),document.getElementById("twitterShare").setAttribute("href","//twitter.com/intent/tweet?text="+f+"&url="+b),document.getElementById("linkedinShare").setAttribute("href","//www.linkedin.com/shareArticle?mini=true&url="+b+"&title="+f+"&summary="+f+"&source="+b),document.getElementById("tumblrShare").setAttribute("href","//www.tumblr.com/share/link?url="+b+"&name="+f),document.getElementById("googleShare").setAttribute("href","//plus.google.com/share?url="+b),document.getElementById("mailShare").setAttribute("href","mailto:?subject="+f+"&body="+b),document.getElementById("vkShare").setAttribute("href","//vk.com/share.php?url="+b+"&title="+f)}},b.prototype._zoomButtons=function(){function b(a,b,c,d,e){try{if(!a||!b)return!1;var f=a+"="+encodeURIComponent(b);return f+="; path=/",c&&(f+="; expires="+c.toGMTString()),d&&(f+="; domain="+d),e&&(f+="; secure"),document.cookie=f,!0}catch(g){console.log(g)}}if(document.getElementById("zoomIn")){if((window.PointerEvent||"ontouchstart"in window)&&!a.detector.device.pc)return void document.getElementById("zoomContainer").parentNode.removeChild(document.getElementById("zoomContainer"));var c=this,d=(this._getWindowWidth()-100)/this._getFitScreenSizes(this.pageRect.width,this.pageRect.height).width,e=new Date;e.setMonth(e.getMonth()+6),this._addEvent(document.getElementById("zoomIn"),"click",function(){c.currentZoom+.2>d||(c.currentZoom=c.currentZoom+.2,c._setSizes.call(c),c._fontCorrection.call(c))}),this._addEvent(document.getElementById("zoomOut"),"click",function(){1!==c.currentZoom&&(c.currentZoom=c.currentZoom-.2,c._setSizes.call(c),c._fontCorrection.call(c),b("zoom",c.currentZoom,e))})}},b.prototype._getFitScreenSizes=function(a,b,c){c=c||this._getWindowWidth()*(2*this.offset.top),c=Math.round(c);var d=this._getWindowWidth(),e=this._getWindowHeight(),f=d/e,g=0==b?0:a/b,h=Math.round(f>g?0==b?0:a*(e-c)/b:d-c),i=Math.round(f>g?e-c:0==a?0:b*(d-c)/a);return{width:Math.round(h),height:Math.round(i)}},b.prototype._getFitWidthSizes=function(a,b,c){c=c||this._getBoundingClientRect(document.body).width*(2*this.offset.top),c=Math.round(c);var d=this._getBoundingClientRect(document.body).width,e=Math.round(d-c),f=Math.round(b*(d-c)/a);return{width:Math.round(e),height:Math.round(f)}},b.prototype._setSizes=function(){var b=0,c=0;"undefined"!=typeof a.TOC_BOOK_HEIGHT?(this.newRect=a.detector.device.pc?this._getFitScreenSizes(this.pageRect.width,a.TOC_BOOK_HEIGHT):this._getFitWidthSizes(this.pageRect.width,a.TOC_BOOK_HEIGHT),this.pageContainer.style.width=this.newRect.width*this.currentZoom+"px",b=this._getWindowHeight()>this.pageRect.height*this.currentZoom?(this._getWindowHeight()-this.pageRect.height*this.currentZoom)/2:this._getWindowHeight()*this.offset.top,c=this._getWindowWidth()-100>this.newRect.width*this.currentZoom?(this._getWindowWidth()-this.newRect.width*this.currentZoom)/2+"px":this._getWindowWidth()*this.offset.left+"px"):(this.newRect=a.detector.device.pc?this._getFitScreenSizes(this.pageRect.width,this.pageRect.height):this._getFitWidthSizes(this.pageRect.width,this.pageRect.height),this.pageContainer.style.width=this.newRect.width*this.currentZoom+"px",this.pageContainer.style.height=this.newRect.height*this.currentZoom+"px",b=this._getWindowHeight()>this.newRect.height*this.currentZoom?(this._getWindowHeight()-this.newRect.height*this.currentZoom)/2:this._getWindowHeight()*this.offset.top,c=this._getWindowWidth()-100>this.newRect.width*this.currentZoom?(this._getWindowWidth()-this.newRect.width*this.currentZoom)/2+"px":this._getWindowWidth()*this.offset.left+"px"),this.pageContainer.style.left="0",b=b-45>10?b-45:10,"pc"!==a.detector.device.type&&(b=20),this.pageContainer.style.margin=b+"px 0 0 "+c;var d=0==this.pageRect.width?0:this.newRect.width*this.currentZoom*20/this.pageRect.width;this.lastFontSize=d.toFixed(6),document.body.style.fontSize=this.lastFontSize+"px"},b.prototype._fontCorrection=function(){for(var a=this._getElementsByClass("testString"),b=0,c=0,d=a.length;d>c;c++){var e=a[c],f=e.parentNode,g=this._getBoundingClientRect(e),h=this._getBoundingClientRect(f),i=this._getBoundingClientRect(document.getElementById("pageContainer")),j=0==i.width?0:h.width/i.width,k=g.width-h.width>0?(g.width-h.width)/h.width:0;k*=j,b=b>=k?b:k}document.body.style.fontSize=this.lastFontSize*(1-b)+"px"},b.prototype._parseVideos=function(){for(var a=this._getElementsByClass("videoItem"),b=this,c=0,d=a.length;d>c;c++){var e=a[c],f=e.className.split(" ")[1],g=VIDEOS_INFO[e.id],h=g.videoId;!function(a,c){b._addEvent(e,"click",function(){b._showVideo.call(b,a,c)})}(h,f);var i=g.thumb;i&&!function(a,c){var d=new Image;d.onload=function(a){c.style.backgroundImage="url('"+a.target.src+"')",b._sizeVideoIcon(c)},d.src=a}(i,e)}this._addEvent(window,"resize",function(a){b._sizeVideoIcons()})},b.prototype._sizeVideoIcons=function(){for(var a=this._getElementsByClass("videoItem"),b=0,c=a.length;c>b;b++)this._sizeVideoIcon(a[b])},b.prototype._sizeVideoIcon=function(a){var b=this._getBoundingClientRect(a),c=this._getElementsByClass("play",a)[0];if(c){var d=b.height>50?.35*b.height:.8*b.height;c.style.width=d+"px",c.style.height=d+"px",c.style.margin=-d/2+"px 0 0 "+-d/2+"px"}},b.prototype._showVideo=function(b,c){this.videoFrame=document.createElement("iframe");var d=document.createElement("div"),e=this;this._getFitScreenSizes(1600,900,this._getWindowHeight()/10);d.className="blackoutVideo",document.body.appendChild(d),this._addEvent(d,"click",function(a){a.stopPropagation?a.stopPropagation():a.returnValue=!1,e._hideVideo.call(e)}),"youtube"===c?(this.videoFrame.className=this.videoFrame.className+" youtube-player",this.videoFrame.src="//www.youtube.com/embed/"+b+"?autoplay=1&html5=1"):this.videoFrame.src="//player.vimeo.com/video/"+b+"?title=0&byline=0&portrait=0&color=da4541",a.detector.publisher.isOn&&(this.videoFrame.src+="&publisher=1"),document.body.appendChild(this.videoFrame),this._resizeVideo(),this._addEvent(a.document,"keyup",function(a){a.stopPropagation?a.stopPropagation():a.returnValue=!1;var b=a.keyCode?a.keyCode:a.which;27===b&&e._hideVideo.call(e)}),this._addEvent(window,"resize",function(a){e._resizeVideo()})},b.prototype._resizeVideo=function(){if(this.videoFrame){var a=this._getFitScreenSizes(1600,900,this._getWindowHeight()/10);this.videoFrame.className="videoFrame",this.videoFrame.setAttribute("type","text/html"),this.videoFrame.setAttribute("width",a.width+"px"),this.videoFrame.setAttribute("height",a.height+"px"),this.videoFrame.setAttribute("frameBorder","0"),this.videoFrame.style.top="50%",this.videoFrame.style.left="50%",this.videoFrame.style.margin=-a.height/2+"px 0 0 "+-a.width/2+"px"}},b.prototype._hideVideo=function(){var a=this._getElementsByClass("blackoutVideo");this.videoFrame&&this.videoFrame.parentNode.removeChild(this.videoFrame);for(var b=0,c=a.length;c>b;b++){var d=a[b];d.parentNode.removeChild(d)}this.videoFrame=!1},b.prototype._parseImages=function(){for(var b=this._getElementsByClass("imageItem"),c=this,d=0,e=b.length;e>d;d++){var f=b[d],g=f.id;!function(b){c._addEvent(f,"click",function(){"undefined"!=typeof a.GALLERY_CONTENT&&b in a.GALLERY_CONTENT&&c._showGallery.call(c,b)})}(g)}},b.prototype._showGallery=function(b){var c=document.createElement("div"),d=this;c.className="blackoutGallery",document.body.appendChild(c),this._addEvent(c,"click",function(a){a.stopPropagation?a.stopPropagation():a.returnValue=!1,d._hideGallery.call(d)});var e=document.createElement("img");e.className="galleryPreloader",e.setAttribute("src",a.DYNAMIC_FOLDER+"/basic-html/styles/preloader.gif"),document.body.appendChild(e),this.imageContainer=document.createElement("img"),this.imageContainer.className="galleryImage",this._addEvent(this.imageContainer,"load",function(){e&&e.parentNode.removeChild(e),d.imageContainerCloseButton=document.createElement("a"),d.imageContainerCloseButton.className="galleryCloseButton",d.imageContainerCloseButton.setAttribute("href","#"),document.body.appendChild(d.imageContainerCloseButton),d.imageContainerWidth=d.imageContainer.width,d.imageContainerHeight=d.imageContainer.height,d._resizeImage(),d._addEvent(d.imageContainerCloseButton,"click",function(a){a.stopPropagation?a.stopPropagation():a.returnValue=!1,d._hideGallery.call(d)})}),this._addEvent(this.imageContainer,"error",function(){e&&e.parentNode.removeChild(e)}),this.imageContainer.style.top="-1000%",this.imageContainer.style.left="-1000%",this.imageContainer.setAttribute("src",a.GALLERY_CONTENT[b][0]),document.body.appendChild(this.imageContainer),this._addEvent(a.document,"keyup",function(a){a.stopPropagation?a.stopPropagation():a.returnValue=!1;var b=a.keyCode?a.keyCode:a.which;27===b&&d._hideGallery.call(d)}),this._addEvent(window,"resize",function(a){d._resizeImage()})},b.prototype._resizeImage=function(){if(this.imageContainer&&this.imageContainerCloseButton){var a=6,b=this.imageContainerWidth,c=this.imageContainerHeight,d=30+.1*Math.max(this._getWindowWidth(),this._getWindowHeight()),e=this._getWindowWidth()-d,f=this._getWindowHeight()-d;if(this.imageContainer.style.backgroundColor="#FFFFFF",this.imageContainerWidth>e-2*a||this.imageContainerHeight>f-2*a){var g=this._getFitScreenSizes(this.imageContainerWidth,this.imageContainerHeight,d);this.imageContainer.setAttribute("width",g.width+"px"),this.imageContainer.setAttribute("height",g.height+"px"),this.imageContainer.style.margin=-(g.height/2+a)+"px 0 0 "+(-g.width/2-a)+"px",this.imageContainerCloseButton.style.margin=-(g.height/2+a+15)+"px 0 0 "+(g.width/2+a-15)+"px"}else this.imageContainer.setAttribute("width",b+"px"),this.imageContainer.setAttribute("height",c+"px"),this.imageContainer.style.margin=-(c/2+a)+"px 0 0 "+(-b/2-a)+"px",this.imageContainerCloseButton.style.margin=-(c/2+a+15)+"px 0 0 "+(b/2+a-15)+"px";this.imageContainer.style.borderWidth=a+"px",this.imageContainer.style.top="50%",this.imageContainer.style.left="50%"}},b.prototype._hideGallery=function(){var a=this._getElementsByClass("blackoutGallery"),b=this._getElementsByClass("galleryPreloader");this.imageContainer&&this.imageContainer.parentNode.removeChild(this.imageContainer),this.imageContainerCloseButton&&this.imageContainerCloseButton.parentNode.removeChild(this.imageContainerCloseButton);for(var c=0,d=a.length;d>c;c++){var e=a[c];e.parentNode.removeChild(e)}for(c=0,d=b.length;d>c;c++){var f=b[c];f.parentNode.removeChild(f)}this.imageContainer=!1,this.imageContainerCloseButton=!1,this.imageContainerHeight=this.imageContainerWidth=0},b.prototype._getBoundingClientRect=function(a){var b=a.getBoundingClientRect();return{width:b.width||b.right-b.left,height:b.height||b.bottom-b.top,left:b.left,right:b.right,top:b.top,bottom:b.bottom}},b.prototype._getWindowWidth=function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth},b.prototype._getWindowHeight=function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},b.prototype._getElementsByClass=function(b,c){if("undefined"==typeof c&&(c=a.document),"function"==typeof c.getElementsByClassName)return c.getElementsByClassName(b);var d=[],e=c.getElementsByTagName("*");for(var f in e)if(Object.prototype.hasOwnProperty.call(e,f)&&"object"==typeof e[f]){var g=Object.prototype.hasOwnProperty.call(e[f],"className")?e[f].className:e[f].getAttribute("className"),h=null===g?[]:g.split(" ");-1!==this._indexOf(h,b)&&d.push(e[f])}return d},b.prototype._addEvent=function(a,b,c){window.addEventListener?a.addEventListener(b,c,!0):a.attachEvent("on"+b,c)},b.prototype._indexOf=function(a,b){if(null==a)return-1;var c,d;for(c=0,d=a.length;d>c;c++)if(c in a&&a[c]===b)return c;return-1},b.prototype._setFrame=function(){navigator.userAgent.match(/iPad;.*CPU.*OS 7_\d/i)&&(document.body.style.height=this._getWindowHeight()+"px"),window.scrollTo(0,0)},a.BasicPage=b;var c=function(){"undefined"==typeof a.BASIC_PAGE&&(a.BASIC_PAGE=new b)};window.addEventListener?a.addEventListener("load",c,!0):a.attachEvent("onload",c)}(this);