!function(a){"use strict";function b(){function b(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 c="undefined",d="object",e="Shockwave Flash",f="ShockwaveFlash.ShockwaveFlash",g="application/x-shockwave-flash",h=[0,0,0],i=navigator.platform.toLowerCase(),j=this.ua.match(/(opera|ie|firefox|chrome|version)[\s\/:]([\w\d\.]+)?.*?(safari|version[\s\/:]([\w\d\.]+)|$)/)||[null,"unknown",0];if(typeof navigator.plugins!==c&&typeof navigator.plugins[e]===d){var k=navigator.plugins[e].description;if(k&&(typeof navigator.mimeTypes==c||!navigator.mimeTypes[g]||navigator.mimeTypes[g].enabledPlugin)){var l=!1;k=k.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),h[0]=parseInt(k.replace(/^(.*)\..*$/,"$1"),10),h[1]=parseInt(k.replace(/^.*\.(.*)\s.*$/,"$1"),10),h[2]=/[a-zA-Z]/.test(k)?parseInt(k.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else if(typeof window.ActiveXObject!==c)try{var m=new ActiveXObject(f);m&&(k=m.GetVariable("$version"),k&&(l=!0,k=k.split(" ")[1].split(","),h=[parseInt(k[0],10),parseInt(k[1],10),parseInt(k[2],10)]))}catch(n){}this.flash=0===h[0]&&0===h[1]&&0===h[2]?!1:!0,this.publisher={},this.publisher.isOn="undefined"!=typeof b("publisher"),this.browser={},this.platform={},this.device={},this.browser.name="version"==j[1]?j[3]:j[1],this.browser.name="unknown"==this.browser.name?"safari":this.browser.name,this.browser[this.browser.name]=!0;var o="ie"==j[1]&&document.documentMode;if(this.browser.version=o||parseFloat("opera"==j[1]&&j[4]?j[4]:j[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)/)||i.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 p=this.ua.match(/os\sx\s(\d+[\._]*\d*[\._]*\d*)/);this.platform.version="[object Array]"===Object.prototype.toString.call(p)&&p.length>1?p[1].split(/[\._]/):0}else if(this.platform.ios){var p=this.ua.match(/os\s(\d+_*\d*_*\d*)/);this.platform.version="[object Array]"===Object.prototype.toString.call(p)&&p.length>1?p[1].split("_"):0}else if(this.platform.android){var p=this.ua.match(/android\s(\d+\.*\d*\.*\d*)/);this.platform.version="[object Array]"===Object.prototype.toString.call(p)&&p.length>1?p[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":i.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),s=q&&this.browser.safari,t=r&&this.browser.chrome;if(this.isBasic||this.isMobile||this.isFlash||((q||r)&&"undefined"==typeof COMPATIBLE?this.isMobile=!0:s||t?this.isMobile=!0:this.flash&&this.device.pc&&(h[0]>10||10===h[0]&&h[1]>=3)?this.isFlash=!0:this.isBasic=!0),this._loadVersion(),this.device.android&&!this.browser.chrome){for(var u=document.getElementsByTagName("meta"),v=0;vb._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||2*this._getWindowWidth()*this.offset.top,c=Math.round(c);var d=this._getWindowWidth(),e=this._getWindowHeight(),f=d/e,g=a/b,h=Math.round(f>g?a*(e-c)/b:d-c),i=Math.round(f>g?e-c:b*(d-c)/a);return{width:Math.round(h),height:Math.round(i)}},b.prototype._getFitWidthSizes=function(a,b,c){c=c||2*this._getBoundingClientRect(document.body).width*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,this.lastFontSize=(this.newRect.width*this.currentZoom*20/this.pageRect.width).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=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.getAttribute("class").split(" ")[1],g=e.id;!function(a,c){b._addEvent(e,"click",function(){b._showVideo.call(b,a,c)})}(g,f)}this._sizeVideoIcons(),this._addEvent(window,"resize",function(){b._sizeVideoIcons()})},b.prototype._sizeVideoIcons=function(){for(var a=this._getElementsByClass("videoItem"),b=0,c=a.length;c>b;b++){var d=a[b],e=this._getBoundingClientRect(d),f=this._getElementsByClass("play",d)[0];if(f){var g=e.height>50?.35*e.height:.8*e.height;f.style.width=g+"px",f.style.height=g+"px",f.style.margin=-g/2+"px 0 0 "+-g/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.setAttribute("class","blackoutVideo"),document.body.appendChild(d),this._addEvent(d,"click",function(a){a.stopPropagation(),e._hideVideo.call(e)}),"youtube"===c?(this.videoFrame.className=this.videoFrame.getAttribute("class")+" youtube-player",this.videoFrame.src="http://www.youtube.com/embed/"+b+"?autoplay=1&html5=1"):this.videoFrame.src="http://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();var b=a.keyCode?a.keyCode:a.which;27===b&&e._hideVideo.call(e)}),this._addEvent(window,"resize",function(){e._resizeVideo()})},b.prototype._resizeVideo=function(){if(this.videoFrame){var a=this._getFitScreenSizes(1600,900,this._getWindowHeight()/10);this.videoFrame.setAttribute("class","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._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=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);