// Created 12/11/2013 12:56:09 PM
var el={canvas:{},cTest:!1,id:function(a){return document.getElementById(a)},tag:function(a){return document.getElementsByTagName(a)[0]},tags:function(a){return document.getElementsByTagName(a)},add:function(a){return document.createElement(a)},css:function(a,c){for(var b in c)c.hasOwnProperty(b)&&(a.style[b]=c[b])},del:function(a){fbUtils.isString(a)?system.publisher.isOn?null!=document.getElementById(a)&&el.id(a).parentNode.removeChild(el.id(a)):el.id(a)&&el.id(a).parentNode.removeChild(el.id(a)):
a.parentNode.removeChild(a);return document.createElement(tag)},del:function(a){system.publisher.isOn?fbUtils.isString(a)?null!=document.getElementById(a)&&el.id(a).parentNode.removeChild(el.id(a)):a.parentNode.removeChild(a):fbUtils.isString(a)?el.id(a)&&el.id(a).parentNode.removeChild(el.id(a)):a.parentNode.removeChild(a)},Class:function(a){return document.getElementsByClassName(tag)},createElement:function(a,c,b,e){b=b||-1;a=document.createElement(a);for(var d in c)c.hasOwnProperty(d)&&("styles"!=
d?a.setAttribute(d,c[d]):this.css(a,c.styles));for(d in e)e.hasOwnProperty(d)&&(a[d]=e[d]);-1!=b&&(fbUtils.isString(b)?document.getElementById(b).appendChild(a):b.appendChild(a));return a},clear:function(a){fbUtils.isString(a)&&(a=a.id(a));a.innerHTML=""}},fbUtils={SPLITTERS:[",",";","."," ","?","!","'",'"',"",String.fromCharCode(10),String.fromCharCode(13),String.fromCharCode(8211),String.fromCharCode(8212),String.fromCharCode(8722),String.fromCharCode(8209),String.fromCharCode(8208)],split:function(a,
c){for(var b=a.split(" "),e=[],d=0;d<b.length;d++)b[d].length>=c&&e.push(b[d]);return e},isSplitter:function(a){for(var c=0;c<this.SPLITTERS.length;c++)if(a==this.SPLITTERS[c])return!0;return!1},getNum:function(a){var c="000"+a;9<a&&(c="00"+a);99<a&&(c="0"+a);999<a&&(c=""+a);return c},hexToRGB:function(a){function c(a){return"#"==a.charAt(0)?a.substring(1,7):a}var b=parseInt(c(a).substring(0,2),16),e=parseInt(c(a).substring(2,4),16);a=parseInt(c(a).substring(4,6),16);return b+","+e+","+a},findArr:function(a,
c){for(i in a)if(1*a[i]===1*c)return i},getMaxZoom:function(a,c,b){return Math.sqrt((a||52E5)/(c*b))},isFunction:function(a){return"[object Function]"===Object.prototype.toString.call(a)},isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)},isString:function(a){return"[object String]"===Object.prototype.toString.call(a)},screening:function(a){return a.replace(/</ig,function(a){return"&lt;"})},formatPrice:function(a){a=parseFloat((a+"").replace(publicationData.shopInfo.currency.decimalSeparator,
".").replace(/[^0-9\.]+/ig,"")).toFixed(publicationData.shopInfo.currency.accuracy);var c=a.split(".");a=c[1];c=c[0];c=this.chunk(c.reverse(),3).join(publicationData.shopInfo.currency.thousandsDelimiter).reverse();a=publicationData.shopInfo.hideZeroDecimals&&0==a?c:c+publicationData.shopInfo.currency.decimalSeparator+a;return a=publicationData.shopInfo.currency.placeSymbolAfterPrice?a+""+publicationData.shopInfo.currency.symbol:publicationData.shopInfo.currency.symbol+""+a},chunk:function(a,c){"undefined"===
typeof c&&(c=2);return a.match(RegExp(".{1,"+c+"}","g"))||[]},objectSize:function(a){var c=0,b;for(b in a)a.hasOwnProperty(b)&&c++;return c},modifyBookData:function(){function a(a,c,d){b[b.length]={};for(var f in a)b[b.length-1][f]=a[f];e[c]=b.length-1;b[b.length-1].fileID=c;b[b.length-1].realWide=d;b[b.length-1].wide=!1}function c(a){for(var b=0,c=a.length;b<c;b++)a[b].page&&(a[b].page=e[a[b].page])}for(var b=[0],e={},d=1;d<=publicationData.pageCount;d++){var f=publicationData.page[d];publicationData.page[d].wide?
(a(f,d,!0),a(f,d,!0)):a(f,d,!1)}d=1;for(f=b.length;d<f;d++)b[d].links&&c(b[d].links),publicationData.page[d]=b[d];publicationData.pageCount=b.length-1;b=null}};String.prototype.reverse=function(){return this.split("").reverse().join("")};
var iOS7LandscapeHeightBugFix=function(){"7"===system.device.version&&(el.id("body").style.height=window.innerHeight+"px",scrollTo(0,document.documentElement.getBoundingClientRect().top),"undefined"!==typeof customEvents&&customEvents.fireEvent(ROTATE_DEVICE))},generatePreloader=function(){var a=el.createElement("div",{id:"mainPreloaderDiv",styles:{width:"100%",height:"100%","z-index":"1000000","background-color":"#"+BG_COLOR,opacity:"1",position:"absolute","-webkit-transition-duration":"300ms","-webkit-transition-delay":"500ms"}},
"body"),c=el.createElement("div",{styles:{position:"absolute","text-align":"center",width:"200px",height:"200px",top:"50%",left:"50%",opacity:"1",margin:"-100px 0 0 -100px","line-height":"100px"}},a),b=el.createElement("image",{id:"preloaderIMG",styles:{"box-shadow":"0 0 3px rgba(0,0,0,0.5)","-webkit-transform-origin":"50% 50%","-webkit-transform":"scale("+window.devicePixelRatio+","+window.devicePixelRatio+")"}});b.onload=function(){c.appendChild(this)};b.src=ASSETS_FOLDER+"/thumb.jpg";changeUrlWhenPubl(ASSETS_FOLDER+
"/thumb.jpg",function(a){b.src=a},-1==ASSETS_FOLDER.indexOf("static"));var e=document.getElementById("mainPreloaderDiv").style.backgroundColor.match(/\d{1,3}/ig),d="",f;for(f in e)d=2==f?d+Math.abs(155-1*e[f]):d+(155-1*e[f])+",";el.createElement("p",{styles:{position:"absolute",top:"50%",left:"50%",width:"300px",color:"rgb("+d+")","font-family":"Helvetica Neue","font-size":18*window.devicePixelRatio+"px","line-height":18*window.devicePixelRatio+"px",margin:20*window.devicePixelRatio*window.devicePixelRatio+
"px 0px 0px -150px","text-align":"center","text-shadow":"0 0 2px rgba("+d+",0.5)"}},a).appendChild(document.createTextNode(PUBLICATION_NAME))};
function FBRequire(a){var c;this.basePath=a;this.numMods=this.numLoads=0;this.head=document.getElementsByTagName("head")[0];this.load=function(a,e,d){function f(){function f(a){var b;if(!(b=!m)){b=!1;for(var d=c.documentElement.getElementsByTagName("Unit"),e=0;e<d.length;e++){var l=d[e];if(l.getAttribute("FileName")==a.substr(a.lastIndexOf("/")+1)){if(b)throw"module has already loaded";b=!0;l=l.getElementsByTagName("Source");g.numMods+=l.length-1;for(var k=0;k<l.length;k++)h(JAVASCRIPT_FOLDER+"/"+
l[k].getAttribute("FileName"))}}b=!b}b&&h(a)}g.numLoads=0;var h=function(a){var b=document.createElement("script");b.type="text/javascript";b.charset="utf-8";b.async=!0;b.addEventListener("load",function(){g.numLoads++;g.numLoads==g.numMods&&(fbUtils.isFunction(e)?e.call():console.log("FBRequire error: callback function is not a function. Callback:"+e))});b.addEventListener("error",function(){fbUtils.isFunction(d)?d.call():console.log("FBRequire error: errorback function is not a function. Errorback:"+
e)});changeUrlWhenPubl(a,function(a){b.src=a},-1==a.indexOf("static"));g.head.appendChild(b)};if(fbUtils.isArray(a)){g.numMods=a.length;for(var k=0;k<a.length;k++)f(g.basePath+a[k]+".js")}else g.numMods=1,f(g.basePath+a+".js")}var g=this,m="undefined"!=typeof window.DEBUG_MODE&&window.DEBUG_MODE;e=e||function(){};d=d||function(){};if(m)if(c)f();else{var h=new XMLHttpRequest;h.open("GET",JAVASCRIPT_FOLDER+"/!units.xml",!1);h.onreadystatechange=function(){if(4==h.readyState)if(200==h.status)c=h.responseXML,
f();else throw"Status is "+h.status;};h.send(null)}else f()};this.loadCSS=function(a,c,d){var f=this;this.endOfLoads=document.styleSheets.length+a.length;c=c||function(){};d=function(a){var b=document.createElement("link");b.type="text/css";b.rel="stylesheet";changeUrlWhenPubl(a,function(a){b.href=a},-1==a.indexOf("static"));f.head.appendChild(b)};if(fbUtils.isArray(a))for(var g=0;g<a.length;g++)d(a[g]+".css");else d(a+".css");(function(){var a=setInterval(function(){f.endOfLoads==document.styleSheets.length&&
(c.call(),clearInterval(a))},20)})()}}var loadLocalsAndContinue=function(){window.localPending=function(){initializeBook()};var a=document.getElementsByTagName("head")[0],c=document.createElement("script");c.id="formPrinter";c.type="text/javascript";c.src=LOCALS_FOLDER+"/"+publicationData.lang+"/textlang.js";a.appendChild(c)};
function detectIPadAndContinue(){"undefined"!==typeof window.ondevicemotion&&-1!=navigator.platform.indexOf("iPad")?window.ondevicemotion=function(a){-1!=navigator.platform.indexOf("iPad")&&(window.IPADVER=a.acceleration?2===window.devicePixelRatio?3:2:2,loadLocalsAndContinue());window.ondevicemotion=null}:(window.IPADVER=system.platform.ios&&system.publisher.isOn?3:0,loadLocalsAndContinue())}
var load=function(){"undefined"===typeof window.PUBL&&(window.PUBL=!0);el.id("body").innerText="";generatePreloader();var a=new FBRequire(""),c=function(){system=new Detect;PUBL&&modifySystem();"undefined"==typeof publicationData.downloads&&(publicationData.downloads={pageDownlaod:!1,publicationDownload:!1});PUBL&&""!=publicationData.GA?a.load([JAVASCRIPT_FOLDER+"/../../default/ga"],function(){}):PUBL&&a.load([JAVASCRIPT_FOLDER+"/../../default/noga"],function(){});if(system.platform.ios||system.browser.chrome){for(var b=
document.getElementsByTagName("meta"),c=0;c<b.length;c++)"viewport"==b[c].name&&document.head.removeChild(b[c]);b="user-scalable=no, initial-scale="+1/(window.devicePixelRatio||1)+", maximum-scale="+1/(window.devicePixelRatio||1)+", user-scalable=no";c=document.createElement("meta");c.name="viewport";c.content=b;document.getElementsByTagName("head")[0].appendChild(c);iOS7LandscapeHeightBugFix()}b=function(){DEV="mobile"===system.device.type?"mobile":"tablet";a.load(JAVASCRIPT_FOLDER+("mobile"===DEV?
"/mobiledom":system.platform.ios?"/iostdom":"/androidtdom"),function(){PUBL&&system.platform.ios&&6<=system.platform.version[0]&&(publicationData.visibility.downloads=!0);generateDOM();a.load([JAVASCRIPT_FOLDER+"/workspace",JAVASCRIPT_FOLDER+"/common",JAVASCRIPT_FOLDER+"/android",JAVASCRIPT_FOLDER+"/ios"],function(){PUBL&&a.load(JAVASCRIPT_FOLDER+"/../../default/publNotify",function(){});detectIPadAndContinue();var b=el.id("mainPreloaderDiv");b.style["-webkit-transform"]="translateY(-"+window.innerHeight+
"px)";b.addEventListener("webkitTransitionEnd",function(){el.del("mainPreloaderDiv")});b=null;system.device.iphone&&"7"===system.device.version&&setInterval(function(){5<Math.abs(window.innerHeight-el.id("body").getBoundingClientRect().height)&&iOS7LandscapeHeightBugFix()},500)})})};system.platform.ios?PUBL?a.loadCSS([STYLES_FOLDER+"/style",STYLES_FOLDER+"/indexios",ASSETS_FOLDER+"/textures/iosskin_pbl"],b):a.loadCSS([STYLES_FOLDER+"/style",STYLES_FOLDER+"/indexios",ASSETS_FOLDER+"/textures/iosskin"],
b):a.loadCSS([STYLES_FOLDER+"/styleandroid",STYLES_FOLDER+"/indexandroid",ASSETS_FOLDER+"/skin"],b)},b=[JAVASCRIPT_FOLDER+"/detect",ASSETS_FOLDER+"/properties"];PUBL&&b.push(JAVASCRIPT_FOLDER+"/../../default/devModels");a.load(b,function(){publicationData.shopInfo?a.load(["undefined"==typeof DEBUG_MODE||!0!=DEBUG_MODE?COMMON_FOLDER+"/ecommerce/cart":JAVASCRIPT_FOLDER+"/../ec/cart",COMMON_FOLDER+"/ecommerce/products"],function(){cart=new Cart(publicationData.shopInfo.id,publicationData.ident);"undefined"!==
typeof shopId&&""!==shopId||delete publicationData.shopInfo;c()}):c()})};document.addEventListener("DOMContentLoaded",load);function changeUrlWhenPubl(a,c,b){PUBL&&("undefined"==typeof b||b)?publ.getFile(a,function(a){c(a.target.responseText)}):c(a)}
var publ={getFile:function(a,c){""!=PS&&void 0!=PS&&(a=a+"?password="+PS);""!=USERID&&void 0!=USERID&&(a=a+"?loginTicket="+USERID);var b=new XMLHttpRequest;b.open("GET",a);b.onload=c;b.onerror=function(){};b.send();delete b},getData:function(a,c){publ.getFile(a,function(){var a=new XMLHttpRequest;a.open("GET",this.responseText);a.onload=c;a.onerror=function(){};a.send();delete a})}};
