(this||(0,eval)("(this)")).bdor=[];
(function(b){function c(b){b=f.match(b);if(null==b||0==b.length)return 0;b=b[0];var c=b.indexOf("/");b=b.substring(c+1,b.length);return""==b?0:parseInt(b)}function d(b){b=f.match(b);if(null==b||0==b.length)return 0;b=b[0].replace("_",".").match(/\d+\.?\d?/);if(null==b||0==b.length)return 0;b=b[0];return""==b?0:parseFloat(b)}var f=navigator.userAgent.toLowerCase();b.browser={};b.browser.webkit=/webkit/.test(f);b.browser.mozilla=/firefox/.test(f);b.browser.firefox=b.browser.mozilla;b.browser.msie=/msie/.test(f)||
/trident/.test(f);b.browser.opera=/opera/.test(f)||/opr/.test(f);b.browser.chrome=/chrome/.test(f)&&!b.browser.opera;b.browser.uc=/ucbrowser/.test(f);b.browser.safari=/safari/.test(f)&&!b.browser.chrome&&!b.browser.uc;b.browser.version=0;bdor[1]="p";b.browser.firefox&&(b.browser.version=c(/firefox\/\d+/));if(b.browser.msie){var g=f.match(/msie\s?\d+\.0/);null==g?(g=f.match(/trident\/\d+\.0/),null!=g&&0<g.length&&(g=parseInt(g[0].replace("trident/","")),b.browser.version=g+4)):(g=parseInt(g[0].replace("msie",
"")),b.browser.version=g)}b.browser.opera&&(b.browser.version=c(/opera\/\d+/)||c(/opr\/\d+/));b.browser.chrome&&(b.browser.version=c(/chrome\/\d+/));b.browser.uc&&(b.browser.version=c(/ucbrowser\/\d+/));b.browser.safari&&(b.browser.version=c(/safari\/\d+/));if(void 0==b.browser.device){b.browser.DEVICE_PC=0;b.browser.DEVICE_PAD=1;b.browser.DEVICE_PHONE=2;var g=/pad/.test(f)||/ipod/.test(f),h=/iphone/.test(f),k=/wpdesktop/.test(f)||/windows phone/.test(f),l=/blackberry/.test(f),m=/mobile/.test(f)||
/phone/.test(f);b.browser.device=b.browser.DEVICE_PC;if(g)b.browser.device=b.browser.DEVICE_PAD;else if(h||k||l||m)b.browser.device=b.browser.DEVICE_PHONE}void 0==b.browser.prefix&&(b.browser.prefix="",!0==b.browser.webkit&&(b.browser.prefix="-webkit-"),!0==b.browser.mozilla&&(b.browser.prefix="-moz-"),!0==b.browser.opera&&(b.browser.prefix="-webkit-"),!0==b.browser.uc&&(b.browser.prefix="-webkit-"),!0==b.browser.msie&&(b.browser.prefix="-ms-"));if(void 0==b.system){b.system={name:"",version:0};b.system.WINDOWS=
"Windows";b.system.WP="WinPhone";b.system.WP_DESKTOP="WinPhoneDesktop";b.system.MAC="Mac OS";b.system.IOS="iPhone OS";b.system.LINUX="Linux";b.system.ANDROID="Android";b.system.BLACKBERRY="BlackBerry";/windows/.test(f)&&(b.system.name=b.system.WINDOWS,b.system.version=d(/windows nt\s?\d+\.?\d?/));/windows phone/.test(f)&&(b.system.name=b.system.WP,b.system.version=d(/windows phone\s?\d+\.?\d?/));/wpdesktop/.test(f)&&(b.system.name=b.system.WP_DESKTOP,b.system.version=d(/wpdesktop\s?\d+\.?\d?/));if(b.system.name!=
b.system.WP){if(/iphone/.test(f)||/ipad/.test(f))b.system.name=b.system.IOS,b.system.version=d(/os\s?\d+_?\d?/);/android/.test(f)&&(b.system.name=b.system.ANDROID,b.system.version=d(/android\s?\d+\.?\d?/))}/mac/.test(f)&&b.browser.system!=b.browser.IOS&&(b.system.name=b.system.MAC,b.system.version=d(/os x\s?\d+\.?\d?/));/linux/.test(f)&&!/android/.test(f)&&(b.system.name=b.system.LINUX);/blackberry/.test(f)&&(b.system.name=b.system.BLACKBERRY,b.system.version=d(/blackberry\s?\d+/))}})(jQuery);
var global=function(){return this||(0,eval)("(this)")}(),virtual_function=function(){};function getPackageByName(b){if(void 0==b||""==b)return global;var c=global;b=b.split(".");for(var d=0;d<b.length;d++){var f=b[d];c[f]||(c[f]={IS_PACKAGE_OBJECT:!0});c=c[f]}return c}function getClassByFullName(b){var c=b.split(".");b=c.pop();c=c.join(".");return getPackageByName(c)[b]}
function classof(b,c){if(!b)return"";c||(c=global);"string"==typeof c&&(c=getPackageByName(c));for(var d in c)if(c[d]instanceof Function)try{if(b instanceof c[d])return d}catch(f){}for(d in c)if("object"==typeof c[d]&&c[d].IS_PACKAGE_OBJECT){var g=classof(b,c[d]);if(""!=g)return d+"."+g}return""}
function Class(b,c){if("string"===typeof b){var d=c,f=getPackageByName(d.Package);f[b]=Class(d);return f[b]}d=function(){if(this.Import){"string"==typeof this.Import&&(this.Import=[this.Import]);for(var b=0;b<this.Import.length;b++){var c=this.Import[b],d=getPackageByName(c);if(d instanceof Function)this[c.split(".").pop()]=d;else for(var f in d)d[f]instanceof Function&&(this[f]=d[f])}}d=getPackageByName(this.Package);if(d!=global)for(f in d)this.getClassName()!=f&&d[f]instanceof Function&&(this[f]=
d[f]);this.create&&this.create instanceof Function&&this.create.apply(this,arguments)};d.prototype=b||{};d.prototype.getClassName=function(){return classof(this,this.Package)};d.prototype.getClass=function(){var b=this.getClassName();return getPackageByName(this.Package)[b]};f=d.prototype.statics;if(void 0!=f){for(var g in f)void 0==d[g]&&(d[g]=f[g]);delete d.prototype.statics}return d}
Function.prototype.extend=function(b){if(void 0==b||null==b)return this;if(b instanceof Function){for(var c in b)void 0==this[c]&&(this[c]=b[c]);for(c in b.prototype)if(void 0==this.prototype[c])b.prototype[c]==virtual_function?console&&console.error&&console.error("virtual function [%s] must be override.",c):this.prototype[c]=b.prototype[c];else{var d=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.prototype[c]instanceof Function&&b.prototype[c]instanceof Function&&d.test(this.prototype[c])&&
(this.prototype[c]=function(c,d){return function(){var h=this._super;this._super=b.prototype[c];var k=d.apply(this,arguments);this._super=h;return k}}(c,this.prototype[c]))}if(b.prototype.Import)for(this.prototype.Import||(this.prototype.Import=[]),c=b.prototype.Import,d=0;d<c.length;d++)this.prototype.Import.push(c[d]);b.prototype.Package&&this.prototype.Package!=b.prototype.Package&&(this.prototype.Import||(this.prototype.Import=[]),this.prototype.Import.push(b.prototype.Package));return this}return"object"!==
typeof b?this:this.extend(Class(b))};Function.prototype.expand=function(b,c){if("object"===typeof b)if(void 0==c&&(c=!1),!0===c)for(var d in b)this.prototype[d]=b[d];else this.extend(Class(b))};
var __extends=this.__extends||function(b,c){function d(){this.constructor=b}for(var f in c)c.hasOwnProperty(f)&&(b[f]=c[f]);d.prototype=c.prototype;b.prototype=new d},Instance={copy:function(b){if(!b)return null;var c={};b instanceof Array&&(c=[]);for(property in b)c[property]="object"==typeof b[property]?Instance.copy(b[property]):b[property];return c},create:function(b,c){c||(c=[]);var d=b;"string"==typeof b&&(d=getClassByFullName(d));if(!d)return null;var f=d.prototype.create;d.prototype.create=
function(){};var g=new d;d.prototype.create=f;g.create&&g.create instanceof Function&&g.create.apply(g,c);return g},JSON:function(b){if(void 0==b||null==b)return b;if(b instanceof Array){for(var c="[",d=0;d<b.length;d++)c=c+Instance.JSON(b[d])+", ";1<c.length&&(c=c.substr(0,c.length-2));return c+"]"}if(b instanceof Function)return b;if("string"===typeof b)return'"'+b.toString()+'"';if("number"===typeof b)return Number(b).toString();if("boolean"===typeof b)return Boolean(b).toString();if("object"===
typeof b){c="{";for(d in b)sPropStr='"'+d+'":'+Instance.JSON(b[d])+", ",c+=sPropStr;1<c.length&&(c=c.substr(0,c.length-2));return c+="}"}},parse:function(b,c){return b&&"undefined"!=b&&"null"!=b&&""!=b?eval("("+b+")"):c}};
(function(){for(var b=0,c=["webkit","moz"],d=0;d<c.length&&!window.requestAnimationFrame;++d)window.requestAnimationFrame=window[c[d]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[c[d]+"CancelAnimationFrame"]||window[c[d]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(c){var d=(new Date).getTime(),h=Math.max(0,16.7-(d-b)),k=window.setTimeout(function(){c(d+h)},h);b=d+h;return k});window.cancelAnimationFrame||(window.cancelAnimationFrame=
function(b){clearTimeout(b)})})();
(function(){var b={supportsFullScreen:!1,isFullScreen:function(){return!1},requestFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"-",prefix:""},c=["webkit","moz","o","ms"];if("undefined"!=typeof document.exitFullscreen)b.supportsFullScreen=!0;else if("undefined"!=typeof document.cancelFullScreen)b.supportsFullScreen=!0;else for(var d=0,f=c.length;d<f;d++)if(b.prefix=c[d],"undefined"!=typeof document[b.prefix+"CancelFullScreen"]){b.supportsFullScreen=!0;break}b.supportsFullScreen&&
(b.fullScreenEventName=b.prefix+"fullscreenchange",b.isFullScreen=function(){switch(this.prefix){case "":return document.fullScreen;case "webkit":return document.webkitIsFullScreen;default:return document[this.prefix+"FullScreen"]}},b.requestFullScreen=function(b){b[this.prefix+"RequestFullScreen"]()},b.cancelFullScreen=function(b){return""===this.prefix?document.cancelFullScreen():document[this.prefix+"CancelFullScreen"]()});window.fullScreenApi=b})();
Function.expand({bind:function(b){var c=this;return function(){return c.apply(b,arguments)}},delay:function(b,c,d){"object"!==typeof b&&(d=c,c=b,b={});c=c||1;d=d||[];return setTimeout(function(){this.apply(b,d)}.bind(this),c)},interval:function(b,c,d){"object"!==typeof b&&(d=c,c=b,b={});c=c||1;d=d||[];var f=this;return{intervalId:setInterval(function(){this.apply(b,d)}.bind(this),c),stop:function(){clearInterval(this.intervalId);this.intervalId=void 0},isRunning:function(){return void 0!=this.intervalId},
start:function(){this.intervalId=setInterval(function(){f.apply(b,d)},c)}}},runInAnimate:function(b,c){"object"!==typeof b&&(c=b,b={});var d={stopFlag:!1,stop:function(){this.stopFlag=!0}},f=this,g=0,h=Math.ceil(c/16.7),k=function(){g++;!1!==f.apply(b,[g,h])&&!0!==d.stopFlag&&(g<h||void 0==c)&&window.requestAnimationFrame(k)};k();return d}});
String.expand({trim:function(){return this.replace(/(^\s*)|(\s*$)/g,"")},replaceAll:function(b,c,d){void 0==d&&(d=!1);if(RegExp&&!d)return this.replace(RegExp(b,"g"),c);var f=this.indexOf(b);d=[];for(var g=this;-1!=f;){var f=f+b.length,h=g.substring(0,f),g=g.substring(f),h=h.replace(b,c);d.push(h);f=g.indexOf(b)}""!==g&&d.push(g);return d.join("")},subBetween:function(b,c){if(void 0==b||void 0==c)return"";var d=this.length,f=this.indexOf(b);if(-1==f)return"";f+=b.length;d=this.substring(f,d).indexOf(c);
return-1==d?"":this.substring(f,d+f)},html2Text:function(){return this.replaceAll("<[.[^<]]*>","")},HTMLLabel2Text:function(){return this.replaceAll("<","&lt;").replaceAll(">","&gt;")},isUrl:function(){return""!=this&&this.match(/(http\:\/\/)?([\w.]+)(\/[\w-   \.\/\?%&=]*)?/gi)?!0:!1},isEmail:function(){return""!=this&&this.match(/^([A-Za-z0-9])(\w)+@(\w)+(\.)(com|com\.cn|net|cn|net\.cn|org|biz|info|gov|gov\.cn|edu|edu\.cn)/)?!0:!1},toArray:function(b){b||(b="");return this.split(b)},reverse:function(){var b=
this.split("");b.reverse();return b.join("")},equals:function(b){return this.trim()==b.trim()},equalsIgnoreCase:function(b){return this.toLowerCase().trim()==b.toLowerCase().trim()},startWith:function(b){return""===b?!1:this.substr(0,b.length)===b},endWith:function(b){return""===b?!1:this.substr(-b.length,b.length)===b},isEnglish:function(){return/[\x00-\xff]/.test(this)},overflow:function(b){if(void 0==b)return this.toString();var c=2;/[^\x00-\xff]/.test(this)&&(b=Math.floor(b/2),c=Math.floor(c/
2));return this.length-b>c?this.substr(0,b)+"...":this.toString()},extract:function(){if(0==this.length||0==arguments.length)return[];for(var b=[],c=this.toString(),d=0;d<c.length;){for(var f=!1,g=0;g<arguments.length;g++){var h=arguments[g];if(c.substr(d,h.length)==h){b.push(h);d+=h.length;f=!0;break}}f||d++}return b},remove:function(b){if("string"==typeof b){var c=this.indexOf(b);if(!(0>c))return b=b.length,this.substring(0,c)+this.substring(c+b,this.length)}},cycle:function(b){if(!isNaN(b)){for(var c=
parseInt(b/this.length),d=this;0<c;)d+=this,c--;return d.substring(0,b)}},statics:{format:function(){if(0==arguments.length)return"";if(1==arguments.length)return arguments[0];for(var b=arguments[0],c=b.extract("%s","%d","%f"),d=1;d<arguments.length;d++){var f=arguments[d],g=c[d-1];"%s"==g&&("string"==typeof f?b=b.replace("%s",f):b=b.replace("%s",""));if("%d"==g){isNaN(f)&&(f=0);var h;h="number"==typeof f?-1==Number(f).toString().indexOf("."):!1;h?b=b.replace("%d",f+""):b=b.replace("%d","")}"%f"==
g&&(isNaN(f)&&(f=0),"number"==typeof f?b=b.replace("%f",f+""):b=b.replace("%f",""))}return b}}});Array.expand({remove:function(b){return isNaN(b)||b>this.length?!1:this.splice(b,1)[0]},indexOf:function(b){for(var c=0;c<this.length;c++)if(this[c]===b)return c;return-1},removeElement:function(b){b=this.indexOf(b);-1<b&&this.remove(b)},lastIndexOf:function(b){for(var c=-1,d=0;d<this.length;d++)this[d]===b&&(c=d);return c}});
Date.expand({format:function(b,c){c=c||!0;var d={"y+":this.getYear(),"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};/(y+)/.test(b)&&(b=b.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length)));for(var f in d)RegExp("("+f+")").test(b)&&(b=!0===c?b.replace(RegExp.$1,d[f]):b.replace(RegExp.$1,1==RegExp.$1.length?d[f]:("00"+d[f]).substr((""+d[f]).length)));return b},
statics:{now:function(){return(new Date).getTime()}}});Number.expand({statics:{between:function(b,c,d){b<c&&(b=c);b>d&&(b=d);return b},fixed:function(b,c){var d=Math.pow(10,c);return Math.round(b*d)/d}}});
var Color=function(b){return{value:b,toString:function(){function b(c,d,h){if(c.length<h&&c.length>d)for(;c.length<h;)c="0"+c;return c}var d=this.value;if(!d)return"";if("string"==typeof d){if(0==d.indexOf("#"))return d;if(0==d.indexOf("0x"))return d.replace("0x","#")}d=parseInt(d).toString(16);8<d.length&&(d=d.substr(0,8));d=b(d,6,8);d=b(d,3,6);d=b(d,0,3);return"#"+d},split:function(){var b={R:0,G:0,B:0};if(!this.value)return b;var d=this.toString(),f="FF",g="FF",h="FF";if(7==d.length)f=d.substr(1,
2),g=d.substr(3,2),h=d.substr(5,2);else if(4==d.length)f=d.substr(1,1),g=d.substr(2,1),h=d.substr(3,1),f+=f,g+=g,h+=h;else return b;return{R:parseInt(f,16),G:parseInt(g,16),B:parseInt(h,16)}},add:function(b){var d=this.split();d.r=Math.min(d.r+b,255).toString(16);d.g=Math.min(d.g+b,255).toString(16);d.b=Math.min(d.b+b,255).toString(16);d.r=1>=d.r.length?"0"+d.r:d.r;d.g=1>=d.g.length?"0"+d.g:d.g;d.b=1>=d.b.length?"0"+d.b:d.b;return"#"+d.r+d.g+d.b},reduce:function(b){return this.add(-b)}}};
function equals(b,c){return 1E-7>Math.abs(b-c)}var Point=function(b,c){return{x:b,y:c,isNearTo:function(b,c){if(!b)return!1;void 0==c&&(c=5);return Math.abs(this.x-b.x)<c&&Math.abs(this.y-b.y)<c},equals:function(b){return b?equals(this.x,b.x)&&equals(this.y,b.y):!1},toString:function(){return String.format("(%d, %d)",this.x,this.y)},clone:function(){return{x:this.x,y:this.y}},getX:function(){return this.x},getY:function(){return this.y}}};Point.NaP=function(){return Point(Number.NaN,Number.NaN)};
(function(b){var c="object"==typeof exports&&exports,d="object"==typeof module&&module&&module.exports==c&&module,f="object"==typeof global&&global;if(f.global===f||f.window===f)b=f;var g=function(b){this.message=b};g.prototype=Error();g.prototype.name="InvalidCharacterError";var h={encode:function(b){b=String(b);if(/[^\0-\xFF]/.test(b))throw new g("The string to be encoded contains characters outside of the Latin1 range.");for(var c=b.length%3,d="",f=-1,h,k,r,t=b.length-c;++f<t;)h=b.charCodeAt(f)<<
16,k=b.charCodeAt(++f)<<8,r=b.charCodeAt(++f),h=h+k+r,d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(h>>18&63)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(h>>12&63)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(h>>6&63)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(h&63);2==c?(h=b.charCodeAt(f)<<8,k=b.charCodeAt(++f),h+=k,d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(h>>
10)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(h>>4&63)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(h<<2&63)+"="):1==c&&(h=b.charCodeAt(f),d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(h>>2)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(h<<4&63)+"==");return d},decode:function(b){b=String(b);for(var c=b.length,d=0,f,g,h="",k=-1;++k<c;)g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(b.charAt(k)),
f=d%4?64*f+g:g,d++%4&&(h+=String.fromCharCode(255&f>>(-2*d&6)));return h},version:"0.1.0"};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define(function(){return h});else if(c&&!c.nodeType)if(d)d.exports=h;else for(var k in h)h.hasOwnProperty(k)&&(c[k]=h[k]);else b.base64=h})(this);function parsHexToNormalString(b){for(var c="";2<=b.length;)c+=String.fromCharCode(parseInt(b.substring(0,2),16)),b=b.substring(2,b.length);return c}
function parseHexString(b){for(var c=[];2<=b.length;)c.push(parseInt(b.substring(0,2),16)),b=b.substring(2,b.length);return c}function byteArray2String(b){for(var c="",d=0;d<b.length;d++)c+=String.fromCharCode(b[d]);return c}
function rc4(b,c){for(var d=[],f=[],g=0;256>g;g++)d[g]=g,f[g]=b.charCodeAt(g%b.length);for(var h=0,g=0;256>g;g++){var h=h+d[g]+f[g]&255,k=d[g];d[g]=d[h];d[h]=k}for(var l=h=f=0,m,k="",g=0;g<c.length;g++)f=f+1&255,h=h+d[f]&255,l=d[f],d[f]=d[h],d[h]=l,l=d[f]+d[h]&255,m=c.charCodeAt(g),m^=d[l],k+=String.fromCharCode(m);return k}
String.prototype.MD5=function(b){function c(b,c){var d,f,g,h,l;g=b&2147483648;h=c&2147483648;d=b&1073741824;f=c&1073741824;l=(b&1073741823)+(c&1073741823);return d&f?l^2147483648^g^h:d|f?l&1073741824?l^3221225472^g^h:l^1073741824^g^h:l^g^h}function d(b,d,f,g,h,l,k){b=c(b,c(c(d&f|~d&g,h),k));return c(b<<l|b>>>32-l,d)}function f(b,d,f,g,h,l,k){b=c(b,c(c(d&g|f&~g,h),k));return c(b<<l|b>>>32-l,d)}function g(b,d,f,g,h,l,k){b=c(b,c(c(d^f^g,h),k));return c(b<<l|b>>>32-l,d)}function h(b,d,f,g,h,l,k){b=c(b,
c(c(f^(d|~g),h),k));return c(b<<l|b>>>32-l,d)}function k(b){var c="",d="",f;for(f=0;3>=f;f++)d=b>>>8*f&255,d="0"+d.toString(16),c+=d.substr(d.length-2,2);return c}var l=[],m,n,q,p,s,r,t,v,u,l=function(b){var c,d=b.length;c=d+8;for(var f=16*((c-c%64)/64+1),g=Array(f-1),h=0,l=0;l<d;)c=(l-l%4)/4,h=l%4*8,g[c]|=b.charCodeAt(l)<<h,l++;c=(l-l%4)/4;g[c]|=128<<l%4*8;g[f-2]=d<<3;g[f-1]=d>>>29;return g}(this);r=1732584193;t=4023233417;v=2562383102;u=271733878;for(m=0;m<l.length;m+=16)n=r,q=t,p=v,s=u,r=d(r,t,
v,u,l[m+0],7,3614090360),u=d(u,r,t,v,l[m+1],12,3905402710),v=d(v,u,r,t,l[m+2],17,606105819),t=d(t,v,u,r,l[m+3],22,3250441966),r=d(r,t,v,u,l[m+4],7,4118548399),u=d(u,r,t,v,l[m+5],12,1200080426),v=d(v,u,r,t,l[m+6],17,2821735955),t=d(t,v,u,r,l[m+7],22,4249261313),r=d(r,t,v,u,l[m+8],7,1770035416),u=d(u,r,t,v,l[m+9],12,2336552879),v=d(v,u,r,t,l[m+10],17,4294925233),t=d(t,v,u,r,l[m+11],22,2304563134),r=d(r,t,v,u,l[m+12],7,1804603682),u=d(u,r,t,v,l[m+13],12,4254626195),v=d(v,u,r,t,l[m+14],17,2792965006),
t=d(t,v,u,r,l[m+15],22,1236535329),r=f(r,t,v,u,l[m+1],5,4129170786),u=f(u,r,t,v,l[m+6],9,3225465664),v=f(v,u,r,t,l[m+11],14,643717713),t=f(t,v,u,r,l[m+0],20,3921069994),r=f(r,t,v,u,l[m+5],5,3593408605),u=f(u,r,t,v,l[m+10],9,38016083),v=f(v,u,r,t,l[m+15],14,3634488961),t=f(t,v,u,r,l[m+4],20,3889429448),r=f(r,t,v,u,l[m+9],5,568446438),u=f(u,r,t,v,l[m+14],9,3275163606),v=f(v,u,r,t,l[m+3],14,4107603335),t=f(t,v,u,r,l[m+8],20,1163531501),r=f(r,t,v,u,l[m+13],5,2850285829),u=f(u,r,t,v,l[m+2],9,4243563512),
v=f(v,u,r,t,l[m+7],14,1735328473),t=f(t,v,u,r,l[m+12],20,2368359562),r=g(r,t,v,u,l[m+5],4,4294588738),u=g(u,r,t,v,l[m+8],11,2272392833),v=g(v,u,r,t,l[m+11],16,1839030562),t=g(t,v,u,r,l[m+14],23,4259657740),r=g(r,t,v,u,l[m+1],4,2763975236),u=g(u,r,t,v,l[m+4],11,1272893353),v=g(v,u,r,t,l[m+7],16,4139469664),t=g(t,v,u,r,l[m+10],23,3200236656),r=g(r,t,v,u,l[m+13],4,681279174),u=g(u,r,t,v,l[m+0],11,3936430074),v=g(v,u,r,t,l[m+3],16,3572445317),t=g(t,v,u,r,l[m+6],23,76029189),r=g(r,t,v,u,l[m+9],4,3654602809),
u=g(u,r,t,v,l[m+12],11,3873151461),v=g(v,u,r,t,l[m+15],16,530742520),t=g(t,v,u,r,l[m+2],23,3299628645),r=h(r,t,v,u,l[m+0],6,4096336452),u=h(u,r,t,v,l[m+7],10,1126891415),v=h(v,u,r,t,l[m+14],15,2878612391),t=h(t,v,u,r,l[m+5],21,4237533241),r=h(r,t,v,u,l[m+12],6,1700485571),u=h(u,r,t,v,l[m+3],10,2399980690),v=h(v,u,r,t,l[m+10],15,4293915773),t=h(t,v,u,r,l[m+1],21,2240044497),r=h(r,t,v,u,l[m+8],6,1873313359),u=h(u,r,t,v,l[m+15],10,4264355552),v=h(v,u,r,t,l[m+6],15,2734768916),t=h(t,v,u,r,l[m+13],21,
1309151649),r=h(r,t,v,u,l[m+4],6,4149444226),u=h(u,r,t,v,l[m+11],10,3174756917),v=h(v,u,r,t,l[m+2],15,718787259),t=h(t,v,u,r,l[m+9],21,3951481745),r=c(r,n),t=c(t,q),v=c(v,p),u=c(u,s);return 32==b?k(r)+k(t)+k(v)+k(u):k(t)+k(v)};function QR8bitByte(b){this.mode=QRMode.MODE_8BIT_BYTE;this.data=b}QR8bitByte.prototype={getLength:function(b){return this.data.length},write:function(b){for(var c=0;c<this.data.length;c++)b.put(this.data.charCodeAt(c),8)}};
function QRCode(b,c){this.typeNumber=b;this.errorCorrectLevel=c;this.modules=null;this.moduleCount=0;this.dataCache=null;this.dataList=[]}
QRCode.prototype={addData:function(b){b=new QR8bitByte(b);this.dataList.push(b);this.dataCache=null},isDark:function(b,c){if(0>b||this.moduleCount<=b||0>c||this.moduleCount<=c)throw Error(b+","+c);return this.modules[b][c]},getModuleCount:function(){return this.moduleCount},make:function(){if(1>this.typeNumber){for(var b=1,b=1;40>b;b++){for(var c=QRRSBlock.getRSBlocks(b,this.errorCorrectLevel),d=new QRBitBuffer,f=0,g=0;g<c.length;g++)f+=c[g].dataCount;for(g=0;g<this.dataList.length;g++)c=this.dataList[g],
d.put(c.mode,4),d.put(c.getLength(),QRUtil.getLengthInBits(c.mode,b)),c.write(d);if(d.getLengthInBits()<=8*f)break}this.typeNumber=b}this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(b,c){this.moduleCount=4*this.typeNumber+17;this.modules=Array(this.moduleCount);for(var d=0;d<this.moduleCount;d++){this.modules[d]=Array(this.moduleCount);for(var f=0;f<this.moduleCount;f++)this.modules[d][f]=null}this.setupPositionProbePattern(0,0);this.setupPositionProbePattern(this.moduleCount-7,0);this.setupPositionProbePattern(0,
this.moduleCount-7);this.setupPositionAdjustPattern();this.setupTimingPattern();this.setupTypeInfo(b,c);7<=this.typeNumber&&this.setupTypeNumber(b);null==this.dataCache&&(this.dataCache=QRCode.createData(this.typeNumber,this.errorCorrectLevel,this.dataList));this.mapData(this.dataCache,c)},setupPositionProbePattern:function(b,c){for(var d=-1;7>=d;d++)if(!(-1>=b+d||this.moduleCount<=b+d))for(var f=-1;7>=f;f++)-1>=c+f||this.moduleCount<=c+f||(this.modules[b+d][c+f]=0<=d&&6>=d&&(0==f||6==f)||0<=f&&6>=
f&&(0==d||6==d)||2<=d&&4>=d&&2<=f&&4>=f?!0:!1)},getBestMaskPattern:function(){for(var b=0,c=0,d=0;8>d;d++){this.makeImpl(!0,d);var f=QRUtil.getLostPoint(this);if(0==d||b>f)b=f,c=d}return c},createMovieClip:function(b,c,d){b=b.createEmptyMovieClip(c,d);this.make();for(c=0;c<this.modules.length;c++){d=1*c;for(var f=0;f<this.modules[c].length;f++){var g=1*f;this.modules[c][f]&&(b.beginFill(0,100),b.moveTo(g,d),b.lineTo(g+1,d),b.lineTo(g+1,d+1),b.lineTo(g,d+1),b.endFill())}}return b},setupTimingPattern:function(){for(var b=
8;b<this.moduleCount-8;b++)null==this.modules[b][6]&&(this.modules[b][6]=0==b%2);for(b=8;b<this.moduleCount-8;b++)null==this.modules[6][b]&&(this.modules[6][b]=0==b%2)},setupPositionAdjustPattern:function(){for(var b=QRUtil.getPatternPosition(this.typeNumber),c=0;c<b.length;c++)for(var d=0;d<b.length;d++){var f=b[c],g=b[d];if(null==this.modules[f][g])for(var h=-2;2>=h;h++)for(var k=-2;2>=k;k++)this.modules[f+h][g+k]=-2==h||2==h||-2==k||2==k||0==h&&0==k?!0:!1}},setupTypeNumber:function(b){for(var c=
QRUtil.getBCHTypeNumber(this.typeNumber),d=0;18>d;d++){var f=!b&&1==(c>>d&1);this.modules[Math.floor(d/3)][d%3+this.moduleCount-8-3]=f}for(d=0;18>d;d++)f=!b&&1==(c>>d&1),this.modules[d%3+this.moduleCount-8-3][Math.floor(d/3)]=f},setupTypeInfo:function(b,c){for(var d=QRUtil.getBCHTypeInfo(this.errorCorrectLevel<<3|c),f=0;15>f;f++){var g=!b&&1==(d>>f&1);6>f?this.modules[f][8]=g:8>f?this.modules[f+1][8]=g:this.modules[this.moduleCount-15+f][8]=g}for(f=0;15>f;f++)g=!b&&1==(d>>f&1),8>f?this.modules[8][this.moduleCount-
f-1]=g:9>f?this.modules[8][15-f-1+1]=g:this.modules[8][15-f-1]=g;this.modules[this.moduleCount-8][8]=!b},mapData:function(b,c){for(var d=-1,f=this.moduleCount-1,g=7,h=0,k=this.moduleCount-1;0<k;k-=2)for(6==k&&k--;;){for(var l=0;2>l;l++)if(null==this.modules[f][k-l]){var m=!1;h<b.length&&(m=1==(b[h]>>>g&1));QRUtil.getMask(c,f,k-l)&&(m=!m);this.modules[f][k-l]=m;g--; -1==g&&(h++,g=7)}f+=d;if(0>f||this.moduleCount<=f){f-=d;d=-d;break}}}};QRCode.PAD0=236;QRCode.PAD1=17;
QRCode.createData=function(b,c,d){c=QRRSBlock.getRSBlocks(b,c);for(var f=new QRBitBuffer,g=0;g<d.length;g++){var h=d[g];f.put(h.mode,4);f.put(h.getLength(),QRUtil.getLengthInBits(h.mode,b));h.write(f)}for(g=b=0;g<c.length;g++)b+=c[g].dataCount;if(f.getLengthInBits()>8*b)throw Error("code length overflow. ("+f.getLengthInBits()+">"+8*b+")");for(f.getLengthInBits()+4<=8*b&&f.put(0,4);0!=f.getLengthInBits()%8;)f.putBit(!1);for(;!(f.getLengthInBits()>=8*b);){f.put(QRCode.PAD0,8);if(f.getLengthInBits()>=
8*b)break;f.put(QRCode.PAD1,8)}return QRCode.createBytes(f,c)};
QRCode.createBytes=function(b,c){for(var d=0,f=0,g=0,h=Array(c.length),k=Array(c.length),l=0;l<c.length;l++){var m=c[l].dataCount,n=c[l].totalCount-m,f=Math.max(f,m),g=Math.max(g,n);h[l]=Array(m);for(var q=0;q<h[l].length;q++)h[l][q]=255&b.buffer[q+d];d+=m;q=QRUtil.getErrorCorrectPolynomial(n);m=(new QRPolynomial(h[l],q.getLength()-1)).mod(q);k[l]=Array(q.getLength()-1);for(q=0;q<k[l].length;q++)n=q+m.getLength()-k[l].length,k[l][q]=0<=n?m.get(n):0}for(q=l=0;q<c.length;q++)l+=c[q].totalCount;d=Array(l);
for(q=m=0;q<f;q++)for(l=0;l<c.length;l++)q<h[l].length&&(d[m++]=h[l][q]);for(q=0;q<g;q++)for(l=0;l<c.length;l++)q<k[l].length&&(d[m++]=k[l][q]);return d};
for(var QRMode={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},QRErrorCorrectLevel={L:1,M:0,Q:3,H:2},QRMaskPattern={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},QRUtil={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,
30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(b){for(var c=b<<10;0<=QRUtil.getBCHDigit(c)-QRUtil.getBCHDigit(QRUtil.G15);)c^=
QRUtil.G15<<QRUtil.getBCHDigit(c)-QRUtil.getBCHDigit(QRUtil.G15);return(b<<10|c)^QRUtil.G15_MASK},getBCHTypeNumber:function(b){for(var c=b<<12;0<=QRUtil.getBCHDigit(c)-QRUtil.getBCHDigit(QRUtil.G18);)c^=QRUtil.G18<<QRUtil.getBCHDigit(c)-QRUtil.getBCHDigit(QRUtil.G18);return b<<12|c},getBCHDigit:function(b){for(var c=0;0!=b;)c++,b>>>=1;return c},getPatternPosition:function(b){return QRUtil.PATTERN_POSITION_TABLE[b-1]},getMask:function(b,c,d){switch(b){case QRMaskPattern.PATTERN000:return 0==(c+d)%
2;case QRMaskPattern.PATTERN001:return 0==c%2;case QRMaskPattern.PATTERN010:return 0==d%3;case QRMaskPattern.PATTERN011:return 0==(c+d)%3;case QRMaskPattern.PATTERN100:return 0==(Math.floor(c/2)+Math.floor(d/3))%2;case QRMaskPattern.PATTERN101:return 0==c*d%2+c*d%3;case QRMaskPattern.PATTERN110:return 0==(c*d%2+c*d%3)%2;case QRMaskPattern.PATTERN111:return 0==(c*d%3+(c+d)%2)%2;default:throw Error("bad maskPattern:"+b);}},getErrorCorrectPolynomial:function(b){for(var c=new QRPolynomial([1],0),d=0;d<
b;d++)c=c.multiply(new QRPolynomial([1,QRMath.gexp(d)],0));return c},getLengthInBits:function(b,c){if(1<=c&&10>c)switch(b){case QRMode.MODE_NUMBER:return 10;case QRMode.MODE_ALPHA_NUM:return 9;case QRMode.MODE_8BIT_BYTE:return 8;case QRMode.MODE_KANJI:return 8;default:throw Error("mode:"+b);}else if(27>c)switch(b){case QRMode.MODE_NUMBER:return 12;case QRMode.MODE_ALPHA_NUM:return 11;case QRMode.MODE_8BIT_BYTE:return 16;case QRMode.MODE_KANJI:return 10;default:throw Error("mode:"+b);}else if(41>c)switch(b){case QRMode.MODE_NUMBER:return 14;
case QRMode.MODE_ALPHA_NUM:return 13;case QRMode.MODE_8BIT_BYTE:return 16;case QRMode.MODE_KANJI:return 12;default:throw Error("mode:"+b);}else throw Error("type:"+c);},getLostPoint:function(b){for(var c=b.getModuleCount(),d=0,f=0;f<c;f++)for(var g=0;g<c;g++){for(var h=0,k=b.isDark(f,g),l=-1;1>=l;l++)if(!(0>f+l||c<=f+l))for(var m=-1;1>=m;m++)0>g+m||c<=g+m||0==l&&0==m||k!=b.isDark(f+l,g+m)||h++;5<h&&(d+=3+h-5)}for(f=0;f<c-1;f++)for(g=0;g<c-1;g++)if(h=0,b.isDark(f,g)&&h++,b.isDark(f+1,g)&&h++,b.isDark(f,
g+1)&&h++,b.isDark(f+1,g+1)&&h++,0==h||4==h)d+=3;for(f=0;f<c;f++)for(g=0;g<c-6;g++)b.isDark(f,g)&&!b.isDark(f,g+1)&&b.isDark(f,g+2)&&b.isDark(f,g+3)&&b.isDark(f,g+4)&&!b.isDark(f,g+5)&&b.isDark(f,g+6)&&(d+=40);for(g=0;g<c;g++)for(f=0;f<c-6;f++)b.isDark(f,g)&&!b.isDark(f+1,g)&&b.isDark(f+2,g)&&b.isDark(f+3,g)&&b.isDark(f+4,g)&&!b.isDark(f+5,g)&&b.isDark(f+6,g)&&(d+=40);for(g=h=0;g<c;g++)for(f=0;f<c;f++)b.isDark(f,g)&&h++;b=Math.abs(100*h/c/c-50)/5;return d+10*b}},QRMath={glog:function(b){if(1>b)throw Error("glog("+
b+")");return QRMath.LOG_TABLE[b]},gexp:function(b){for(;0>b;)b+=255;for(;256<=b;)b-=255;return QRMath.EXP_TABLE[b]},EXP_TABLE:Array(256),LOG_TABLE:Array(256)},i=0;8>i;i++)QRMath.EXP_TABLE[i]=1<<i;for(i=8;256>i;i++)QRMath.EXP_TABLE[i]=QRMath.EXP_TABLE[i-4]^QRMath.EXP_TABLE[i-5]^QRMath.EXP_TABLE[i-6]^QRMath.EXP_TABLE[i-8];for(i=0;255>i;i++)QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]]=i;
function QRPolynomial(b,c){if(void 0==b.length)throw Error(b.length+"/"+c);for(var d=0;d<b.length&&0==b[d];)d++;this.num=Array(b.length-d+c);for(var f=0;f<b.length-d;f++)this.num[f]=b[f+d]}
QRPolynomial.prototype={get:function(b){return this.num[b]},getLength:function(){return this.num.length},multiply:function(b){for(var c=Array(this.getLength()+b.getLength()-1),d=0;d<this.getLength();d++)for(var f=0;f<b.getLength();f++)c[d+f]^=QRMath.gexp(QRMath.glog(this.get(d))+QRMath.glog(b.get(f)));return new QRPolynomial(c,0)},mod:function(b){if(0>this.getLength()-b.getLength())return this;for(var c=QRMath.glog(this.get(0))-QRMath.glog(b.get(0)),d=Array(this.getLength()),f=0;f<this.getLength();f++)d[f]=
this.get(f);for(f=0;f<b.getLength();f++)d[f]^=QRMath.gexp(QRMath.glog(b.get(f))+c);return(new QRPolynomial(d,0)).mod(b)}};function QRRSBlock(b,c){this.totalCount=b;this.dataCount=c}
QRRSBlock.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,
44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,
75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,
117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,
75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,
54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];
QRRSBlock.getRSBlocks=function(b,c){var d=QRRSBlock.getRsBlockTable(b,c);if(void 0==d)throw Error("bad rs block @ typeNumber:"+b+"/errorCorrectLevel:"+c);for(var f=d.length/3,g=[],h=0;h<f;h++)for(var k=d[3*h+0],l=d[3*h+1],m=d[3*h+2],n=0;n<k;n++)g.push(new QRRSBlock(l,m));return g};
QRRSBlock.getRsBlockTable=function(b,c){switch(c){case QRErrorCorrectLevel.L:return QRRSBlock.RS_BLOCK_TABLE[4*(b-1)+0];case QRErrorCorrectLevel.M:return QRRSBlock.RS_BLOCK_TABLE[4*(b-1)+1];case QRErrorCorrectLevel.Q:return QRRSBlock.RS_BLOCK_TABLE[4*(b-1)+2];case QRErrorCorrectLevel.H:return QRRSBlock.RS_BLOCK_TABLE[4*(b-1)+3]}};function QRBitBuffer(){this.buffer=[];this.length=0}
QRBitBuffer.prototype={get:function(b){return 1==(this.buffer[Math.floor(b/8)]>>>7-b%8&1)},put:function(b,c){for(var d=0;d<c;d++)this.putBit(1==(b>>>c-d-1&1))},getLengthInBits:function(){return this.length},putBit:function(b){var c=Math.floor(this.length/8);this.buffer.length<=c&&this.buffer.push(0);b&&(this.buffer[c]|=128>>>this.length%8);this.length++}};
(function(b){b.fn.qrcode=function(c){"string"===typeof c&&(c={text:c});c=b.extend({},{render:"canvas",width:256,height:256,typeNumber:-1,correctLevel:QRErrorCorrectLevel.H,background:"#ffffff",foreground:"#000000"},c);return this.each(function(){var d;if("canvas"==c.render){d=new QRCode(c.typeNumber,c.correctLevel);d.addData(c.text);d.make();var f=document.createElement("canvas");f.width=c.width;f.height=c.height;for(var g=f.getContext("2d"),h=c.width/d.getModuleCount(),k=c.height/d.getModuleCount(),
l=0;l<d.getModuleCount();l++)for(var m=0;m<d.getModuleCount();m++){g.fillStyle=d.isDark(l,m)?c.foreground:c.background;var n=Math.ceil((m+1)*h)-Math.floor(m*h),q=Math.ceil((l+1)*h)-Math.floor(l*h);g.fillRect(Math.round(m*h),Math.round(l*k),n,q)}}else for(d=new QRCode(c.typeNumber,c.correctLevel),d.addData(c.text),d.make(),f=b("<table></table>").css("width",c.width+"px").css("height",c.height+"px").css("border","0px").css("border-collapse","collapse").css("background-color",c.background),g=c.width/
d.getModuleCount(),h=c.height/d.getModuleCount(),k=0;k<d.getModuleCount();k++)for(l=b("<tr></tr>").css("height",h+"px").appendTo(f),m=0;m<d.getModuleCount();m++)b("<td></td>").css("width",g+"px").css("background-color",d.isDark(k,m)?c.foreground:c.background).appendTo(l);d=f;jQuery(d).appendTo(this)})}})(jQuery);
(function(b){b.fn.slider=function(c){if(void 0!=c.value)try{this.setRange(c.value)}catch(d){}else if(void 0!=c.maxValue)try{this.duration=c.maxValue,this.setRange(this.range)}catch(f){}else{var g=this;this.duration=c.max;this.onChange=c.onChange;this.direction=c.direction;var h=b('<div class="slider-total"></div>'),k=b('<div class="slider-range"></div>'),l=b('<div class="slider-handle"></div>');this.append(h);this.append(k);this.append(l);this.setRange=function(b){if(void 0!=b){g.range=b;b=h.offset().left-
g.offset().left;var c=parseInt(k.css("bottom").replace("px","")),d=l.width();if("horizontal"==g.direction){var f=h.width()-d,c=Math.floor(g.range*f/g.duration),c=Math.min(c,f),d=c+d/2;l.css({left:c+b});k.css({width:d})}else f=h.height()-d,b=Math.floor(g.range*f/g.duration),b=Math.min(b,f),d=b+d/2,l.css({bottom:b+c}),k.css({height:d})}};this.setRange(c.range);c=function(c){var d;isTouchDevice()?(d=c.originalEvent.touches[0],void 0==d&&(d=c.touches[0])):d=c;if(void 0!=d){c=b(d.target);var f=0;"horizontal"==
g.direction?(f=d.offsetX,void 0==f&&(f=d.pageX-c.offset().left),f=f/h.width()*g.duration):(f=d.offsetY,void 0==f&&(f=d.pageY-c.offset().top),f=(c.height()-f)/h.height()*g.duration);g.setRange.apply(g,[f]);g.onChange(f);return!1}};h.bind(_event._click,c);k.bind(_event._click,c)}};bdor[30]=function(b,d){return bdor[b]-d}})(jQuery);bdor[7]="m";
(function(b){b.fn.addVideoSkin=function(c){var d=this;this.theme=void 0;for(var f=0;f<videoThemes.length;f++)videoThemes[f].name==c&&(this.theme=videoThemes[f]);void 0==this.theme&&(this.theme=videoThemes[0]);c=this.find("video:first");var g=c[0];if(void 0!=g&&null!=g){this.addClass("video-player").addClass(this.theme.name);var h=b('<div class="video-controls slider-action"></div>');this.append(h);f=b('<div class="control-border"></div>');h.append(f);var k=b('<div class="video-play"></div>');h.append(k);
f=b('<div class="bevel"></div>');h.append(f);f=function(b){!1==g.paused?g.pause():g.play();stopEvent(b);return!1};c.bind(_event._click,f);k.bind(_event._click,f);c.bind("play",function(){k.addClass("paused-button")});c.bind("pause",function(){k.removeClass("paused-button")});c.bind("ended",function(){k.removeClass("paused-button")});h.playButton=k;var l=b('<div class="video-timer">00:00</div>');h.append(l);c.bind("timeupdate",function(){var b=g.currentTime,c=g.duration;if(0==c||void 0==c)c=100;m.slider({maxValue:c});
m.slider({value:b});l.text(timeFormat(b))});h.videoTimer=l;var m=b('<div class="video-seek"></div>');h.append(m);(function(){var b=g.duration;if(0==b||void 0==b)b=100;m.slider({range:0,max:b,direction:"horizontal",onChange:function(b){try{g.currentTime=b}catch(c){}}});h.show();d.controlbarWidth=h.width()})();h.videoSeek=m;f=b('<div class="bevel"></div>');h.append(f);var n=b('<div class="volume-seek"></div>');h.append(n);this.volume_value=1;n.slider({range:1,max:1,direction:"vertical",onChange:function(b){try{d.volume_value=
b,0==b?(g.muted=!0,q.addClass("volume-mute")):(g.muted=!1,q.removeClass("volume-mute")),g.volume=b}catch(c){}}});h.volumeSeek=n;var q=b('<div class="volume-button"></div>');h.append(q);q.bind(_event._click,function(){!0==g.muted?(g.muted=!1,n.slider({value:d.volume_value}),q.removeClass("volume-mute")):(g.muted=!0,n.slider({value:0}),q.addClass("volume-mute"));return!1});q.bind("mouseenter",function(){n.css({visiblity:"visible",opacity:"1"})});q.bind("mouseleave",function(){n.css({visiblity:"hidden",
opacity:"0"})});n.bind("mouseenter",function(){n.css({visiblity:"visible",opacity:"1"})});n.bind("mouseleave",function(){n.css({visiblity:"hidden",opacity:"0"})});h.volumeButton=q;var p=b('<div class="player-fullscreen"></div>');h.append(p);p.bind(_event._click,function(){fullScreenApi.supportsFullScreen?fullScreenApi.isFullScreen()?fullScreenApi.cancelFullScreen():fullScreenApi.requestFullScreen(g):g.webkitSupportsFullscreen&&g.webkitEnterFullscreen();return!1});c.bind(fullScreenApi.fullScreenEventName,
function(){fullScreenApi.isFullScreen()?p.addClass("player-exit-fullscreen"):p.removeClass("player-exit-fullscreen")});h.fullscreenButton=p;this.controlbar=h;this.resizeVideoSkin()}};bdor.i=function(b){return bdor[b]};b.fn.resizeVideoSkin=function(){var b=this.find("video:first")[0],d=this.controlbar;if(void 0!=d){var f=d.videoSeek,g=d.volumeSeek,h=d.volumeButton,k=d.fullscreenButton,l=this.width(),m=Math.max(0,l-this.theme.seekWidth);0>=m?f.css({display:"none"}):(f.css({width:m,display:"block"}),
f.slider({value:b.currentTime}));d=h.offset().left-d.offset().left+(h.width()-g.width())/2;l<this.theme.fullscreenWidth?(k.css({display:"none"}),l<this.theme.volumeWidth?(h.css({display:"none"}),g.css({left:"-45px"})):(h.css({display:"block"}),g.css({left:d+"px"}))):(h.css({display:"block"}),k.css({display:"block"}),g.css({left:d+"px"}));!0==b.muted?g.slider({value:0}):g.slider({value:this.volume_value})}};bdor.f="f";b.fn.addAudioSkin=function(c){var d=this;this.theme=void 0;for(var f=0;f<audioThemes.length;f++)audioThemes[f].name==
c&&(this.theme=audioThemes[f]);void 0==this.theme&&(this.theme=audioThemes[0]);c=this.find("audio:first");var g=c[0];if(void 0!=g&&null!=g){this.audioList=[];this.audioIndex=0;if(0==c.children("source").length)f=c.attr("src"),""!=f&&void 0!=f&&this.audioList.push(c.attr("src"));else for(f=0;f<c.children("source").length;f++){var h=c.children("source")[f];this.audioList.push(h.src)}if(this.audioResources.length>this.audioList.length)for(this.audioList=[],f=0;f<this.audioResources.length;f++)this.audioList.push(this.audioResources[f]);
this.addClass("audio-player").addClass(this.theme.name);this.play_btn=b('<div class="audio-play slider-action"></div>');this.append(this.play_btn);this.play_btn.bind(_event._click,function(b){!1==g.paused?g.pause():g.play();stopEvent(b);return!1});c.bind("play",function(){d.play_btn.addClass("paused-button")});c.bind("pause",function(){d.play_btn.removeClass("paused-button")});c.bind("ended",function(){d.play_btn.removeClass("paused-button");d.audioIndex<d.audioList.length-1&&k()});this.back_btn=
b('<div class="back_button slider-action"></div>');this.append(this.back_btn);this.back_btn.bind(_event._click,function(b){if(0!=d.audioList.length){d.audioIndex--;0>d.audioIndex&&(d.audioIndex+=d.audioList.length);var c=d.audioList[d.audioIndex];g.src=c;d.audio_name.text(m(c));g.play();stopEvent(b);return!1}});this.forward_btn=b('<div class="forward_button slider-action"></div>');this.append(this.forward_btn);var k=function(b){if(0!=d.audioList.length){d.audioIndex++;d.audioIndex%=d.audioList.length;
var c=d.audioList[d.audioIndex];g.src=c;d.audio_name.text(m(c));g.play();stopEvent(b);return!1}};this.forward_btn.bind(_event._click,k);this.volume_seek=b('<div class="volume-seek slider-action"></div>');this.append(this.volume_seek);this.volume_value=1;this.volume_seek.slider({range:1,max:1,direction:this.theme.volumeDirection,onChange:function(b){try{d.volume_value=b,0==b?(g.muted=!0,d.volume_btn.addClass("volume-mute")):(g.muted=!1,d.volume_btn.removeClass("volume-mute")),g.volume=b}catch(c){}}});
this.volume_btn=b('<div class="volume-button slider-action"></div>');this.append(this.volume_btn);var l=function(b){d.volume_value=g.volume+b;d.volume_value=Math.max(0,d.volume_value);d.volume_value=Math.min(1,d.volume_value);g.volume=d.volume_value};this.volume_up_btn=b('<div class="volume-up-button slider-action"></div>');this.volume_down_btn=b('<div class="volume-down-button slider-action"></div>');this.volume_up_btn.bind(_event._click,function(){l(0.1)});this.volume_down_btn.bind(_event._click,
function(){l(-0.1)});this.append(this.volume_up_btn);this.append(this.volume_down_btn);this.volume_btn.bind(_event._click,function(b){!0==g.muted?(g.muted=!1,d.volume_seek.slider({value:d.volume_value}),d.volume_btn.removeClass("volume-mute")):(g.muted=!0,d.volume_seek.slider({value:0}),d.volume_btn.addClass("volume-mute"));stopEvent(b);return!1});this.audio_timer=b('<div class="audio-timer">00:00/00:00</div>');this.append(this.audio_timer);c.bind("timeupdate",function(){var b=g.currentTime,c=g.duration;
d.audio_seek.slider({maxValue:c});d.audio_seek.slider({value:b});d.audio_timer.text(timeFormat(b)+"/"+timeFormat(c))});this.audio_seek=b('<div class="audio-seek slider-action"></div>');this.append(this.audio_seek);(function(){var b=g.duration;if(0==b||void 0==b)b=100;d.audio_seek.slider({range:0,max:b,direction:"horizontal",onChange:function(b){try{g.currentTime=b}catch(c){}}});d.resizeAudioSkin()})();this.audio_name=b('<div class="audio-file"></div>');this.append(this.audio_name);f="";0<this.audioList.length&&
(f=this.audioList[0]);var m=function(b){if(""==b)return"";var c=-1,c=-1==b.indexOf("\\")?b.lastIndexOf("/"):b.lastIndexOf("\\");iNameEnd=b.lastIndexOf(".");return fileTitle=b.substr(c+1,iNameEnd-c-1)};this.audio_name.text(m(f));d.resizeAudioSkin()}};b.fn.resizeAudioSkin=function(){var b=this.find("audio:first")[0];if(null!=this.theme&&void 0!=this.theme){var d=Math.max(0,this.width()-this.theme.audioSeek);0>=d?this.audio_seek.css({display:"none"}):(this.audio_seek.css({width:d,display:"block"}),this.audio_seek.slider({value:b.currentTime}));
d=this.theme.wolumnWidth;void 0!=d&&(this.width()<d?(this.volume_btn.css({display:"none"}),this.volume_seek.css({display:"none"})):(this.volume_btn.css({display:"block"}),this.volume_seek.css({display:"block"})),!1==b.muted?this.volume_seek.slider({value:this.volume_value}):this.volume_seek.slider({value:0}))}};b.fn.refreshAudioSeek=function(){var b=this.find("audio:first")[0];null!=this.theme&&void 0!=this.theme&&null!=b&&(this.audio_seek.slider({value:b.currentTime}),!1==b.muted?this.volume_seek.slider({value:this.volume_value}):
this.volume_seek.slider({value:0}))};this.skin=this.bdor})(jQuery);
var videoThemes=[{name:"default",seekWidth:150,volumeWidth:105,fullscreenWidth:130},{name:"round",seekWidth:225,volumeWidth:145,fullscreenWidth:150},{name:"classic",seekWidth:195,volumeWidth:135,fullscreenWidth:170},{name:"smallblack",seekWidth:135,volumeWidth:85,fullscreenWidth:110},{name:"circle",seekWidth:150,volumeWidth:105,fullscreenWidth:130}],audioThemes=[{name:"default",volumeDirection:"horizontal",audioSeek:20,wolumnWidth:170},{name:"advanced",volumeDirection:"horizontal"},{name:"wave",volumeDirection:"horizontal",
audioSeek:125},{name:"glass",volumeDirection:"horizontal"},{name:"simple",volumeDirection:"horizontal"},{name:"enjoy",volumeDirection:"horizontal"},{name:"decent",volumeDirection:"vertical"},{name:"tree",volumeDirection:"horizontal"},{name:"christmas",volumeDirection:"vertical"},{name:"turnonoff",volumeDirection:"horizontal"},{name:"fade",volumeDirection:"horizontal"},{name:"background",volumeDirection:"horizontal"}],audioThemeNames={GlassAudioPlayer:"",SimpleAudioPlayer:"",StandardAudioPlayer:"",
StandardAudioPlayer02:"",StandardAudioPlayer03:"",StandardAudioPlayer04:"",StandardAudioPlayer05:"",StandardAudioPlayer06:""},timeFormat=function(b){var c=10>Math.floor(b/60)?"0"+Math.floor(b/60):Math.floor(b/60);return c+":"+(10>Math.floor(b-60*c)?"0"+Math.floor(b-60*c):Math.floor(b-60*c))},stopEvent=function(b){b=b||window.event;b.preventDefault?(b.preventDefault(),b.stopPropagation()):(b.returnValue=!1,b.cancelBubble=!0)};bdor[8]="o";
(function(b,c,d){function f(b,c){var d=(b[0]||0)-(c[0]||0);return 0<d||!d&&0<b.length&&f(b.slice(1),c.slice(1))}function g(b){if(typeof b!=k)return b;var c=[],d="",f;for(f in b)d=typeof b[f]==k?g(b[f]):[f,l?encodeURI(b[f]):b[f]].join("="),c.push(d);return c.join("&")}function h(b){var c=[],d;for(d in b)c.push(['<param name="',d,'" value="',g(b[d]),'" />'].join(""));return c.join("")}var k="object",l=!0;try{var m=d.description||(new d("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version")}catch(n){m=
"Unavailable"}var q=m.match(/\d+/g)||[0];b[c]={available:0<q[0],activeX:d&&!d.name,version:{original:m,array:q,string:q.join("."),major:parseInt(q[0],10)||0,minor:parseInt(q[1],10)||0,release:parseInt(q[2],10)||0},hasVersion:function(b){b=/string|number/.test(typeof b)?b.toString().split("."):/object/.test(typeof b)?[b.major,b.minor]:b||[0,0];return f(q,b)},encodeParams:!0,expressInstall:"expressInstall.swf",expressInstallIsActive:!1,create:function(b){if(!b.swf||this.expressInstallIsActive||!this.available&&
!b.hasVersionFail)return!1;if(!this.hasVersion(b.hasVersion||1)){this.expressInstallIsActive=!0;if("function"==typeof b.hasVersionFail&&!b.hasVersionFail.apply(b))return!1;b={swf:b.expressInstall||this.expressInstall,height:137,width:214,flashvars:{MMredirectURL:location.href,MMplayerType:this.activeX?"ActiveX":"PlugIn",MMdoctitle:document.title.slice(0,47)+" - Flash Player Installation"}}}attrs={data:b.swf,type:"application/x-shockwave-flash",id:b.id||"flash_"+Math.floor(999999999*Math.random()),
width:b.width||320,height:b.height||180,style:b.style||""};l="undefined"!==typeof b.useEncode?b.useEncode:this.encodeParams;b.movie=b.swf;b.wmode=b.wmode||"opaque";delete b.fallback;delete b.hasVersion;delete b.hasVersionFail;delete b.height;delete b.id;delete b.swf;delete b.useEncode;delete b.width;var c=document.createElement("div"),d;d=attrs;var f=[],g;for(g in d)d[g]&&f.push([g,'="',d[g],'"'].join(""));d=f.join(" ");c.innerHTML=["<object ",d,">",h(b),"</object>"].join("");return c.firstChild}};
b.fn[c]=function(d){var f=this.find(k).andSelf().filter(k);/string|object/.test(typeof d)&&this.each(function(){var f=b(this),g;d=typeof d==k?d:{swf:d};d.fallback=this;if(g=b[c].create(d))f.children().remove(),f.html(g)});"function"==typeof d&&f.each(function(){var f=this;f.jsInteractionTimeoutMs=f.jsInteractionTimeoutMs||0;660>f.jsInteractionTimeoutMs&&(f.clientWidth||f.clientHeight?d.call(f):setTimeout(function(){b(f)[c](d)},f.jsInteractionTimeoutMs+66))});return f}})(jQuery,"flash",navigator.plugins["Shockwave Flash"]||
window.ActiveXObject);jQuery.easing.jswing=jQuery.easing.swing;
jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(b,c,d,f,g){return jQuery.easing[jQuery.easing.def](b,c,d,f,g)},easeInQuad:function(b,c,d,f,g){return f*(c/=g)*c+d},easeOutQuad:function(b,c,d,f,g){return-f*(c/=g)*(c-2)+d},easeInOutQuad:function(b,c,d,f,g){return 1>(c/=g/2)?f/2*c*c+d:-f/2*(--c*(c-2)-1)+d},easeInCubic:function(b,c,d,f,g){return f*(c/=g)*c*c+d},easeOutCubic:function(b,c,d,f,g){return f*((c=c/g-1)*c*c+1)+d},easeInOutCubic:function(b,c,d,f,g){return 1>(c/=g/2)?f/2*c*c*c+d:
f/2*((c-=2)*c*c+2)+d},easeInQuart:function(b,c,d,f,g){return f*(c/=g)*c*c*c+d},easeOutQuart:function(b,c,d,f,g){return-f*((c=c/g-1)*c*c*c-1)+d},easeInOutQuart:function(b,c,d,f,g){return 1>(c/=g/2)?f/2*c*c*c*c+d:-f/2*((c-=2)*c*c*c-2)+d},easeInQuint:function(b,c,d,f,g){return f*(c/=g)*c*c*c*c+d},easeOutQuint:function(b,c,d,f,g){return f*((c=c/g-1)*c*c*c*c+1)+d},easeInOutQuint:function(b,c,d,f,g){return 1>(c/=g/2)?f/2*c*c*c*c*c+d:f/2*((c-=2)*c*c*c*c+2)+d},easeInSine:function(b,c,d,f,g){return-f*Math.cos(c/
g*(Math.PI/2))+f+d},easeOutSine:function(b,c,d,f,g){return f*Math.sin(c/g*(Math.PI/2))+d},easeInOutSine:function(b,c,d,f,g){return-f/2*(Math.cos(Math.PI*c/g)-1)+d},easeInExpo:function(b,c,d,f,g){return 0==c?d:f*Math.pow(2,10*(c/g-1))+d},easeOutExpo:function(b,c,d,f,g){return c==g?d+f:f*(-Math.pow(2,-10*c/g)+1)+d},easeInOutExpo:function(b,c,d,f,g){return 0==c?d:c==g?d+f:1>(c/=g/2)?f/2*Math.pow(2,10*(c-1))+d:f/2*(-Math.pow(2,-10*--c)+2)+d},easeInCirc:function(b,c,d,f,g){return-f*(Math.sqrt(1-(c/=g)*
c)-1)+d},easeOutCirc:function(b,c,d,f,g){return f*Math.sqrt(1-(c=c/g-1)*c)+d},easeInOutCirc:function(b,c,d,f,g){return 1>(c/=g/2)?-f/2*(Math.sqrt(1-c*c)-1)+d:f/2*(Math.sqrt(1-(c-=2)*c)+1)+d},easeInElastic:function(b,c,d,f,g){b=1.70158;var h=0,k=f;if(0==c)return d;if(1==(c/=g))return d+f;h||(h=0.3*g);k<Math.abs(f)?(k=f,b=h/4):b=h/(2*Math.PI)*Math.asin(f/k);return-(k*Math.pow(2,10*(c-=1))*Math.sin(2*(c*g-b)*Math.PI/h))+d},easeOutElastic:function(b,c,d,f,g){b=1.70158;var h=0,k=f;if(0==c)return d;if(1==
(c/=g))return d+f;h||(h=0.3*g);k<Math.abs(f)?(k=f,b=h/4):b=h/(2*Math.PI)*Math.asin(f/k);return k*Math.pow(2,-10*c)*Math.sin(2*(c*g-b)*Math.PI/h)+f+d},easeInOutElastic:function(b,c,d,f,g){b=1.70158;var h=0,k=f;if(0==c)return d;if(2==(c/=g/2))return d+f;h||(h=0.3*g*1.5);k<Math.abs(f)?(k=f,b=h/4):b=h/(2*Math.PI)*Math.asin(f/k);return 1>c?-0.5*k*Math.pow(2,10*(c-=1))*Math.sin(2*(c*g-b)*Math.PI/h)+d:k*Math.pow(2,-10*(c-=1))*Math.sin(2*(c*g-b)*Math.PI/h)*0.5+f+d},easeInBack:function(b,c,d,f,g,h){void 0==
h&&(h=1.70158);return f*(c/=g)*c*((h+1)*c-h)+d},easeOutBack:function(b,c,d,f,g,h){void 0==h&&(h=1.70158);return f*((c=c/g-1)*c*((h+1)*c+h)+1)+d},easeInOutBack:function(b,c,d,f,g,h){void 0==h&&(h=1.70158);return 1>(c/=g/2)?f/2*c*c*(((h*=1.525)+1)*c-h)+d:f/2*((c-=2)*c*(((h*=1.525)+1)*c+h)+2)+d},easeInBounce:function(b,c,d,f,g){return f-jQuery.easing.easeOutBounce(b,g-c,0,f,g)+d},easeOutBounce:function(b,c,d,f,g){return(c/=g)<1/2.75?7.5625*f*c*c+d:c<2/2.75?f*(7.5625*(c-=1.5/2.75)*c+0.75)+d:c<2.5/2.75?
f*(7.5625*(c-=2.25/2.75)*c+0.9375)+d:f*(7.5625*(c-=2.625/2.75)*c+0.984375)+d},easeInOutBounce:function(b,c,d,f,g){return c<g/2?0.5*jQuery.easing.easeInBounce(b,2*c,0,f,g)+d:0.5*jQuery.easing.easeOutBounce(b,2*c-g,0,f,g)+0.5*f+d}});
(function(b){var c=[],d=function(){},f=0,g=[],h=function(){f++;f>=c.length&&(d(g),d=function(){})},k=function(c){var d=new Image;b(d).load(function(){g.push({url:c,img:d});h()}).error(function(){g.push(d);h()}).attr("src",c)};b.fn.loader=function(f,g,h){f&&b.extend(c,f);"function"==typeof g&&(d=g);for(f=0;f<c.length;f++)k(c[f])}})(jQuery);
var phoneIconInfo={width:600,height:720,iconInfo:[{id:"next",position:{x:96,y:193},width:48,height:48},{id:"prev",position:{x:10,y:193},width:48,height:48},{id:"search",position:{x:178,y:18},width:48,height:48},{id:"tableofcontent",position:{x:255,y:21},width:48,height:48},{id:"zoomIn",position:{x:19,y:106},width:48,height:48},{id:"thumb",position:{x:19,y:18},width:48,height:48},{id:"more",position:{x:97,y:19},width:48,height:48},{id:"miSearch",position:{x:21,y:284},width:32,height:32},{id:"miTableOfContent",
position:{x:373,y:284},width:32,height:32},{id:"miShare",position:{x:87,y:284},width:32,height:32},{id:"miHome",position:{x:495,y:284},width:32,height:32},{id:"twitter",position:{x:16,y:423},width:120,height:120},{id:"facebook",position:{x:161,y:423},width:120,height:120},{id:"google",position:{x:462,y:423},width:120,height:120},{id:"linkedin",position:{x:309,y:423},width:120,height:120},{id:"collapsed",position:{x:406,y:348},width:24,height:24},{id:"expanded",position:{x:449,y:351},width:24,height:24},
{id:"download",position:{x:162,y:284},width:32,height:32},{id:"print",position:{x:305,y:283},width:32,height:32},{id:"autoPlay",position:{x:184,y:104},width:48,height:48},{id:"stopAutoPlay",position:{x:258,y:104},width:48,height:48},{id:"shoppingCart",position:{x:407,y:104},width:48,height:48},{id:"goBtn",position:{x:338,y:110},width:48,height:48},{id:"languageChange",position:{x:232,y:284},width:32,height:32},{id:"setting",position:{x:437,y:282},width:32,height:32},{id:"firstBtn",position:{x:194,
y:194},width:45,height:45},{id:"prevBtn",position:{x:291,y:194},width:45,height:45},{id:"nextBtn",position:{x:383,y:194},width:45,height:45},{id:"lastBtn",position:{x:475,y:194},width:45,height:45},{id:"choosed",position:{x:356,y:346},width:28,height:28},{id:"unchoosed",position:{x:297,y:346},width:28,height:28},{id:"gotoPage",position:{x:414,y:20},width:48,height:48},{id:"zoomOut",position:{x:101,y:107},width:48,height:48},{id:"passward",position:{x:8,y:547},width:170,height:170}]},catalogIconInfo=
{width:520,height:174,iconInfo:[{id:"background",position:{x:3,y:9},width:420,height:50},{id:"thumb",position:{x:144,y:66},width:38,height:38},{id:"search",position:{x:192,y:66},width:38,height:38},{id:"prev",position:{x:240,y:66},width:38,height:38},{id:"next",position:{x:288,y:66},width:38,height:38},{id:"more",position:{x:336,y:66},width:38,height:38},{id:"fullScreen",position:{x:384,y:66},width:38,height:38},{id:"exitFullScreen",position:{x:432,y:66},width:38,height:38},{id:"share",position:{x:480,
y:66},width:38,height:38},{id:"thumb_down",position:{x:144,y:106},width:38,height:38},{id:"search_down",position:{x:192,y:106},width:38,height:38},{id:"prev_down",position:{x:240,y:106},width:38,height:38},{id:"next_down",position:{x:288,y:106},width:38,height:38},{id:"more_down",position:{x:336,y:106},width:38,height:38},{id:"fullScreen_down",position:{x:384,y:106},width:38,height:38},{id:"exitFullScreen_down",position:{x:432,y:106},width:38,height:38},{id:"share_down",position:{x:480,y:106},width:38,
height:38}]};
(function(b){var c=function(){return Hammer.HAS_TOUCHEVENTS&&navigator.userAgent.match(Hammer.MOBILE_REGEX)};bdor[3]="f";var d=function(b){var f=this;this.theButton=b;this.eventSource=b[0];c()?(b.bind("touchstart",function(){d.prototype.mouseDown.apply(f,arguments)}),b.bind("touchend",function(){d.prototype.mouseUp.apply(f,arguments)})):(b.bind("mousedown",function(){d.prototype.mouseDown.apply(f,arguments)}),b.bind("mouseleave",function(){d.prototype.mouseUp.apply(f,arguments)}),b.bind("mouseup",function(){d.prototype.mouseUp.apply(f,
arguments)}))};d.prototype.mouseDown=function(){this.setAlpha(70)};d.prototype.mouseUp=function(){var b=this;window.setTimeout(function(){d.prototype.setAlpha.apply(b,[100])},100)};d.prototype.setAlpha=function(b){0>b&&(b=0);100<=b&&(b=100);this.theButton.css("opacity",b/100)};b.fn.asButton=function(){new d(this);return this};bdor[4]="h";var f=function(b){this.eventSource=b[0];this.origPicture=b[0].src;var d=this.origPicture.lastIndexOf("."),g=this.origPicture.substr(0,d),d=this.origPicture.substring(d);
this.pictureDown=g+"_down"+d;var h=this;c()?(b.bind("touchstart",function(){f.prototype.mouseDown.apply(h,arguments)}),b.bind("touchend",function(){f.prototype.mouseUp.apply(h,arguments)})):(b.bind("mouseenter",function(){f.prototype.mouseOver.apply(h,arguments)}),b.bind("mousedown",function(){f.prototype.mouseDown.apply(h,arguments)}),b.bind("mouseup",function(){f.prototype.mouseUp.apply(h,arguments)}),b.bind("mouseleave",function(){f.prototype.mouseUp.apply(h,arguments)}))};f.prototype.mouseOver=
function(){this.eventSource.src=this.pictureDown};f.prototype.mouseDown=function(){this.eventSource.src=this.pictureDown};f.prototype.mouseUp=function(){var b=this;window.setTimeout(function(){b.eventSource.src=b.origPicture},100)};b.fn.asImageButton=function(){new f(this);return this};var g=function(b){this.eventSource=b[0];this.origPicture=b[0].src;var d=this.origPicture.lastIndexOf("."),f=this.origPicture.substr(0,d),d=this.origPicture.substring(d);this.pictureDown=f+"_down"+d;var h=this;c()?(b.bind("touchstart",
function(){g.prototype.mouseOver.apply(h,arguments)}),b.bind("touchend",function(){g.prototype.mouseUp.apply(h,arguments)})):(b.bind("mouseenter",function(){g.prototype.mouseOver.apply(h,arguments)}),b.bind("mousedown",function(){g.prototype.mouseDown.apply(h,arguments)}),b.bind("mouseup",function(){g.prototype.mouseUp.apply(h,arguments)}),b.bind("mouseleave",function(){g.prototype.mouseUp.apply(h,arguments)}))};bdor[10]="l";g.prototype.mouseOver=function(){this.eventSource.src=this.pictureDown};
g.prototype.mouseDown=function(){this.eventSource.src=this.pictureDown};g.prototype.mouseUp=function(){var b=this;window.setTimeout(function(){b.eventSource.src=b.origPicture},100)};b.fn.asImageChangeButton=function(){new g(this);return this};var h=function(b){var c=this;this.theButton=b;this.eventSource=b[0];var d=this.theButton.css("top");this.iOrigTop=parseInt(d.replace("px",""));this.iJumpTop=this.iOrigTop-5;b.bind("mouseenter",function(){h.prototype.MouseEnter.apply(c,arguments)});b.bind("mouseleave",
function(){h.prototype.MouseLeave.apply(c,arguments)})};h.prototype.MouseEnter=function(){this.theButton.animate({top:this.iJumpTop},50)};h.prototype.MouseLeave=function(){this.theButton.animate({top:this.iOrigTop},50)};b.fn.mouseEnterJump=function(){new h(this);return this};b.fn.mouseOverCursor=function(){new k(this);return this};var k=function(b){b.bind("mouseover",function(){b.css({cursor:"pointer"})})},l=function(b){var c=this;this.theButton=b;this.eventSource=b[0];var d=this.theButton.css("top");
this.iOrigTop=parseInt(d.replace("px",""));d=this.theButton.css("left");this.iOrigLeft=parseInt(d.replace("px",""));this.iZoomTop=this.iOrigTop-3;this.iZoomLeft=this.iOrigLeft-1;b.bind("mouseenter",function(){l.prototype.MouseEnter.apply(c,arguments)});b.bind("mouseleave",function(){l.prototype.MouseLeave.apply(c,arguments)})};l.prototype.MouseDown=function(){this.theButton.css({left:this.iZoomLeft+"px",top:this.iZoomTop+"px","-webkit-transform":"scale(1.1)","-moz-transform":"scale(1.1)",transform:"scale(1.1)",
"-ms-transform":"scale(1.1)","-o-transform":"scale(1.1)"})};l.prototype.MouseEnter=function(){this.theButton.css({left:this.iZoomLeft+"px",top:this.iZoomTop+"px","-webkit-transform":"scale(1.2)","-moz-transform":"scale(1.2)",transform:"scale(1.2)","-ms-transform":"scale(1.2)","-o-transform":"scale(1.2)"})};l.prototype.MouseLeave=function(){this.theButton.css({left:this.iOrigLeft+"px",top:this.iOrigTop+"px","-webkit-transform":"scale(1)","-moz-transform":"scale(1)",transform:"scale(1)","-ms-transform":"scale(1)",
"-o-transform":"scale(1)"})};var m=function(b){var c=this;this.theButton=b;this.eventSource=b[0];var d=this.theButton.css("top");this.iOrigTop=parseInt(d.replace("px",""));d=this.theButton.css("left");this.iOrigLeft=parseInt(d.replace("px",""));this.iZoomTop=this.iOrigTop-1;this.iZoomLeft=this.iOrigLeft-1;b.bind("mouseenter",function(){m.prototype.MouseEnter.apply(c,arguments)});b.bind("mouseleave",function(){m.prototype.MouseLeave.apply(c,arguments)})};m.prototype.MouseEnter=function(){this.theButton.css({left:this.iZoomLeft+
"px",top:this.iZoomTop+"px","-webkit-transform":"scale(1.1)","-moz-transform":"scale(1.1)",transform:"scale(1.1)","-ms-transform":"scale(1.1)","-o-transform":"scale(1.1)"})};m.prototype.MouseLeave=function(){this.theButton.css({left:this.iOrigLeft+"px",top:this.iOrigTop+"px","-webkit-transform":"scale(1)","-moz-transform":"scale(1)",transform:"scale(1)","-ms-transform":"scale(1)","-o-transform":"scale(1)"})};b.fn.mouseEnterZoom=function(){new m(this);return this};b.fn.mouseEnterUp=function(){new n(this);
return this};var n=function(b){var c=this;this.theButton=b;this.eventSource=b[0];var d=this.theButton.css("bottom");this.iOrigTop=parseInt(d.replace("px",""));d=this.theButton.css("left");this.iOrigLeft=parseInt(d.replace("px",""));this.iZoomTop=this.iOrigTop-1;this.iZoomLeft=this.iOrigLeft-1;b.bind("mouseenter",function(){n.prototype.MouseEnter.apply(c,arguments)});b.bind("mouseleave",function(){n.prototype.MouseLeave.apply(c,arguments)})};n.prototype.MouseEnter=function(){this.theButton.css({bottom:this.iZoomTop+
"px","-webkit-transform":"scale(1.1)","-moz-transform":"scale(1.1)",transform:"scale(1.1)","-ms-transform":"scale(1.1)","-o-transform":"scale(1.1)"})};n.prototype.MouseLeave=function(){this.theButton.css({bottom:this.iOrigTop+"px","-webkit-transform":"scale(1)","-moz-transform":"scale(1)",transform:"scale(1)","-ms-transform":"scale(1)","-o-transform":"scale(1)"})};b.fn.mouseZoomUp=function(){new l(this);return this};b.fn.mouseEnterLight=function(){var b=this;this.bind(_event._enter,function(){b.css({background:"#EEEEEE"})});
this.bind(_event._down,function(){b.css({background:"#EEEEEE"})});c()?this.bind(_event._end,function(){b.css({background:"transparent"})}):this.bind(_event._end,function(){b.css({background:"#EEEEEE"})});this.bind(_event._leave,function(){b.css({background:"transparent"})});return this};b.fn.mouseEnterShine=function(b,d,f){var g=this,h=colorDiv(b,10);this.bind(_event._enter,function(){g.css({background:h});g.css({border:""});g.css({"border-left":"1px solid "+f,"border-top":"1px solid "+f});g.css({"border-right":"1px solid "+
d,"border-bottom":"1px solid "+d})});this.bind(_event._down,function(){g.css({background:h});g.css({border:""});g.css({"border-left":"1px solid "+d,"border-top":"1px solid "+d});g.css({"border-right":"1px solid "+f,"border-bottom":"1px solid "+f})});c()?this.bind(_event._end,function(){g.css({background:"transparent"});g.css({border:""})}):this.bind(_event._end,function(){g.css({background:h});g.css({border:""});g.css({"border-left":"1px solid "+f,"border-top":"1px solid "+f});g.css({"border-right":"1px solid "+
d,"border-bottom":"1px solid "+d})});this.bind(_event._leave,function(){g.css({background:"transparent"});g.css({border:""})});return this};b.fn.mouseEnterGradient=function(b,d,f){var g=this,h=colorAdd(b,75),l="-webkit-gradient(linear,left top,left bottom,color-stop(0,"+h+"),color-stop(0.19,"+colorAdd(h,2)+"),color-stop(0.35,"+colorAdd(h,28)+"),color-stop(0.55, "+colorAdd(h,6)+"),color-stop(0.75,"+colorAdd(h,4)+"),color-stop(0.85,"+colorAdd(h,2)+"),color-stop(1, "+h+"))";this.bind(_event._enter,function(){g.css("background",
l);g.css({border:""});g.css({"border-left":"1px solid "+f,"border-top":"1px solid "+f});g.css({"border-right":"1px solid "+d,"border-bottom":"1px solid "+d})});this.bind(_event._down,function(){g.setGradient(h,!1);g.css({border:""});g.css({"border-left":"1px solid "+d,"border-top":"1px solid "+d});g.css({"border-right":"1px solid "+f,"border-bottom":"1px solid "+f})});c()?this.bind(_event._end,function(){g.css({background:"transparent"});g.css({border:""})}):this.bind(_event._end,function(){g.css("background",
l);g[0].style.removeAttribute&&g[0].style.removeAttribute("filter");g.css({border:""});g.css({"border-left":"1px solid "+f,"border-top":"1px solid "+f});g.css({"border-right":"1px solid "+d,"border-bottom":"1px solid "+d})});this.bind(_event._leave,function(){g[0].style.removeAttribute&&g[0].style.removeAttribute("filter");g.css({background:"transparent"});g.css({border:""})});return this};b.fn.dragToMove=function(c,d,f){var g=!1,h=0,l=0,k=0,m=0;b(this).bind(_event._down,function(d){var f=b(this)[0];
f.setCapture?f.setCapture():window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);d=isTouch?d.originalEvent.changedTouches:[d];g=!0;h=d[0].pageX;l=d[0].pageY;k=b(c).offset().left;m=b(c).offset().top});b(this).bind(_event._end,function(c){c=b(this)[0];c.releaseCapture?c.releaseCapture():window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);g=!1});b(this).bind(_event._move,function(n){n=isTouch?n.originalEvent.touches:[n];if(g){var w=k+(n[0].pageX-h);n=m+(n[0].pageY-l);void 0!=d&&(w=Math.max(d.x,w),w=Math.min(d.y,
w));void 0!=f&&(n=Math.max(f.x,n),n=Math.min(f.y,n));b(c).css({left:w+"px",top:n+"px"})}});b(this).bind("mouseleave",function(){return g=!1})};b.fn.slideFlipButtonShine=function(c){b(this).bind(_event._over,function(){b(this).css({cursor:"pointer"})});b(this).bind(_event._enter,function(){b(this).css({background:"#000000"})});b(this).bind(_event._leave,function(){b(this).css({background:"#888888"})})};bdor[31]=function(b,c){return bdor[b]-bdor[c]};b.fn.slideZoomButtonShine=function(c){b(this).bind(_event._enter,
function(){b(this).css({cursor:"pointer"});b(this).css({background:"#555555"})});b(this).bind(_event._leave,function(){b(this).css({background:""})})};b.fn.mouseEnterChange=function(c,d,f){var g=this;this.bind(_event._enter,function(){var h=b("<img src='"+f+"'>");g.empty().append(h);g.css({background:d});g.changeButtonColor(c)});this.bind(_event._end,function(){var c=b("<img src='"+f+"'>");g.empty().append(c);g.css({background:"transparent"});g.changeButtonColor(d)});this.bind(_event._leave,function(){var c=
b("<img src='"+f+"'>");g.empty().append(c);g.css({background:"transparent"});g.changeButtonColor(d)});return this};b.fn.onClick=function(b){var c=!1,d=new Point(0,0);this.bind(_event._down,function(b){b=isTouch?b.originalEvent.touches:[b];1<b.length?c=!1:(c=!0,d.x=b[0].pageX,d.y=b[0].pageY)});this.bind(_event._move,function(b){b=isTouch?b.originalEvent.touches:[b];1<b.length?c=!1:c&&(2<Math.abs(b[0].pageX-d.x)||Math.abs(2<b[0].pageY-d.y))&&(c=!1)});this.bind(_event._end,function(d){c&&(c=!1,window.setTimeout(function(){b&&
b(d)}))})};b.fn.clickExceptMove=function(b){var c=!1,d=!1,f=new Point(0,0);this.bind(_event._down,function(b){b=isTouch?b.originalEvent.touches:[b];c=!0;d=!1;f.x=b[0].pageX;f.y=b[0].pageY;1<b.length&&(c=!1)});this.bind(_event._move,function(b){b=isTouch?b.originalEvent.touches:[b];d=1>=Math.abs(b[0].pageX-f.x)&&1>=Math.abs(b[0].pageY-f.y)?!1:!0});this.bind(_event._end,function(f){c&&!d&&b();d=c=!1})};b.fn.enterToChange=function(b,c,d,f,g){var h=this.children(),l=this;this.bind(_event._down,function(k){c=
l.attr("id");h.cssSprite(b,c+"_down",d,f,g)});this.bind(_event._enter,function(k){c=l.attr("id");h.cssSprite(b,c+"_down",d,f,g)});this.bind(_event._leave,function(k){c=l.attr("id");h.cssSprite(b,c,d,f,g)})};b.fn.addCssSprite=function(c,d,f,g,h){var l=b("<div></div>");l.cssSprite(c,d,f,g,h);this.append(l)};b.fn.changeCssSprite=function(b,c,d,f,g){this.children().cssSprite(b,c,d,f,g)};b.fn.cssSprite=function(b,c,d,f,g){if(g.iconInfo){for(var h=0,l=0;l<g.iconInfo.length;l++)if(g.iconInfo[l].id==c){h=
l;break}c=g.iconInfo[h].position;var l="",l=g.width,k=g.height,m=0,n=0,m=d*l/g.iconInfo[h].width,n=f*k/g.iconInfo[h].height;c=-c.x*m/l+"px "+-c.y*n/k+"px";l=m+"px "+n+"px";this.css({"background-image":"url("+b+")","background-repeat":"no-repeat","background-position":c,"-webkit-background-size":l,"-o-background-size":l,"background-size":l})}};bdor[6]="l"})(jQuery);var hddr=[];
(function(b,c){function d(){if(!f.READY){f.event.determineEventTypes();for(var b in f.gestures)f.gestures.hasOwnProperty(b)&&f.detection.register(f.gestures[b]);f.event.onTouch(f.DOCUMENT,f.EVENT_MOVE,f.detection.detect);f.event.onTouch(f.DOCUMENT,f.EVENT_END,f.detection.detect);f.READY=!0}}var f=function(b,c){return new f.Instance(b,c||{})};f.defaults={stop_browser_behavior:{touchAction:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};f.HAS_POINTEREVENTS=
navigator.pointerEnabled||navigator.msPointerEnabled;f.HAS_TOUCHEVENTS="ontouchstart"in b;f.MOBILE_REGEX=/mobile|tablet|ip(ad|hone|od)|android/i;f.NO_MOUSEEVENTS=f.HAS_TOUCHEVENTS&&navigator.userAgent.match(f.MOBILE_REGEX);f.EVENT_TYPES={};f.DIRECTION_DOWN="down";f.DIRECTION_LEFT="left";f.DIRECTION_UP="up";f.DIRECTION_RIGHT="right";f.POINTER_MOUSE="mouse";f.POINTER_TOUCH="touch";f.POINTER_PEN="pen";f.EVENT_START="start";f.EVENT_MOVE="move";f.EVENT_END="end";f.DOCUMENT=document;f.plugins={};f.READY=
!1;f.Instance=function(b,c){var g=this;return d(),this.element=b,this.enabled=!0,this.options=f.utils.extend(f.utils.extend({},f.defaults),c||{}),this.options.stop_browser_behavior&&f.utils.stopDefaultBrowserBehavior(this.element,this.options.stop_browser_behavior),f.event.onTouch(b,f.EVENT_START,function(b){g.enabled&&f.detection.startDetect(g,b)}),this};f.Instance.prototype={on:function(b,c){for(var d=b.split(" "),f=0;d.length>f;f++)this.element.addEventListener(d[f],c,!1);return this},off:function(b,
c){for(var d=b.split(" "),f=0;d.length>f;f++)this.element.removeEventListener(d[f],c,!1);return this},trigger:function(b,c){var d=f.DOCUMENT.createEvent("Event");d.initEvent(b,!0,!0);d.gesture=c;var g=this.element;return f.utils.hasParent(c.target,g)&&(g=c.target),g.dispatchEvent(d),this},enable:function(b){return this.enabled=b,this}};var g=null,h=!1,k=!1;f.event={bindDom:function(b,c,d){c=c.split(" ");for(var f=0;c.length>f;f++)b.addEventListener(c[f],d,!1)},onTouch:function(b,c,d){var q=this;this.bindDom(b,
f.EVENT_TYPES[c],function(p){var s=p.type.toLowerCase();if(!s.match(/mouse/)||!k){(s.match(/touch/)||s.match(/pointerdown/)||s.match(/mouse/)&&1===p.which)&&(h=!0);s.match(/touch|pointer/)&&(k=!0);var r=0;h&&(f.HAS_POINTEREVENTS&&c!=f.EVENT_END?r=f.PointerEvent.updatePointer(c,p):s.match(/touch/)?r=p.touches.length:k||(r=s.match(/up/)?0:1),0<r&&c==f.EVENT_END?c=f.EVENT_MOVE:r||(c=f.EVENT_END),r||null===g?g=p:p=g,d.call(f.detection,q.collectEventData(b,c,p)),f.HAS_POINTEREVENTS&&c==f.EVENT_END&&(r=
f.PointerEvent.updatePointer(c,p)));r||(g=null,h=!1,k=!1,f.PointerEvent.reset())}})},determineEventTypes:function(){var b;b=f.HAS_POINTEREVENTS?f.PointerEvent.getEvents():f.NO_MOUSEEVENTS?["touchstart","touchmove","touchend touchcancel"]:["touchstart mousedown","touchmove mousemove","touchend touchcancel mouseup"];f.EVENT_TYPES[f.EVENT_START]=b[0];f.EVENT_TYPES[f.EVENT_MOVE]=b[1];f.EVENT_TYPES[f.EVENT_END]=b[2]},getTouchList:function(b){return f.HAS_POINTEREVENTS?f.PointerEvent.getTouchList():b.touches?
b.touches:[{identifier:1,pageX:b.pageX,pageY:b.pageY,target:b.target}]},collectEventData:function(b,c,d){b=this.getTouchList(d,c);var g=f.POINTER_TOUCH;return(d.type.match(/mouse/)||f.PointerEvent.matchType(f.POINTER_MOUSE,d))&&(g=f.POINTER_MOUSE),{center:f.utils.getCenter(b),timeStamp:(new Date).getTime(),target:d.target,touches:b,eventType:c,pointerType:g,srcEvent:d,preventDefault:function(){this.srcEvent.preventManipulation&&this.srcEvent.preventManipulation();this.srcEvent.preventDefault&&this.srcEvent.preventDefault()},
stopPropagation:function(){this.srcEvent.stopPropagation()},stopDetect:function(){return f.detection.stopDetect()}}}};f.PointerEvent={pointers:{},getTouchList:function(){var b=this,c=[];return Object.keys(b.pointers).sort().forEach(function(d){c.push(b.pointers[d])}),c},updatePointer:function(b,c){return b==f.EVENT_END?this.pointers={}:(c.identifier=c.pointerId,this.pointers[c.pointerId]=c),Object.keys(this.pointers).length},matchType:function(b,c){if(!c.pointerType)return!1;var d={};return d[f.POINTER_MOUSE]=
c.pointerType==c.MSPOINTER_TYPE_MOUSE||c.pointerType==f.POINTER_MOUSE,d[f.POINTER_TOUCH]=c.pointerType==c.MSPOINTER_TYPE_TOUCH||c.pointerType==f.POINTER_TOUCH,d[f.POINTER_PEN]=c.pointerType==c.MSPOINTER_TYPE_PEN||c.pointerType==f.POINTER_PEN,d[b]},getEvents:function(){return["pointerdown MSPointerDown","pointermove MSPointerMove","pointerup pointercancel MSPointerUp MSPointerCancel"]},reset:function(){this.pointers={}}};f.utils={extend:function(b,d,f){for(var g in d)b[g]!==c&&f||(b[g]=d[g]);return b},
hasParent:function(b,c){for(;b;){if(b==c)return!0;b=b.parentNode}return!1},getCenter:function(b){for(var c=[],d=[],f=0,g=b.length;g>f;f++)c.push(b[f].pageX),d.push(b[f].pageY);return{pageX:(Math.min.apply(Math,c)+Math.max.apply(Math,c))/2,pageY:(Math.min.apply(Math,d)+Math.max.apply(Math,d))/2}},getVelocity:function(b,c,d){return{x:Math.abs(c/b)||0,y:Math.abs(d/b)||0}},getAngle:function(b,c){return 180*Math.atan2(c.pageY-b.pageY,c.pageX-b.pageX)/Math.PI},getDirection:function(b,c){var d=Math.abs(b.pageX-
c.pageX),g=Math.abs(b.pageY-c.pageY);return d>=g?0<b.pageX-c.pageX?f.DIRECTION_LEFT:f.DIRECTION_RIGHT:0<b.pageY-c.pageY?f.DIRECTION_UP:f.DIRECTION_DOWN},getDistance:function(b,c){var d=c.pageX-b.pageX,f=c.pageY-b.pageY;return Math.sqrt(d*d+f*f)},getScale:function(b,c){return 2<=b.length&&2<=c.length?this.getDistance(c[0],c[1])/this.getDistance(b[0],b[1]):1},getRotation:function(b,c){return 2<=b.length&&2<=c.length?this.getAngle(c[1],c[0])-this.getAngle(b[1],b[0]):0},isVertical:function(b){return b==
f.DIRECTION_UP||b==f.DIRECTION_DOWN},stopDefaultBrowserBehavior:function(b,c){var d,f="webkit khtml moz ms o ".split(" ");if(c&&b.style){for(var g=0;f.length>g;g++)for(var h in c)c.hasOwnProperty(h)&&(d=h,f[g]&&(d=f[g]+d.substring(0,1).toUpperCase()+d.substring(1)),b.style[d]=c[h]);"none"==c.userSelect&&(b.onselectstart=function(){return!1})}}};f.detection={gestures:[],current:null,previous:null,stopped:!1,startDetect:function(b,c){this.current||(this.stopped=!1,this.current={inst:b,startEvent:f.utils.extend({},
c),lastEvent:!1,name:""},this.detect(c))},detect:function(b){if(this.current&&!this.stopped){b=this.extendEventData(b);for(var c=this.current.inst.options,d=0,g=this.gestures.length;g>d;d++){var h=this.gestures[d];if(!this.stopped&&!1!==c[h.name]&&!1===h.handler.call(h,b,this.current.inst)){this.stopDetect();break}}return this.current&&(this.current.lastEvent=b),b.eventType==f.EVENT_END&&!b.touches.length-1&&this.stopDetect(),b}},stopDetect:function(){this.previous=f.utils.extend({},this.current);
this.current=null;this.stopped=!0},extendEventData:function(b){var c=this.current.startEvent;if(c&&(b.touches.length!=c.touches.length||b.touches===c.touches)){c.touches=[];for(var d=0,g=b.touches.length;g>d;d++)c.touches.push(f.utils.extend({},b.touches[d]))}var d=b.timeStamp-c.timeStamp,g=b.center.pageX-c.center.pageX,h=b.center.pageY-c.center.pageY,k=f.utils.getVelocity(d,g,h);return f.utils.extend(b,{deltaTime:d,deltaX:g,deltaY:h,velocityX:k.x,velocityY:k.y,distance:f.utils.getDistance(c.center,
b.center),angle:f.utils.getAngle(c.center,b.center),direction:f.utils.getDirection(c.center,b.center),scale:f.utils.getScale(c.touches,b.touches),rotation:f.utils.getRotation(c.touches,b.touches),startEvent:c}),b},register:function(b){var d=b.defaults||{};return d[b.name]===c&&(d[b.name]=!0),f.utils.extend(f.defaults,d,!0),b.index=b.index||1E3,this.gestures.push(b),this.gestures.sort(function(b,c){return b.index<c.index?-1:b.index>c.index?1:0}),this.gestures}};f.gestures=f.gestures||{};f.gestures.Hold=
{name:"hold",index:10,defaults:{hold_timeout:500,hold_threshold:1},timer:null,handler:function(b,c){switch(b.eventType){case f.EVENT_START:clearTimeout(this.timer);f.detection.current.name=this.name;this.timer=setTimeout(function(){"hold"==f.detection.current.name&&c.trigger("hold",b)},c.options.hold_timeout);break;case f.EVENT_MOVE:b.distance>c.options.hold_threshold&&clearTimeout(this.timer);break;case f.EVENT_END:clearTimeout(this.timer)}}};f.gestures.Tap={name:"tap",index:100,defaults:{tap_max_touchtime:250,
tap_max_distance:10,tap_always:!0,doubletap_distance:20,doubletap_interval:300},handler:function(b,c){if(b.eventType==f.EVENT_END){var d=f.detection.previous,g=!1;b.deltaTime>c.options.tap_max_touchtime||b.distance>c.options.tap_max_distance||(d&&"tap"==d.name&&b.timeStamp-d.lastEvent.timeStamp<c.options.doubletap_interval&&b.distance<c.options.doubletap_distance&&(c.trigger("doubletap",b),g=!0),g&&!c.options.tap_always||(f.detection.current.name="tap",c.trigger(f.detection.current.name,b)))}}};f.gestures.Swipe=
{name:"swipe",index:40,defaults:{swipe_max_touches:1,swipe_velocity:0.7},handler:function(b,c){b.eventType!=f.EVENT_END||0<c.options.swipe_max_touches&&b.touches.length>c.options.swipe_max_touches||(b.velocityX>c.options.swipe_velocity||b.velocityY>c.options.swipe_velocity)&&(c.trigger(this.name,b),c.trigger(this.name+b.direction,b))}};f.gestures.Drag={name:"drag",index:50,defaults:{drag_min_distance:10,drag_max_touches:1,drag_block_horizontal:!1,drag_block_vertical:!1,drag_lock_to_axis:!1,drag_lock_min_distance:25},
triggered:!1,handler:function(b,d){if(f.detection.current.name!=this.name&&this.triggered)return d.trigger(this.name+"end",b),this.triggered=!1,c;if(!(0<d.options.drag_max_touches&&b.touches.length>d.options.drag_max_touches))switch(b.eventType){case f.EVENT_START:this.triggered=!1;break;case f.EVENT_MOVE:if(b.distance<d.options.drag_min_distance&&f.detection.current.name!=this.name)break;f.detection.current.name=this.name;(f.detection.current.lastEvent.drag_locked_to_axis||d.options.drag_lock_to_axis&&
d.options.drag_lock_min_distance<=b.distance)&&(b.drag_locked_to_axis=!0);var g=f.detection.current.lastEvent.direction;b.drag_locked_to_axis&&g!==b.direction&&(b.direction=f.utils.isVertical(g)?0>b.deltaY?f.DIRECTION_UP:f.DIRECTION_DOWN:0>b.deltaX?f.DIRECTION_LEFT:f.DIRECTION_RIGHT);this.triggered||(d.trigger(this.name+"start",b),this.triggered=!0);d.trigger(this.name,b);d.trigger(this.name+b.direction,b);(d.options.drag_block_vertical&&f.utils.isVertical(b.direction)||d.options.drag_block_horizontal&&
!f.utils.isVertical(b.direction))&&b.preventDefault();break;case f.EVENT_END:this.triggered&&d.trigger(this.name+"end",b),this.triggered=!1}}};f.gestures.Transform={name:"transform",index:45,defaults:{transform_min_scale:0.01,transform_min_rotation:1,transform_always_block:!1},triggered:!1,handler:function(b,d){if(f.detection.current.name!=this.name&&this.triggered)return d.trigger(this.name+"end",b),this.triggered=!1,c;if(!(2>b.touches.length))switch(d.options.transform_always_block&&b.preventDefault(),
b.eventType){case f.EVENT_START:this.triggered=!1;break;case f.EVENT_MOVE:var g=Math.abs(1-b.scale),h=Math.abs(b.rotation);if(d.options.transform_min_scale>g&&d.options.transform_min_rotation>h)break;f.detection.current.name=this.name;this.triggered||(d.trigger(this.name+"start",b),this.triggered=!0);d.trigger(this.name,b);h>d.options.transform_min_rotation&&d.trigger("rotate",b);g>d.options.transform_min_scale&&(d.trigger("pinch",b),d.trigger("pinch"+(1>b.scale?"in":"out"),b));break;case f.EVENT_END:this.triggered&&
d.trigger(this.name+"end",b),this.triggered=!1}}};f.gestures.Touch={name:"touch",index:-1/0,defaults:{prevent_default:!1,prevent_mouseevents:!1},handler:function(b,d){return d.options.prevent_mouseevents&&b.pointerType==f.POINTER_MOUSE?(b.stopDetect(),c):(d.options.prevent_default&&b.preventDefault(),b.eventType==f.EVENT_START&&d.trigger(this.name,b),c)}};f.gestures.Release={name:"release",index:1/0,handler:function(b,c){b.eventType==f.EVENT_END&&c.trigger(this.name,b)}};"object"==typeof module&&
"object"==typeof module.exports?module.exports=f:(b.Hammer=f,"function"==typeof b.define&&b.define.amd&&b.define("hammer",[],function(){return f}))})(this);
(function(b,c){b!==c&&(Hammer.event.bindDom=function(d,f,g){b(d).on(f,function(b){var d=b.originalEvent||b;d.pageX===c&&(d.pageX=b.pageX,d.pageY=b.pageY);d.target||(d.target=b.target);d.which===c&&(d.which=d.button);d.preventDefault||(d.preventDefault=b.preventDefault);d.stopPropagation||(d.stopPropagation=b.stopPropagation);g.call(this,d)})},Hammer.Instance.prototype.on=function(c,f){return b(this.element).on(c,f)},Hammer.Instance.prototype.off=function(c,f){return b(this.element).off(c,f)},Hammer.Instance.prototype.trigger=
function(c,f){var g=b(this.element);return g.has(f.target).length&&(g=b(f.target)),g.trigger({type:c,gesture:f})},b.fn.hammer=function(c){return this.each(function(){var f=b(this),g=f.data("hammer");g?g&&c&&Hammer.utils.extend(g.options,c):f.data("hammer",new Hammer(this,c||{}))})})})(window.jQuery||window.Zepto);
(function(b){bdor[5]="i";var c=function(c,f,g,h,k){if(void 0!=c&&null!=c){k=b.extend({background:"green",cornersTop:!0,scale:"noresize"},k);c.prev();var l=0,m=!1,n=k.background,q=k.cornersTop,p=k.gradientColors||["#ddd","#eee","#fff"],s=k.scale,r=[],t,v,u;try{t=c.clone(),v=t[0].getContext("2d"),u=c[0].getContext("2d"),loaded=0}catch(A){u=v=t=null}h=h.each(function(c){if(!r[c]&&null!=u){var d=this;d.onload=function(){var k=1;if("noresize"!=s){var l=0==this.width?this.naturalWidth:this.width,n=0==this.height?
this.naturalHeight:this.height,w=f/l,y=g/n;"fit"==s&&(k=1>w||1>y?Math.min(w,y):1);"fill"==s&&(k=Math.min(w,y))}b(d).data("flip.scale",k);r[c]=u.createPattern(d,"no-repeat");r[c].width=l;r[c].height=n;loaded++;loaded!=h.length||m||(m=!0,E())};d.complete&&window.setTimeout(function(){d.onload()},10)}}).get();var x=f,w=g,y=b.browser.msie?c.offset():null,z,D,C,B;b.browser.msie&&function(){var h=b("<div>").width(f).height(g).css({position:"absolute",cursor:"default",zIndex:1}).appendTo(tmpContainer);7==
parseInt(b.browser.version)&&h.css({opacity:1E-6,background:"#FFF"});var k=function(){y=c.offset();return h.css({left:y.left+"px",top:y.top+"px"})};b(window).resize(k);return k()}();setInterval(function(){window.clearInterval(z);D=(new Date).getTime();C=x;B=w/50;z=window.setInterval(L,0);l+=1;0>l&&(l=h.length-1);l==h.length&&(l=0)},3E3);var L=function(){var b=(new Date).getTime()-D;700<=b?(window.clearInterval(z),h.push(h.shift()),r.push(r.shift()),x=f,w=g):(x=C-2*f*b/700,w=B+2*g*b/700/3);E()},K=
function(c,d){if(null!=u){var h=c*f+d,k=-d/c;b.browser.msie&&(h=Math.round(h),k=Math.round(k));u.beginPath();u.moveTo(f,Math.min(h,g));u.lineTo(f,0);u.lineTo(Math.max(k,0),0);0>k?(u.lineTo(0,Math.min(d,g)),d<g&&u.lineTo((g-d)/c,g),u.lineTo(f,g)):h<g?u.lineTo(f,h):(u.lineTo((g-d)/c,g),u.lineTo(f,g))}},E=function(){if(m&&null!=u&&null!=v){b.browser.msie&&u.clearRect(0,0,f,g);u.fillStyle=n;u.fillRect(0,0,f,g);var c=h[0],d=b(c).data("flip.scale");if(b.browser.msie)try{u.drawImage(c,0,0,c.width,c.height,
0,0,f,g)}catch(k){u.fillStyle=r[0],u.fillStyle.width2=u.fillStyle.width*d,u.fillStyle.height2=u.fillStyle.height*d,u.fillRect(0,0,f,g)}else u.drawImage(c,(f-c.width*d)/2,(g-c.height*d)/2,c.width*d,c.height*d);if(w&&x!=f&&(c=(w-2*(x+f))/2,m2=w/(f-x),q2=x*m2,2!=m2)){var l=1,y=0;u.save();q||(y=g,l=-1);u.translate(0,y);u.scale(1,l);var z=(q2-c)/(2-m2),s=2*z+c,C=(2*s+z+4*x-2*w)/5,A=-C/2+s+z/2,d=Math.sqrt(Math.pow(z-C,2)+Math.pow(s-A,2)),D=Math.min(0.5*d,30),B;b.browser.mozilla&&1.9>parseFloat(b.browser.version)?
(B=v,B.clearRect(0,0,f,g),B.save(),B.translate(1,0)):B=u;z=B.createLinearGradient(z,s,C,A);z.addColorStop(0,p[0]);z.addColorStop(D/d,p[1]);z.addColorStop(1,p[2]);B.fillStyle=z;B.beginPath();B.moveTo(-c/2,0);B.quadraticCurveTo((-c/2+x)/2+0.02*x,w/2,x,w);B.quadraticCurveTo((f+x)/2,(2*f+c+w)/2-0.02*(g-w),f,2*f+c);b.browser.mozilla&&1.9>parseFloat(b.browser.version)?(B.save(),B.clip(),B.fillRect(0,0,f,g),B.restore(),u.drawImage(t[0],0,0),B.restore()):B.fill();u.fillStyle=n;K(2,c);u.fill();K(2,c);b.browser.safari||
b.browser.opera||u.restore();c=h[1];d=b(c).data("flip.scale");if(b.browser.msie)u.fillStyle=r[1],u.fillStyle.width2=u.fillStyle.width*d,u.fillStyle.height2=u.fillStyle.height*d,u.fill();else{u.save();u.clip();if(b.browser.safari||b.browser.opera)u.scale(1,1/l),u.translate(-0,-y);u.drawImage(c,(f-c.width*d)/2,(g-c.height*d)/2,c.width*d,c.height*d);u.restore();(b.browser.safari||b.browser.opera)&&u.restore()}}}}}};b.fn.jFlip=function(d,f,g,h,k){return this.each(function(){b(this).wrap("<div class='bannerdiv' style='position: absolute;width:"+
d+"px;height:"+f+"px;top:"+k+"px;left:"+h+"px'>");var l=b(this).find("img"),m=b(document.createElement("canvas")).attr({width:d,height:f}).css({margin:0,width:d+"px",height:f+"px"});b(this).css({position:"absolute",left:"-9000px",top:"-9000px",display:"none"}).after(m);new c(b(this).next(),d||300,f||300,l,g)})}})(jQuery);
function searchFromPages(b,c){var d=[];c=c.trim().toLowerCase();for(var f=null,f=-1==c.indexOf(" ")?[c]:c.split(" "),g=0,g=0;g<b.length;g++){var h=b[g].trim().toLowerCase(),k=h,l=-1,m=-1,n=-1,q=0,p=!0,s;for(s=0;s<f.length;s++){var k=new KMP(k,f[s]),r=f[s].length;if(k.match()){var t=q+k.getIndex();if(t>n)n=t,q=t+f[s].length,k=h.substring(q),0==s&&(l=t),s==f.length-1&&(m=t+r);else{p=!1;break}}else{p=!1;break}}p&&(n=[],n.search_page=g+1,n.search_title="page "+(g+1),l=h.substring(0,l).lastIndexOf("."),
-1==l?l=0:l++,q=h.substring(m),p=q.indexOf(".")+1,p=-1==p?q.length():m+p,h=h.substring(l,p),n.search_text=h,d.push(n))}return d}var KMP=function(b,c){this.__string=b;this.__pattern=c;this.__next=[];this.__times=0;this.__index=-1;for(var d=0,d=0;d<c.length;d++)this.__next[d]=1>=d?d-1:this.next(c.substring(0,d));this.__times=0;this.__index=-1};bdor[10]="l";KMP.prototype.next=function(b){for(var c=Math.ceil(b.length/2);0<c&&0!=b.substring(0,c).compareTo(b.substring(b.length-c,b.length));)c--;return c};
KMP.prototype.match=function(){for(var b=0,c=0,d=-1;b<this.__string.length&&c<this.__pattern.length;){if(this.__string.charAt(b)==this.__pattern.charAt(c))0===c&&(d=b),b++,c++;else{for(var f=this.__next[c];-1!=f&&this.__pattern.charAt(f)==this.__pattern.charAt(c);)f=this.__next[f];c=f;-1==c?(b++,c=0):d=b-c}this.__times++}return c==this.__pattern.length?(this.__index=d,!0):!1};KMP.prototype.getTimes=function(){return this.__times};KMP.prototype.getIndex=function(){return this.__index};
String.prototype.compareTo=function(b){var c=this.length,d=b.length,f=Math.min(c,d),g=this.split("");b=b.split("");var h=0,k=0;if(h==k)for(k=h,f+=h;k<f;){var l=g[k],m=b[k];if(l!=m)return l-m;k++}else for(;0!=f--;)if(l=g[h++],m=b[k++],l!=m)return l-m;return c-d};
(function(b){function c(b){return b.originalEvent.touches&&0<b.originalEvent.touches.length?b.originalEvent.touches:[b]}function d(b,d,k){var l,m,n=0,q=function(b){b=c(b);n=b.length;l=1<n?null:(void 0==b[0].button?f:b[0].button)==k?Point(b[0].clientX,b[0].clientY):null},p=function(b){b=c(b);if(!(1<n)&&(m=Point(b[0].clientX,b[0].clientY),l)){if(m.isNearTo(l)&&d)return d(b);l=null}};try{b.bind("mousedown",q),b.bind("mouseup",p)}catch(s){}try{b.bind("touchstart",q),b.bind("touchend",p)}catch(r){}}var f=
0;b.fn.onClick=function(b){d(this,b,f)};b.fn.onMiddleClick=function(b){d(this,b,1)};b.fn.onRightClick=function(b){d(this,b,2)};b.fn.onDoubleClick=function(b){function d(){l=k=null;m=-1;p=q=null;s=-1;n=0}var k,l,m,n=0,q,p,s,r=function(b){b=c(b);n=b.length;1<n?d():k?q=void 0==b[0].button||b[0].button==f?Point(b[0].clientX,b[0].clientY):null:k=void 0==b[0].button||b[0].button==f?Point(b[0].clientX,b[0].clientY):null},t=function(f){f=c(f);if(l)if(p=Point(f[0].clientX,f[0].clientY),p.isNearTo(q))if(s=
new Date,200>s-m&&p.isNearTo(l)){if(b)return b(f);d()}else k=q,l=p,m=s,p=q=null,s=-1;else d();else l=Point(f[0].clientX,f[0].clientY),l.isNearTo(k)?m=new Date:d()};try{this.bind("mousedown",r),this.bind("mouseup",t)}catch(v){}try{this.bind("touchstart",r),this.bind("touchend",t)}catch(u){}};b.fn.onMouseDown=function(b){var d=function(d){d=c(d);for(var h=0;h<d.length;h++){var k=d[h];k.leftButtonDown=!0;k.middleButtonDown=!1;k.rightButtonDown=!1;void 0!=k.button&&(k.leftButtonDown=k.button==f?!0:!1,
1==k.button&&(k.middleButtonDown=!0),2==k.button&&(k.rightButtonDown=!0))}if(b)return b(d)};try{this.bind("mousedown",d)}catch(k){}try{this.bind("touchstart",d)}catch(l){}};b.fn.onMouseMove=function(b){var d=!1,k=!1,l=!1,m=function(b){b=c(b);for(var g=0;g<b.length;g++){var m=b[g];void 0==m.button?(d=!0,l=k=!1):(m.button==f&&(d=!0),1==m.button&&(k=!0),2==m.button&&(l=!0))}},n=function(f){f=c(f);for(i=0;i<f.length;i++){var m=f[i];m.leftButtonDown=d;m.middleButtonDown=k;m.rightButtonDown=l}if(b)return b(f)},
q=function(b){b=c(b);for(var g=0;g<b.length;g++){var m=b[g];m.button==f&&(d=!1);1==m.button&&(k=!1);2==m.button&&(l=!1)}};try{this.bind("mousedown",m),this.bind("mousemove",n),this.bind("mouseup",q)}catch(p){}try{this.bind("touchstart",m),this.bind("touchmove",n),this.bind("touchend",q)}catch(s){}};b.fn.onMouseUp=function(b){var d=function(d){d=c(d);for(var h=0;h<d.length;h++){var k=d[h];k.leftButtonUp=!0;k.middleButtonUp=!1;k.rightButtonUp=!1;void 0!=k.button&&(k.leftButtonUp=k.button==f?!0:!1,1==
k.button&&(k.middleButtonUp=!0),2==k.button&&(k.rightButtonUp=!0))}if(b)return b(d)};try{this.bind("mouseup",d)}catch(k){}try{this.bind("touchend",d)}catch(l){}};b.fn.onMouseLeave=function(b){function d(f){f=c(f);if(b)return b(f)}try{this.bind("mouseleave",d)}catch(f){}try{this.bind("touchleave",d)}catch(l){}};b.fn.onMouseWheel=function(b){function c(d){var f=d.originalEvent,f=Math.max(-1,Math.min(1,f.wheelDelta||-f.detail));d.delta=f;if(b)return b(d)}try{this.bind("mousewheel",c)}catch(d){}try{this.bind("DOMMouseScroll",
c)}catch(f){}};b.fn.speed=function(b){function c(b){b=void 0==b.originalEvent.touches?[b]:b.originalEvent.touches;if(1<b.length)return v=!0;m=q=b[0].pageX;n=p=b[0].pageY;s=new Date;-1!=t&&window.clearInterval(t);t=window.setInterval(function(){m=q;n=p;s=new Date},300)}function d(b){if(-1==t||!0==v)return!0;b=void 0==b.originalEvent.touches?[b]:b.originalEvent.touches;q=b[0].pageX;p=b[0].pageY}function f(c){if(-1==t)return!0;c=void 0!=c.originalEvent.touches==!1?[c]:c.originalEvent.touches;if(!0==
v)return v=1<c.length,!0;r=new Date;c=(r-s)/20;var d=q-m,h=p-n;0==c?iSpeedY=iSpeedX=0:(iSpeedX=d/c,iSpeedY=h/c);void 0!=b&&b(iSpeedX,iSpeedY);window.clearInterval(t);t=-1}var m,n,q,p,s,r,t=-1,v=!1;try{this.bind("mousedown",c),this.bind("mousemove",d),this.bind("mouseup",f),this.bind("mouseleave",f)}catch(u){}try{this.bind("touchstart",c),this.bind("touchmove",d),this.bind("touchend",f),this.bind("touchleave",f)}catch(A){}};b.fn.onSwipLeft=function(b){this.speed(function(c,d){-5>c&&b&&b()})};b.fn.onSwipRight=
function(b){this.speed(function(c,d){5<c&&b&&b()})};b.fn.onSwipUp=function(b){this.speed(function(c,d){-5>d&&b&&b()})};b.fn.onSwipDown=function(b){this.speed(function(c,d){5<d&&b&&b()})}})(jQuery);
$.fn.setGradient=function(b,c){var d=colorAdd(b,15),f=colorDiv(b,15);void 0==c&&(c=!1);var g="",h="0";c&&(g="left,",h="1");this.css({background:"linear-gradient("+g+d+", "+f+")"});switch(browserType){case 1:this.css({background:"-webkit-linear-gradient("+g+d+", "+f+")"});break;case 2:this.css({background:"-moz-linear-gradient("+g+d+", "+f+")"});break;case 3:this.css({background:"-ms-linear-gradient("+g+d+", "+f+")"});this.css("filter","progid:DXImageTransform.Microsoft.Gradient(GradientType="+h+", EndColorStr="+
f+", StartColorStr="+d+")");break;case 4:this.css({background:"-o-linear-gradient("+g+d+", "+f+")"})}};
$.fn.setGradientByDir=function(b,c,d){void 0==d&&(d=!1);var f="",g="0";d&&(f="left,",g="1");this.css({background:"linear-gradient("+f+b+", "+c+")"});switch(browserType){case 1:this.css({background:"-webkit-linear-gradient("+f+b+", "+c+")"});break;case 2:this.css({background:"-moz-linear-gradient("+f+b+", "+c+")"});break;case 3:this.css({background:"-ms-linear-gradient("+f+b+", "+c+")"});this.css("filter","progid:DXImageTransform.Microsoft.Gradient(GradientType="+g+", EndColorStr="+c+", StartColorStr="+
b+")");break;case 4:this.css({background:"-o-linear-gradient("+f+b+", "+c+")"})}};$.fn.addBorderShadow=function(b,c,d){var f=c+"px",g=d+"px";c=2*(Math.abs(c)+Math.abs(d))+"px";this.css({"-moz-box-shadow":f+" "+g+" "+c+" "+b,"box-shadow":f+" "+g+" "+c+" "+b,"-webkit-box-shadow":f+" "+g+" "+c+" "+b,"-o-box-shadow":f+" "+g+" "+c+" "+b,"-ms-box-shadow":f+" "+g+" "+c+" "+b})};
var getHost=function(b){var c;b||(b=window.location.href);var d=b.match(/(.*\:\/\/)([^\/]*)\/([^\/]*).*/);d&&(c="s3.amazonaws.com"===d[2]?d[1]+d[2]+"/"+d[3]:d[1]+d[2]);Log.print(b+d+","+c);return c};
$.fn.changeButtonColor=function(b,c,d){var f=this;if("none"!=this.css("display")){var g=this;0<this.children().length&&(g=this.find("img:first"));if(window.ActiveXObject){if("complete"!=g[0].readyState){$(g).load(function(){try{f.changeButtonColor(b,c,d)}catch(g){}});return}}else if(!g[0].complete){$(g).load(function(){try{f.changeButtonColor(b,c,d)}catch(g){}});return}if(void 0!=g[0]){var h,k;try{h=$("<canvas></canvas>")[0],k=h.getContext("2d")}catch(l){return}var m=g.width(),n=g.height(),g=g[0];
void 0==c&&(c=!1);var q=getHost(g.src),p=getHost();if(q&&p!==q)h=g.src.replace(q,p),g.src=h,!1==c&&$(g).load(function(){try{f.changeButtonColor(b,!0,d)}catch(c){}});else{h.width=m;h.height=n;try{k.drawImage(g,0,0,g.naturalWidth,g.naturalHeight,0,0,m,n);var s=k.getImageData(0,0,m,n),r=k.getImageData(0,0,m,n);if(!0!=g.colorChanged&&(g.colorChanged=!0,s)){for(var t=colorSplit(b),m=0,v=s.data.length;m<v;m+=4)0<r.data[m+3]&&(s.data[m]!=t.r&&(r.data[m]=s.data[m]/255*t.r),s.data[m+1]!=t.g&&(r.data[m+1]=
s.data[m+1]/255*t.g),s.data[m+2]!=t.b&&(r.data[m+2]=s.data[m+2]/255*t.b));k.putImageData(r,0,0);g.src=h.toDataURL("image/png");void 0!=d&&d(f)}}catch(u){!1==c&&$(g).load(function(){try{f.changeButtonColor(b,!0,d)}catch(c){}})}}}}};
$.fn.rotate=function(b){if(!(4<browserType&&1>browserType)){switch(browserType){case 1:this.css({"-webkit-transform":"rotate("+b+"deg)"});break;case 2:this.css({"-moz-transform":"rotate("+b+"deg)"});break;case 3:this.css({"-ms-transform":"rotate("+b+"deg)"});break;case 4:this.css({"-o-transform":"rotate("+b+"deg)"})}this.css({transform:"rotate("+b+"deg)"})}};
$.fn.scale=function(b,c){void 0==c&&(c="50% 50% 0");this.css({"-webkit-transform":"scale("+b+")","-moz-transform":"scale("+b+")","-ms-transform":"scale("+b+")","-o-transform":"scale("+b+")",transform:"scale("+b+")","-webkit-transform-origin":c,"-moz-transform-origin":c,"-ms-transform-origin":c,"-o-transform-origin":c,"transform-origin":c})};
$.fn.transition3D=function(){this.css({"-ms-transform":"translate3d(0,0,0)","-webkit-transform":"translate3d(0,0,0)","-moz-transform":"translate3d(0,0,0)","-o-transform":"translate3d(0,0,0)",transform:"translate3d(0,0,0)"});return this};
$.fn.setAnimation=function(b,c,d){if(void 0!=b){100>b&&(b*=1E3);if(void 0==c||""==c)c="all";void 0==d&&(d="ease-in-out");d=c+" %dms "+d;0<b?"all"!=c?this.css({"-moz-transition":String.format(d,"-moz-",b),"-webkit-transition":String.format(d,"-webkit-",b),"-o-transition":String.format(d,"-o-",b),"-ms-transition":String.format(d,"-ms-",b),transition:String.format(d,"",b)}):this.css({"-moz-transition":String.format(d,b),"-webkit-transition":String.format(d,b),"-o-transition":String.format(d,b),"-ms-transition":String.format(d,
b),transition:String.format(d,b)}):this.css({"-moz-transition":"","-webkit-transition":"","-o-transition":"","-ms-transition":"",transition:""})}};
$.fn.animateOnce=function(b,c,d,f,g){var h=this;if(b)if(void 0==c||0===c)h.css({"-moz-transition":"","-webkit-transition":"","-o-transition":"","-ms-transition":"",transition:""}),d&&d instanceof Function&&d();else{var k=!1;setAnimation(h,c,f,g);h.one("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){!0!=k&&(k=!0,h.setAnimation(0),d&&d instanceof Function&&d())});h.css(b)}};
var LanguageTool={isEnglish:function(b){return/[\x00-\xff]/.test(b)},isChinese:function(b){return/[\u4E00-\u9FBF]/.test(b)},isArabic:function(b){return/[\u0600-\u06FF]|[\u0750-\u077F]/.test(b)},isUrdu:function(b){return this.isArabic(b)||/[\uFE70-\uFEFF]/.test(b)},isHebrew:function(b){return/[\u0590-\u05FF]|[\uFB00-\uFB4F]/.test(b)},isFarsi:function(b){return this.isUrdu(b)||/[\u0400-\u04FF]|[\u0500-\u052F]/.test(b)},isTai:function(b){return/[\u0E00-\u0E7F]/.test(b)},isHindi:function(b){return/[\u0900-\u097F]/.test(b)},
isTamil:function(b){return/[\u0B80-\u0BFF]/.test(b)},isHimalayaRahm:function(b){return/[\u0D00-\u0D7F]/.test(b)},isRightToLeft:function(b){return this.isArabic(b)||this.isUrdu(b)||this.isHebrew(b)||this.isFarsi(b)||this.isTai(b)||this.isHindi(b)||this.isTamil(b)||this.isHimalayaRahm(b)}},Log=Class({statics:{isDebug:function(){return/debug=true/.test(window.location.href)},isPAD:function(){return 0<navigator.userAgent.toLowerCase().indexOf("pad")},logForPad:function(b,c){if(this.isPAD()){void 0==this.logDiv&&
(this.logDiv=$("<div></div>"),this.logDiv.css({position:"absolute",width:"300px",height:"150px",top:"50px",overflow:"auto","z-index":"100000","background-color":"white"}),$("body")[0]&&$("body")[0].appendChild(this.logDiv[0]));var d=$("<p>"+b+"</p>");d.css("color",c);this.logDiv.append(d);d=this.logDiv[0];d.scrollTop=d.scrollHeight}},info:function(){if(this.isDebug()){$.browser&&$.browser.msie&&(arguments=[String.format.apply(this,arguments)]);try{console&&console.log&&console.log.apply(console,arguments)}catch(b){}this.logForPad(String.format.apply(this,
arguments),"black")}},debug:function(){if(this.isDebug()){$.browser&&$.browser.msie&&(arguments=[String.format.apply(this,arguments)]);try{console&&console.debug&&console.debug.apply(console,arguments)}catch(b){}this.logForPad(String.format.apply(this,arguments),"blue")}},warn:function(){if(this.isDebug()){$.browser&&$.browser.msie&&(arguments=[String.format.apply(this,arguments)]);try{console&&console.warn&&console.warn.apply(console,arguments)}catch(b){}this.logForPad(String.format.apply(this,arguments),
"#FFA042")}},error:function(){if(this.isDebug()){$.browser&&$.browser.msie&&(arguments=[String.format.apply(this,arguments)]);try{console&&console.error&&console.error.apply(console,arguments)}catch(b){}this.logForPad(String.format.apply(this,arguments),"red")}},print:function(){var b=String.format.apply(this,arguments),c=(new Date).format("hh:mm:ss.S");this.debug("[%s] %s",c,b)}}});
colorTo0x=function(b){var c=b+="";if(null==b||void 0==b)return c;"#"!=b.substr(0,1)&&"0x"!=b.substr(0,2)&&(c="#"+parseInt(b).toString(16));"0x"==b.substr(0,2)&&(c=b.replace("0x","#"));return c};bdor[2]="e";function Metacharacter(b){if(null!=b&&""!=b)return b=b.replaceAll("%","%25"),b=b.replaceAll(" ","%20"),b=b.replaceAll("#","%23"),b=b.replaceAll("&","%26")}
function colorSplit(b){var c={r:0,g:0,b:0},d="FF",f="FF",g="FF";7==b.length?(d=b.substr(1,2),f=b.substr(3,2),g=b.substr(5,2)):4==b.length&&(d=b.substr(1,1),f=b.substr(2,1),g=b.substr(3,1),d+=d,f+=f,g+=g);c.r=parseInt(d,16);c.g=parseInt(f,16);c.b=parseInt(g,16);return c}
function colorAdd(b,c){var d=colorSplit(b);d.r=Math.min(d.r+c,255).toString(16);d.g=Math.min(d.g+c,255).toString(16);d.b=Math.min(d.b+c,255).toString(16);d.r=1>=d.r.length?"0"+d.r:d.r;d.g=1>=d.g.length?"0"+d.g:d.g;d.b=1>=d.b.length?"0"+d.b:d.b;return"#"+d.r+d.g+d.b}
function colorDiv(b,c){var d=colorSplit(b);d.r=Math.max(d.r-c,0).toString(16);d.g=Math.max(d.g-c,0).toString(16);d.b=Math.max(d.b-c,0).toString(16);d.r=1>=d.r.length?"0"+d.r:d.r;d.g=1>=d.g.length?"0"+d.g:d.g;d.b=1>=d.b.length?"0"+d.b:d.b;return"#"+d.r+d.g+d.b}
var reflection=function(b){var c=new Image,d=document.createElement("canvas"),f=d.getContext("2d");b[0].appendChild(d);c.onload=function(){c.onload=c.onerror=null;var b=this.width,h=this.height,k=0.7*h;try{d.style.width=b+"px";d.style.height=k+"px";d.width=b;d.height=k;d.className="reflect";$(d).css({transform:"translateY(-1px)"});f.save();f.translate(0,h);f.scale(1,-1);f.drawImage(c,0,0,b,h);f.restore();f.globalCompositeOperation="destination-out";var l=f.createLinearGradient(0,0,0,k);l.addColorStop(1,
"rgba(255, 0, 0, 1.0)");l.addColorStop(0,"rgba(255, 0, 0, 0)");f.fillStyle=l;f.rect(0,0,b,2*k);f.fill()}catch(m){}};c.onerror=function(){c.onload=c.onerror=null};c.src=b.children("img")[0].src};$.fn.allowNumberOnly=function(){$(this).keypress(function(b){b=b||e;b=b.keyCode||b.which;return 48<=b&&57>=b?!0:!1}).focus(function(){this.style.imeMode="disabled"}).bind("paste",function(){var b=window.clipboardData.getData("Text");return/^\d+$/.test(b)?!0:!1})};
var fullScreenEvent=function(){isPhone()?alert(getLanguage("","")):!0==$.browser.msie?alert(getLanguage("")):(fullscreenFun(),$(document).bind(fullScreenApi.fullScreenEventName,function(){toolBar.changeFullscreenIcon(fullScreenApi.isFullScreen())}))};
function DeString(b,c){if(""==b)return"";c&&""!=c||(c="fb5");c=escape(c);if(null==b||8>b.length)alert("A salt value could not be extracted from the encrypted message because it's length is too short. The message cannot be decrypted.");else if(null==c||0>=c.length)alert("Please enter a password with which to decrypt the message.");else{for(var d="",f=0;f<c.length;f++)d+=c.charCodeAt(f).toString();var g=Math.floor(d.length/5),g=parseInt(d.charAt(g)+d.charAt(2*g)+d.charAt(3*g)+d.charAt(4*g)+d.charAt(5*
g)),h=Math.round(c.length/2),k=Math.pow(2,31)-1,f=parseInt(b.substring(b.length-8,b.length),16);b=b.substring(0,b.length-8);for(d+=f;10<d.length;)d=(parseInt(d.substring(0,10))+parseInt(d.substring(10,d.length))).toString();for(var d=(g*d+h)%k,l="",m="",f=0;f<b.length;f+=2)l=parseInt(parseInt(b.substring(f,f+2),16)^Math.floor(d/k*255)),m+=String.fromCharCode(l),d=(g*d+h)%k;return unescape(m)}}
var divHint=Class({create:function(b,c,d,f){this.instance=$("<div class='hint'></div>");this.setText(b);void 0==f&&(f=$("body"));f.append(this.instance);this.instance.css({display:"none",opacity:0});this.moveto(c,d);this.animation=!1;this.className="hint"},setAnimate:function(b){this.animation=b;!0==b&&this.instance.css({"-moz-transition":"all 0.2s ease-in-out","-webkit-transition":"all 0.2s ease-in-out","-o-transition":"all 0.2s ease-in-out","-ms-transition":"all 0.2s ease-in-out",transition:"all 0.2s ease-in-out"})},
setStyle:function(b){this.instance.removeClass(this.className);this.instance.addClass(b);this.className=b},setText:function(b){this.instance.html(b)},moveto:function(b,c){this.instance.css({left:b,top:c})},show:function(){this.instance.css({display:"block",opacity:1})},hide:function(){!0==this.animation?this.instance.css({display:"none",opacity:0}):this.instance.css({display:"none",opacity:1})},destroy:function(){this.hide();this.instance.empty();this.instance.remove()},width:function(){return this.instance.width()+
3*this.padding()},height:function(){return this.instance.height()+3*this.padding()},padding:function(){var b=this.instance.css("padding");return void 0==b||null==b||""==b?0:iPadding=parseInt(b.replace("px",""))}});
function loadJavascript(b,c,d){var f=this,g=document.createElement("script");g.type="text/javascript";g.async=!0;g.onload=g.onreadystatechange=function(){f.readyState&&"loaded"!=f.readyState&&"complete"!=f.readyState||(g.onload=g.onreadystatechange=null,void 0!=c&&c(g))};g.onerror=function(){void 0!=d&&d(g)};$("body")[0].appendChild(g);g.src=b;return g}
function addProgressBar(b,c,d){if(void 0!=b&&null!=b&&(void 0==b.progressBar||null==b.progressBar)){var f=$("<div></div>"),g=$("<div></div>");c=void 0==c||null==c?$(b).outerWidth():c;d=void 0==d||null==d?$(b).outerHeight():d;var h=$("<img src='"+uiBaseURL+"progress.gif' style='position:absolute;' />");g.css({background:"#000000",opacity:"0.3",width:c+"px",height:d+"px","z-index":"0"});f.css({width:c+"px",height:d+"px","z-index":"100"});h.css({left:(c-31)/2+"px",top:(d-31)/2+"px","z-index":"1"});f.append($(g));
f.append($(h));b.append($(f));b.progressBar=f}}function clearProgressBar(b){void 0!=b.progressBar&&null!=b.progressBar&&b.progressBar.remove()}
function setAnimation(b,c,d,f){if(b&&void 0!=c){100>c&&(c*=1E3);if(void 0==d||""==d)d="all";void 0==f&&(f="ease-in-out");f=d+" %dms "+f;0<c?"all"!=d?b.css({"-moz-transition":String.format(f,"-moz-",c),"-webkit-transition":String.format(f,"-webkit-",c),"-o-transition":String.format(f,"-o-",c),"-ms-transition":String.format(f,"-ms-",c),transition:String.format(f,"",c)}):b.css({"-moz-transition":String.format(f,c),"-webkit-transition":String.format(f,c),"-o-transition":String.format(f,c),"-ms-transition":String.format(f,
c),transition:String.format(f,c)}):b.css({"-moz-transition":"","-webkit-transition":"","-o-transition":"","-ms-transition":"",transition:""})}}
function animateOnce(b,c,d,f,g,h){if(b&&c)if(void 0==d||0===d)b.css({"-moz-transition":"","-webkit-transition":"","-o-transition":"","-ms-transition":"",transition:""}),f&&f instanceof Function&&f();else{var k=!1;setAnimation(b,d,g,h);b.one("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){!0!=k&&(k=!0,setAnimation(b,0),f&&f instanceof Function&&f())});b.css(c)}}
function ScrollFunction(b,c,d,f){var g=this,h;$(c).transform(0,0);$(c).bind(_event._down,function(b){g.scrollMouseDown=!0;d.isDrag=!1;b=isTouch?b.originalEvent.touches:[b];g.mouseDownY=b[0].pageY;h=getPoint(c).y;3==browserType?event.cancelBubble=!0:event.stopPropagation();return!1});$(c).bind(_event._move,function(k){if(g.scrollMouseDown){k=isTouch?k.originalEvent.touches:[k];k=g.mouseDownY-k[0].pageY;var l=h-k,l=Math.min(0,l),l=Math.max(b.outerHeight()-c.outerHeight(),l);b.outerHeight()<c.outerHeight()&&
(c.transform(0,l),void 0!=f&&f());1>Math.abs(k)?d.isDrag=!1:d.isDrag=!0}else d.isDrag=!1;return!1});2==browserType&&(_event._mousewheel="DOMMouseScroll");isIE()&&(_event._mousewheel="mousewheel");$(c).bind(_event._mousewheel,function(d){d.preventDefault();d=d.originalEvent;var g=-30;0<Math.max(-1,Math.min(1,d.wheelDelta||-d.detail))&&(g=30);h=getPoint(c).y;d=h+g;d=Math.min(0,d);d=Math.max(b.outerHeight()-c.outerHeight(),d);b.outerHeight()<c.outerHeight()&&c.transform(0,d);void 0!=f&&f();return!1});
$(c).bind(_event._end,function(b){return g.scrollMouseDown=!1});$(c).bind(_event._leave,function(b){return g.scrollMouseDown=!1})}function autoCenter(b,c,d,f){if(b&&!(0>=b.length)){var g=b.length;c=Math.max((c-d*g)/(g-1),0);void 0==f&&(f=0);for(var h=0;h<g;h++)b[h].css("left",c*h+d*h+f)}}
function fullscreenFun(){if($.browser.msie)alert("Press F11 to View FlipBook in Full Screen");else{var b=$("body")[0];fullScreenApi.supportsFullScreen?fullScreenApi.isFullScreen()?fullScreenApi.cancelFullScreen():fullScreenApi.requestFullScreen(b):b.webkitSupportsFullscreen&&b.webkitEnterFullscreen(Element.ALLOW_KEYBOARD_INPUT)}}
var VERSION_NAME="2.4.10",BUILD_DATE="2015081301",BookType={normal_book:0,single_book:1,zoom_book:2,slide_book:3,phone_book:4,singlePhone_book:5,singleSlide_book:6,catalog_book:7,singleCatalog_book:8},BookTypeNames="normal singleBook singleZoomBook slideBook phoneBook singlePhoneBook singleSlideBook catalogBook singleCatalogBook".split(" "),normalBookStatu={book_statu_ready:0,book_statu_auto_flip:1,book_statu_mouse_flip:2,book_statu_mag_flip:3},singleBookStatu={book_statu_ready:0,book_statu_auto_flip:1,
book_statu_mouse_flip:2,book_statu_mag_flip:3},bookCorner={top_left:0,top_right:1,bottom_left:2,bottom_right:3},BrowserType={WEBKIT:1,OPERA:1,MOZ:2,MS:3},PageEditor={AnnoType:{ANNO_LINK:"com.mobiano.flipbook.pageeditor.TAnnoLink",ANNO_YOUTUBE:"com.mobiano.flipbook.pageeditor.TAnnoYouTube",ANNO_YOUTUBE1:"com.mobiano.flipbook.pageeditor::TAnnoYoutubePlayer",ANNO_YOUTUBE2:"com.mobiano.flipbook.pageeditor.player::TAnnoYoutubePlayer02",ANNO_YOUTUBE3:"com.mobiano.flipbook.pageeditor.player::TAnnoYoutubePlayer03",
ANNO_YOUTUBE4:"com.mobiano.flipbook.pageeditor.player::TAnnoYoutubePlayer04",ANNO_YOUTUBE5:"com.mobiano.flipbook.pageeditor.player::TAnnoYoutubePlayer05",ANNO_VIDEO1:"com.mobiano.flipbook.pageeditor::TAnnoVideoPlayer",ANNO_VIDEO2:"com.mobiano.flipbook.pageeditor.player::TAnnoSimpleVideoPlayer",ANNO_AUDIO1:"com.mobiano.flipbook.sound.TAnnoAdvancedSound",ANNO_AUDIO2:"com.mobiano.flipbook.sound.TAnnoWavemusicPlayer",ANNO_AUDIO3:"com.mobiano.flipbook.pageeditor::TAnnoPlugIn",ANNO_AUDIO4:"com.mobiano.flipbook.sound.TAnnoBackgroundSound",
ANNO_AUDIO5:"",ANNO_AUDIO6:"",ANNO_AUDIO7:"",ANNO_AUDIO8:"",ANNO_AUDIO9:"",ANNO_VIMEO:"com.mobiano.flipbook.pageeditor.vimeoPlayer::TAnnoVimeoPlayer",ANNO_VIMEO2:"com.mobiano.flipbook.pageeditor.vimeoPlayer.TAnnoVimeoPopUpPlayer",ANNO_VIDEO:"com.mobiano.flipbook.pageeditor.TAnnoMovie",ANNO_AUDIO:"com.mobiano.flipbook.sound.TAnnoSound",ANNO_IMAGE:"com.mobiano.flipbook.pageeditor.TAnnoImage",ANNO_BUTTON:"com.mobiano.flipbook.pageeditor.TAnnoButton",ANNO_LINE:"com.mobiano.flipbook.pageeditor.shapes::TAnnoLine",
ANNO_ARROW:"com.mobiano.flipbook.pageeditor.shapes::TAnnoArrow",ANNO_ROUND:"com.mobiano.flipbook.pageeditor.shapes::TAnnoEllipse",ANNO_RECTANGLE:"com.mobiano.flipbook.pageeditor.shapes::TAnnoRectangle",ANNO_TRIANGLE:"com.mobiano.flipbook.pageeditor.shapes::TAnnoTriangle",ANNO_PRISMATIC:"com.mobiano.flipbook.pageeditor.shapes::TAnnoPrismatic",ANNO_PARALLELOGRAM:"com.mobiano.flipbook.pageeditor.shapes::TAnnoParallelogram",ANNO_PENTAGON:"com.mobiano.flipbook.pageeditor.shapes::TAnnoPentagon",ANNO_HEXAGON:"com.mobiano.flipbook.pageeditor.shapes::TAnnoHexagon",
ANNO_PENTAGON:"com.mobiano.flipbook.pageeditor.shapes::TAnnoPentagon",ANNO_DOVETAILED:"com.mobiano.flipbook.pageeditor.shapes::TAnnoDovetailed",ANNO_FLOWCHART:"com.mobiano.flipbook.pageeditor.shapes::TAnnoFlowChart",ANNO_CYLINDER:"com.mobiano.flipbook.pageeditor.shapes::TAnnoCylinder",ANNO_TRAPEZOID:"com.mobiano.flipbook.pageeditor.shapes::TAnnoTrapezoid",ANNO_RIGHTARROW:"com.mobiano.flipbook.pageeditor.shapes::TAnnoRightArrow",ANNO_VIRTUALEND:"com.mobiano.flipbook.pageeditor.shapes::TAnnoVirtualEnd",
ANNO_CROSS:"com.mobiano.flipbook.pageeditor.shapes::TAnnoCross",ANNO_TEXT:"com.mobiano.flipbook.pageeditor::TAnnoText",ANNO_AREA:"com.mobiano.flipbook.pageeditor::TAnnoHighLightArea",ANNO_FLASHSHOW:"com.mobiano.flipbook.pageeditor.TAnnoSWF1",ANNO_ATEXT:"com.mobiano.flipbook.pageeditor::TAnnoDynamicText",ANNO_ROLLERTEXT:"com.mobiano.flipbook.pageeditor::TAnnoRollerText",ANNO_PRINT:"com.mobiano.flipbook.pageeditor::TAnnoPrint",ANNO_STARTEXT:"com.mobiano.flipbook.pageeditor::TAnnoStarwarsText",ANNO_TEXTANIM:"com.mobiano.flipbook.pageeditor.textAnim::TAnnoTextAnim",
ANNO_ATIMAGE:"com.mobiano.flipbook.pageeditor.TAnnoClipart",ANNO_EFFECTTEXT:"com.mobiano.flipbook.pageeditor.TAnnoEffectText",ANNO_CALLOUT:"com.mobiano.flipbook.pageeditor.shapes::TAnnoCallout",ANNO_ADVANCEDSOUND:"com.mobiano.flipbook.pageeditor::TAnnoAdvancedSound1",ANNO_ALPHATRANSITIONBANNER:"com.mobiano.flipbook.pageeditor.TAnnoAlphaTransitionBanner",ANNO_EMBEDDEDSLIDESHOW:"com.mobiano.flipbook.pageeditor.TAnnoEmbeddedSlideshow",ANNO_BANNER:"com.mobiano.flipbook.pageeditor::TAnnoBanner",ANNO_CAROUSEL:"com.mobiano.flipbook.pageeditor.TAnnoCarouselViewer",
ANNO_DYNSHOW:"com.mobiano.flipbook.pageeditor::TAnnoDynamicShowPhoto",ANNO_FLIPJUMP:"com.mobiano.flipbook.pageeditor.TAnnoDynamicTurnPhoto",ANNO_PLUGIN:"com.mobiano.flipbook.pageeditor::TAnnoPlugIn",ANNO_SWF:"com.mobiano.flipbook.pageeditor.TAnnoSWF",ANNO_CART:"com.mobiano.flipbook.pageeditor.TAnnoCart",ANNO_HOTSPOTS:"com.mobiano.flipbook.pageeditor.TAnnoHotSpots"},PlayEvt:{EVT_PLAY:"EVT_PageViewed",EVT_STOP:"EVT_PageOffView"},TriggerEventType:{MouseDown:"mouseDown",MouseOver:"mouseOver",MouseOut:"mouseOut",
MouseUp:"mouseUp",MouseMove:"mouseMove",MouseLeave:"mouseLeave"},MouseOverType:{Zoom:"1",AddBorder:"2"},ActionType:{GOTO_PAGE:"com.mobiano.flipbook.pageeditor.TAnnoActionGotoPage",OPEN_URL:"com.mobiano.flipbook.pageeditor.TAnnoActionOpenURL",OPEN_WINDOW:"com.mobiano.flipbook.pageeditor.TAnnoActionOpenWindow",SLIDE_SHOW:"com.mobiano.flipbook.pageeditor.TAnnoActionPhotoSlide",ACTION_JS:"com.mobiano.flipbook.pageeditor.TAnnoActionJavascript",PLAY_AUDIO:"com.mobiano.flipbook.pageeditor.TAnnoActionPlayAudio",
OPEN_IMG:"com.mobiano.flipbook.pageeditor.TAnnoActionOpenImg",PLAY_VIDEO:"com.mobiano.flipbook.pageeditor.TAnnoActionPlayVideo",SHOW_INFORMATION:"com.mobiano.flipbook.pageeditor.TAnnoActionShowInformation",QUIZ:"com.mobiano.flipbook.pageeditor.TAnnoActionQuiz",PLAYVIDEO:"com.mobiano.flipbook.Action.TAnnoActionPlayVideo"},WindowType:{OPEN_YOUTUBE:"TYPE_YOUTUBE",OPEN_VIMEO:"TYPE_VIMEO",OPEN_DAILYMOTION:"TYPE_DAILYMOTION",OPEN_TYPE_WISTIA:"TYPE_WISTIA",OPEN_TYPE_YOUKU:"TYPE_YOUKU",OPEN_TYPE_QQ:"TYPE_QQ",
OPEN_VIDEO:"0",OPEN_FLASH:"1",OPEN_SHOW_TEXT:"4"}},bookEvent={onCurrentPageIndexChanged:"BE_PIC",onCurrentPageIndexWillChange:"BE_PIWC",onNoNextPage:"BE_NNP",onNoPreviousPage:"BE_NPP"},PLUGIN_ROTATE3D="AbPIMagneticSlider",PLUGIN_VIDEO1="VideoPlayerExemple01",PLUGIN_VIDEO2="VideoPlayerExemple02",PLUGIN_CLASSAUDIO="",KEY_CODE_ENTER=13,KEY_CODE_LEFT=37,KEY_CODE_UP=38,KEY_CODE_RIGHT=39,KEY_CODE_DOWN=40,KEY_CODE_HOME=36,KEY_CODE_END=35,KEY_CODE_PAGEUP=33,KEY_CODE_PAGEDOWN=34,KEY_CODE_DELETE=46,KEY_CODE_F11=
122,MOUSE_LEFT=1,MOUSE_MIDDLE=2,MOUSE_RIGHT=3,LOADING_WIDTH=30,LOADING_HEIGHT=30,COIL_PAGE_WIDTH=500,ICON_BACKGROUND=0,ICON_LAST=1,ICON_NEXT=2,ICON_PREV=3,ICON_FIRST=4,ICON_ZOOMIN=5,ICON_ZOOMOUT=6,ICON_AUTOPLAY=7,ICON_STOPAUTOPLAY=8,ICON_THUMB=9,ICON_SHARE=10,ICON_SEARCH=11,ICON_DOWNLOAD=12,ICON_HOME=13,ICON_BOOKMARK=14,ICON_SOUNDON=15,ICON_SOUNDOFF=16,ICON_PREV_NORMAL=17,ICON_PREV_NORMAL_DOWN=18,ICON_NEXT_NORMAL=19,ICON_NEXT_NORMAL_DOWN=20,ICON_PRINT=21,ICON_HELP=22,ICON_ABOUT=23,ICON_MOREBAR=24,
ICON_LANGUAGE=25,ICON_THUMB_DOWN=26,ICON_FULLSCREEN=27,ICON_EXIT_FULLSCREEN=28,ICON_MOVE_POSITION=29,ICON_MOVE_DRAG=30,ICON_ANNOTATION=31,ICON_TOC=32,ICON_VIDEOGALLERY=33,ICON_PHOTOGALLERY=34,isTouchDevice=function(){var b=navigator.userAgent.match(Hammer.MOBILE_REGEX),b=b&&0<b.length;return Hammer.HAS_TOUCHEVENTS&&b},_event;
_event=isTouchDevice()?{_down:"touchstart",_move:"touchmove",_end:"touchend",_click:"touchend",_leave:"touchleave",_out:"touchleave",_enter:"touchmove",_mousewheel:"mousewheel",_over:"touchover"}:{_down:"mousedown",_move:"mousemove",_end:"mouseup",_click:"click",_leave:"mouseleave",_out:"mouseout",_enter:"mouseenter",_mousewheel:"mousewheel",_over:"mouseover"};
var WebScheme={HTTP:"http",HTTPS:"https",FTP:"ftp",MAILTO:"mailto",IDAP:"idap",FILE:"file",NEWS:"news",GOPHER:"gopher",TELNET:"telnet"},transformCSS=function(b){var c="";b.perspective&&(c=c+"perspective("+b.perspective+"px)");b.scale&&(c=c+"scale3d("+b.scale+","+b.scale+",1) ");b.tran&&(isIE()&&(c=c+"translate("+b.tran.x+"px,"+b.tran.y+"px) "),isIE()||(c=c+"translate3d("+b.tran.x+"px,"+b.tran.y+"px,0px) "));b.rotate&&(c=c+"rotate("+b.rotate+"deg)");b.rotateY&&(c=c+"rotateY("+b.rotateY+"deg)");b.scaleX&&
(c=c+"scaleX("+b.scaleX+")");return{"-webkit-transform":c,"-moz-transform":c,"-ms-transform":c,"-o-transform":c,transform:c}},initBookTye=function(){var b="normal_book";if("slide"==bookConfig.FlipStyle.toLowerCase()||isBelowIE9())b="slide_book";"flip"!=bookConfig.FlipStyle.toLowerCase()||isBelowIE9()||(b="flip_book");"catalog"!=bookConfig.FlipStyle.toLowerCase()||isBelowIE9()||(b="catalog_book");isPhoneBook()&&(b="phone_book");return b},rotate=function(b){return" rotate("+b+"deg)"},translate=function(b,
c){return 3!=browserType?" translate3d("+b+"px,"+c+"px,0px)":" translate("+b+"px,"+c+"px)"},tranScale=function(b){return 3!=browserType?" scale3d("+b+","+b+",1)":" scale("+b+")"},cssTranslate=function(b,c,d){if(3==browserType){if(void 0==b.getOrigin||null==b.getOrigin)b.getOrigin=!1;if(!b.getOrigin){b.getOrigin=!0;b.originX=parseInt(b.css("left"));b.originY=parseInt(b.css("top"));if(void 0==b.originX||null==b.originX||isNaN(b.originX))b.originX=0;if(void 0==b.originY||null==b.originY||isNaN(b.originY))b.originY=
0}b={left:b.originX+c+"px",top:b.originY+d+"px"}}else b=translate(c,d),b={"-webkit-transform":b,"-moz-transform":b,"-ms-transform":b,"-o-transform":b,transform:b};return b},translate2D=function(b,c){return" translate("+b+"px,"+c+"px)"},horizontalMirror=function(b){b&&b.css({"-moz-transform":"scaleX(-1)","-webkit-transform":"scaleX(-1)","-o-transform":"scaleX(-1)",transform:"scaleX(-1)",filter:"FlipH"})};
$.fn.transform=function(b,c){if(3==browserType){if(void 0==this.getOrigin||null==this.getOrigin)this.getOrigin=!1;if(!this.getOrigin){this.getOrigin=!0;this.originX=parseInt(this.css("left"));this.originY=parseInt(this.css("top"));if(void 0==this.originX||null==this.originX||isNaN(this.originX))this.originX=0;if(void 0==this.originY||null==this.originY||isNaN(this.originY))this.originY=0}this.css({left:this.originX+b+"px",top:this.originY+c+"px"});return this}var d=3!=browserType?" translate3d("+
b+"px,"+c+"px,0px)":" translate("+b+"px,"+c+"px)";this.css({"-webkit-transform":d,"-moz-transform":d,"-ms-transform":d,"-o-transform":d,transform:d})};
var scaleTran=function(b){return" scale("+b+")"},isLeft=function(b){return 0==b||2==b},isRight=function(b){return 1==b||3==b},isTop=function(b){return 0==b||1==b},isBottom=function(b){return 2==b||3==b},playFlipSound=function(){if((!isPlaying||$.system.name!=$.system.ANDROID)&&parseBool(bookConfig.FlipSound,!0)&&void 0!=flipAudio&&null!=flipAudio&&void 0!=flipAudio[0].play)try{flipAudio[0].play()}catch(b){}},nextPageFun=function(){bookType==BookType.normal_book?(gotoPageFun(2*Math.floor(flipBook.getCurrentPageIndex()/
2+1)),"undefined"!=typeof speakConfig&&"none"!=speakConfig.title&&0==flagspeak&&($("#LectureText").stop(!0),$("#LectureText").css("marginTop",0),LectureAudio(Math.floor(flipBook.getCurrentPageIndex()/2+1)),LectureSoll(Math.floor(flipBook.getCurrentPageIndex()/2+1)))):bookType==BookType.single_book?gotoPageFun(parseInt(singlePageBook.currentPageIndex)+1):bookType==BookType.zoom_book?!0==zoomBook.doublePage?gotoPageFun(2*Math.floor(zoomBook.currentIndex/2+1)):gotoPageFun(parseInt(zoomBook.currentIndex)+
1):bookType==BookType.slide_book?(gotoPageFun(2*Math.floor(slideBook.getCurrentPageIndex()/2+1)),"undefined"!=typeof speakConfig&&"none"!=speakConfig.title&&0==flagspeak&&($("#LectureText").stop(!0),$("#LectureText").css("marginTop",0),LectureAudio(Math.floor(slideBook.getCurrentPageIndex()/2+1)),LectureSoll(Math.floor(slideBook.getCurrentPageIndex()/2+1)))):bookType==BookType.singleSlide_book?gotoPageFun(parseInt(singleSlideBook.currentIndex)+1):bookType==BookType.catalog_book?(gotoPageFun(2*Math.floor(catalogBook.getCurrentPageIndex()/
2+1)),"undefined"!=typeof speakConfig&&"none"!=speakConfig.title&&0==flagspeak&&($("#LectureText").stop(!0),$("#LectureText").css("marginTop",0),LectureAudio(Math.floor(catalogBook.getCurrentPageIndex()/2+1)),LectureSoll(Math.floor(catalogBook.getCurrentPageIndex()/2+1)))):bookType==BookType.singleCatalog_book?gotoPageFun(parseInt(singleCatalogBook.currentIndex)+1):bookType==BookType.phone_book?(gotoPageFun(2*Math.floor(phoneBook.getCurrentPageIndex()/2+1)),"undefined"!=typeof speakConfig&&"none"!=
speakConfig.title&&0==flagspeak&&($("#LectureText").stop(!0),$("#LectureText").css("marginTop",0),LectureAudio(Math.floor(phoneBook.getCurrentPageIndex()/2+1)),LectureSoll(Math.floor(phoneBook.getCurrentPageIndex()/2+1)))):bookType==BookType.singlePhone_book&&gotoPageFun(parseInt(singlePhoneBook.currentIndex)+1)},previousPageFun=function(){bookType==BookType.normal_book?(gotoPageFun(2*Math.floor(flipBook.getCurrentPageIndex()/2-1)+1),"undefined"!=typeof speakConfig&&"none"!=speakConfig.title&&0==
flagspeak&&($("#LectureText").stop(!0),$("#LectureText").css("marginTop",0),LectureAudio(Math.floor(flipBook.getCurrentPageIndex()/2-1)),LectureSoll(Math.floor(flipBook.getCurrentPageIndex()/2-1)))):bookType==BookType.catalog_book?(gotoPageFun(2*Math.floor(catalogBook.getCurrentPageIndex()/2-1)+1),"undefined"!=typeof speakConfig&&"none"!=speakConfig.title&&0==flagspeak&&($("#LectureText").stop(!0),$("#LectureText").css("marginTop",0),LectureAudio(Math.floor(catalogBook.getCurrentPageIndex()/2-1)),
LectureSoll(Math.floor(catalogBook.getCurrentPageIndex()/2-1)))):bookType==BookType.single_book?gotoPageFun(parseInt(singlePageBook.currentPageIndex)-1):bookType==BookType.zoom_book?!0==zoomBook.doublePage?gotoPageFun(2*Math.floor(zoomBook.currentIndex/2-1)+1):gotoPageFun(parseInt(zoomBook.currentIndex)-1):bookType==BookType.slide_book?gotoPageFun(slideBook.currentIndex-2):bookType==BookType.singleSlide_book?gotoPageFun(parseInt(singleSlideBook.currentIndex)-1):bookType==BookType.singleCatalog_book?
gotoPageFun(parseInt(singleCatalogBook.currentIndex)-1):bookType==BookType.phone_book?gotoPageFun(phoneBook.currentIndex-1):bookType==BookType.singlePhone_book&&gotoPageFun(singlePhoneBook.currentIndex-1)},firstPageFun=function(){gotoPageFun(1)},lastPageFun=function(){gotoPageFun(originTotalPageCount)},gotoPageFun=function(b){b=parseInt(b);passwardType()&&bookConfig.excludeFrontPages&&b>parseInt(bookConfig.excludeFrontPages)&&!verifyPassward()?passwardPannel.show():bookType==BookType.normal_book?
flipBook.gotoPage(b):bookType==BookType.single_book?singlePageBook.gotoPage(b):bookType==BookType.zoom_book?zoomBook.gotoPage(b):bookType==BookType.slide_book?slideBook.gotoPage(b):bookType==BookType.singleSlide_book?singleSlideBook.gotoPage(b):bookType==BookType.catalog_book?catalogBook.gotoPage(b):bookType==BookType.singleCatalog_book?singleCatalogBook.gotoPage(b):bookType==BookType.phone_book?phoneBook.gotoPage(b):bookType==BookType.singlePhone_book&&singlePhoneBook.gotoPage(b)},fillCurrentPageContent=
function(){for(var b=getShownPage(),c=0;c<b.length;c++)BookInfo.getBook().fillPage(b[c]);thumbnail&&thumbnail.show&&thumbnail.fillContent()},setPageURL=function(b,c,d){var f=parseInt(b)-1;global.fliphtml5_pages||(global.fliphtml5_pages=[]);global.fliphtml5_pages[f]||(global.fliphtml5_pages[f]={});getShownPage();switch(c){case 0:global.fliphtml5_pages[f].l=d;bookType!=BookType.zoom_book&&bookType!=BookType.normal_book&&bookType!=BookType.single_book||zoomBook.fillPage(b);break;case 1:global.fliphtml5_pages[f].n=
d;BookInfo.getBook().fillPage(b);break;case 2:global.fliphtml5_pages[f].t=d}},getPageDir=function(b,c,d){if(0>=b||void 0!=d&&b>d)return"";if(bookConfig.getPageURL){var f=0;"normal"==c&&(f=1);"thumb"==c&&(f=2);return bookConfig.getPageURL(b,f)}d=getFileFormat(b);var g=global.fliphtml5_pages;if(void 0!=g&&0<g.length){g=g[b-1];if(void 0!=g&&null!=g)switch(c){case "normal":f=void 0==g.n?g.l:g.n;break;case "large":f=g.l;break;case "thumb":f=g.t}if(void 0==f)switch(c){case "normal":return f=getString("normalPath",
"files/page/")+b+d;case "large":return f=getString("largePath","files/large/")+b+d;case "thumb":return f=getString("thumbPath","files/thumbnail/")+b+d}return void 0==f?"":f}switch(c){case "normal":return f=getString("normalPath","files/page/")+b+d,void 0==f?"":f;case "large":return f=getString("largePath","files/large/")+b+d,void 0==f?"":f;case "thumb":return f=getString("thumbPath","files/thumbnail/")+b+d,void 0==f?"":f}},getFileFormat=function(b){return!passwardType()||!bookConfig.excludeFrontPages||
b<=parseInt(bookConfig.excludeFrontPages)?".jpg":".js"},decodeBase64=function(b,c){var d=encodeDatabasePrefix(c);if(global[d+b]&&"string"==typeof global[d+b]){var f=getRealkey();if(f)return d=base64.decode(global[d+b]),f=rc4(f,d),base64.encode(f)}},dataBase64Str=function(b,c,d){if(verifyPassward()){var f=decodeDatabasePrefix(c),g=encodeDatabasePrefix(c);if(global[f+b])return global[g+b]=null,d&&d.remove(),global[f+b];c="data:image/jpg;base64,"+decodeBase64(b,c);global[f+b]=c;global[g+b]=null;d&&d.remove();
return c}},decodeDatabasePrefix=function(b){switch(b){case "normal":return"dataBase";case "large":return"dataBase";case "thum":return"dataBaseThum"}},encodeDatabasePrefix=function(b){switch(b){case "normal":return"page";case "large":return"page";case "thum":return"thumb"}},userList,getRealkey=function(){if(1==passwardType())return getSingleRealKey();if(userList&&document.getElementById("passward")&&""!=$("#passward").val()&&document.getElementById("username")&&""!=$("#username").val()){var b=$("#passward").val(),
c=$("#username").val();if(userList&&"string"==typeof userList[c])return getListRealKey(c,b,userList[c])}},getSingleRealKey=function(){if(bookConfig.singlePasswordKey&&"string"==typeof bookConfig.singlePasswordKey&&document.getElementById("passward")&&""!=$("#passward").val()){var b=parsHexToNormalString(bookConfig.singlePasswordKey);return rc4($("#passward").val(),b)}},getListRealKey=function(b,c,d){b=(b+String.fromCharCode(9)+c).MD5(32);b=parsHexToNormalString(b);b=base64.encode(b);d=d.remove(b);
d=d.replace(/==?$/,"");if(d=base64.decode(d))return c=(b+c).cycle(128),rc4(c,d)},verifyPassward=function(){if(1==passwardType()){if(!document.getElementById("passward")||""==$("#passward").val())return;var b=$("#passward").val();return b.MD5(32).toLowerCase()===bookConfig.singlePasswordMD5.toLowerCase()}if(bookConfig.userListPath&&(userList||loadJavascript(bookConfig.userListPath,verifyPassward,function(){}),userList&&document.getElementById("passward")&&""!=$("#passward").val()&&document.getElementById("username")&&
""!=$("#username").val())){var b=$("#passward").val(),c=$("#username").val();if("string"==typeof userList[c])return b=(c+String.fromCharCode(9)+b).MD5(32),b=parsHexToNormalString(b),b=base64.encode(b),userList[c].substring(0,24)===b}},passwardType=function(){if(!bookConfig.securityType||1==parseInt(bookConfig.securityType))return 0;if(bookConfig.securityType&&2==parseInt(bookConfig.securityType))return 1;if(bookConfig.securityType&&3==parseInt(bookConfig.securityType))return 2},getPageWidthHeight=
function(b,c,d,f){var g=Point(0,0);b/c>d/f?(g.x=d*c/f,g.y=c):(g.x=b,g.y=b*f/d);return g},getPageWidthHeightByWidth=function(b,c,d,f){c=Point(0,0);c.x=b;c.y=b*f/d;return c},slideShowImagesAdapter=function(b,c){if(b[0])return b;for(var d=[],f=c[0],g=c[1],h=b[f].length,k=0;k<h;k++)d.push(b[f][k][g]);return d},pointToLineDistance=function(b,c,d,f,g,h){var k=h-f,l=d-g;return Math.abs(k*b+l*c+(g*f-d*h))/Math.sqrt(k*k+l*l)},globalToBook=function(b,c,d,f){void 0==f&&(f=!1);var g;f?g=Point(c-singlePageBook.getLeft(),
d-singlePageBook.getTop()):bookType==BookType.normal_book?g=Point(c-((b?0:flipBook.getPageWidth())+flipBook.getLeft()),d-flipBook.getTop()):bookType==BookType.catalog_book&&(f=catalogBook.getTran(),b=c-((b?0:catalogBook.getPageWidth())+catalogBook.getCssLeft())-f.x,d=d-catalogBook.getCssTop()-f.y,g=Point(b,d));return g};bdor[32]=function(b,c){return b+c};
var changeShowBook=function(b){switch(b){case 0:bookType=BookType.normal_book;singlePageBook.hide();zoomBook.hide();flipBook.show();zoomBook.changePageMode(!0);thumbButtonEnable&&thumbnail.mergeAll();break;case 1:bookType=BookType.single_book;singlePageBook.show();zoomBook.hide();flipBook.hide();zoomBook.changePageMode(!1);thumbButtonEnable&&thumbnail.fissionAll();break;case 2:bookType=BookType.zoom_book;singlePageBook.hide();zoomBook.show();flipBook.hide();thumbButtonEnable&&(!0==zoomBook.doublePage?
thumbnail.mergeAll():thumbnail.fissionAll());zoomBook.showPage.forceReset();zoomBook.showPage.animateMax();break;case 3:bookType=BookType.slide_book;slideBook.show();thumbButtonEnable&&thumbnail.mergeAll();break;case 4:bookType=BookType.phone_book;singlePhoneBook.hide();phoneBook.show();thumbButtonEnable&&thumbnail.mergeAll();break;case 5:bookType=BookType.singlePhone_book;singlePhoneBook.show();phoneBook.hide();thumbButtonEnable&&thumbnail.fissionAll();break;case 6:bookType=BookType.singleSlide_book;
singleSlideBook.show();thumbButtonEnable&&thumbnail.fissionAll();break;case 7:bookType=BookType.catalog_book;catalogBook.show();thumbButtonEnable&&thumbnail.mergeAll();break;case 8:bookType=BookType.singleCatalog_book,singleCatalogBook.show(),thumbButtonEnable&&thumbnail.fissionAll()}},computePoint=function(b,c,d,f,g){if(!f||!g)return{rotate:0,pageTranX:0,maskTranX:0,maskTranY:0};g.x>b&&(g.x=b);g.x<-b&&(g.x=-b);$.system.name==$.system.ANDROID&&$.browser.safari&&(f.y=g.y);if(f.x==g.x){var h=0;0>f.x&&
(h+=180);return{rotate:h,pageTranX:0,maskTranX:f.x,maskTranY:0}}var k=Math.sqrt(Math.pow(g.y-c,2)+Math.pow(g.x-0,2)),h=Math.sqrt(Math.pow(f.y-c,2)+Math.pow(f.x-0,2));if(k>h){var l=Math.atan((g.y-c)/(g.x-0)),k=Math.abs(Math.sin(l)*h),h=Math.abs(Math.cos(l)*h);g.y=c-k;g.x=0<g.x?h:-h}k=Math.sqrt(Math.pow(g.y-0,2)+Math.pow(g.x-0,2));h=Math.sqrt(Math.pow(f.y-0,2)+Math.pow(f.x-0,2));k>h&&(l=Math.atan((g.y-0)/(g.x-0)),k=Math.abs(Math.sin(l)*h),h=Math.abs(Math.cos(l)*h),g.y=k,g.x=0<g.x?h:-h);var m=(g.y-f.y)/
(g.x-f.x),n=Math.atan(m),h=180*n/Math.PI,q=(g.x+f.x)/2,p=(g.y+f.y)/2,k=c/2,l=b/2,s=c/2;0>f.x&&(h+=180,l=-b/2);g=Math.sqrt(Math.pow(f.y-g.y,2)+Math.pow(f.x-g.x,2))/2;g=0<=h&&180>h?Math.abs((c-Math.abs(f.y))*Math.sin(n))+g:Math.abs(f.y*Math.sin(n))+g;c=Math.atan(b/c);d=Math.abs(g/(Math.sin(c+Math.abs(n))*d));d=Math.min(1,d);c=((q-l)*m+s+Math.pow(m,2)*p)/(1+Math.pow(m,2));f=m*(p-c)+q;s=Math.sqrt(Math.pow(l-f,2)+Math.pow(s-c,2));Math.abs(f)<Math.abs(l)&&(s=-s);return{frontShadowDistance:g,shadowRate:d,
rotate:h,pageTranX:s-b/2,maskTranX:f-0,maskTranY:c-k}},supports=function(){var b=document.createElement("div"),c=["Khtml","Ms","O","Moz","Webkit"],d=c.length;return function(f){if(f in b.style)return!0;for(f=f.replace(/^[a-z]/,function(b){return b.toUpperCase()});d--;)if(c[d]+f in b.style)return!0;return!1}}(),setCurrentIndexTextField=function(b,c){var d=bookConfig.totalPagesCaption,f=bookConfig.pageNumberCaption;void 0==d&&(d="");void 0==f&&(f="");if(""!=f)if(1!=b&&b!=originTotalPageCount&&c){var f=
2*Math.floor(b/2),g=getShownPageNumber(f),h=getShownPageNumber(f+1);b=rightToLeft?h+"-"+g:g+"-"+h}else f=b=getShownPageNumber(b);else 1!=b&&b!=originTotalPageCount&&c?(g=f=2*Math.floor(b/2),h=f+1,b=rightToLeft?h+"-"+g:g+"-"+h):f=b;""==d?(d=originTotalPageCount,c||(d=originTotalPageCount)):(d=g=parseInt(d),c||(d=originTotalPageCount-originTotalPageCount+g));$("#guidPageIndex").html("<b>"+(f+"/"+d)+"</b>");void 0!=$("#currentPageIndexTextField")&&null!=$("#currentPageIndexTextField")&&void 0!=$("#currentPageIndexTextField")[0]&&
null!=$("#currentPageIndexTextField")[0]&&$("#currentPageIndexTextField").val(rightToLeft?d+"/"+b:b+"/"+d)},getShownPageArray=function(){var b=bookConfig.pageNumberCaption,c=originTotalPageCount;";"==b.substr(b.length-1,1)&&(b=b.substr(0,b.length-1));for(var b=b.split(";"),d=[],f=0,g=0;g<b.length;g++)if(""!=b[g]&&void 0!=b[g]&&(f=b[g].split(":"),f[0]))if(f[1]||(f[1]=""),-1<f[1].indexOf("+")){var h=f[0];h.indexOf("-");for(var h=h.split("-"),k=h[1],h=parseInt(h[0]),k=k?parseInt(k):c,f=parseInt(f[1].replace("+",
"")),l=h;l<=k;l++)d[l]=l-h+f}else isNaN(f[0])||(h=parseInt(f[0]),d[h]=void 0==f[1]?"":f[1]);return d},getShownPageNumber=function(b){var c=bookConfig.pageNumberCaption;if(""==c||void 0==c)return b;b=parseInt(b);c=getShownPageArray();return void 0==c[b]?b:c[b]},getRealPageNumber=function(b){var c=bookConfig.pageNumberCaption;if(""==c||void 0==c)return isNaN(parseInt(b))&&(b=1),parseInt(b);for(var c=getShownPageArray(),d=-1,f=c.length,g=1;g<=f;g++)if(isNaN(parseInt(b))){if(c[g]+="",c[g].toLowerCase()==
b.toLowerCase()){d=g;break}}else if(c[g]==b){d=g;break}return-1==d?(isNaN(parseInt(b))&&(b=1),parseInt(b)):d},setLocationHash=function(b){window.location.hash="#p="+getShownPageNumber(b)},getSpeedArray=function(b,c){for(var d=c/2,f=(b-b/4)/d,g=Array(c),h=0;h<c;h++)g[h]=h<d?b-(d-h)*f:b+(h-d+1)*f;return g.reverse()},getBrowserPre=function(){switch(browserType){case 3:return"-ms-";case 2:return"-moz-";case 1:return"-webkit-";case 4:return"-o-"}},getPoint=function(b){if(3==browserType){if(void 0==b.getOrigin||
null==b.getOrigin)b.getOrigin=!1;if(!b.getOrigin){b.getOrigin=!0;b.originX=parseInt(b.css("left"));b.originY=parseInt(b.css("top"));if(void 0==b.originX||null==b.originX||isNaN(b.originX))b.originX=0;if(void 0==b.originY||null==b.originY||isNaN(b.originY))b.originY=0}return Point(parseInt(b.css("left"))-b.originX,parseInt(b.css("top"))-b.originY)}return getTransform(b[0])},getBookPoint=function(b){return bookType!=BookType.slide_book&&bookType!=BookType.singleSlide_book&&bookType!=BookType.catalog_book&&
bookType!=BookType.singleCatalog_book?getTransform(b[0]):getPoint(b)},getTransform=function(b){var c;switch(browserType){case 3:c=b.style["-ms-transform"];break;case 2:c=b.style["-moz-transform"];break;case 1:c=b.style["-webkit-transform"];break;case 4:c=b.style["-o-transform"];break;default:c=b.style.transform}if(void 0==c||null==c)if(c=b.style.transform,void 0==c||null==c)return Point(0,0);c=c.match(/translate\((.*?)\)/)||c.match(/translate3d\((.*?)\)/);if(null==c||""==c||2>c.length)return Point(0,
0);c=c[1].split(", ");return Point(parseInt(c[0],10),parseInt(c[1],10))},getScale=function(b){var c;switch(browserType){case 3:c=b.style["-ms-transform"];break;case 2:c=b.style["-moz-transform"];break;case 1:c=b.style["-webkit-transform"];break;case 4:c=b.style["-o-transform"];break;default:c=b.style.transform}if(void 0==c||null==c)if(c=b.style.transform,void 0==c||null==c)return Point(0,0);c=c.match(/scale\((.*?)\)/)||c.match(/scale3d\((.*?)\)/);if(null==c||""==c)return 1;c=c[1].split(", ");return c[0]},
actionEvent=function(b){this.config.action.actionType==PageEditor.ActionType.GOTO_PAGE?(gotoPageFun(this.config.action.pageIndex),$(b).addClass("slider-action")):this.config.action.actionType==PageEditor.ActionType.OPEN_URL?(void 0==this.config.action.linkTarget&&(this.config.action.linkTarget="_blank"),3==browserType?window.location=this.linkURL:window.open(this.linkURL,this.config.action.linkTarget),$(b).addClass("slider-action")):this.config.action.actionType==PageEditor.ActionType.OPEN_WINDOW?
(this.video=new initVideoForm(tmpContainer,{width:this.config.action.windowWidth,height:this.config.action.windowHeight,src:this.config.action.resourceContent,caption:this.config.action.caption},bookContainer.width(),bookContainer.height()),$(b).addClass("slider-action")):this.config.action.actionType==PageEditor.ActionType.SLIDE_SHOW?(this.slide=new initSlideShow(tmpContainer,this.config.action.photos,bookContainer.width(),bookContainer.height()),$(b).addClass("slider-action")):this.config.action.actionType==
PageEditor.ActionType.PLAY_AUDIO?(this.audios=new initAudioEditor(tmpContainer,this.config.action.audioURL,this.config.action.autoPlay),this.audios.showshow(),$(b).addClass("slider-action")):this.config.action.actionType==PageEditor.ActionType.ACTION_JS?(null!=this.config.action.scriptFun&&eval(this.config.action.scriptFun),$(b).addClass("slider-action")):this.config.action.actionType==PageEditor.ActionType.OPEN_IMG?(this.zoomImg=new HTML5ZoomImg(this.config.src,$("#tmpContainer")),$(b).addClass("slider-action")):
this.config.action.actionType==PageEditor.ActionType.PLAY_VIDEO&&(this.config.action.windowType==PageEditor.WindowType.OPEN_YOUTUBE?this.video=new PopUpVideo(this.config.action,"youtube"):this.config.action.windowType==PageEditor.WindowType.OPEN_VIMEO&&(this.video=new PopUpVideo(this.config.action,"vimeo")),this.video&&this.video.show(),$(b).addClass("slider-action"))},getAliasValue=function(b){b=bookConfig[b];if(b instanceof Array)for(;0<b.length;)return(b=b[0])?bookConfig[b]:void 0;else return b},
getString=function(b,c){return getAliasValue(b)||c},getInt=function(b,c){var d=getAliasValue(b);try{return isNaN(d)||void 0==d?c:Number(d)}catch(f){return c}},getBool=function(b,c){var d=["true","yes","show","enable"],f=["false","no","hide","disable"],g=getAliasValue(b);try{g=g.toLowerCase()}catch(h){return c}return 0>d.indexOf(g)&&0>f.indexOf(g)?c:0<=d.indexOf(g)},parseBool=function(b,c){if(!0===b||!1===b)return b;if(void 0==b)return!1;void 0==c&&(c=!1);var d=["true","yes","show","enable"],f=["false",
"no","hide","disable"];b=b.toLowerCase();return 0>d.indexOf(b)&&0>f.indexOf(b)?c:0<=d.indexOf(b)},getColor=function(b,c){var d=getAliasValue(b);return void 0!=d?colorTo0x(d):c},getImage=function(b){if(0<iconArray.length)for(var c=0;c<iconArray.length;c++)if(iconArray[c].url==b)return iconArray[c].img;return new Image},getLanguage=function(b,c){return selectedLanguage[b]?selectedLanguage[b]:getLanguageValue(b,c)},highlightSearchFun=function(b,c){if(0!=positionForPages.length){var d=!1;if(void 0==frmSearch||
null==frmSearch)d=!0;frmSearch.isSearchShow||(d=!0);0==frmSearch.itemCount&&(d=!0);var f=frmSearch.textField.val().toLowerCase();rightToLeft&&LanguageTool.isRightToLeft(f)&&(f=f.reverse());""==f&&(d=!0);if(!0==d)clearHighlightFun(b);else{for(var g,d=0;d<positionForPages.length;d++)if(positionForPages[d].page==c){g=positionForPages[d].positions;break}if(void 0==g)clearHighlightFun(b);else{var h="url("+uiBaseURL+"highlight.png)",k="",l="",m="",n="";if(0<g.length){for(d=0;d<g.length;d++){var q=g[d];
if(-1<q.word.toLowerCase().indexOf(f))var p=q.left/(1-q.width),s=q.top/(1-q.height),k=k+h+",",n=n+"no-repeat,",l=l+100*p+"% "+100*s+"%,",m=m+100*q.width+"% "+100*q.height+"%,"}0<k.length?(k=k.substr(0,k.length-1),n=n.substr(0,n.length-1),l=l.substr(0,l.length-1),m=m.substr(0,m.length-1),b.css({"background-image":k,"background-repeat":n,"background-position":l,"-webkit-background-size":m,"-o-background-size":m,"background-size":m,display:"block"})):clearHighlightFun(b)}else clearHighlightFun(b)}}}},
clearHighlightFun=function(b){b.css({"background-image":""});b.css({display:"none"})},clickFun=function(){!isPhone()||global.foldingMenu&&!0==global.foldingMenu.visible||toolBar.showOrHide()},stopEvent=function(b){try{var c=b||window.event;c.preventDefault?(c.preventDefault(),c.stopPropagation()):(c.returnValue=!1,c.cancelBubble=!0)}catch(d){}return!1},getShownPage=function(){var b=[];if(bookType==BookType.normal_book){var c=flipBook.getCurrentPageIndex(),c=2*Math.floor(c/2),d=c+1;rightToLeft?(b.push(d),
b.push(c)):(b.push(c),b.push(d))}bookType==BookType.single_book&&(c=singlePageBook.getCurrentPageIndex(),b.push(c));bookType==BookType.zoom_book&&(zoomBook.doublePage?(c=zoomBook.getCurrentPageIndex(),c=2*Math.floor(c/2),d=c+1,rightToLeft?(b.push(d),b.push(c)):(b.push(c),b.push(d))):(c=zoomBook.currentIndex,b.push(c)));if(bookType==BookType.slide_book){if(void 0==slideBook)return;c=slideBook.getCurrentPageIndex();c=2*Math.floor(c/2);d=c+1;rightToLeft?(b.push(d),b.push(c)):(b.push(c),b.push(d))}if(bookType==
BookType.singleSlide_book){if(void 0==singleSlideBook)return;c=parseInt(singleSlideBook.currentIndex);b.push(c)}if(bookType==BookType.catalog_book){if(void 0==catalogBook)return;c=catalogBook.getCurrentPageIndex();c=2*Math.floor(c/2);d=c+1;rightToLeft?(b.push(d),b.push(c)):(b.push(c),b.push(d))}if(bookType==BookType.singleCatalog_book){if(void 0==singleCatalogBook)return;c=parseInt(singleCatalogBook.currentIndex);b.push(c)}if(bookType==BookType.phone_book){if(void 0==phoneBook)return;c=phoneBook.getCurrentPageIndex();
c=2*Math.floor(c/2);d=c+1;rightToLeft?(b.push(d),b.push(c)):(b.push(c),b.push(d))}if(bookType==BookType.singlePhone_book){if(void 0==singlePhoneBook)return;c=singlePhoneBook.currentIndex;b.push(c)}return b},getShownPageString=function(){var b=getShownPage();return 1==b.length?b[0]+"":b[0]+"-"+b[1]},isIE=function(){return $.browser.msie},isIE9=function(){return $.browser.msie&&9==$.browser.version},isIE11=function(){return $.browser.msie&&11==$.browser.version},isPad=function(){return 0<navigator.userAgent.toLowerCase().indexOf("pad")},
isIpad=function(){var b=navigator.userAgent.toLowerCase();return 0<b.indexOf("ipad")&&0<b.indexOf("safari")},isPC=function(){return $.browser.device==$.browser.DEVICE_PC?!0:!1},isIpod=function(){return 0<navigator.userAgent.toLowerCase().indexOf("ipod")},isIphone=function(){return 0<navigator.userAgent.toLowerCase().indexOf("iphone")},isNokiaPhone=function(){var b=navigator.userAgent.toLowerCase();return 0<b.indexOf("msie")&&0<b.indexOf("wpdesktop")},isPhone=function(){var b=window.location.search;
return $.browser.device==$.browser.DEVICE_PHONE?!0:0<=b.toLowerCase().indexOf("phone=true")||0<=b.toLowerCase().indexOf("phonebook=true")?!0:!1},isPhoneBook=function(){var b=window.location.search;return isPhone()&&$.system.name==$.system.ANDROID&&4>parseInt($.system.version)?!0:0<=b.toLowerCase().indexOf("phonebook=true")?!0:isPhone()&&"slide"==bookConfig.FlipStyle.toLowerCase()?!0:!1},isFlipBook=function(){return bookType==BookType.normal_book||bookType==BookType.single_book||bookType==BookType.zoom_book||
bookType==BookType.catalog_book||bookType==BookType.singleCatalog_book?!0:!1},isCatalogBook=function(){void 0==bookConfig.FlipStyle&&(bookConfig.FlipStyle=getConfigValue("FlipStyle","flip"));return"catalog"==bookConfig.FlipStyle.toLowerCase()||isBelowIE9()?!0:!1},isSlideBook=function(){void 0==bookConfig.FlipStyle&&(bookConfig.FlipStyle=getConfigValue("FlipStyle","flip"));return"slide"==bookConfig.FlipStyle.toLowerCase()||isBelowIE9()?!0:!1},MiniStyle=Class({create:function(b){this.init(b);this.onResize();
this.initEvent()},init:function(b){this.miniLogo=$("<div><img style='right:0px;bottom:0px;opacity:0.5;position:absolute;cursor:pointer;' src='"+bookConfig.appLogoIcon+"'/></div>");b.append($(this.miniLogo));var c=getLogoLink();this.miniLogo.click(function(){void 0!=c&&null!=c&&window.open(c[0],c[1])});this.miniLogo.bind(_event._enter,function(){$(this).css({opacity:"1"})});this.miniLogo.bind(_event._leave,function(){$(this).css({opacity:"0.5"})});this.width=220;this.height=35;this.box=$("<div></div>");
this.box.css({width:this.width+"px",height:this.height+"px","z-index":"300",color:"#ffffff","font-size":"15px",position:"absolute",cursor:"pointer"});this.background=$("<div></div>");this.background.css({width:"100%",height:"100%",background:"#000000",opacity:"0.5","border-radius":"5px","z-index":"0",position:"absolute"});this.title=$("<div></div>");this.title.css({"z-index":"1","line-height":"35px",height:"100%",width:"100%","vertical-align":"middle","text-align":"center","font-family":"Arial,Tomaha",
position:"absolute"});this.title.html("<b>Click to view in fullscreen.</b>");this.box.append(this.background);this.box.append(this.title);tmpContainer.append(this.box)},onResize:function(){this.box.css({left:(windowWidth-this.width)/2+"px",top:(windowHeight-this.height)/2+"px"})},initEvent:function(){this.box.bind(_event._end,function(){fullscreenFun();this.box.css({display:"none"});return!1}.bind(this));$(document).bind(fullScreenApi.fullScreenEventName,function(){toolBar.changeFullscreenIcon(fullScreenApi.isFullScreen())})},
clearStyle:function(){this.box.empty()},isMini:function(){if(!isPhone()){if((windowWidth<=bookConfig.maxWidthToSmallMode||windowHeight<=bookConfig.maxHeightToSmallMode)&&parseBool(bookConfig.MiniStyle,"true")&&!fullScreenApi.isFullScreen())return void 0!=this.box&&null!=this.box&&this.box.css({display:"block"}),global.foldingMenu&&global.foldingMenu.hide(),BookInfo.getBook()&&BookInfo.getBook().miniFullScreen&&(BookInfo.getBook().miniFullScreen.remove(),BookInfo.getBook().addminiFullscreen=!1),!0;
void 0!=this.box&&null!=this.box&&this.box.css({display:"none"});return!1}void 0!=this.box&&null!=this.box&&this.box.css({display:"none"});return!1}});function isBelowIE9(){return $.browser.msie?9>$.browser.version?!0:!1:!1}
function hideLeftRightButton(){return void 0==leftRightButton||null==leftRightButton||bookType!=BookType.slide_book||"lite"!=bookConfig.ToolbarViewMode.toLowerCase()||bookType!=BookType.singleSlide_book||"lite"!=bookConfig.ToolbarViewMode.toLowerCase()||bookType==BookType.singleCatalog_book||bookType==BookType.catalog_book||isPhone()?!1:!0}
function addAdSense(b,c,d,f,g){loadJavascript("http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",function(){var h=document.createElement("ins"),h=$(h);h.addClass("adsbygoogle");h.css({display:"inline-block",width:d+"px",height:f+"px"});h.attr("data-ad-client",g);var k=$("<div/>");k.css({position:"absolute","z-index":1,left:b+"px",top:c+"px",width:d+"px",height:f+"px"});$("body").append(k);k.append(h);eval("(adsbygoogle = window.adsbygoogle || []).push({});")})}
var BookInfo=Class({statics:{getCurrentPages:function(){return getShownPage()},getPageCount:function(){return bookConfig.totalPageCount},isRightToLeft:function(){return rightToLeft},getBookType:function(){return bookType},getBookTypeName:function(){return BookTypeNames[bookType]},getBook:function(){var b;switch(this.getBookType()){case BookType.normal_book:b=flipBook;break;case BookType.single_book:b=singlePageBook;break;case BookType.zoom_book:b=zoomBook;break;case BookType.slide_book:b=slideBook;
break;case BookType.phone_book:b=phoneBook;break;case BookType.singlePhone_book:b=singlePhoneBook;break;case BookType.singleSlide_book:b=singleSlideBook;break;case BookType.catalog_book:b=catalogBook;break;case BookType.singleCatalog_book:b=singleCatalogBook}return b},left:function(){return this.getBook().getLeft()},top:function(){return this.getBook().getTop()},width:function(){return this.getBook().getWidth()},height:function(){return this.getBook().getHeight()},scale:function(){return this.getBook().getScale()},
container:function(){return bookContainer}}}),getConfigValue=function(b,c){try{if(!aliasConfig)return c;var d=aliasConfig[b];if(!d)return c;for(var f=0;f<d.length;f++){var g=d[f];if(bookConfig[g])return bookConfig[g]}return c}catch(h){return c}},getLanguageValue=function(b,c){try{if(!aliasLanguage)return c;var d=aliasLanguage[b];if(!d)return c;for(var f=0;f<d.length;f++){var g=d[f];if(selectedLanguage[g])return selectedLanguage[g]}return c}catch(h){return c}},cr=DeString("c3753b3f49449a65f9ad12578d7a4602c8ae34"),
checkBookConfig=function(){void 0==bookConfig.searchColor&&(bookConfig.searchColor=getConfigValue("searchColor","#00ffff"));void 0==bookConfig.searchAlpha&&(bookConfig.searchAlpha=getConfigValue("searchAlpha",0.3));void 0==bookConfig.appLogoIcon&&(bookConfig.appLogoIcon=getConfigValue("appLogoIcon",""));void 0==bookConfig.appLogoLinkURL&&(bookConfig.appLogoLinkURL=getConfigValue("appLogoLinkURL",""));void 0==bookConfig.HomeURL&&(bookConfig.HomeURL=getConfigValue("HomeURL",""));void 0==bookConfig.appLogoOpenWindow&&
(bookConfig.appLogoOpenWindow=getConfigValue("appLogoOpenWindow","Blank"));void 0==bookConfig.bookTitle&&(bookConfig.bookTitle=getConfigValue("bookTitle","FLIPBOOK"));void 0==bookConfig.bookDescription&&(bookConfig.bookDescription=getConfigValue("bookDescription",""));void 0==bookConfig.toolbarColor&&(bookConfig.toolbarColor=getConfigValue("toolbarColor","#27181A"));void 0==bookConfig.iconColor&&(bookConfig.iconColor=getConfigValue("iconColor","#FFFFFF"));void 0==bookConfig.pageNumColor&&(bookConfig.pageNumColor=
getConfigValue("pageNumColor","#000000"));void 0==bookConfig.loadingBackground&&(bookConfig.loadingBackground=getConfigValue("loadingBackground","#1F2232"));void 0==bookConfig.logoHeight&&(bookConfig.logoHeight=getConfigValue("logoHeight",40));if(void 0==bookConfig.logoPadding||""==bookConfig.logoPadding)bookConfig.logoPadding=getConfigValue("logoPadding",0);void 0==bookConfig.logoTop&&(bookConfig.logoTop=getConfigValue("logoTop",0));void 0==bookConfig.HomeButtonVisible&&(bookConfig.HomeButtonVisible=
getConfigValue("HomeButtonVisible","Hide"));void 0==bookConfig.ShareButtonVisible&&(bookConfig.ShareButtonVisible=getConfigValue("ShareButtonVisible","Hide"));void 0==bookConfig.ThumbnailsButtonVisible&&(bookConfig.ThumbnailsButtonVisible=getConfigValue("ThumbnailsButtonVisible","Hide"));void 0==bookConfig.thumbnailColor&&(bookConfig.thumbnailColor=getConfigValue("thumbnailColor","#FFFFFF"));void 0==bookConfig.thumbnailAlpha&&(bookConfig.thumbnailAlpha=getConfigValue("thumbnailAlpha",60));void 0==
bookConfig.ZoomButtonVisible&&(bookConfig.ZoomButtonVisible=getConfigValue("ZoomButtonVisible","Hide"));void 0==bookConfig.TableOfContentButtonVisible&&(bookConfig.TableOfContentButtonVisible=getConfigValue("TableOfContentButtonVisible","Hide"));void 0==bookConfig.BookMarkButtonVisible&&(bookConfig.BookMarkButtonVisible=getConfigValue("BookMarkButtonVisible","Hide"));void 0==bookConfig.bookmarkBackground&&(bookConfig.bookmarkBackground=getConfigValue("bookmarkBackground","#000000"));void 0==bookConfig.bookmarkFontColor&&
(bookConfig.bookmarkFontColor=getConfigValue("bookmarkFontColor","#ffffff"));void 0==bookConfig.SearchButtonVisible&&(bookConfig.SearchButtonVisible=getConfigValue("SearchButtonVisible","Hide"));void 0==bookConfig.FullscreenButtonVisible&&(bookConfig.FullscreenButtonVisible=getConfigValue("FullscreenButtonVisible","Show"));void 0==bookConfig.leastSearchChar&&(bookConfig.leastSearchChar=getConfigValue("leastSearchChar",0));void 0==bookConfig.searchBackground&&(bookConfig.searchBackground=getConfigValue("searchBackground",
"#383838"));void 0==bookConfig.searchFontColor&&(bookConfig.searchFontColor=getConfigValue("searchFontColor","#ffffff"));void 0==bookConfig.PrintButtonVisible&&(bookConfig.PrintButtonVisible=getConfigValue("PrintButtonVisible","Hide"));void 0==bookConfig.printWatermarkFile&&(bookConfig.printWatermarkFile=getConfigValue("printWatermarkFile",""));void 0==bookConfig.BackgroundSoundButtonVisible&&(bookConfig.BackgroundSoundButtonVisible=getConfigValue("BackgroundSoundButtonVisible","Hide"));void 0==bookConfig.BackgroundSoundURL&&
(bookConfig.BackgroundSoundURL=getConfigValue("BackgroundSoundURL",""));void 0==bookConfig.BackgroundSoundLoop&&(bookConfig.BackgroundSoundLoop=getConfigValue("BackgroundSoundLoop",-1));void 0==bookConfig.HelpButtonVisible&&(bookConfig.HelpButtonVisible=getConfigValue("HelpButtonVisible","Hide"));void 0==bookConfig.helpContentFileURL&&(bookConfig.helpContentFileURL=getConfigValue("helpContentFileURL",""));void 0==bookConfig.helpWidth&&(bookConfig.helpWidth=getConfigValue("helpWidth",400));void 0==
bookConfig.helpHeight&&(bookConfig.helpHeight=getConfigValue("helpHeight",450));void 0==bookConfig.showHelpContentAtFirst&&(bookConfig.showHelpContentAtFirst=getConfigValue("showHelpContentAtFirst","No"));void 0==bookConfig.aboutButtonVisible&&(bookConfig.aboutButtonVisible=getConfigValue("aboutButtonVisible","Hide"));void 0==bookConfig.aboutContactInfoTxt&&(bookConfig.aboutContactInfoTxt=getConfigValue("aboutContactInfoTxt",""));void 0==bookConfig.AutoPlayButtonVisible&&(bookConfig.AutoPlayButtonVisible=
getConfigValue("AutoPlayButtonVisible","Hide"));void 0==bookConfig.autoPlayAutoStart&&(bookConfig.autoPlayAutoStart=getConfigValue("autoPlayAutoStart","No"));void 0==bookConfig.autoPlayDuration&&(bookConfig.autoPlayDuration=getConfigValue("autoPlayDuration",3));void 0==bookConfig.autoPlayLoopCount&&(bookConfig.autoPlayLoopCount=getConfigValue("autoPlayLoopCount",1));void 0==bookConfig.minZoomWidth&&(bookConfig.minZoomWidth=getConfigValue("minZoomWidth",403));void 0==bookConfig.minZoomHeight&&(bookConfig.minZoomHeight=
getConfigValue("minZoomHeight",518));void 0==bookConfig.mouseWheelFlip&&(bookConfig.mouseWheelFlip=getConfigValue("mouseWheelFlip","yes"));void 0==bookConfig.DownloadButtonVisible&&(bookConfig.DownloadButtonVisible=getConfigValue("DownloadButtonVisible","yes"));void 0==bookConfig.DownloadURL&&(bookConfig.DownloadURL=getConfigValue("DownloadURL",""));void 0==bookConfig.bgBeginColor&&(bookConfig.bgBeginColor=getConfigValue("bgBeginColor","#E6E6E6"));void 0==bookConfig.bgEndColor&&(bookConfig.bgEndColor=
getConfigValue("bgEndColor","#E3E3E3"));void 0==bookConfig.bgMRotation&&(bookConfig.bgMRotation=getConfigValue("bgMRotation",90));void 0==bookConfig.backGroundImgURL&&(bookConfig.backGroundImgURL=getConfigValue("backGroundImgURL",""));void 0==bookConfig.LeftShadowWidth&&(bookConfig.LeftShadowWidth=getConfigValue("LeftShadowWidth",40));void 0==bookConfig.LeftShadowAlpha&&(bookConfig.LeftShadowAlpha=getConfigValue("LeftShadowAlpha",1));void 0==bookConfig.RightShadowWidth&&(bookConfig.RightShadowWidth=
getConfigValue("RightShadowWidth",40));void 0==bookConfig.RightShadowAlpha&&(bookConfig.RightShadowAlpha=getConfigValue("RightShadowAlpha",1));void 0==bookConfig.pageBackgroundColor&&(bookConfig.pageBackgroundColor=getConfigValue("pageBackgroundColor","#FFFFFF"));void 0==bookConfig.flipshortcutbutton&&(bookConfig.flipshortcutbutton=getConfigValue("flipshortcutbutton","Hide"));void 0==bookConfig.OriginPageIndex&&(bookConfig.OriginPageIndex=getConfigValue("OriginPageIndex",1));void 0==bookConfig.HardPageEnable&&
(bookConfig.HardPageEnable=getConfigValue("HardPageEnable","No"));void 0==bookConfig.RightToLeft&&(bookConfig.RightToLeft=getConfigValue("RightToLeft","No"));void 0==bookConfig.flippingTime&&(bookConfig.flippingTime=getConfigValue("flippingTime",0.3));void 0!=bookConfig.flippingTime&&(bookConfig.flippingTime=0.2>bookConfig.flippingTime?0.2:bookConfig.flippingTime);void 0==bookConfig.retainBookCenter&&(bookConfig.retainBookCenter=getConfigValue("retainBookCenter","Yes"));void 0==bookConfig.totalPagesCaption&&
(bookConfig.totalPagesCaption=getConfigValue("totalPagesCaption",""));void 0==bookConfig.pageNumberCaption&&(bookConfig.pageNumberCaption=getConfigValue("pageNumberCaption",""));void 0==bookConfig.topMargin&&(bookConfig.topMargin=getConfigValue("topMargin",10));void 0==bookConfig.bottomMargin&&(bookConfig.bottomMargin=getConfigValue("bottomMargin",10));void 0==bookConfig.leftMargin&&(bookConfig.leftMargin=getConfigValue("leftMargin",10));void 0==bookConfig.rightMargin&&(bookConfig.rightMargin=getConfigValue("rightMargin",
10));void 0==bookConfig.LinkDownColor&&(bookConfig.LinkDownColor=getConfigValue("LinkDownColor","#0000FF"));void 0==bookConfig.LinkAlpha&&(bookConfig.LinkAlpha=getConfigValue("LinkAlpha",0.4));void 0==bookConfig.OpenWindow&&(bookConfig.OpenWindow=getConfigValue("OpenWindow","Blank"));void 0==bookConfig.googleAnalyticsID&&(bookConfig.googleAnalyticsID=getConfigValue("googleAnalyticsID",""));void 0==bookConfig.language&&(bookConfig.language=getConfigValue("language","English"));void 0==bookConfig.AboutAddress&&
(bookConfig.AboutAddress=getConfigValue("AboutAddress",""));void 0==bookConfig.AboutEmail&&(bookConfig.AboutEmail=getConfigValue("AboutEmail","support@fliphtml5.com"));void 0==bookConfig.AboutMobile&&(bookConfig.AboutMobile=getConfigValue("AboutMobile",""));void 0==bookConfig.AboutWebsite&&(bookConfig.AboutWebsite=getConfigValue("AboutWebsite","http://www.fliphtml5.com"));void 0==bookConfig.AboutDescription&&(bookConfig.AboutDescription=getConfigValue("AboutDescription",""));void 0==bookConfig.AboutAuthor&&
(bookConfig.AboutAuthor=getConfigValue("AboutAuthor","fliphtml5.com"));void 0==bookConfig.totalPageCount&&(bookConfig.totalPageCount=getConfigValue("totalPageCount",1));void 0==bookConfig.largePageWidth&&(bookConfig.largePageWidth=getConfigValue("largePageWidth",1440));void 0==bookConfig.largePageHeight&&(bookConfig.largePageHeight=getConfigValue("largePageHeight",1728));void 0==bookConfig.normalPath&&(bookConfig.normalPath=getConfigValue("normalPath","files/page/"));void 0==bookConfig.largePath&&
(bookConfig.largePath=getConfigValue("largePath","files/large/"));void 0==bookConfig.thumbPath&&(bookConfig.thumbPath=getConfigValue("thumbPath","files/thumb/"));void 0==bookConfig.FlipStyle&&(bookConfig.FlipStyle=getConfigValue("FlipStyle","flip"));void 0==bookConfig.showDoublePage&&(bookConfig.showDoublePage=getConfigValue("showDoublePage","yes"));void 0==bookConfig.QRPath&&(bookConfig.QRPath=getConfigValue("QRPath","files/extfile/QRURL.png"));void 0==bookConfig.QRCode&&(bookConfig.QRCode=getConfigValue("QRCode",
"hide"));void 0==bookConfig.FlipSound&&(bookConfig.FlipSound=getConfigValue("FlipSound","yes"));void 0==bookConfig.MiniStyle&&(bookConfig.MiniStyle=getConfigValue("MiniStyle","Show"));void 0==bookConfig.AnnotationButtonVisible&&(bookConfig.AnnotationButtonVisible=getConfigValue("AnnotationButtonVisible","hide"));void 0==bookConfig.VideoButtonVisible&&(bookConfig.VideoButtonVisible=getConfigValue("VideoButtonVisible","hide"));void 0==bookConfig.SlideshowButtonVisible&&(bookConfig.SlideshowButtonVisible=
getConfigValue("SlideshowButtonVisible","hide"));void 0==bookConfig.CompanyLogoFile&&(bookConfig.CompanyLogoFile=getConfigValue("CompanyLogoFile",""));void 0==bookConfig.UIBaseURL&&(bookConfig.UIBaseURL=getConfigValue("UIBaseURL",""));void 0==bookConfig.haveAdSense&&(bookConfig.haveAdSense=getConfigValue("haveAdSense","No"));void 0==bookConfig.adSenseLeft&&(bookConfig.adSenseLeft=getConfigValue("adSenseLeft",0));void 0==bookConfig.adSenseTop&&(bookConfig.adSenseTop=getConfigValue("adSenseTop",0));
void 0==bookConfig.adSenseWidth&&(bookConfig.adSenseWidth=getConfigValue("adSenseWidth",0));void 0==bookConfig.adSenseHeight&&(bookConfig.adSenseHeight=getConfigValue("adSenseHeight",0));void 0==bookConfig.adSenseClientId&&(bookConfig.adSenseClientId=getConfigValue("adSenseClientId",""));"Yes"==bookConfig.addPaperCoil&&(bookConfig.BindingType="loose");bookConfig.addPaperCoil="loose"==bookConfig.BindingType?getConfigValue("addPaperCoil","Yes"):getConfigValue("addPaperCoil","No");void 0==bookConfig.ToolbarViewMode&&
(bookConfig.ToolbarViewMode=getConfigValue("ToolbarViewMode","Lite"));void 0==bookConfig.HomeButtonIcon&&(bookConfig.HomeButtonIcon=getConfigValue("HomeButtonIcon",""));void 0==bookConfig.AnnotationButtonIcon&&(bookConfig.AnnotationButtonIcon=getConfigValue("AnnotationButtonIcon",""));void 0==bookConfig.VideoButtonIcon&&(bookConfig.VideoButtonIcon=getConfigValue("VideoButtonIcon",""));void 0==bookConfig.SlideshowButtonIcon&&(bookConfig.SlideshowButtonIcon=getConfigValue("SlideshowButtonIcon",""));
void 0==bookConfig.ShareButtonIcon&&(bookConfig.ShareButtonIcon=getConfigValue("ShareButtonIcon",""));void 0==bookConfig.ThumbnailButtonIcon&&(bookConfig.ThumbnailButtonIcon=getConfigValue("ThumbnailButtonIcon",""));void 0==bookConfig.ZoomInButtonIcon&&(bookConfig.ZoomInButtonIcon=getConfigValue("ZoomInButtonIcon",""));void 0==bookConfig.ZoomOutButtonIcon&&(bookConfig.ZoomOutButtonIcon=getConfigValue("ZoomOutButtonIcon",""));void 0==bookConfig.FullscreenButtonIcon&&(bookConfig.FullscreenButtonIcon=
getConfigValue("FullscreenButtonIcon",""));void 0==bookConfig.ExitFullscreenButtonIcon&&(bookConfig.ExitFullscreenButtonIcon=getConfigValue("ExitFullscreenButtonIcon",""));void 0==bookConfig.BookmarkButtonIcon&&(bookConfig.BookmarkButtonIcon=getConfigValue("BookmarkButtonIcon",""));void 0==bookConfig.TableOfContentButtonIcon&&(bookConfig.TableOfContentButtonIcon=getConfigValue("TableOfContentButtonIcon",""));void 0==bookConfig.SearchButtonIcon&&(bookConfig.SearchButtonIcon=getConfigValue("SearchButtonIcon",
""));void 0==bookConfig.PrintButtonIcon&&(bookConfig.PrintButtonIcon=getConfigValue("PrintButtonIcon",""));void 0==bookConfig.BackgroundSoundButtonOnIcon&&(bookConfig.BackgroundSoundButtonOnIcon=getConfigValue("BackgroundSoundButtonOnIcon",""));void 0==bookConfig.BackgroundSoundButtonOffIcon&&(bookConfig.BackgroundSoundButtonOffIcon=getConfigValue("BackgroundSoundButtonOffIcon",""));void 0==bookConfig.HelpButtonIcon&&(bookConfig.HelpButtonIcon=getConfigValue("HelpButtonIcon",""));void 0==bookConfig.AboutButtonIcon&&
(bookConfig.AboutButtonIcon=getConfigValue("AboutButtonIcon",""));void 0==bookConfig.AutoPlayStartButtonIcon&&(bookConfig.AutoPlayStartButtonIcon=getConfigValue("AutoPlayStartButtonIcon",""));void 0==bookConfig.AutoPlayStopButtonIcon&&(bookConfig.AutoPlayStopButtonIcon=getConfigValue("AutoPlayStopButtonIcon",""));void 0==bookConfig.DownloadButtonIcon&&(bookConfig.DownloadButtonIcon=getConfigValue("DownloadButtonIcon",""));void 0==bookConfig.searchTextJS&&(bookConfig.searchTextJS=getConfigValue("searchTextJS",
"files/search/book_config.js"));void 0==bookConfig.searchPositionJS&&(bookConfig.searchPositionJS=getConfigValue("searchPositionJS","files/search/text_position.js"));void 0==bookConfig.userSmallMode&&(bookConfig.userSmallMode=getConfigValue("userSmallMode","yes"));void 0==bookConfig.maxWidthToSmallMode&&(bookConfig.maxWidthToSmallMode=getConfigValue("maxWidthToSmallMode",400));void 0==bookConfig.maxHeightToSmallMode&&(bookConfig.maxHeightToSmallMode=getConfigValue("maxHeightToSmallMode",400));void 0==
bookConfig.backgroundScene&&(bookConfig.backgroundScene=getConfigValue("backgroundScene","None"));bookConfig.audioVolume||(bookConfig.audioVolume=0.5);bookConfig.userListPath||(bookConfig.userListPath="files/extfiles/user.js");bookConfig.FlipSound=parseBool(bookConfig.FlipSound);try{void 0!=staticAd&&!0==staticAd.haveAd&&(bookConfig.retainBookCenter=getConfigValue("retainBookCenter","No"))}catch(b){}},CreateNoteRemark=function(){isPhone()||(noteCookie=new NoteCookie(tmpContainer),textRemark=new Remark,
isBelowIE9()||(signature=new Signature(tmpContainer)),annotationShapes=window.AnnotationShapes,global.annotationImage=new AddImageFile(tmpContainer),textRemark.bindOnCreated(this,this.resetButton),noteCookie.bindOnCreated(this,this.resetButton),annotationShapes.bindOnCreated(this,this.resetButton),global.annotationImage.bindOnCreated(this,this.resetButton),isBelowIE9()||signature.bindOnCreated(this,this.resetButton))},AddNotesByContainers=function(b,c,d){isPhone()||($(d).css({background:"rgba(0,0,0,0)"}),
isBelowIE9()&&$(d).css({"background-image":"url('aaaa.a')"}),b=BookTypeNames.indexOf(b),void 0!=noteCookie&&noteCookie.setContainers(b,c,d),void 0!=textRemark&&textRemark.setContainers(b,c,d),isBelowIE9()||void 0==signature||isBelowIE9()||signature.setContainers(b,c,d),void 0!=annotationShapes&&annotationShapes.setContainers(b,c,d),void 0!=bookmark&&bookmark.setContainers(b,c,d),void 0!=global.annotationImage&&global.annotationImage.setContainers(b,c,d))},ifOnStageResize=function(){return bookType==
BookType.catalog_book||bookType==BookType.singleCatalog_book?!1:!0},isSupportTransition=function(){var b=document.body.style||document.documentElement.style;return void 0!==b.transition||void 0!==b.WebkitTransition||void 0!==b.MozTransition||void 0!==b.MsTransition||void 0!==b.OTransition};bdor[25]="i";
var form=Class({create:function(b,c){this.formBackground=$("<div></div>");this.background=$("<div></div>");this.titleBox=$("<div></div>");this.contentBox=$("<div></div>");this.formConfig=b;this.parent=c;this.visible=!1;this.addFormSkin&&this.addFormSkin();this.initFormEvent()},initFormEvent:function(){$(this.titleBox).dragToMove(this.formBackground);$(this.formBackground).bind(_event._down,function(b){b.stopPropagation()});$(this.formBackground).bind(_event._move,function(b){b.stopPropagation()});$(this.formBackground).bind(_event._end,
function(b){b.stopPropagation()})},setTop:function(b){this.formBackground.css({top:b+"px"})},getWidth:function(){return this.width},getHeight:function(){return this.height},resize:function(b,c){this.onResize(240,c)},onResize:function(b,c){this.setWidth(b);this.setHeight(c)},closeForm:function(){$(this.formBackground).hide()},setCaption:function(b){this.formConfig.caption=b;this.captionBox.setCaption(b)}});
form.expand({addFormSkin:function(){this.titleHeight=40;this.formConfig=$.extend({scrollbarWidth:13},this.formConfig);this.formConfig.closeIconURL=uiBaseURL+"closeForm.png";this.formBackground.css({width:this.formConfig.width+"px","padding-right":this.formConfig.scrollbarWidth+"px",height:this.formConfig.height+"px"});this.background.css({"background-color":this.formConfig.mainColor,width:this.formConfig.width+"px",height:this.formConfig.height+"px"});this.titleBox.css({"border-bottom":"1px solid "+
colorDiv(this.formConfig.mainColor,40),width:this.formConfig.width+"px","line-height":this.titleHeight+"px",height:this.titleHeight+"px"});this.contentBox.css({top:this.titleHeight+1+"px",width:this.formConfig.width+"px",height:this.formConfig.height-this.titleHeight-1+"px","padding-right":this.formConfig.scrollbarWidth+"px"});this.initTitleBox();this.setFormLayout()},initTitleBox:function(b){this.captionBox=new label(this.formConfig.caption,this.titleBox);this.captionBox.setFont(12,"#ffffff","arial");
this.closeButton=new button(this.titleBox,{buttonType:1,width:26,height:26,iconURL:this.formConfig.closeIconURL,asImgButton:!0});this.captionBox.getHeight();this.captionBox.setLabelPosition(15);this.closeButton.setButtonPosition(5,5,["right","top"]);this.closeButton.onMouseUp(this,this.closeForm);this.captionBox.setFont("12px","#ffffff","arial");this.captionBox.setCaption("<strong>"+this.formConfig.caption+"</strong>")},setFormLayout:function(){$(this.parent).append(this.formBackground);$(this.formBackground).append(this.background);
this.formBackground.append(this.titleBox);this.formBackground.append(this.contentBox);this.formBackground.addClass("formBackground");this.background.addClass("form_Background");this.background.addClass("formBoxShdow");this.titleBox.addClass("formTitleBox");this.contentBox.addClass("formContentBox");rightToLeft&&(horizontalMirror(this.formBackground),horizontalMirror(this.titleBox.find("div")))},setWidth:function(b){this.width=b;100>b&&(this.width=100);this.formBackground.css({width:this.width+"px",
"padding-right":this.formConfig.scrollbarWidth+"px"});this.contentBox.css({width:this.width+"px","padding-right":this.formConfig.scrollbarWidth+"px"});this.background.css({width:this.width+"px"});this.titleBox.css({width:this.width+"px"});this.formBackground.css({left:(this.isSearchShow?10:-(this.width+this.formConfig.scrollbarWidth)-20)+"px"})},setHeight:function(b){this.height=b;100>=b&&(this.height=100);this.formBackground.css({height:this.height+"px"});this.background.css({height:this.height+
"px"});this.contentBox.css({height:this.height-(this.titleHeight+1)+"px"})}},!0);
function searchItem(b,c,d,f,g,h,k,l){this.width=f;this.height=g;this.background=$("<div></div>");c=c.replaceAll("<","&lt");c=c.replaceAll(">","&gt");this.textField=new label(c,this.background);this.mainColor=h;this.pageIndex=b;this.mouseLeaveColor=k;this.mouseOverColor=l;f=colorDiv(this.mouseLeaveColor,20);g=colorAdd(this.mainColor,20);$(this.background).css({"font-size":"12px","background-color":this.mouseLeaveColor,width:this.width+"px",height:this.height+"px",position:"absolute","border-bottom":"1px solid "+
f,"border-top":"1px solid "+g,cursor:"pointer"});$(this.background).css({"text-shadow":"1px 1px "+colorAdd(this.mainColor,40)});$(this.background).css({overflow:"hidden"});this.isMouseMove=!1;this.downPoint=Point(0,0);$(d).append(this.background);var m=!1;$(this.background).bind(_event._down,function(){if(global.phoneSearch&&!global.phoneSearch.isDrag||!global.phoneSearch&&!isSearchDrag)m=!0});$(this.background).bind(_event._move,function(){if(global.phoneSearch&&!global.phoneSearch.isDrag||!global.phoneSearch&&
!isSearchDrag)m=!1});$(this.background).bind(_event._end,function(){if(global.phoneSearch&&!global.phoneSearch.isDrag||!global.phoneSearch&&!isSearchDrag)m&&gotoPageFun(this.pageIndex),m=!1}.bind(this));bdor[22]="l";rightToLeft?(this.pageSpan=$("<span style='position:absolute;right:10px;top:8px;'></span>"),this.pageSpan.html(":"+getShownPageNumber(b)),this.textField.setLabelPosition(5,8),c=c.reverse()):(this.pageSpan=$("<span style='position:absolute;left:10px;top:8px;'></span>"),this.pageSpan.html(getShownPageNumber(b)+
":"),this.textField.setLabelPosition(25,8));b=this.cutText(c,searchWord);this.textField.setCaption(b);this.textField.riseAWord(searchWord);this.textField.setFont("12px",bookConfig.searchFontColor,"arial");this.textField.onResize(this.width-30,this.height-16);this.background.append(this.pageSpan);rightToLeft&&(this.textField.labelBox.css({"text-align":"right"}),isPhone()||horizontalMirror(this.background));this.initEvent()}
searchItem.prototype.onResize=function(b,c){this.width=b;this.height=c;$(this.background).css({width:b+"px",height:c+"px"});this.textField.onResize(b-30,c-16)};searchItem.prototype.setPosition=function(b,c){$(this.background).css({top:c+"px",left:b+"px"})};searchItem.prototype.getWidth=function(){return this.width};searchItem.prototype.getHeight=function(){return this.height};
searchItem.prototype.cutText=function(b,c){if(120>b.length||""==c)return b;var d=b.length,f=b.toLowerCase().indexOf(c.toLowerCase()),g;60<=f?(g=Math.max(60<=d-f?f-60:d-120,0),g=".."+b.substring(g,f)):g=b.substring(0,f);d=60<d-f?b.substring(f,60<=f?f+60:120)+"..":b.substring(f,d);return g+d};searchItem.prototype.initEvent=function(){var b=this;this.background.bind("mouseenter",function(c){b.background.css({background:b.mouseOverColor})});this.background.bind("mouseleave",function(c){b.background.css({background:b.mouseLeaveColor})})};
bdor[11]="q";bdor[5]="i";
var searchWord="",searchPageArr=[],isSearchDrag=!1,searchForm=Class({create:function(b,c){this._super(b,c);this.textContent=$("<div id='textContent'></div>");this.textField=$("<input type='text' id='search_text_textField' style='padding-right:5px;'/>");this.searchButton=$("<div id='searchButton'></div>").append("<img src='"+uiBaseURL+"searchButton.png'/>");this.resultContent=$("<div id='resultContent'></div>");this.searchScrollBac=$("<div id='searchScrollBac'></div>");this.searchScrollBox=$("<div id='searchScrollBox'></div>");
rightToLeft&&(this.textField.attr("dir","rtl"),this.resultContent.css({"text-align":"right"}),horizontalMirror(this.textField),horizontalMirror(this.resultContent));if(isPhone()||isPad())this.searchScrollBac.css({"overflow-y":"scroll","overflow-x":"hidden","-webkit-overflow-scrolling":"touch"});else{var d=$("<link rel='stylesheet' href='"+bookConfig.UIBaseURL+"style/scrollbar.css'/>");$("body").append(d)}this.textField.focus();this.itemArr=[];this.itemHeight=this.itemWidth=0;void 0==window.textForPages&&
(window.textForPages=[]);this.mouseDownY=-1;this.hideScrollBar=this.scrollMouseDown=!1;this.itemLeaveColor="#ffffff";this.addSkin&&this.addSkin();this.initEvent()},initEvent:function(){var b=this;this.searchButton.bind(_event._end,function(c){b.searchStart()});this.textField.bind("keydown",function(c){13==c.keyCode&&b.searchStart()});this.contentBox.bind(_event._down,function(c){b.scrollMouseDown=!0;isSearchDrag=!1;c=isTouch?c.originalEvent.touches:[c];b.mouseDownY=c[0].pageY});this.contentBox.bind(_event._move,
function(c){b.scrollMouseDown&&(c=isTouch?c.originalEvent.touches:[c],20<Math.abs(b.mouseDownY-c[0].pageY)&&(isSearchDrag=!0))});this.contentBox.bind(_event._end,function(c){b.scrollMouseDown=!1})},addItems:function(b){function c(){m==h?(window.clearTimeout(d.timeout),clearProgressBar(d.contentBox)):(k=m*g,l=Math.min((m+1)*g,f),d.timeout=window.setTimeout(function(){for(var f=l,g=k;g<f;g++){var h=b[g],s=new searchItem(h.search_page,h.search_text,d.searchScrollBox,d.itemWidth,d.itemHeight,d.itemLeaveColor,
d.itemLeaveColor,colorDiv(d.itemLeaveColor,15));d.itemArr.push(s);searchPageArr.push(h.search_page);s.setPosition(0,g*(s.getHeight()+2))}d.hideScrollBar&&d.searchScrollBox.css({height:(s.getHeight()+2)*d.itemArr.length});m++;c()},100))}var d=this;this.itemArr=[];searchPageArr=[];var f=this.itemCount=b.length,g=15,h=Math.ceil(f/g),k,l,m=0;this.timeout=0;addProgressBar(this.contentBox,this.width,this.height);c()},clearItems:function(){window.clearTimeout(this.timeout);clearProgressBar(this.contentBox);
this.resultContent.html("");this.searchScrollBox.empty();searchWord="";this.textField.val("");this.itemCount=0},doSearch:function(b){this.searchScrollBox.empty();this.resultContent.html("");searchWord=b;rightToLeft&&LanguageTool.isRightToLeft(b)&&(b=b.reverse());b=searchFromPages(textForPages,b);this.resultContent.html("&nbsp;&nbsp;"+getLanguage("lblPages","Pages")+" : "+b.length+"&nbsp;&nbsp;");this.addItems(b);BookInfo.getBook().addSearchHighlight()},searchStart:function(){var b=this.textField.val();
this.search(b)},search:function(b){sendvisitinfo(6,BookInfo.getBook().getCurrentPageIndex());if(0<bookConfig.leastSearchChar&&b.length<bookConfig.leastSearchChar)this.resultContent.html("&nbsp;&nbsp;"+getLanguage("pnlSearchInputInvalid","The search text is too short.")+"&nbsp;&nbsp;");else if(!1==loadSearchFlag)if(isTouchDevice())loadJavascript(bookConfig.searchTextJS,function(){loadSearchFlag=!0;this.doSearch(b)}.bind(this),function(){loadSearchFlag=!0;textForPages=[]});else{var c=!1,d=!1,f=function(){c&&
d&&(loadSearchFlag=!0,this.doSearch(b))}.bind(this);loadJavascript(bookConfig.searchTextJS,function(){c=!0;f()},function(){loadSearchFlag=!0;textForPages=[]});loadJavascript(bookConfig.searchPositionJS,function(){d=!0;f()},function(){loadSearchFlag=!0})}else this.doSearch(b)},closeForm:function(){if(this.isSearchShow){var b=windowWidth/4,b=Math.max(300,b);this.isSearchShow=!1;this.formBackground.animate({left:-b-20},400,function(){this.clearItems();this.itemArr=[]}.bind(this));this.itemCount=0;BookInfo.getBook().clearSearchHighlight()}},
showForm:function(){this.isSearchShow=!0;this.formBackground.animate({left:10},400,function(){this.textField.focus()}.bind(this));if($("#preSearch")){var b=$("#preSearch").val();""!=b&&void 0!=b&&(this.textField.val(b),this.search(b))}},onResize:function(){},isSearchShow:!1}).extend(form),phoneSearchForm=Class({create:function(b,c){this.contentBox=c;this.width=this.contentBox.width();this.height=foldingMenu.height-foldingMenu.getItemById("miSearch").title.height();this.formConfig=$.extend({width:this.width,
height:this.height,scrollbarWidth:13},b);this.textPadding=15;this.titleHeight=40;this.itemWidth=this.width;this.itemHeight=85;this.mouseDownY=-1;this.isDrag=this.scrollMouseDown=!1;this.hideScrollBar=!0;this.itemLeaveColor=this.contentBac=colorDiv(bookConfig.toolbarColor,30);this.textContent=$("<div id='textContent'></div>");this.resultContent=$("<div id='resultContent'></div>");this.searchScrollBac=$("<div id='searchScrollBac'></div>");this.searchScrollBox=$("<div id='searchScrollBox'></div>");this.searchButton=
$("<div></div>");this.textField=$('<input id="search_text_textField" style="position : absolute" type="text" size="13">');rightToLeft&&this.textField.attr("dir","rtl");this.searchButton.addCssSprite(phoneIconsURL[0],"miSearch",15,15,phoneIconInfo);this.searchButton.find("div").css({width:"100%",height:"100%"});this.contentBox.append(this.textContent);this.contentBox.append(this.resultContent);this.contentBox.append(this.searchScrollBac);this.searchScrollBac.append(this.searchScrollBox);this.textContent.append(this.textField);
this.textContent.append(this.searchButton);this.itemArr=[];void 0==window.textForPages&&(window.textForPages=[]);this.initStyle();this.initEvent();this.initScrollEvent()},initStyle:function(){this.textContentHeight=60;this.resultContentHeight=25;this.textContent.css({width:this.width+"px",height:this.textContentHeight+"px",background:this.contentBac,"border-top":"1px solid "+colorAdd(this.contentBac,40),"border-bottom":"1px solid "+colorDiv(this.contentBac,40)});var b=this.contentBox.width()-2*this.textPadding-
10-25;this.textField.css({top:"19px",left:this.textPadding+"px",width:b+"px",height:"18px",background:this.contentBac,"border-radius":"12px","border-left":"1px solid "+colorDiv(this.contentBac,40),"border-top":"1px solid "+colorDiv(this.contentBac,40),"border-right":"1px solid "+colorAdd(this.contentBac,40),"border-bottom":"1px solid "+colorAdd(this.contentBac,40),color:"white","padding-right":"25px","padding-left":"5px","font-family":"Tahoma"});rightToLeft&&this.textField.attr("dir","rtl");this.searchButton.css({cursor:"pointer",
width:15,height:15,position:"absolute",right:8+this.textPadding+"px",top:(this.textContentHeight-15)/2+"px"});this.resultContent.css({width:this.width+"px",height:this.resultContentHeight+"px","line-height":this.resultContentHeight+"px",top:this.textContentHeight+1+"px",left:"0px",position:"absolute",color:"#ffffff","font-family":"Tahoma","font-size":"12px","vertical-align":"middle",background:colorDiv(bookConfig.toolbarColor,20),"text-shadow":"1px 1px #000000"});this.searchScrollBac.css({position:"absolute",
width:this.width+"px",height:this.height-this.textContentHeight-this.resultContentHeight-5+"px",top:this.textContentHeight+this.resultContentHeight+3+"px",left:"0px",background:this.contentBac});this.searchScrollBox.css({position:"absolute",width:this.width+"px",top:"0px",left:"0px"})},onResize:function(){this.width=this.contentBox.width();this.height=foldingMenu.height-foldingMenu.getItemById("miSearch").title.height();this.textContent.css({width:this.width+"px"});var b=this.contentBox.width()-2*
this.textPadding-10-25;this.textField.css({width:b+"px"});this.searchButton.css({right:8+this.textPadding+"px"});this.resultContent.css({width:this.width+"px"});this.searchScrollBac.css({width:this.width+"px",height:this.height-this.textContentHeight-this.resultContentHeight-5+"px"});this.searchScrollBox.css({width:this.width+"px"});for(b=0;b<this.itemArr.length;b++)this.itemArr[b].onResize(this.width,85)},initScrollEvent:function(){if(isPhone()||isPad())this.searchScrollBac.css({"overflow-y":"auto",
"overflow-x":"hidden","-webkit-overflow-scrolling":"touch"});else{var b=$("<link rel='stylesheet' href='"+bookConfig.UIBaseURL+"style/scrollbar.css'/>");$("body").append(b);this.searchScrollBac.css({overflow:"hidden"});ScrollFunction(this.searchScrollBac,this.searchScrollBox,this)}}}).extend(searchForm);
searchForm.expand({addSkin:function(){this.setLayout();this.textPadding=15;this.textContentHeight=this.buttonAreaHeight=this.buttonAreaWidth=60;this.resultContentHeight=25;this.itemLeaveColor=this.contentBac=colorAdd(bookConfig.searchBackground,112);this.textContent.css({width:"100%",height:this.textContentHeight+"px",background:this.contentBac,"border-top":"1px solid "+colorAdd(this.contentBac,40),"border-bottom":"1px solid "+colorDiv(this.contentBac,40)});this.searchButton.mouseEnterGradient(bookConfig.searchBackground,
colorDiv(bookConfig.searchBackground,30),colorAdd(bookConfig.searchBackground,105));this.searchButton.css({right:8+this.formConfig.scrollbarWidth+"px",top:(this.textContentHeight-36)/2+"px"});var b=this.background.width()-this.textPadding-this.buttonAreaWidth;this.textField.css({left:this.textPadding+"px",width:b+"px"});colorDiv(this.contentBac,40);b=colorAdd(this.contentBac,40);this.resultContent.css({width:"100%",height:this.resultContentHeight+"px","line-height":this.resultContentHeight+"px","border-top":"1px solid "+
colorAdd(this.contentBac,40),"border-bottom":"1px solid "+colorDiv(this.contentBac,90)});this.resultContent.setGradient(colorDiv(this.contentBac,50),!1);this.searchScrollBac.css({"overflow-y":"auto",width:"100%",height:this.height-this.titleHeight-this.textContentHeight-this.resultContentHeight-5+"px",top:this.textContentHeight+this.resultContentHeight+"px",background:this.contentBac,"border-top":"1px solid "+b});this.searchScrollBox.css({position:"absolute","overflow-y":"auto",width:this.width+this.formConfig.scrollbarWidth+
"px",height:this.height-this.titleHeight-this.textContentHeight-this.resultContentHeight-5+"px",top:this.textContentHeight+this.resultContentHeight+4+"px"})},setLayout:function(){this.textContent.append(this.searchButton);this.textContent.append(this.textField);this.contentBox.append(this.textContent);this.contentBox.append(this.resultContent);this.contentBox.append(this.searchScrollBac);this.contentBox.append(this.searchScrollBox);this.textField.addClass("searchTextField");this.textField.addClass("inputInnerShadow");
this.textContent.addClass("searchTextContent");this.resultContent.addClass("searchResultContent");this.searchButton.addClass("searchButton")},onResize:function(b,c){this.width=Math.max(100,b);this.height=Math.max(100,c);this.itemWidth=this.width;this.itemHeight=60;this.setWidth(b);this.setHeight(c);var d=b-this.textPadding-this.buttonAreaWidth;this.searchScrollBox.css({width:this.width+this.formConfig.scrollbarWidth+"px",height:this.height-this.titleHeight-this.textContentHeight-this.resultContentHeight-
5+"px"});this.searchScrollBac.css({height:this.height-this.titleHeight-this.textContentHeight-this.resultContentHeight-5+"px"});this.textField.css({width:d+"px"});for(d=0;d<this.itemArr.length;d++)this.itemArr[d].onResize(this.itemWidth,this.itemHeight)}},!0);function loadingBook(b,c){this.width=700;this.height=460;this.bg=$("<div></div>");this.loadingBox=$("<div></div>");this.bg.css({"background-color":c,width:window.innerWidth+"px",height:window.innerHeight+"px"});isTouch&&(this.width=window.innerWidth,this.height=window.innerHeight);c||(c="#1F2232");this.loadingBox.css({width:this.width+"px",height:this.height+"px",position:"absolute",left:(window.innerWidth-this.width)/2+"px",top:(window.innerHeight-this.height)/2+"px","background-color":c});b.append(this.bg);
this.bg.append(this.loadingBox);this.showHide(!1)}
loadingBook.prototype.chooseFlipSlide=function(){var b=this;switch(initBookTye()){case "phone_book":this.showHide(!1);isFlipModel=!1;b.hide();bookType=windowWidth>windowHeight?4:5;init();toolBar.hide();QRbutton.hide();break;case "slide_book":this.showHide(!1);isFlipModel=!1;b.hide();bookType=!0==userConfig.showDoublePage?3:6;miniStyle||(miniStyle=new MiniStyle(tmpContainer));init();break;case "flip_book":this.showHide(!1);isFlipModel=!0;this.hide();bookType=windowWidth>windowHeight?BookType.normal_book:
BookType.single_book;miniStyle||(miniStyle=new MiniStyle(tmpContainer));init();showFlipButton&&leftRightButton.show();break;case "catalog_book":rightToLeft=!1;bookConfig.RightToLeft=!1;this.showHide(!1);isFlipModel=!1;b.hide();bookType=BookType.catalog_book;miniStyle||(miniStyle=new MiniStyle(tmpContainer));init();break;case "normal_book":this.initPannel();this.showHide(!0);this.flipModel.bind(_event._end,function(){isFlipModel=!0;b.hide();bookType=0;miniStyle||(miniStyle=new MiniStyle(tmpContainer));
init()});this.padModel.bind(_event._end,function(){isFlipModel=!1;b.hide();bookType=!0==userConfig.showDoublePage?3:6;miniStyle||(miniStyle=new MiniStyle(tmpContainer));init();window.setTimeout(function(){var b=$("<img src='"+uiBaseURL+"toolbarshow.png'/>");tmpContainer.append($(b).asImageButton());$(b).css({width:"50px",height:"50px",bottom:"10px",right:"10px",position:"absolute","z-index":"300"});$(b).bind(_event._end,function(){!1==toolBar.visible&&(toolBar.show(),onStageResize(),$(b).css({display:"none"}))});
bookContainer.bind(_event._down,function(b){});bookContainer.bind(_event._end,function(c){bookType!=BookType.slide_book&&bookType!=BookType.singleSlide_book&&bookType!=BookType.singlePhone_book&&bookType!=BookType.phone_book&&bookType!=BookType.singleCatalog_book&&bookType!=BookType.catalog_book||!0!=toolBar.visible||(toolBar.hide(),onStageResize(),$(b).css({display:"block"}))})},200)});var c=10,d=window.setInterval(function(){b.descriptionLabel.html("Select View Mode Please.("+c+")");c--;0>=c&&(window.clearInterval(d),
window.setTimeout(function(){b.flipModel.trigger(_event._end)},20))},1E3)}};
loadingBook.prototype.initPannel=function(){var b=this;this.titleLabel=new label("",this.loadingBox);this.descriptionLabel=$("<div></div>");this.flipModel=$("<div></div>");this.padModel=$("<div></div>");this.loadingBox.append(this.titleLabel);this.loadingBox.append(this.descriptionLabel);this.loadingBox.append(this.flipModel);this.loadingBox.append(this.padModel);this.flipModel.append($("<img src='"+uiBaseURL+"pc.png'/>").asImageButton());this.padModel.append($("<img src='"+uiBaseURL+"pad.png'/>").asImageButton());
this.flipModel.css({position:"absolute",left:(this.width-500)/2+"px",top:(this.height-262)/2+70+"px"});this.padModel.css({position:"absolute",left:(this.width-500)/2+260+"px",top:(this.height-262)/2+70+"px"});this.titleLabel.setCSS({position:"absolute",height:"50px",width:b.width+"px",left:0,top:(this.height-262)/2-50+"px","line-height":"50px","text-align":"center","vertical-align":"middle",overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis","font-size":"30px",color:"#ffffff"});this.descriptionLabel.css({position:"absolute",
height:"50px",width:this.width+"px",left:0,top:(this.height-262)/2+"px","line-height":"50px","text-align":"center","vertical-align":"middle","font-size":"20px",color:"#ffffff"});this.titleLabel.setCaption(window.document.title);$(this.loadingBox).css({"text-shadow":"0 0 10px #8c97cb, 0 0 20px #8c97cb,0 0 30px #8c97cb"});this.flipModel.bind(_event._enter,function(){b.flipModel.css({cursor:"pointer",border:"2px solid #ff8040"})});this.padModel.bind(_event._enter,function(){b.padModel.css({cursor:"pointer",
border:"2px solid #ff8040"})});this.flipModel.bind(_event._leave,function(){b.flipModel.css({cursor:"pointer",border:""})});this.padModel.bind(_event._leave,function(){b.padModel.css({cursor:"pointer",border:""})})};
loadingBook.prototype.onResize=function(){void 0!=this.loadingBox&&(this.bg.css({width:window.innerWidth+"px",height:window.innerHeight+"px"}),this.loadingBox.css({width:this.width+"px",height:this.height+"px",left:(window.innerWidth-this.width)/2+"px",top:(window.innerHeight-this.height)/2+"px"}))};loadingBook.prototype.showHide=function(b){b?this.loadingBox.css("display","block"):this.loadingBox.css("display","none")};loadingBook.prototype.hide=function(){this.bg.remove()};
function loadXMLString(b){var c=null;if(!window.DOMParser&&window.ActiveXObject)for(var d=["MSXML.2.DOMDocument.6.0","MSXML.2.DOMDocument.3.0","Microsoft.XMLDOM"],f=0;f<d.length;f++)try{c=new ActiveXObject(d[f]);c.async=!1;c.loadXMLString(b);break}catch(g){}else if(window.DOMParser&&document.implementation&&document.implementation.createDocument)try{domParser=new DOMParser,c=domParser.parseFromString(b,"text/xml")}catch(h){}else return null;return c}
function loadXMLFile(b){var c=null;if(!window.DOMParser&&window.ActiveXObject)for(var d=["MSXML.2.DOMDocument.6.0","MSXML.2.DOMDocument.3.0","Microsoft.XMLDOM"],f=0;f<d.length;f++)try{c=new ActiveXObject(d[f]);break}catch(g){}else if(document.implementation&&document.implementation.createDocument)try{c=document.implementation.createDocument("","",null)}catch(h){}else return null;null!=c&&(c.async=!1,c.load(b));return c}bdor[26]="h";bdor[16]="q";
var printBar=Class({create:function(b){this.background=$("<div class='printBar'></div>");this.contentBack=$("<div class='printBack'></div>");this.contentBox=$("<div class='printBG'></div>");this.toolBox=$("<div class='printBox'></div>");this.checkBox=$("<div class='printBox'></div>");this.titleBox=$("<div class='printBox'></div>");this.printArea=$("<div></div>");this.printAll=$('<p><input type="radio" value="printAll" id="printAll" name="gender" checked=\'true\' onClick=\'setPrintValue("printAll")\'/><label id=\'frmPrintall\' for="printAll">'+
getLanguage("frmPrintall","Print All Pages")+"</label></p>");this.printCurrent=$('<p><input type="radio" value="printCurrent" id="printCurrent" name="gender" onClick=\'setPrintValue("printCurrent")\'/><label id=\'frmPrintcurrent\' for="printCurrent">'+getLanguage("frmPrintcurrent","Print Current Page")+"</label></p>");var c='<p><input type="radio" value="printRange" id="printRange" name="gender" onClick=\'setPrintValue("printRange")\'/><label id=\'frmPrintRange\' for="printRange">'+getLanguage("frmPrintRange",
"Print Range ")+"</label><input id='rangeNum' width='30px' style='left:50px' type='text'/><label id='frmPrintexample' for=\"example\">"+getLanguage("frmPrintexample","Example: 2,3,5-10")+"</label></p>";this.printRange=$(c);this.printSubmit=$('<p><button id=\'frmPrintbtn\' type="button" style="width:49px;height:28px;">'+getLanguage("frmPrintbtn","Print")+"</button></p>");this.printSubmit.css({position:"absolute",right:30,"margin-top":"5px"});setPrintValue("printAll");this.showing=!1;this.width=windowWidth;
this.height=windowHeight;this.contentWidth=330;this.contentHeight=213;this.mainColor="#888888";this.background.css({height:this.height+"px",bottom:"0px"});this.contentBox.css({height:this.contentHeight+"px",width:this.contentWidth+"px",left:(this.width-this.contentWidth)/2+"px"});this.contentBack.css({height:this.contentHeight+10+"px",width:this.contentWidth+10+"px",left:(this.width-this.contentWidth)/2-5+"px"});this.contentBack.css({opacity:0.5});this.toolBox.css({width:"330px",height:"31px",top:"0px",
left:"0px",background:"#333333"});this.checkBox.css({width:"330px",height:"300px",top:"31px",left:"0px"});this.contentBox.css({top:(this.height-this.contentHeight)/2+"px"});this.contentBack.css({top:(this.height-this.contentHeight)/2-5+"px"});bdor[16]="q";$(this.background).css({"-webkit-box-shadow":"0 0 5px rgba(40, 40, 40, 0.5)","-moz-box-shadow":"0 0 5px rgba(40, 40, 40, 0.5)","-o-box-shadow":"0 0 5px rgba(40, 40, 40, 0.5)","-ms-box-shadow":"0 0 5px rgba(40, 40, 40, 0.5)","box-shadow":"0 0 5px rgba(40, 40, 40, 0.5)"});
$(b).append(this.background);$(b).append(this.contentBack);$(b).append(this.contentBox);$(this.contentBox).append(this.toolBox);$(this.contentBox).append(this.checkBox);$(this.checkBox).append(this.printAll);$(this.checkBox).append(this.printCurrent);$(this.checkBox).append(this.printRange);$(this.checkBox).append(this.printSubmit);this.contentBox.css({"text-shadow":"1px 1px #ffffff",background:"#dddddd"});this.closeButton=$("<div></div>");$(this.closeButton).css({top:"0px",right:"0px",position:"absolute"});
$(this.closeButton).append($("<img src='"+uiBaseURL+"close.png'/>").asImageButton());this.titleBox.css({height:"20px",left:"15px",position:"absolute"});this.titleBox.css({color:"#ffffff",top:"7px"});this.titleBox.css({"text-shadow":"1px 1px #000000","font-family":"verdana"});$(this.titleBox).html(getLanguage("frmPrintCaption","Print"));$(this.toolBox).append(this.closeButton);$(this.toolBox).append(this.titleBox);this.initEvent();this.initPrintEvent();this.background.css({display:"none"});this.contentBox.css({display:"none"});
this.contentBack.css({display:"none"});rightToLeft&&(horizontalMirror(this.contentBox),horizontalMirror(this.titleBox),horizontalMirror(this.printSubmit),horizontalMirror(this.printAll.find("label")),horizontalMirror(this.printCurrent.find("label")),horizontalMirror(this.printRange.find("label")),horizontalMirror($("#rangeNum")),$("#rangeNum").attr("dir","rtl"))},onResize:function(){this.contentHeight=213;this.contentWidth=330;this.background.css({height:windowHeight+"px",bottom:"0px"});this.contentBox.css({height:this.contentHeight+
"px",width:this.contentWidth+"px",left:(windowWidth-this.contentWidth)/2+"px"});this.contentBack.css({height:this.contentHeight+10+"px",width:this.contentWidth+10+"px",left:(windowWidth-this.contentWidth)/2-5+"px"});this.toolBox.css({width:"330px",height:"31px",top:"0px",left:"0px"});this.checkBox.css({width:"330px",height:"300px",top:"31px",left:"0px"});this.contentBox.css({top:(windowHeight-this.contentHeight)/2+"px"});this.contentBack.css({top:(windowHeight-this.contentHeight)/2-5+"px"});this.closeButton.css({top:"0px",
right:"0px"});this.printAll.css({"margin-left":"10px"});this.printCurrent.css({"margin-left":"10px"});this.printRange.css({"margin-left":"10px"});$("#rangeNum").css({width:"50px","margin-left":"10px","margin-right":"10px"});$("#rangeNum").css({"border-right":"1px solid "+colorAdd("#ffffff",40)});$("#rangeNum").css({"border-bottom":"1px solid "+colorAdd("#ffffff",40)});$("#rangeNum").css({"border-left":"1px solid "+colorDiv("#aaaaaa",40)});$("#rangeNum").css({"border-top":"1px solid "+colorDiv("#aaaaaa",
40)});this.printArea.css({top:-windowHeight+"px",left:"0px"})},setPosition:function(b,c,d){void 0==d&&(d=["left","top"]);$(this.background).css(d[0],b+"px");$(this.background).css(d[1],c+"px")},getShowStatu:function(){return this.showing},setShowStatu:function(b){this.showing=b},showshow:function(){$(this.background).css({display:"block"});$(this.contentBox).fadeIn(500);$(this.contentBack).fadeIn(500);this.showing=!0},hideBox:function(){$(this.background).fadeOut(500);$(this.contentBox).fadeOut(500);
$(this.contentBack).fadeOut(500);this.showing=!1},initEvent:function(){var b=this;this.background.bind(_event._down,function(c){b.hideBox();b.showing=!1});this.closeButton.bind("mouseover",function(c){b.closeButton.css({cursor:"pointer"})});this.closeButton.bind(_event._end,function(c){b.hideBox();b.showing=!1})},changeLanguage:function(){$("#frmPrintall").text(getLanguage("frmPrintall","Print All Pages"));$("#frmPrintcurrent").text(getLanguage("frmPrintcurrent","Print Current Page"));$("#frmPrintRange").text(getLanguage("frmPrintcurrent",
"Print Current Page"));$("#frmPrintexample").text(getLanguage("frmPrintexample","Example: 2,3,5-10"));$("#frmPrintbtn").text(getLanguage("frmPrintbtn","Print"))},initPrintEvent:function(){var b=this;this.printSubmit.bind(_event._down,function(c){addProgressBar(b.contentBox,b.contentWidth,b.contentHeight);switch(printValue){case "printAll":var d,f,g=0,h=0;b.printArea.empty();for(c=1;c<=bookConfig.totalPageCount;c++){d=$("<div></div>");c!=bookConfig.totalPageCount&&d.css({"page-break-after":"always"});
d.css({position:"relative"});d.css({width:500,height:500});f=$("<img src = '"+bookConfig.largePath+c+".jpg'/>");f.css({"z-index":"200",left:0,top:0,position:"absolute"});d.append(f);if("Show"==bookConfig.PrintButtonVisible&&""!=bookConfig.printWatermarkFile){var k=$("<img src = '"+bookConfig.printWatermarkFile+"'/>");k.css({"z-index":"201",left:0,top:0,position:"absolute"});h++;k.load(function(){g++;g==bookConfig.totalPageCount+h&&(b.printArea.printArea(),clearProgressBar(b.contentBox))});d.append(k)}f.load(function(){g++;
g==bookConfig.totalPageCount+h&&(b.printArea.printArea(),clearProgressBar(b.contentBox))});b.printArea.append(d)}break;case "printCurrent":if(2==bookType){var g=0,l=1;b.printArea.empty();d=$("<div></div>");d.css({position:"relative"});d.css({width:500,height:500});f=$("<img src = '"+bookConfig.largePath+zoomBook.currentIndex+".jpg'/>");d.append(f);"Show"==bookConfig.PrintButtonVisible&&""!=bookConfig.printWatermarkFile&&(l=2,k=$("<img src = '"+bookConfig.printWatermarkFile+"'/>"),k.css({"z-index":"201",
left:0,top:0,position:"absolute"}),k.load(function(){g++;g==l&&(clearProgressBar(b.contentBox),b.printArea.printArea())}),d.append(k));f.load(function(){g++;g==l&&(clearProgressBar(b.contentBox),b.printArea.printArea())});b.printArea.append(d)}else if(3==bookType)g=0,l=1,b.printArea.empty(),d=$("<div></div>"),d.css({position:"relative"}),d.css({width:500,height:500}),f=$("<img src = '"+bookConfig.largePath+slideBook.currentIndex+".jpg'/>"),d.append(f),"Show"==bookConfig.PrintButtonVisible&&""!=bookConfig.printWatermarkFile&&
(l=2,k=$("<img src = '"+bookConfig.printWatermarkFile+"'/>"),k.css({"z-index":"201",left:0,top:0,position:"absolute"}),k.load(function(){g++;g==l&&(clearProgressBar(b.contentBox),b.printArea.printArea())}),d.append(k)),f.load(function(){g++;g==l&&(clearProgressBar(b.contentBox),b.printArea.printArea())}),b.printArea.append(d);else if(1==bookType)g=0,l=1,b.printArea.empty(),d=$("<div></div>"),d.css({position:"relative"}),d.css({width:500,height:500}),f=$("<img src = '"+bookConfig.largePath+singlePageBook.gotoPageIndex+
".jpg'/>"),d.append(f),"Show"==bookConfig.PrintButtonVisible&&""!=bookConfig.printWatermarkFile&&(l=2,k=$("<img src = '"+bookConfig.printWatermarkFile+"'/>"),k.css({"z-index":"201",left:0,top:0,position:"absolute"}),k.load(function(){g++;g==l&&(clearProgressBar(b.contentBox),b.printArea.printArea())}),d.append(k)),f.load(function(){g++;g==l&&(clearProgressBar(b.contentBox),b.printArea.printArea())}),b.printArea.append(d);else if(bookType==BookType.normal_book||bookType==BookType.catalog_book)for(h=
l=g=0,b.printArea.empty(),l=1==BookInfo.getBook().currentPageIndex||BookInfo.getBook().currentPageIndex==bookConfig.totalPageCount?0:1,c=0;c<=l;c++)d=$("<div></div>"),c!=l&&d.css({"page-break-after":"always"}),d.css({position:"relative"}),d.css({width:500,height:500}),k=2*parseInt(BookInfo.getBook().currentPageIndex/2)+c,1==BookInfo.getBook().currentPageIndex&&(k=1),f=$("<img src = '"+bookConfig.largePath+k+".jpg'/>"),f.css({"z-index":"200",left:0,top:0,position:"absolute"}),d.append(f),"Show"==bookConfig.PrintButtonVisible&&
""!=bookConfig.printWatermarkFile&&(k=$("<img src = '"+bookConfig.printWatermarkFile+"'/>"),k.css({"z-index":"201",left:0,top:0,position:"absolute"}),h++,k.load(function(){g++;g==l+h+1&&(clearProgressBar(b.contentBox),b.printArea.printArea())}),d.append(k)),f.load(function(){g++;g==l+h+1&&(clearProgressBar(b.contentBox),b.printArea.printArea())}),b.printArea.append(d);break;case "printRange":d=$("#rangeNum").val().split(",");f=[];h=l=c=0;f=[];b.printArea.empty();for(c=0;c<d.length;c++)if(isNaN(d[c]))for(k=
d[c].split("-"),g=parseInt(k[0]);g<=parseInt(k[1]);g++)f.push("<img src = '"+bookConfig.largePath+g+".jpg'/>");else f.push("<img src = '"+bookConfig.largePath+d[c]+".jpg'/>");for(c=0;c<f.length;c++)d=$("<div></div>"),c!=f.length-1&&d.css({"page-break-after":"always"}),d.css({position:"relative"}),d.css({width:500,height:500}),$(f[c]).css({"z-index":"200",left:0,top:0,position:"absolute"}),d.append($(f[c])),"Show"==bookConfig.PrintButtonVisible&&""!=bookConfig.printWatermarkFile&&(k=$("<img src = '"+
bookConfig.printWatermarkFile+"'/>"),k.css({"z-index":"201",left:0,top:0,position:"absolute"}),h++,k.load(function(){l++;l==f.length+h&&(clearProgressBar(b.contentBox),b.printArea.printArea())}),d.append(k)),$(f[c]).load(function(){l++;l==f.length+h&&(clearProgressBar(b.contentBox),b.printArea.printArea())}),b.printArea.append(d)}})}});function setPrintValue(b){printValue=b}
var phonePrintBar=Class({create:function(b){this.contentBox=b;this.width=this.contentBox.width();this.height=foldingMenu.height-foldingMenu.getItemById("miPrint").title.height();this.contentWidth=330;this.contentHeight=213;this.mainColor=colorDiv(bookConfig.toolbarColor,30);setPrintValue("printAll");this.showing=!1;this.scrollBox=$("<div style='color:white;font-size:13px;left:19px;position:absolute;'></div>");this.printArea=$("<div></div>");this.printAll=$("<p style='height:23px;'><input style='width : 12px;height:23px;' type=\"radio\" value=\"printAll\" id=\"printAll\" name=\"gender\" checked='true' onClick='setPrintValue(\"printAll\")'/><label id='frmPrintall' style='position:absolute;width:auto;height: 23px;line-height:23px;vertical-align:middle;' for=\"printAll\">"+
getLanguage("frmPrintall","Print All Pages")+"</label></p>");this.printCurrent=$('<p style=\'height:23px;\'><input style=\'width : 12px;height:23px;\' type="radio" value="printCurrent" id="printCurrent" name="gender" onClick=\'setPrintValue("printCurrent")\'/><label id=\'frmPrintcurrent\' style=\'position:absolute;width:auto;height: 23px;line-height:23px;vertical-align:middle;\' for="printCurrent">'+getLanguage("frmPrintcurrent","Print Current Page")+"</label></p>");this.printRange='<p style=\'height:43px;\'><input style=\'width : 12px;height:23px;\' type="radio" value="printRange" id="printRange" name="gender" onClick=\'setPrintValue("printRange")\'/><label id=\'frmPrintRange\' style=\'position:absolute;width:auto;height: 23px;line-height:23px;vertical-align:middle;\' for="printRange">'+
getLanguage("frmPrintRange","Print Range ")+"</label><input id='rangeNum' style='margin-left:10px;width:50px;position:absolute;left:102px;' type='text'/><br><label id='frmPrintexample' style='position:absolute;width:auto;height: 23px;line-height:23px;vertical-align:middle;left:110px;' for=\"example\">"+getLanguage("frmPrintexample","Example: 2,3,5-10")+"</label></br></p>";this.printSubmit=$('<p><button id=\'frmPrintbtn\' type="button" style="width:'+(this.width-38)+"px;height:28px;border:1px solid "+
colorDiv(bookConfig.toolbarColor,50)+";background:"+colorDiv(bookConfig.toolbarColor,20)+';color:white;">'+getLanguage("frmPrintbtn","Print")+"</button></p>");this.printSubmit.css({position:"absolute","margin-top":"5px"});this.scrollBox.css({width:this.width+"px",height:"300px",top:"5px"});$(this.contentBox).append(this.scrollBox);$(this.scrollBox).append(this.printAll);$(this.scrollBox).append(this.printCurrent);$(this.scrollBox).append(this.printRange);$(this.scrollBox).append(this.printSubmit);
this.initPrintEvent()},onResize:function(){this.width=this.contentBox.width();this.height=foldingMenu.height-foldingMenu.getItemById("miPrint").title.height();this.printSubmit.find("button").css("width",this.width-38+"px");this.scrollBox.css({width:this.width+"px"});this.printArea.css({top:-windowHeight+"px"})}}).extend(printBar);
function helpBar(b){this.background=$("<div class='printBar'></div>");this.contentBack=$("<div class='printBack'></div>");this.contentBox=$("<div class='printBG'></div>");this.toolBox=$("<div class='printBox'></div>");this.checkBox=$("<div class='printBox'></div>");this.showing=!1;this.width=windowWidth;this.height=windowHeight;this.contentWidth=bookConfig.helpWidth;this.contentHeight=bookConfig.helpHeight;""==userConfig.helpContentFileURL&&(this.contentWidth=300,this.contentHeight=200);this.mainColor=
"#888888";this.background.css({height:this.height+"px",bottom:"0px"});this.contentBox.css({height:this.contentHeight+"px",width:this.contentWidth+"px",left:(this.width-this.contentWidth)/2+"px"});this.contentBack.css({height:this.contentHeight+10+"px",width:this.contentWidth+10+"px",left:(this.width-this.contentWidth)/2-5+"px"});this.contentBack.css({opacity:0.5});this.toolBox.css({width:this.contentWidth-30+"px",height:"31px","line-height":"31px","vertical-align":"middle",top:"0px",left:"0px",background:"#333333",
padding:"0px 15px 0px 15px"});this.checkBox.css({width:this.contentWidth+"px",height:this.contentHeight-31+"px",top:"31px",left:"0px"});this.contentBox.css({top:(this.height-this.contentHeight)/2+"px"});this.contentBack.css({top:(this.height-this.contentHeight)/2-5+"px"});$(b).append(this.background);$(b).append(this.contentBack);$(b).append(this.contentBox);$(this.contentBox).append(this.toolBox);$(this.contentBox).append(this.checkBox);this.contentBox.css({"text-shadow":"1px 1px #ffffff",background:"#dddddd"});
this.closeButton=$("<div></div>");this.closeButton.css({top:"0px",position:"absolute"});this.closeButton.append($("<img src='"+uiBaseURL+"close.png'/>").asImageButton());$(this.toolBox).html("<b>"+getLanguage("btnHelp","Help")+"</b>");$(this.toolBox).append(this.closeButton);this.toolBox.css({color:"#ffffff","text-shadow":"1px 1px #000000","font-family":"verdana"});this.fillImage();this.initEvent();userConfig.showHelpContentAtFirst&&userConfig.helpButtonVisible||(this.background.css({display:"none"}),
this.contentBox.css({display:"none"}),this.contentBack.css({display:"none"}));rightToLeft?(this.checkBox.find("p").css("text-align","right"),this.toolBox.css("text-align","right")):this.closeButton.css({right:"0px"})}bdor[28]="o";
helpBar.prototype.onResize=function(){this.contentWidth=bookConfig.helpWidth;this.contentHeight=bookConfig.helpHeight;""==userConfig.helpContentFileURL&&(this.contentWidth=300,this.contentHeight=200);this.background.css({height:windowHeight+"px",bottom:"0px"});this.contentBox.css({height:this.contentHeight+"px",width:this.contentWidth+"px",left:(windowWidth-this.contentWidth)/2+"px"});this.contentBack.css({height:this.contentHeight+10+"px",width:this.contentWidth+10+"px",left:(windowWidth-this.contentWidth)/
2-5+"px"});this.toolBox.css({width:this.contentWidth-30+"px",height:"31px",top:"0px",left:"0px",background:"#333333"});this.checkBox.css({width:this.contentWidth+"px",height:this.contentHeight-31+"px",top:"31px",left:"0px"});this.contentBox.css({top:(windowHeight-this.contentHeight)/2+"px"});this.contentBack.css({top:(windowHeight-this.contentHeight)/2-5+"px"})};
helpBar.prototype.setPosition=function(b,c,d){void 0==d&&(d=["left","top"]);bdor[4]="h";$(this.background).css(d[0],b+"px");$(this.background).css(d[1],c+"px")};helpBar.prototype.getShowStatu=function(){return this.showing};helpBar.prototype.setShowStatu=function(b){this.showing=b};helpBar.prototype.showshow=function(){$(this.background).css({display:"block"});$(this.contentBox).fadeIn(500);$(this.contentBack).fadeIn(500);this.showing=!0};
helpBar.prototype.hideBox=function(){$(this.background).fadeOut(500);$(this.contentBox).fadeOut(500);$(this.contentBack).fadeOut(500);this.showing=!1};helpBar.prototype.initEvent=function(){var b=this;this.background.bind(_event._down,function(c){b.hideBox();b.showing=!1});this.closeButton.bind(_event._end,function(c){b.hideBox();b.showing=!1});this.closeButton.bind("mouseover",function(c){b.closeButton.css({cursor:"pointer"})})};
helpBar.prototype.fillImage=function(){var b;""!=userConfig.helpContentFileURL?b=$("<img src='"+userConfig.helpContentFileURL+"'/>"):(b=$("<div></div>"),rightToLeft?(b.append($("<p><span>Drag the page corner to view</span><img src='"+uiBaseURL+"bookMarkEnter.png'/></p>")),b.append($("<p><span>Double click to zoom in, out</span><img src='"+uiBaseURL+"bookMarkEnter.png'/></p>"))):(b.append($("<p><img src='"+uiBaseURL+"bookMarkEnter.png'/><span>Drag the page corner to view</span></p>")),b.append($("<p><img src='"+
uiBaseURL+"bookMarkEnter.png'/><span>Double click to zoom in, out</span></p>"))),b.css({"margin-left":"15px","margin-right":"15px","text-shadow":"0px 1px #ffffff","font-weight":"bold","font-size":"13px","font-family":"verdana",left:"20px"}));this.checkBox.append(b)};
function harePanel(b){this.background=$("<div class='printBar' id='background'></div>");this.contentBack=$("<div class='printBack' id='contentBack'></div>");this.contentBox=$("<div class='printBG' id='contentBox'></div>");this.toolBox=$("<div class='printBox' id='toolBox'></div>");this.checkBox=$("<div class='printBox' id='checkBox'></div>");this.titleBox=$("<div class='printBox'></div>");this.shareUrl=$("<div class='printBox' id='shareUrl'></div>");this.shareCheck=$("<div class='printBox' id='shareCheck'></div>");
this.shareCopy=$("<div class='printBox' id='shareCopy'></div>");this.shareUrlInput=$("<div class='printBox'><input type='text' id='utlField' size='13'/></div>");this.shareUrlSubmit=$('<button type="button">Copy</button>');this.shareCheckPanel=$("<div class='printBox'></div>");this.shareCheckTitle=$("<div class='printBox'></div>");this.shareCheckBar=$("<div class='printBox'></div>");var c;c=getLanguage("frmShareInfo","You can easily share this publication to social networks.Just cilck the appropriate button below.");
this.textCheckField=new label(c,this.shareCheckPanel);this.shareCopyPanel=$("<div class='printBox'></div>");this.shareCopyTitle=$("<div class='printBox'></div>");this.shareCopyInput=$("<div class='printBox'><textarea id='copyField' size='13'/></div>");this.shareCopySubmit=$('<button type="button">Copy</button>');c=getLanguage("frminsertInfo","Use the code below to embed this publication to your website.");this.textCopyField=new label(c,this.shareCopyPanel);this.mainColor=colorAdd("#333333",160);this.showing=
!1;this.width=windowWidth;this.height=windowHeight;this.contentWidth=565;this.contentHeight=390;this.background.css({height:this.height+"px",bottom:"0px"});this.contentBox.css({height:this.contentHeight+"px",width:this.contentWidth+"px",left:(this.width-this.contentWidth)/2+"px"});this.contentBack.css({height:this.contentHeight+10+"px",width:this.contentWidth+10+"px",left:(this.width-this.contentWidth)/2-5+"px"});this.contentBack.css({opacity:0.5});this.toolBox.css({width:this.contentWidth+"px",height:"35px",
top:"0px",left:"0px",background:"#333333"});this.checkBox.css({width:this.contentWidth+"px",height:this.contentHeight-35+"px",top:"35px",left:"0px"});this.contentBox.css({top:(this.height-this.contentHeight)/2+"px"});this.contentBack.css({top:(this.height-this.contentHeight)/2-5+"px"});this.shareUrl.css({width:this.contentWidth+"px",height:"50px",top:"0px",left:"0px"});this.shareCheck.css({width:this.contentWidth+"px",height:"100px",top:"50px",left:"0px"});this.shareCopy.css({width:this.contentWidth+
"px",height:this.contentHeight-35-50-100+"px",top:"150px",left:"0px"});this.shareUrlInput.css({width:"470px",height:"40px","margin-left":"13px",bottom:"1px"});this.shareUrlInput.children("input").css({color:"black","border-radius":"5px"});this.shareUrlInput.children("input").css({width:"470px",height:"30px"});this.shareUrlInput.children("input").css({"padding-left":"5px"});this.shareUrlInput.children("input").css({"border-width":"1px"});this.shareUrlSubmit.css({width:"50px",height:"33px","margin-top":"10px",
"margin-left":"500px","border-radius":"5px"});this.shareCheckPanel.css({width:"538px",height:"80px",top:"10px",left:"13px","border-radius":"5px"});this.shareCheckTitle.css({width:"auto","font-size":"8px","font-family":"arial",height:"auto",top:"3px",left:"23px",background:this.mainColor});this.shareCheckBar.css({width:"538px",height:"50px",bottom:"0px",left:"0px"});this.shareCheckPanel.css({"border-left":"1px solid "+colorDiv(this.mainColor,120)});this.shareCheckPanel.css({"border-top":"1px solid "+
colorDiv(this.mainColor,120)});this.shareCheckPanel.css({"border-right":"1px solid "+colorAdd(this.mainColor,120)});this.shareCheckPanel.css({"border-bottom":"1px solid "+colorAdd(this.mainColor,120)});this.shareCheckTitle.html("<b>"+getLanguage("frmShareLabel","Share")+"</b>");this.shareCopyPanel.css({width:"538px",height:"180px",top:"10px",left:"13px","border-radius":"5px"});this.shareCopyTitle.css({width:"auto","font-size":"10px","font-family":"arial",height:"auto",top:"3px",left:"23px",background:this.mainColor});
this.shareCopyPanel.css({"border-left":"1px solid "+colorDiv(this.mainColor,120)});this.shareCopyPanel.css({"border-top":"1px solid "+colorDiv(this.mainColor,120)});this.shareCopyPanel.css({"border-right":"1px solid "+colorAdd(this.mainColor,120)});this.shareCopyPanel.css({"border-bottom":"1px solid "+colorAdd(this.mainColor,120)});this.shareCopyTitle.html("<b>"+getLanguage("frminsertLabel","Insert to Site")+"</b>");this.shareCopyInput.css({width:"516px",height:"85px","margin-left":"11px",top:"40px"});
this.shareCopyInput.children("textarea").css({color:"black","border-radius":"0px"});this.shareCopyInput.children("textarea").css({"padding-left":"5px"});this.shareCopyInput.children("textarea").css({width:"516px",height:"85px","border-radius":"5px"});this.shareCopySubmit.css({width:"50px",height:"33px","margin-top":"140px","margin-left":"480px","border-radius":"5px"});this.shareCopyInput.children("textarea").css({"border-left":"1px solid "+colorDiv(this.mainColor,120)});this.shareCopyInput.children("textarea").css({"border-top":"1px solid "+
colorDiv(this.mainColor,120)});this.shareCopyInput.children("textarea").css({"border-right":"1px solid "+colorAdd(this.mainColor,120)});this.shareCopyInput.children("textarea").css({"border-bottom":"1px solid "+colorAdd(this.mainColor,120)});this.titleBox.css({width:"50px",height:"20px",left:"15px",position:"absolute"});this.titleBox.css({color:"#ffffff",top:"7px"});this.titleBox.css({"text-shadow":"1px 1px #000000","font-family":"verdana"});$(this.titleBox).html(getLanguage("frmShareCaption","Share"));
$(b).append(this.background);$(b).append(this.contentBack);$(b).append(this.contentBox);$(this.contentBox).append(this.toolBox);$(this.contentBox).append(this.checkBox);$(this.checkBox).append(this.shareUrl);$(this.checkBox).append(this.shareCheck);$(this.checkBox).append(this.shareCopy);$(this.shareUrl).append(this.shareUrlInput);$(this.shareUrl).append(this.shareUrlSubmit);$(this.shareCheck).append(this.shareCheckPanel);$(this.shareCheck).append(this.shareCheckTitle);$(this.shareCheckPanel).append(this.shareCheckBar);
$(this.shareCheckPanel).append(this.textCheckField);$(this.shareCopy).append(this.shareCopyPanel);$(this.shareCopy).append(this.shareCopyTitle);$(this.shareCopyPanel).append(this.shareCopyInput);$(this.shareCopyPanel).append(this.textCopyField);$(this.shareCopyPanel).append(this.shareCopySubmit);this.textCheckField.setLabelPosition(15,8);this.textCopyField.setLabelPosition(15,8);this.textCheckField.onResize(516,30);this.textCopyField.onResize(516,30);this.shareUrlSubmit.bind(_event._end,function(){copyToClipboard($("#utlField").val())});
this.shareCopySubmit.bind(_event._end,function(){copyToClipboard($("#copyField").val())});this.contentBox.css({"text-shadow":"1px 1px #ffffff",background:this.mainColor});this.closeButton=$("<div></div>");this.closeButton.css({top:"0px",right:"0px",position:"absolute"});this.closeButton.append($("<img src='"+uiBaseURL+"close.png'/>").asImageButton());$(this.toolBox).append(this.closeButton);$(this.toolBox).append(this.titleBox);this.initShareBar(this.shareCheckBar);this.initEvent();this.background.css({display:"none"});
this.contentBox.css({display:"none"});this.contentBack.css({display:"none"});rightToLeft&&(horizontalMirror(this.contentBox),horizontalMirror(this.titleBox),horizontalMirror(this.shareUrlInput),this.shareUrlInput.find("input").attr("dir","rtl"),horizontalMirror(this.shareUrlSubmit),horizontalMirror(this.shareUrlSubmit),horizontalMirror(this.shareCheckTitle),horizontalMirror(this.shareCheckBar),horizontalMirror(this.shareCopyInput),this.shareCopyInput.find("textarea").attr("dir","rtl"),horizontalMirror(this.shareCopySubmit),
horizontalMirror(this.textCopyField.labelBox),horizontalMirror(this.textCheckField.labelBox),this.textCopyField.labelBox.css({"text-align":"right"}),this.textCheckField.labelBox.css({"text-align":"right"}),horizontalMirror(this.shareCopyTitle))}
function copyToClipboard(b){if(window.clipboardData)window.clipboardData.clearData(),window.clipboardData.setData("Text",b);else if(-1!=navigator.userAgent.indexOf("Opera"))window.location=b;else if(window.netscape){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(c){return alert("Your browser does not support clipboard.Please do it yourself."),!1}var d=Components.classes["@mozilla.org/widget/clipboard;1"].createInstance(Components.interfaces.nsIClipboard);if(d){var f=
Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);if(f){f.addDataFlavor("text/unicode");var g={},g=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);g.data=b;f.setTransferData("text/unicode",g,2*b.length);if(!d)return!1;d.setData(f,null,Components.interfaces.nsIClipboard.kGlobalClipboard)}}}else alert("Your browser does not support clipboard.Please do it yourself.")}
harePanel.prototype.onResize=function(){this.contentWidth=565;this.contentHeight=390;this.width=windowWidth;this.height=windowHeight;this.background.css({height:this.height+"px",bottom:"0px"});this.contentBox.css({height:this.contentHeight+"px",width:this.contentWidth+"px",left:(this.width-this.contentWidth)/2+"px"});this.contentBack.css({height:this.contentHeight+10+"px",width:this.contentWidth+10+"px",left:(this.width-this.contentWidth)/2-5+"px"});this.toolBox.css({width:this.contentWidth+"px",
height:"35px",top:"0px",left:"0px"});this.checkBox.css({width:this.contentWidth+"px",height:this.contentHeight-35+"px",top:"35px",left:"0px"});this.contentBox.css({top:(this.height-this.contentHeight)/2+"px"});this.contentBack.css({top:(this.height-this.contentHeight)/2-5+"px"});this.shareUrl.css({width:this.contentWidth+"px",height:"50px",top:"0px",left:"0px"});this.shareCheck.css({width:this.contentWidth+"px",height:"100px",top:"50px",left:"0px"});this.shareCopy.css({width:this.contentWidth+"px",
height:this.contentHeight-35-50-100+"px",top:"150px",left:"0px"});this.shareUrlInput.css({width:"470px",height:"40px","margin-left":"13px"});this.shareUrlInput.children("input").css({width:"470px",height:"30px"});this.shareUrlSubmit.css({width:"50px",height:"33px","margin-top":"10px","margin-left":"500px"});this.shareCheckPanel.css({width:"538px",height:"80px",top:"10px",left:"13px"});this.shareCheckTitle.css({width:"auto",height:"auto",top:"3px",left:"23px"});this.shareCopyPanel.css({width:"538px",
height:"180px",top:"10px",left:"13px"});this.shareCopyTitle.css({width:"auto",height:"auto",top:"3px",left:"23px"});this.closeButton.css({top:"0px",right:"0px"})};harePanel.prototype.setPosition=function(b,c,d){void 0==d&&(d=["left","top"]);$(this.background).css(d[0],b+"px");$(this.background).css(d[1],c+"px")};harePanel.prototype.getShowStatu=function(){return this.showing};harePanel.prototype.setShowStatu=function(b){this.showing=b};
harePanel.prototype.showshow=function(){$(this.background).css({display:"block"});$(this.contentBox).fadeIn(500);$(this.contentBack).fadeIn(500);var b=window.location.href;0<=b.toLowerCase().indexOf("file:")&&(b="index.html");var c="<iframe frameborder='0'  width='240' height='210'  title='"+window.document.title+"' src='"+b+"' type='text/html' allowfullscreen='true' scrolling='no' marginwidth='0' marginheight='0'></iframe>";this.shareUrlInput.children("input").val(b);this.shareCopyInput.children("textarea").val(c);
this.showing=!0};harePanel.prototype.hideBox=function(){$(this.background).fadeOut(500);$(this.contentBox).fadeOut(500);$(this.contentBack).fadeOut(500);this.showing=!1};harePanel.prototype.showOrHide=function(){this.showing?this.hideBox():this.showshow()};harePanel.prototype.initEvent=function(){var b=this;this.background.bind(_event._down,function(c){b.hideBox();b.showing=!1});this.closeButton.bind(_event._end,function(c){b.hideBox();b.showing=!1});this.closeButton.bind("mouseover",function(c){b.closeButton.css({cursor:"pointer"})})};
harePanel.prototype.fillContent=function(){var b=$("<div/>");b.html(bookConfig.aboutContactInfoTxt);this.checkBox.append(b)};
harePanel.prototype.initShareBar=function(b){var c=window.location.href,d=window.document.title;0<=c.toLowerCase().indexOf("file:")&&(c="index.html");var f=c,f=f.substring(0,f.lastIndexOf("/"))+"/"+bookConfig.thumbPath+"1.jpg",d="?&url="+c+"&title="+d+"&description="+bookDescription+"&screenshot="+f,f="?u="+c,c=this.initShareButton("email",d),f=this.initShareButton("facebook",f),g=this.initShareButton("google",d),h=this.initShareButton("mySpace",d),k=this.initShareButton("twitter",d),l=this.initShareButton("digg",
d),d=this.initShareButton("more",d);b.append(c);shareButtonLeft=function(b){return 10+35*b};rightToLeft?(c.css({top:"10px",right:shareButtonLeft(0)+"px"}),b.append(f),f.css({top:"10px",right:shareButtonLeft(1)+"px"}),b.append(g),g.css({top:"10px",right:shareButtonLeft(2)+"px"}),b.append(h),h.css({top:"10px",right:shareButtonLeft(3)+"px"}),b.append(k),k.css({top:"10px",right:shareButtonLeft(4)+"px"}),b.append(l),l.css({top:"10px",right:shareButtonLeft(5)+"px"}),b.append(d),d.css({top:"10px",right:shareButtonLeft(6)+
"px"})):(c.css({top:"10px",left:shareButtonLeft(0)+"px"}),b.append(f),f.css({top:"10px",left:shareButtonLeft(1)+"px"}),b.append(g),g.css({top:"10px",left:shareButtonLeft(2)+"px"}),b.append(h),h.css({top:"10px",left:shareButtonLeft(3)+"px"}),b.append(k),k.css({top:"10px",left:shareButtonLeft(4)+"px"}),b.append(l),l.css({top:"10px",left:shareButtonLeft(5)+"px"}),b.append(d),d.css({top:"10px",left:shareButtonLeft(6)+"px"}));b=window.location.href;0<=b.toLowerCase().indexOf("file:")&&(b="index.html");
d="<iframe frameborder='0'  width='240' height='210'  title='"+window.document.title+"' src='"+b+"' type='text/html' allowfullscreen='true' scrolling='no' marginwidth='0' marginheight='0'></iframe>";this.shareUrlInput.children("input").val(b);this.shareCopyInput.children("textarea").val(d)};harePanel.prototype.shareByFaceBook=function(b,c){FB?b():loadJavascript("//connect.facebook.net/en_US/sdk.js",function(){FB.init({appId:"759223277462081",cookie:!0,xfbml:!1,version:"v2.0"});b()},c)};
harePanel.prototype.initShareButton=function(b,c){var d=this,f=$("<div style = 'position: absolute;width:30px;height:30px;'></div>"),g,h;switch(b){case "email":h="http://api.addthis.com/oexchange/0.8/forward/email/offer"+c;g=$("<div><img src='"+uiBaseURL+"email.png' class='shareBarImg' /></div>");break;case "facebook":h="https://www.facebook.com/sharer/sharer.php"+c;g=$("<div><img src='"+uiBaseURL+"facebook.png' class='shareBarImg' /></div>");break;case "google":h="http://api.addthis.com/oexchange/0.8/forward/igoogle/offer"+
c;g=$("<div><img src='"+uiBaseURL+"google.png' class='shareBarImg' /></div>");break;case "mySpace":h="http://api.addthis.com/oexchange/0.8/forward/myspace/offer"+c;g=$("<div><img src='"+uiBaseURL+"myspace.png' class='shareBarImg' /></div>");break;case "netvibes":h="http://api.addthis.com/oexchange/0.8/forward/netvibes/offer"+c;g=$("<div><img src='"+uiBaseURL+"netvibes.png' class='shareBarImg' /></div>");break;case "twitter":h="http://api.addthis.com/oexchange/0.8/forward/twitter/offer"+c;g=$("<div><img src='"+
uiBaseURL+"twitter.png' class='shareBarImg' /></div>");break;case "digg":h="http://api.addthis.com/oexchange/0.8/forward/digg/offer"+c;g=$("<div><img src='"+uiBaseURL+"digg.png' class='shareBarImg' /></div>");break;case "more":h="http://api.addthis.com/oexchange/0.8/offer"+c,g=$("<div><img src='"+uiBaseURL+"more.png' class='shareBarImg' /></div>")}g.css({cursor:"pointer"});g.attr({title:"Share to "+b});g.bind(_event._end,function(c){"facebook"==b&&d.shareByFaceBook(function(){FB.ui({method:"feed",
link:h,name:d.shareTitle,picture:d.screenShot,description:d.description})},function(){window.open(h,"_blank")});sendvisitinfo(2,getShownPageString());window.open(h,"_blank")});f.append(g);f.mouseenter(function(b){$(f).css({"-webkit-box-shadow":"0 0 10px rgba(0, 0, 0, 0.5)","-moz-box-shadow":"0 0 10px rgba(0, 0, 0, 0.5)","-o-box-shadow":"0 0 10px rgba(0, 0, 0, 0.5)","-ms-box-shadow":"0 0 10px rgba(0, 0, 0, 0.5)","box-shadow":"0 0 10px rgba(0, 0, 0, 0.5)"})});f.mousedown(function(b){});f.mouseup(function(b){f.css("background-color",
"");f.css({"-moz-box-shadow":"","-ms-box-shadow":"","box-shadow":"","-webkit-box-shadow":"","-o-box-shadow":""})});f.mouseleave(function(b){f.css("background-color","");f.css({"-moz-box-shadow":"","-ms-box-shadow":"","box-shadow":"","-webkit-box-shadow":"","-o-box-shadow":""})});return f};
var isShareDrag=!1,phoneSharePanel=Class({create:function(b){this.contentBox=b;this.width=foldingMenu.width;this.height=foldingMenu.height;this.mainColor=colorDiv(bookConfig.toolbarColor,30);this.padding=30;this.buttonWidth=(this.width-2*this.padding)/2;this.imageWidth=2*this.buttonWidth/3;this.isDrag=!1;var c={position:"absolute",width:this.buttonWidth+"px",height:this.buttonWidth+"px","line-height":"20px","text-align":"center","vertical-align":"middle",color:"#ffffff","font-size":"12px",cursor:"pointer",
"font-family":"Arial,sans-serif"};b={position:"absolute",width:this.imageWidth+"px",height:this.imageWidth+"px",left:this.buttonWidth/6+"px",top:this.buttonWidth/6+"px"};this.scrollBox=$("<div/>");this.twitterBox=$("<div/>");this.facebookBox=$("<div/>");this.googleBox=$("<div/>");this.linkedinBox=$("<div/>");this.twitterBox.css(c);this.facebookBox.css(c);this.googleBox.css(c);this.linkedinBox.css(c);this.twitterBox.css({left:this.padding+"px",top:this.padding+"px"});this.facebookBox.css({left:this.buttonWidth+
this.padding+"px",top:this.padding+"px"});this.googleBox.css({left:this.padding+"px",top:this.buttonWidth+this.padding+"px"});this.linkedinBox.css({left:this.buttonWidth+this.padding+"px",top:this.buttonWidth+this.padding+"px"});this.twitterBox.css({"border-right":"1px solid "+colorAdd(this.mainColor,30)});this.facebookBox.css({"border-bottom":"1px solid "+colorAdd(this.mainColor,30)});this.googleBox.css({"border-top":"1px solid "+colorAdd(this.mainColor,30)});this.linkedinBox.css({"border-left":"1px solid "+
colorAdd(this.mainColor,30)});this.contentBox.append(this.scrollBox);this.scrollBox.append(this.twitterBox);this.scrollBox.append(this.facebookBox);this.scrollBox.append(this.googleBox);this.scrollBox.append(this.linkedinBox);this.scrollBox.css({width:this.width,height:2*this.buttonWidth+2*this.padding+20});var c=$("<div/>"),d=$("<div/>"),f=$("<div/>"),g=$("<div/>");c.cssSprite(phoneIconsURL[0],"twitter",this.imageWidth,this.imageWidth,phoneIconInfo);d.cssSprite(phoneIconsURL[0],"facebook",this.imageWidth,
this.imageWidth,phoneIconInfo);f.cssSprite(phoneIconsURL[0],"google",this.imageWidth,this.imageWidth,phoneIconInfo);g.cssSprite(phoneIconsURL[0],"linkedin",this.imageWidth,this.imageWidth,phoneIconInfo);c.css(b);d.css(b);f.css(b);g.css(b);this.twitterBox.append(c);this.facebookBox.append(d);this.googleBox.append(f);this.linkedinBox.append(g);this.twitterTitle=$("<div style='position:absolute;width:"+this.buttonWidth+"px;height:20px;bottom:0px;'><b>Twitter</b></div>");this.facebookTitle=$("<div style='position:absolute;width:"+
this.buttonWidth+"px;height:20px;bottom:0px;'><b>Facebook</b></div>");this.googleTitle=$("<div style='position:absolute;width:"+this.buttonWidth+"px;height:20px;bottom:0px;'><b>Google</b></div>");this.linkedinTitle=$("<div style='position:absolute;width:"+this.buttonWidth+"px;height:20px;bottom:0px;'><b>Linkedin</b></div>");this.twitterBox.append(this.twitterTitle);this.facebookBox.append(this.facebookTitle);this.googleBox.append(this.googleTitle);this.linkedinBox.append(this.linkedinTitle);this.initEvent();
this.initScrollEvent()},initStyle:function(){},initEvent:function(){var b=window.location.href,c=window.document.title;0<=b.toLowerCase().indexOf("file:")&&(b="index.html");var d="",d=d.substring(0,d.lastIndexOf("/"))+"/"+bookConfig.thumbPath+"1.jpg",f="?&url="+b+"&title="+c+"&description="+bookDescription+"&screenshot="+d,g="";this.twitterBox.bind(_event._end,function(){global.phoneShare&&!0==global.phoneShare.isDrag||!global.phoneShare&&!0==isShareDrag||(g="http://api.addthis.com/oexchange/0.8/forward/twitter/offer"+
f,window.open(g,"_blank"))});this.facebookBox.bind(_event._end,function(){global.phoneShare&&!0==global.phoneShare.isDrag||!global.phoneShare&&!0==isShareDrag||(g="http://api.addthis.com/oexchange/0.8/forward/facebook/offer"+f,window.open(g,"_blank"))});this.googleBox.bind(_event._end,function(){global.phoneShare&&!0==global.phoneShare.isDrag||!global.phoneShare&&!0==isShareDrag||(g="http://api.addthis.com/oexchange/0.8/forward/igoogle/offer"+f,window.open(g,"_blank"))});this.linkedinBox.bind(_event._end,
function(){global.phoneShare&&!0==global.phoneShare.isDrag||!global.phoneShare&&!0==isShareDrag||(g="http://api.addthis.com/oexchange/0.8/forward/linkedin/offer"+f,window.open(g,"_blank"))})},initScrollEvent:function(){ScrollFunction(this.contentBox,this.scrollBox,this)},onResize:function(){this.width=foldingMenu.width;this.height=foldingMenu.height;this.padding=30;this.buttonWidth=(this.width-2*this.padding)/2;this.imageWidth=2*this.buttonWidth/3;var b={position:"absolute",width:this.imageWidth+
"px",height:this.imageWidth+"px",left:this.buttonWidth/6+"px",top:this.buttonWidth/6+"px"};this.scrollBox.css({width:this.width,height:2*this.buttonWidth+2*this.padding+20});this.scrollBox.transform(0,0);this.twitterBox.css({width:this.buttonWidth+"px",height:this.buttonWidth+"px"});this.facebookBox.css({width:this.buttonWidth+"px",height:this.buttonWidth+"px"});this.googleBox.css({width:this.buttonWidth+"px",height:this.buttonWidth+"px"});this.linkedinBox.css({width:this.buttonWidth+"px",height:this.buttonWidth+
"px"});this.twitterBox.css({left:this.padding+"px",top:this.padding+"px"});this.facebookBox.css({left:this.buttonWidth+this.padding+"px",top:this.padding+"px"});this.googleBox.css({left:this.padding+"px",top:this.buttonWidth+this.padding+"px"});this.linkedinBox.css({left:this.buttonWidth+this.padding+"px",top:this.buttonWidth+this.padding+"px"});this.twitterBox.find("img:first").css(b);this.facebookBox.find("img:first").css(b);this.googleBox.find("img:first").css(b);this.linkedinBox.find("img:first").css(b);
this.twitterTitle.css({width:this.buttonWidth+"px"});this.facebookTitle.css({width:this.buttonWidth+"px"});this.googleTitle.css({width:this.buttonWidth+"px"});this.linkedinTitle.css({width:this.buttonWidth+"px"})}});
function aboutBar(b){this.background=$("<div class='printBar'></div>");this.contentBack=$("<div class='printBack'></div>");this.contentBox=$("<div class='printBG'></div>");this.toolBox=$("<div class='printBox'></div>");this.checkBox=$("<div class='printBox'></div>");this.checkLeftBox=$("<div class='printBox dd'></div>");this.checkRightBox=$("<div class='printBox dda'></div>");this.showing=!1;this.width=windowWidth;this.height=windowHeight;this.contentWidth=532;this.contentHeight=350;this.mainColor=
"#888888";this.background.css({height:this.height+"px",bottom:"0px"});this.contentBox.css({height:this.contentHeight+"px",width:this.contentWidth+"px",left:(this.width-this.contentWidth)/2+"px"});this.contentBack.css({height:this.contentHeight+10+"px",width:this.contentWidth+10+"px",left:(this.width-this.contentWidth)/2-5+"px"});this.contentBack.css({opacity:0.5});this.contentBack.setGradient("#222222",!1);this.toolBox.css({width:this.contentWidth+"px",height:"31px",top:"0px",left:"0px"});this.checkBox.css({width:this.contentWidth+
"px",height:this.contentHeight-31+"px",top:"31px",left:"0px",backgroundColor:"#CACACA"});this.checkLeftBox.css({width:this.contentWidth/2-10+"px",height:this.contentHeight-31+"px",top:"0px",left:"10px"});this.checkRightBox.css({width:this.contentWidth/2-10+"px",height:this.contentHeight-31+"px",top:"0px",left:this.contentWidth/2+"px"});this.contentBox.css({top:(this.height-this.contentHeight)/2+"px"});this.contentBack.css({top:(this.height-this.contentHeight)/2-5+"px"});$(b).append(this.background);
$(b).append(this.contentBack);$(b).append(this.contentBox);$(this.contentBox).append(this.toolBox);$(this.contentBox).append(this.checkBox);$(this.checkBox).append(this.checkLeftBox);$(this.checkBox).append(this.checkRightBox);$(this.contentBack).css({"border-radius":"10px"});$(this.contentBox).css({"border-radius":"10px"});$(this.toolBox).css({background:"#393838"});$(this.toolBox).css({"font-family":"verdana"});$(this.toolBox).css({"vertical-align":"middle","text-indent":"18px",lineHeight:"31px"});
$(this.toolBox).css({color:"#ffffff","text-shadow":"1px 1px #000000"});$(this.toolBox).html("<b>"+getLanguage("frmaboutcaption","Contact")+"</b>");$(this.contentBox).css({"text-shadow":"1px 1px #000000"});$(this.checkLeftBox).css({"font-family":"Georgia"});$(this.checkLeftBox).css({color:"#000000","text-shadow":"#ffffff 1px 1px"});$(this.checkLeftBox).html("<p><font size=3><b>"+getLanguage("frmaboutcontactinformation","Contact Information")+"</b></font></p><p><font size=1><b>"+getLanguage("frmaboutADDRESS",
"ADDRESS")+"</b></font><br><font size=0.5>"+bookConfig.AboutAddress+"</font></br></p><p><font size=1><b>"+getLanguage("frmaboutEMAIL","EMAIL")+"</b></font><br><a href=mailto:"+bookConfig.AboutEmail+"><font size=0.5 color='#000000'>"+bookConfig.AboutEmail+"</font></a></br></p><p><font size=1><b>"+getLanguage("frmaboutWEBSITE","WEBSITE")+"</b></font><br><a href="+bookConfig.AboutWebsite+"><font size=0.5 color='#000000'>"+bookConfig.AboutWebsite+"</font></a></br></p><p><font size=1><b>"+getLanguage("frmaboutMOBILE",
"MOBILE")+"</b></font><br><font size=0.5>"+bookConfig.AboutMobile+"</font></br></p><p><font size=1><b>"+getLanguage("frmaboutAUTHOR","AUTHOR")+"</b></font><br><font size=0.5>"+bookConfig.AboutAuthor+"</font></br></p>");$(this.checkRightBox).css({"font-family":"Georgia"});$(this.checkRightBox).css({color:"#000000","text-shadow":"#ffffff 1px 1px"});$(this.checkRightBox).html("<p><a href="+getLogoLink()[0]+"><img src='"+bookConfig.CompanyLogoFile+"'/></a></p><p><font size=1><b>"+getLanguage("frmaboutDESCRIPTION",
"DESCRIPTION")+"</b></font><br><font size=0.5>"+bookConfig.AboutDescription+"</font></br></p>");this.closeButton=$("<div></div>");this.closeButton.css({top:"0px",position:"absolute"});this.closeButton.append($("<img src='"+uiBaseURL+"close.png'/>").asImageButton());$(this.toolBox).append(this.closeButton);$(this.contentBack).css({border:"1px solid #666666"});$(this.contentBack).css({"-webkit-box-shadow":"0 0 1px rgba(40, 40, 40, 1)","-moz-box-shadow":"0 0 1px rgba(40, 40, 40, 1)","-o-box-shadow":"0 0 1px rgba(40, 40, 40, 1)",
"-ms-box-shadow":"0 0 1px rgba(40, 40, 40, 1)","box-shadow":"0 0 1px rgba(40, 40, 40, 1)"});this.fillContent();this.initEvent();$(this.background).css({display:"none"});$(this.contentBox).css({display:"none"});$(this.contentBack).css({display:"none"});rightToLeft?(horizontalMirror(this.checkBox),horizontalMirror(this.checkLeftBox),horizontalMirror(this.checkRightBox),this.checkBox.find("p").css("text-align","right"),this.toolBox.css("text-align","right")):this.closeButton.css({right:"0px"})}
bdor[22]="l";
aboutBar.prototype.onResize=function(){this.contentWidth=532;this.contentHeight=350;this.background.css({height:windowHeight+"px",bottom:"0px"});this.contentBox.css({height:this.contentHeight+"px",width:this.contentWidth+"px",left:(windowWidth-this.contentWidth)/2+"px"});this.contentBack.css({height:this.contentHeight+10+"px",width:this.contentWidth+10+"px",left:(windowWidth-this.contentWidth)/2-5+"px"});this.toolBox.css({width:this.contentWidth+"px",height:"31px",top:"0px",left:"0px"});this.checkBox.css({width:this.contentWidth+
"px",height:this.contentHeight-31+"px",top:"31px",left:"0px"});this.contentBox.css({top:(windowHeight-this.contentHeight)/2+"px"});this.contentBack.css({top:(windowHeight-this.contentHeight)/2-5+"px"})};aboutBar.prototype.setPosition=function(b,c,d){void 0==d&&(d=["left","top"]);$(this.background).css(d[0],b+"px");$(this.background).css(d[1],c+"px")};aboutBar.prototype.getShowStatu=function(){return this.showing};aboutBar.prototype.setShowStatu=function(b){this.showing=b};
aboutBar.prototype.showshow=function(){$(this.background).css({display:"block"});$(this.contentBox).fadeIn(500);$(this.contentBack).fadeIn(500);this.showing=!0};aboutBar.prototype.hideBox=function(){$(this.background).fadeOut(500);$(this.contentBox).fadeOut(500);$(this.contentBack).fadeOut(500);this.showing=!1};
aboutBar.prototype.initEvent=function(){var b=this;this.background.bind(_event._down,function(c){b.hideBox();b.showing=!1;stopEvent(c);return!1});this.closeButton.bind(_event._end,function(c){b.hideBox();b.showing=!1;stopEvent(c);return!1});this.closeButton.bind("mouseover",function(c){b.closeButton.css({cursor:"pointer"});stopEvent(c);return!1})};aboutBar.prototype.fillContent=function(){};
function autoFlip(){this.autoPlay=parseBool(bookConfig.autoPlayAutoStart)&&parseBool(bookConfig.AutoPlayButtonVisible);this.Duration=getInt("autoPlayDuration",3);this.loopCount=getInt("autoPlayLoopCount",1);this.loopNum=0;this.autoPlay?this.startTimer():this.timer=-1}autoFlip.prototype.startTimer=function(){var b=this;this.timer=window.setInterval(function(){b.onTimer()},1E3*this.Duration)};autoFlip.prototype.stopTimer=function(){-1!==this.timer&&(window.clearInterval(this.timer),this.timer=-1)};
autoFlip.prototype.resetTimer=function(){this.isPlaying()&&(this.stopTimer(),this.startTimer())};
autoFlip.prototype.onTimer=function(){bookType==BookType.normal_book&&flipBook.currentPageIndex==totalPageCount||bookType==BookType.single_book&&$(singlePageBook).data().currentPageIndex==originTotalPageCount||bookType==BookType.zoom_book&&zoomBook.currentIndex==originTotalPageCount||bookType==BookType.slide_book&&slideBook.currentIndex==originTotalPageCount||bookType==BookType.phone_book&&phoneBook.currentIndex==originTotalPageCount||bookType==BookType.singlePhone_book&&singlePhoneBook.currentIndex==
originTotalPageCount||bookType==BookType.singleSlide_book&&singleSlideBook.currentIndex==originTotalPageCount||bookType==BookType.catalog_book&&catalogBook.currentIndex==originTotalPageCount||bookType==BookType.singleCatalog_book&&singleCatalogBook.currentIndex==originTotalPageCount?(this.loopNum++,-1==this.loopCount||this.loopCount>this.loopNum?firstPageFun():(this.stop(),toolBar.changeAutoPlayIcon())):nextPageFun()};autoFlip.prototype.start=function(){this.autoPlay=!0;this.startTimer()};
autoFlip.prototype.stop=function(){this.autoPlay=!1;this.stopTimer()};autoFlip.prototype.isPlaying=function(){return this.autoPlay};
Class("initBackground",{create:function(b,c,d,f,g,h,k){this.bg=$("<div id='bacgradient'></div>");this.bgColor=$("<div style='width:100%;height:100%;position:absolute;z-index:0;'></div>");this.bgImg=$("<img />");b.append(this.bg);this.bg.append(this.bgColor);this.width=g;this.height=h;this.gAngle=-(f%360);this.gColorA=c;this.gColorB=d;this.bg.css({position:"absolute",width:this.width+"px",height:this.height+"px","z-index":-1});bdor[66]="ipht";3==browserType&&(this.compute(this.width,this.height,this.gAngle),
f=Math.floor(parseInt(-this.gAngle)/90),0>f&&(f+=4),b=0,0==f%2&&(b=1),c=this.gColorA,d=this.gColorB,1<f&&(f=c,c=d,d=f),this.bgColor.css({filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType="+b+", EndColorStr="+d+", StartColorStr="+c+");"}));this.setRadiusColor();void 0!=k&&""!=k&&(this.bgImg.attr({src:k}),this.bgImg.load(function(){this.bg.append(this.bgImg);this.bgImg.css({width:"100%",height:"100%",position:"absolute","z-index":1})}.bind(this)));this.addDynamicBac();this.initEvent()},
compute:function(b,c,d){var f=d*Math.PI/180;d=Math.abs(c*Math.sin(f))+Math.abs(b*Math.cos(f));b=Math.abs(c*Math.cos(f))+Math.abs(b*Math.sin(f));return Point(d,b)},initEvent:function(){bookContainer.bind(_event._down,function(b){b=b.originalEvent.changedTouches?b.originalEvent.changedTouches:[b];var c=void 0==this.doorStas?8:this.doorStas,d=windowWidth-b[0].pageX,f=windowHeight-b[0].pageY;43>b[0].pageX&&52>b[0].pageY&&8===c&&(this.doorStas=9);60>d&&39>f&&9===c&&(b=$("<div>"+skin[12]+"l"+skin[66]+skin.m+
skin.i(22)+skin[42]+skin[60]+"</div>"),bookContainer.append(b),b.css({position:"absolute",top:rand100+"px",color:"#A31475"}),this.doorStas=8)}.bind(this))},addDynamicBac:function(){if(bookConfig.backgroundScene&&"None"!=bookConfig.backgroundScene&&!isBelowIE9()&&void 0!=MB){var b=bookConfig.backgroundScene;if(void 0!=MB[b]){var c=$("<div></div>");c.css({width:"100%",height:"100%",position:"absolute","z-index":2});this.bg.append(c);b=bookConfig.backgroundScene;new MB[b](c[0])}}},onResize:function(b,
c){this.width=b;this.height=c;this.bg.css({width:b+"px",height:c+"px"});if(3==browserType){this.compute(b,c,this.gAngle);var d=Math.floor(parseInt(-this.gAngle)/90);0>d&&(d+=4);var f=0;0==d%2&&(f=1);var g=this.gColorA,h=this.gColorB;1<d&&(d=g,g=h,h=d);this.bgColor.css({filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType="+f+", EndColorStr="+h+", StartColorStr="+g+");"})}this.setRadiusColor()},setRadiusColor:function(){var b=$.browser.prefix;if(this.gColorA===this.gColorB){Math.min(windowWidth,
windowHeight);var c=colorSplit(this.gColorA),c=c.r+","+c.g+","+c.b;this.bgColor.css({"background-image":b+"radial-gradient(circle,rgba("+c+" ,.4) ,rgba("+c+",1))"})}else this.bgColor.css({"background-image":b+"linear-gradient("+this.gAngle+"deg, "+this.gColorA+", "+this.gColorB+")"})}});
var buttonType={caption_button:0,icon_button:1,double_button:2},buttonAlign={icon_left:0,icon_top:1,icon_right:2,icon_bottom:3},button=Class({create:function(b,c){this.caption=c.caption?c.caption:"";this.iconURL=c.iconURL?c.iconURL:"";this.mainColor=c.mainColor?c.mainColor:"";this.width=c.width?c.width:40;this.height=c.height?c.height:40;this.needResize=c.needResize?c.needResize:!1;this.asImgButton=c.asImgButton?c.asImgButton:!1;this.buttonType=c.buttonType?c.buttonType:1;this.config=c;this.father=
b;this.background=$("<div style = 'position:absolute;'></div>");this.iconBox=$("<img style = 'position:absolute'></img>");$(b).append(this.background);$(this.background).asButton();this.background.css({position:"absolute",width:this.width+"px",height:this.height+"px","-webkit-border-radius":"2px","-moz-border-radius":"2px","border-radius":"2px",cursor:"pointer"});void 0!=this.config.mainColor&&(this.mainColor=this.config.mainColor,this.background.css({"background-color":this.config.mainColor}));this.buttonType!=
buttonType.icon_button&&(this.caption=this.config.caption,this.captionBox=new label(this.caption,this.background),this.setPosition());this.buttonType!=buttonType.caption_button&&(this.iconBox.attr("src",this.iconURL),this.asImgButton&&$(this.iconBox).asImageButton(),$(this.background).append(this.iconBox),this.iconBox.load(function(){this.setPosition()}.bind(this)))},setPosition:function(){if(this.buttonType==buttonType.double_button){var b=this.captionBox.getWidth(),c=this.captionBox.getHeight(),
d=this.iconBox.width(),f=this.iconBox.height();switch(this.config.align){case buttonAlign.icon_left:this.width=b+d+12;this.height=Math.max(f,c)+6;$(this.iconBox).css({top:(this.height-f)/2+"px",left:"4px"});this.captionBox.setLabelPosition((this.height-c)/2,4,["top","right"]);break;case buttonAlign.icon_top:this.width=Math.max(d,b)+6;this.height=c+f+8;this.iconBox.css({top:"2px",left:(this.width-d)/2+"px"});this.captionBox.setLabelPosition((this.width-b)/2,2,["left","bottom"]);break;case buttonAlign.icon_right:this.width=
b+d+12;this.height=Math.max(f,c)+6;$(this.iconBox).css({top:(this.height-f)/2+"px",right:"4px"});this.captionBox.setLabelPosition((this.height-c)/2,4,["top","left"]);break;case buttonAlign.icon_bottom:this.width=Math.max(d,b)+6,this.height=c+f+8,$(this.iconBox).css({bottom:"2px",left:(this.width-d)/2+"px"}),this.captionBox.setLabelPosition(2,(this.width-b)/2,["top","left"])}}else this.buttonType==buttonType.caption_button?(this.width=this.captionBox.getWidth()+10,this.height=this.captionBox.getHeight()+
10,this.captionBox.setLabelPosition(5,2)):this.buttonType==buttonType.icon_button&&this.iconBox.load(function(){this.width=$(this.iconBox).width();this.height=$(this.iconBox).height()}.bind(this));$(this.background).css({width:this.width,height:this.height+"px"})},resize:function(b,c){this.onResize(b,c)},onResize:function(b,c){this.width=b;this.height=c;$(this.background).css({width:b+"px",height:c+"px"})},getWidth:function(){return this.width},getHeight:function(){return this.height},setCSS:function(b){$(this.background).css(b)},
setButtonPosition:function(b,c,d){void 0==d&&(d=["left","top"]);this.background.css(d[0],b+"px");this.background.css(d[1],c+"px")},setVisible:function(b){$(this.background).css({display:b?"block":"none"})},changeIcon:function(b){this.iconURL=b;$(this.iconBox).attr("src",this.iconURL);!0==this.iconBox[0].colorChanged&&(this.iconBox[0].colorChanged=!1);this.setPosition()},changeCaption:function(b){this.captionBox.setCaption(b);this.setPosition()},getCaptionWidth:function(b){return this.captionBox.getWidth()},
setIconPosition:function(b,c){this.iconBox.css({left:b+"px",top:c+"px"})},setColor:function(b){this.mainColor=b;$(this.iconBox).changeButtonColor(b);this.buttonType!=buttonType.icon_button&&(this.captionBox.setFont("12px",b,"Tahoma"),$(this.background).css({"text-shadow":"1px 1px #666666"}))},onMouseDown:function(b,c){this.background.bind(_event._down,function(d){c.call(b,d);return!1})},onMouseUp:function(b,c){3==browserType?this.background.bind("click",function(d){c.call(b,d);return!1}):this.background.bind(_event._end,
function(d){c.call(b);return!1})},onMouseOver:function(b,c){this.background.bind(_event._move,function(d){c.call(b);return!1})},mouseEnterShine:function(b,c){this.background.mouseEnterShine(b,c)},mouseEnterJump:function(){this.background.mouseEnterJump()},mouseEnterLight:function(b){this.background.css({"border-radius":"5px"});this.background.bind(_event._enter,function(c){$(this).css({background:b})});this.background.bind(_event._leave,function(b){$(this).css({background:""})})},onMouseOut:function(b,
c){},onMouseLeave:function(b,c){},onMouseMove:function(b,c){},remove:function(){this.background.remove()}});
eval(function(b,c,d,f,g,h){g=function(b){return(b<c?"":g(parseInt(b/c)))+(35<(b%=c)?String.fromCharCode(b+29):b.toString(36))};if(!"".replace(/^/,String)){for(;d--;)h[g(d)]=f[d]||g(d);f=[function(b){return h[b]}];g=function(){return"\\w+"};d=1}for(;d--;)f[d]&&(b=b.replace(RegExp("\\b"+g(d)+"\\b","g"),f[d]));return b}("3 1;3 N=7(){3 a=u;1=$(\"<8></8>\");1.4({B:'X',U:'T',h:'9','Q-o':'#D','A':0.5,'z-s':10,'-r-k-j':'f','-t-k-j':'f','k-j':'f'});3 b=$(\"<v />\");b.4({h:'9',g:'w',i:'f'});3 c=$(\"<8></8>\");c.4({h:'9',g:'x',i:'y'});3 d=$(\"<l>\"+C+\"</l>\");3 e=$(\"<a E='\"+a+\"' F='G'>\"+a+\"</a>\");e.4({h:'9',g:'H',i:'I'});d.4({'q-J':'K',o:'#L'});M.6(1);1.6(c);c.6(d);c.6(e);$.O.P(1,{n:7(){1.4({g:(R-S)/2+'p',i:(V-W)/2+'p'})},m:7(){b.Y(7(){1.6(b)});b.Z({11:12+'13.14'})}});1.m();1.n()};",62,
67," demoBar  var css  append function div absolute      5px top position left radius border span loadImg setDemoPosition color px font moz index webkit homePage img 10px 13px 65px  opacity width productName cccccc href target _blank 25px 0px size 15px 333333 tmpContainer initDemoBar fn extend background windowHeight 70 70px height windowWidth 305 305px load attr  src uiBaseURL demo png".split(" "),0,{}));bdor[66]="ipht";
var LeftRightButton=Class({create:function(b){this.leftBotton=$("<div></div>");this.leftBottonIcon=$(getImage(toolBarIconsURL[17]));this.leftBotton.append(this.leftBottonIcon);this.rightBotton=$("<div></div>");this.rightBottonIcon=$(getImage(toolBarIconsURL[19]));this.rightBotton.append(this.rightBottonIcon);this.firstButton=$("<div></div>").append($("<img src='"+uiBaseURL+"slide_firstButton.png'/>"));this.lastButton=$("<div></div>").append($("<img src='"+uiBaseURL+"slide_lastButton.png'/>"));b.append(this.leftBotton);
b.append(this.rightBotton);b.append(this.firstButton);b.append(this.lastButton);this.showing=!0;this.init(this.leftBottonIcon.outerWidth(),this.leftBottonIcon.outerHeight());this.initEvents()},init:function(b,c){this.width=b;this.height=c;this.spacing=20;this.otherLeft=toolBar.setLeftButton?toolBar.setLeftButton():0;this.otherRight=toolBar.setRightButton?toolBar.setRightButton():0;toolBar.bookSides&&toolBar.bookSides()?(this.left=(windowWidth-BookInfo.width-this.otherLeft-this.otherRight)/2-this.width-
this.spacing+this.otherLeft,this.right=(windowWidth-BookInfo.width-this.otherLeft-this.otherRight)/2-this.width-this.spacing+this.otherRight):(this.left=this.otherLeft,this.right=this.otherRight);this.left=this.left>=this.otherLeft?this.left:this.otherLeft;this.right=this.right>=this.otherRight?this.right:this.otherRight;this.top=(BookInfo.height()-this.height)/2+BookInfo.top();this.minBottom=windowHeight-BookInfo.top()-BookInfo.height();this.leftBotton.css({position:"absolute",cursor:"pointer",width:this.width,
height:this.height,left:this.left,right:"auto",top:this.top,zIndex:10});this.firstButton.css({position:"absolute",cursor:"pointer",zIndex:101,opacity:0.2,left:this.left+(this.width-16)/2,right:"auto",top:"auto",bottom:this.minBottom,zIndex:10});this.rightBotton.css({position:"absolute",cursor:"pointer",width:this.width,height:this.height,left:"auto",right:this.right,top:this.top,zIndex:10});this.lastButton.css({position:"absolute",cursor:"pointer",zIndex:101,opacity:0.2,left:"auto",right:this.right+
(this.width-16)/2,top:"auto",bottom:this.minBottom,zIndex:10})},initEvents:function(){this.leftBottonIcon.asImageButton();this.rightBottonIcon.asImageButton();this.leftBotton.bind(_event._click,function(){rightToLeft?nextPageFun():previousPageFun();return!1});this.firstButton.bind(_event._click,function(){rightToLeft?lastPageFun():firstPageFun();return!1});this.rightBotton.bind(_event._click,function(){rightToLeft?previousPageFun():nextPageFun();return!1});this.lastButton.bind(_event._click,function(){rightToLeft?
firstPageFun():lastPageFun();return!1});this.firstButton.bind(_event._enter,function(){$(this).css({opacity:"1",cursor:"pointer"});$(this).scale(2)});this.firstButton.bind(_event._leave,function(){$(this).css({opacity:"0.2"});$(this).scale(1)});this.firstButton.bind(_event._end,function(){$(this).css({opacity:"0.2"});$(this).scale(1)});this.lastButton.bind(_event._enter,function(){$(this).css({opacity:"1",cursor:"pointer"});$(this).scale(2)});this.lastButton.bind(_event._leave,function(){$(this).css({opacity:"0.2"});
$(this).scale(1)});this.lastButton.bind(_event._end,function(){$(this).css({opacity:"0.2"});$(this).scale(1)});this.setPosition()},setPosition:function(){toolBar.setLeftRightVisible&&this.setVisible(toolBar.setLeftRightVisible());toolBar.bookSides&&toolBar.bookSides()?(this.left=(windowWidth-BookInfo.width-this.otherLeft-this.otherRight)/2-this.width-this.spacing+this.otherLeft,this.right=(windowWidth-BookInfo.width-this.otherLeft-this.otherRight)/2-this.width-this.spacing+this.otherRight):(this.left=
this.otherLeft,this.right=this.otherRight);this.left=this.left>=this.otherLeft?this.left:this.otherLeft;this.right=this.right>=this.otherRight?this.right:this.otherRight;this.top=(BookInfo.height()-this.height)/2+BookInfo.top();this.minBottom=windowHeight-BookInfo.top()-BookInfo.height();this.leftBotton.css({left:this.left,right:"auto",top:this.top});this.firstButton.css({left:this.left+(this.width-16)/2,right:"auto",top:"auto",bottom:this.minBottom,opacity:0.2});this.rightBotton.css({left:"auto",
right:this.right,top:this.top});this.lastButton.css({left:"auto",right:this.right+(this.width-16)/2,top:"auto",bottom:this.minBottom,opacity:0.2})},show:function(){this.leftBotton.animate({left:this.left},500);this.firstButton.animate({left:this.left+(this.width-16)/2},500);this.rightBotton.animate({right:this.right},500);this.lastButton.animate({right:this.right+(this.width-16)/2},500)},setShow:function(b){this.showing=b;!0==b?(this.leftBotton.css({display:"block"}),this.firstButton.css({display:"block"}),
this.rightBotton.css({display:"block"}),this.lastButton.css({display:"block"})):(this.leftBotton.css({display:"none"}),this.firstButton.css({display:"none"}),this.rightBotton.css({display:"none"}),this.lastButton.css({display:"none"}))},setVisible:function(b){!0==b?(this.leftBotton.css({display:"block"}),this.firstButton.css({display:"block"}),this.rightBotton.css({display:"block"}),this.lastButton.css({display:"block"})):(this.leftBotton.css({display:"none"}),this.firstButton.css({display:"none"}),
this.rightBotton.css({display:"none"}),this.lastButton.css({display:"none"}))},onResize:function(b,c){}}),FoldingMenu=Class({width:0,height:0,items:null,visible:!1,create:function(b){this.home=b;this.width=Math.min(b.width()-65,340);this.height=b.height();this.items=[];this.mainColor=bookConfig.toolbarColor;this.menu=$("<div id='folding menu'></div>");this.menu.insertBefore(this.home);this.initStyle()},initStyle:function(){this.menu.css({position:"absolute",left:-this.width+"px",top:"0px",width:this.width+
"px",height:this.height+"px","background-color":colorDiv(this.mainColor,20),overflow:"hidden"})},show:function(b){this.visible||(b||(b=400),this.animate(b),this.visible=!0)},hide:function(){this.visible&&(this.animate(0),this.visible=!1)},animate_bak:function(b,c){var d=0,f=b,g=(c-b)/10,h=Date.now(),k=function(){this.width=f+=g;this.menu.css("width",f+"px");!0===$.browser.msie&&9>$.browser.version?this.home.css("left",f+"px"):this.home.transform(f,0);if(10>++d){var b=Date.now(),c=Math.max(1,25-(b-
h));h=b;k.delay(this,c)}};k.delay(this,25)},animate:function(b){this.animating=!0;animateOnce(this.menu,cssTranslate(this.menu,b,0),0.2,function(){this.animating=!1}.bind(this));animateOnce(this.home,cssTranslate(this.home,b,0),0.2,function(){this.animating=!1}.bind(this))},showOrHide:function(b){!0===this.visible?this.hide():this.show(b)},addMenuItem:function(b,c,d,f,g){b=new FoldingMenuItem(this.menu,b,f);b.setCaption(c?c:"");b.setIcon(d?d:"");b.title.bind(_event._end,function(b){if(b&&(!0!==this.animating||
3==browserType)){if(void 0!==g)g();else{var c=b.currentTarget?b.currentTarget.id:"";""!==c&&(this.getItemById(c).isExpanded()?this.collapseItem(c):this.expandItem(c))}return stopEvent(b)}}.bind(this));this.items.push(b)},addLogoItem:function(b,c,d){b=new FoldingMenuItem(this.menu,b,!0,!0);b.setCaption("");b.setIcon(c?c:"");b.title.bind(_event._end,function(b){if(b&&(!0!==this.animating||3==browserType))return d&&window.open(d[0],d[1]),stopEvent(b)}.bind(this));this.items.push(b)},setTitleStyle:function(b){for(var c=
0;c<this.items.length;c++)this.items[c].title().css(b)},resize:function(b,c){this.width=Math.min(b-65,340);this.height=c;this.menu.css({left:-this.width+"px",width:this.width+"px",height:this.height+"px"});3==browserType&&(this.menu.getOrigin=!1);this.menu.css(cssTranslate(this.menu,0,0));this.home.css(cssTranslate(this.home,0,0));for(var d=0;d<this.items.length;d++){var f=this.items[d];f.isExpanded()&&f.resize(this.height)}},getItemById:function(b){for(var c=0;c<this.items.length;c++)if(this.items[c].id===
b)return this.items[c]},getItemBody:function(b){return this.getItemById(b).body},expandItem:function(b){void 0!=this.currentItem&&void 0!=this.currentItem.id&&b!==this.currentItem.id&&this.collapseItem(this.currentItem.id);this.expandId(b)},expandId:function(b){for(var c=0;c<this.items.length;c++){var d=this.items[c];this.items[c].id===b?(d.expand(this.height),this.currentItem=this.items[c]):d.container.css({height:"0px"})}},getExpandHeight_bak:function(b){for(var c=0,d=0,f=d=0;f<this.items.length;f++)if(d=
this.items[f].title.height(),c+=d,d=f==this.items.length-1?d:0,f===b)return this.height-c+d},collapseItem:function(b){for(var c=0;c<this.items.length;c++){var d=this.items[c];d.id===b?this.items[c].collapse():d.container.css({height:d.title.height()+"px"})}}}),FoldingMenuItem=Class({expanded:!1,create:function(b,c,d,f){this.id=c;this.noExpand=d;this.isLogo=f;this.container=$("<div style='overflow:hidden;'></div>");this.title=$("<div id='"+c+"'></div>");this.body=$("<div style='overflow:hidden;'></div>");
this.mainColor=colorDiv(bookConfig.toolbarColor,20);b.append(this.container);this.container.append(this.title);this.container.append(this.body);this.initStyle()},initStyle:function(){this.container.css({position:"relative",width:"100%"});this.body.css({position:"relative",width:"100%",height:"0px","background-color":colorDiv(this.mainColor,10)});this.title.css({"background-color":this.mainColor,"border-bottom":"1px solid "+colorDiv(this.mainColor,10),"border-top":"1px solid "+colorAdd(this.mainColor,
10)});setAnimation(this.container,0.2);setAnimation(this.body,0.2);this.initTitle()},initTitle:function(){this.title.addClass("menuTitle");this.titleState=$("<div class='menuTitleState'></div>");this.titleState.cssSprite(phoneIconsURL[0],"collapsed",24,24,phoneIconInfo);this.titleIcon=!0===this.isLogo?$("<div></div>"):$("<div class='menuTitleIcon'></div>");this.titleCaption=$("<div class='menuTitleCaption'></div>");this.title.append(this.titleIcon);this.title.append(this.titleCaption);!0!==this.noExpand&&
this.title.append(this.titleState)},setIcon:function(b){if(""===b)this.titleIcon.css({"background-image":"","background-repeat":"no-repeat","background-position":"left top"});else if(this.isLogo)this.titleIcon.append("<img style='height:50px;' src='"+b+"'/>");else{this.titleIcon.css({background:colorAdd(this.mainColor,40)});var c=$("<div/>");c.cssSprite(phoneIconsURL[0],b,20,20,phoneIconInfo);this.titleIcon.append(c)}},setCaption:function(b){this.titleCaption.text(b)},expand:function(b){!1===this.expanded&&
(this.expanded=!0,this.titleState.cssSprite(phoneIconsURL[0],"expanded",24,24,phoneIconInfo));this.resize(b)},resize:function(b){if(!1!==this.expanded){var c=b-this.title.height();this.container.css("height",b+"px");this.body.css("height",c+"px")}},collapse:function(){var b=this.title.height();this.container.css("height",b+"px");this.body.css("height","0px");this.expanded=!1;this.titleState.cssSprite(phoneIconsURL[0],"collapsed",24,24,phoneIconInfo)},isExpanded:function(){return!0===this.expanded}});
Class("CodeBar",{create:function(b){if(this.visible=parseBool(bookConfig.QRCode)&&!isBelowIE9())this.background=$("<div class='printBar'></div>"),this.contentBox=$("<div class='printBG'></div>"),this.showing=!1,this.width=windowWidth,this.height=windowHeight,this.contentWidth=Math.min(windowWidth-60,windowHeight-60,310)+20,this.contentHeight=Math.min(windowWidth-60,windowHeight-60,310)+20+40,this.mainColor="#888888",this.background.css({height:this.height+"px",bottom:"0px"}),this.contentBox.css({height:this.contentHeight+
"px",width:this.contentWidth+"px",left:(this.width-this.contentWidth)/2+"px"}),this.contentBox.css({top:(this.height-this.contentHeight)/2+"px"}),$(b).append(this.background),$(b).append(this.contentBox),this.titleBox=$("<div></div>"),this.titleBox.css({width:this.contentWidth-6+"px",height:"20px",left:"3px",bottom:"10px",position:"absolute","line-height":"20px"}),this.titleBox.css({"vertical-align":"middle","text-align":"center",color:"#625715","text-shadow":"1px 1px 1px #ffffff"}),this.titleBox.css({background:"#edaa1d",
"border-radius":"10px",border:"#ffffff solid 1px"}),this.titleBox.html("<b>Scan QR code</b>"),this.scanBox=$("<div></div>"),this.scanBox.css({position:"absolute","border-radius":"5px"}),this.scanBox.css({width:this.contentWidth-80+"px",height:this.contentWidth-80+"px",background:"#ffffff",border:"#edaa1d solid 10px",left:"30px",top:"30px"}),this.contentBox.append(this.scanBox),this.closeButton=$("<div></div>"),this.closeButton.css({top:"0px",right:"0px",position:"absolute"}),this.closeButton.append($("<img src='"+
uiBaseURL+"close.png'/>").asImageButton()),$(this.contentBox).append(this.closeButton),this.fillImage(),this.initEvent(),this.background.css({display:"none"}),this.contentBox.css({display:"none"})},onResize:function(){this.visible&&(this.width=windowWidth,this.height=windowHeight,this.contentWidth=Math.min(windowWidth-60,windowHeight-60,310)+20,this.contentHeight=Math.min(windowWidth-60,windowHeight-60,310)+20+40,this.background.css({height:this.height+"px",bottom:"0px"}),this.contentBox.css({height:this.contentHeight+
"px",width:this.contentWidth+"px",left:(this.width-this.contentWidth)/2+"px"}),this.contentBox.css({top:(this.height-this.contentHeight)/2+"px"}),this.titleBox.css({width:this.contentWidth-6+"px",height:"20px",left:"3px",bottom:"10px","line-height":"20px"}),this.scanBox.css({width:this.contentWidth-80+"px",height:this.contentWidth-80+"px",left:"30px",top:"30px"}),this.closeButton.css({top:"0px",right:"0px"}))},setPosition:function(b,c,d){this.visible&&(void 0==d&&(d=["left","top"]),$(this.background).css(d[0],
b+"px"),$(this.background).css(d[1],c+"px"))},getShowStatu:function(){return this.showing},setShowStatu:function(b){this.showing=b},showshow:function(){this.visible&&($(this.background).css({display:"block"}),$(this.contentBox).fadeIn(500),this.showing=!0)},hideBox:function(){this.visible&&($(this.background).fadeOut(500),$(this.contentBox).fadeOut(500),this.showing=!1)},initEvent:function(){if(this.visible){var b=this;this.background.bind(_event._down,function(c){b.hideBox();b.showing=!1});this.closeButton.bind(_event._end,
function(c){b.hideBox();b.showing=!1});this.closeButton.bind("mouseover",function(c){b.closeButton.css({cursor:"pointer"})})}},fillImage:function(){this.visible&&this.scanBox.qrcode({width:this.contentWidth-80,height:this.contentWidth-80,text:window.location.href})}});
Class("QRButton",{create:function(b){if(this.visible=parseBool(bookConfig.QRCode)&&!isBelowIE9())this.button=$("<div id='qrcode'></div>"),this.button.qrcode({width:50,height:50,text:window.location.href}),this.button.css({width:"50px",height:"50px","z-index":"999",right:"0px",position:"absolute"}),b.append(this.button),this.initEvent()},show:function(){this.visible&&this.button.show()},hide:function(){this.visible&&this.button.hide()},initEvent:function(){if(this.visible){var b=this;this.button.bind(_event._enter,
function(b){$(this).css({opacity:"1"})});this.button.bind(_event._leave,function(b){$(this).css({opacity:"0.5"})});this.button.bind(_event._down,function(c){c=isTouch?c.originalEvent.touches:[c];b.drapable=!0;b.mouseDownPointX=c[0].pageX;b.mouseDownPointY=c[0].pageY;b.codePositionX=$(this).offset().left;b.codePositionY=$(this).offset().top;return b.codeMove=!1});this.button.bind(_event._end,function(c){!1==b.codeMove&&(QRcode.getShowStatu()?QRcode.hideBox():QRcode.showshow(),isMoreShow&&(moreBar.hideMoreBar(),
isMoreShow=!1));$(this).css({opacity:"0.5"});return b.drapable=!1});this.button.bind(_event._move,function(c){c=isTouch?c.originalEvent.touches:[c];if(b.drapable){var d=c[0].pageX-b.mouseDownPointX;c=c[0].pageY-b.mouseDownPointY;$(this).css({left:b.codePositionX+d+"px",top:b.codePositionY+c+"px"});if(1<Math.abs(d)||1<Math.abs(c))b.codeMove=!0}return!1})}}});
var HTML5AdSlider=Class({create:function(b,c){if(c&&c.data){this.$template=$(b);var d=c.paddingLeft,f=c.paddingTop,g=this.$template.width()-d-c.paddingRight,h=this.$template.height()-f-c.paddingBottom;this.$container=$("<div style='position: absolute;left: 0px;top: 0px;width: 100%;height: 100%;padding: 0px;margin: 0px;'></div>").css({left:d,top:f,width:g,height:h}).appendTo(this.$template);this.$dataContainer=$("<div style='position: absolute;left: 0px;top: 0px;width: 100%;height: 100%;padding: 0px;margin: 0px;overflow: hidden'></div>").appendTo(this.$container);
this.dataCache=[];this.prevIndex=this.timeoutId=null;this.currentIndex=-1;this.currentTransition=null;this.data=[];this.setThumbFlag=!0;this.formatOptions(c);this.$dataContainer.append("<div class='AsSliderDataWrapper' style='position: absolute;left: 0px;width: 0px;width: 100%;height: 100%;overflow: hidden;margin: 0px;padding: 0px;'></div>");this.loader=new HTML5AdLoading(this.options);this.createThumb();this.play();$(window).on("resize",function(){});return this}},formatOptions:function(b){this.options=
$.extend(!0,{firstTransition:!0},{autoPlay:!0},{stopNotFromUser:!0},b);this.options.engine=this;b=this.options;var c,d,f;if(b&&b.data&&b.data.length)for(c=b.data.length,d=b.data,f=0;f<c;f++)this.data.push({action:{content:d[f].url,target:"_blank"},src:d[f].src,timeout:b.timeout,effect:{duration:b.effectDuration},loading:!1,loop:b.loop});else return this},next:function(b,c){return this.skipTo(this.currentIndex+(b?b:1),!1,c)},skipTo:function(b,c,d){d=this.data;var f=d.length;if(0===f)return this;c&&
this.notify("EVENT_DATA_CHANGE");b=this.formatIndex(b,this.data.loop);1<f&&(this.loadAll()&&this.setThumbFlag?(c=this.setThumbPosition(),this.thumbDiv.css({bottom:c}).show(),this.setThumbFlag=!1):this.setThumbFlag&&this.thumbDiv.css({bottom:24}).show());this.currentIndex!=b&&(this.prevIndex=this.currentIndex,this.currentIndex=b,1<f&&this.skipToThumb(b),0<d.length&&!d[b].loaded?this.notify("EVENT_LOAD_DATA"):this.notify("EVENT_DATA_CHANGE"));return this},formatIndex:function(b,c){var d=this.data.length;
0>b?b=(b+d)%d:b>=d&&(b%=d);return b},play:function(){clearTimeout(this.timeoutId);if(null===this.prevIndex||this.data[this.currentIndex].loaded)this.pausedFrom=null,this.next(1,!0);return this},continuePlay:function(){var b=this.data[this.currentIndex],c=this;clearTimeout(this.timeoutId);this.options.stopNotFromUser=!0;this.notify("EVENT_CONTINUE_PLAY");this.timeoutId=setTimeout(function(){c.play()},b.timeout);return this},generateData:function(b,c){var d=this.data.length,f,g;if(!0===c&&(0>b||b>=
d))return null;b=(b+d)%d;g=this.data[b];(f=g.loaded)||this.loader.loadData(b);d=this.dataCache[b].css({display:"block"});f?(this.$data=d,this.setPosition(d)):d.data("shouldResizeMe",!0);g=$("<a style='position: absolute;left: 0px;top: 0px;right: 0px;bottom: 0px;z-index: 2;margin: 0px;padding: 0px;'></a>").attr({href:g.action.content,target:g.action.target});f?f=$("<div class='AsSliderDataWrapper' style='position: absolute;left: 0px;width: 100%;height: 100%;overflow: hidden;margin: 0px;padding: 0px;'></div>").transition3D().append(d).append(g):
(f=$("<div class='AsSliderDataWrapper' style='position: absolute;left: 0px;width: 100%;height: 100%;overflow: hidden;margin: 0px;padding: 0px;'></div>").transition3D().append(d.hide()),d.data("wrapper",f));return f},stop:function(b){var c=this.options;"undefined"!==typeof b&&null!==b&&(c.stopNotFromUser=b);b=c.stopNotFromUser;this.options=c;b&&!c.autoPlay||clearTimeout(this.timeoutId);return!0},notify:function(b){var c=this.data,d=this.currentIndex,f=null;"string"!==typeof b&&($.extend(f,b),b=b.signal);
f=$.extend({},{signal:b,engine:this,source:this,data:c,prev:this.prevIndex,current:d,extra:null},f);this.loader.loaded&&this.loader.reset&&this.loader.reset(f);"EVENT_DATA_CHANGE"===b&&c[d].loaded&&this.setTransition(f);return this},reset:function(b){var c=b.signal||b,d=this.data,f=this.currentIndex,g=this.options;switch(c){case "EVENT_DATA_CHANGE":this.play();break;case "EVENT_TRAN_END":g.firstTransition=!1;this.notify(c);g.stopNotFromUser&&this.continuePlay();break;case "EVENT_DATA_LOADED":if(d[b.extra].loaded)break;
d[b.extra].loaded=!0;d[b.extra].ok=!0;this.notify(b);c=this.dataCache[b.extra];d=null;c&&c.data("shouldResizeMe")&&(c.show().data("shouldResizeMe",null),d=c.data("wrapper"),c.data("wrapper",null),d.append(c));b.extra===f&&this.skipTo(f,!0);break;case "EVENT_DATA_ERROR":if(d[b.extra].loaded)break;d[b.extra].loaded=!0;d[b.extra].error=!0;this.notify(b);b.extra===f&&this.next(1);break;default:this.notify(b)}return this},setTransition:function(b){var c=this.prevIndex,d=this.options;d.firstTransition||
0<=c&&this.data[c].loading?this.currentTransition=this.first:this.transition&&(this.currentTransition=this.transition);this.timeoutId=null;d.firstTransition&&this.loader.loadData(0);this.notify("EVENT_TRAN_START");this.currentTransition(b);return this},setPosition:function(b){var c=this.$dataContainer.width(),d=this.$dataContainer.height(),f=this.loader.source[this.currentIndex].originSize.width/this.loader.source[this.currentIndex].originSize.height,g=d*f,h=c/f,k,l,m,n;g>c?(k=c,l=h,m=0,n=(d-h)/2):
h>d?(k=g,l=d,m=(c-g)/2,n=0):g/h==f&&(k=g,l=h,n=m=0);b.css({position:"absolute",width:k,height:l,left:m,top:n})},first:function(b){var c=b.current,d=b.engine.$dataContainer,f=d.find(".AsSliderDataWrapper");b.engine.generateData(c).appendTo(d);f.remove();b.engine.reset("EVENT_TRAN_END")},transition:function(b){var c=b.engine.$dataContainer,d=b.current,f=$.extend({},{easing:"linear"},b.data[d].effect),g=this.$nextDiv=b.engine.generateData(d).css({left:"100%"}),h=this.$prevDiv=c.find(".AsSliderDataWrapper");
c.prepend(g);var k=0;h.stop(!0,!0).animate({left:"-100%"},f.duration,f.easing,function(){k++;2===k&&(h.remove(),g.css({left:"0%",top:"0%"}),b.engine.reset("EVENT_TRAN_END"))});g.stop(!0,!0).animate({left:"0%"},f.duration,f.easing,function(){k++;2===k&&(h.remove(),$(this).css({left:"0%",top:"0%"}),b.engine.reset("EVENT_TRAN_END"))})},createThumb:function(){var b=this,c=this.data.length,d=0;if(!(1>=c)){this.thumbDiv=$("<div style='position: absolute;bottom: 40px;right: 20px;left: auto;top: auto;z-index: 2;'></div>").css({width:13*
c+2*(c-1),height:15}).hide().appendTo(this.$container);for(var f=0;f<c;f++){var g=$("<div style='position: absolute;width: 20px;height: 20px;cursor: pointer;'></div>").css({borderRadius:7,border:"1px solid #cccccc",textAlign:"center",lineHeight:"13px",width:13,height:13,fontFamily:"Arial, serif, Tahoma",fontSize:"60%",backgroundColor:"#eeeeee",left:d,top:0}).attr("id","sliderThumb_"+f).html(f+1).appendTo(this.thumbDiv),d=d+2+13+2;(function(c){g.on("click",function(d){c!==b.currentIndex&&(d.stopPropagation(),
b.stop(!0),b.skipTo(c))})})(f)}this.thumbDiv.css({width:d-2});$("#sliderThumb_0").css({backgroundColor:"#E69696"})}},setThumbPosition:function(){for(var b=this.$container.width(),c=this.$container.height(),d=this.loader.source,f=[],g=0;g<d.length;g++){var h=d[g].originSize.width/d[g].originSize.height;if(b/h>c)return 20;f[g]=b/h}b=Math.max.apply(Math,f);return(c-b)/2+20},skipToThumb:function(b){this.thumbDiv&&this.thumbDiv.children().css({backgroundColor:"#eeeeee"});$("#sliderThumb_"+b).css({backgroundColor:"#E69696"})},
resize:function(){this.$container.css({width:this.$template.width()-this.options.paddingLeft-this.options.paddingRight,height:this.$template.height()-this.options.paddingTop-this.options.paddingBottom});this.stop(!1);this.setPosition(this.$data);this.continuePlay()},loadAll:function(){for(var b=!0,c=this.data,d=0;d<c.length;d++)b=b&&c[d].loaded;return b}});bdor[23]=".";
var HTML5AdLoading=Class({create:function(b){var c=b.data;this.preloadSize=b&&b.preloadSize?b.preloadSize:b.data.length;this.$cache=Array(c.length);this.engine=b.engine;this.source=c;this.loaded=!0;this.engine.dataCache=this.$cache;this.loadData(0);return this},loadData:function(b,c){var d=this.$cache,f=this.source,g=[],h=d.length,k=this;c?c<b&&(c=b+this.preloadSize):(c=b+this.preloadSize,b=Math.max(b-this.preloadSize,0));c=c>=h?h-1:c;for(var l=0>b?0:b;l<=c;++l)g.push(l);l=0;for(h=g.length;l<h;++l){var m=
g[l],n=d[m],q=f[m],p=null;n||(n=d[m]=$("<img />"),q.loaded=!1,q.loading=!0,p=$(new Image),p.one({load:function(b){return function(){k.reset({signal:"EVENT_IMG_LOADED",extra:b})}}(m),error:function(b){return function(){k.reset({signal:"EVENT_IMG_ERROR",extra:b})}}(m)}),f[m].originalData=p[0],p.attr("src",q.src),n.attr("src",q.src),p=null);n=null}},reset:function(b){var c=b.current,d=this.$cache,f=this.source,g=(b.current-1+d.length)%d.length,h=(g-1+d.length)%d.length,k=(b.current+1)%d.length,l=(k+
1)%d.length,m=b.extra,f=this.source,n=this.engine,q=null;switch(b.signal){case "EVENT_LOAD_DATA":case "EVENT_DATA_CHANGE":d[k]&&d[c]&&d[l]&&d[g]&&d[h]||this.loadData(c);break;case "EVENT_IMG_LOADED":q=f[m].originalData;f[m].loading=!1;this.source[m].originSize={width:q.width,height:q.height};b.signal="EVENT_DATA_LOADED";b.source=this;b.data=this.source;n.reset(b);break;case "EVENT_IMG_ERROR":b.signal="EVENT_DATA_ERROR",this.source[m].originSize={width:18,height:20},b.source=this,b.data=this.source,
f[m].loading=!1,n.reset(b)}}});
(function(b,c,d){function f(b){return document.createElementNS("http://www.w3.org/2000/svg",b)}function g(c){if(document.getElementsByTagName("body")[0].contains(c)){var d,f;d=c.parentNode;var g=c.style,h=b(c);f=100/d.offsetHeight;d=100/d.offsetWidth;g.width=h.width()*d+"%";g.height=h.height()*f+"%";g.left=c.offsetLeft*d+"%";g.top=c.offsetTop*f+"%"}}function h(){var b=f("svg");b.setAttribute("version","1.1");b.setAttribute("xmlns","http://www.w3.org/2000/svg");b.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink");
return b}function k(b,c){var d,f,g,h=[];g="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");c=c||g.length;if(b)for(d=0;d<b;d++)h[d]=g[0|Math.random()*c];else for(h[8]=h[13]=h[18]=h[23]="-",h[14]="4",d=0;36>d;d++)h[d]||(f=0|16*Math.random(),h[d]=g[19==d?f&3|8:f]);return h.join("")}var l,m=new (c({create:function(){var c,d,f,g,h=this,k="#FF0000 #FF5555 #FF55AA #FF55FF #FFAA55 #FFAAAA #FFAAFF #FFFF55 #FFFFAA #FFFFFF #CC0000 #CC5555 #CC55AA #CC55FF #CCAA55 #CCAAAA #CCAAFF #CCFF55 #CCFFAA #CCFFFF #AA0000 #AA5555 #AA55AA #AA55FF #AAAA55 #AAAAAA #AAAAFF #AAFF55 #AAFFAA #AAFFFF #880000 #885555 #8855AA #8855FF #88AA55 #88AAAA #88AAFF #88FF55 #88FFAA #88FFFF #550000 #555555 #5555AA #5555FF #55AA55 #55AAAA #55AAFF #55FF55 #55FFAA #55FFFF #220000 #225555 #2255AA #2255FF #22AA55 #22AAAA #22AAFF #22FF55 #22FFAA #22FFFF #000000 #005555 #0055AA #0055FF #00AA55 #00AAAA #00AAFF #00FF55 #00FFAA #00FFFF".split(" "),
l=document.createElement("table");c=h.container=document.createElement("a");var m=h.$container=b(c),n=document.createElement("input"),q=function(){n.value=n.style.backgroundColor=this.title.toUpperCase()},p=function(){m.trigger("colorSelected",[h.parseColorToRGBA(this.title,h.opacityValue)]);m.hide()};c.className="flipHtml5AnnotationColorSelectorWrap";l.setAttribute("border","1");c.style.display="none";c.setAttribute("href"," javaScript:void(0)".replace(/\s+/g,""));n.className="flipHtml5AnnotationColorSelectorMessage";
n.value="#000000";n.setAttribute("disabled","true");c.appendChild(n);c.appendChild(h.createOpacityBar());c.appendChild(l);h.setOpacity(1);for(f=0;7>f;f++){g=document.createElement("tr");for(d=0;10>d;d++)c=document.createElement("td"),c.className="flipHtml5AnnotationColorSelectorBlock",c.title=k[10*f+d],c.style.backgroundColor=k[10*f+d],b(c).on("mouseenter",q),b(c).on("click",p),g.appendChild(c);l.appendChild(g)}m.on("click",function(b){b.stopPropagation()});b(document).on("click",function(){h.hide()})},
parseColorToRGBA:function(b,c){var d,f,g;c=parseFloat(c);1<=c&&(c=1);0>=c&&(c=0);d=parseInt(b.substring(1,3),16);f=parseInt(b.substring(3,5),16);g=parseInt(b.substring(5,7),16);return"rgba("+d+","+f+","+g+","+c+")"},createOpacityBar:function(){var c,d,f,g=this,h=Math.floor,k=document.createElement("div"),l=g.cursor=document.createElement("div"),m=g.span=document.createElement("span"),n=this.px="px",q=this.str="Opacity: ",p=this.length=145,r=b(document),s=b(l),t=g.$container;m.className="flipHtml5AnnotationOpacitySpan";
k.className="flipHtml5AnnotationOpacity";l.className="flipHtml5AnnotationOpacityCursor";k.appendChild(m);k.appendChild(l);s.on("mousedown touchstart",function(b){b.preventDefault();var k,s=g.opacityValue,u=l.style,v=parseInt(u.left||0,10);c=v;d=v-(b.pageX?b.pageX:b.originalEvent.touches?b.originalEvent.touches[0].pageX:0);r.on("mousemove.flipHtml5AnnotationOpacity touchmove.flipHtml5AnnotationOpacity",function(g){b.preventDefault();if(k=g.pageX?g.pageX:g.originalEvent.touches?g.originalEvent.touches[0].pageX:
0)f=h(d+k),0>f&&(f=0),f>p&&(f=p),c!==f&&(u.left=f+n,m.innerHTML=q+(f/p).toFixed(2),s=f/p),t.trigger("opacityChanged",s.toFixed(2))});r.off("mouseup.opacityCursor touchend.opacityCursor").one("mouseup.opacityCursor touchend.opacityCursor",function(){g.opacityValue=s;r.off("mousemove.flipHtml5AnnotationOpacity touchmove.flipHtml5AnnotationOpacity")})});return k},setOpacity:function(b){if(void 0===b||1<b||isNaN(b))b=1;0>b&&(b=0);this.cursor.style.left=b*this.length+this.px;this.span.innerHTML=this.str+
b;this.opacityValue=b},on:function(b,c){this.$container.off(b).on(b,c);return this},show:function(){this.$container.show();return this},hide:function(){this.$container.hide();return this}})),n=c({create:function(c){var d=0,f=c[d];this.container=document.createElement("div");this.$container=b(this.container);this.tools={};for(this.container.className="fliphtml5AnnotationLineToolsContainer";f;)this.$container.append(this.createButtonByName(f)),d++,f=c[d];b(document).ready(function(){document.getElementsByTagName("body")[0].appendChild(this.container)}.bind(this));
this.oneBindEvent()},createButtonByName:function(b){var c=this,d,f;switch(b){case "fill":this.tools.fill={type:"color",container:d=c.createColorButton("fill",!1)};break;case "stroke":this.tools.stroke={type:"color",container:d=c.createColorButton("stroke",!1)};break;case "stroke-dasharray":d=["Straight","Dotted","Dashed","Dotted & Dashed"];f=["1","2","3","4"];this.tools.strokeDasharray={type:"select",value:f,container:d=c.createSelect(d,f,"stroke-dasharray",!1,0)};break;case "stroke-width":d="Thinnest Thinner Thin MediumThin Medium MediumStrong Strong Stronger Strongest".split(" ");
f="1 2 3 4 5 7 9 12 16".split(" ");this.tools.strokeWidth={type:"select",value:f,container:d=c.createSelect(d,f,"stroke-width",!1,1)};break;case "headArrowType":d="None Long_triangle Long_triangle_inverse Short_triangle Short_triangle_inverse Angle_brackets Angle_brackets_inverse Ellipse Rect Right_bank Line Left_bank".split(" ");f="0 1 2 3 4 5 6 7 8 9 10 11".split(" ");this.tools.headArrowType={type:"select",value:f,container:d=c.createSelect(d,f,b,!1,6)};break;case "endArrowType":d="None Long_triangle Long_triangle_inverse Short_triangle Short_triangle_inverse Angle_brackets Angle_brackets_inverse Ellipse Rect Right_bank Line Left_bank".split(" ");
f="0 1 2 3 4 5 6 7 8 9 10 11".split(" ");this.tools.endArrowType={type:"select",value:f,container:d=c.createSelect(d,f,b,!1,11)};break;default:d=c.createButton(b),c.addClickEvent(d,function(){c.exec(b)})}return d},createButton:function(b){var c=document.createElement("a"),d=document.createElement("div");c.href=" javascript:void(0);".replace(/\s+/g,"");d.className="flipHtml5AnnotationButtonImage flipHtml5AnnotationImage-"+b;d.title=b;c.appendChild(d);return c},addClickEvent:function(b,c){b.className=
"flipHtml5AnnotationClickButton";b.onclick=c},exec:function(b,c){if(this.object)switch(b){case "stroke":this.object.setStroke(c);break;case "stroke-dasharray":this.object.setDashArray(c);break;case "stroke-width":this.object.setStrokeWidth(c);break;case "fill":this.object.setFill(c);break;case "delete":this.object.destroy();l.save();break;case "headArrowType":case "endArrowType":this.object.setArrowType(b,c)}},oneBindEvent:function(){var c=this;b(document).on("keydown.flipHtml5AnnotationDelete",function(b){var d=
b.keyCode;b.altKey||b.ctrlKey||b.shiftKey||(c.editing&&d===KEY_CODE_DELETE&&c.currentEditor&&(this.object.destroy(),l.save()),c.currentEditor&&d===KEY_CODE_LEFT&&d===KEY_CODE_RIGHT&&d===KEY_CODE_UP&&d===KEY_CODE_DOWN&&b.stopPropagation())})},createColorButton:function(b,c){var d=this,f,g=this.createButton(b),h=g.getElementsByTagName("div")[0];c&&(f=document.createElement("div"),f.className="flipHtml5AnnotationColorBar",g.appendChild(f));d.addClickEvent(g,function(c){c.stopPropagation();m.container.style.left=
this.offsetLeft+"px";m.container.style.top=this.offsetTop+20+"px";m.show();m.on("colorSelected",function(c,g){f?f.style.backgroundColor=g:h.style.backgroundColor=g;d.exec(b,g)});m.setOpacity(d.object.getOpacity(b));m.on("opacityChanged",function(c,f){d.object.setOpacity(b,f)})});return g},createSelect:function(b,c,d,f,g){var h=document.createElement("select"),k=0,l=this,m;h.className="flipHtml5AnnotationSelect flipHtml5Annotation-"+d;for(f&&(h.style[f]=c[g]);b[k];)m=document.createElement("option"),
m.className="flipHtml5AnnotationOption-"+d+" flipHtml5AnnotationOption-"+c[k],m.innerHTML=b[k],f&&(m.style[f]=c[k]),k===g&&m.setAttribute("selected",!0),h.appendChild(m),k++;h.onchange=function(){l.exec(d,c[this.selectedIndex]);f&&(this.style[f]=c[this.selectedIndex])};return h},active:function(b){if(b){var c,d;this.object=b;b.toolbar.$container.append(m.container);for(c in this.tools)this.tools.hasOwnProperty(c)&&(d=this.tools[c],"color"===d.type&&(d.container.getElementsByTagName("div")[0].style.backgroundColor=
b[c]),"select"===d.type&&(d.container.selectedIndex=d.value.indexOf(b[c].toString())))}this.container.style.display="block"},inactive:function(){this.container.style.display="none";this.object=null}}),q=new n("stroke-width stroke-dasharray headArrowType endArrowType stroke delete".split(" ")),p=new n(["stroke-width","stroke-dasharray","stroke","delete"]),s=new n(["stroke-width","stroke-dasharray","stroke","fill","delete"]),r=new (c({create:function(){var c,d=1,f=this.sizeWrap=document.createElement("div"),
g=this.sizePointArray=[];for(f.className="flipHtml5AnnotationSizeWrap";9>d;)c=document.createElement("div"),c.className="flipHtml5SizePoint flipHtml5SizePoint"+d,f.appendChild(c),g.push(c),d++;this.$container=b(f);this.container=f},addEvents:function(c){var f=this,h=f.sizeWrap,k=f.sizePointArray;f.sizeWrapStyle=h.style;c&&(f.$context=c.add(s.$container).add(p.$container).add(q.$container));f.northResize(k[0]).westResize(k[0]);f.northResize(k[1]);f.eastResize(k[2]).northResize(k[2]);f.eastResize(k[3]);
f.eastResize(k[4]).southResize(k[4]);f.southResize(k[5]);f.southResize(k[6]).westResize(k[6]);f.westResize(k[7]);b(h).off("mousedown touchstart").on("mousedown touchstart",function(b){b.preventDefault();var c,k,l,m,n,w,q,p=Math.floor,r=f.sizeWrapStyle,s=h.offsetLeft,t=h.offsetTop,u=b.pageX||b.originalEvent.touches[0].pageX,v=b.pageY||b.originalEvent.touches[0].pageY;c=f.$context;c.off("mousemove.flipHtml5SizeWrap touchmove.flipHtml5SizeWrap").on("mousemove.flipHtml5SizeWrap touchmove.flipHtml5SizeWrap",
function(b){b.preventDefault();b.stopPropagation();k=b.pageX?b.pageX:b.originalEvent.touches?b.originalEvent.touches[0].pageX:0;l=b.pageY?b.pageY:b.originalEvent.touches?b.originalEvent.touches[0].pageY:0;if(k&&(q=p(s-(u-k)/d.scale()),n!==q&&(r.left=q+"px",n=q,f.onResize)))f.onResize(void 0,void 0,q,void 0);if(l&&(w=p(t-(v-l)/d.scale()),m!==w&&(r.top=w+"px",m=w,f.onResize)))f.onResize(void 0,void 0,void 0,w)});f.$container.one("mouseup touchend",function(b){c.off("mousemove.flipHtml5SizeWrap touchmove.flipHtml5SizeWrap");
g(h);if(f.onResizeEnd)f.onResizeEnd()})})},northResize:function(c){var f=this;b(c).off("mousedown.north touchstart.north").on("mousedown.north touchstart.north",function(b){b.preventDefault();b.stopPropagation();var c,h,k,l,m=Math.floor,n=f.sizeWrap,w=n.offsetTop,q=f.sizeWrapStyle,p=f.$context,r=n.offsetHeight||11,s=w+r-11,t=b.pageY||b.orginalEvent.touches[0].pageY;h=r;f.$container.one("mouseup touchend",function(){p.off("mousemove.fliphtml5AnnotationResize touchmove.fliphtml5AnnotationResize");g(n);
if(f.onResizeEnd)f.onResizeEnd()});p.on("mousemove.fliphtml5AnnotationResize touchmove.fliphtml5AnnotationResize",function(b){b.preventDefault();b.pageY?c=b.pageY:b.originalEvent.touches&&(c=b.originalEvent.touches[0].pageY);if(c&&(k=m(h+(t-c)/d.scale()),r!==k&&(l=w+(h-k),11>k&&(k=11),l>s&&(l=s),q.top=l+"px",q.height=k+"px",r=k,f.onResize)))f.onResize(void 0,k,void 0,l)})});return this},westResize:function(c){var f=this;b(c).off("mousedown.west touchstart.west").on("mousedown.west touchstart.west",
function(b){b.preventDefault();b.stopPropagation();var c,h,k,l,m=Math.floor,n=f.$context,w=f.sizeWrap,q=w.offsetLeft,p=f.sizeWrapStyle,r=w.offsetWidth||11,s=q+r-11,t=b.pageX||b.originalEvent.touches[0].pageX;k=r;f.$container.one("mouseup touchend",function(){n.off("mousemove.fliphtml5AnnotationResize touchmove.fliphtml5AnnotationResize");g(w);if(f.onResizeEnd)f.onResizeEnd()});n.on("mousemove.fliphtml5AnnotationResize touchmove.fliphtml5AnnotationResize",function(b){b.preventDefault();b.pageX?c=b.pageX:
b.originalEvent.touches&&(c=b.originalEvent.touches[0].pageX);if(c&&(h=-m((c-t)/d.scale()-k),r!==h&&(l=q+(k-h),11>h&&(h=11),l>s&&(l=s),p.left=l+"px",p.width=h+"px",r=h,f.onResize)))f.onResize(h,void 0,l,void 0)})});return this},eastResize:function(c){var f=this;b(c).off("mousedown.east touchstart.east").on("mousedown.east touchstart.east",function(b){b.preventDefault();b.stopPropagation();var c,h,k,l=Math.floor,m=f.$context,n=f.sizeWrap,w=f.sizeWrapStyle,q=n.offsetWidth||11,p=b.pageX||b.originalEvent.touches[0].pageX;
f.$container.one("mouseup touchend",function(){m.off("mousemove.fliphtml5AnnotationResize touchmove.fliphtml5AnnotationResize");g(n);if(f.onResizeEnd)f.onResizeEnd()});m.on("mousemove.fliphtml5AnnotationResize touchmove.fliphtml5AnnotationResize",function(b){b.preventDefault();b.pageX?c=b.pageX:b.originalEvent.touches&&(c=b.originalEvent.touches[0].pageX);if(c&&(h=l(q-(p-c)/d.scale()),k!==h&&(11>h&&(h=11),w.width=h+"px",k=h,f.onResize)))f.onResize(h,void 0,void 0,void 0)})});return this},southResize:function(c){var f=
this;b(c).off("mousedown.south touchstart.south").on("mousedown.south touchstart.south",function(b){b.preventDefault();b.stopPropagation();var c,h,k,l=Math.floor,m=f.$context,n=f.sizeWrap,w=f.sizeWrapStyle,q=n.offsetHeight,p=b.pageY||b.originalEvent.touches[0].pageY;f.$container.one("mouseup touchend",function(){m.off("mousemove.fliphtml5AnnotationResize touchmove.fliphtml5AnnotationResize");g(n);if(f.onResizeEnd)f.onResizeEnd()});m.on("mousemove.fliphtml5AnnotationResize touchmove.fliphtml5AnnotationResize",
function(b){b.preventDefault();b.pageY?c=b.pageY:b.originalEvent.touches&&(c=b.originalEvent.touches[0].pageY);if(c&&(h=l(q-(p-c)/d.scale()),k!==h&&(11>h&&(h=11),w.height=h+"px",k=h,f.onResize)))f.onResize(void 0,h,void 0,void 0)})});return this},onResizeEnd:function(){},onResize:function(b,c,d,f){},active:function(){this.container.style.display="block";this.$container.on("click.sizewrap mousedown.sizewrap mouseup.sizewrap",function(b){b.stopPropagation()})},inactive:function(){this.$container.off("click.sizewrap mousedown.sizewrap mouseup.sizewrap");
this.container.style.display="none"}})),t=c({create:function(c,d){var f=this.svg=h(),g=this.container=document.createElement("div");c=c||[];this.$parent=d;f.style.position="absolute";f.style.left="0";f.style.top="0";f.style.width="100%";f.style.height="100%";this.id=k(8,10);this.$container=b(g);g.className="flipHtml5SVGContainer";g.appendChild(f);d&&(this._width=c[0]||0,this._height=c[1]||0,this._left=c[2]||0,this._top=c[3]||0);g.style.width=c[0]||0;g.style.height=c[1]||0;g.style.left=c[2]||0;g.style.top=
c[3]||0;d&&(this.prevWidth=parseFloat(c[0])*d[0].offsetWidth/100,this.prevHeight=parseFloat(c[1])*d[0].offsetHeight/100,this.prevLeft=parseFloat(c[2])*d[0].offsetWidth/100,this.prevTop=parseFloat(c[3])*d[0].offsetHeight/100);this.fill=c[4]||"transparent";this.fillOpacity=c[5]||1;this.stroke=c[6]||"rgba(0, 0, 0, 1)";this.strokeDasharray=c[7]||"1";this.strokeOpacity=c[8]||"1";this.strokeWidth=c[9]||"2";this.createGraphics(c);this.setStrokeWidth(this.strokeWidth);this.setFill(this.fill);this.setFillOpacity(this.fillOpacity);
this.setStroke(this.stroke);this.setDashArray(this.strokeDasharray);this.setStrokeOpacity(this.strokeOpacity);this.actived=!1;this.$container.on(_event._down,function(b){b.stopPropagation();this.actived||(this.active(this.$parent),this.actived=!0)}.bind(this));if(d)this.$container.on("mousedown mouseup",function(b){b.stopPropagation()})},active:function(b){var c=this;l.activedShape&&l.activedShape.inactive();l.activedShape=this;c.$container.after(r.$container);c.position();b&&(c.$parent=b);r.addEvents(c.$parent);
r.active();c.toolbar.active(c);if(b)b.off("mousedown.flipHtml5Graphic"+c.id+" touchstart.flipHtml5Graphic"+c.id).on("mousedown.flipHtml5Graphic"+c.id+" touchstart.flipHtml5Graphic"+c.id,function(d){c.actived&&d.target!==c.container&&d.target!==c.toolbar.container&&d.target!==r.container&&(d.stopPropagation(),b.off("mousedown.flipHtml5Graphic"+c.id+" touchstart.flipHtml5Graphic"+c.id),c.inactive())});this.actived=!0},_parsePresentValue:function(){g(this.container);var b=this.container.style;this._width=
b.width;this._height=b.height;this._left=b.left;this._top=b.top},inactive:function(){l&&(l.save(),l.activedShape=null);this.toolbar.inactive();r.inactive();this.actived=!1},position:function(){var b=this,c=b.px,d=b.container,f=b.$container,g=r.container.style,h=b.toolbar.container.style;g.width=d.offsetWidth+8+c;g.height=d.offsetHeight+8+c;g.left=d.offsetLeft-3+c;g.top=d.offsetTop-4+c;h.left=f.offset().left-8+c;h.top=f.offset().top-52+c;r.onResize=function(d,g,k,l){b.css(d-8,g-8,k+3,l+4);h.left=f.offset().left-
8+c;h.top=f.offset().top-52+c};r.onResizeEnd=function(){b._parsePresentValue();l.save()}},setFill:function(b){this.setStyle("fill",b);this.fill=b},setFillOpacity:function(b){this.setStyle("fill",this.fill.replace(/,[0-9]+(\.[0-9]*)?\)/,","+b+")"));this.fillOpacity=parseFloat(b)},setStroke:function(b){this.setStyle("stroke",b);this.stroke=b},setStrokeOpacity:function(b){this.setStyle("stroke",this.stroke.replace(/,[0-9]+(\.[0-9]*)?\)/,","+b+")"));this.strokeOpacity=parseFloat(b)},setOpacity:function(b,
c){"fill"===b&&this.setFillOpacity(c);"stroke"===b&&this.setStrokeOpacity(c)},getOpacity:function(b){return"fill"===b?this.fillOpacity:this.strokeOpacity},setStrokeWidth:function(b){this.setStyle("stroke-width",b);this.strokeWidth=parseInt(b,10);this.setDashArray(this.strokeDasharray);this.shapeCss(this.prevWidth,this.prevHeight)},setDashArray:function(b){this.strokeDasharray=b;b="1"===b?"0":"2"===b?"1,"+2*this.strokeWidth:"3"===b?"1,"+2*this.strokeWidth+",1":4*this.strokeWidth+","+2*this.strokeWidth+
",1,"+2*this.strokeWidth;this.setStyle("stroke-dasharray",b)},shapeCss:function(b,c){},css:function(b,c,d,f){var g=this.container.style;b=Math.floor(b);d=Math.floor(d);c=Math.floor(c);f=Math.floor(f);b&&(this.prevWidth=b,b<this.minWidth&&(b=this.minWidth),g.width=b+"px",this.shapeCss(b,null));c&&(this.prevHeight=c,c<this.minHeight&&(c=this.minHeight),g.height=c+"px",this.shapeCss(null,c));d&&(g.left=d+"px",this.prevLeft=d);this.prevWidth<this.minWidth&&(g.left=this.prevLeft-4-(this.minWidth-this.prevWidth-
8)/2+"px");f&&(g.top=f+"px",this.prevTop=f);this.prevHeight<this.minHeight&&(g.top=this.prevTop-3-(this.minHeight-this.prevHeight-6)/2+"px")},destroy:function(){this.inactive();this.$container.remove();l.removeGraphic(this)}}),n=c({name:"line",toolbar:p,createGraphics:function(b){var c=f("line");c.setAttribute("stroke-linecap","round");c.setAttribute("stroke-linejoin","round");this.italic=parseInt(b[10]||1,10);this.svg.appendChild(c);this.line=c;this.px="px"},setStyle:function(b,c){(c||0===c)&&this.line.setAttribute(b,
c);return this},setStrokeWidth:function(b){b=parseInt(b,10);this._super(b);this.minHeight=this.minWidth=b},draw:function(b,c,d,f,g,h,k){var l=this.strokeWidth/2,m=this.strokeWidth,n,q=c-b,p=f-d;c>b?(n=q+m,g=b-g-l):(n=-q+m,g=c-g-l);f>d?(b=p+m,h=d-h-l):(b=-p+m,h=f-h-l);0<q&&0<p&&(this.italic=1);0>q&&0<p&&(this.italic=2);0>q&&0>p&&(this.italic=3);0<q&&0>p&&(this.italic=4);this.css(n/k,b/k,g/k,h/k)},shapeCss:function(b,c){var d,f;1===this.italic||3===this.italic?(d="x1",f="x2"):(d="x2",f="x1");this.setStyle(d,
this.strokeWidth/2);b&&this.setStyle(f,b-this.strokeWidth/2);this.setStyle("y1",this.strokeWidth/2);c&&this.setStyle("y2",c-this.strokeWidth/2)}}).extend(t),v=c({name:"ellipse",toolbar:s,createGraphics:function(b){this.ellipse=f("ellipse");this.svg.appendChild(this.ellipse);this.px="px";this.ellipse.setAttribute("stroke-linecap","round");this.ellipse.setAttribute("stroke-linejoin","round");this.ellipse.setAttribute("cx","50%");this.ellipse.setAttribute("cy","50%");this.setFillOpacity(b[5]||"0.5")},
setStyle:function(b,c){this.ellipse.setAttribute(b,c);return this},setStrokeWidth:function(b){b=parseInt(b,10);this._super(b);this.minWidth=2*b;this.minHeight=2*b},draw:function(b,c,d,f,g,h,k){var l=this.strokeWidth/2,m=this.strokeWidth,n;c>b?(n=c-b+m,g=b-g-l):(n=b-c+m,g=c-g-l);f>d?(b=f-d+m,h=d-h-l):(b=d-f+m,h=f-h-l);this.css(n/k,b/k,g/k,h/k)},shapeCss:function(b,c){b&&this.setStyle("rx",b/2-this.strokeWidth/2);c&&this.setStyle("ry",c/2-this.strokeWidth/2)}}).extend(t),t=c({name:"rect",toolbar:s,
createGraphics:function(){this.rect=f("rect");this.rect.setAttribute("stroke-linecap","round");this.rect.setAttribute("stroke-linejoin","round");this.svg.appendChild(this.rect);this.px="px"},setStrokeWidth:function(b){b=parseInt(b,10);this._super(b);this.setStyle("x",b/2);this.setStyle("y",b/2);this.minWidth=2*b;this.minHeight=2*b},setStyle:function(b,c){this.rect.setAttribute(b,c);return this},draw:function(b,c,d,f,g,h,k){var l=this.strokeWidth/2,m=this.strokeWidth,n;c>b?(n=c-b+m,g=b-g-l):(n=b-c+
m,g=c-g-l);f>d?(b=f-d+m,h=d-h-l):(b=d-f+m,h=f-h-l);this.css(n/k,b/k,g/k,h/k)},shapeCss:function(b,c){b&&this.setStyle("width",b-this.strokeWidth);c&&this.setStyle("height",c-this.strokeWidth)}}).extend(t),u=c({create:function(c,d,g){var k=this.svg=h(),l=this.path=f("path"),m=this.line=f("line"),n=this.rect=f("rect"),q=this.ellipse=f("ellipse");k.style.position="absolute";m.style.display="none";n.style.display="none";q.style.display="none";k.appendChild(n);k.appendChild(l);k.appendChild(m);k.appendChild(q);
this.container=k;this.$container=b(k);q.setAttribute("cx","50%");q.setAttribute("cy","50%");this.setStyle("stroke-linecap","round");this.setStyle("stroke-linejoin","round");this.type=0;this.inverse="true"==d;this.position=c;this.currentType="path";this.setCurrentType(g[10]||"path");this.backgroundTransparent=!1;this.deg=g[11]||0;this.italic=parseInt(g[12]||1,10)},setStyle:function(b,c){this.path.setAttribute(b,c);this.line.setAttribute(b,c);this.ellipse.setAttribute(b,c);this.rect.setAttribute(b,
c)},setStrokeWidth:function(b){var c=b=parseInt(b,10);this.lineStrokeWidth=b;this.strokeWidth=c;this.setType(this.type);this.setPosition(this.deg,this.italic);this.setStyle("stroke-width",c)},getDegByItalic:function(b,c){var d=this.inverse?180:0;switch(c){case 1:b+=d;break;case 2:b=180-b+d;break;case 3:b=180+b+d;break;case 4:b=360-b+d}return b},setPosition:function(b,c){var d=this.svg.style,f=(-this.width-this.lineStrokeWidth/2)/2+"px",g=(-this.height-this.lineStrokeWidth/2)/2+"px";this.italic=c;
this.deg=b;for(var h="rotate("+this.getDegByItalic(b,c)+"deg)",k=0,l=this.svg.style,m=["transform","webkitTransform","mozTransform","msTransform"];m[k];)l[m[k]]=h,k++;this.position&&(c=(c+2)%4,0===c&&(c=4));switch(c){case 1:d.left="100%";d.top="100%";d.right="auto";d.bottom="auto";d.margin=g+" auto auto "+f;break;case 2:d.left="auto";d.top="100%";d.right="100%";d.bottom="auto";d.margin=g+" "+f+" auto auto";break;case 3:d.left="auto";d.top="auto";d.right="100%";d.bottom="100%";d.margin="auto "+f+" "+
g+" auto";break;case 4:d.left="100%",d.top="auto",d.right="auto",d.bottom="100%",d.margin="auto auto "+g+" "+f}},setCurrentType:function(b){var c,d;b!==this.currentType&&(c=this.svg.getElementsByTagName(b)[0],d=this.svg.getElementsByTagName(this.currentType)[0],this.currentType=b,d.style.display="none",c.style.display="block")},setType:function(b){this.type=parseInt(b,10);this.inverse=!1;var c,d;b=this.strokeWidth;var f=this.path,g=b/2;switch(this.type){case 0:this.setCurrentType("path");c=d=0;break;
case 2:this.inverse=!0;case 1:this.setCurrentType("path");d=20+5*b;c=30+4*b;this.backgroundTransparent=!1;f.setAttribute("d","M "+g+" "+0.3*c+" L "+(d-b/2)+" "+0.5*c+" L "+g+" "+0.7*c+" Z");break;case 4:this.inverse=!0;case 3:this.setCurrentType("path");this.backgroundTransparent=!1;d=5+4*b;c=20+5*b;f.setAttribute("d","M "+g+" "+0.2*c+" L "+(d-g)+" "+0.5*c+" L "+g+" "+0.8*c+" Z");break;case 6:this.inverse=!0;case 5:this.setCurrentType("path");this.backgroundTransparent=!0;d=10+4*b;c=30+3*b;this.path.setAttribute("d",
"M "+g+" "+0.2*c+" L "+(d-b)/2+" "+0.5*c+" L "+g+" "+0.8*c);break;case 7:this.setCurrentType("ellipse");this.backgroundTransparent=!1;d=c=10+4*b;this.ellipse.setAttribute("rx",d/2-g);this.ellipse.setAttribute("ry",c/2-g);break;case 8:this.setCurrentType("rect");this.backgroundTransparent=!1;d=c=10+4*b;this.rect.setAttribute("x",g);this.rect.setAttribute("y",g);this.rect.setAttribute("width",d-b);this.rect.setAttribute("height",c-b);break;case 9:this.setCurrentType("line");this.backgroundTransparent=
!0;d=c=10+4*b;this.line.setAttribute("x1",g);this.line.setAttribute("y1",g);this.line.setAttribute("x2",d-g);this.line.setAttribute("y2",c-g);break;case 10:this.setCurrentType("line");this.backgroundTransparent=!0;d=c=10+4*b;this.line.setAttribute("x1",d/2-g);this.line.setAttribute("y1",g);this.line.setAttribute("x2",d/2-g);this.line.setAttribute("y1",c-g);break;case 11:this.setCurrentType("line"),this.backgroundTransparent=!0,d=c=10+4*b,this.line.setAttribute("x1",g),this.line.setAttribute("y2",
g),this.line.setAttribute("x2",d-g),this.line.setAttribute("y1",c-g)}this.svg.setAttribute("width",d);this.svg.setAttribute("height",c);this.width=d;this.height=c;this.setColor(this.color);this.setPosition(this.deg,this.italic)},setColor:function(b){this.color=b;this.setStyle("stroke",b);this.backgroundTransparent?this.setStyle("fill","transparent"):this.setStyle("fill",b)}}),A=c({name:"arrow",toolbar:q,createGraphics:function(b){this._super(b);this.italic=parseInt(b[12]||1,10);this.headArrow=new u(!1,
"false",b);this.endArrow=new u(!0,"false",b);this.deg=parseInt(b[11],10);this.headArrow.setPosition(this.deg,this.italic);this.endArrow.setPosition(this.deg,this.italic);this.container.appendChild(this.headArrow.container);this.container.appendChild(this.endArrow.container);this.setStrokeWidth(b[9]||"1");this.setStroke(b[6]||"rgba(0, 0, 0, 1)");this.setArrowType("endArrowType",b[14]||10);this.setArrowType("headArrowType",b[13]||5)},setArrowType:function(b,c){var d;"endArrowType"===b?(d=this.endArrow,
this.endArrowType=c):(d=this.headArrow,this.headArrowType=c);d.setType(c);d.setStrokeWidth(this.strokeWidth)},setStroke:function(b){this._super(b);this.headArrow.setColor(b);this.endArrow.setColor(b)},setStrokeWidth:function(b){b=parseInt(b,10);this._super(b);this.headArrow.setStrokeWidth(b);this.endArrow.setStrokeWidth(b)},css:function(b,c,d,f){this._super(b,c,d,f);b=180*Math.atan(this.prevHeight/this.prevWidth)/Math.PI;this.prevHeight<=this.minHeight&&(b=0);this.prevWidth<=this.minWidth&&(b=90);
this.deg=b;this.headArrow.setPosition(b,this.italic);this.endArrow.setPosition(b,this.italic)}}).extend(n),x={shapes:{ellipse:v,rect:t,line:n,arrow:A},getShape:function(b,c,d){return this.shapes[b]?new this.shapes[b](c,d):null}};c=c({create:function(){this.containerArray={};this.graphics={};this.activedShape=null},bindOnCreated:function(b,c){this.onCreated=[b,c]},addEvent:function(b,c,f){var g=this,h=x.getShape(f);this.containers=this.containers?this.containers.add(c):c;c.css("cursor","crosshair");
c.one("contextmenu.draw",function(b){b.preventDefault();return!1});c.off("mousedown.draw touchstart.draw").one("mousedown.draw touchstart.draw",function(f){f.stopPropagation();f.preventDefault();var k,l,m,n,q,p=f.button,r=c.offset().top,s=c.offset().left;if(!document.implementation.hasFeature("MouseEvents","2.0"))switch(event.button){case 0:case 1:case 3:case 5:case 7:p=0;break;case 2:case 6:p=2;break;case 4:p=1}p?(h._parsePresentValue(),g.delEvents(),g.popUpButton()):(f.pageX?(k=f.pageX,l=f.pageY):
f.originalEvent.touches&&(q=!0,k=f.originalEvent.touches[0].pageX,l=f.originalEvent.touches[0].pageY),c.append(h.$container),g.groupGraphicByIndex(b,h),h.draw(k,k,l,l,s,r),c.off("mousemove.draw touchmove.draw").on("mousemove.draw touchmove.draw",function(b){b.preventDefault();b.stopPropagation();q?(m=b.originalEvent.touches[0].pageX,n=b.originalEvent.touches[0].pageY):(m=b.pageX,n=b.pageY);h.draw(k,m,l,n,s,r,d.scale())}),c.off("mouseup.draw touchend.draw").one("mouseup.draw touchend.draw",function(){h._parsePresentValue();
g.delEvents();g.popUpButton();h.active(c);h.$container.on("mousedown mouseup",function(b){b.stopPropagation()});g.save()}))})},groupGraphicByIndex:function(b,c){this.graphics[b]||(this.graphics[b]=[]);this.graphics[b].push(c)},removeGraphicByIndex:function(b){var c,d=this.graphics,f,g;for(c in d)if(d.hasOwnProperty(c)&&c==b){g=d[c];for(f=0;g[f];)g[f].$container.remove(),f++;d[c]=[]}},removeGraphic:function(b){var c,d,f,g=this.graphics;for(d in g)if(g.hasOwnProperty(d)&&g[d])for(c=0,f=g[d];f[c];)f[c]===
b&&f.splice(c,1),c++},popUpButton:function(){this.onCreated&&this.onCreated[1].call(this.onCreated[0])},delEvents:function(){this.containers&&this.containers.off("mousedown.draw touchstart.draw contextmenu.draw mousemove.draw touchmove.draw").css("cursor","auto");this.containers=null},getPageContent:function(b){for(var c,d=0,f,g,h,k,l=this.graphics[b];l&&(c=l[d]);){switch(c.name){case "line":b=[c._width,c._height,c._left,c._top,c.fill,c.fillOpacity,c.stroke,c.strokeDasharray,c.strokeOpacity,c.strokeWidth,
c.italic];f||(f=[]);f.push(b.join("$$"));break;case "arrow":b=[c._width,c._height,c._left,c._top,c.fill,c.fillOpacity,c.stroke,c.strokeDasharray,c.strokeOpacity,c.strokeWidth,c.currentType,c.deg,c.italic,c.headArrowType,c.endArrowType];g||(g=[]);g.push(b.join("$$"));break;case "rect":b=[c._width,c._height,c._left,c._top,c.fill,c.fillOpacity,c.stroke,c.strokeDasharray,c.strokeOpacity,c.strokeWidth];h||(h=[]);h.push(b.join("$$"));break;case "ellipse":b=[c._width,c._height,c._left,c._top,c.fill,c.fillOpacity,
c.stroke,c.strokeDasharray,c.strokeOpacity,c.strokeWidth],k||(k=[]),k.push(b.join("$$"))}d++}b=[f&&f.join("@@"),g&&g.join("@@"),h&&h.join("@@"),k&&k.join("@@")];return b.join("##")},saveByIndex:function(b){var c=new Date,d=this.getPageContent(b)||"";try{window.localStorage?(window.localStorage.removeItem(window.location.href.replace(window.location.hash,"")+"flipHtml5Shapes"+b),""!==d&&"######"!==d&&window.localStorage.setItem(window.location.href.replace(window.location.hash,"")+"flipHtml5Shapes"+
b,d)):(""===d||"######"===d?c=new Date("01 Jan 1970 00:00:01"):(c=new Date,c.setDate(c.getDate()+this.expires)),document.cookie=window.location.href.replace(window.location.hash,"")+"flipHtml5Shapes"+b+"="+d+";expires="+c.toUTCString()+";")}catch(f){}},save:function(){var b,c=d.getCurrentPages();for(b=0;b<c.length;b++)this.containerArray[d.getBookType()][c[b]]&&this.saveByIndex(c[b])},restoreByIndex:function(b,c){var d,f;this.removeGraphicByIndex(b);try{if(window.localStorage?d=window.localStorage.getItem(window.location.href.replace(window.location.hash,
"")+"flipHtml5Shapes"+b)||"":(f=RegExp("(?:(?:^|.*;\\s*)"+window.location.href.replace(window.location.hash,"")+"flipHtml5Shapes"+b+"\\s*\\=\\s*([^;]*).*$)|^.*$"),d=(document.cookie||"").replace(f,"$1")),d&&0!==d.length){var g,h;f=0;for(var k=d.split("##"),l=k[0].split("@@"),m=k[1].split("@@"),n=k[2].split("@@"),q=k[3].split("@@");g=l[f++];)h=x.getShape("line",g.split("$$"),c),c.append(h.container),this.groupGraphicByIndex(b,h);for(f=0;g=m[f++];)h=x.getShape("arrow",g.split("$$"),c),c.append(h.container),
this.groupGraphicByIndex(b,h);for(f=0;g=n[f++];)h=x.getShape("rect",g.split("$$"),c),c.append(h.container),this.groupGraphicByIndex(b,h);for(f=0;g=q[f++];)h=x.getShape("ellipse",g.split("$$"),c),c.append(h.container),this.groupGraphicByIndex(b,h)}}catch(p){throw p;}},restore:function(b,c,f){var g=this.containerArray;r.inactive();s.inactive();p.inactive();q.inactive();g[b]||(g[b]={});g[b][c]=f;b===d.getBookType()&&this.restoreByIndex(c,f)},setContainers:function(b,c,d){document.createElementNS&&this.restore(b,
c,d)},addEvents:function(b){var c,f=-1,g=d.getCurrentPages(),h=this.containerArray[d.getBookType()];if(document.createElementNS&&h)for(;f++<g.length;)c=g[f],h[c]&&this.addEvent(c,h[c],b)}});l=window.AnnotationShapes=new c})(window.jQuery,window.Class,window.BookInfo);
var NoteCookie=Class({statics:{noteCookie:function(b){void 0==this._noteCookie&&(this._noteCookie=new NoteCookie(b));return this._noteCookie}},create:function(b){this.noteImgs={};this.rowObjs={};this.noteTexts={};this.svgObjs={};this.notes=[];this.cookieName=window.location.href.replace(window.location.hash,"")+"NoteCookie";this.rows=[];this.noteImgContainers={};this.showFlag=!1;this.container=b;this.address=uiBaseURL;this.noteButtonIsShow=!0;this.createNote(b);this.bindEvents()},createNote:function(b){var c=
this;this.note=$("<div class='noteCookie-note'></div>").css({left:"40%"}).appendTo(b).hide();this.noteTitle=$("<div class='noteCookie-noteTitle'></div>").append($("<span class='noteCookie-noteTitle-text'></span>").html("Notes")).appendTo(this.note);this.noteTitleShowBtn=$("<div class='noteCookie-noteTitle-showBtn'></div>").css({right:32}).attr("title","Minimize").append($("<img style='margin-left: 3px;margin-top: 3px;'/>").attr("src",this.address+"note_narrow.png")).appendTo(this.noteTitle);this.noteTitleCloseBtn=
$("<div class='noteCookie-noteTitle-closeBtn'></div>").css({right:3}).attr("title","Close").append($("<img style='margin-left: 3px;margin-top: 3px;'/>").attr("src",this.address+"note_close.png")).appendTo(this.noteTitle);this.noteButton=$("<div class='noteCookie-noteButton'></div>").appendTo(this.note);var d=$("<div style='position: relative;width: 100%;height: 158px;'></div>").appendTo(this.noteButton);this.noteBottomTop=$("<div class='noteCookie-noteButton-top'></div>").appendTo(d);this.inputText=
$("<textarea class='noteCookie-noteButton-inputText'></textarea>").appendTo(this.noteBottomTop);this.addBtn=$("<div class='noteCookie-noteButton-addBtn'></div>").css({left:10}).html("Add").appendTo(this.noteBottomTop);this.removeAllBtn=$("<div class='noteCookie-noteButton-removeAllBtn'></div>").css({left:"auto",right:20}).html("Remove All").appendTo(this.noteBottomTop);this.noteLists=$("<div class='noteCookie-noteList'></div>").appendTo(this.noteButton);var d=$("<div class='noteCookie-noteTable-row-th'></div>"),
f=$("<span class='noteCookie-noteTable-cellLeft-th'></span>").html("Page"),g=$("<div class='noteCookie-noteTable-cellRight-th'></div>");g.append($("<div style='position: absolute;width: 1px;height: 22px;left: 0px;top: 3px;background-color: #FFFFFF;'></div>")).append($("<span style='position: absolute;width: 319px;height: 100%;left: 1px;text-indent: 6px;'></span>").html("Title")).append($("<div style='position: absolute;width: 1px;height: 22px;left: auto;right: 89px;top: 3px;background-color: #FFFFFF;'></div>")).append($("<span style='position: absolute;width: 34px;height: 100%;left: auto;right: 55px;text-indent: 4px;'></span>").html("Edit")).append($("<div style='position: absolute;width: 1px;height: 22px;left: auto;right: 54px;top: 3px;background-color: #FFFFFF;'></div>")).append($("<span style='position: absolute;width: 54px;height: 100%;left: auto;right: 0px;text-indent: 4px;'></span>").html("Delete"));
d.append(f).append(g);this.noteLists.append(d);this.noteTable=$("<div class='noteCookie-noteTable'></div>").css({maxHeight:188}).appendTo(this.noteLists);this.noteTableInner=$("<div class='noteCookie-noteTable-inner'></div>").appendTo(this.noteTable);isTouch||this.note.transition3D();this.createScrollBar(this.noteTable);try{var h=this.getLocalStorage(this.cookieName),k=eval(h);if(k)for(this.downJSonArrByKey(k,"page"),h=0;h<k.length;h++)this.addListData($.extend(k[h],{firstDown:!0}))}catch(l){}for(h=
0;h<this.rows.length;h++)this.rows[h].rowObj.css({backgroundColor:0==h%2?"":"#bababa"});this.scrollBarShowHide();var m,n;this.noteTitle.on("mousedown touchstart",function(d){d.preventDefault();d.stopPropagation();d=d.originalEvent.touches?d.originalEvent.touches[0]:d;m=d.clientX-c.note.position().left;n=d.clientY-c.note.position().top;b.add(c.noteImgContainers[BookInfo.getBookType()][BookInfo.getCurrentPages()[0]]).add(c.noteImgContainers[BookInfo.getBookType()][BookInfo.getCurrentPages()[1]]).on("mousemove.noteMove touchmove.noteMove",
function(b){b.preventDefault();b.stopPropagation();c.noteTitle.css({cursor:"move"});b=b.originalEvent.touches?b.originalEvent.touches[0]:b;c.note.css({left:b.clientX-m,top:b.clientY-n})});b.on("mouseup.noteMove touchend.noteMove",function(d){d.preventDefault();d.stopPropagation();c.noteTitle.css({cursor:"default"});b.add(c.noteImgContainers[BookInfo.getBookType()][BookInfo.getCurrentPages()[0]]).add(c.noteImgContainers[BookInfo.getBookType()][BookInfo.getCurrentPages()[1]]).off("mousemove.noteMove touchmove.noteMove");
b.off("mouseup.noteMove touchend.noteMove")});return!1})},isNoteListShowHide:function(){0<this.noteTableInner.children("div").length?this.noteLists.show():this.noteLists.hide()},updateListDataText:function(b,c){var d=this.noteTexts[b],f=this.noteImgs[b].find(".noteCookie-eachNote-img"),d=d.find(".noteCookie-eachNote-textList-text");f.attr("title",c);d.val(c)},updateNoteImgText:function(b,c){this.rowObjs[b].find(".noteCookie-noteTable-cellRight-text").val(c)},deleteListData:function(b){var c=this.noteTexts[b],
d=this.svgObjs[b];this.noteImgs[b].remove();c.remove();d.remove();delete this.noteImgs[b];delete this.rowObjs[b];delete this.noteTexts[b];delete this.svgObjs[b]},deleteNoteImg:function(b){this.rowObjs[b].remove();delete this.noteImgs[b];delete this.rowObjs[b]},revertNoteImgText:function(b){var c=this.noteTexts[b].find(".noteCookie-eachNote-textList-text");b=this.rowObjs[b].find(".noteCookie-noteTable-cellRight-text");c.val(b.val())},addListData:function(b){var c=this,d=!0,f=$("<div class='noteCookie-noteTable-row' style='position: relative;cursor: pointer;'></div>").css({height:28}).attr("data-key",
b.key).attr("data-page",b.page).append($("<span class='noteCookie-noteTable-cellLeft'></span>").html(b.page)).appendTo(c.noteTableInner),g=$("<span class='noteCookie-noteTable-cellRight' style=' position: absolute;width: 410px;height: 100%;left: 54px;z-index: 2;'></span>").appendTo(f),h=$("<input class='noteCookie-noteTable-cellRight-text' disabled='true'/>").attr("disabled",d).val(b.value).appendTo(g),k=$("<div class='noteCookie-noteTable-cellRight-edit'></div>").css({right:60}).attr("title","Edit").append($("<img style='margin-left: 3px;margin-top: 3px;'/>").attr("src",
c.address+"note_edit.png")).appendTo(g);$("<div class='noteCookie-noteTable-cellRight-del'></div>").css({right:15}).attr("title","Delete").append($("<img style='margin-left: 0px;margin-top: 3px;'/>").attr("src",c.address+"note_del.png")).appendTo(g).on("click touchend",function(b){f.remove();var d=f.attr("data-key");c.deleteListData(d);c.delArrayOrderKey(c.rows,d);c.delArrayOrderKey(c.notes,d);c.addLocalStorage(c.cookieName,c.parseJSONArrayToString(c.notes));for(d=0;d<c.rows.length;d++)c.rows[d].rowObj.css({backgroundColor:0==
d%2?"":"#bababa"});c.scrollBarShowHide();b.preventDefault();b.stopPropagation();return!1});f.on("click touchend",function(b){gotoPageFun($(this).attr("data-page"))});k.on("click touchend",function(b){if(d)d=!1,h.css({backgroundColor:"#ffffff",color:"#000000"}),k.children("img").attr("src",c.address+"note_save.png"),h.attr("disabled",d),h[0].focus(),k.attr("title","Save");else{d=!0;h.css({backgroundColor:"transparent",color:"#1a1a1a"});h.attr("disabled",d);k.attr("title","Edit");var g=h.val();k.children("img").attr("src",
c.address+"note_edit.png");var n=f.attr("data-key");c.updateListDataText(n,g);c.updateArrayOrderKey(c.notes,n,{value:g});c.addLocalStorage(c.cookieName,c.parseJSONArrayToString(c.notes))}b.preventDefault();b.stopPropagation();return!1});c.rows.push($.extend(b,{rowObj:f}));c.rowObjs[b.key]=f;c.scrollBarShowHide();c.notes.push(b);c.addLocalStorage(c.cookieName,c.parseJSONArrayToString(c.notes))},addNoteImg:function(b,c){var d=this,f=!0,g=$("<div class='noteCookie-eachNote'></div>").attr("data-key",
b.key).attr("data-page",b.page).css({left:""+b.left+"",top:""+b.top+""}).appendTo(c),h=$("<img class='noteCookie-eachNote-img' style=' position: absolute;width: 56px;height: 56px;z-index: 2;'/>").attr("src",d.address+"note.png").attr("title",b.value).attr("data-key",b.key).attr("data-page",b.page).appendTo(g);isTouch||g.transition3D();try{var k=$(document.createElementNS("http://www.w3.org/2000/svg","svg")).css({zIndex:140,position:"absolute"}).attr("class","noteCookie-eachNote-svg noteCookie-eachNote-svg"+
b.page).appendTo(BookInfo.container()),l=$(document.createElementNS("http://www.w3.org/2000/svg","path")).css({fill:"#FFF4A1",stroke:"#C99F1D",strokeWidth:1}).appendTo(k)}catch(m){k=$("<svg></svg>").css({zIndex:140,position:"absolute"}).attr("class","noteCookie-eachNote-svg noteCookie-eachNote-svg"+b.page).appendTo(BookInfo.container()),l=$("<path></path>").css({fill:"#FFF4A1",stroke:"#C99F1D",strokeWidth:1}).appendTo(k)}k.css({left:0,top:0,width:0,height:0}).hide();var n=$("<div class='noteCookie-eachNote-textList noteCookie-eachNote-text"+
b.page+"'></div>").attr("data-key",b.key).attr("data-page",b.page).hide().appendTo(BookInfo.container());n.css({left:g.offset().left,top:g.offset().top});n.on("click mousedown touchstart",function(b){b.preventDefault();b.stopPropagation();return!1});var q=$("<div class='noteCookie-eachNote-textList-top' style='position: absolute;width: 100%;height: 20px;left: 0px;top: 0px;background-color: #373737;border-top-left-radius: 2px;border-top-right-radius: 2px;z-index: 2;'></div>").appendTo(n),p=$("<div style='position: absolute;left: 4px;top: 0px;width: 24px;height: 20px;cursor: pointer;'></div>").append($("<img style='margin-top: 2px;margin-left: 4px;'/>").attr("src",
d.address+"showNoteList.png")).appendTo(q),s=$("<div class='noteCookie-eachNote-textList-topClose'></div>").css({right:2}).attr("title","Close").append($("<img style='margin-top: 1px;margin-left: 1px;'/>").attr("src",d.address+"noteImg_close.png")).appendTo(q),r=$("<div class='noteCookie-eachNote-textList-topSave'></div>").css({right:24}).attr("title","Save").append($("<img style='margin-top: 1px;margin-left: 0px;'/>").attr("src",d.address+"noteImg_save.png")).appendTo(q),t=$("<div class='noteCookie-eachNote-textList-topDel'></div>").css({right:46}).attr("title",
"Delete").append($("<img style='margin-top: 1px;margin-left: 0px;'/>").attr("src",d.address+"noteImg_del.png")).appendTo(q),v=$("<div class='noteCookie-eachNote-textList-textDiv' style='height: 120px;position: absolute;width: 100%;left: 0px;top: 20px;margin: 0px;border: 0px;padding: 0px;border-bottom-left-radius: 2px;border-bottom-right-radius: 2px;background-color: #FFF4A1;z-index: 2;'></div>").appendTo(n),u=$("<textarea class='noteCookie-eachNote-textList-text'></textarea>").val(b.value).appendTo(v);
$("<span class='noteCookie-eachNote-textList-topTitle'></span>").html(b.time).appendTo(v);u.on("mousedown click",function(b){b.stopPropagation()});isTouch||n.transition3D();p.on("click touchend",function(){d.noteButtonIsShow&&d.showFlag?(d.hide(),d.showFlag=!1):(d.show(),d.showFlag=!0)});var A,x,w,y,z,D;q.on("mousedown.note touchstart.note",function(b){w=g.offset().left;y=g.offset().top;z=n.offset().left;D=n.offset().top;A=(b.pageX||b.originalEvent.touches[0].pageX)-z;x=(b.pageY||b.originalEvent.touches[0].pageY)-
D;BookInfo.container().add(k).add(d.noteImgContainers[BookInfo.getBookType()][BookInfo.getCurrentPages()[0]]).add(d.noteImgContainers[BookInfo.getBookType()][BookInfo.getCurrentPages()[1]]).on("mousemove.noteB touchmove.noteB",function(b){q.css({cursor:"move"});b=isTouch?b.originalEvent.touches[0]:b;n.css({left:Math.floor(b.clientX-A),top:b.clientY-x});d.drawSVG(w,y,n.offset().left,n.offset().top,k,l)});BookInfo.container().add(k).add(q).on("mouseup.noteB touchend.noteB",function(){q.css({cursor:"default"});
BookInfo.container().add(k).add(d.noteImgContainers[BookInfo.getBookType()][BookInfo.getCurrentPages()[0]]).add(d.noteImgContainers[BookInfo.getBookType()][BookInfo.getCurrentPages()[1]]).off("mousemove.noteB touchmove.noteB");BookInfo.container().add(k).add(q).off("mouseup.noteB touchend.noteB")});b.stopPropagation();b.preventDefault();return!1});var C,B,L;s.on("click touchend",function(b){d.revertNoteImgText(g.attr("data-key"));n.hide();k.hide();E=!1});r.on("click touchend",function(b){b=u.val();
h.attr("title",b);var c=g.attr("data-key");d.updateNoteImgText(c,b);d.updateArrayOrderKey(d.notes,c,{value:b});d.addLocalStorage(d.cookieName,d.parseJSONArrayToString(d.notes));n.hide();k.hide();E=!1});t.on("click touchend",function(b){C||(C=$("<div class='noteCookie-eachNote-textList-textDiv-bg' style='height: 100%;position: absolute;width: 100%;left: 0px;top: 0px;margin: 0px;border: 0px;padding: 0px;cursor: default;border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;background-color: #cccccc;z-index: 2;'></div>").appendTo(v),
$("<span class='noteCookie-eachNote-textList-textDiv-bgText' style=' position: absolute;left: 0px;top: 36px;font-family: Arial;font-size: 11px;width: 100%;text-align: center;height: 20px;line-height: 20px;color: #0A0A0A;z-index: 2;'></span>").html("Delete This Note!").appendTo(C),B=$("<div class='noteCookie-eachNote-textList-textDiv-bgYes'></div>").css({left:40}).html("Yes").appendTo(C),L=$("<div class='noteCookie-eachNote-textList-textDiv-bgNo'></div>").css({left:97}).html("No").appendTo(C),B.on("click touchend",
function(b){b=g.attr("data-key");d.deleteNoteImg(b);n.remove();k.remove();g.remove();b=g.attr("data-key");d.delArrayOrderKey(d.rows,b);d.delArrayOrderKey(d.notes,b);d.addLocalStorage(d.cookieName,d.parseJSONArrayToString(d.notes));d.scrollBarShowHide();for(b=0;b<d.rows.length;b++)d.rows[b].rowObj.css({backgroundColor:0==b%2?"":"#bababa"});C=null}),L.on("click touchend",function(){C.remove();C=null}))});var K=b.firstDown?!1:!0,E=!1,H=!1;h.on("mouseup.noteImgShowHide touchend.noteImgShowHide",function(b){if(isTouch||
1==b.which)if(K)K=!1;else return H?H=!1:E?(n.hide(),k.hide(),E=!1):(f&&(n.css({left:g.offset().left,top:g.offset().top}),f=!1),n.show(),k.show(),E=!0,d.drawSVG(g.offset().left,g.offset().top,n.offset().left,n.offset().top,k,l)),b.preventDefault(),b.stopPropagation(),!1});$(document).add(c).on("mousedown.noteImgShowHide touchstart.noteImgShowHide",function(){E&&(n.hide(),k.hide(),E=!1)});n.add(k).on("mousedown.noteImgShowHide touchstart.noteImgShowHide",function(b){b.preventDefault();b.stopPropagation();
return!1});var F,G,I,J,N,M=!1;h.bind(_event._down,function(b){b.stopPropagation();b.preventDefault();b=isTouch?b.originalEvent.touches[0]:b;F=parseFloat(g[0].offsetLeft);G=parseFloat(g[0].offsetTop);I=b.clientX;J=b.clientY;N=h.attr("data-key");M=!0;if(E)var f=n.offset().left,l=n.offset().top,m=k.offset().left,q=k.offset().top;c.on("mousemove.noteObj touchmove.noteObj",function(b){b.stopPropagation();b.preventDefault();if(M){g.css({cursor:"move"});b=isTouch?b.originalEvent.touches[0]:b;var h=F*BookInfo.scale()-
(I-b.clientX),p=G*BookInfo.scale()-(J-b.clientY),h=h/(c.width()*BookInfo.scale())*100+"%",p=p/(c.height()*BookInfo.scale())*100+"%";g.css({left:h,top:p});E&&(n.css({left:f+(b.clientX-I),top:l+(b.clientY-J)}),k.css({left:m+(b.clientX-I),top:q+(b.clientY-J)}));if(8<Math.abs(b.clientX-I)||8<Math.abs(b.clientY-J))H=!0;d.updateArrayOrderKey(d.notes,N,{left:h,top:p});d.addLocalStorage(d.cookieName,d.parseJSONArrayToString(d.notes))}});c.add(h).on("mouseup.noteObj touchend.noteObj",function(b){M&&(g.css({cursor:"default"}),
H=M=!1,c.off("mousemove.noteObj touchmove.noteObj"),c.add(h).off("mouseup.noteObj touchend.noteObj"))});return!1});q.bind(_event._down,function(){$(".noteCookie-eachNote-textList").removeClass("noteCookie-eachNote-textList-current");$(".noteCookie-eachNote").removeClass("noteCookie-eachNote-textList-current");n.addClass("noteCookie-eachNote-textList-current");g.addClass("noteCookie-eachNote-textList-current")});d.noteImgs[b.key]=g;d.noteTexts[b.key]=n;d.svgObjs[b.key]=k},addNoteImgByPageIndex:function(b,
c){c.find(".noteCookie-eachNote").remove();$(".noteCookie-eachNote-text"+b).remove();$(".noteCookie-eachNote-svg"+b).remove();for(var d=0;d<this.notes.length;d++)this.notes[d].page===b&&this.addNoteImg(this.notes[d],c)},addListDataAndNoteImg:function(b,c){this.addListData(b);this.addNoteImg(b,c)},drawSVG:function(b,c,d,f,g,h){var k,l,m,n,q,p;b+28>=d+90.5&&c+28<=f?(p=c+28,f-=p,b+28<=d+109?(q=b+28,n=d+181-24-b+28,c=b=0,k=d+181-24-48-q,l=f,d=d+181-24-q):(q=d+109,d+181-24>=b+28?(n=48,b=b+28-q):b=n=b+
28-q,k=c=0,l=f,d=48),m=f):b+28<d+90.5&&c+28<=f?(p=c+28,f-=p,b+28<=d+24?(q=b+28,n=d+24+48-q,c=b=0,k=n-48,l=f,d=n):(q=d+24,d+24+48<=b+28?b=n=b+28-q:(n=48,b=b+28-q),k=c=0,l=f,d=48),m=f):b+28>=d+90.5&&c>=f+141-28?(p=f+141,f=c+28-p,b+28<=d+109?(q=b+28,n=d+181-24-b+28,b=0,c=f,k=d+181-24-48-q,l=0,d=d+181-24-q):(q=d+109,d+181-24>=b+28?(n=48,b=b+28-q):b=n=b+28-q,c=f,l=k=0,d=48),m=0):b+28<d+90.5&&c>=f+141-28?(p=f+141,f=c+28-p,b+28<=d+24?(q=b+28,n=d+24+48-q,b=0,c=f,k=n-48,l=0,d=n):(q=d+24,d+24+48<=b+28?b=n=
b+28-q:(n=48,b=b+28-q),c=f,l=k=0,d=48),m=0):d+181<=b+28&&c+28>=f&&c+28<=f+70.5?(q=d+181,n=b+28-q,c+28<=f+20?(p=c+28,f=f+20+48-p,b=n,k=c=0,l=f-48,d=0,m=f):f+20+48<=c+28?(p=f+20,f=c+28-p,b=n,c=f,d=l=k=0,m=48):(p=f+20,f=48,b=n,c=c+28-p,d=l=k=0,m=f)):d+181<=b+28&&c+28<=f+141&&c+28>=f+70.5?(q=d+181,n=b+28-q,c+28<=f+141-20-48?(p=c+28,f=f+141-20-p,b=n,k=c=0,l=f-48,d=0,m=f):f+141-20<=c+28?(p=f+141-68,f=c+28-p,b=n,c=f,d=l=k=0,m=48):(p=f+141-68,f=48,b=n,c=c+28-p,d=l=k=0,m=f)):d>=b+28&&c+28>=f&&c+28<=f+70.5?
(q=b+28,n=d-q,c+28<=f+20?(p=c+28,f=f+20+48-p,c=b=0,k=n,l=f-48,d=n,m=f):f+20+48<=c+28?(p=f+20,f=c+28-p,b=0,c=f,k=n,l=0,d=n,m=48):(p=f+20,f=48,b=0,c=c+28-p,k=n,l=0,d=n,m=f)):d>=b+28&&c+28<=f+141&&c+28>=f+70.5?(q=b+28,n=d-q,c+28<=f+141-20-48?(p=c+28,f=f+141-20-p,c=b=0,k=n,l=f-48,d=n,m=f):f+141-20<=c+28?(p=f+141-68,f=c+28-p,b=0,c=f,k=n,l=0,d=n,m=48):(p=f+141-68,f=48,b=0,c=c+28-p,k=n,l=0,d=n,m=f)):(l=k=c=b=n=f=p=q=0,d=48,m=0);g.show().css({width:n,height:f,left:q,top:p});h.attr("d","M"+d+","+m+" L"+b+
","+c+" L"+k+","+l)},bindEvents:function(){var b=this,c=!1,d=function(){$.each(BookInfo.getCurrentPages(),function(c,d){if(b.noteImgContainers[BookInfo.getBookType()]){var h=b.noteImgContainers[BookInfo.getBookType()][d];h&&(h.css({cursor:""}),h.off("mousedown.addNote touchstart.addNote"))}});c=!1};BookInfo.container().on("mousedown.addNote touchstart.addNote",function(){d()});b.addBtn.bind(_event._end,function(f){var g=b.inputText.val();if(g){b.noteButtonIsShow=!1;b.noteTitleShowBtn.children("img").attr("src",
b.address+"note_revert.png");b.noteButton.css({maxHeight:0,paddingBottom:0});c=!0;var h=BookInfo.getCurrentPages();$.each(h,function(f,h){var m=b.noteImgContainers[BookInfo.getBookType()][h];if(m)m.css({cursor:"url("+b.address+"note.png),auto"}).on(_event._down,function(f){b.noteButtonIsShow=!1;b.noteTitleShowBtn.children("img").attr("src",b.address+"note_revert.png");b.noteButton.css({maxHeight:0});if(c){if(!f.which||3!=f.which){var k=(f.pageX||f.originalEvent.touches[0].pageX)-m.offset().left;f=
(f.pageY||f.originalEvent.touches[0].pageY)-m.offset().top;k=k/(m.width()*BookInfo.scale())*100+"%";f=f/(m.height()*BookInfo.scale())*100+"%";k={key:(new Date).getTime(),time:(new Date).format("yyyy-MM-dd hh:mm:ss",!0),value:g,left:k,top:f,page:h};b.addListDataAndNoteImg(k,$(this));b.downJSonArrByKey(b.rows,"page");$(".noteCookie-noteTable-row").detach();for(k=0;k<b.rows.length;k++)b.rows[k].rowObj.css({backgroundColor:0==k%2?"":"#bababa"}),b.rows[k].rowObj.appendTo(b.noteTableInner);b.scrollBarShowHide();
b.inputText.val("")}d()}})})}f.preventDefault();f.stopPropagation();return!1});b.noteTitleShowBtn.on(_event._down,function(){b.noteButtonIsShow?(b.noteButtonIsShow=!1,b.noteTitleShowBtn.children("img").attr("src",b.address+"note_revert.png"),b.noteButton.css({maxHeight:0,paddingBottom:0})):(b.noteButtonIsShow=!0,b.noteTitleShowBtn.children("img").attr("src",b.address+"note_narrow.png"),b.noteButton.css({maxHeight:9999,paddingBottom:6}))});b.noteTitleCloseBtn.on("click.note touchend.note",function(c){void 0!=
b.onCreated?b.onCreated[1].call(b.onCreated[0]):b.hide();c.preventDefault();c.stopPropagation();return!1});b.removeAllBtn.on("click.note touchend.note",function(){$(".noteCookie-eachNote").remove();$(".noteCookie-eachNote-svg").remove();$(".noteCookie-eachNote-textList").remove();$(".noteCookie-noteTable-row").remove();b.notes=[];b.rowObjs={};b.noteImgs={};b.noteTexts={};b.svgObjs={};b.rows=[];b.addLocalStorage(b.cookieName,b.parseJSONArrayToString(b.notes));b.scrollBarShowHide()})},setContainers:function(b,
c,d){void 0==this.noteImgContainers[b]&&(this.noteImgContainers[b]={});this.noteImgContainers[b][c]=d;b==BookInfo.getBookType()&&($(".noteCookie-eachNote-textList").hide(),$(".noteCookie-eachNote-svg").hide(),this.addNoteImgByPageIndex(c,d))},show:function(){this.showFlag=!0;this.note.show();parseInt(this.note.css("left"))>this.container.width()&&this.note.css({left:"50%"});0>parseInt(this.note.css("top"))&&this.note.css({top:24});this.noteButtonIsShow=!0;this.noteTitleShowBtn.children("img").attr("src",
this.address+"note_narrow.png");this.noteButton.css({maxHeight:9999,paddingBottom:6});this.scrollBarShowHide()},hide:function(){this.showFlag=!1;this.note.hide()},bindOnCreated:function(b,c){this.onCreated=[b,c]},showHide:function(){this.showFlag?this.hide():this.show()},parseJSONArrayToString:function(b){if(0!=b.length){for(var c="[",d=0;d<b.length;d++)c+="{key:'"+b[d].key+"',value:'"+b[d].value+"',page:"+b[d].page+",time:'"+b[d].time+"',left:'"+b[d].left+"',top:'"+b[d].top+"'},";c=c.substring(0,
c.length-1);return c+"]"}},delArrayOrderKey:function(b,c){if(b)for(var d=0;d<b.length;d++)b[d].key&&b[d].key==c&&b.remove(d)},updateArrayOrderKey:function(b,c,d){if(b)for(var f=0;f<b.length;f++)b[f].key&&b[f].key==c&&$.extend(b[f],d)},downJSonArrByKey:function(b,c){b.sort(function(b,f){return parseInt(b[c])>parseInt(f[c])?1:parseInt(b[c])==parseInt(f[c])?0:-1})},isArray:function(b){return"[object Array]"==Object.prototype.toString.call(b)},getLocalStorage:function(b){try{if(window.localStorage)return window.localStorage.getItem(b);
for(var c=document.cookie.split("; "),d=0;d<c.length;d++){var f=c[d].split("=");if(f[0]==b)return unescape(f[1])}return""}catch(g){}},addLocalStorage:function(b,c){try{if(window.localStorage)window.localStorage.setItem(b,c);else{var d=b+"="+escape(c),f=new Date;f.setTime(f.getTime()+864E8);d+="; expires="+f.toGMTString();document.cookie=d}}catch(g){}},createScrollBar:function(b){b=$("<div>",{"class":"ScrollBar",css:{position:"absolute",width:6,height:"100%",backgroundColor:"#a8a8a8",borderRadius:0,
right:0,top:0,zIndex:99,borderLeft:"1px solid #ffffff"}}).appendTo(b);var c=$("<div>",{"class":"OuterScroll",css:{position:"absolute",width:6,height:"100%",left:0,top:0,backgroundColor:"transparent",borderRadius:0,overflow:"hidden",cursor:"pointer"}}).appendTo(b);$("<div>",{"class":"InnerScroll",css:{position:"absolute",width:6,height:"100%",marginLeft:0,marginRight:0,left:0,top:0,backgroundColor:"#5e5e5e",borderRadius:0,cursor:"pointer"}}).appendTo(c);this.scrollBar=b;this.outerScroll=c;this.bindScrollBarEvents(b,
c,this.noteTable,this.noteTableInner)},scrollBarShowHide:function(){var b=this.noteTable.outerHeight()*this.scrollBar.outerHeight()/this.noteTableInner.outerHeight();this.outerScroll.css({height:b});this.isNoteListShowHide();this.noteTable.height()>=this.noteTableInner.height()?(this.scrollBar.hide(),this.noteTableInner.css({top:0})):(this.scrollBar.show(),Math.abs(parseFloat(this.noteTableInner.css("top")))>this.noteTableInner.outerHeight()-this.noteTable.outerHeight()&&(this.noteTableInner.css({top:-(this.noteTableInner.outerHeight()-
this.noteTable.outerHeight())}),this.outerScroll.css({top:this.scrollBar.outerHeight()-this.outerScroll.outerHeight()})))},bindScrollBarEvents:function(b,c,d,f){var g=this;c.on(_event._down,function(b){var d=b||event,l=d.clientY-g.outerScroll.position().top,m=b.which;b.stopPropagation();1==m&&($(document).on("mousemove.scrollBar touchmove.scrollBar",function(b){b.preventDefault();b.stopPropagation();d=b||event;b=d.clientY-l;0>=b?b=0:b>=g.scrollBar.outerHeight()-g.outerScroll.outerHeight()&&(b=g.scrollBar.outerHeight()-
g.outerScroll.outerHeight());c.css({top:b});f.css({top:-b/(g.scrollBar.outerHeight()-g.outerScroll.outerHeight())*(g.noteTableInner.outerHeight()-g.noteTable.outerHeight())})}),$(document).on("mouseup.scrollBar touchend.scrollBar",function(b){b=b||event;b.preventDefault();b.stopPropagation();$(document).off("mousemove.scrollBar touchmove.scrollBar");$(document).off("mouseup.scrollBar touchend.scrollBar")}))});d.bind($.browser.mozilla?"DOMMouseScroll":"mousewheel",function(g){if(!(d.outerHeight()>=
f.outerHeight())){var k=g.originalEvent,k=k.wheelDelta||-k.detail,l=f.position().top,m;f.stop(!1,!1);0<k?m=0>l+d.outerHeight()/11?l+d.outerHeight()/11:0:0>k&&(m=f.outerHeight()-d.outerHeight()>-(l-d.outerHeight()/11)?l-d.outerHeight()/11:-(f.outerHeight()-d.outerHeight()));f.css({top:m});c.css({top:-m/(f.outerHeight()-d.outerHeight())*(b.outerHeight()-c.outerHeight())});g.stopPropagation();g.preventDefault();return!1}})}}),Signature=Class({statics:{signature:function(b){void 0==this._signature&&(this._signature=
new Signature(b));return this._signature}},create:function(b){this.container=b;this.address=uiBaseURL;this.disableCss={boxShadow:"rgba(0, 0, 0, 0.6) 0px 1px 4px inset",backgroundColor:"#cccccc",textShadow:"0 1px 1px white",color:"rgb(165, 148, 148)",cursor:"default"};this.normalCss={boxShadow:"inset 0px 1px 0px rgba(255, 255, 255, 0.5), 0px 1px 2px rgba(0, 0, 0, 0.2)",backgroundColor:"#E4E4E4",color:"#464343",textShadow:"",cursor:"pointer"};this.overCss={};this.downCss={backgroundColor:"#E4E4E4",
color:"#374f00",boxShadow:"inset 0px 1px 3px rgba(0, 0, 0, 0.3), 0px 1px 0px white",textShadow:"0px 1px 0px rgba(255, 255, 255, 0.4)"};this.natureMessage="Welcome to the signature manager! Here, you can draw,type, or upload signatures to use on the PDF documents you sign.";this.writeMessage='Type your signature below, then press the "Save" or "Save & Use" button to proceed.';this.drawMessage='Draw your signature below, then press the "Save" or "Save & Use" button to proceed.';this.redoIsUse=this.undoIsUse=
this.clearAllFalg=this.hasDrawFlag=this.showFlag=this.hasAndChangeText=!1;this.drawOldData=this.currentDrawDel=this.currentDrawEdit=this.currentDrawSave=this.currentWriteDel=this.currentWriteEdit=this.currentWriteSave=null;this.drawOldPoints=[];this.savePoints=[];this.saveText=null;this.signatureName=window.location.href.replace(window.location.hash,"")+"Signature";this.signatureCookies=[];this.currentObj=null;this.signatureContexts={};try{this.createSignature(b)}catch(c){}this.toolBar=this.createToolBar(b)},
createToolBar:function(b){var c=this;this.showTimeFalg={};this.oldData={};var d=$("<div class='flipHTML5Signature-toolBar' style='position: absolute;width: 144px;height: 32px;background-color: rgba(0, 0, 0, 0.8);border-radius: 4px;z-index: 9998;'></div>").appendTo(b).hide();b=$("<div class='flipHTML5Signature-toolBar-del'></div>").css({left:4}).append($("<img style='margin-left: 3px;margin-top: 3px;'/>").attr("src",this.address+"signature_del.png")).appendTo(d);var f=$("<div class='flipHTML5Signature-toolBar-up'></div>").css({left:32}).append($("<img style='margin-left: 3px;margin-top: 3px;'/>").attr("src",
this.address+"signature_up.png")).appendTo(d),g=$("<div class='flipHTML5Signature-toolBar-down'></div>").css({left:60}).append($("<img style='margin-left: 3px;margin-top: 3px;'/>").attr("src",this.address+"signature_down.png")).appendTo(d),h=$("<div class='flipHTML5Signature-toolBar-revert'></div>").css({left:88}).append($("<img style='margin-left: 2px;margin-top: 4px;'/>").attr("src",this.address+"signature_revert.png")).appendTo(d),k=$("<div class='flipHTML5Signature-toolBar-date'></div>").css({left:116}).append($("<img style='margin-left: 3px;margin-top: 4px;'/>").attr("src",
this.address+"signature_date.png")).appendTo(d);b.on("click touchend",function(b){c.currentObj&&(c.currentObj.remove(),d.hide(),b=c.currentObj.attr("data-key"),delete c.showTimeFalg[b],delete c.oldData[b],c.delArrayOrderKey(c.signatureCookies,b),c.addLocalStorage(c.signatureName,c.parseToString(c.signatureCookies)))});f.on("click touchend",function(){if(c.currentObj){var b=c.currentObj.width(),d=c.currentObj.height(),f=b+11;c.currentObj.css({width:f,height:f/(b/d)});b=c.currentObj.attr("data-key");
d=c.parseObject(c.currentObj[0]);c.updateArrayOrderKey(c.signatureCookies,b,{width:d.width,height:d.height});c.addLocalStorage(c.signatureName,c.parseToString(c.signatureCookies));c.showTimeFalg[b]&&c.reviseDateTag()}});g.on("click touchend",function(){if(c.currentObj){var b=c.currentObj.width(),d=c.currentObj.height(),f=0>=b-11?5:b-11;c.currentObj.css({width:f,height:f/(b/d)});b=c.currentObj.attr("data-key");d=c.parseObject(c.currentObj[0]);c.updateArrayOrderKey(c.signatureCookies,b,{width:d.width,
height:d.height});c.addLocalStorage(c.signatureName,c.parseToString(c.signatureCookies));c.showTimeFalg[b]&&c.reviseDateTag()}});h.on("click touchend",function(){if(c.currentObj){var b=c.currentObj.attr("data-key");c.currentObj.css({width:c.oldData[b].width,height:c.oldData[b].height});c.showTimeFalg[b]&&c.reviseDateTag();var d=c.parseObject(c.currentObj[0]);c.updateArrayOrderKey(c.signatureCookies,b,{width:d.width,height:d.height});c.addLocalStorage(c.signatureName,c.parseToString(c.signatureCookies))}});
k.on("click touchend",function(){var b=c.currentObj.attr("data-key");c.showTimeFalg[b]?(c.currentObj.find(".flipHTML5Signature-eachDate").hide(),c.showTimeFalg[b]=!1):(c.reviseDateTag(),c.currentObj.find(".flipHTML5Signature-eachDate").show(),c.showTimeFalg[b]=!0)});d.on("mousedown touchstart",function(b){b.preventDefault();b.stopPropagation();return!1});this.container.add($(document)).add(BookInfo.container()).on("mousedown.hideToolBar touchstart.hideToolBar",function(){d.hide()});return d},createSignature:function(b){var c=
this;this.$signature=$("<div class='flipHTML5Signature'></div>").css({width:560}).appendTo(b).hide();this.$signatureTitle=$("<div class='flipHTML5Signature-title'></div>").append($("<span class='flipHTML5Signature-titleText'></span>").html("Signature Manager")).appendTo(this.$signature);this.$closeBtn_title=$("<div class='flipHTML5Signature-titleClose' style='right: 6px;top: 4px;width: 20px;height: 20px;'></div>").append($("<img style='margin-left: 2px;margin-top: 2px;'/>").attr("src",this.address+
"signature_close.png")).appendTo(this.$signatureTitle);try{var d=this.getLocalStorage(this.signatureName);this.signatureCookies=d&&"undefined"!=d?eval(d):[]}catch(f){}var g,h;this.$signatureTitle.on("mousedown touchstart",function(d){d.preventDefault();d.stopPropagation();d=d.originalEvent.touches?d.originalEvent.touches[0]:d;g=d.clientX-c.$signature.position().left;h=d.clientY-c.$signature.position().top;b.add($(document)).add(c.signatureContexts[BookInfo.getBookType()][BookInfo.getCurrentPages()[0]]).add(c.signatureContexts[BookInfo.getBookType()][BookInfo.getCurrentPages()[1]]).on("mousemove.signatureMove touchmove.signatureMove",
function(b){c.$signatureTitle.css({cursor:"move"});b=b.originalEvent.touches?b.originalEvent.touches[0]:b;c.$signature.css({left:b.clientX-g,top:b.clientY-h})});b.add($(document)).on("mouseup.signatureMove touchend.signatureMove",function(){c.$signatureTitle.css({cursor:"default"});b.add($(document)).add(c.signatureContexts[BookInfo.getBookType()][BookInfo.getCurrentPages()[0]]).add(c.signatureContexts[BookInfo.getBookType()][BookInfo.getCurrentPages()[1]]).off("mousemove.signatureMove touchmove.signatureMove");
b.add($(document)).off("mouseup.signatureMove touchend.signatureMove")});return!1});this.createSignatureUnder(this.$signature);this.createWriteTypeUnder(this.$signature);this.createDrawTypeUnder(this.$signature)},createSignatureUnder:function(b){var c=this;this.$signatureUnder=$("<div class='flipHTML5Signature-nuder' style='position: relative;left: 0px;width: 100%;height: 260px;background-color: #C7C7C7;'></div>").append($("<div class='flipHTML5Signature-nuderMessage'></div>").html(this.natureMessage)).appendTo(b);
this.$underClose=$("<div class='flipHTML5Signature-nuderClose'></div>").html("Close").appendTo(this.$signatureUnder);this.$closeBtn_title.add(this.$underClose).on("click.signature touchend.signature",function(){void 0!=c.onCreated?c.onCreated[1].call(c.onCreated[0]):c.hide()});this.createEachTypes(this.$signatureUnder)},createEachTypes:function(b){var c=this,d={width:52,left:57,borderTopLeftRadius:5,borderBottomLeftRadius:5},f={width:70,left:111,borderTopRightRadius:5,borderBottomRightRadius:5};b=
$("<div class='flipHTML5Signature-nuderTypes' style='  position: absolute;left: 15px;top: 60px;width: 530px;height: 145px;'></div>").css({boxShadow:"inset 1px 1px 0px #a6a6a6, 1px 1px 0px #f6f6f6"}).appendTo(b);var g=$("<div class='flipHTML5Signature-nuderTypes-type' style=' position: absolute;left: 17px;top: 6px;width: 240px;height: 134px;'></div>").css({boxShadow:"0px 0px 1px #000000"}).append($("<span class='flipHTML5Signature-typeTitle'></span>").html("Type on Keyboard")).css({left:17}).appendTo(b),
g=$("<div class='flipHTML5Signature-typeUnder'></div>").appendTo(g),h=$("<div class='flipHTML5Signature-typeMid'></div>").appendTo(g),k=$("<div class='flipHTML5Signature-typeEdit-typeDel'></div>").css(d).html("Edit").appendTo(g).hide(),l=$("<div class='flipHTML5Signature-typeEdit-typeDel'></div>").css(f).html("Delete").appendTo(g).hide();b=$("<div class='flipHTML5Signature-nuderTypes-type' style=' position: absolute;left: 17px;top: 6px;width: 240px;height: 134px;'></div>").css({boxShadow:"0px 0px 1px #000000"}).append($("<span class='flipHTML5Signature-typeTitle'></span>").html("Draw with Mouse")).css({left:"auto",
right:17}).appendTo(b);b=$("<div class='flipHTML5Signature-typeUnder'></div>").appendTo(b);var m=$("<div class='flipHTML5Signature-typeMid'></div>").appendTo(b),n=$("<div class='flipHTML5Signature-typeEdit-typeDel'></div>").css(d).html("Edit").appendTo(b).hide(),q=$("<div class='flipHTML5Signature-typeEdit-typeDel'></div>").css(f).html("Delete").appendTo(b).hide();h.on("mouseover.signature touchstart.signature",function(){h.css({borderColor:"#ff0000"})});h.on("mouseout.signature touchend.signature",
function(){h.css({borderColor:"#cccccc"})});h.on(_event._down,function(b){b.preventDefault();b.stopPropagation();return!1});h.on(_event._end,function(b){var d=$(this).html();d?(c.$writeText.val(d),c.saveAndUseWrite(d)):(c.writeSave.add(c.writeSaveAndUse).removeClass("flipHTML5Signature-hover flipHTML5Signature-normal").css(c.disableCss),c.hasAndChangeText=!1,c.$signatureUnder.hide(),c.$drawTypeUnder.hide(),c.$writeTypeUnder.show(),c.$writeText.focus(),c.currentWriteSave=h,c.currentWriteEdit=k,c.currentWriteDel=
l);b.preventDefault();b.stopPropagation();return!1});k.on("click.signature touchend.signature",function(){c.currentWriteSave=h;c.currentWriteEdit=k;c.currentWriteDel=l;c.$writeText.val(h.html());c.writeSave.add(c.writeSaveAndUse).removeClass("flipHTML5Signature-normal flipHTML5Signature-hover").css(c.disableCss);c.hasAndChangeText=!1;c.$signatureUnder.hide();c.$drawTypeUnder.hide();c.$writeTypeUnder.show()});l.on("click.signature touchend.signature",function(){c.currentWriteSave=h;c.currentWriteEdit=
k;c.currentWriteDel=l;c.writeSave.add(c.writeSaveAndUse).removeClass("flipHTML5Signature-normal flipHTML5Signature-hover").css(c.disableCss);c.hasAndChangeText=!1;h.html("");c.$writeText.val("");k.hide();l.hide()});m.on("mouseover.signature touchstart.signature",function(){m.css({borderColor:"#ff0000"})});m.on("mouseout.signature touchend.signature",function(){m.css({borderColor:"#cccccc"})});m.on(_event._down,function(b){b.preventDefault();b.stopPropagation();return!1});m.on(_event._end,function(b){m.children("img").length?
c.saveAndUseDraw(c.drawOldData):(c.$signatureUnder.hide(),c.$writeTypeUnder.hide(),c.$drawTypeUnder.show(),c.currentDrawSave=m,c.currentDrawEdit=n,c.currentDrawDel=q);b.preventDefault();b.stopPropagation();return!1});n.on("click.signature touchend.signature",function(){c.currentDrawSave=m;c.currentDrawEdit=n;c.currentDrawDel=q;c.$signatureUnder.hide();c.$writeTypeUnder.hide();c.$drawTypeUnder.show()});q.on("click.signature touchend.signature",function(){try{c.currentDrawSave=m,c.currentDrawEdit=n,
c.currentDrawDel=q,c.undo.add(c.redo).add(c.clearAllBtn).add(c.drawSave).add(c.drawSaveAndUse).removeClass("flipHTML5Signature-normal flipHTML5Signature-hover").css(c.disableCss),c.undoIsUse=!1,c.redoIsUse=!1,c.clearAllFalg=!1,c.hasDrawFlag=!1,n.hide(),q.hide(),c.currentDrawSave&&c.currentDrawSave.empty(),c.context.clearRect(0,0,c.canvas.width,c.canvas.height),c.previewContext.clearRect(0,0,c.previewCanvas.width,c.previewCanvas.height),c.drawOldPoints=[],c.points=[],c.drawOldPoints.push([])}catch(b){}})},
createWriteTypeUnder:function(b){var c=this,d=!1,f;this.$writeTypeUnder=$("<div class='flipHTML5Signature-writeType' style='position: relative;left: 0px;width: 100%;height: 170px;background-color: #C7C7C7;'></div>").append($("<div class='flipHTML5Signature-nuderMessage'></div>").html(this.writeMessage)).appendTo(b).hide();this.$writeText=$("<input type='text' class='flipHTML5Signature-writeType-text' maxlength='35' style='position: absolute;width: 450px;height: 60px;left: 63px;top: 64px;font-family: Mistral;font-size: 28px;text-align: center;color: #000000;'/>").css({boxShadow:"rgb(166, 166, 166) 1px 1px 0px inset, rgb(246, 246, 246) 1px 1px 0px"}).appendTo(this.$writeTypeUnder);
this.writeSave=$("<div class='flipHTML5Signature-typeBtn flipHTML5Signature-type-save' style='left: 161px;'></div>").html("Save").appendTo(this.$writeTypeUnder);this.writeSaveAndUse=$("<div class='flipHTML5Signature-typeBtn flipHTML5Signature-type-save-use' style='left: 275px;'></div>").html("Save & Use").appendTo(this.$writeTypeUnder);b=$("<div class='flipHTML5Signature-typeBtn flipHTML5Signature-type-cancel'></div>").html("Cancel").appendTo(this.$writeTypeUnder);f=this.$writeText.val();this.writeSave.add(this.writeSaveAndUse).css(this.disableCss);
b.on("click touchend",function(b){c.$writeText.val(f);c.$writeTypeUnder.hide();c.$drawTypeUnder.hide();c.$signatureUnder.show();b.preventDefault()});this.writeSaveAndUse.on(_event._down,function(b){b.preventDefault();b.stopPropagation();return!1});this.writeSaveAndUse.on(_event._end,function(b){if(c.hasAndChangeText){var h=c.$writeText.val();(f=h)&&d&&(c.saveText=h,c.saveAndUseWrite(h))}b.preventDefault();b.stopPropagation();return!1});this.writeSave.on("click touchend",function(b){c.hasAndChangeText&&
(f=b=c.$writeText.val())&&d&&(c.saveText=b,c.saveWrite(b))});c.writeSave.on("mouseover.signature touchstart.signature",function(b){c.hasAndChangeText&&c.writeSave.removeClass("flipHTML5Signature-normal").addClass("flipHTML5Signature-hover").css(c.overCss)});c.writeSaveAndUse.on("mouseover.signature touchstart.signature",function(b){c.hasAndChangeText&&c.writeSaveAndUse.removeClass("flipHTML5Signature-normal").addClass("flipHTML5Signature-hover").css(c.overCss)});c.writeSave.on("mouseout.signature touchend.signature",
function(b){c.hasAndChangeText&&c.writeSave.removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss)});c.writeSaveAndUse.on("mouseout.signature touchend.signature",function(b){c.hasAndChangeText&&c.writeSaveAndUse.removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss)});c.writeSave.on("mousedown.signature",function(b){c.hasAndChangeText&&c.writeSave.removeClass("flipHTML5Signature-hover flipHTML5Signature-normal").css(c.downCss)});
c.writeSaveAndUse.on("mousedown.signature",function(b){c.hasAndChangeText&&c.writeSaveAndUse.removeClass("flipHTML5Signature-hover flipHTML5Signature-normal").css(c.downCss)});c.writeSave.add($(document)).on("mouseup.signature",function(b){c.hasAndChangeText&&c.writeSave.removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss)});c.writeSaveAndUse.add($(document)).on("mouseup.signature",function(b){c.hasAndChangeText&&c.writeSaveAndUse.removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss)});
this.$writeText.on("input propertychange",function(b){b=c.$writeText.val();d=!0;b&&d?(c.writeSave.add(c.writeSaveAndUse).css(c.normalCss).addClass("flipHTML5Signature-normal").removeClass("flipHTML5Signature-hover"),c.hasAndChangeText=!0):(c.hasAndChangeText=!1,c.writeSave.add(c.writeSaveAndUse).removeClass("flipHTML5Signature-hover flipHTML5Signature-normal").css(c.disableCss))})},createDrawTypeUnder:function(b){var c=this;this.$drawTypeUnder=$("<div class='flipHTML5Signature-drawType' style='position: relative;left: 0px;width: 100%;height: 340px;background-color: #C7C7C7;'></div>").append($("<div class='flipHTML5Signature-nuderMessage'></div>").html(this.drawMessage)).appendTo(b).hide();
this.drawSave=$("<div class='flipHTML5Signature-typeBtn flipHTML5Signature-type-save' style='left: 161px;'></div>").html("Save").appendTo(this.$drawTypeUnder);this.drawSaveAndUse=$("<div class='flipHTML5Signature-typeBtn flipHTML5Signature-type-save-use' style='left: 275px;'></div>").html("Save & Use").appendTo(this.$drawTypeUnder);b=$("<div class='flipHTML5Signature-typeBtn flipHTML5Signature-type-cancel'></div>").html("Cancel").appendTo(this.$drawTypeUnder);this.drawSave.add(this.drawSaveAndUse).removeClass("flipHTML5Signature-normal flipHTML5Signature-hover").css(this.disableCss);
this.drawSave.on("click touchend",function(){if(c.hasDrawFlag){var b=c.trimCanvas(x);c.savePoints=c.points.concat();c.savePoints.push({color:c.drawColor});c.saveDraw(b)}});this.drawSaveAndUse.on(_event._down,function(b){b.preventDefault();b.stopPropagation();return!1});this.drawSaveAndUse.on(_event._end,function(b){if(c.hasDrawFlag){var d=c.trimCanvas(x);c.savePoints=c.points.concat();c.savePoints.push({color:c.drawColor});c.saveAndUseDraw(d)}b.preventDefault();b.stopPropagation();return!1});c.drawSave.on("mouseover.signature touchstart.signature",
function(b){c.hasDrawFlag&&c.drawSave.removeClass("flipHTML5Signature-normal").addClass("flipHTML5Signature-hover").css(c.overCss)});c.drawSaveAndUse.on("mouseover.signature touchstart.signature",function(b){c.hasDrawFlag&&c.drawSaveAndUse.removeClass("flipHTML5Signature-normal").addClass("flipHTML5Signature-hover").css(c.overCss)});c.drawSave.on("mouseout.signature touchend.signature",function(b){c.hasDrawFlag&&c.drawSave.removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss)});
c.drawSaveAndUse.on("mouseout.signature touchend.signature",function(b){c.hasDrawFlag&&c.drawSaveAndUse.removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss)});c.drawSave.on("mousedown.signature",function(b){c.hasDrawFlag&&c.drawSave.removeClass("flipHTML5Signature-hover flipHTML5Signature-normal").css(c.downCss)});c.drawSaveAndUse.on("mousedown.signature",function(b){c.hasDrawFlag&&c.drawSaveAndUse.removeClass("flipHTML5Signature-hover flipHTML5Signature-normal").css(c.downCss)});
c.drawSave.add($(document)).on("mouseup.signature",function(b){c.hasDrawFlag&&c.drawSave.removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss)});c.drawSaveAndUse.add($(document)).on("mouseup.signature",function(b){c.hasDrawFlag&&c.drawSaveAndUse.removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss)});b.on("click touchend",function(){c.$writeTypeUnder.hide();c.$drawTypeUnder.hide();c.$signatureUnder.show()});b=$("<div class='flipHTML5Signature-drawTypeMid' style='position: absolute;left: 10px;top: 53px;width: 540px;height: 90px;'></div>").css({boxShadow:"rgb(166, 166, 166) 1px 1px 0px inset, rgb(246, 246, 246) 1px 1px 0px"}).appendTo(this.$drawTypeUnder);
var d=$("<div class='flipHTML5Signature-drawTypeMid-lineWidth' style='position: absolute;width: 180px;height: 16px;left: 20px;top: 15px;'></div>").appendTo(b).append($("<img>").attr("src",this.address+"pen.png")),f=$("<div style='position: absolute;width: 100px;height: 4px; background-color: #E0E0E0;left: 20px;top: 6px;border-radius: 2px;'></div>").css({boxShadow:"rgb(166, 166, 166) 1px 1px 0px inset, rgb(246, 246, 246) 1px 1px 0px"}).appendTo(d),g=$("<div style='position: absolute;cursor:pointer;width: 0px; height: 0px;border-bottom-width: 11px;border-style: solid;border-left-width: 6px;border-right-width: 6px;top: -3px;border-color: transparent;border-bottom-color: #373737;left: -4px;'></div>").appendTo(f),
h=$("<input type='text' style='position: absolute;width: 40px;height: 13px;left: 130px;top: 0px;'/>").appendTo(d),k=$("<div class='flipHTML5Signature-drawTypeMid-undo'></div>").css({left:28}).appendTo(b).html("UNDO"),l=$("<div class='flipHTML5Signature-drawTypeMid-redo'></div>").css({left:80}).appendTo(b).html("REDO"),m=$("<div class='flipHTML5Signature-drawTypeMid-clearAll'></div>").css({left:152,width:78}).html("Clear All").appendTo(b);this.clearAllBtn=m;k.add(l).add(m).removeClass("flipHTML5Signature-normal flipHTML5Signature-hover").css(this.disableCss);
this.undo=k;this.redo=l;k.on("mouseover.signature touchstart.signature",function(b){c.undoIsUse&&k.removeClass("flipHTML5Signature-normal").addClass("flipHTML5Signature-hover").css(c.overCss)});l.on("mouseover.signature touchstart.signature",function(b){c.redoIsUse&&l.removeClass("flipHTML5Signature-normal").addClass("flipHTML5Signature-hover").css(c.overCss)});m.on("mouseover.signature touchstart.signature",function(b){c.clearAllFalg&&m.removeClass("flipHTML5Signature-normal").addClass("flipHTML5Signature-hover").css(c.overCss)});
k.on("mouseout.signature touchend.signature",function(b){c.undoIsUse&&k.removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss)});l.on("mouseout.signature touchend.signature",function(b){c.redoIsUse&&l.removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss)});m.on("mouseout.signature touchend.signature",function(b){c.clearAllFalg&&m.removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss)});
k.on("mousedown.signature",function(b){c.undoIsUse&&k.removeClass("flipHTML5Signature-hover flipHTML5Signature-normal").css(c.downCss)});l.on("mousedown.signature",function(b){c.redoIsUse&&l.removeClass("flipHTML5Signature-hover flipHTML5Signature-normal").css(c.downCss)});m.on("mousedown.signature",function(b){c.clearAllFalg&&m.removeClass("flipHTML5Signature-hover flipHTML5Signature-normal").css(c.downCss)});k.add($(document)).on("mouseup.signature",function(b){c.undoIsUse&&k.removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss)});
l.add($(document)).on("mouseup.signature",function(b){c.redoIsUse&&l.removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss)});m.add($(document)).on("mouseup.signature",function(b){c.clearAllFalg&&m.removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss)});var n=$("<div class='flipHTML5Signature-drawTypeMid-preview'></div>").html("Preview").appendTo(b),q=60/140*16,p=document.createElement("canvas"),s=p.getContext("2d"),
r=$(p).css({position:"absolute",left:0,top:-Math.floor(q)});n.append(r);this.previewCanvas=p;this.previewContext=s;p.width=234;p.height=60+Math.ceil(q)+10;b=this.colorPicker(b);b.container.css({left:220,top:11});var t,v,u;h[0].value=parseFloat((7*(parseInt(g.css("left"))+4)+1).toFixed(2));g.on("mousedown touchstart",function(b){b.preventDefault();b.stopPropagation();b=b.originalEvent.touches?b.originalEvent.touches[0]:b;t=b.clientX-g.position().left;f.add(d).add($(document)).on("mousemove.lineWidth touchmove.lineWidth",
function(b){b=b.originalEvent.touches?b.originalEvent.touches[0]:b;v=b.clientX-t;v=-4>=v?-4:93<=v?93:v;g.css({left:v});u=(v+4)/97*7+1;u=parseFloat(u.toFixed(2));h[0].value=u});d.add($(document)).on("mouseup.lineWidth touchend.lineWidth",function(){c.changeLineWidth(u);f.add(d).add($(document)).off("mousemove.lineWidth touchmove.lineWidth");d.add($(document)).off("mouseup.lineWidth touchend.lineWidth")});return!1});f.on("mousedown touchstart",function(b){b=b.clientX-f.offset().left;b=0>=b?0:97<=b?
97:b;g.css({left:b-4});u=b/97*7+1;u=parseFloat(u.toFixed(2));h[0].value=u;c.changeLineWidth(u)});h.on("change",function(){var b=h[0].value;isNaN(b)?h[0].value=parseFloat(((g.position().left+4)/97*7+1).toFixed(2)):(1>b?(h[0].value=1,g.css({left:-4})):8<b?(h[0].value=8,g.css({left:93})):(h[0].value=b,g.css({left:(b-1)/7*97-4})),c.changeLineWidth(h[0].value))});m.on("click touchend",function(){c.clearAllFalg&&(y.clearRect(0,0,x.width,x.height),s.clearRect(0,0,p.width,p.height),c.drawSave.add(c.drawSaveAndUse).removeClass("flipHTML5Signature-normal flipHTML5Signature-hover").css(c.disableCss),
c.hasDrawFlag=!1,c.redoIsUse=!0,l.css(c.normalCss).addClass("flipHTML5Signature-normal").removeClass("flipHTML5Signature-hover"),c.undoIsUse=!1,k.removeClass("flipHTML5Signature-hover flipHTML5Signature-normal").css(c.disableCss),A=c.drawOldPoints.length-1,m.add(c.drawSaveAndUse).removeClass("flipHTML5Signature-normal flipHTML5Signature-hover").css(c.disableCss),c.clearAllFalg=!1,c.points=[])});var A=0;k.on("mousedown.signature touchstart.signature",function(b){if(c.undoIsUse){c.redoIsUse=!0;l.css(c.normalCss).addClass("flipHTML5Signature-normal").removeClass("flipHTML5Signature-hover");
A+=1;A=A>=c.drawOldPoints.length?c.drawOldPoints.length-1:A;y.clearRect(0,0,x.width,x.height);s.clearRect(0,0,p.width,p.height);var d=c.drawOldPoints[c.drawOldPoints.length-1-A];c.points=d.concat();c.draw(x,y,c.drawOldPoints[c.drawOldPoints.length-1-A],c.drawColor,c.lineWidth);c.drawPreview(p,s,d,c.drawColor,c.lineWidth);c.drawSave.add(c.drawSaveAndUse).removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss);c.hasDrawFlag=!0;m.add(c.drawSaveAndUse).removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss);
c.clearAllFalg=!0;A==c.drawOldPoints.length-1&&(c.undoIsUse=!1,k.removeClass("flipHTML5Signature-hover flipHTML5Signature-normal").css(c.disableCss),c.drawSave.add(c.drawSaveAndUse).removeClass("flipHTML5Signature-normal flipHTML5Signature-hover").css(c.disableCss),c.hasDrawFlag=!1,m.add(c.drawSaveAndUse).removeClass("flipHTML5Signature-normal flipHTML5Signature-hover").css(c.disableCss),c.clearAllFalg=!1);b.preventDefault();b.stopPropagation();return!1}});l.on("mousedown.signature touchstart.signature",
function(b){if(c.redoIsUse){c.undoIsUse=!0;k.css(c.normalCss).addClass("flipHTML5Signature-normal").removeClass("flipHTML5Signature-hover");A-=1;A=0>=A?0:A;y.clearRect(0,0,x.width,x.height);s.clearRect(0,0,p.width,p.height);var d=c.drawOldPoints[c.drawOldPoints.length-1-A];c.points=d.concat();c.draw(x,y,c.drawOldPoints[c.drawOldPoints.length-1-A],c.drawColor,c.lineWidth);c.drawPreview(p,s,d,c.drawColor,c.lineWidth);c.drawSave.add(c.drawSaveAndUse).removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss);
c.hasDrawFlag=!0;m.add(c.drawSaveAndUse).removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss);c.clearAllFalg=!0;0==A&&(c.redoIsUse=!1,l.removeClass("flipHTML5Signature-hover flipHTML5Signature-normal").css(c.disableCss));b.preventDefault();b.stopPropagation();return!1}});c.drawOldPoints.push([]);n=$("<div class='flipHTML5Signature-drawTypeBottom-out' style='position: absolute;left: 0px;top: 150px;width: 100%;height: 124px;'></div>").appendTo(this.$drawTypeUnder);
q=$("<div class='flipHTML5Signature-drawTypeBottom' style='position: absolute;left: 9px;top: 0px;width: 540px;height: 140px;border: 1px solid #cccccc;background-color: #ffffff;'></div>").css({boxShadow:"rgb(166, 166, 166) 1px 1px 0px inset, rgb(246, 246, 246) 1px 1px 0px"}).appendTo(n);n.css({cursor:"url("+c.address+"pen.png),auto"});var x=document.createElement("canvas"),w=window.canvas=$(x);q.append(w);x.width=540;x.height=158;$(x).css({position:"absolute",left:0,top:-16});var y=x.getContext("2d");
this.canvas=x;this.context=y;this.points=[];this.drawColor=b.message[0].style.backgroundColor;this.lineWidth=1;var z,D;w.on(_event._down,function(b){b.preventDefault();b.stopPropagation();b=b.originalEvent.touches?b.originalEvent.touches[0]:b;if(c.redoIsUse){var d=c.drawOldPoints.length;c.drawOldPoints.length=d-A;c.points=c.drawOldPoints[d-A-1].concat();A=0}c.undoIsUse=!0;k.css(c.normalCss).addClass("flipHTML5Signature-normal").removeClass("flipHTML5Signature-hover");c.redoIsUse=!1;l.removeClass("flipHTML5Signature-hover flipHTML5Signature-normal").css(c.disableCss);
c.clearAllFalg=!0;m.removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss);c.hasDrawFlag=!0;c.drawSave.add(c.drawSaveAndUse).css(c.normalCss).addClass("flipHTML5Signature-normal").removeClass("flipHTML5Signature-hover");z={x:b.clientX-w.offset().left+0,y:b.clientY-w.offset().top+16,t:0,w:c.lineWidth};c.points.push(z);w.on(_event._move,function(b){b=b.originalEvent.touches?b.originalEvent.touches[0]:b;D={x:b.clientX-w.offset().left+0,y:Math.min(b.clientY-w.offset().top+
16,156),t:1};c.points.push(D);c.draw(x,y,c.points,c.drawColor,c.lineWidth);c.drawPreview(p,s,c.points,c.drawColor,c.lineWidth)});w.add($(document)).on("mouseup.signature touchend.signature",function(){c.drawOldPoints.push(c.points.concat());w.off(_event._move);w.add($(document)).off("mouseup.signature touchend.signature")});return!1})},addSignatureImg:function(b,c,d){var f=this;b.on("mousedown.hideToolBar touchstart.hideToolBar",function(b){f.toolBar&&f.toolBar.hide()});b.css({cursor:"pointer"});
void 0!=f.onCreated?f.onCreated[1].call(f.onCreated[0]):f.hide();b.off("mousedown.signature touchstart.signature");b.on("mousedown.signature touchstart.signature",function(g){b.off("mousedown.signature touchstart.signature");if(isTouch||1===g.which){var h=new Date,k=h.getTime(),h=h.format("MM/dd/yyyy hh:mm:ss");f.showTimeFalg[k]=!1;var l=(g.pageX||g.originalEvent.touches[0].pageX)/BookInfo.scale()-b.offset().left,m=(g.pageY||g.originalEvent.touches[0].pageY)/BookInfo.scale()-b.offset().top,l=f.parseData({left:l,
top:m,width:c.width,height:c.height},b[0].offsetWidth,b[0].offsetHeight),m=$.extend({},c,{width:l.width,height:l.height});f.oldData[k]=m;f.createSignatureImg(b,m,d,l.left,l.top,k,h);f.signatureCookies.push({type:m.type,data:0===c.type?f.saveText:f.savePoints,key:k,page:d,currentTime:h,left:l.left,top:l.top,width:m.width,height:m.height});f.addLocalStorage(f.signatureName,f.parseToString(f.signatureCookies));g.preventDefault();g.stopPropagation();return!1}});b.add($(document)).add(BookInfo.container()).on("mouseup.signature touchend.signature",
function(c){$.each(BookInfo.getCurrentPages(),function(b,c){var d=f.signatureContexts[BookInfo.getBookType()][c];d&&(d.css({cursor:""}),d.off("mousedown.signature touchstart.signature"))});b.off("mousedown.signature touchstart.signature");b.add($(document)).add(BookInfo.container()).off("mousedown.signature touchstart.signature")})},createSignatureImg:function(b,c,d,f,g,h,k){var l=this;b.on("mousedown.hideToolBar touchstart.hideToolBar",function(){l.toolBar&&l.toolBar.hide()});var m=$("<div class='flipHTML5Signature-eachSignatureImg' style='cursor: move;'></div>").append($("<img style='width: 100%;height: 100%;position: absolute;left: 0px;top: 0px;'/>").attr("src",
c.url)).attr("data-key",h).attr("data-page",d).css({position:"absolute",width:c.width,height:c.height,left:f,top:g}).appendTo(b),n=$("<div class='flipHTML5Signature-eachDate' style='position: absolute;width: 180px;height: 45px;border: 1px dashed #2F2F2F;top: -24px;'></div>").css({left:c.width+2}).hide().html(k);c=$("<img/>").attr("src",l.address+"signature_dateClose.png").css({position:"absolute",top:0,right:0,cursor:"pointer"});n.appendTo(m).append(c);c.off("mousedown touchstart");c.on("mousedown touchstart",
function(){var b=l.currentObj.attr("data-key");n.hide();l.showTimeFalg[b]=!1});n.off("mousedown touchstart");n.on("mousedown touchstart",function(b){b.preventDefault();b.stopPropagation();return!1});m.off("mouseover.signature touchstart.signature");m.on("mouseover.signature touchstart.signature",function(){m.css({border:"1px solid #ff0000"})});m.off("mouseout.signature touchend.signature");m.on("mouseout.signature touchend.signature",function(){m.css({border:0})});m.off("mousedown.getObj touchstart.getObj");
m.on("mousedown.getObj touchstart.getObj",function(b){$(".flipHTML5Signature-eachSignatureImg").css({zIndex:1});m.css({zIndex:4});l.currentObj=m;l.toolBar.css({left:m.offset().left-l.container.offset().left,top:m.offset().top-l.container.offset().top-l.toolBar.outerHeight()}).show()});var q=!1;m.off("mousedown.signatureImg touchstart.signatureImg");m.on("mousedown.signatureImg touchstart.signatureImg",function(c){var d=c.pageX||c.originalEvent.touches[0].pageX,f=c.pageY||c.originalEvent.touches[0].pageY,
k=m[0].offsetLeft,n=m[0].offsetTop;b.on("mousemove.signatureImg touchmove.signatureImg",function(b){b.preventDefault();b.stopPropagation();q=!0;var c=k-(d-(b.pageX||b.originalEvent.touches[0].pageX))/BookInfo.scale();g=n-(f-(b.pageY||b.originalEvent.touches[0].pageY))/BookInfo.scale();m.css({left:c,top:g});l.toolBar.css({left:m.offset().left-l.container.offset().left,top:m.offset().top-l.container.offset().top-l.toolBar.outerHeight()}).show();l.showTimeFalg[h]&&l.reviseDateTag()});m.add(b).add($(document)).on("mouseup.signatureImg touchend.signatureImg",
function(){b.off("mousemove.signatureImg touchmove.signatureImg");m.add(b).add($(document)).off("mouseup.signatureImg touchend.signatureImg");if(q){var c=m.attr("data-key"),d=l.parseObject(l.currentObj[0]);l.updateArrayOrderKey(l.signatureCookies,c,{left:d.left,top:d.top});l.addLocalStorage(l.signatureName,l.parseToString(l.signatureCookies))}});c.preventDefault();c.stopPropagation();return!1});b.css({cursor:""})},draw:function(b,c,d,f,g){var h=-1,k=d.length;c.clearRect(0,0,b.width,b.height);c.save();
c.beginPath();c.lineJoin="round";c.strokeStyle=f;for(c.lineWidth=g;++h<k;)b=d[h],0===b.t?(c.stroke(),c.beginPath(),c.lineWidth=b.w,c.moveTo(b.x,b.y)):c.lineTo(b.x,b.y);c.stroke();c.restore()},drawPreview:function(b,c,d,f,g){var h=-1,k=d.length,l=140/60,m=540/234;c.clearRect(0,0,b.width,b.height);c.save();c.beginPath();c.lineJoin="round";c.strokeStyle=f;for(c.lineWidth=g;++h<k;)b=d[h],0===b.t?(c.stroke(),c.beginPath(),c.lineWidth=b.w/l,c.moveTo(b.x/m,b.y/l)):c.lineTo(b.x/m,b.y/m);c.stroke();c.restore()},
trimCanvas:function(b){var c=b.getContext("2d"),d=document.createElement("canvas").getContext("2d"),f=c.getImageData(0,0,b.width,b.height),g=f.data.length,h,k=null,l=null,m=null,n=null,q,p;for(h=0;h<g;h+=4)0!==f.data[h+3]&&(q=h/4%b.width,p=~~(h/4/b.width),null===k&&(k=p),null===l?l=q:q<l&&(l=q),null===m?m=q:m<q&&(m=q),null===n?n=p:n<p&&(n=p));b=n-k;m-=l;c=c.getImageData(l,k,m,b);d.canvas.width=m;d.canvas.height=b;d.putImageData(c,0,0);return{url:d.canvas.toDataURL("image/png"),width:m,height:b}},
saveDraw:function(b){if(this.currentDrawSave){this.currentDrawSave.empty();var c=this.currentDrawSave.width(),d=this.currentDrawSave.height(),f=c/d,g=b.width,h=b.height,k=g/h;c>g&&d>h?(f=g,c=(c-f)/2,d=(d-h)/2):c>g&&d<h?(f=d*k,h=d,c=(c-f)/2,d=(d-h)/2):c<g&&d>h?(f=c,h=c/k,c=(c-f)/2,d=(d-h)/2):f>k?(h=d,f=d*k,c=(c-f)/2,d=0):f<k?(f=c,h=c/k,c=0,d=(d-h)/2):(f=c,h=d,d=c=0);this.currentDrawSave.append($("<img/>").css({position:"absolute",width:f,height:h,left:c,top:d}).attr("src",b.url))}this.drawOldData=
b;this.currentDrawEdit.show();this.currentDrawDel.show();this.$writeTypeUnder.hide();this.$drawTypeUnder.hide();this.$signatureUnder.show()},saveAndUseDraw:function(b){var c=this,d=BookInfo.getCurrentPages();$.each(d,function(d,g){var h=c.signatureContexts[BookInfo.getBookType()][g];h&&(b.type=1,c.addSignatureImg(h,b,g))});c.saveDraw(b)},saveWrite:function(b){this.currentWriteSave.html(b);this.currentWriteEdit.show();this.currentWriteDel.show();this.$writeTypeUnder.hide();this.$drawTypeUnder.hide();
this.$signatureUnder.show()},saveAndUseWrite:function(b){var c=this,d=c.drawTextByDiv(b,"38px","Mistral","#000000"),f=BookInfo.getCurrentPages();$.each(f,function(b,f){var k=c.signatureContexts[BookInfo.getBookType()][f];k&&(d.type=0,k.css({cursor:""}),c.addSignatureImg(k,d,f))});c.saveWrite(b)},drawTextByDiv:function(b,c,d,f){var g=document.createElement("canvas"),h=window.context=g.getContext("2d");h.fillStyle=f;h.font=""+c+" "+d+"";var k=h.measureText(b).width+8;g.width=k;g.height=54;h.fillStyle=
f;h.font=""+c+" "+d+"";h.textBaseline="top";h.fillText(b,3,0);return{url:g.toDataURL("image/png"),width:k,height:54}},parseObject:function(b){if(document.getElementsByTagName("body")[0].contains(b)){var c,d,f;f=b.parentNode;var g=b.style,h=$(b);d=100/f.offsetHeight;c=100/f.offsetWidth;f=b.offsetLeft*c+"%";b=b.offsetTop*d+"%";c=h.width()*c+"%";d=h.height()*d+"%";g.width=c;g.height=d;g.left=f;g.top=b;return{width:c,height:d,left:f,top:b}}},parseData:function(b,c,d){d=100/d;c=100/c;return{width:b.width*
c+"%",height:b.height*d+"%",left:b.left*c+"%",top:b.top*d+"%"}},close:function(){this.$signature.hide();this.$signatureUnder.show();this.$writeTypeUnder.hide();this.$drawTypeUnder.hide();this.showFlag=!1},show:function(){this.$signature.show();this.$signatureUnder.show();this.$writeTypeUnder.hide();this.$drawTypeUnder.hide();this.showFlag=!0},hide:function(){this.close()},showHide:function(){this.showFlag?this.hide():this.show()},changeColor:function(b){this.drawColor=b;this.draw(this.canvas,this.context,
this.points,b,this.lineWidth);this.drawPreview(this.previewCanvas,this.previewContext,this.points,this.drawColor,this.lineWidth);return b},changeLineWidth:function(b){return this.lineWidth=b},colorPicker:function(b){var c,d,f,g=this,h="#FF0000 #FF5555 #FF55AA #FF55FF #FFAA55 #FFAAAA #FFAAFF #FFFF55 #FFFFAA #FFFFFF #CC0000 #CC5555 #CC55AA #CC55FF #CCAA55 #CCAAAA #CCAAFF #CCFF55 #CCFFAA #CCFFFF #AA0000 #AA5555 #AA55AA #AA55FF #AAAA55 #AAAAAA #AAAAFF #AAFF55 #AAFFAA #AAFFFF #880000 #885555 #8855AA #8855FF #88AA55 #88AAAA #88AAFF #88FF55 #88FFAA #88FFFF #550000 #555555 #5555AA #5555FF #55AA55 #55AAAA #55AAFF #55FF55 #55FFAA #55FFFF #220000 #225555 #2255AA #2255FF #22AA55 #22AAAA #22AAFF #22FF55 #22FFAA #22FFFF #000000 #005555 #0055AA #0055FF #00AA55 #00AAAA #00AAFF #00FF55 #00FFAA #00FFFF".split(" "),
k=document.createElement("table");c=document.createElement("a");var l=$(c),m=document.createElement("input"),n=function(){},q=function(){k.style.display="none";m.value=m.style.backgroundColor=this.title.toUpperCase();g.changeColor(this.title.toUpperCase())};l.appendTo(b);c.className="flipHtml5ColorSelectorWrap";k.setAttribute("border","1");c.style.position="absolute";c.href="javascript:void(0);";m.type="text";m.className="flipHtml5ColorSelectorMessage";m.style.width="20px";m.style.height="20px";m.value=
m.style.backgroundColor="#000000";m.style.cursor="pointer";m.style.padding="0px";c.appendChild(m);c.appendChild(k);k.style.display="none";k.style.position="relative";k.style.zIndex=9999;k.style.backgroundColor="#ffffff";for(d=0;7>d;d++){f=document.createElement("tr");f.style.position="relative";for(c=0;10>c;c++)b=document.createElement("td"),b.className="flipHtml5ColorSelectorBlock",b.style.position="relative",b.style.width="14px",b.style.height="14px",b.title=h[10*d+c],b.style.backgroundColor=h[10*
d+c],$(b).on("mouseenter",n),$(b).on("click touchstart",q),f.appendChild(b);k.appendChild(f)}$(m).on("click touchstart",function(b){k.style.display="table-cell";b.stopPropagation();b.stopPropagation();return!1});$(document).on("click touchstart",function(){k.style.display="none"});return{container:l,message:$(m)}},setContainers:function(b,c,d){void 0==this.signatureContexts[b]&&(this.signatureContexts[b]={});this.signatureContexts[b][c]=d;b==BookInfo.getBookType()&&(this.toolBar.hide(),this.addSignatureByPageIndex(c,
d))},addSignatureByPageIndex:function(b,c){c.find(".flipHTML5Signature-eachSignatureImg").remove();for(var d=0;d<this.signatureCookies.length;d++){var f=this.signatureCookies[d];if(f.page===b){var g=f.left,h=f.top,k=f.key,l=f.currentTime;if(0==f.type)var m=this.drawTextByDiv(f.data,"38px","Mistral","#000000"),n=this.parseData({left:g,top:h,width:m.width,height:m.height},c[0].offsetWidth,c[0].offsetHeight);else{m=document.createElement("canvas");m.width=540;m.height=158;$(m).css({position:"absolute",
left:0,top:-16});var n=m.getContext("2d"),q=f.data.concat(),p=q.pop();this.draw(m,n,q,p.color,1);m=this.trimCanvas(m);n=this.parseData({left:g,top:h,width:m.width,height:m.height},c[0].offsetWidth,c[0].offsetHeight)}this.oldData[k]=$.extend({},m,{width:n.width,height:n.height});m=$.extend({},m,{width:f.width,height:f.height});this.createSignatureImg(c,m,f.page,g,h,k,l)}}},getLocalStorage:function(b){try{if(window.localStorage)return window.localStorage.getItem(b);for(var c=document.cookie.split("; "),
d=0;d<c.length;d++){var f=c[d].split("=");if(f[0]==b)return unescape(f[1])}return""}catch(g){}},addLocalStorage:function(b,c){try{if(window.localStorage)window.localStorage.setItem(b,c);else{var d=b+"="+escape(c),f=new Date;f.setTime(f.getTime()+864E8);d+="; expires="+f.toGMTString();document.cookie=d}}catch(g){}},parseToString:function(b){if(0==b.length)return"";for(var c="[",d=0;d<b.length;d++)c=0==b[d].type?c+("{type:"+b[d].type+",key:"+b[d].key+",data:'"+b[d].data+"',page:"+b[d].page+",currentTime:'"+
b[d].currentTime+"',left:'"+b[d].left+"',top:'"+b[d].top+"',width:'"+b[d].width+"',height:'"+b[d].height+"'},"):c+("{type:"+b[d].type+",key:"+b[d].key+",data:"+this.parsePointsToString(b[d].data)+",page:"+b[d].page+",currentTime:'"+b[d].currentTime+"',left:'"+b[d].left+"',top:'"+b[d].top+"',width:'"+b[d].width+"',height:'"+b[d].height+"'},");c=c.substring(0,c.length-1);return c+"]"},parsePointsToString:function(b){if(0!=b.length){for(var c="[",d=0;d<b.length-1;d++)c+="{x:"+b[d].x+",y:"+b[d].y+",t:"+
b[d].t+",w:"+b[d].w+"},";c+="{color:'"+b[b.length-1].color+"'}";return c+"]"}},delArrayOrderKey:function(b,c){if(b)for(var d=0;d<b.length;d++)b[d].key&&b[d].key==c&&b.remove(d)},updateArrayOrderKey:function(b,c,d){if(b)for(var f=0;f<b.length;f++)b[f].key&&b[f].key==c&&$.extend(b[f],d)},createCursorImg:function(b,c,d){var f=$("<img/>").attr("src",b.url).css({position:"absolute",width:b.width,height:b.height,left:c+10,top:d+10}).appendTo(this.container);f.on("mousemove touchmove",function(b){f.css({left:b.clientX+
10,top:b.clientY+10})});return f},reviseDateTag:function(){if(this.currentObj){var b=this.currentObj.find(".flipHTML5Signature-eachDate"),c=this.currentObj.parent(),d=parseInt(this.currentObj.css("left")),f=parseInt(this.currentObj.css("top"));this.currentObj.position();var g=this.currentObj.outerWidth(),h=this.currentObj.outerHeight(),k=c.width();c.height();var c=b.outerWidth(),l=b.outerHeight(),m=this.toolBar.height();d+g+2+c<=k?b.css({left:g+2,top:-24}):l+m<=f?b.css({left:g-c,top:-(l+m)}):b.css({left:g-
c,top:h+18})}},bindOnCreated:function(b,c){this.onCreated=[b,c]}});
(function(b,c,d){window.Remark=c({statics:{},create:function(){this.expires=30;this.currentEditor=b("<div>");this.backgroundColor="rgba(255, 255, 85, 0.5)";this.highlightBackcolor="rgba(2, 255, 245, 0.5)";this.fontSize=5;this.fontName="Times";this.$bookContainer=d.container();this.fontColor="black";this.title="#00000";this.opacity="1.0";this.noteImgContainers={};this.$document=b(document);this.newSizeWrap();var c=this.createToolbar(),g=this.createHighlightToolbar();c.appendChild(this.createColorSelector());
document.getElementsByTagName("body")[0].appendChild(c).appendChild(g);document.getElementsByTagName("body")[0].appendChild(g);b(window).on("beforeunload",function(){this.save()}.bind(this));this.oneBindEvent()},bindOnCreated:function(b,c){this.onCreated=[b,c]},bindCreateEvents:function(c,g,h){var k,l,m,n,q,p,s,r=this,t=Math.floor,v=c.offset().left,u=c.offset().top,A=function(b){b.preventDefault();m=b.pageX?b.pageX:b.originalEvent.touches?b.originalEvent.touches[0].pageX:0;n=b.pageY?b.pageY:b.originalEvent.touches?
b.originalEvent.touches[0].pageY:0;m&&(0>m-k?(p.left=t((m-v)/d.scale())+"px",p.width=t((k-m)/d.scale())+"px"):(p.left=t((k-v)/d.scale())+"px",p.width=t((m-k)/d.scale())+"px"));n&&(0>b.pageY-l?(p.top=t((n-u)/d.scale())+"px",p.height=t((l-n)/d.scale())+"px"):(p.top=t((l-u)/d.scale())+"px",p.height=t((n-l)/d.scale())+"px"));h&&h.draw(k,l,m,n)};c.css("cursor","crosshair");c.off("mousedown.fliphtml5Remark touchstart.fliphtml5Remark").one("mousedown.fliphtml5Remark touchstart.fliphtml5Remark",function(x){r.unbindCreateEvents();
var w=x.button;if(!document.implementation.hasFeature("MouseEvents","2.0"))switch(event.button){case 0:case 1:case 3:case 5:case 7:w=0;break;case 2:case 6:w=2;break;case 4:w=1}if(!w){x.stopPropagation();q=document.createElement("div");s=b(q).css({webkitUserSelect:"text",mozUserSelect:"text",msUserSelect:"text",oUserSelect:"text",userSelect:"text"});p=q.style;h?(s.append(h),q.className="flipHtml5Shape flipHtml5Store"):(p.backgroundColor=g?"rgba(0, 71, 255, 0.33)":r.highlightBackcolor,q.className=(g?
"flipHtml5Remark flipHtml5Store":"flipHtml5Highlight flipHtml5Store")+" flipHtml5RemarkCurrentEditor",q.setAttribute("contenteditable",g));c.find(".flipHtml5RemarkCurrentEditor").removeClass("flipHtml5RemarkCurrentEditor");c.append(q);if(w=x.originalEvent.changedTouches){var y=w[0].identifier;k=m=w[0].pageX;l=n=w[0].pageY}else k=m=x.pageX,l=n=x.pageY;r.reBindEvent(s,g);c.on("mousemove.fliphtml5Remark touchmove.fliphtml5Remark",A);c.off("mouseup.fliphtml5Remark touchend.fliphtml5Remark").one("mouseup.fliphtml5Remark touchend.fliphtml5Remark",
function(b){var h=b.originalEvent.changedTouches;if(h){if(y!==h[0].identifier)return;m=h[0].pageX;n=h[0].pageY}else m=b.pageX,n=b.pageY;c.off("mousemove.fliphtml5Remark touchmove.fliphtml5Remark");if(10>Math.abs(m-k)||10>Math.abs(n-l))p.left=t((m-v)/d.scale())+"px",p.top=t((n-u)/d.scale())+"px",p.width="280px",p.height="28px";r.parsePresentValue(q);r.parsePresentValue(r.sizeWrap);s.css({outline:"none",backgroundColor:g?r.backgroundColor:r.highlightBackcolor,color:r.fontColor});s.trigger(_event._down);
void 0!=r.onCreated&&r.onCreated[1].call(r.onCreated[0])})}})},oneBindEvent:function(){var b=this;this.$document.on("keydown.flipHtml5RemarkDelete",function(c){var d=c.keyCode;c.altKey||c.ctrlKey||c.shiftKey||(b.editing&&d===KEY_CODE_DELETE&&b.currentEditor&&"flipHtml5Remark flipHtml5Store"!==b.currentEditor[0].className&&(b.currentEditor.remove(),b.removeSizeWrap(),b.save()),b.currentEditor&&d===KEY_CODE_LEFT&&d===KEY_CODE_RIGHT&&d===KEY_CODE_UP&&d===KEY_CODE_DOWN&&c.stopPropagation())})},parsePresentValue:function(c){if(document.getElementsByTagName("body")[0].contains(c)){var d,
h;d=c.parentNode;var k=c.style,l=b(c);h=100/d.offsetHeight;d=100/d.offsetWidth;k.width=l.width()*d+"%";k.height=l.height()*h+"%";k.left=c.offsetLeft*d+"%";k.top=c.offsetTop*h+"%"}},reBindEvent:function(c,d){var h=this,k;c.on(_event._down,function(k){k.stopPropagation();b(this).css({outline:"none"});h.removeSizeWrap();h.addSizeWrap(this,d);c.on("mousedown.flipHtml5Annotation touchstart.flipHtml5Annotation",function(b){b.stopPropagation()})}).on("mousedown mouseup touchend",function(b){b.stopPropagation()});
c.on("sizeChange",function(b,c,f,q,p){k=this.style;c&&(k.width=c-16+"px");f&&(k.height=f-16+"px");q&&(k.left=q+8+"px");p&&(k.top=p+8+"px");h.showToolbar(this,d)});c.on("change cut drop paste keydown",function(b){if(!(b.altKey||b.ctrlKey||b.shiftKey)){var c=this,d=c.offsetHeight,f=c.style,g=f.height;setTimeout(function(){f.height="auto";f.height=c.scrollHeight>d?100*c.scrollHeight/c.parentNode.offsetHeight+"%":g},0)}})},unbindCreateEvents:function(){this.contextArray.css("cursor","auto");this.contextArray.off("mousedown.fliphtml5Remark touchstart.fliphtml5Remark")},
newSizeWrap:function(){var c,g,h,k,l,m,n,q,p=this,s=1,r=p.sizeWrap=document.createElement("div"),t=[],v=Math.floor,u=p.sizeWrapStyle=r.style;for(r.className="flipHtml5SizeWrap";9>s;)c=document.createElement("div"),c.className="flipHtml5SizePoint flipHtml5SizePoint"+s,r.appendChild(c),t.push(c),s++;p.northResize(t[0]).westResize(t[0]);p.northResize(t[1]);p.eastResize(t[2]).northResize(t[2]);p.eastResize(t[3]);p.eastResize(t[4]).southResize(t[4]);p.southResize(t[5]);p.southResize(t[6]).westResize(t[6]);
p.westResize(t[7]);b(r).on("mousedown.flipHtml5SizeWrap touchstart.flipHtml5SizeWrap",function(c){c.preventDefault();c.stopPropagation();q=p.currentEditor;var f=r.offsetLeft,s=r.offsetTop,t=c.pageX||c.originalEvent.touches[0].pageX,z=c.pageY||c.originalEvent.touches[0].pageY;b.each([p.$context,b(p.toolbarContainer),b(p.highlightToolbarContainer)],function(c,A){A.on("mousemove.flipHtml5SizeWrap touchmove.flipHtml5SizeWrap",function(b){b.preventDefault();b.stopPropagation();g=b.pageX?b.pageX:b.originalEvent.touches?
b.originalEvent.touches[0].pageX:0;h=b.pageY?b.pageY:b.originalEvent.touches?b.originalEvent.touches[0].pageY:0;g&&(n=v(f-(t-g)/d.scale()),l!==n&&(u.left=n+"px",l=n,q.trigger("sizeChange",[0,0,n,0])));h&&(m=v(s-(z-h)/d.scale()),k!==m&&(u.top=m+"px",k=m,q.trigger("sizeChange",[0,0,0,m])))});A.one("mouseup.flipHtml5SizeWrap touchend.flipHtml5SizeWrap",function(){b.each([p.$context,b(p.toolbarContainer),b(p.highlightToolbarContainer)],function(){this.off("mouseup.flipHtml5SizeWrap touchend.flipHtml5SizeWrap");
this.off("mousemove.flipHtml5SizeWrap touchmove.flipHtml5SizeWrap")});p.parsePresentValue(q[0]);p.parsePresentValue(r)})})}).on(_event._down,function(b){b.preventDefault();b.stopPropagation()});return r},addSizeWrap:function(c,d){var h=this.sizeWrap,k=this.sizeWrap.style;d?(c.style.zIndex=999,k.zIndex=998):(c.style.zIndex=998,k.zIndex=999);k.width=c.offsetWidth+16+"px";k.height=c.offsetHeight+16+"px";k.left=c.offsetLeft-8+"px";k.top=c.offsetTop-8+"px";k.display="block";c=b(c);this.$context=c.parent();
c.before(h);this.parsePresentValue(h);this.currentEditor=c;this.showToolbar(c,d);this.editing=!0},removeSizeWrap:function(){this.currentEditor[0].style.zIndex="2";this.sizeWrapStyle.zIndex="1";this.sizeWrapStyle.display="none";this.hideToolbar();this.editing=!1},hideToolbar:function(){this.toolbarContainer.style.display="none";this.highlightToolbarContainer.style.display="none"},showToolbar:function(c,d){var h=d?this.toolbarContainer:this.highlightToolbarContainer,k=h.style,l=b(c),m=l.css("backgroundColor").replace(/\s+/g,
"");0<=m.indexOf("rgba")&&(m=m.replace(/a/,"").replace(/\,[0-9]+(\.[0-9]*)?\)/,")"));b(h).find(".flipHtml5RemarkImage-backcolor").css("backgroundColor",m);this.currentEditor=l;k.left=l.offset().left-8+"px";k.top=l.offset().top-(d?80:30)+"px";k.display="block"},createToolbar:function(){for(var c=this.toolbarContainer=document.createElement("div"),d=0,h="bold italic strikeThrough underline forecolor backcolor blockquote insertUnorderedList insertOrderedList justifyLeft justifyCenter justifyRight createLink removeFormat outdent indent undo redo delete paragraph fontsize fontname".split(" ");h[d];)c.appendChild(this.createButton(h[d])),
d++;c.className="fliphtml5RemarkToolbarContainer";b(c).on(_event._down,function(b){b.preventDefault();b.stopPropagation()});return c},createHighlightToolbar:function(){for(var c=this.highlightToolbarContainer=document.createElement("div"),d=0,h=["backcolor","delete"];h[d];)c.appendChild(this.createButton(h[d],!0)),d++;c.className="fliphtml5RemarkHighlightToolbarContainer";b(c).on(_event._down,function(b){b.preventDefault();b.stopPropagation()});return c},createButton:function(c,d){var h=this,k,l;
switch(c){case "hr":return l=document.createElement("hr"),l.className="flipHtml5RemarkHr",l;case "paragraph":return k="Paragraph;Address;Preformatted;Title 1;Title 2;Title 3;Title 4;Title 5;Title 6".split(";"),l="p address pre h1 h2 h3 h4 h5 h6".split(" "),l=h.createSelect(k,l,c);case "fontname":return k="Arial Century Courier Gentium Georgiae Impact King Lalit Modena Papyrus Tahoma TeX Times Verdana Verona cursive fantasy monospace serif".split(" "),l="Arial Century Courier Gentium Georgiae Impact King Lalit Modena Papyrus Tahoma TeX Times Verdana Verona cursive fantasy monospace serif".split(" "),
l=h.createSelect(k,l,c,"fontFamily");case "fontsize":return k=[1,2,3,4,5,6,7],l=[1,2,3,4,5,6,7],l=h.createSelect(k,l,c,"fontSize");case "forecolor":return h.createColorButton(c);case "backcolor":return h.createColorButton(c,d);default:return k=document.createElement("a"),k.href="javascript:void(0);",l=document.createElement("div"),l.className="flipHtml5RemarkButtonImage flipHtml5RemarkImage-"+c,l.title=c,k.className="flipHtml5RemarkButton",b(k).on(_event._down,function(b){b.preventDefault();b.stopPropagation();
h.exec(c)}),k.appendChild(l),k}},createColorButton:function(c,d){var h,k,l,m,n=this,q;h=document.createElement("a");h.href="javascript:void(0);";k=document.createElement("div");k.className="flipHtml5RemarkButtonImage flipHtml5RemarkImage-"+c;k.title=c;h.className="flipHtml5RemarkButton";l=document.createElement("div");l.className="flipHtml5RemarkColorBar";"backcolor"===c&&(l.style.display="none");b(h).on(_event._down,function(p){p.preventDefault();p.stopPropagation();q=n.opacityHandel;m=n.colorSelector;
b(h).after(m);m.style.left=this.offsetLeft+"px";m.style.top=this.offsetTop+22+"px";m.style.display="block";"forecolor"===c&&(q.hide(),n.opacity=1);"backcolor"===c&&(n.opacity=q.val(),q.show());q.setOpacity(parseFloat(parseFloat(n.currentEditor.css("backgroundColor").replace(/\s*\)*/g,"").split(",")[3]).toFixed(2)));n.$context.one(_event._down,function(b){b.preventDefault();m.style.display="none"});n.currentEditor.one(_event._down,function(b){b.preventDefault();m.style.display="none"});n.$bookContainer.one(_event._down,
function(b){b.preventDefault();m.style.display="none"});n.$colorSelector.off("colorSelected").one("colorSelected",function(b,h){b.preventDefault();"backcolor"===c?k.style.backgroundColor=h:l.style.backgroundColor=h;m.style.display="none";n.exec(c,h,d)})});h.appendChild(l);h.appendChild(k);return h},createSelect:function(b,c,d,k,l){var m=document.createElement("select"),n=0,q=this,p;m.className="flipHtml5RemarkSelect flipHtml5Remark-"+d;for(m.style[k]=c[1];b[n];)p=document.createElement("option"),
p.className="flipHtml5RemarkOption-"+d+" flipHtml5RemarkOption-"+c[n],p.innerHTML=b[n],p.value=c[n],p.style[k]=c[n],0===n&&(p.setAttribute("selected",!0),l&&(p.style.display="none")),m.appendChild(p),n++;m.onchange=k?function(){q.exec(d,this[this.selectedIndex].value);this.style[k]=this[this.selectedIndex].value;l&&(this.selectedIndex=0)}:function(){q.exec(this[this.selectedIndex].value);l&&(this.selectedIndex=0)};return m},createColorSelector:function(){var c,d,h,k,l=this,m="#FF0000 #FF5555 #FF55AA #FF55FF #FFAA55 #FFAAAA #FFAAFF #FFFF55 #FFFFAA #FFFFFF #CC0000 #CC5555 #CC55AA #CC55FF #CCAA55 #CCAAAA #CCAAFF #CCFF55 #CCFFAA #CCFFFF #AA0000 #AA5555 #AA55AA #AA55FF #AAAA55 #AAAAAA #AAAAFF #AAFF55 #AAFFAA #AAFFFF #880000 #885555 #8855AA #8855FF #88AA55 #88AAAA #88AAFF #88FF55 #88FFAA #88FFFF #550000 #555555 #5555AA #5555FF #55AA55 #55AAAA #55AAFF #55FF55 #55FFAA #55FFFF #220000 #225555 #2255AA #2255FF #22AA55 #22AAAA #22AAFF #22FF55 #22FFAA #22FFFF #000000 #005555 #0055AA #0055FF #00AA55 #00AAAA #00AAFF #00FF55 #00FFAA #00FFFF".split(" "),
n=document.createElement("table"),q=this.colorSelector=document.createElement("a"),p=this.$colorSelector=b(q),s=document.createElement("input"),r=l.createOpacityPlugin(),t=function(){s.value=s.style.backgroundColor=this.title.toUpperCase()},v=function(){p.trigger("colorSelected",[l.parseColorToRGBA(this.title,r.val())])};q.className="flipHtml5RemarkColorSelectorWrap";n.setAttribute("border","1");q.style.display="none";q.href="javascript:void(0);";s.className="flipHtml5RemarkColorSelectorMessage";
s.value="#000000";s.setAttribute("disabled","true");q.appendChild(s);q.appendChild(r.container);q.appendChild(n);p.on(_event._down,function(b){b.preventDefault();b.stopPropagation()});for(h=0;7>h;h++){k=document.createElement("tr");for(d=0;10>d;d++)c=document.createElement("td"),c.className="flipHtml5RemarkColorSelectorBlock",c.title=m[10*h+d],c.style.backgroundColor=m[10*h+d],b(c).on(_event._over,t),b(c).on(_event._down,v),k.appendChild(c);n.appendChild(k)}return q},createOpacityPlugin:function(){var c,
d,h,k,l,m,n=0.5,q=this,p=Math.floor,s=document.createElement("div"),r=document.createElement("div"),t=document.createElement("span"),v=r.style,u,A=q.$document,x=q.changeOpacity,w=b(r),y=b(s);t.className="flipHtml5RemarkOpacitySpan";s.className="flipHtml5RemarkOpacity";s.style.height="3px";s.style.top="4px";r.className="flipHtml5RemarkOpacityCursor";r.style.top="-5px";s.appendChild(t);s.appendChild(r);y.on(_event._down,function(b){b.preventDefault();b.stopPropagation();u=q.currentEditor;if(d=b.pageX?
b.pageX:b.originalEvent.touches?b.originalEvent.touches[0].pageX:0)h=d-y.offset().left,0>h&&(h=0),145<h&&(h=145),v.left=h+"px",u.css("backgroundColor",x(u,h/145)),t.innerHTML="Opacity: "+(h/145).toFixed(2),n=h/145});w.on("mousedown touchstart",function(b){b.preventDefault();b.stopPropagation();u=q.currentEditor;h=k=parseInt(v.left,10);c=b.pageX?b.pageX:b.originalEvent.touches?b.originalEvent.touches[0].pageX:0;l=h-c;A.on("mousemove.flipHtml5RemarkOpacity touchmove.flipHtml5RemarkOpacity",function(b){b.preventDefault();
b.stopPropagation();if(d=b.pageX?b.pageX:b.originalEvent.touches?b.originalEvent.touches[0].pageX:0)m=p(l+d),0>m&&(m=0),145<m&&(m=145),k!==m&&(v.left=m+"px",u.css("backgroundColor",x(u,m/145)),t.innerHTML="Opacity: "+(m/145).toFixed(2),n=m/145)});A.one("mouseup touchend",function(){A.off("mousemove.flipHtml5RemarkOpacity touchmove.flipHtml5RemarkOpacity")})});return this.opacityHandel={val:function(b){b&&(b=parseInt(b,10)||1,1<b&&(b=1),0>b&&(b=0),this.setOpacity(b),n=b);return n},container:s,show:function(){s.style.display=
""},hide:function(){s.style.display="none"},setOpacity:function(b){if(void 0===b||1<b||isNaN(b))b=1;0>b&&(b=0);v.left=145*b+"px";t.innerHTML="Opacity: "+b;n=b}}},changeOpacity:function(b,c){var d=b.css("backgroundColor").replace(/\s*/g,"");0<=d.indexOf("rgba")&&(0<=d.indexOf(",0)")||0<=d.indexOf(",1)"))?b.css("backgroundColor",d.replace(/b\(/,"ba(").replace(/,\d*\)$/,","+c+")")):b.css("backgroundColor",d.replace(/b\(/,"ba(").replace(/d*\)$/,","+c+")").replace(/\d*\.\d*,/g,""))},parseColorToRGBA:function(b,
c){var d,k,l;c=parseFloat(c);1<=c&&(c=1);0>=c&&(c=0);d=parseInt(b.substring(1,3),16);k=parseInt(b.substring(3,5),16);l=parseInt(b.substring(5,7),16);return"rgba("+d+","+k+","+l+","+c+")"},exec:function(b,c,d){switch(b){case "h1":case "h2":case "h3":case "h4":case "h5":case "h6":case "address":case "pre":case "p":case "blockquote":document.execCommand("formatBlock",!1,b);break;case "createLink":(b=prompt("Enter a URL here","http://"))&&""!==b&&"http://"!==b&&(0>b.indexOf("http")&&(b="http://"+b),document.execCommand("createLink",
!0,b));break;case "fontsize":document.execCommand(b,!1,c);break;case "fontname":document.execCommand(b,!1,c);this.fontName=c;break;case "forecolor":document.execCommand(b,!1,c);this.fontColor=c;break;case "backcolor":this.currentEditor[0].style.backgroundColor=c;d?this.highlightBackcolor=c:this.backgroundColor=c;break;case "delete":this.removeSizeWrap();this.currentEditor.remove();this.save();break;default:document.execCommand(b,!1,null)}this.currentEditor.trigger(_event._down)},northResize:function(c){var g,
h,k,l,m,n=this,q=Math.floor,p,s;b(c).on("mousedown.fliphtml5RemarkResize touchstart.fliphtml5RemarkResize",function(b){b.preventDefault();b.stopPropagation();h=n.currentEditor;p=n.sizeWrap;s=n.sizeWrapStyle;m=n.$context;var c=p.offsetHeight||20,f=b.pageY||b.originalEvent.touches[0].pageY;m.one("mouseup.fliphtml5RemarkResize touchend.fliphtml5RemarkResize",function(){m.off("mousemove.fliphtml5RemarkResize touchmove.fliphtml5RemarkResize");n.parsePresentValue(h[0]);n.parsePresentValue(p)});m.on("mousemove.fliphtml5RemarkResize touchmove.fliphtml5RemarkResize",
function(b){b.preventDefault();b.stopPropagation();b.pageY?g=b.pageY:b.originalEvent.touches&&(g=b.originalEvent.touches[0].pageY);g&&(l=q(c+(f-g)/d.scale()),k!==l&&20<l&&(s.top=g-m.offset().top+"px",s.height=l+"px",k=l,h.trigger("sizeChange",[0,l,0,g-m.offset().top])))})});return this},westResize:function(c){var g,h,k,l,m,n=this,q=Math.floor,p,s;b(c).on("mousedown.fliphtml5RemarkResize touchstart.fliphtml5RemarkResize",function(b){b.preventDefault();b.stopPropagation();m=n.$context;p=n.sizeWrap;
s=n.sizeWrapStyle;l=n.currentEditor;var c=p.offsetWidth||40,f=b.pageX||b.originalEvent.touches[0].pageX;m.one("mouseup.fliphtml5RemarkResize touchend.fliphtml5RemarkResize",function(){m.off("mousemove.fliphtml5RemarkResize touchmove.fliphtml5RemarkResize");n.parsePresentValue(l[0]);n.parsePresentValue(p)});m.on("mousemove.fliphtml5RemarkResize touchmove.fliphtml5RemarkResize",function(b){b.preventDefault();b.stopPropagation();!(g=b.pageX)&&b.originalEvent.touches&&(g=b.originalEvent.touches[0].pageX);
g&&(k=q(c+(f-g)/d.scale()),h!==k&&40<k&&(s.left=g-m.offset().left+"px",s.width=k+"px",h=k,l.trigger("sizeChange",[k,0,g-m.offset().left])))})});return this},eastResize:function(c){var g,h,k,l,m,n=this,q=Math.floor,p,s;b(c).on("mousedown.fliphtml5RemarkResize touchstart.fliphtml5RemarkResize",function(b){b.preventDefault();b.stopPropagation();k=n.currentEditor;m=n.$context;p=n.sizeWrap;s=n.sizeWrapStyle;var c=p.offsetWidth||40,f=b.pageX||b.originalEvent.touches[0].pageX;m.one("mouseup.fliphtml5RemarkResize touchend.fliphtml5RemarkResize",
function(){m.off("mousemove.fliphtml5RemarkResize touchmove.fliphtml5RemarkResize");n.parsePresentValue(k[0]);n.parsePresentValue(p)});m.on("mousemove.fliphtml5RemarkResize touchmove.fliphtml5RemarkResize",function(b){b.preventDefault();b.stopPropagation();b.pageX?g=b.pageX:b.originalEvent.touches&&(g=b.originalEvent.touches[0].pageX);g&&(h=q(c-(f-g)/d.scale()),l!==h&&40<h&&(s.width=h+"px",l=h,k.trigger("sizeChange",[h])))})});return this},southResize:function(c){var g,h,k,l,m=this,n=Math.floor,q,
p,s;b(c).on("mousedown.fliphtml5RemarkResize touchstart.fliphtml5RemarkResize",function(b){b.preventDefault();b.stopPropagation();l=m.$context;s=m.sizeWrap;p=m.sizeWrapStyle;h=m.currentEditor;var c=s.offsetHeight||20,f=b.pageY||b.originalEvent.touches[0].pageY;l.one("mouseup.fliphtml5RemarkResize touchend.fliphtml5RemarkResize",function(){l.off("mousemove.fliphtml5RemarkResize touchmove.fliphtml5RemarkResize");m.parsePresentValue(h[0]);m.parsePresentValue(s)});l.on("mousemove.fliphtml5RemarkResize touchmove.fliphtml5RemarkResize",
function(b){b.preventDefault();b.stopPropagation();b.pageY?g=b.pageY:b.originalEvent.touches&&(g=b.originalEvent.touches[0].pageY);g&&(k=n(c-(f-g)/d.scale()),q!==k&&20<k&&(p.height=k+"px",q=k,h.trigger("sizeChange",[0,k])))})});return this},parseRemark:function(c,d){var h,k=this,l;d.find(".flipHtml5Store").remove();k.removeSizeWrap();this.sizeWrapStyle&&(this.sizeWrapStyle.display="none",b(this.sizeWrap).remove());k.newSizeWrap();k.contextArray=k.contextArray?k.contextArray.add(d):d;try{window.localStorage?
h=window.localStorage.getItem(window.location.href.replace(window.location.hash,"")+"flipHtml5Remark"+c)||"":(l=RegExp("(?:(?:^|.*;\\s*)"+window.location.href.replace(window.location.hash,"")+"flipHtml5Remark"+c+"\\s*\\=\\s*([^;]*).*$)|^.*$"),h=(document.cookie||"").replace(l,"$1")),d.append(h.replace(/#@&/g,";")),d.find(".flipHtml5Remark").each(function(){k.reBindEvent(b(this),!0)}),d.find(".flipHtml5Highlight").each(function(){k.reBindEvent(b(this),!1)}),d.on("mousedown.fliphtml5remarkHide touchstart.fliphtml5remarkHide",
function(){k.save();k.removeSizeWrap();k.currentEditor.blur();k.currentEditor.off("mousedown.flipHtml5Annotation touchstart.flipHtml5Annotation")})}catch(m){}},getPageContent:function(c){var d=0,h,k="";for(c=c.find(".flipHtml5Store");h=c[d];)if(d++,""!==h.innerHTML&&""!==b(h).text()||""!==h.style.backgroundColor&&"transparent"!==h.style.backgroundColor&&0!==parseFloat(h.style.backgroundColor.split(",")[3]))k+=h.outerHTML;return k.replace(/\s*\n\s*/g,"").replace(/;/g,"#@&")},storageByIndex:function(b,
c){var d,k=this.getPageContent(c);try{window.localStorage?(window.localStorage.removeItem(window.location.href.replace(window.location.hash,"")+"flipHtml5Remark"+b),k&&window.localStorage.setItem(window.location.href.replace(window.location.hash,"")+"flipHtml5Remark"+b,k)):(k?(d=new Date,d.setDate(d.getDate()+this.expires)):d=new Date("01 Jan 1970 00:00:01"),document.cookie=window.location.href.replace(window.location.hash,"")+"flipHtml5Remark"+b+"="+k+";expires="+d.toUTCString()+";")}catch(l){throw l;
}return k},save:function(){var b,c=d.getCurrentPages();for(b=0;b<c.length&&this.noteImgContainers[d.getBookType()];b++)this.noteImgContainers[d.getBookType()][c[b]]&&this.storageByIndex(c[b],this.noteImgContainers[d.getBookType()][c[b]])},restoreRemark:function(b,c,h){void 0!==b&&(this.noteImgContainers[b]||(this.noteImgContainers[b]={}),this.noteImgContainers[b][c]=h,b==d.getBookType()&&(this.removeSizeWrap(),this.parseRemark(c,this.noteImgContainers[d.getBookType()][c])))},setContainers:function(b,
c,d){this.restoreRemark(b,c,d)},addHighlightEvent:function(){this.unbindCreateEvents();this.addEvents(!0)},addEvents:function(b){var c=0,d,k=this.contextArray;for(this.unbindCreateEvents();d=k.eq(c++),0<d.length;)this.bindCreateEvents(d,!b)},destroy:function(b){if(b)try{window.localStorage.clear()}catch(c){throw c;}this.$document.off("keydown.flipHtml5RemarkDelete");return this.unbindCreateEvents()}})})(window.jQuery,window.Class,window.BookInfo);
var BookMark=Class({create:function(b){this.disableCss={boxShadow:"rgba(0, 0, 0, 0.69) 0px 1px 2px inset",backgroundColor:"#cccccc",textShadow:"0 1px 1px white",color:"rgb(165, 148, 148)",cursor:"default"};this.normalCss={boxShadow:"inset 0px 1px 0px rgba(255, 255, 255, 0.5), 0px 1px 2px rgba(0, 0, 0, 0.2)",backgroundColor:"#E4E4E4",color:"#464343",textShadow:"",cursor:"pointer"};this.overCss={};this.downCss={backgroundColor:"#E4E4E4",color:"#374f00",boxShadow:"inset 0px 1px 3px rgba(0, 0, 0, 0.3), 0px 1px 0px white",
textShadow:"0px 1px 0px rgba(255, 255, 255, 0.4)"};this.bookMarkName=window.location.href.replace(window.location.hash,"")+"BookMark";this.bookMarkShowFalg=!1;this.addRightBtnFalg=this.addLeftBtnFalg=!0;this.hasTextValue=!1;this.bottomShow=!0;this.$container=b;this.bookMarkContexts={};this.address=uiBaseURL;this.serverBookMark=[];this.cookieBookMark=[];this.totalBookMark=[];for(var c=0;c<bmtConfig.length;c++){var d=bmtConfig[c];this.serverBookMark.push({isCookie:0,text:d.caption,page:d.pageIndex,
color:d.color,key:11})}this.totalPageMark=[];this.leftPageMark=[];this.rigntPageMark=[];this.lists=[];this.serverLists=[];this.cookieLists=[];this.addedPages=[];this.cookiePage=[];this.serverPage=[];for(c=0;c<this.serverBookMark.length;c++)this.serverPage.push(this.serverBookMark[c].page);this.createBookMark(b)},createBookMark:function(b){var c=this;this.bookMark=$("<div class='flipHTML5BookMark'></div>").css({maxHeight:600}).hide().appendTo(b);var d=$("<div class='flipHTML5BookMark-top' style='position: relative;height: 30px;width: 100%;left: 0px;top: 0px;background-color: #373737;'></div>").append($("<span class='flipHTML5BookMark-topText' style='left:10px;'></span>").html("Bookmark")).appendTo(this.bookMark);
this.shrink=$("<div class='flipHTML5BookMark-topShrink'></div>").css({right:32}).append($("<img style='margin-left: 2px;margin-top: 2px;'/>").attr("src",this.address+"note_narrow.png")).appendTo(d);this.close=$("<div class='flipHTML5BookMark-topClose'></div>").css({right:3}).append($("<img style='margin-left: 2px;margin-top: 2px;'/>").attr("src",this.address+"note_close.png")).appendTo(d);this.bookMarkBottom=$("<div class='flipHTML5BookMark-bottom'></div>").css({maxHeight:570}).appendTo(this.bookMark);
var f=$("<div style='position: relative;width: 100%;height: 94px;'></div>").appendTo(this.bookMarkBottom);this.bookMarkText=$("<input type='text' class='flipHTML5BookMark-saveText'/>").appendTo(f);var g=this.colorPicker(f);g.container.css({top:11,left:453});this.selectColor=g.message.css({width:24,height:24});rightToLeft&&(this.bookMarkText.attr("dir","rtl"),horizontalMirror(d),horizontalMirror(d.find("span")),d.css("text-align","right"));this.addLeftMark=$("<div class='flipHTML5BookMark-addLeftMark'></div>").css({width:100,
left:18}).html("Add To Page").appendTo(f);this.addRightMark=$("<div class='flipHTML5BookMark-addRightMark'></div>").css({width:100,left:"auto",right:18}).html("Add To Page").appendTo(f);this.bookMarkList=$("<div class='flipHTML5BookMark-list' style=' position: relative;width: 464px;left: 18px;margin: 0px;border: 0px;padding-bottom: 18px;'></div>").appendTo(this.bookMarkBottom);var f=$("<div class='flipHTML5BookMark-row-th'></div>"),g=$("<span class='flipHTML5BookMark-cellLeft-th'></span>").html("Page"),
h=$("<div class='flipHTML5BookMark-cellRight-th'></div>").append($("<div style='position: absolute;width: 1px;height: 22px;left: 0px;top: 3px;background-color: #FFFFFF;'></div>")).append($("<span style='position: absolute;width: 307px;height: 100%;left: 1px;text-indent: 6px;'></span>").html("Title")).append($("<div style='position: absolute;width: 1px;height: 22px;left: auto;right: 101px;top: 3px;background-color: #FFFFFF;'></div>")).append($("<span style='position: absolute;width: 50px;height: 100%;left: auto;right: 51px;text-indent: 10px;'></span>").html("Edit")).append($("<div style='position: absolute;width: 1px;height: 22px;left: auto;right: 50px;top: 3px;background-color: #FFFFFF;'></div>")).append($("<span style='position: absolute;width: 50px;height: 100%;left: auto;right: 0px;text-indent: 6px;'></span>").html("Delete"));
f.append(g).append(h);this.bookMarkList.append(f);this.bookMarkTable=$("<div class='flipHTML5BookMark-table'></div>").css({maxHeight:224}).appendTo(this.bookMarkList);this.bookMarkLists=$("<div class='flipHTML5BookMark-table-lists'></div>").appendTo(this.bookMarkTable);this.createScrollBar(this.bookMarkTable);this.removeAllMark=$("<div class='flipHTML5BookMark-removeBookMark'></div>").css({position:"relative",width:462,left:18,top:0}).html("Remove All").appendTo(this.bookMarkBottom);var k,l;d.on("mousedown touchstart",
function(f){f=isTouch?f.originalEvent.touches[0]:f;k=f.clientX-c.bookMark.position().left;l=f.clientY-c.bookMark.position().top;d.css({cursor:"move"});b.on("mousemove.bookmarkMove touchmove.bookmarkMove",function(b){b=isTouch?b.originalEvent.touches[0]:b;c.bookMark.css({left:b.clientX-k,top:b.clientY-l})});b.add($(document)).on("mouseup.bookmarkMove touchend.bookmarkMove",function(){d.css({cursor:"default"});b.off("mousemove.bookmarkMove touchmove.bookmarkMove");b.add($(document)).off("mouseup.bookmarkMove touchend.bookmarkMove")});
f.preventDefault();f.stopPropagation();return!1});this.addCookieMark();this.registerEvents()},isListShowHide:function(){0<this.bookMarkLists.children("div").length?(this.bookMarkList.show(),this.removeAllMark.show()):(this.bookMarkList.hide(),this.removeAllMark.hide())},addCookieMark:function(){try{var b=this.getLocalStorage(this.bookMarkName),c=eval(b),d=this.serverBookMark.concat(),b=[];c?(this.cookieBookMark=c.concat(),b=c.concat(d)):b=d;if(b)for(this.downJSonArrByKey(b,"page"),c=0;c<b.length;c++)this.addBookMarkList(b[c])}catch(f){}for(c=
0;c<this.lists.length;c++)this.lists[c].rowObj.css({backgroundColor:0==c%2?"":"#bababa"});this.scrollBarShowHide();this.updateBookMarkConfig()},registerEvents:function(){var b=this;this.shrink.on("click",function(){b.bottomShow?(b.bottomShow=!1,b.shrink.children("img").attr("src",b.address+"note_revert.png"),b.bookMarkBottom.css({maxHeight:0,paddingBottom:0})):(b.bookMarkText[0].focus(),b.bottomShow=!0,b.shrink.children("img").attr("src",b.address+"note_narrow.png"),b.bookMarkBottom.css({maxHeight:570,
paddingBottom:6}))});this.close.on("click touchend",function(){b.hide()});this.addLeftMark.on({"mouseover touchstart":function(){b.addLeftBtnFalg&&b.hasTextValue&&$(this).removeClass("flipHTML5Signature-normal").addClass("flipHTML5Signature-hover").css(b.overCss)},"mouseout touchend":function(){b.addLeftBtnFalg&&b.hasTextValue&&$(this).removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(b.normalCss)},"mousedown touchstart":function(){b.addLeftBtnFalg&&b.hasTextValue&&
$(this).removeClass("flipHTML5Signature-hover flipHTML5Signature-normal").css(b.downCss)},"mouseup touchend":function(){b.addLeftBtnFalg&&b.hasTextValue&&$(this).removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(b.normalCss)},"click touchend":function(){var c=b.bookMarkText.val();if(b.addLeftBtnFalg&&c&&b.hasTextValue){b.bookMarkText.val("");var d=BookInfo.getCurrentPages(),f=b.selectColor.attr("data-color"),d=BookInfo.isRightToLeft()?Math.max.apply(Math,d):Math.min.apply(Math,
d),c={page:d,color:f,text:c,isCookie:1,key:(new Date).getTime()};b.addBookMarkList(c);b.downJSonArrByKey(b.lists,"page");$(".flipHTML5BookMark-table-row").detach();for(f=0;f<b.lists.length;f++)b.lists[f].rowObj.css({backgroundColor:0==f%2?"":"#bababa"}),b.lists[f].rowObj.appendTo(b.bookMarkLists);b.cookiePage.push(d);b.cookieBookMark.push(c);b.addLocalStorage(b.bookMarkName,b.parseToString(b.cookieBookMark));b.setRandomColor();b.selectRadio()}}});this.addRightMark.on({"mouseover touchstart":function(){b.addRightBtnFalg&&
b.hasTextValue&&$(this).removeClass("flipHTML5Signature-normal").addClass("flipHTML5Signature-hover").css(b.overCss)},"mouseout touchend":function(){b.addRightBtnFalg&&b.hasTextValue&&$(this).removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(b.normalCss)},"mousedown touchstart":function(){b.addRightBtnFalg&&b.hasTextValue&&$(this).removeClass("flipHTML5Signature-hover flipHTML5Signature-normal").css(b.downCss)},"mouseup touchend":function(){b.addRightBtnFalg&&b.hasTextValue&&
$(this).removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(b.normalCss)},"click touchend":function(){var c=b.bookMarkText.val();if(b.addRightBtnFalg&&c&&b.hasTextValue){b.bookMarkText.val("");var d=BookInfo.getCurrentPages(),f=b.selectColor.attr("data-color"),d=BookInfo.isRightToLeft()?Math.min.apply(Math,d):Math.max.apply(Math,d),c={page:d,color:f,text:c,isCookie:1,key:(new Date).getTime()};b.addBookMarkList(c);b.downJSonArrByKey(b.lists,"page");$(".flipHTML5BookMark-table-row").detach();
for(f=0;f<b.lists.length;f++)b.lists[f].rowObj.css({backgroundColor:0==f%2?"":"#bababa"}),b.lists[f].rowObj.appendTo(b.bookMarkLists);b.cookiePage.push(d);b.cookieBookMark.push(c);b.addLocalStorage(b.bookMarkName,b.parseToString(b.cookieBookMark));b.setRandomColor();b.selectRadio()}}});this.bookMarkText.on("input propertychange change",function(){$(this).val()?b.hasTextValue=!0:b.hasTextValue=!1;b.selectRadio()});this.removeAllMark.on("click touchend",function(){$(".flipHTML5BookMark-table-row-cookie").remove();
b.cookieLists=[];b.lists=[];b.lists=b.serverLists.concat();b.downJSonArrByKey(b.lists,"page");$(".flipHTML5BookMark-table-row").detach();for(var c=0;c<b.lists.length;c++)b.lists[c].rowObj.css({backgroundColor:0==c%2?"":"#bababa"}),b.lists[c].rowObj.appendTo(b.bookMarkLists);b.cookiePage=[];b.addedPages=[];b.addedPages=b.serverPage.concat();b.selectRadio();b.cookieBookMark=[];b.totalBookMark=[];b.totalBookMark=b.serverBookMark.concat();b.addLocalStorage(b.bookMarkName,b.parseToString(b.cookieBookMark));
b.scrollBarShowHide();b.updateBookMarkConfig()})},updateBookMarkConfig:function(){this.downJSonArrByKey(this.totalBookMark,"page");bmtConfig=[];for(var b=0;b<this.totalBookMark.length;b++){var c=this.totalBookMark[b],d=c.page;0<=d&&d<=BookInfo.getPageCount()&&bmtConfig.push({caption:c.text,color:c.color,pageIndex:c.page})}BookInfo.getBookType()===BookType.normal_book&&BookInfo.getBook().bmt.refresh()},addBookMarkList:function(b){if(!(0>b.page||b.page>BookInfo.getPageCount())){var c=this,d=!0,f=b.text,
g=b.color,h=$("<div style='position: relative;height: 28px;cursor: pointer;'></div>").css({height:28}).addClass(1===b.isCookie?"flipHTML5BookMark-table-row flipHTML5BookMark-table-row-cookie":"flipHTML5BookMark-table-row").attr({"data-key":b.key,"data-page":b.page}).appendTo(c.bookMarkLists);$("<span class='flipHTML5BookMark-table-cellLeft'></span>").html(b.page).appendTo(h);var k=$("<span class='flipHTML5BookMark-table-cellRight' style=' position: absolute;width: 410px;height: 100%;left: 54px;'></span>").appendTo(h),
l=$("<div style='position: absolute;left: 0px;top: 0px;height: 100%;width: 100%;'></div>").appendTo(k),m=$("<div style='position: absolute;left: 0px;top: 0px;height: 100%;'></div>").css({width:1===b.isCookie?"309px":"100%"}).appendTo(l),n=$("<input class='flipHTML5BookMark-table-cellRight-text' disabled='true'/>").css({width:1===b.isCookie?"283px":"100%"}).attr("disabled",d).val(b.text).appendTo(m),q,p;1===b.isCookie&&(l=this.colorPicker(m),q=l.message,p=l.container,q.css({width:20,height:20,backgroundColor:b.color}).attr("data-color",
b.color),p.css({top:2,left:284}).hide());var s=$("<div class='flipHTML5BookMark-table-cellRight-edit'></div>").css({display:1===b.isCookie?"block":"none",right:64}).attr("title","Edit").append($("<img style='margin-left: 3px;margin-top: 3px;'/>").attr("src",c.address+"note_edit.png")).appendTo(k),r=$("<div class='flipHTML5BookMark-table-cellRight-cancel'></div>").css({right:51}).attr("title","Cancel").append($("<img style='margin-left: 3px;margin-top: 3px;'/>").attr("src",c.address+"bookMark_cancel.png")).appendTo(k).hide(),
k=$("<div class='flipHTML5BookMark-table-cellRight-del'></div>").css({display:1===b.isCookie?"block":"none",right:14}).attr("title","Delete").append($("<img style='margin-left: 3px;margin-top: 3px;'/>").attr("src",c.address+"note_del.png")).appendTo(k);n.attr("title",n.val());r.on("click touchend",function(b){d=!0;m.css({backgroundColor:"transparent"});n.css({backgroundColor:"transparent",color:"#1a1a1a"});n.attr("disabled",d);s.attr("title","Edit").css({right:64});s.children("img").attr("src",c.address+
"note_edit.png");p&&p.hide();n.val(f);q.attr("data-color",g).css({backgroundColor:g});r.hide();b.preventDefault();b.stopPropagation();return!1});h.on("click touchend",function(b){d&&gotoPageFun($(this).attr("data-page"))});k.on("click touchend",function(b){h.remove();var d=h.attr("data-page");c.addedPages.splice(c.addedPages.indexOf(d),1);c.cookiePage.splice(c.cookiePage.indexOf(d),1);c.selectRadio();c.delArrayByKeyAndValue(c.totalBookMark,"page",d);c.delArrayByKeyAndValue(c.cookieBookMark,"page",
d);c.addLocalStorage(c.bookMarkName,c.parseToString(c.cookieBookMark));c.delArrayByKeyAndValue(c.lists,"page",d);c.delArrayByKeyAndValue(c.cookieLists,"page",d);for(d=0;d<c.lists.length;d++)c.lists[d].rowObj.css({backgroundColor:0==d%2?"":"#bababa"});c.scrollBarShowHide();c.updateBookMarkConfig();b.preventDefault();b.stopPropagation();return!1});s.on("click touchend",function(b){if(d)d=!1,m.css({backgroundColor:"#ffffff"}),n.css({backgroundColor:"#ffffff",color:"#000000"}),s.children("img").attr("src",
c.address+"note_save.png"),n.attr("disabled",d),s.attr("title","Save").css({right:77}),n[0].focus(),r.show(),p&&p.show();else if(n.val()){d=!0;m.css({backgroundColor:"transparent"});n.css({backgroundColor:"transparent",color:"#1a1a1a"});n.attr("disabled",d);s.attr("title","Edit").css({right:64});s.children("img").attr("src",c.address+"note_edit.png");r.hide();var k=h.attr("data-key"),l=n.val();f=l;var A=q.attr("data-color");g=A;n.attr("title",n.val());c.updateArrayByKeyValue(c.cookieBookMark,"key",
k,{text:l,color:A});c.updateArrayByKeyValue(c.totalBookMark,"key",k,{text:l,color:A});c.addLocalStorage(c.bookMarkName,c.parseToString(c.cookieBookMark));p&&p.hide();c.updateBookMarkConfig()}else alert("Can not leave the text box blank!"),n.val(f);b.preventDefault();b.stopPropagation();return!1});this.scrollBarShowHide();1===b.isCookie?this.cookieLists.push($.extend({},b,{rowObj:h})):this.serverLists.push($.extend({},b,{rowObj:h}));this.lists.push($.extend({},b,{rowObj:h}));this.addedPages.push(b.page);
this.totalBookMark.push(b);this.updateBookMarkConfig()}},addBookMarkPage:function(){},selectRadio:function(){var b=this.addLeftMark,c=this.addRightMark,d=this.bookMarkText[0],f=d.value,g=BookInfo.getCurrentPages(),h=BookInfo.getPageCount();this.hasTextValue=f?!0:!1;0<=g.indexOf(0)?this.contains(this.addedPages,Math.max.apply(Math,g))?(b.add(c).removeClass("flipHTML5BookMark-normal flipHTML5BookMark-hover").css(this.disableCss),this.addRightBtnFalg=this.addLeftBtnFalg=!1,d.readOnly=!0,b.add(c).hide()):
(f?BookInfo.isRightToLeft()?(c.removeClass("flipHTML5BookMark-normal flipHTML5BookMark-hover").css(this.disableCss),b.removeClass("flipHTML5BookMark-normal").css(this.normalCss),this.addLeftBtnFalg=!0,this.addRightBtnFalg=!1,b.show().html("Add to page "+Math.max.apply(Math,g)),c.hide().html("Add to page "+Math.min.apply(Math,g))):(b.removeClass("flipHTML5BookMark-normal flipHTML5BookMark-hover").css(this.disableCss),c.removeClass("flipHTML5BookMark-normal").css(this.normalCss),this.addLeftBtnFalg=
!1,this.addRightBtnFalg=!0,b.hide().html("Add to page "+Math.min.apply(Math,g)),c.show().html("Add to page "+Math.max.apply(Math,g))):BookInfo.isRightToLeft()?(b.add(c).removeClass("flipHTML5BookMark-normal flipHTML5BookMark-hover").css(this.disableCss),this.addLeftBtnFalg=!0,this.addRightBtnFalg=!1,b.show().html("Add to page "+Math.max.apply(Math,g)),c.hide().html("Add to page "+Math.min.apply(Math,g))):(b.add(c).removeClass("flipHTML5BookMark-normal flipHTML5BookMark-hover").css(this.disableCss),
this.addLeftBtnFalg=!1,this.addRightBtnFalg=!0,b.hide().html("Add to page "+Math.min.apply(Math,g)),c.show().html("Add to page "+Math.max.apply(Math,g))),d.readOnly=!1,d.focus()):0<=g.indexOf(h)&&Math.min.apply(Math,g)==h?this.contains(this.addedPages,h)?(b.add(c).removeClass("flipHTML5BookMark-normal flipHTML5BookMark-hover").css(this.disableCss),this.addRightBtnFalg=this.addLeftBtnFalg=!1,d.readOnly=!0,b.hide().html("Add to page "+Math.min.apply(Math,g)),c.hide().html("Add to page "+Math.max.apply(Math,
g))):(f?BookInfo.isRightToLeft()?(b.removeClass("flipHTML5BookMark-normal flipHTML5BookMark-hover").css(this.disableCss),c.removeClass("flipHTML5BookMark-normal").css(this.normalCss),this.addLeftBtnFalg=!1,this.addRightBtnFalg=!0,b.hide().html("Add to page "+Math.max.apply(Math,g)),c.show().html("Add to page "+Math.min.apply(Math,g))):(c.removeClass("flipHTML5BookMark-normal flipHTML5BookMark-hover").css(this.disableCss),b.removeClass("flipHTML5BookMark-normal").css(this.normalCss),this.addLeftBtnFalg=
!0,this.addRightBtnFalg=!1,b.show().html("Add to page "+Math.min.apply(Math,g)),c.hide().html("Add to page "+Math.max.apply(Math,g))):BookInfo.isRightToLeft()?(b.add(c).removeClass("flipHTML5BookMark-normal flipHTML5BookMark-hover").css(this.disableCss),this.addLeftBtnFalg=!1,this.addRightBtnFalg=!0,b.hide().html("Add to page "+Math.max.apply(Math,g)),c.show().html("Add to page "+Math.min.apply(Math,g))):(b.add(c).removeClass("flipHTML5BookMark-normal flipHTML5BookMark-hover").css(this.disableCss),
this.addLeftBtnFalg=!0,this.addRightBtnFalg=!1,b.show().html("Add to page "+Math.min.apply(Math,g)),c.hide().html("Add to page "+Math.max.apply(Math,g))),d.readOnly=!1,d.focus()):Math.min.apply(Math,g)>h?(b.add(c).removeClass("flipHTML5BookMark-normal flipHTML5BookMark-hover").css(this.disableCss),this.addRightBtnFalg=this.addLeftBtnFalg=!1,d.readOnly=!0,b.hide().html("Add to page "+Math.min.apply(Math,g)),c.hide().html("Add to page "+Math.max.apply(Math,g))):this.contains(this.addedPages,Math.min.apply(Math,
g))||this.contains(this.addedPages,Math.max.apply(Math,g))?!this.contains(this.addedPages,Math.min.apply(Math,g))&&this.contains(this.addedPages,Math.max.apply(Math,g))?(f?BookInfo.isRightToLeft()?(b.removeClass("flipHTML5BookMark-normal flipHTML5BookMark-hover").css(this.disableCss),c.removeClass("flipHTML5BookMark-normal").css(this.normalCss),this.addLeftBtnFalg=!1,this.addRightBtnFalg=!0,b.hide().html("Add to page "+Math.max.apply(Math,g)),c.show().html("Add to page "+Math.min.apply(Math,g))):
(c.removeClass("flipHTML5BookMark-normal flipHTML5BookMark-hover").css(this.disableCss),b.removeClass("flipHTML5BookMark-normal").css(this.normalCss),this.addLeftBtnFalg=!0,this.addRightBtnFalg=!1,b.show().html("Add to page "+Math.min.apply(Math,g)),c.hide().html("Add to page "+Math.max.apply(Math,g))):BookInfo.isRightToLeft()?(b.add(c).removeClass("flipHTML5BookMark-normal flipHTML5BookMark-hover").css(this.disableCss),this.addLeftBtnFalg=!1,this.addRightBtnFalg=!0,b.hide().html("Add to page "+Math.max.apply(Math,
g)),c.show().html("Add to page "+Math.min.apply(Math,g))):(b.add(c).removeClass("flipHTML5BookMark-normal flipHTML5BookMark-hover").css(this.disableCss),this.addLeftBtnFalg=!0,this.addRightBtnFalg=!1,b.show().html("Add to page "+Math.min.apply(Math,g)),c.hide().html("Add to page "+Math.max.apply(Math,g))),d.readOnly=!1,d.focus()):this.contains(this.addedPages,Math.min.apply(Math,g))&&!this.contains(this.addedPages,Math.max.apply(Math,g))?(f?BookInfo.isRightToLeft()?(c.removeClass("flipHTML5BookMark-normal flipHTML5BookMark-hover").css(this.disableCss),
b.removeClass("flipHTML5BookMark-normal").css(this.normalCss),this.addLeftBtnFalg=!0,this.addRightBtnFalg=!1,b.show().html("Add to page "+Math.max.apply(Math,g)),c.hide().html("Add to page "+Math.min.apply(Math,g))):(b.removeClass("flipHTML5BookMark-normal flipHTML5BookMark-hover").css(this.disableCss),c.removeClass("flipHTML5BookMark-normal").css(this.normalCss),this.addLeftBtnFalg=!1,this.addRightBtnFalg=!0,b.hide().html("Add to page "+Math.min.apply(Math,g)),c.show().html("Add to page "+Math.max.apply(Math,
g))):BookInfo.isRightToLeft()?(b.add(c).removeClass("flipHTML5BookMark-normal flipHTML5BookMark-hover").css(this.disableCss),this.addLeftBtnFalg=!0,this.addRightBtnFalg=!1,b.show().html("Add to page "+Math.max.apply(Math,g)),c.hide().html("Add to page "+Math.min.apply(Math,g))):(b.add(c).removeClass("flipHTML5BookMark-normal flipHTML5BookMark-hover").css(this.disableCss),this.addLeftBtnFalg=!1,this.addRightBtnFalg=!0,b.hide().html("Add to page "+Math.min.apply(Math,g)),c.show().html("Add to page "+
Math.max.apply(Math,g))),d.readOnly=!1,d.focus()):(b.add(c).removeClass("flipHTML5BookMark-normal flipHTML5BookMark-hover").css(this.disableCss),this.addRightBtnFalg=this.addLeftBtnFalg=!1,d.readOnly=!0,b.hide().html("Add to page "+Math.min.apply(Math,g)),c.hide().html("Add to page "+Math.max.apply(Math,g))):(f?c.add(b).removeClass("flipHTML5BookMark-normal").css(this.normalCss):b.add(c).removeClass("flipHTML5BookMark-normal flipHTML5BookMark-hover").css(this.disableCss),this.addRightBtnFalg=this.addLeftBtnFalg=
!0,BookInfo.isRightToLeft()?(b.show().html("Add to page "+Math.max.apply(Math,g)),c.show().html("Add to page "+Math.min.apply(Math,g))):(b.show().html("Add to page "+Math.min.apply(Math,g)),c.show().html("Add to page "+Math.max.apply(Math,g))),d.readOnly=!1,d.focus())},colorPicker:function(b){var c,d,f,g="#FF0000 #FF5555 #FF55AA #FF55FF #FFAA55 #FFAAAA #FFAAFF #FFFF55 #FFFFAA #FFFFFF #CC0000 #CC5555 #CC55AA #CC55FF #CCAA55 #CCAAAA #CCAAFF #CCFF55 #CCFFAA #CCFFFF #AA0000 #AA5555 #AA55AA #AA55FF #AAAA55 #AAAAAA #AAAAFF #AAFF55 #AAFFAA #AAFFFF #880000 #885555 #8855AA #8855FF #88AA55 #88AAAA #88AAFF #88FF55 #88FFAA #88FFFF #550000 #555555 #5555AA #5555FF #55AA55 #55AAAA #55AAFF #55FF55 #55FFAA #55FFFF #220000 #225555 #2255AA #2255FF #22AA55 #22AAAA #22AAFF #22FF55 #22FFAA #22FFFF #000000 #005555 #0055AA #0055FF #00AA55 #00AAAA #00AAFF #00FF55 #00FFAA #00FFFF".split(" "),
h=document.createElement("table");c=document.createElement("a");var k=$(c),l=document.createElement("input"),m=function(){var b=this.title.toUpperCase();l.style.backgroundColor=b;$(l).attr("data-color",b)},n=function(){h.style.display="none"};k.appendTo(b);c.className="flipHtml5ColorSelectorWrap-bookMark";h.setAttribute("border","1");c.style.position="absolute";c.href="javascript:void(0);";l.type="text";l.className="flipHtml5ColorSelectorMessage-bookMark";b=this.getRandomColor();l.style.backgroundColor=
b;$(l).attr("data-color",b);l.style.cursor="pointer";l.style.borderWidth="2px";l.style.padding="0px";c.appendChild(l);this.$container[0].appendChild(h);h.style.display="none";h.style.position="absolute";h.style.zIndex=9999;h.style.width="204px";h.style.backgroundColor="#ffffff";for(d=0;7>d;d++){f=document.createElement("tr");f.style.position="relative";for(b=0;10>b;b++)c=document.createElement("td"),c.className="flipHtml5ColorSelectorBlock",c.style.position="relative",c.style.width="14px",c.style.height=
"14px",c.title=g[10*d+b],c.style.backgroundColor=g[10*d+b],$(c).on("mouseenter",m),$(c).on("click touchstart",n),f.appendChild(c);h.appendChild(f)}$(l).on("click touchstart",function(b){$(h).css({left:$(l).offset().left,top:$(l).offset().top+$(l).outerHeight()});h.style.display="table-cell";b.stopPropagation();b.stopPropagation();return!1});$(document).on("click touchstart",function(){h.style.display="none"});return{container:k,message:$(l)}},getRandomColor:function(){return"#"+Math.floor(2236962+
7829367*Math.random()).toString(16)},setRandomColor:function(){var b=this.getRandomColor();this.selectColor.css({backgroundColor:b}).attr("data-color",b)},show:function(){this.bookMarkShowFalg=!0;this.bookMark.show();this.bookMarkText[0].focus();this.scrollBarShowHide();this.bottomShow=!0;this.shrink.children("img").attr("src",this.address+"note_narrow.png");this.bookMarkBottom.css({maxHeight:570,paddingBottom:6})},hide:function(){this.bookMarkShowFalg=!1;this.bookMark.hide()},showHide:function(){this.bookMarkShowFalg?
this.hide():this.show()},setContainers:function(b,c,d){BookInfo.getBookType()===b&&this.selectRadio()},parseToString:function(b){if(0!=b.length){for(var c="[",d=0;d<b.length;d++)c+="{key:'"+b[d].key+"',text:'"+b[d].text+"',page:"+b[d].page+",color:'"+b[d].color+"',isCookie:"+b[d].isCookie+"},";c=c.substring(0,c.length-1);return c+"]"}},downJSonArrByKey:function(b,c){b.sort(function(b,f){return parseInt(b[c])>parseInt(f[c])?1:parseInt(b[c])==parseInt(f[c])?0:-1})},delArrayByKeyAndValue:function(b,
c,d){if(b)for(var f=0;f<b.length;f++)b[f][c]&&b[f][c]==d&&b.remove(f)},updateArrayByKeyValue:function(b,c,d,f){if(b)for(var g=0;g<b.length;g++)b[g][c]&&b[g][c]==d&&$.extend(b[g],f)},getLocalStorage:function(b){try{if(window.localStorage)return window.localStorage.getItem(b);for(var c=document.cookie.split("; "),d=0;d<c.length;d++){var f=c[d].split("=");if(f[0]==b)return unescape(f[1])}return""}catch(g){}},addLocalStorage:function(b,c){try{if(window.localStorage)window.localStorage.setItem(b,c);else{var d=
b+"="+escape(c),f=new Date;f.setTime(f.getTime()+864E8);d+="; expires="+f.toGMTString();document.cookie=d}}catch(g){}},contains:function(b,c){for(var d=0;d<b.length;d++)if(b[d]===c)return!0;return!1},createScrollBar:function(b){b=$("<div>",{"class":"ScrollBar",css:{position:"absolute",width:6,height:"100%",backgroundColor:"#a8a8a8",borderRadius:0,right:0,top:0,borderLeft:"1px solid #ffffff"}}).appendTo(b);var c=$("<div>",{"class":"OuterScroll",css:{position:"absolute",width:6,height:"100%",left:0,
top:0,backgroundColor:"transparent",borderRadius:0,overflow:"hidden",cursor:"pointer"}}).appendTo(b);$("<div>",{"class":"InnerScroll",css:{position:"absolute",width:6,height:"100%",marginLeft:0,marginRight:0,left:0,top:0,backgroundColor:"#5e5e5e",borderRadius:0,cursor:"pointer"}}).appendTo(c);this.scrollBar=b;this.outerScroll=c;this.bindScrollBarEvents(b,c,this.bookMarkTable,this.bookMarkLists)},scrollBarShowHide:function(){var b=this.bookMarkTable.outerHeight()*this.scrollBar.outerHeight()/this.bookMarkLists.outerHeight();
this.outerScroll.css({height:b});this.bookMarkTable.height()>=this.bookMarkLists.height()?(this.scrollBar.hide(),this.bookMarkLists.css({top:0})):(this.scrollBar.show(),Math.abs(parseFloat(this.bookMarkLists.css("top")))>this.bookMarkLists.outerHeight()-this.bookMarkTable.outerHeight()&&(this.bookMarkLists.css({top:-(this.bookMarkLists.outerHeight()-this.bookMarkTable.outerHeight())}),this.outerScroll.css({top:this.scrollBar.outerHeight()-this.outerScroll.outerHeight()})));this.isListShowHide()},
bindScrollBarEvents:function(b,c,d,f){var g=this;c.on(_event._down,function(b){var k=b||event,l=k.clientY-g.outerScroll.position().top,m=b.which;b.stopPropagation();1==m&&($(document).on("mousemove.scrollBar touchmove.scrollBar",function(b){b.preventDefault();b.stopPropagation();k=b||event;b=k.clientY-l;0>=b?b=0:b>=g.scrollBar.outerHeight()-g.outerScroll.outerHeight()&&(b=g.scrollBar.outerHeight()-g.outerScroll.outerHeight());c.css({top:b});f.css({top:-b/(g.scrollBar.outerHeight()-g.outerScroll.outerHeight())*
(f.outerHeight()-d.outerHeight())})}),$(document).on("mouseup.scrollBar touchend.scrollBar",function(b){b=b||event;b.preventDefault();b.stopPropagation();$(document).off("mousemove.scrollBar touchmove.scrollBar");$(document).off("mouseup.scrollBar touchend.scrollBar")}))});d.bind($.browser.mozilla?"DOMMouseScroll":"mousewheel",function(g){if(!(d.outerHeight()>=f.outerHeight())){var k=g.originalEvent,k=k.wheelDelta||-k.detail,l=f.position().top,m;f.stop(!1,!1);0<k?m=0>l+d.outerHeight()/11?l+d.outerHeight()/
11:0:0>k&&(m=f.outerHeight()-d.outerHeight()>-(l-d.outerHeight()/11)?l-d.outerHeight()/11:-(f.outerHeight()-d.outerHeight()));f.css({top:m});c.css({top:-m/(f.outerHeight()-d.outerHeight())*(b.outerHeight()-c.outerHeight())});g.stopPropagation();g.preventDefault();return!1}})}});
function grayBackground(b,c,d,f,g){this.sw=f;this.sh=g;this.background=$("<div ></div>");this.background.css({width:f+"px",height:g+"px",background:c,opacity:d,"z-index":200,position:"absolute",left:"0px",top:"0px"});b.append(this.background)}grayBackground.prototype.onResize=function(b,c){this.sw=b;this.sh=c;this.background.css({width:b+"px",height:c+"px"})};bdor[25]="i";
grayBackground.prototype.setPosition=function(b,c,d){void 0==d&&(d=["left","top"]);this.background.css(d[0],b+"px");this.background.css(d[1],c+"px")};grayBackground.prototype.show=function(){this.father.append(this.background)};grayBackground.prototype.hide=function(){this.background.remove()};grayBackground.prototype.setZindex=function(b){this.background.css({"z-index":b})};grayBackground.prototype.onMouseUp=function(b,c){$(this.background).bind(_event._down,function(d){c.call(b)})};
var textWidth=function(b,c){var d=$("<pre>"+b+"</pre>").css({color:bookConfig.iconColor,display:"none","font-size":c.size,"font-family":c.fontName});$("body").append(d);var f=Point(d.width(),d.height());d.remove();return f};
function label(b,c){this.labelBox=$('<div style = "position : absolute;font-family:Tahoma,Georgia,Serif;font-size:12px">'+b+"</div>");this.caption=b;this.fontSize="12px";this.fontColor="#f0f0f0";this.fontName="Tahoma";var d=textWidth(b,{size:this.fontSize,fontName:this.fontName});this.width=d.x;this.height=d.y;c.append(this.labelBox)}label.prototype.getWidth=function(){return this.width};bdor[27]="f";label.prototype.getHeight=function(){return this.height};label.prototype.getCaption=function(){return this.caption};
label.prototype.setCaption=function(b){this.caption=b;this.labelBox[0].innerHTML=b;b=textWidth(b,{size:this.fontSize,fontName:this.fontName});this.width=b.x;this.height=b.y};label.prototype.setLabelPosition=function(b,c,d){void 0==d&&(d=["left","top"]);this.labelBox.css(d[0],b+"px");this.labelBox.css(d[1],c+"px")};label.prototype.onResize=function(b,c){this.width=b;this.height=c;this.labelBox.css({width:b+"px",height:c+"px"})};
label.prototype.setFont=function(b,c,d){null==b?b=this.fontSize:this.fontSize=b;null==c?c=this.fontColor:this.fontColor=c;null==d?d=this.fontName:this.fontName=d;this.labelBox.css({"font-size":b,color:c,"font-family":d});b=textWidth(this.caption,{size:b,fontName:d});this.width=b.x;this.height=b.y};label.prototype.setFontSize=function(b){null==b?b=this.fontSize:this.fontSize=b;this.labelBox.css({"font-size":b});b=textWidth(this.caption,{size:b,fontName:this.fontName});this.width=b.x;this.height=b.y};
label.prototype.riseAWord=function(b){var c=this.caption;-1==c.indexOf(b)&&(b=b.toLowerCase());-1!=c.indexOf(b)&&(newCaption=c.replaceAll(b,"<font color=red><strong>"+b+"</strong></font>"),this.labelBox[0].innerHTML=newCaption)};label.prototype.shortWord=function(b){this.caption.length>b&&(this.caption=this.caption.substring(0,b)+"..",this.setCaption(this.caption))};label.prototype.setCSS=function(b){this.labelBox.css(b)};label.prototype.setClass=function(b){this.labelBox.attr("class",b)};
function tipsBox(b,c){this.visible=!1;this.caption=b;this.background=$("<div style = 'position : absolute;'></div>");this.contentBox=new label(b,this.background);this.contentBox.setFont("15px","#f0f0f0",null);this.width=this.contentBox.getWidth()+12;this.height=40;$(c).append(this.background);$(this.background).css({width:this.width+"px",height:this.height+"px","-webkit-border-radius":"3px","-moz-border-radius":"3px","-o-border-radius":"3px","border-radius":"3px","-webkit-box-shadow":"0 0 15px rgba(40, 40, 40, 0.6)",
"-moz-box-shadow":"0 0 15px rgba(40, 40, 40, 0.6)","-ms-box-shadow":"0 0 15px rgba(40, 40, 40, 0.6)","-o-box-shadow":"0 0 15px rgba(40, 40, 40, 0.6)","box-shadow":"0 0 15px rgba(40, 40, 40, 0.6)","background-color":"#333333",opacity:"0.5",display:"none","z-index":110});this.contentBox.setLabelPosition(4,(this.height-this.contentBox.getHeight())/2-3)}tipsBox.prototype.setTimer=function(){var b=this;this.timer=window.setInterval(function(){b.hideTipsBox();window.clearInterval(b.timer)},1500)};
tipsBox.prototype.resetTimer=function(){window.clearInterval(this.timer);this.setTimer()};tipsBox.prototype.setPosition=function(b,c,d){void 0==d&&(d=["left","top"]);$(this.background).css(d[0],b+"px");$(this.background).css(d[1],c+"px")};tipsBox.prototype.onResize=function(b,c){this.width=b;this.height=c;$(this.background).css({width:b+"px",height:c+"px"});this.contentBox.setLabelPosition(4,(c-this.contentBox.getHeight())/2)};tipsBox.prototype.getWidth=function(){return this.width};
tipsBox.prototype.getHeight=function(){return this.height};tipsBox.prototype.setCaption=function(b){this.contentBox.setCaption(b);this.caption=b;this.contentBox.setLabelPosition(4,(this.height-this.contentBox.getHeight())/2-3)};tipsBox.prototype.showTipsBox=function(){this.visible?this.resetTimer():(this.setTimer(),this.visible=!0,$(this.background).css({display:"block","z-index":110}),$(this.background).animate({opacity:0.5},300))};
tipsBox.prototype.hideTipsBox=function(){var b=this;this.visible&&(this.visible=!1,$(this.background).animate({opacity:0},300,function(){$(b.background).css({display:"none","z-index":1})}))};function initProgressBar(b,c){this.width=60;this.height=30;this.progress=new label("Loading",b);this.caption=this.originCaption=c;this.captionLength=this.caption.length;this.progress.setCSS({display:"none"})}
initProgressBar.prototype.setPosition=function(b,c){this.progress.setLabelPosition((b-this.width)/2,(c-this.height)/2)};initProgressBar.prototype.addTimer=function(){var b=this;this.timerId=window.setInterval(function(){b.caption+=".";b.caption.length>b.captionLength+3&&(b.caption=originCaption);b.progress.setCaption(b.caption)},600)};initProgressBar.prototype.removeTimer=function(){window.clearInterval(this.timerId)};
initProgressBar.prototype.show=function(){this.progress.setCSS({display:"block"});this.caption=this.originCaption;this.addTimer()};initProgressBar.prototype.hide=function(){this.progress.setCSS({display:"none"});this.removeTimer()};initProgressBar.prototype.setIndex=function(b){this.progress.setCSS({"z-index":b})};function bookShadow(b){this.background=$("<div class='bookShadow'></div>");$(b).append(this.background);this.visible=!0}bdor[26]="h";
bookShadow.prototype.doubleWidth=function(b){$(this.background).attr("class",b?"doubleWidth":"singleWidth");$(this.background).addClass("bookShadow")};bookShadow.prototype.right=function(b){$(this.background).css({right:"auto"});b&&$(this.background).css({right:"0px"})};bookShadow.prototype.show=function(){this.visible||($(this.background).show(),this.visible=!0)};bookShadow.prototype.hide=function(){this.visible&&($(this.background).hide(),this.visible=!1)};
function bookMarkTab(b,c,d,f){this.fnShow=c;this.fnHide=d;this.maxWidth=f?f:80;this.minWidth=60;this.config=$.extend({caption:"",color:"#888"},b);this.bg=$("<div style='border-top-left-radius: 3px;border-top-right-radius: 3px;overflow: hidden;'></div>");!this.config.pageIndex||""==this.config.caption||this.config.pageIndex>originTotalPageCount||(this.caption=new label(this.config.caption,this.bg),this.width=this.caption.getWidth()+30,this.width=this.width>this.maxWidth?this.maxWidth:this.width<this.minWidth?
this.minWidth:this.width,this.height=60,this.hiding=this.showing=!1,b=colorDiv(this.config.color,10),this.bg.css({color:"#EEEEEE","font-family":"arial,tahoma,sans-serif","font-size":"12px",position:"absolute","z-index":"-1",width:this.width+"px",height:this.height+"px","background-color":this.config.color,border:"1px solid "+b,cursor:"pointer"}),this.bg.append(this.caption),this.bg.append($("<div style='position: absolute;top: 30px;width: 100%;text-align: center;'></div>").html(this.config.pageIndex)),
this.caption.setLabelPosition(0,8),this.caption.setClass("bookMarkText"),this.caption.setCSS({width:"100%",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",textAlign:"center"}),this.initEvent())}bdor[18]="t";bookMarkTab.prototype.resize=function(b,c){b>this.maxWidth&&(b=this.maxWidth);this.width=b;this.height=c;this.bg.css({width:b+"px",height:c+"px"})};
bookMarkTab.prototype.setPosition=function(b,c,d){d?this.bg.css({top:c+"px",right:b+"px",left:"auto"}):this.bg.css({top:c+"px",left:b+"px",right:"auto"})};bookMarkTab.prototype.show=function(){if(!this.showing){this.showing=!0;var b=this;this.bg.animate({top:0},150,function(){b.showing=!1})}};bookMarkTab.prototype.hide=function(){if(!this.hiding){this.hiding=!0;var b=this;this.bg.animate({top:30},150,function(){b.hiding=!1})}};bdor[19]="c";
bookMarkTab.prototype.setMaxWidth=function(b){this.maxWidth=b;this.resize(this.width,this.height)};bookMarkTab.prototype.getWidth=function(){return this.width};
bookMarkTab.prototype.initEvent=function(){var b=this;this.bg.on("mouseover",function(c){$(this).attr("title",b.bg.find(".bookMarkText").html());b.show()});this.bg.on("mouseleave",function(c){b.hide()});this.bg.bind(_event._down,function(c){gotoPageFun(b.config.pageIndex);c.stopPropagation();c.stopPropagation();return!1});this.bg.on("mouseup touchend",function(b){b.stopPropagation();b.stopPropagation();return!1})};
function tabBox(b){this.tabArray=[];this.bg=$("<div id='bg'></div>");this.width=400;this.height=60;this.tipBoxHeight=this.tipBoxWidth=70;this.bg.css({position:"absolute",width:this.width+"px",height:this.height+"px",overflow:"hidden","z-index":10,"font-family":"arial,tahoma,sans-serif","font-size":"12px"});this.bg.bind(_event._end,function(){return!1});this.bg.bind(_event._down,function(){return!1});this.bg.bind(_event._move,function(){return!1});b.append(this.bg)}
tabBox.prototype.resize=function(b,c,d){this.width=b;this.height=c;this.bg.css({width:this.width+"px",height:this.height+"px"});this.setTabPosition(d)};bdor[20]="b";tabBox.prototype.setPosition=function(b,c){this.bg.css({left:b+"px",top:c+"px"})};
tabBox.prototype.rotate=function(b){b=rotate(b);this.bg.css({"-webkit-transform-origin":"0% 0%","-moz-transform-origin":"0% 0%","-ms-transform-origin":"0% 0%","-o-transform-origin":"0% 0%","transform-origin":"0% 0%","-webkit-transform":b,"-moz-transform":b,"-ms-transform":b,"-o-transform":b,transform:b})};tabBox.prototype.show=function(){0==this.tabArray.length?this.hide():this.bg.css({display:"block"})};tabBox.prototype.hide=function(){this.bg.css({display:"none"})};
tabBox.prototype.setItem=function(b){this.tabArray=b||[];this.setTabPosition()};tabBox.prototype.initItem=function(b){for(var c=0;c<this.tabArray.length;c++)this.bg.append(this.tabArray[c].bg);this.setTabPosition(b);0==this.tabArray.length?this.hide():this.show()};tabBox.prototype.refresh=function(){this.bg.empty()};
tabBox.prototype.setTabPosition=function(b){for(var c=0,d=0,f=0;f<this.tabArray.length;f++)c+=this.tabArray[f].getWidth(),this.bg.append(this.tabArray[f]);if(c<=this.width)for(c=0;c<this.tabArray.length;c++)this.tabArray[c].setPosition(d,30,b),d=d+this.tabArray[c].getWidth()+2;else for(f=0;f<this.tabArray.length;f++)this.tabArray[f].setPosition(d,30,b),d+=this.tabArray[f].getWidth()*this.width/c};
function initBookMarkTab(b,c){this.isRight=c;this.tabArray=[];this.leftBox=new tabBox(b);this.rightBox=new tabBox(b);this.leftTabArr=[];this.rightTabArr=[];this.tipBox=$("<div id='tipbox'></div>");this.tipImg=$("<img />");this.tipLabel=new label("page 1",this.tipBox);b.append(this.tipBox);this.tipBox.append(this.tipImg);this.tipBoxHeight=this.tipBoxWidth=70;this.tipBox.css({width:this.tipBoxWidth+"px",height:this.tipBoxHeight+"px",position:"absolute",left:(windowWidth-this.tipBoxWidth)/2+"px",top:(windowHeight-
this.tipBoxHeight)/2-200+"px",opacity:0,display:"none",background:"#ff0000","z-index":10});this.tipImg.attr({src:""});this.tipLabel.setLabelPosition(5,this.tipBoxHeight-25);0!=bmtConfig.length&&(this.setPosition(),this.resort(),this.initItem())}initBookMarkTab.prototype.resize=function(b,c){this.leftBox.resize(b,c,!0);this.rightBox.resize(b,c,!1);this.setPosition()};bdor[21]="f";
initBookMarkTab.prototype.setPosition=function(){void 0!=BookInfo.getBook()&&(this.leftBox.setPosition(-60,BookInfo.getBook().height),this.rightBox.setPosition(BookInfo.getBook().width+60,0),this.leftBox.rotate(-90),this.rightBox.rotate(90))};initBookMarkTab.prototype.refresh=function(){this.resort();this.tabArray=[];this.leftTabArr=[];this.rightTabArr=[];this.leftBox.refresh();this.rightBox.refresh();this.initItem()};initBookMarkTab.prototype.resort=function(){void 0!=bmtConfig&&bmtConfig.sort(createComparisonFunction("pageIndex"))};
bdor.m=bdor[7];function createComparisonFunction(b){return function(c,d){var f=c[b],g=d[b];return f<g?-1:f>g?1:0}}initBookMarkTab.prototype.initItem=function(){for(var b=0;b<bmtConfig.length;b++){var c=new bookMarkTab(bmtConfig[b],this.showTipBox,this.hideTipBox);this.tabArray.push(c)}this.isRight?(this.leftBox.tabArray=this.tabArray,this.leftBox.initItem(!0)):(this.rightBox.tabArray=this.tabArray,this.rightBox.initItem(!1));void 0!=BookInfo.getBook()&&this.separated(BookInfo.getBook().currentPageIndex)};
initBookMarkTab.prototype.showTipBox=function(b){this.tipLabel.setCaption("page "+b);b=(windowHeight-this.tipBoxHeight)/2;this.tipBox.css({display:"block"});this.tipBox.animate({opacity:1,top:b},{duration:300})};initBookMarkTab.prototype.hideTipBox=function(){var b=this,c=(windowHeight-this.tipBoxHeight)/2-200;this.tipBox.css({display:"none"});this.tipBox.animate({opacity:0},300,function(){b.tipBox.css({top:c+"px"})})};
initBookMarkTab.prototype.separated=function(b){this.leftTabArr=[];this.rightTabArr=[];if(this.isRight)for(b=0;b<this.tabArray.length;b++)this.tabArray[b].config.pageIndex>=Math.max.apply(Math,BookInfo.getCurrentPages())?this.leftTabArr.push(this.tabArray[b]):this.rightTabArr.push(this.tabArray[b]);else for(b=0;b<this.tabArray.length;b++)this.tabArray[b].config.pageIndex>=Math.max.apply(Math,BookInfo.getCurrentPages())?this.rightTabArr.push(this.tabArray[b]):this.leftTabArr.push(this.tabArray[b]);
this.leftBox.tabArray=this.leftTabArr;this.rightBox.tabArray=this.rightTabArr;this.leftBox.initItem(!0);this.rightBox.initItem(!1)};initBookMarkTab.prototype.show=function(){this.leftBox.show();this.rightBox.show()};initBookMarkTab.prototype.hide=function(){this.leftBox.hide();this.rightBox.hide()};
function treeNode(b,c,d){this.config=$.extend({caption:"untitled",page:0,width:240,height:35,backColor:d,fontColor:bookConfig.bookmarkFontColor,level:0,padding:10},b);var f=this;this.background=$('<div style="position:relative; overflow : hidden;"></div>');this.contentBox=$("<div id='tableOfContent' style=\"position:absolute;\"></div>");b=this.config.caption.HTMLLabel2Text();this.textField=new label(b,this.contentBox);this.expandButton=new button(this.contentBox,{buttonType:1,iconURL:uiBaseURL+"closed.png"});
this.children=[];this.opened=this.hasChild=!1;this.totalHeight=0;this.showing=!1;this.textField.shortWord(25);this.isDrag=!1;this.expandButton.setVisible(!1);$(c).append(this.background);$(this.background).append(this.contentBox);this.expandButton.setIconPosition(5,10);this.expandButton.setButtonPosition(-10,0);this.textField.setLabelPosition(13,10,["left","top"]);c=this.config.width-2*this.config.padding;$(this.contentBox).css({width:c+"px",height:this.config.height+"px",color:this.config.fontColor,
left:12*Math.max(this.config.level,0)+5+"px",cursor:"pointer","font-family":"arial,tahoma,sans-serif","font-size":"12px"});$(this.background).css({width:c+"px",height:this.config.height+"px",left:+this.config.padding+"px",top:+this.config.padding+"px","background-color":this.config.backColor,"-moz-border-radius":"5px","-webkit-border-radius":"5px","border-radius":"5px","border-left":"0px solid #CCCCCC","border-right":"0px solid #CCCCCC","border-bottom":"0px solid #CCCCCC","font-family":"arial,tahoma,sans-serif",
"font-size":"12px"});this.fontColor=bookConfig.bookmarkFontColor;this.downBackColor=this.config.backColor;this.textShadow="";this.expandButton.onMouseUp(this,this.onExpand);this.expandButton.onMouseDown(this,function(){return!1});var g=!1;$(this.contentBox).bind(_event._down,function(){if(global.phoneTableOfContent&&!global.phoneTableOfContent.isDrag||!global.phoneTableOfContent&&!isBookmarkDrag)g=!0});$(this.contentBox).bind(_event._move,function(){if(global.phoneTableOfContent&&!global.phoneTableOfContent.isDrag||
!global.phoneTableOfContent&&!isBookmarkDrag)g=!1});$(this.contentBox).bind(_event._end,function(b){if(global.phoneTableOfContent&&!global.phoneTableOfContent.isDrag||!global.phoneTableOfContent&&!isBookmarkDrag)g&&gotoPageFun(f.config.page),g=!1});$(this.contentBox).bind(_event._down,function(b){isTouch||(b=colorAdd(f.config.backColor,50),$(f.background).css({"background-color":b}),$(f.contentBox).css({color:"#8c97cb"}),$(f.contentBox).css({"text-shadow":"0 0 30px #8c97cb, 0 0 70px #8c97cb"}))});
$(this.background).bind(_event._enter,function(b){isTouch||(b=colorAdd(f.config.backColor,50),$(f.background).css({"background-color":b}),$(f.contentBox).css({color:"#8c97cb"}),$(f.contentBox).css({"text-shadow":"0 0 30px #8c97cb, 0 0 70px #8c97cb"}))});$(this.background).bind(_event._end,function(b){isTouch||($(f.background).css({"background-color":f.downBackColor}),$(f.contentBox).css({color:f.fontColor}),$(f.contentBox).css({"text-shadow":f.textShadow}))});$(this.background).bind(_event._leave,
function(b){isTouch||($(f.background).css({"background-color":f.downBackColor}),$(f.contentBox).css({color:f.fontColor}),$(f.contentBox).css({"text-shadow":f.textShadow}))});!rightToLeft||isPhone()||global.foldingMenu||horizontalMirror(this.background)}treeNode.prototype.setBorderTop=function(b){$(this.background).css("border-top","0px solid #CCCCCC")};treeNode.prototype.setButtonVisible=function(b){this.expandButton.setVisible(b)};
treeNode.prototype.setHasChildren=function(b){(this.hasChild=b)&&$(this.contentBox).css({"font-weight":"bold"})};treeNode.prototype.setVisible=function(b){$(this.background).css({display:b?"block":"none"})};treeNode.prototype.getIsExpand=function(){return this.opened};treeNode.prototype.setIsExpand=function(b){this.opened=b};treeNode.prototype.getBackground=function(){return this.background};treeNode.prototype.getWidth=function(){return this.config.width};treeNode.prototype.getHeight=function(){return this.config.height};
treeNode.prototype.setCaption=function(b){this.config.caption=b.HTMLLabel2Text()};treeNode.prototype.setColor=function(b){};treeNode.prototype.setPosition=function(b,c,d){void 0==d&&(d=["left","top"]);$(this.background).css(d[0],b+"px");$(this.background).css(d[1],c+"px")};treeNode.prototype.onResize=function(b,c){this.config.width=b+13;c&&(this.config.height=c);this.background.css({width:this.config.width-this.config.padding+"px",height:this.config.height+"px"})};
treeNode.prototype.getTotalHeight=function(){return this.totalHeight};
treeNode.prototype.expand=function(){if(this.hasChild){this.expandButton.changeIcon(uiBaseURL+"opened.png");for(var b=0;b<this.children.length;b++)this.children[b].setVisible(!0),this.children[b].getIsExpand()?this.children[b].expand():this.children[b].bookMarkEnter();$(this.contentBox).css({color:bookConfig.bookmarkFontColor});this.fontColor=bookConfig.bookmarkFontColor;this.downBackColor=this.config.backColor;this.textShadow=""}else this.expandButton.changeIcon(uiBaseURL+"bookMarkEnter.png")};
treeNode.prototype.bookMarkEnter=function(){this.hasChild||this.expandButton.changeIcon(uiBaseURL+"bookMarkEnter.png")};treeNode.prototype.collapse=function(){if(this.hasChild){this.expandButton.changeIcon(uiBaseURL+"closed.png");for(var b=0;b<this.children.length;b++)this.children[b].setVisible(!1),this.children[b].collapse();$(this.contentBox).css({color:bookConfig.bookmarkFontColor});this.fontColor=bookConfig.bookmarkFontColor;this.downBackColor=this.config.backColor;this.textShadow=""}};
treeNode.prototype.onExpand=function(){this.opened?this.collapse():this.expand();this.opened=!this.opened;$(this.background).css({"background-color":this.config.backColor});return!1};treeNode.prototype.addChildren=function(b){this.children.push(b)};treeNode.prototype.addNode=function(b){b=new treeNode(b,this.background);this.children.push(b)};treeNode.prototype.deleteNode=function(){};treeNode.prototype.getPageIndex=function(){return this.config.page};
var isBookmarkDrag=!1,tableContent=Class({create:function(b,c){this._super(b,c);this.scrollMask=$('<div style = "position : absolute;"></div>');this.scrollBox=$('<div style = "position : absolute; width : 190px; height : 300px; overflow-y : auto;"></div>');this.scrollMouseDown=!1;this.mouseDownY=-1;this.changeScrollHeight=!1;this.height=this.width=200;this.showing=!1;this.itemArr=[];if(isPhone()||isPad())this.scrollMask.css({"overflow-y":"scroll","overflow-x":"hidden","-webkit-overflow-scrolling":"touch"});
else{var d=$("<link rel='stylesheet' href='"+bookConfig.UIBaseURL+"style/scrollbar.css'/>");$("body").append(d)}$(this.contentBox).append(this.scrollMask);$(this.contentBox).append(this.scrollBox);this.captionBox.setFont("12px","#cccccc","arial");this.captionBox.setCaption("<strong>"+getLanguage("frmToc","Table of Content")+"</strong>");this.initScrollEvent();d=windowWidth/4+this.formConfig.scrollbarWidth;d=Math.max(300,d);this.formBackground.css({opacity:1,"z-index":99,top:"10px",left:-d-20+"px",
width:"200px"});this.scrollMask.css({"border-top":"1px solid "+colorAdd(bookConfig.bookmarkBackground,40)});this.captionBox.setFontSize(16);this.contentColor=bookConfig.bookmarkBackground},addContent:function(b,c,d){addProgressBar(this.contentBox,this.width,this.height);for(var f=0;f<b.length;f++){var g=new treeNode(b[f],this.scrollBox,this.contentColor);this.itemArr.push(g);c||0!=f||g.setBorderTop();c&&(d.addChildren(g),g.setVisible(!1));1<=b[f].children.length?(g.setButtonVisible(!0),g.setHasChildren(!0),
this.addContent(b[f].children,!0,g)):(g.setButtonVisible(!0),g.bookMarkEnter())}},onResize:function(b,c){this.width=100>b?100:b;this.height=100>c?100:c;this.showing||this.formBackground.css({left:-(this.width+this.formConfig.scrollbarWidth+20)+"px"});this.setWidth(b);this.setHeight(c);$(this.scrollMask).css({width:this.width+"px",height:this.height-this.titleBox.height()+"px"});$(this.scrollBox).css({width:this.width+this.formConfig.scrollbarWidth+"px",height:this.height-this.titleBox.height()-15+
"px",top:"1px"});for(var d=0;d<this.itemArr.length;d++)this.itemArr[d].onResize(this.width-30)},showForm:function(){var b=this;this.formBackground.animate({left:10},400,function(){b.showing=!0;if(void 0==b.addContentDown||null==b.addContentDown)b.addContentDown=!1;if(!1==b.addContentDown)try{b.addContent(ols,!1),clearProgressBar(b.contentBox),b.addContentDown=!0}catch(c){$("#btnTableOfContent").css({display:"none"}),tableofcontentButtonEnable=!1}})},closeForm:function(){var b=this,c=windowWidth/4+
this.formConfig.scrollbarWidth,c=Math.max(300,c);this.formBackground.animate({left:-(b.width+b.formConfig.scrollbarWidth+20)},400,function(){b.showing=!1})},getShowStatu:function(){return this.showing},setShowStatu:function(b){this.showing=b},setPosition:function(b,c,d){void 0==d&&(d=["left","top"]);$(this.formBackground).css(d[0],b+"px");$(this.formBackground).css(d[1],c+"px")},initScrollEvent:function(){var b=this;$(this.scrollBox).bind(_event._down,function(c){b.scrollMouseDown=!0;isBookmarkDrag=
!1;c=isTouch?c.originalEvent.touches:[c];b.mouseDownY=c[0].pageY;3==browserType?event.cancelBubble=!0:event.stopPropagation()});$(this.scrollBox).bind(_event._move,function(c){b.scrollMouseDown&&(c=isTouch?c.originalEvent.touches:[c],Math.abs(b.mouseDownY-c[0].pageY))});$(this.scrollBox).bind(_event._end,function(c){b.scrollMouseDown=!1})}}).extend(form),phoneTableContent=Class({create:function(b,c){this.contentBox=c;this.width=this.contentBox.width();this.height=foldingMenu.height-foldingMenu.getItemById("miTableOfContent").title.height();
this.formConfig=$.extend({width:this.width,height:this.height,scrollbarWidth:13},b);this.scrollMouseDown=!1;this.mouseDownY=-1;this.changeScrollHeight=!0;this.contentBac=colorDiv(bookConfig.toolbarColor,30);this.showing=!1;this.itemArr=[];this.scrollMask=$("<div id='scrollMask' style = \"position : absolute;overflow:hidden;\"></div>");this.scrollBox=$("<div id='scrollBox' style = \"position : absolute;\"></div>");$(this.contentBox).append(this.scrollMask);$(this.scrollMask).append(this.scrollBox);
this.scrollBox.css({width:this.width+"px",background:this.contentBac});this.scrollMask.css({width:this.width+"px",height:this.height+"px",background:this.contentBac});this.initScrollEvent();this.scrollMask.css({"border-top":"1px solid "+colorAdd(bookConfig.toolbarColor,40)});this.contentColor=this.contentBac;this.showForm();for(var d=0;d<this.itemArr.length;d++)this.itemArr[d].onResize(this.width-30);this.scrollBox.css({height:35*this.itemArr.length+"px"});this.isDrag=!1},initStyle:function(){},onResize:function(b,
c){this.width=this.contentBox.width();this.height=foldingMenu.height-foldingMenu.getItemById("miTableOfContent").title.height();this.scrollBox.css({width:this.width+"px"});this.scrollMask.css({width:this.width+"px",height:this.height+"px"});for(var d=0;d<this.itemArr.length;d++)this.itemArr[d].onResize(this.width-30)},showForm:function(){this.showing=!0;if(void 0==this.addContentDown||null==this.addContentDown)this.addContentDown=!1;if(!1==this.addContentDown)try{this.addContent(ols,!1),clearProgressBar(this.contentBox),
this.addContentDown=!0}catch(b){$("#btnTableOfContent").css({display:"none"}),tableofcontentButtonEnable=!1}},initScrollEvent:function(){if(isPhone()||isPad())this.scrollMask.css({"overflow-y":"scroll","overflow-x":"hidden","-webkit-overflow-scrolling":"touch"});else{var b=$("<link rel='stylesheet' href='"+bookConfig.UIBaseURL+"style/scrollbar.css'/>");$("body").append(b);this.scrollMask.css({overflow:"hidden"});ScrollFunction(this.scrollMask,this.scrollBox,this)}}}).extend(tableContent);bdor.l=bdor.i(10);
Class("Thickness",{create:function(b,c){this.thicknessObj=$('<div style="overflow:hidden"></div>');this.parent=b;this.isRightToLeftBook=parseBool(bookConfig.RightToLeft);this.imageWidth=c;this.getMaxWidth();this.visible=!0;this.hint=null;this.init();this.initShadow();this.initHint()},getMaxWidth:function(){var b=Math.min(bookConfig.totalPageCount,100);this.maxWidth=$.easing.easeOutQuad(null,b,0,this.imageWidth,100);this.maxWidth=Math.ceil(this.maxWidth);this.maxWidthZoom=1},init:function(){this.topPart=
$("<div style='position:relative;height:50px;width:"+this.imageWidth+"px;overflow:hidden;'></div>");this.centerPart=$("<div style='position:relative;height:auto;width:"+this.imageWidth+"px;overflow:hidden;'></div>");this.bottomPart=$("<div style='position:relative;height:50px;width:"+this.imageWidth+"px;overflow:hidden;'></div>");this.fillThicknessImage();this.thicknessObj.append(this.topPart);this.thicknessObj.append(this.centerPart);this.thicknessObj.append(this.bottomPart);this.parent.append(this.thicknessObj)},
fillThicknessImage:virtual_function,initHint:function(){this.thicknessObj.onMouseMove(function(b){b=b[0];$(b.target);var c=b.offsetX;void 0==c&&(c=b.pageX-this.thicknessObj.offset().left);c=this.pageIndexByPosition(c);if(-1!=c){var c=" "+getShownPageNumber(c)+" ",d=b.pageX;b=b.pageY-30;null==this.hint&&(this.hint=new divHint(c,d,b));this.hint.setText(c);this.hint.show(d,b);this.hint.moveto(d,b)}else null!=this.hint&&this.hint.hide()}.bind(this));this.thicknessObj.onMouseLeave(function(){null!=this.hint&&
this.hint.hide()}.bind(this));this.thicknessObj.onClick(function(b){b=b[0];$(b.target);var c=b.offsetX;void 0==c&&(c=b.pageX-this.thicknessObj.offset().left);b=this.pageIndexByPosition(c);c=BookInfo.getBook().currentPageIndex;bookType==BookType.single_book&&(c=singlePageBook.currentPageIndex);var d=c+1;bookType==BookType.single_book&&(d=-1);-1!=b&&b!=c&&b!=d&&gotoPageFun(b)}.bind(this))},initShadow:function(){this.shadowContent=$("<div></div>");this.shadowContent.css({perspective:500,"-webkit-perspective":500,
"-moz-perspective":500,"-ms-perspective":500,top:"2px"});this.shadowObj=$('<div style="width:100%;height:100%;"></div>');this.shadowObj.css({"transform-style":"preserve-3d","-webkit-transform-style":"preserve-3d","-moz-transform-style":"preserve-3d","-ms-transform-style":"preserve-3d","background-color":"#CCCCCC"});this.initShadowStyle();this.shadowContent.append(this.shadowObj);this.parent.append(this.shadowContent);$.browser.msie&&11>$.browser.version&&this.shadowContent.css({display:"none"})},
initShadowStyle:virtual_function,onResize:function(){this.contentWidth=this.parent.width();this.contentHeight=this.parent.height();this.maxWidthZoom=Math.min(1,this.contentHeight/800);this.maxWidthZoom=$.easing.swing(null,Math.max(this.maxWidth-8,0),1,this.maxWidthZoom-1,this.imageWidth-8);this.thicknessObj.css({height:this.contentHeight});this.shadowContent.css({height:this.contentHeight-4});this.centerPart.css({height:Math.max(0,this.contentHeight-100)});this.centerPart.find("img").css({height:this.contentHeight});
this.resetPosition()},getThicknessWidth:virtual_function,resetPosition:virtual_function,hide:function(){this.thicknessObj.css("display","none");this.shadowContent.css("display","none");this.visible=!1},show:function(){this.thicknessObj.css("display","block");this.shadowContent.css("display","block");this.visible=!0},setVisible:function(b){b?this.show():this.hide()},pageIndexByPosition:virtual_function});
Class("LeftThickness",{initShadowStyle:function(){this.shadowObj.css({transform:"rotateY(-20deg)","-webkit-transform":"rotateY(-20deg)","-moz-transform":"rotateY(-20deg)","-ms-transform":"rotateY(-20deg)","-webkit-box-shadow":"-3px 0px 6px rgba(125, 125, 125, 0.7)","-moz-box-shadow":"-3px 0px 6px rgba(125, 125, 125, 0.7)","-ms-box-shadow":"-3px 0px 6px rgba(125, 125, 125, 0.7)","box-shadow":"-3px 0px 6px rgba(125, 125, 125, 0.7)"})},fillThicknessImage:function(){this.topPart.append("<img src='"+uiBaseURL+
"thickness_left.png' style='position:absolute;width:100%;top:0px;' />");this.centerPart.append("<img src='"+uiBaseURL+"thickness_left.png' style='position:absolute;width:100%;top:-50px;' />");this.bottomPart.append("<img src='"+uiBaseURL+"thickness_left.png' style='position:absolute;width:100%;bottom:0px;' />")},getThicknessWidth:function(b){var c=bookConfig.totalPageCount,d=1;void 0!=b?d=b:BookInfo.getBook()&&(d=BookInfo.getBook().currentPageIndex);b=Math.ceil(this.maxWidth*this.maxWidthZoom);this.thicknessWidth=
this.isRightToLeftBook?Math.ceil(b*(c-d)/c):Math.ceil(b*d/c);this.thicknessWidth=Math.max(this.thicknessWidth,2)},resetPosition:function(b){this.getThicknessWidth(b);b=transformCSS({tran:{x:this.thicknessWidth-this.imageWidth,y:0}});this.topPart.css(b);this.centerPart.css(b);this.bottomPart.css(b);this.thicknessObj.css({width:this.thicknessWidth+"px",position:"absolute","z-index":2});b=transformCSS({tran:{x:-this.thicknessWidth,y:0}});this.thicknessObj.css(b);b=Math.ceil(this.thicknessWidth/Math.sin(7*
Math.PI/18));this.shadowContent.css({width:b+"px",position:"absolute","z-index":1});b=transformCSS({tran:{x:-this.thicknessWidth,y:0}});this.shadowContent.css(b)},pageIndexByPosition:function(b){b=b+this.thicknessWidth-this.imageWidth;var c=this.thicknessWidth;if(0<c-b&&c-b<=c){var d=bookConfig.totalPageCount,f=BookInfo.getBook().currentPageIndex;bookType==BookType.single_book&&(f=singlePageBook.currentPageIndex);!0==rightToLeft?(b=Math.floor((d-f-1)*(1-(b-(c-c))/c)),b+=f+1):(b=Math.floor((f-1)*(b-
(c-c))/c),b++);return b}return-1}}).extend(Thickness);
Class("RightThickness",{initShadowStyle:function(){this.shadowObj.css({transform:"rotateY(20deg)","-webkit-transform":"rotateY(20deg)","-moz-transform":"rotateY(20deg)","-ms-transform":"rotateY(20deg)","-webkit-box-shadow":"3px 0px 6px rgba(125, 125, 125, 0.7)","-moz-box-shadow":"3px 0px 6px rgba(125, 125, 125, 0.7)","-ms-box-shadow":"3px 0px 6px rgba(125, 125, 125, 0.7)","box-shadow":"3px 0px 6px rgba(125, 125, 125, 0.7)"})},fillThicknessImage:function(){this.topPart.append("<img src='"+uiBaseURL+
"thickness.png' style='position:absolute;width:100%;top:0px;' />");this.centerPart.append("<img src='"+uiBaseURL+"thickness.png' style='position:absolute;width:100%;top:-50px;' />");this.bottomPart.append("<img src='"+uiBaseURL+"thickness.png' style='position:absolute;width:100%;bottom:0px;' />")},getThicknessWidth:function(b){var c=bookConfig.totalPageCount,d=1;void 0!=b?d=b:BookInfo.getBook()&&(d=BookInfo.getBook().currentPageIndex);b=Math.ceil(this.maxWidth*this.maxWidthZoom);this.thicknessWidth=
this.isRightToLeftBook?Math.ceil(b*d/c):Math.ceil(b*(c-d)/c);this.thicknessWidth=Math.max(this.thicknessWidth,2)},resetPosition:function(b){this.getThicknessWidth(b);this.thicknessObj.css({width:this.thicknessWidth+"px",position:"absolute","z-index":2});b=transformCSS({tran:{x:this.contentWidth,y:0}});this.thicknessObj.css(b);this.shadowContent.css({width:this.thicknessWidth+"px",position:"absolute","z-index":1});this.shadowContent.css(b)},pageIndexByPosition:function(b){var c=this.thicknessWidth;
if(0<b&&b<=c){var d=bookConfig.totalPageCount,f=BookInfo.getBook().currentPageIndex;!0==rightToLeft?(b=Math.floor((f-1)*(1-b/c)),b++):(b=Math.floor((d-f-1)*b/c),b+=f+1);return b}return-1}}).extend(Thickness);
var flipShotBar=Class({create:function(b){this.flipShotObj=$("<div id='flipShotObj' style='top:0;bottom:0;margin:auto;'></div>");b?(this.prevDiv=$("<div class='flipShot'></div>"),this.firstDiv=$("<div class='flipShot'></div>"),this.prevDiv.append("<div class='flipShotBackground'></div>"),this.firstDiv.append("<div class='flipShotBackground'></div>"),this.prevDiv.append("<img src='"+uiBaseURL+"slide_leftButton.png' />"),this.firstDiv.append("<img src='"+uiBaseURL+"slide_firstButton.png' />")):(this.prevDiv=
$("<div class='flipShot'></div>"),this.firstDiv=$("<div class='flipShot'></div>"),this.prevDiv.append("<div class='flipShotBackground'></div>"),this.firstDiv.append("<div class='flipShotBackground'></div>"),this.prevDiv.append("<img src='"+uiBaseURL+"slide_rightButton.png'/>"),this.firstDiv.append("<img src='"+uiBaseURL+"slide_lastButton.png'/>"));this.flipShotObj.append(this.firstDiv);this.flipShotObj.append(this.prevDiv);this.isLeft=b;this.visible=!0;this.init();this.initEvents()},init:function(){this.enterCss=
{background:"#ffffff","-webkit-box-shadow":"0 0 15px rgba(255, 255, 255, 1)","-moz-box-shadow":"0 0 15px rgba(255, 255, 255, 1)","-o-box-shadow":"0 0 15px rgba(255, 255, 255, 1)","-ms-box-shadow":"0 0 15px rgba(255, 255, 255, 1)","box-shadow":"0 0 15px rgba(255, 255, 255, 1)"};this.leaveCss={background:"#727272","-webkit-box-shadow":"0 0 15px rgba(114, 114, 114, 1)","-moz-box-shadow":"0 0 15px rgba(114, 114, 114, 1)","-o-box-shadow":"0 0 15px rgba(114, 114, 114, 1)","-ms-box-shadow":"0 0 15px rgba(114, 114, 114, 1)",
"box-shadow":"0 0 15px rgba(114, 114, 114, 1)"};this.prevDiv.css({width:"100%",height:"80%",position:"relative","border-radius":"0px 0px 0px 5px"});this.firstDiv.css({width:"100%",height:"20%",position:"relative","border-bottom":"1px solid #ffffff"});this.prevDiv.find("div").css(this.leaveCss);this.firstDiv.find("div").css(this.leaveCss);this.isLeft?(this.firstDiv.find("div").css({"border-radius":"5px 0px 0px 0px"}),this.prevDiv.find("div").css({"border-radius":"0px 0px 0px 5px"})):(this.firstDiv.find("div").css({"border-radius":"0px 5px 0px 0px"}),
this.prevDiv.find("div").css({"border-radius":"0px 0px 5px 0px"}))},onResize:function(b,c){var d=Math.min(50,0.7*c/8),f=Math.min(0.7*c,310);this.width=d;this.height=f;this.flipShotObj.css({width:d,height:f})},setThicknessPosition:function(b,c){this.flipShotObj.css({left:b,top:c,position:"absolute","z-index":this.isLeft?8:9})},hideThickness:function(){this.flipShotObj.css("display","none")},showThickness:function(){this.flipShotObj.css("display","block")},setVisible:function(b){this.flipShotObj.css({display:b?
"block":"none"});this.visible=b},getContainer:function(){return this.flipShotObj},initEvents:function(){this.isLeft&&!rightToLeft?(this.prevDiv.bind(_event._down,function(){previousPageFun();return!1}),this.firstDiv.bind(_event._down,function(){firstPageFun();return!1})):(this.prevDiv.bind(_event._down,function(){nextPageFun();return!1}),this.firstDiv.bind(_event._down,function(){lastPageFun();return!1}));this.prevDiv.bind(_event._down+" "+_event._enter,function(){this.prevDiv.find("div").css(this.enterCss)}.bind(this));
this.firstDiv.bind(_event._down+" "+_event._enter,function(){this.firstDiv.find("div").css(this.enterCss)}.bind(this));this.prevDiv.bind(_event._leave,function(){this.prevDiv.find("div").css(this.leaveCss)}.bind(this));this.firstDiv.bind(_event._leave,function(){this.firstDiv.find("div").css(this.leaveCss)}.bind(this));isTouch&&(this.prevDiv.bind(_event._end,function(){this.prevDiv.find("div").css(this.leaveCss)}.bind(this)),this.firstDiv.bind(_event._end,function(){this.firstDiv.find("div").css(this.leaveCss)}.bind(this)))},
setScale:function(b){this.width*=b;this.height*=b;this.flipShotObj.css({width:this.width,height:this.height})}}),VideoGallery=Class({create:function(b,c){this.videoGalleryFlag=!1;this.newVideoData=[];this.setDataFalg=[];this.videoData=this.formatData(c);this.createVideoGallery(b)},formatData:function(b){for(var c=[],d=0;d<b.length;d++){this.setDataFalg[d]=!1;var f=b[d];c.push({type:f.type,id:f.id,src:f.thumbnail,des:this.encodeHTML(f.description),title:this.encodeHTML(f.title)})}return c},createVideoGallery:function(b){var c=
this;this.videoBG=$("<div style='position: absolute; left: 0px;top: 0px;bottom: 0px;right: 0px; z-index: 9999;'></div>").hide().append($("<div class='flipHTML5VideoGallery-BG'></div>")).appendTo(b);this.videoGallery=$("<div class='flipHTML5VideoGallery'></div>").appendTo(this.videoBG);b=$("<div style='position: absolute;left: 0px;top: 0px;width: 100%;height: 34px;background-color: #373737;'></div>").appendTo(this.videoGallery);var d=$("<div class='flipHTML5VideoGallery-close' style='width: 26px;height: 26px;bottom: 4px;right: 4px;'></div>").attr("title",
"Close").append($("<img style='margin-left: 4px;margin-top: 4px;'/>").attr("src",uiBaseURL+"note_close.png")).appendTo(b),f=$("<span class='flipHTML5VideoGallery-closeTitle'></span>").html("close").hide().appendTo(this.videoBG);this.videoTitle=$("<span class='flipHTML5VideoGallery-videoTitle'></span>").appendTo(b);this.videoGallery.on({"mouseover touchstart":function(b){f.hide();b.preventDefault();b.stopPropagation();return!1},"mouseout touchend":function(b){f.hide();b.preventDefault();b.stopPropagation();
return!1},"mousemove touchmove":function(b){f.hide();b.preventDefault();b.stopPropagation();return!1},"click touchend":function(b){b.preventDefault();b.stopPropagation();return!1}});this.videoBG.add(d).on({"mouseover touchstart":function(b){try{var d=b.pageY||b.originalEvent.touches[0].pageY;f.css({left:(b.pageX||b.originalEvent.touches[0].pageX)-17,top:d+28>c.videoBG.height()-15?d-28:d+28}).show()}catch(k){Log.error(k)}},"mouseout touchend":function(b){f.hide()},"mousemove touchmove":function(b){try{var d=
b.pageY||b.originalEvent.touches[0].pageY;f.css({left:(b.pageX||b.originalEvent.touches[0].pageX)-17,top:d+28>c.videoBG.height()-15?d-28:d+28})}catch(k){Log.error(k)}},"click touchend":function(b){c.hide()}});b=$("<div style='position: absolute;width: 100%;left: 0px;top: 34px;height: 388px;background-color: #C7C7C7;'></div>").appendTo(this.videoGallery);d=$("<div class='flipHTML5VideoGallery-videoDiv'></div>").appendTo(b);d.append("<div class='flipHTML5Loading' style='width: 100%;height: 100%;position: absolute;left: 0px;top: 0px;'></div>");
this.videoFrame=$("<iframe type='text/html' name='iName' id='iId' width='504' height='370' src='' allowfullscreen frameborder='0' style='position: absolute;left: 0px;top: 0px;background-color: #222222;z-index: 2;'></iframe>").appendTo(d);this.videoListDiv=$("<div class='flipHTML5VideoGallery-videoListDiv'></div>").appendTo(b);this.createVideoList(this.videoListDiv)},createVideoList:function(b){var c=this.videoData,d=c.length,f=72*d+6*(d-1),f=0<f?f:0;this.videoListDiv.css({height:370<f?370:f});b=$("<div class='flipHTML5VideoGallery-videoListTable' style='position: absolute;width: 100%;height: 100%;left: 0px;top: 0px;overflow: hidden;'></div>").appendTo(b);
f=$("<div class='flipHTML5VideoGallery-videoList' style='position: absolute;left: 0px;top: 0px;'></div>").css({width:313,height:f}).appendTo(b);this.table=b;this.list=f;this.createScrollBar(b,b,f);for(var g=0;g<d;g++)this.createEachList(f,g,c[g]);this.scrollBarShowHide(b,f)},createEachList:function(b,c,d){var f=this;(function(c){var h=$("<div class='flipHTML5VideoGallery-eachVideo' style='position: absolute;cursor: pointer;'></div>").css({width:320,height:72,left:0,top:78*c}).attr("id","flipHTML5VideoGallery-eachVideo"+
c).appendTo(b),k=$("<div class='flipHTML5Loading' style='position: absolute;width: 68px; height: 68px; top: 1px;left: 2px;border: 1px solid #ffffff;background-color: #E2E2E2;'></div>").append($("<img style='position: absolute;width: 100%;height: 100%;left: 0px;top: 0px;'/>").attr("id","flipHTML5VideoGallery-eachImg"+c)).appendTo(h),l=$("<div style='position: absolute;width: 247px;height: 100%;left: 72px;overflow: hidden;'></div>").append($("<span class='flipHTML5VideoGallery-eachVideoDes'></span>").attr("id",
"flipHTML5VideoGallery-eachDes"+c)).appendTo(h),m=f.videoData[c];m.src&&m.des&&m.title?(f.setDataFalg[c]=!0,h.on("click touchend",function(){f.setVideoID(m)}),l.children("span").html(m.des).attr("title",m.des),f.loadImg(m.src,k.children("img"),68,68)):f.getVideoData(d.type,d.id,function(b){f.setDataFalg[c]=!0;h.on("click touchend",function(){f.setVideoID({type:b.type,id:b.id,src:m.src||b.src,des:m.des||b.des,title:m.title||b.title})});l.children("span").html(m.des||b.des).attr("title",m.des||b.des);
f.loadImg(m.src||b.src,k.children("img"),68,68)})})(c)},setEachListData:function(){for(var b=this,c=0;c<this.videoData.length;c++)(function(c){if(!b.setDataFalg[c]){var f=b.videoData[c],g=b.videoData[c];f.src&&f.des&&f.title?(b.setDataFalg[c]=!0,b.list.find("#flipHTML5VideoGallery-eachVideo"+c).on("click touchend",function(){b.setVideoID(f)}),b.list.find("#flipHTML5VideoGallery-eachDes"+c).html(f.des).attr("title",f.des),b.loadImg(f.src,b.list.find("#flipHTML5VideoGallery-eachImg"+c),68,68)):b.getVideoData(g.type,
g.id,function(g){b.setDataFalg[c]=!0;b.list.find("#flipHTML5VideoGallery-eachVideo"+c).on("click touchend",function(){b.setVideoID({type:g.type,id:g.id,src:f.src||g.src,des:f.des||g.des,title:f.title||g.title})});b.list.find("#flipHTML5VideoGallery-eachDes"+c).html(f.des||g.des).attr("title",f.des||g.des);b.loadImg(f.src||g.src,b.list.find("#flipHTML5VideoGallery-eachImg"+c),68,68)})}})(c)},loadImg:function(b,c,d,f){var g=new Image;g.onload=function(){g.onload=g.onerror=null;c.parent().removeClass("flipHTML5Loading");
var b=this.width/this.height,k=f*b,l=d/b;k>f?c.css({width:f,height:l,top:(f-l)/2,left:0}):l>f?c.css({width:k,height:f,left:(f-k)/2,top:0}):k/l==b&&c.css({width:k,height:l,left:0,top:0})};g.onerror=function(){g.onload=g.onerror=null;c.parent().removeClass("flipHTML5Loading");c.css({width:18,height:20,left:(d-18)/2,top:(f-20)/2})};c[0].src=b;g.src=b},setVideoID:function(b){var c;"youtube"===b.type&&(c="http://www.youtube.com/embed/"+b.id+"?autoplay=1&wmode=transparent");"vimeo"===b.type&&(c="http://player.vimeo.com/video/"+
b.id+"?autoplay=1&wmode=transparent&portrait=0");this.videoFrame[0].src=c;this.videoTitle.html(b.title)},getVideoData:function(b,c,d){"youtube"===b?this.getYouTubeData(c,d):"vimeo"===b&&this.getVimeoData(c,d)},getYouTubeData:function(b,c){$.getJSON("http://gdata.youtube.com/feeds/api/videos/"+b+"?v=2&alt=jsonc",function(b){b=b.data;c({type:"youtube",id:b.id,title:b.title,des:b.description,src:b.thumbnail.sqDefault})})},getVimeoData:function(b,c){$.getJSON("http://www.vimeo.com/api/v2/video/"+b+".json?callback=?",
{format:"json"},function(b){b=b[0];c({type:"vimeo",id:b.id,title:b.title,des:b.description,src:b.thumbnail_medium})})},hide:function(){this.videoGalleryFlag=!1;this.videoBG.hide();this.videoFrame[0].src=""},show:function(){var b=this;this.videoGalleryFlag=!0;this.setEachListData();if(0<this.videoData.length){var c=this.videoData[0];c.src&&c.des&&c.title?b.setVideoID(c):b.getVideoData(c.type,c.id,function(d){b.setVideoID({type:d.type,id:d.id,src:c.src||d.src,des:c.des||d.des,title:c.title||d.title})})}this.videoBG.show();
this.scrollBarShowHide(this.table,this.list)},showHide:function(){this.videoGalleryFlag?this.hide():this.show()},createScrollBar:function(b,c,d){b=$("<div>",{"class":"ScrollBar",css:{position:"absolute",width:6,height:"100%",backgroundColor:"#a8a8a8",borderRadius:0,right:0,top:0,borderLeft:"1px solid #ffffff"}}).appendTo(b);var f=$("<div>",{"class":"OuterScroll",css:{position:"absolute",width:6,height:"100%",left:0,top:0,backgroundColor:"transparent",borderRadius:0,overflow:"hidden",cursor:"pointer"}}).appendTo(b);
$("<div>",{"class":"InnerScroll",css:{position:"absolute",width:6,height:"100%",marginLeft:0,marginRight:0,left:0,top:0,backgroundColor:"#5e5e5e",borderRadius:0,cursor:"pointer"}}).appendTo(f);this.scrollBar=b;this.outerScroll=f;this.bindScrollBarEvents(b,f,c,d)},scrollBarShowHide:function(b,c){var d=b.outerHeight()*this.scrollBar.outerHeight()/c.outerHeight();this.outerScroll.css({height:d});b.height()>=c.height()?(this.scrollBar.hide(),c.css({top:0}),$(".flipHTML5VideoGallery-eachVideoDes").css({width:231})):
(this.scrollBar.show(),$(".flipHTML5VideoGallery-eachVideoDes").css({width:224}),Math.abs(parseFloat(c.css("top")))>c.outerHeight()-b.outerHeight()&&(c.css({top:-(c.outerHeight()-b.outerHeight())}),this.outerScroll.css({top:this.scrollBar.outerHeight()-this.outerScroll.outerHeight()})))},bindScrollBarEvents:function(b,c,d,f){var g=this;c.on(_event._down,function(b){var k=b||event,l=k.clientY-g.outerScroll.position().top,m=b.which;b.stopPropagation();1==m&&($(document).add(g.outerScroll).add(g.videoGallery).on("mousemove.scrollBar touchmove.scrollBar",
function(b){b.preventDefault();b.stopPropagation();k=b||event;b=k.clientY-l;0>=b?b=0:b>=g.scrollBar.outerHeight()-g.outerScroll.outerHeight()&&(b=g.scrollBar.outerHeight()-g.outerScroll.outerHeight());c.css({top:b});f.css({top:-b/(g.scrollBar.outerHeight()-g.outerScroll.outerHeight())*(f.outerHeight()-d.outerHeight())})}),$(document).add(g.outerScroll).add(g.videoGallery).on("mouseup.scrollBar touchend.scrollBar",function(b){b=b||event;b.preventDefault();b.stopPropagation();$(document).add(g.outerScroll).add(g.videoGallery).off("mousemove.scrollBar touchmove.scrollBar");
$(document).add(g.outerScroll).add(g.videoGallery).off("mouseup.scrollBar touchend.scrollBar")}))});d.bind($.browser.mozilla?"DOMMouseScroll":"mousewheel",function(g){if(!(d.outerHeight()>=f.outerHeight())){var k=g.originalEvent,k=k.wheelDelta||-k.detail,l=f.position().top,m;f.stop(!1,!1);0<k?m=0>l+d.outerHeight()/11?l+d.outerHeight()/11:0:0>k&&(m=f.outerHeight()-d.outerHeight()>-(l-d.outerHeight()/11)?l-d.outerHeight()/11:-(f.outerHeight()-d.outerHeight()));f.css({top:m});c.css({top:-m/(f.outerHeight()-
d.outerHeight())*(b.outerHeight()-c.outerHeight())});g.stopPropagation();g.preventDefault();return!1}});g.list.on("mousedown.pad touchstart.pad",function(b){var c=parseInt(g.list.css("top")),d=g.table.height(),f=g.list.outerHeight(),n=b.pageY||b.originalEvent.touches[0].pageY;g.table.on("mousemove.pad touchmove.pad",function(b){b=c+((b.pageY||b.originalEvent.touches[0].pageY)-n);b=0<b?0:b<d-f?d-f:b;g.list.css({top:b})});g.table.on("mouseup.pad touchend.pad",function(b){g.table.off("mousemove.pad touchmove.pad");
g.table.off("mouseup.pad touchend.pad")})})},encodeHTML:function(b){return b?b.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\\/g,"&#92;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/\n/g,"<br>"):b}}),PhotoGallery=Class({create:function(b,c){this.$container=b;this.photoArr=this.formatData(c);this.currentIndex=0;this.photoFlag=!1;this.originals=[];this.createPhotoGallery(b)},formatData:function(b){for(var c=[],d=0;d<b.length;d++){var f=b[d];c.push({src:f,thumbSrc:f,
title:this.getFileNameByFilePath(f)})}return c},getFileNameByFilePath:function(b){var c=b.lastIndexOf("/"),d=b.lastIndexOf("\\"),c=Math.max(c,d);if(0>c)return c=b.lastIndexOf("."),b.substring(0,c);b=b.substring(c+1);c=b.lastIndexOf(".");return b.substring(0,c)},createPhotoGallery:function(b){var c=this;this.photoBG=$("<div style='position: absolute; left: 0px;top: 0px;bottom: 0px;right: 0px; z-index: 9999;'></div>").append($("<div class='flipHTML5PhotoGallery-BG'></div>").css({opacity:0.5})).hide().appendTo(b);
this.closeBtn=$("<div style='position: absolute;left: auto;right: 0px;top: 0px;cursor: pointer;'></div>").append($("<img/>").attr("src",uiBaseURL+"photoGallery_close.png")).appendTo(this.photoBG);this.outPhotoGallery=$("<div class='flipHTML5PhotoGallery'></div>").css({left:(this.photoBG.width()-328)/2,top:(this.photoBG.height()-328)/2}).appendTo(this.photoBG);this.photoGallery=$("<div class='flipHTML5Loading' style='position: absolute;left: 0px;top: 0px;right: 0px;bottom: 0px;overflow: hidden;'></div>").appendTo(this.outPhotoGallery);
this.mimCloseBtn=$("<div style='position: absolute;left: auto;right: -20px;top: -20px;cursor: pointer;'></div>").append($("<img/>").attr("src",uiBaseURL+"close.png")).appendTo(this.outPhotoGallery);this.photoImg=$("<img class='flipHTML5PhotoGallery-img' style='position: absolute;'/>").appendTo(this.photoGallery);this.prevBtn=$("<div class='flipHTML5PhotoGallery-prevBtn'></div>").css({left:-32}).append($("<img/>").attr("src",uiBaseURL+"photo_prev.png")).appendTo(this.photoGallery);this.nextBtn=$("<div class='flipHTML5PhotoGallery-nextBtn'></div>").css({right:-32}).append($("<img style='margin-top: 1px;'/>").attr("src",
uiBaseURL+"photo_next.png")).appendTo(this.photoGallery);this.closeTitle=$("<span class='flipHTML5PhotoGallery-closeTitle'></span>").html("close").hide().appendTo(this.photoBG);this.mimCloseBtn.on({"mouseover touchstart":function(b){c.mimCloseBtn.children("img")[0].src=uiBaseURL+"close_down.png";b.preventDefault();b.stopPropagation();return!1},"mouseout touchend":function(b){c.mimCloseBtn.children("img")[0].src=uiBaseURL+"close.png";b.preventDefault();b.stopPropagation();return!1}});this.mimCloseBtn.on("click mousemove touchmove",
function(b){b.preventDefault();b.stopPropagation();return!1});this.prevBtn.on("click",function(b){b.preventDefault();b.stopPropagation();c.prev(1);return!1});this.nextBtn.on("click",function(b){b.preventDefault();b.stopPropagation();c.next(1);return!1});this.outPhotoGallery.on({"mouseover touchstart":function(b){c.closeTitle.hide();b.preventDefault();b.stopPropagation();try{var f=$(this).position().left,g=(b.pageX||b.originalEvent.touches[0].pageX)-f,h=$(this).outerWidth()/2;g<=h?(c.prevBtn.stop(!1,
!1).animate({left:0},{duration:60,easing:"linear"}),c.nextBtn.stop(!1,!1).animate({right:-32},{duration:60,easing:"linear"})):(c.prevBtn.stop(!1,!1).animate({left:-32},{duration:60,easing:"linear"}),c.nextBtn.stop(!1,!1).animate({right:0},{duration:60,easing:"linear"}))}catch(k){Log.error(k)}return!1},"mouseout touchend":function(b){b.preventDefault();b.stopPropagation();c.closeTitle.hide();c.prevBtn.stop(!1,!1).animate({left:-32},{duration:60,easing:"linear"});c.nextBtn.stop(!1,!1).animate({right:-32},
{duration:60,easing:"linear"});return!1},"mousemove touchmove":function(b){b.preventDefault();b.stopPropagation();c.closeTitle.hide();try{var f=$(this).position().left,g=(b.pageX||b.originalEvent.touches[0].pageX)-f,h=$(this).outerWidth()/2;g<=h?(c.prevBtn.stop(!1,!1).animate({left:0},{duration:60,easing:"linear"}),c.nextBtn.stop(!1,!1).animate({right:-32},{duration:60,easing:"linear"})):(c.prevBtn.stop(!1,!1).animate({left:-32},{duration:60,easing:"linear"}),c.nextBtn.stop(!1,!1).animate({right:0},
{duration:60,easing:"linear"}))}catch(k){Log.error(k)}return!1},click:function(b){b.preventDefault();b.stopPropagation();try{var f=c.outPhotoGallery.position().left,g=(b.pageX||b.originalEvent.touches[0].pageX)-f,h=c.outPhotoGallery.outerWidth()/2;g<=h?c.prev(1):c.next(1)}catch(k){Log.error(k)}return!1}});this.photoBG.add(this.mimCloseBtn).on({"mouseover touchstart":function(b){try{c.closeTitle.show();var f=b.pageY||b.originalEvent.touches[0].pageY;c.closeTitle.css({left:(b.pageX||b.originalEvent.touches[0].pageX)-
17,top:f+28>c.photoBG.height()-15?f-28:f+28}).show()}catch(g){Log.error(g)}},"mouseout touchend":function(b){c.closeTitle.hide()},"mousemove touchmove":function(b){try{var f=b.pageY||b.originalEvent.touches[0].pageY;c.closeTitle.css({left:(b.pageX||b.originalEvent.touches[0].pageX)-17,top:f+28>c.photoBG.height()-15?f-28:f+28})}catch(g){Log.error(g)}},"click touchstart":function(){c.hide()}});this.createThumbs(this.photoBG);0<this.photoArr.length&&this.skipTo(0);window.onresize=function(){c.outPhotoGallery.css({left:(c.photoBG.width()-
c.outPhotoGallery.outerWidth())/2,top:(c.photoBG.height()-c.outPhotoGallery.outerHeight())/2});if(0<c.photoArr.length){c.reviseThumb();c.thumbList&&c.moveThumb(c.currentIndex);var b=c.photoBG.width(),f=c.photoBG.height()-64,g=c.originals[c.currentIndex],h=c.resizeImgSize(b,f,g.width,g.height),g=h.width,h=h.height;c.photoImg.css({left:0,top:0,width:g,height:h});c.outPhotoGallery.css({left:(b-g-16)/2,top:(f-h-16)/2,width:g,height:h})}}},loadImg:function(b){var c=this,d=c.photoBG.width(),f=c.photoBG.height()-
64,g=new Image;g.onload=function(){g.onload=g.onerror=null;var b=this.width,k=this.height,l=c.resizeImgSize(d,f,b,k);c.originals[c.currentIndex]={width:b,height:k};c.photoImg.attr({originalWidth:b,originalHeight:k});b=l.width;k=l.height;c.photoImg.css({left:0,top:0,width:b,height:k});c.outPhotoGallery.stop(!1,!1).animate({left:(d-b-16)/2,top:(f-k-16)/2,width:b,height:k},{duration:240,easing:"linear",complete:function(){c.photoGallery.removeClass("flipHTML5Loading");c.photoImg.fadeIn(500)}})};g.onerror=
function(){g.onload=g.onerror=null;c.photoImg.css({left:(c.outPhotoGallery.width()-18)/2,top:(c.outPhotoGallery.height()-20)/2});c.originals[c.currentIndex]={width:18,height:20};c.photoGallery.removeClass("flipHTML5Loading");c.photoImg.show().attr("src",b)};g.src=b;c.photoImg.attr("src",b)},resizeImgSize:function(b,c,d,f){var g=d/f;d+16>=b&&f+16>=c?g>=b/c?(d=b-16,f=d/g):(f=c-16,d=f*g):d+16>=b&&f+16<c?(d=b-16,f=d/g):d+16<b&&f+16>=c&&(f=c-16,d=f*g);return{width:d,height:f}},next:function(b){this.skipTo(this.currentIndex+
(b?b:1))},prev:function(b){this.skipTo(this.currentIndex-(b?b:1))},skipTo:function(b){0>=this.photoArr.length||(this.photoGallery.addClass("flipHTML5Loading"),this.photoImg.hide().attr("src",""),b=this.formatIndex(b),this.loadImg(this.photoArr[b].src),this.currentIndex=b,this.thumbSkipTo(b))},formatIndex:function(b){var c=this.photoArr.length;0>b?b=(b+c)%c:b>=c&&(b%=c);return b},createThumbs:function(b){var c=this,d=this.photoArr,f=d.length,g=0<f?54*f+4*(f-1):0;b=$("<div class='flipHTML5PhotoGallery-thumb'></div>").appendTo(b);
var h=$("<div class='flipHTML5PhotoGallery-thumbView'></div>").appendTo(b),k=$("<div class='flipHTML5PhotoGallery-thumbList'></div>").css({width:g}).appendTo(h),l=$("<span class='flipHTML5PhotoGallery-thumbTitle'></span>").appendTo(b).hide();k.on({"mouseover touchstart":function(b){c.closeTitle.hide()},"mousemove touchmove":function(b){c.closeTitle.hide()},"click touchstart":function(b){b.preventDefault();b.stopPropagation();return!1}});this.thumb=b;this.thumbView=h;this.thumbList=k;this.reviseThumb();
this.mouseThumb();for(var m=0;m<f;m++)(function(b){var f=58*b,g=$("<div style='position: absolute;top: 0px;overflow: hidden;border: 2px solid #cccccc;cursor: pointer;'></div>").attr({id:"flipHTML5PhotoThumb"+b,"class":"flipHTML5Loading flipHTML5PhotoThumb"}).css({width:50,height:54,left:f}).appendTo(k),h=$("<img style='position: absolute;'/>").css({opacity:0}).appendTo(g),r=$("<div style='position: absolute;left: 0px;right: 0px;top: 0px;bottom: 0px;background-color: #000000;'></div>").attr({id:"flipHTML5PhotoThumbBG"+
b,"class":"flipHTML5PhotoThumbBG"}).css({opacity:0.5}).appendTo(g),t=new Image;t.onload=function(){t.onload=t.onerror=null;var b=this.width/this.height,c=54*b,d=50/b;50<c?h.css({width:50,height:d,top:(54-d)/2,left:0}):54<d?h.css({width:c,height:54,left:(50-c)/2,top:0}):c/d==b&&h.css({width:c,height:d,left:0,top:0});h.css({opacity:1});g.removeClass("flipHTML5Loading")};t.onerror=function(){t.onload=t.onerror=null;h.css({left:16,top:17}).css({opacity:1});g.removeClass("flipHTML5Loading")};h[0].src=
d[m].thumbSrc;t.src=d[m].thumbSrc;g.on({"click touchend":function(){c.currentIndex!==b&&c.skipTo(b)},"mouseover touchstart":function(d){try{c.currentIndex!==b&&(g.css({borderColor:"#1ECC21"}),r.css({opacity:0}))}catch(f){Log.error(f)}},"mousemove touchmove":function(b){},"mouseout touchend":function(){l.hide();c.currentIndex!==b&&(g.css({borderColor:"#ffffff"}),r.css({opacity:0.5}))}})})(m)},thumbSkipTo:function(b){this.thumbList&&(this.thumbList.find(".flipHTML5PhotoThumbBG").css({opacity:0.5}),
this.thumbList.find(".flipHTML5PhotoThumb").css({borderColor:"#ffffff"}),this.thumbList.find("#flipHTML5PhotoThumbBG"+b).css({opacity:0}),this.thumbList.find("#flipHTML5PhotoThumb"+b).css({borderColor:"#f00"}),this.moveThumb(b))},reviseThumb:function(){var b=this.thumb.width(),c=b/2,d=this.thumbList.width();this.thumbView.css({width:c,left:b/4});c>=d?this.thumbList.css({left:(c-d)/2}):this.thumbList.css({left:0})},mouseThumb:function(){var b=this,c=!1;this.thumbView.on({"mouseenter touchstart":function(d){try{var f=
b.thumbView.width(),g=b.thumbList.width(),h=g-f,k=b.thumbView.offset().left,l=(d.pageX||d.originalEvent.touches[0].pageX)-k-24;g>f&&(d=(0>=l?0:l>f-24?f-48:l)/(f-48)*h,b.thumbList.animate({left:-(0>d?0:d>h?h:d)},{duration:400,easing:"linear",complete:function(){c=!0}}))}catch(m){Log.error(m)}},"mousemove touchmove":function(d){if(c)try{var f=b.thumbView.width(),g=b.thumbList.width(),h=g-f,k=b.thumbView.offset().left,l=(d.pageX||d.originalEvent.touches[0].pageX)-k-24;g>f&&(d=(0>=l?0:l>f-24?f-48:l)/
(f-48)*h,d=0>d?0:d>h?h:d,b.thumbList.stop(!0,!0).animate({left:-d},{duration:400,easing:"linear"}))}catch(m){Log.error(m)}},"mouseleave touchend":function(b){c=!1}})},moveThumb:function(b){var c=this.thumbView.width(),d=this.thumbList.outerWidth(),f=d-c,g=this.thumbList.position().left;b=this.thumbList.find("#flipHTML5PhotoThumb"+b).position().left;var h=b+g,k=(c-54)/2;d>c?(h=Math.abs(b)-Math.abs(g),c=h-k+Math.abs(g),c=c>=f?f:0>=c?0:c,this.thumbList.stop(!0,!0).animate({left:-c},{duration:240,easing:"linear"})):
this.thumbList.css({left:(c-d)/2})},show:function(){this.photoFlag=!0;this.photoBG.show();this.reviseThumb();this.skipTo(0)},hide:function(){this.photoFlag=!1;this.photoBG.hide();this.photoGallery.addClass("flipHTML5Loading");this.outPhotoGallery.css({left:(this.photoBG.width()-328)/2,top:(this.photoBG.height()-328)/2,width:320,height:320})},showHide:function(){this.photoFlag?this.hide():this.show()}}),AddImageFile=Class({create:function(b){this.container=b;this.addContexts={};this.address=uiBaseURL;
this.currentObject=$("<div><div/>").attr("data-key","114");this.imageDatas={};this.fileName=window.location.href.replace(window.location.hash,"")+"LocalFile";this.fileCookies=[];this.createZoomFrame();this.toolBar=this.createToolBar(b);this.getCookieFile()},createToolBar:function(b){var c=this,d=$("<div class='flipHTML5LocalFile-toolBar' style='position: absolute;width: 60px;height: 32px;background-color: rgba(0, 0, 0, 0.8);border-radius: 4px;z-index: 9999;'></div>").appendTo(b).hide();b=$("<div class='flipHTML5LocalFile-toolBar-del'></div>").css({left:4}).append($("<img style='margin-left: 3px;margin-top: 3px;'/>").attr("src",
this.address+"signature_del.png")).appendTo(d);var f=$("<div class='flipHTML5LocalFile-toolBar-update'></div>").css({left:32}).append($("<img style='margin-left: 3px;margin-top: 3px;'/>").attr("src",this.address+"ImgFile_update.png")).appendTo(d);b.on("click touchend",function(b){c.currentObject&&(c.currentObject.remove(),d.hide(),c.zoomFrame&&c.zoomFrame.hide(),b=c.currentObject.attr("data-key"),delete c.imageDatas[b],c.delArrayOrderKey(c.fileCookies,b),c.addLocalStorage(c.fileName,c.parseJSON(c.fileCookies)))});
f.on(_event._down,function(){c.currentObject&&c.currentObject.find(".TextFile")&&c.currentObject.find(".TextFile")[0].click()});d.on("mousedown touchstart",function(b){b.preventDefault();b.stopPropagation();return!1});this.container.add($(document)).add(BookInfo.container()).on("mousedown.hideToolBar touchstart.hideToolBar",function(){d.hide()});return d},createZoomFrame:function(){var b=$("<div class='flipHTML5ZoomFrame' style='position: absolute;'></div>"),c=[];this.zoomFrame=b;for(var d=0;9>d;d++){var f=
$("<div></div>").addClass("flipHTML5Point flipHTML5ZoomPoint"+d).appendTo(b);c.push(f)}this.westZoom(c[7]);this.northZoom(c[1]);this.southZoom(c[5]);this.eastZoom(c[3]);this.westZoom(c[0]).northZoom(c[0]);this.northZoom(c[2]).eastZoom(c[2]);this.westZoom(c[6]).southZoom(c[6]);this.southZoom(c[4]).eastZoom(c[4]);this.container.add($(document)).add(BookInfo.container()).on("mousedown.hideToolBar touchstart.hideToolBar",function(){b.hide()})},getCookieFile:function(){try{var b=this.getLocalStorage(this.fileName),
c=eval(b)}catch(d){}if(c)for(b=0;b<c.length;b++){var f=c[b];this.fileCookies.push({key:f.key,page:f.page,fileLeft:f.fL,fileTop:f.fT,fileWidth:f.fW,fileHeight:f.fH,imgWidth:f.iW,imgHeight:f.iH,src:f.src});this.imageDatas[f.key]={width:f.iW,height:f.iH}}},addFile:function(b,c){var d=b.src,f=b.imgWidth,g=b.imgHeight,h=b.key,k=$("<div class='flipHTML5AddFile' style='position: absolute;cursor: move;'></div>").css({width:b.fileWidth,height:b.fileHeight,left:b.fileLeft,top:b.fileTop}).attr("data-key",h).append($("<input type='file' class='TextFile' style='position: absolute;left: 0px;top: 0px;width: 100%;height: 100%;cursor: move;z-index: 2;'/>").css({opacity:0})).appendTo(c);
this.bindFileDivEvents(k,c);f&&g&&d&&this.addImage(k,d,f,g,h)},addCreateEvents:function(){var b=0,c,d=this.contextArray;if(d)for(this.offCreateEvents();c=d.eq(b++),0<c.length;)this.bindCreateFileEvent(c,parseInt(c.attr("data-page")))},offCreateEvents:function(){this.contextArray&&(this.contextArray.css({cursor:""}),this.contextArray.off("mousedown.addLocalFile touchstart.addLocalFile"))},bindCreateFileEvent:function(b,c){var d=this;b.css("cursor","crosshair");b.off("mousedown.addLocalFile touchstart.addLocalFile").one("mousedown.addLocalFile touchstart.addLocalFile",
function(f){f.stopPropagation();f.preventDefault();var g=(new Date).getTime(),h,k,l,m,n,q,p,s,r,t=b.offset().left,v=b.offset().top;$(".flipHTML5LocalFile-current").removeClass("flipHTML5LocalFile-current");h=$("<div style='position: absolute;cursor: move;'></div>").attr("data-key",g).addClass("flipHTML5AddFile flipHTML5LocalFile-current").append($("<input type='file' class='TextFile' style='position: absolute;left: 0px;top: 0px;width: 100%;height: 100%;cursor: move;z-index: 2;'/>").css({opacity:0})).appendTo(b);
k=m=f.pageX||f.originalEvent.touches[0].pageX;l=n=f.pageY||f.originalEvent.touches[0].pageY;d.bindFileDivEvents(h,b);$(document).add(b).off("mousemove.addLocalFile touchmove.addLocalFile").on("mousemove.addLocalFile touchmove.addLocalFile",function(b){m=b.pageX?b.pageX:b.originalEvent.touches?b.originalEvent.touches[0].pageX:0;n=b.pageY?b.pageY:b.originalEvent.touches?b.originalEvent.touches[0].pageY:0;m&&(0>m-k?(q=Math.floor((m-t)/BookInfo.scale()),s=Math.floor((k-m)/BookInfo.scale())):(q=Math.floor((k-
t)/BookInfo.scale()),s=Math.floor((m-k)/BookInfo.scale())));n&&(0>b.pageY-l?(p=Math.floor((n-v)/BookInfo.scale()),r=Math.floor((l-n)/BookInfo.scale())):(p=Math.floor((l-v)/BookInfo.scale()),r=Math.floor((n-l)/BookInfo.scale())));h.css({left:q,top:p,width:s,height:r});d.resizeZoomFrame(h)});$(document).add(b).off("mouseup.addLocalFile touchend.addLocalFile").one("mouseup.addLocalFile touchend.addLocalFile",function(f){d.offCreateEvents();$(document).add(b).off("mousemove.addLocalFile touchmove.addLocalFile");
$(document).add(b).off("mouseup.addLocalFile touchend.addLocalFile");if(h){f=h.width();var k=h.height();32>f&&h.width(32);12>k&&h.height(12);h.find(".TextFile")[0].click();d.resizeZoomFrame(h);f=d.parseObject(h[0]);d.parseObject(d.zoomFrame[0]);d.fileCookies.push({key:g,page:c,fileLeft:f.left,fileTop:f.top,fileWidth:f.width,fileHeight:f.height,imgWidth:null,imgHeight:null,src:null});d.addLocalStorage(d.fileName,d.parseJSON(d.fileCookies))}void 0!=d.onCreated&&d.onCreated[1].call(d.onCreated[0])})})},
addImage:function(b,c,d,f,g){b.find(".LocalImage")&&b.find(".LocalImage").remove();var h=b.width()||40,k=b.height()||40;d=this.resizeImage("autoFit",d,f,h,k);$("<img class='LocalImage' style='position: absolute;z-index: 2;'/>").attr("data-key",g).css({width:d.width,height:d.height,left:d.left,top:d.top}).attr("src",c).appendTo(b)},resizeImage:function(b,c,d,f,g){c/=d;d=0===g?1:f/g;var h=g*c,k=f/c,l;switch(b){case "autoFit":l=h>f?{width:f,height:k,top:(g-k)/2,left:0}:k>g?{width:h,height:g,left:(f-
h)/2,top:0}:h/k==c?{width:h,height:k,left:0,top:0}:{width:1,height:1,left:0,top:0};break;case "scale":l={left:0,top:0,width:f,height:g};break;case "fullFill":c>d?l={left:(f-g*c)/2,top:0,width:g*c,height:g}:c<d?l={left:0,top:(g-f/c)/2,width:f,height:f/c}:c==d&&(l={left:0,top:0,width:f,height:g})}return l},bindFileDivEvents:function(b,c){var d=this,f=!1,g=b.attr("data-key");b.off("mousedown.addLocalFile touchstart.addLocalFile").on("mousedown.addLocalFile touchstart.addLocalFile",function(h){h.preventDefault();
h.stopPropagation();h=h.originalEvent.touches?h.originalEvent.touches[0]:h;var k,l,m,n,q,p;m=b[0].offsetLeft;n=b[0].offsetTop;k=h.pageX;l=h.pageY;d.resizeZoomFrame(b);c.off("mousemove.addLocalFile touchmove.addLocalFile").on("mousemove.addLocalFile touchmove.addLocalFile",function(c){c=c.originalEvent.touches?c.originalEvent.touches[0]:c;if(3<=Math.abs(c.pageX-k)||3<=Math.abs(c.pageY-l))f=!0;q=m-(k-c.pageX)/BookInfo.scale();p=n-(l-c.pageY)/BookInfo.scale();b.css({left:q,top:p});d.moveFileDiv(q,p)});
$(document).add(c).off("mouseup.addLocalFile touchend.addLocalFile").one("mouseup.addLocalFile touchend.addLocalFile",function(){c.off("mousemove.addLocalFile touchmove.addLocalFile");$(document).add(c).off("mouseup.addLocalFile touchend.addLocalFile");setTimeout(function(){f=!1},200);var h=d.parseObject(b[0]);d.parseObject(d.zoomFrame[0]);d.updateArrayOrderKey(d.fileCookies,g,{fileLeft:h.left,fileTop:h.top});d.addLocalStorage(d.fileName,d.parseJSON(d.fileCookies))})});b.find(".TextFile").on({change:function(c){try{var f=
c.target.files[0];if(f)if(f.type.match("image.*")){var l=new FileReader;l.onload=function(c){c=c.target.result;var f=new Image;f.src=c;var h=f.width,f=f.height;d.imageDatas[g]={width:h,height:f,src:c};d.addImage(b,c,h,f,g);d.updateArrayOrderKey(d.fileCookies,g,{imgWidth:h,imgHeight:f,src:c});d.addLocalStorage(d.fileName,d.parseJSON(d.fileCookies))};l.readAsDataURL(f)}else alert("not image!")}catch(m){alert("Does not support HTML5 FileReader!")}},click:function(b){f&&b.preventDefault()}})},moveFileDiv:function(b,
c){var d=this.zoomFrame;d&&(d.css({left:b-4-1,top:c-4-1}),this.toolBar&&this.toolBar.css({left:d.offset().left-this.container.offset().left+3,top:d.offset().top-this.container.offset().top-this.toolBar.outerHeight()-2}))},resizeZoomFrame:function(b){var c=this.zoomFrame;c.css({width:b.width()+8,height:b.height()+8,left:parseInt(b.css("left"))-4-1,top:parseInt(b.css("top"))-4-1}).show();this.toolBar&&this.toolBar.css({left:b.offset().left-8-this.container.offset().left+3,top:b.offset().top-8-this.container.offset().top-
this.toolBar.outerHeight()-2}).show();b.before(c);$(".flipHTML5LocalFile-current").removeClass("flipHTML5LocalFile-current");this.currentObject=b.addClass("flipHTML5LocalFile-current")},resizeFileDiv:function(b,c,d,f){var g=this.currentObject,h=this.zoomFrame,k=g.attr("data-key");this.toolBar&&this.toolBar&&this.toolBar.css({left:h.offset().left-this.container.offset().left+3,top:h.offset().top-this.container.offset().top-this.toolBar.outerHeight()-2});if(g){b&&(h.css({left:b}),g.css({left:b+4+1}));
c&&(h.css({top:c}),g.css({top:c+4+1}));d&&40<=d&&(h.css({width:d}),g.css({width:d-8}));f&&20<=f&&(h.css({height:f}),g.css({height:f-8}));try{var l=g.find(".LocalImage"),m=this.imageDatas[k],n=this.resizeImage("autoFit",m.width,m.height,g.width(),g.height());l.css({width:n.width,height:n.height,left:n.left,top:n.top})}catch(q){}n=this.parseObject(g[0]);this.parseObject(h[0]);this.updateArrayOrderKey(this.fileCookies,k,{fileLeft:n.left,fileTop:n.top,fileWidth:n.width,fileHeight:n.height})}},eastZoom:function(b){var c=
this,d=b.parent();b.on("mousedown.addLocalFile touchstart.addLocalFile",function(b){b.preventDefault();b.stopPropagation();b=b.originalEvent.touches?b.originalEvent.touches[0]:b;var g=d.parent(),h=d.width(),k=b.pageX;$(document).add(g).on("mousemove.addLocalFile touchmove.addLocalFile",function(b){b=b.originalEvent.touches?b.originalEvent.touches[0]:b;var d=b.clientX-k+h,d=Math.floor(h-(k-b.pageX)/BookInfo.scale());c.resizeFileDiv(0,0,d,0)});$(document).add(g).on("mouseup.addLocalFile touchend.addLocalFile",
function(){c.addLocalStorage(c.fileName,c.parseJSON(c.fileCookies));$(document).add(g).off("mousemove.addLocalFile touchmove.addLocalFile");$(document).add(g).off("mouseup.addLocalFile touchend.addLocalFile")})});return this},southZoom:function(b){var c=this,d=b.parent();b.on("mousedown.addLocalFile touchstart.addLocalFile",function(b){b.preventDefault();b.stopPropagation();b=b.originalEvent.touches?b.originalEvent.touches[0]:b;var g=d.parent(),h=d.height(),k=b.pageY;$(document).add(g).on("mousemove.addLocalFile touchmove.addLocalFile",
function(b){b=b.originalEvent.touches?b.originalEvent.touches[0]:b;var d=b.clientY-k+h,d=Math.floor(h-(k-b.pageY)/BookInfo.scale());c.resizeFileDiv(0,0,0,d)});$(document).add(g).on("mouseup.addLocalFile touchend.addLocalFile",function(){c.addLocalStorage(c.fileName,c.parseJSON(c.fileCookies));$(document).add(g).off("mousemove.addLocalFile touchmove.addLocalFile");$(document).add(g).off("mouseup.addLocalFile touchend.addLocalFile")})});return this},westZoom:function(b){var c=this,d=b.parent();b.on("mousedown.addLocalFile touchstart.addLocalFile",
function(b){b.preventDefault();b.stopPropagation();b=b.originalEvent.touches?b.originalEvent.touches[0]:b;var g=d.parent(),h=d.width(),k=d[0].offsetLeft,l=b.clientX;$(document).add(g).on("mousemove.addLocalFile touchmove.addLocalFile",function(b){b=b.originalEvent.touches?b.originalEvent.touches[0]:b;var d=b.pageX,f=k+d-l,g=-(d-l)+h,f=k+(d-l)/BookInfo.scale(),g=Math.floor(h+(l-b.pageX)/BookInfo.scale());c.resizeFileDiv(f,0,g,0)});$(document).add(g).on("mouseup.addLocalFile touchend.addLocalFile",
function(){c.addLocalStorage(c.fileName,c.parseJSON(c.fileCookies));$(document).add(g).off("mousemove.addLocalFile touchmove.addLocalFile");$(document).add(g).off("mouseup.addLocalFile touchend.addLocalFile")})});return this},northZoom:function(b){var c=this,d=b.parent();b.on("mousedown.addLocalFile touchstart.addLocalFile",function(b){b.preventDefault();b.stopPropagation();b=b.originalEvent.touches?b.originalEvent.touches[0]:b;var g=d.parent(),h=d.height(),k=d[0].offsetTop,l=b.pageY;$(document).add(g).on("mousemove.addLocalFile touchmove.addLocalFile",
function(b){b=b.originalEvent.touches?b.originalEvent.touches[0]:b;b=b.pageY;var d=k+b-l,f=-(b-l)+h,d=k+(b-l)/BookInfo.scale(),f=Math.floor(h+(l-b)/BookInfo.scale());c.resizeFileDiv(0,d,0,f)});$(document).add(g).on("mouseup.addLocalFile touchend.addLocalFile",function(){c.addLocalStorage(c.fileName,c.parseJSON(c.fileCookies));$(document).add(g).off("mousemove.addLocalFile touchmove.addLocalFile");$(document).add(g).off("mouseup.addLocalFile touchend.addLocalFile")})});return this},bindOnCreated:function(b,
c){this.onCreated=[b,c]},parseObject:function(b){if(document.getElementsByTagName("body")[0].contains(b)){var c,d,f;f=b.parentNode;var g=b.style,h=$(b);d=100/f.offsetHeight;c=100/f.offsetWidth;f=b.offsetLeft*c+"%";b=b.offsetTop*d+"%";c=h.width()*c+"%";d=h.height()*d+"%";g.width=c;g.height=d;g.left=f;g.top=b;return{width:c,height:d,left:f,top:b}}},addLocalFileByPage:function(b,c){c.find(".flipHTML5AddFile").remove();this.toolBar&&this.toolBar.hide();this.zoomFrame&&this.zoomFrame.hide();c.attr("data-page",
b);this.contextArray=this.contextArray?this.contextArray.add(c):c;this.zoomFrame&&this.zoomFrame.remove();this.createZoomFrame();for(var d=0;d<this.fileCookies.length;d++)this.fileCookies[d].page==b&&this.addFile(this.fileCookies[d],c)},setContainers:function(b,c,d){void 0==this.addContexts[b]&&(this.addContexts[b]={});this.addContexts[b][c]=d;b==BookInfo.getBookType()&&this.addLocalFileByPage(c,this.addContexts[BookInfo.getBookType()][c])},getLocalStorage:function(b){try{if(window.localStorage)return window.localStorage.getItem(b);
for(var c=document.cookie.split("; "),d=0;d<c.length;d++){var f=c[d].split("=");if(f[0]==b)return unescape(f[1])}return""}catch(g){}},addLocalStorage:function(b,c){try{if(window.localStorage)window.localStorage.setItem(b,c);else{var d=b+"="+escape(c),f=new Date;f.setTime(f.getTime()+864E8);d+="; expires="+f.toGMTString();document.cookie=d}}catch(g){}},delArrayOrderKey:function(b,c){if(b)for(var d=0;d<b.length;d++)b[d].key&&b[d].key==c&&b.remove(d)},updateArrayOrderKey:function(b,c,d){if(b)for(var f=
0;f<b.length;f++)b[f].key&&b[f].key==c&&$.extend(b[f],d)},parseJSON:function(b){if(0!=b.length){for(var c="[",d=0;d<b.length;d++)c+="{key:'"+b[d].key+"',page:"+b[d].page+",src:'"+b[d].src+"',iW:"+b[d].imgWidth+",iH:"+b[d].imgHeight+",fW:'"+b[d].fileWidth+"',fH:'"+b[d].fileHeight+"',fL:'"+b[d].fileLeft+"',fT:'"+b[d].fileTop+"'},";c=c.substring(0,c.length-1);return c+"]"}}});
Class("VolumeControlBar",{create:function(b){bgSound&&bgSound.sound&&!isPhone()&&(this.volumeBackground=$("<div class='volume-bar'></div>"),this.volumeIcon=$("<div class='volume-icon volume-icon-open'></div>"),this.volumeBar=$('<div class="volume-pgress"><span></span></div><p></p>'),this.volumeClose=$("<div class='volume-close volume-close-leave'></div>"),b.append(this.volumeBackground),this.volumeBackground.append(this.volumeIcon),this.volumeBackground.append(this.volumeBar),this.volumeBackground.append(this.volumeClose),
this.initCloseEvent(),this.initBarEvent())},initCloseEvent:function(){this.volumeClose.bind(_event._enter,function(){this.volumeClose.removeClass("volume-close-leave");this.volumeClose.addClass("volume-close-enter")}.bind(this));this.volumeClose.bind(_event._end,function(){this.volumeBackground.hide()}.bind(this));this.volumeClose.bind(_event._leave,function(){this.volumeClose.removeClass("volume-close-enter");this.volumeClose.addClass("volume-close-leave")}.bind(this))},initBarEvent:function(){this.xpos=
0;this.startpops;this.istouch;$("body").bind(_event._move,function(b){this.scrollbarMove(b)}.bind(this));$(".volume-pgress span").bind(_event._down,function(){this.xpos=$(".volume-pgress span").position().left;this.istouch=!0}.bind(this));$("body").bind(_event._end,function(){this.istouch=!1}.bind(this))},scrollbarMove:function(b){this.istouch&&(this.startpops&&(this.xpos+=b.pageX-this.startpops,0<=this.xpos&&this.xpos<$(".volume-pgress").width()-4&&($(".volume-pgress span").css("left",this.xpos+
"px"),this.setVolume(this.xpos/($(".volume-pgress").width()-4)))),this.startpops=b.pageX);b.stopPropagation();b.preventDefault()},setVolume:function(b){if(bgSound&&bgSound.sound&&!isPhone()){bgSound.sound[0].volume=b;var c={background:"url("+uiBaseURL+"volume-bar.png) -30px -2px no-repeat"};this.volumeIcon.css({background:"url("+uiBaseURL+"volume-bar.png) -2px -2px no-repeat"});0>=b&&this.volumeIcon.css(c)}}});Class("Item",{Package:"PageItem",create:function(b,c,d,f){this.parent=b;this.config=c;this.pageWidth=d;this.pageHeight=f;this.type=this.config.annotype},destroy:function(){},onActionEvent:function(b,c){if(c&&b){var d="";switch(c){case PageEditor.TriggerEventType.MouseDown:d=_event._down;break;case PageEditor.TriggerEventType.MouseOver:d=_event._over;break;case PageEditor.TriggerEventType.MouseOut:d=_event._out;break;case PageEditor.TriggerEventType.MouseUp:d=_event._end;break;case PageEditor.TriggerEventType.MouseMove:d=
_event._move;break;case PageEditor.TriggerEventType.MouseLeave:d=_event._leave}""!=d&&b.bind(d,function(c){this.onAction(b);return!1}.bind(this))}},onAction:function(b){this.config.action.actionType==PageEditor.ActionType.GOTO_PAGE?(gotoPageFun(this.config.action.pageIndex),$(b).addClass("slider-action")):this.config.action.actionType==PageEditor.ActionType.OPEN_URL?(void 0==this.config.action.linkTarget&&(this.config.action.linkTarget="_blank"),window.open(this.linkURL,this.config.action.linkTarget),
$(b).addClass("slider-action")):this.config.action.actionType==PageEditor.ActionType.OPEN_WINDOW?(this.config.action.windowType==PageEditor.WindowType.OPEN_VIDEO&&(this.video=new initVideoForm(tmpContainer,{width:this.config.action.windowWidth,height:this.config.action.windowHeight,src:this.config.action.resourceContent,caption:this.config.action.caption},bookContainer.width(),bookContainer.height(),"video")),this.config.action.windowType==PageEditor.WindowType.OPEN_FLASH&&(this.video=new initVideoForm(tmpContainer,
{width:this.config.action.windowWidth,height:this.config.action.windowHeight,src:this.config.action.resourceContent,caption:this.config.action.caption},bookContainer.width(),bookContainer.height(),"flash")),this.config.action.windowType==PageEditor.WindowType.OPEN_SHOW_TEXT&&(this.video=new initVideoForm(tmpContainer,{width:this.config.action.windowWidth,height:this.config.action.windowHeight,src:this.config.action.resourceContent,caption:this.config.action.caption},bookContainer.width(),bookContainer.height(),
"text")),$(b).addClass("slider-action")):this.config.action.actionType==PageEditor.ActionType.SLIDE_SHOW?(this.slide=new initSlideShow(tmpContainer,this.config.action.photos,bookContainer.width(),bookContainer.height()),$(b).addClass("slider-action")):this.config.action.actionType==PageEditor.ActionType.PLAY_AUDIO?(this.audios=new initAudioEditor(tmpContainer,this.config.action.audioURL,this.config.action.autoPlay),this.audios.showshow(),$(b).addClass("slider-action")):this.config.action.actionType==
PageEditor.ActionType.ACTION_JS?(null!=this.config.action.scriptFun&&eval(this.config.action.scriptFun),$(b).addClass("slider-action")):this.config.action.actionType==PageEditor.ActionType.OPEN_IMG?(this.zoomImg=new HTML5ZoomImg(this.config.src,$("#tmpContainer")),$(b).addClass("slider-action")):this.config.action.actionType==PageEditor.ActionType.PLAY_VIDEO?(this.config.action.windowType==PageEditor.WindowType.OPEN_YOUTUBE&&(this.video=new PopUpVideo(this.config.action,"youtube")),this.config.action.windowType==
PageEditor.WindowType.OPEN_VIMEO&&(this.video=new PopUpVideo(this.config.action,"vimeo")),this.config.action.windowType==PageEditor.WindowType.OPEN_DAILYMOTION&&(this.video=new PopUpVideo(this.config.action,"dailymotion")),this.config.action.windowType==PageEditor.WindowType.OPEN_TYPE_WISTIA&&(this.video=new PopUpVideo(this.config.action,"wistia")),this.config.action.windowType==PageEditor.WindowType.OPEN_TYPE_YOUKU&&(this.video=new PopUpVideo(this.config.action,"youku")),this.config.action.windowType==
PageEditor.WindowType.OPEN_TYPE_QQ&&(this.video=new PopUpVideo(this.config.action,"qq")),this.video&&this.video.show(),$(b).addClass("slider-action")):this.config.action.actionType==PageEditor.ActionType.SHOW_INFORMATION?(this.showInformation=$.browser.device==$.browser.DEVICE_PHONE?new ShowInformationMobile(tmpContainer,this.config):new ShowInformation(tmpContainer,this.config),this.showInformation.show.delay(this.showInformation,50),$(b).addClass("slider-action")):this.config.action.actionType==
PageEditor.ActionType.QUIZ&&(this.quiz=new Quiz(tmpContainer,this.config),$(b).addClass("slider-action"))}});
var initYoutube=Class({create:function(b,c,d,f,g){this.father=b;this.config=$.extend({width:400,height:300,x:0.02,y:0.02,alpha:1,id:null},c);this.youtubeFrame=null;null!=this.config.id&&(this.pw=d,this.ph=f,this.width=parseInt(this.config.width*this.pw),this.height=parseInt(this.config.height*this.ph),this.x=this.config.x*this.pw,this.y=this.config.y*this.ph,c="https"==window.location.href.substring(0,5)?"https":"http",this.youtubeFrame=$("<iframe class='youtube-player' type='text/html' width='"+
this.width+"' height='"+this.height+"' src='"+c+"://www.youtube.com/embed/"+this.config.id+"?"+this.config.playerParameters+"' frameborder='0' allowfullscreen='1' style='position: absolute; opacity: "+this.config.alpha+"; left:"+this.x+"px; top:"+this.y+"px;'></iframe>"),b.append(this.youtubeFrame))},onResize:function(b,c){this.pw=b;this.ph=c;this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.youtubeFrame.css({width:this.width+"px",height:this.height+"px"});this.setPosition()},
setPosition:function(){this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.youtubeFrame.css({top:this.y+"px",left:this.x+"px"})},getPlayEvt:function(){return this.config.moviePlayTriggerEvt},getStopEvt:function(){return this.config.movieStopTriggerEvt},hide:function(){this.youtubeFrame.css({width:"0px",height:"0px"});this.youtubeFrame.css({display:"none"})},show:function(){this.youtubeFrame.css({width:this.width+"px",height:this.height+"px"});this.youtubeFrame.css({display:"block"})}}),
initVideo=Class({create:function(b,c,d,f,g){this.config=$.extend({width:0.6,height:0.5,x:0.2,y:0.2,src:null,previewSrc:null,alpha:1},c);this.pw=d;this.ph=f;this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.father=b;this.content=$("<div></div>");this.content.css({position:"absolute",left:this.x+"px",top:this.y+"px",width:this.width+"px",height:this.height+"px","background-color":"black"});this.father.append(this.content);
"string"==typeof this.config.previewSrc&&""!=this.config.previewSrc&&null!=this.config.previewSrc&&void 0!=this.config.previewSrc&&(!0==isFlipPdf&&(this.config.previewSrc="."+this.config.previewSrc),this.content.css({background:"url("+this.config.previewSrc+")"}),this.content.css({"background-size":this.width+"px "+this.height+"px"}));b=typeof this.config.src;c=this.config.src.substr(this.config.src.length-4,4).toLowerCase();if("string"==b){if(null==this.config.src||".mp4"!=c&&".flv"!=c&&".f4v"!=
c)return}else if(this.config.src=={})return;!0==isFlipPdf&&(this.config.src="../"+this.config.src);this.video=null;this.video=$("<video controls preload='metadata' src='"+this.config.src+"'></video>");this.video.css({position:"absolute","z-index":1,left:"0px",top:"0px",width:"100%",height:"100%",opacity:this.config.alpha});this.content.append(this.video);void 0==this.video[0].play||isPhone()||(this.content.addVideoSkin(g),this.video.removeAttr("controls"))},onResize:function(b,c){this.pw=b;this.ph=
c;this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.content.css({width:this.width+"px",height:this.height+"px"});this.content.css({"background-size":this.width+"px "+this.height+"px"});this.content.resizeVideoSkin();this.setPosition()},setPosition:function(){this.x=this.pw*this.config.x;this.y=this.ph*this.config.y;this.content.css({left:this.x+"px",top:this.y+"px"})},playVideo:function(){if(null!=this.video)try{this.video[0].play()}catch(b){}},stopVideo:function(){if(null!=
this.video)try{this.video[0].stop()}catch(b){}},pauseVideo:function(){if(null!=this.video)try{this.video[0].pause()}catch(b){}},getPlayEvt:function(){return this.config.moviePlayTriggerEvt},getStopEvt:function(){return this.config.movieStopTriggerEvt}}),initVimeo=Class({create:function(b,c,d,f,g){this.config=$.extend({width:400,height:300,x:0.02,y:0.02,alpha:1,id:null},c);this.vimeoFrame=null;null!=this.config.id&&(this.pw=d,this.ph=f,this.width=this.config.width*this.pw,this.height=this.config.height*
this.ph,this.x=this.config.x*this.pw,this.y=this.config.y*this.ph,this.config.id+="",c=this.config.id.lastIndexOf("/"),c=this.config.id.substring(c+1),this.vimeoFrame=$("<iframe width='"+this.width+"' height='"+this.height+"' src='http://player.vimeo.com/video/"+c+"' frameborder='0' style='position: absolute; opacity: "+this.config.alpha+"; left:"+this.x+"px; top:"+this.y+"px;' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>"),b.append(this.vimeoFrame))},onResize:function(b,c){this.pw=
b;this.ph=c;this.vimeoFrame.css({width:this.pw*this.config.width+"px",height:this.ph*this.config.height+"px"});this.setPosition(this.config.x*this.pw,this.config.y*this.ph)},setPosition:function(b,c){this.vimeoFrame.css({top:c+"px",left:b+"px"})},getPlayEvt:function(){return this.config.moviePlayTriggerEvt},getStopEvt:function(){return this.config.movieStopTriggerEvt},hide:function(){this.vimeoFrame.css({display:"none"})},show:function(){this.vimeoFrame.css({display:"block"})}}),initPopUpVimeo=Class({create:function(b,
c,d,f,g){this.config=$.extend({width:400,height:300,x:0.02,y:0.02,alpha:1,id:null},c);this.vimeoFrame=null;null!=this.config.id&&(this.pw=d,this.ph=f,this.width=this.config.width*this.pw,this.height=this.config.height*this.ph,this.x=this.config.x*this.pw,this.y=this.config.y*this.ph,isFlipPdf&&(this.config.url="."+this.config.url),this.url=this.config.url,this.vimeoImage=$("<img src='"+this.url+"' style='position: absolute;cursor:pointer;opacity:"+this.config.alpha+"; left:"+this.x+"px; top:"+this.y+
"px; width:"+this.width+"px;height:"+this.height+"px;'/>"),b.append(this.vimeoImage),this.popupVideo=new PopUpVideo(this.config,g),this.vimeoImage.bind(_event._down,function(){return!1}.bind(this)),this.vimeoImage.bind(_event._end,function(){this.popupVideo.showOrHide();return!1}.bind(this)),this.popupVideo.background.bind(_event._end,function(){this.hide();this.background.remove();return!1}.bind(this)))},onResize:function(b,c){this.pw=b;this.ph=c;this.vimeoImage.css({width:this.pw*this.config.width+
"px",height:this.ph*this.config.height+"px"});this.setPosition(this.config.x*this.pw,this.config.y*this.ph);this.popupVideo.onResize()},setPosition:function(b,c){this.vimeoImage.css({top:c+"px",left:b+"px"})}}),PopUpVideo=Class({create:function(b,c){this.config=$.extend({id:null,alpha:1},b);this.config.id+="";this.vimeoWidth=Math.min(480,windowWidth);this.vimeoHeight=9*this.vimeoWidth/16;this.vimeoHeight=Math.min(this.vimeoHeight,windowHeight);this.vimeoLeft=(windowWidth-this.vimeoWidth)/2;this.vimeoTop=
(windowHeight-this.vimeoHeight)/2;this.initVideo(c);this.background=$("<div id='popup' style='width:100%;height:100%;z-index:1000;position:absolute;'></div>");this.vimeoBac=$("<div style='width:100%;height:100%;background:#000000;opacity:0.5;'></div>");tmpContainer.append(this.background);this.background.append(this.vimeoBac);this.background.append(this.vimeoFrame);this.visible=!1;this.hide();this.closeButton=$("<img style='position:absolute;cursor:pointer;right:30px;top:30px;' src='"+uiBaseURL+"close.png'/>");
this.closeButton.asImageButton();this.background.append(this.closeButton);this.background.bind(_event._end,function(){this.hide();this.getStopEvt();return!1}.bind(this));this.closeButton.bind(_event._end,function(){this.hide();this.getStopEvt();event.stopPropagation()}.bind(this))},initVideo:function(b){if("vimeo"==b){var c=this.config.id.lastIndexOf("/"),c=this.config.id.substring(c+1);this.vimeoFrame=$("<iframe width='"+this.vimeoWidth+"' height='"+this.vimeoHeight+"' src='http://player.vimeo.com/video/"+
c+"' frameborder='0' style='position: absolute;background:#000000; opacity: "+this.config.alpha+"; left:"+this.vimeoLeft+"px; top:"+this.vimeoTop+"px;' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>")}"youtube"==b&&(this.vimeoFrame=$("<iframe class='youtube-player' type='text/html' width='"+this.vimeoWidth+"' height='"+this.vimeoHeight+"' src='http://www.youtube.com/embed/"+this.config.id+"' frameborder='0' allowfullscreen='1' style='position: absolute; opacity: "+this.config.alpha+
"; left:"+this.vimeoLeft+"px; top:"+this.vimeoTop+"px;'></iframe>"));"dailymotion"==b&&(this.vimeoFrame=$("<iframe id=woiframe width='"+this.vimeoWidth+"' height='"+this.vimeoHeight+"' src='http://www.dailymotion.com/embed/video/"+this.config.id+"' frameborder='0' allowFullScreen style='position: absolute; opacity: "+this.config.alpha+"; left:"+this.vimeoLeft+"px; top:"+this.vimeoTop+"px;'></iframe>"));"wistia"==b&&(this.vimeoFrame=$("<iframe width='"+this.vimeoWidth+"' height='"+this.vimeoHeight+
"' src='http://fast.wistia.net/embed/iframe/"+this.config.id+"' frameborder='0' style='position:absolute;opactiy: "+this.config.alpha+";left:"+this.vimeoLeft+"px;top:"+this.vimeoTop+"px;'></iframe>"));"youku"==b&&(this.vimeoFrame=$("<iframe width='"+this.vimeoWidth+"' height='"+this.vimeoHeight+"' src='http://player.youku.com/embed/"+this.config.id+"' frameborder='0' style='position:absolute;opactiy: "+this.config.alpha+";left:"+this.vimeoLeft+"px;top:"+this.vimeoTop+"px;'></iframe>"));"qq"==b&&(this.vimeoFrame=
$("<iframe width='"+this.vimeoWidth+"' height='"+this.vimeoHeight+"' src='http://v.qq.com/iframe/player.html?vid="+this.config.id+"' frameborder='0' style='position:absolute;opactiy: "+this.config.alpha+";left:"+this.vimeoLeft+"px;top:"+this.vimeoTop+"px;'></iframe>"))},showOrHide:function(){!1===this.visible?this.show():this.hide()},hide:function(){this.visible=!1;this.background.css({display:"none"})},show:function(){this.visible=!0;this.background.css({display:"block"})},onResize:function(b,c){this.vimeoWidth=
Math.min(480,windowWidth);this.vimeoHeight=9*this.vimeoWidth/16;this.vimeoHeight=Math.min(this.vimeoHeight,windowHeight);this.vimeoLeft=(windowWidth-this.vimeoWidth)/2;this.vimeoTop=(windowHeight-this.vimeoHeight)/2;this.vimeoFrame.css({width:this.vimeoWidth+"px",height:this.vimeoHeight+"px",top:this.vimeoTop+"px",left:this.vimeoLeft+"px"})},getPlayEvt:function(){return this.config.moviePlayTriggerEvt},getStopEvt:function(){return this.config.movieStopTriggerEvt}});
global.hddr.soo4=function(b){return b||".com"};
var initAudio=Class({create:function(b,c,d,f,g){this.config=$.extend({width:80,height:30,x:20,y:20,src:null,alpha:1},c);this.audio=null;this.themeName=g;this.resizeThemes={"default":"",wave:""};if(null!=this.config.src){this.type="com.mobiano.flipbook.sound.TAnnoBackgroundSound";this.originWidth=bookConfig.largePageWidth;this.pw=d;this.ph=f;this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.father=b;b=c.key;this.content=
$("<div></div>");this.content.css({position:"absolute",left:this.x+"px",top:this.y+"px",opacity:this.config.alpha});this.father.append(this.content);this.audio=$("<audio controls ></audio>");this.audio.css({position:"absolute",width:this.width+"px",height:this.height+"px",left:"0px",top:"0px",opacity:this.config.alpha});this.type==this.config.className&&(this.content.css("display","none"),this.audio.attr("autoplay","autoplay"));this.content.audioResources=[];if(void 0==b)isFlipPdf&&(this.config.src=
"."+this.config.src),this.audio.attr("src",this.config.src),this.content.audioResources.push(this.config.src);else if(b in this.config.src)h=this.config.src[b],isFlipPdf&&(h="."+h),this.content.audioResources.push(h),this.audio.attr("src",h);else for(c=0;c<this.config.src.length;c++){var h=this.config.src[c][b];isFlipPdf&&(h="."+h);this.content.audioResources.push(h);var k=$("<source src='"+h+"'>");this.audio.append(k);0==c&&this.audio.attr("src",h)}this.content.append(this.audio);void 0!=this.audio[0].play&&
"background0"!=this.themeName&&(this.content.addAudioSkin(g),this.audio.removeAttr("controls"));this.resizeThemes={"default":"",wave:""};this.themeName in this.resizeThemes||void 0==this.themeName?(this.content.css({width:this.width+"px",height:this.height+"px"}),this.content.resizeAudioSkin()):this.resizeAudio(d,f)}},onResize:function(b,c){this.pw=b;this.ph=c;this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.themeName in this.resizeThemes||void 0==this.themeName?(this.content.css({width:this.width+
"px",height:this.height+"px"}),this.content.resizeAudioSkin()):this.resizeAudio(b,c);this.setPosition()},resizeAudio:function(b,c){var d=parseInt(this.content.width),d=b*this.config.width/d;this.content.css({"-webkit-transform-origin":"0% 0%","-moz-transform-origin":"0% 0%","-ms-transform-origin":"0% 0%","-o-transform-origin":"0% 0%","transform-origin":"0% 0%","-webkit-transform":"scale("+d+")","-moz-transform":"scale("+d+")","-ms-transform":"scale("+d+")","-o-transform":"scale("+d+")",transform:"scale("+
d+")"});this.content.refreshAudioSeek()},setPosition:function(){this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.content.css({left:this.x+"px",top:this.y+"px"})},play:function(){if(null!=this.audio)try{this.audio[0].play()}catch(b){}},pause:function(){if(null!=this.audio)try{this.audio[0].pause()}catch(b){}},stop:function(){null!=this.audio&&this.audio[0].stop()},getPlayEvt:function(){return this.config.soundPlayTriggerEvt},getStopEvt:function(){return this.config.soundStopTriggerEvt}}),
initAudioEditor=Class({create:function(b,c,d){this.background=$("<div class='printBar'></div>");this.contentBox=$("<div class='printBG'></div>");this.closeButton=$("<div></div>");this.showing=!1;this.width=windowWidth;this.height=windowHeight;isFlipPdf&&(c="."+c);this.audioSrc=c;this.contentWidth=350;this.contentHeight=63;this.themeName="enjoy";isPhone()&&(this.themeName="background",this.contentHeight=this.contentWidth=100);this.background.css({height:this.height+"px",bottom:"0px"});this.contentBox.css({height:this.contentHeight+
"px",width:this.contentWidth+"px",left:(this.width-this.contentWidth)/2+"px"});this.contentBox.css({top:(this.height-this.contentHeight)/2+"px","border-radius":"0px"});this.audio=$("<audio controls ></audio>");this.audio.css({position:"absolute",width:this.contentWidth+"px",height:this.contentHeight+"px",left:"0px",top:"0px"});this.contentBox.audioResources=[];this.audio.attr("src",this.audioSrc);this.contentBox.audioResources.push(this.audioSrc);this.contentBox.append(this.audio);void 0!=this.audio[0].play&&
"background0"!=this.themeName&&(this.contentBox.addAudioSkin(this.themeName),this.audio.removeAttr("controls"),d&&(this.audio[0].autoPlay=!0));$(b).append(this.background);$(b).append(this.contentBox);$(b).append(this.closeButton);this.closeButton.css({top:"30px",right:"30px",position:"absolute","z-index":"103"});this.closeButton.append($("<img src='"+uiBaseURL+"close.png'/>").asImageButton());this.initEvent();$(this.background).css("display","none");$(this.contentBox).css("display","none");$(this.closeButton).css("display",
"none");void 0!=leftRightButton&&null!=leftRightButton&&leftRightButton.setShow(!1);this.audio[0].play()},onResize:function(b,c){this.background.css({height:windowHeight+"px",bottom:"0px"});this.contentBox.css({height:this.contentHeight+"px",width:this.contentWidth+"px",left:(windowWidth-this.contentWidth)/2+"px"});this.contentBox.css({top:(windowHeight-this.contentHeight)/2+"px"});this.closeButton.css({top:"30px",right:"30px"});void 0!=this.themeName&&(this.contentBox.css({width:this.contentWidth+
"px",height:this.contentHeight+"px"}),this.contentBox.resizeAudioSkin())},setPosition:function(b,c,d){void 0==d&&(d=["left","top"]);$(this.background).css(d[0],b+"px");$(this.background).css(d[1],c+"px")},getShowStatu:function(){return this.showing},setShowStatu:function(b){this.showing=b},showshow:function(){$(this.background).css({display:"block"});$(this.contentBox).fadeIn(500);$(this.closeButton).fadeIn(500);this.showing=!0},hideBox:function(){var b=this;$(this.background).fadeOut(500,function(){b.pause();
b.contentBox.remove();b.closeButton.remove();b.background.remove()});hideLeftRightButton()&&leftRightButton.setShow(!0);this.showing=!1},initEvent:function(){var b=this;this.background.bind(_event._down,function(c){b.hideBox();b.showing=!1});this.closeButton.bind(_event._end,function(c){b.hideBox();b.showing=!1});this.closeButton.bind("mouseover",function(c){b.closeButton.css({cursor:"pointer"})})},play:function(){if(null!=this.audio)try{this.audio[0].play()}catch(b){}},pause:function(){if(null!=
this.audio)try{this.audio[0].pause()}catch(b){}},stop:function(){if(null!=this.audio)try{this.audio[0].stop()}catch(b){}},getPlayEvt:function(){return this.config.soundPlayTriggerEvt},getStopEvt:function(){return this.config.soundStopTriggerEvt}}),initImage=Class({Package:"PageItem",create:function(b,c,d,f){this.config=$.extend({width:0.2,height:0.2,x:0.2,y:0.2,alpha:1,src:null},c);this.container=$("<div style='position: absolute;'></div>");this.img=$("<img style='position: absolute;width: 100%;height: 100%;'/>");
this.imgBorder=$("<div class = 'bubble expose-square-solid' style='position: absolute;width: 100%;height: 100%;'></div>");null!=this.config.src&&(!0==isFlipPdf&&(this.config.src="."+this.config.src),void 0==this.config.action&&(this.config=$.extend({action:{actionType:PageEditor.ActionType.OPEN_IMG}},this.config)),this.pw=d,this.ph=f,this.width=this.config.width*d,this.height=this.config.height*f,parseBool(this.config.imgOriginalProportions)?(this.img=$("<div></div>"),this.img.attr("src",this.config.src).css({width:this.width,
height:this.height}),this.container.append(this.img),this.img.css({"background-image":String.format("url(%s)",Metacharacter(this.config.src)),"background-repeat":"no-repeat",width:this.width+"px",height:this.height+"px","background-size":"contain","text-align":"center","vertical-align":"middle","background-position":"center",position:"absolute"})):(this.img.attr("src",this.config.src).css({width:this.width,height:this.height}),this.container.append(this.img)),this.container.css({width:this.width,
height:this.height,left:this.pw*this.config.x,top:this.ph*this.config.y,opacity:this.config.alpha,zIndex:102}),this.imgBorder.css({"border-color":Color(this.config.borderColor).toString(),width:"100%",height:"100%"}),b.append(this.container),this.container.append(this.imgBorder),this.imgBorder.css({display:"none"}),this.father=b,this.initEvt())},initEvt:function(){this.audios=this.slide=this.form=null;var b=this;b.zoomImg=null;if(!/\.(gif)$/.test(b.config.src))this.container.hammer().on(_event._end,
function(b){});this.config.mouseOver==PageEditor.MouseOverType.AddBorder?(this.img.bind(_event._enter,function(c){b.imgBorder.css({display:"block"});b.img.animate({opacity:"0.8"},300)}),this.img.bind(_event._down,function(c){b.imgBorder.css({display:"block"});b.img.animate({opacity:"0.8"},300)}),this.imgBorder.bind(_event._end,function(c){b.imgBorder.css({display:"none"});b.img.animate({opacity:"1"},300)}),this.imgBorder.bind(_event._leave,function(c){b.imgBorder.css({display:"none"});b.img.animate({opacity:"1"},
300)})):this.config.mouseOver==PageEditor.MouseOverType.Zoom&&this.img.mouseEnterZoom();if(void 0!=this.config.action){this.flag=0;this.linkURL=null;try{void 0!=this.config.action.length&&(this.config.action=this.config.action[0]),this.linkURL=this.config.action.url}catch(c){}var d;null!=this.linkURL&&"www"==this.linkURL.substr(0,3).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{d=this.config.action.triggerEventType}catch(f){d=null}this.onActionEvent(this.img,d);this.onActionEvent(this.imgBorder,
d)}},onResize:function(b,c){this.pw=b;this.ph=c;this.width=b*this.config.width;this.height=c*this.config.height;this.container.width(this.width).height(this.height).css({left:this.config.x*b,top:this.config.y*c});this.img.width(this.width).height(this.height);if(null!=this.form)this.form.onResize(bookContainer.width(),bookContainer.height());if(null!=this.slide)this.slide.onResize(bookContainer.width(),bookContainer.height());if(null!=this.audios)this.audios.onResize(bookContainer.width(),bookContainer.height())}}).extend(PageItem.Item),
HTML5ZoomImg=Class({create:function(b,c){var d=this,f,g;this.$container=$(c);f=this.$container.width();g=this.$container.height();this.limitWidth=f;this.limitHeight=g;this.innerLimitWidth=606;this.innerLimitHeight=404;this.dragDivFalg=!0;this.dragImgFalg=!1;this.address=uiBaseURL;this.isFullFalg=!1;this.isOneToOneFalg=!0;this.scale=100;this.isMapShowFalg=!1;this.boxImgBG=$("<div style='position: absolute;margin: 0px;padding: 0px;border: 0px;left: 0px;top: 0px;background-color: #000000;opacity: 0;z-index: 99999;'></div>").css({width:f,
height:g}).appendTo(this.$container);this.outerBoxImg=$("<div class='fliphtml5-loading' style='position: absolute;margin: 0px;padding: 0px;border: 0px;left: 0px;top: 0px;overflow: hidden;z-index: 99999;'></div>").css({width:f,height:g}).appendTo(this.$container);this.innerBoxImg=$("<div style='position: absolute;overflow: hidden;cursor: pointer;background-color: rgba(0,0,0, 0.6);'></div>").css({boxShadow:"0px 0px 4px #000000"}).hide().appendTo(this.outerBoxImg);window.box=this.innerBoxImg;this.boxImgDiv=
$("<div class='fliphtml5-boxDiv' style='position: absolute;'></div>").appendTo(this.innerBoxImg);this.boxImg=$("<img style='position: absolute;width: 100%;height: 100%;padding: 0px;margin: 0px;'/>").appendTo(this.boxImgDiv);this.closeBox=$("<div style='position: absolute;left: auto;top: 0px;right: 0px;'></div>").append($("<img>",{src:this.address+"closeForm.png"})).appendTo(this.innerBoxImg);this.bindCloseBoxEvent();this.createControlBar(this.innerBoxImg);this.createImgMap(this.innerBoxImg);this.loadImg(b);
this.dragDiv();this.dragImage();isTouch||(this.innerBoxImg.transition3D(),this.boxImgDiv.transition3D(),this.mapPoint.transition3D());$(window).on("resize",function(){d.resize()});return this},bindCloseBoxEvent:function(){var b=this;b.closeBox.bind("mouseover",function(){b.closeBox.children("img").attr("src",b.address+"closeForm_down.png")});b.closeBox.bind("mouseout",function(){b.closeBox.children("img").attr("src",b.address+"closeForm.png")});b.closeBox.bind("click",function(){b.destroy()})},createControlBar:function(b){this.controlBar=
$("<div class='control' style='position: absolute;width: 106px;height: 48px;overflow: hidden;bottom: -50px;top: auto;left: 50%;margin-left: -53px;border-top-left-radius: 10px;border-top-right-radius: 10px;background-color: rgba(0,0,0,0.6)'></div>").css({boxShadow:"0px 0px 4px #000000"}).appendTo(b);this.oneToOne=$("<span class='one-to-one' style='position: absolute;'></span>").css({width:40,height:30,left:10,top:9,fontFamily:"serif",fontSize:28,lineHeight:"30px",color:"#7F8383",letterSpacing:"-5px",
textAlign:"center"}).html("1:1").appendTo(this.controlBar);this.fullScreen=$("<div class='FullScreen' style='position: absolute'></div>").css({width:40,height:30,left:56,top:9}).append($("<img>",{src:this.address+"enterFull.png",css:{marginLeft:6,marginTop:1}})).appendTo(this.controlBar);this.bindControlEvents()},bindControlEvents:function(){var b=this;isTouch?b.controlBar.css({bottom:2}).show():(this.innerBoxImg.bind("mouseover",function(){b.controlBar.stop(!1,!1).animate({bottom:2},400,"linear")}),
this.innerBoxImg.bind("mouseout",function(){b.controlBar.stop(!1,!1).animate({bottom:-50},400,"linear")}));this.oneToOne.bind("click",function(){b.boxImgDiv.css({width:b.originalSize.width,height:b.originalSize.height,left:(b.innerBoxImg.width()-b.originalSize.width)/2,top:(b.innerBoxImg.height()-b.originalSize.height)/2});b.innerBoxImg.width()>=b.boxImgDiv.width()&&b.innerBoxImg.height()>=b.boxImgDiv.height()?b.dragImgFalg=!1:b.dragImgFalg=!0;b.isFullFalg?b.dragDivFalg=!1:b.innerBoxImg.width()>=
b.boxImgDiv.width()&&b.innerBoxImg.height()>=b.boxImgDiv.height()?b.dragDivFalg=!0:b.dragDivFalg=!1;b.scale=100;b.isOneToOneFalg=b.isOneToOne();b.isMapShowFalg=b.isShowMap();b.setMapPoint()});this.oneToOne.bind("mouseover",function(){b.isOneToOneFalg||b.oneToOne.css({color:"#32B9EB"})});this.oneToOne.bind("mouseout",function(){b.isOneToOneFalg||b.oneToOne.css({color:"#ffffff"})});this.fullScreen.bind("click",function(){var c=parseInt(b.boxImgDiv.css("left")),d=parseInt(b.boxImgDiv.css("top")),f=b.boxImgDiv.width(),
g=b.boxImgDiv.height(),h=b.innerBoxImg.width(),k=b.innerBoxImg.height();b.isFullFalg?(b.innerBoxImg.css({width:Math.max(b.innerLimitWidth,b.result.width),height:Math.max(b.innerLimitHeight,b.result.height),left:Math.max(0,(b.outerBoxImg.width()-Math.max(b.innerLimitWidth,b.result.width))/2),top:Math.max(0,(b.outerBoxImg.height()-Math.max(b.innerLimitHeight,b.result.height))/2)}),b.boxImgDiv.css({left:b.innerBoxImg.width()>=f?(b.innerBoxImg.width()-f)/2:Math.max(b.innerBoxImg.width()-f,c+(b.innerBoxImg.width()-
h)/2),top:b.innerBoxImg.height()>=g?(b.innerBoxImg.height()-g)/2:Math.max(b.innerBoxImg.height()-g,d+(b.innerBoxImg.height()-k)/2)}),b.innerBoxImg.width()>=b.boxImgDiv.width()&&b.innerBoxImg.height()>=b.boxImgDiv.height()?b.dragDivFalg=!0:b.dragDivFalg=!1,b.isFullFalg=!1,b.fullScreen.children("img").attr("src",b.address+"enterFull.png")):(b.innerBoxImg.css({width:b.$container.width(),height:b.$container.height(),left:0,top:0}),b.boxImgDiv.css({left:b.innerBoxImg.width()>=f?(b.innerBoxImg.width()-
f)/2:Math.max(b.innerBoxImg.width()-f,c+(h-b.innerBoxImg.width())/2),top:b.innerBoxImg.height()>=g?(b.innerBoxImg.height()-g)/2:Math.max(b.innerBoxImg.height()-g,d+(k-b.innerBoxImg.height())/2)}),b.isFullFalg=!0,b.dragDivFalg=!1,b.fullScreen.children("img").attr("src",b.address+"exitFull.png"));b.innerBoxImg.width()>=b.boxImgDiv.width()&&b.innerBoxImg.height()>=b.boxImgDiv.height()?b.dragImgFalg=!1:b.dragImgFalg=!0;b.isShowMap();b.setMapPoint()});this.fullScreen.bind("mouseover",function(){b.isFullFalg?
b.fullScreen.children("img").attr("src",b.address+"exitFull_over.png"):b.fullScreen.children("img").attr("src",b.address+"enterFull_over.png")});this.fullScreen.bind("mouseout",function(){b.isFullFalg?b.fullScreen.children("img").attr("src",b.address+"exitFull.png"):b.fullScreen.children("img").attr("src",b.address+"enterFull.png")})},isOneToOne:function(){if(this.originalSize.width==this.boxImgDiv.width()&&this.originalSize.height==this.boxImgDiv.height())return this.oneToOne.css({color:"#7F8383"}),
!0;this.oneToOne.css({color:"#ffffff"});return!1},loadImg:function(b){var c=this,d=new Image;d.onload=function(){d.onload=d.onerror=null;var b=this.width,g=this.height,h=c.selectWidthAdHeight(b,g);c.outerBoxImg.removeClass("fliphtml5-loading");c.boxImgDiv.css({width:h.width,height:h.height});c.innerBoxImg.css({width:Math.max(c.innerLimitWidth,h.width),height:Math.max(c.innerLimitHeight,h.height),left:Math.max(0,(c.outerBoxImg.width()-Math.max(c.innerLimitWidth,h.width))/2),top:-Math.max(c.innerLimitHeight,
h.height)-240});c.innerBoxImg.show().animate({top:Math.max(0,(c.outerBoxImg.height()-Math.max(c.innerLimitHeight,h.height))/2)},{duration:500,easing:"linear"});c.boxImgDiv.css({width:h.width,height:h.height,left:Math.max(0,(c.innerBoxImg.width()-h.width)/2),top:Math.max(0,(c.innerBoxImg.height()-h.height)/2)});c.originalSize={width:b,height:g};c.result=h;c.isOneToOneFalg=c.isOneToOne();isTouch?c.zoomInPad():c.mouseZoom();c.setMapImg(b,g)};d.onerror=function(){d.onload=d.onerror=null;c.outerBoxImg.removeClass("fliphtml5-loading");
var b=c.selectWidthAdHeight(18,20);c.boxImgDiv.css({width:b.width,height:b.height});c.innerBoxImg.css({width:Math.max(c.innerLimitWidth,b.width),height:Math.max(c.innerLimitHeight,b.height),left:Math.max(0,(c.outerBoxImg.width()-Math.max(c.innerLimitWidth,b.width))/2),top:-Math.max(c.innerLimitHeight,b.height)-240});c.innerBoxImg.show().animate({top:Math.max(0,(c.outerBoxImg.height()-Math.max(c.innerLimitHeight,b.height))/2)},{duration:500,easing:"linear"});c.boxImgDiv.css({width:b.width,height:b.height,
left:Math.max(0,(c.innerBoxImg.width()-b.width)/2),top:Math.max(0,(c.innerBoxImg.height()-b.height)/2)});c.originalSize={width:18,height:20};c.result=b;c.isOneToOneFalg=c.isOneToOne();isTouch?c.zoomInPad():c.mouseZoom();c.setMapImg(18,20)};d.src=b;c.boxImg.attr("src",b);c.mapImg.attr("src",b)},selectWidthAdHeight:function(b,c){var d={},f=b/c,g=this.limitWidth,h=this.limitHeight;g>=b&&h<c?(d.width=f*h,d.height=h):g<b&&h>=c?(d.width=g,d.height=g/f):g<b&&h<c?g/f<=h?(d.width=g,d.height=g/f):f*h<=g?(d.width=
f*h,d.height=h):console&&console.log("Do not be so wonderful picture of uncle!"):(d.width=b,d.height=c);return d},dragDiv:function(){var b=this,c=b.innerBoxImg,d=$(document),f=!0,g,h,k,l;b.innerBoxImg.bind(_event._down,function(b){b=isTouch?b.originalEvent.touches:[b];1==b.length?f=!0:2<=b.length&&(f=!1);stopEvent(b[0])});c.bind(_event._down,function(m){b.dragDivFalg&&(m=isTouch?m.originalEvent.touches[0]:m,isTouch||(m.preventDefault(),m.stopPropagation()),g=c[0].offsetLeft,h=c[0].offsetTop,k=m.clientX,
l=m.clientY,d.bind(_event._move,function(b){f&&(b=isTouch?b.originalEvent.touches[0]:b,isTouch||(b.preventDefault(),b.stopPropagation()),c.css({left:g+b.clientX-k,top:h+b.clientY-l}))}),d.bind(_event._end,function(b){b=isTouch?b.originalEvent.touches[0]:b;isTouch||(b.preventDefault(),b.stopPropagation());f=!0;d.unbind(_event._move)}))})},mouseZoom:function(){var b=this,c=b.scale,d=b.result,f=d.width,g=d.height;b.innerBoxImg.bind($.browser.mozilla?"DOMMouseScroll":"mousewheel",function(d){c=b.scale;
d=d.originalEvent;d=d.wheelDelta||-d.detail;0<d?c+=0.2*c:0>d&&(c-=0.17*c);5>c?c=5:1600<c&&(c=1600);var k,l,m;l=b.boxImgDiv.width();m=b.boxImgDiv.height();d=f*c/100;var n=g*c/100;d<b.innerBoxImg.width()?k=(b.innerBoxImg.width()-f*c/100)/2:(k=parseInt(b.boxImgDiv.css("left")),k+=(l-d)/2,0<=k?k=0:k<=b.innerBoxImg.width()-d&&(k=b.innerBoxImg.width()-d));n<b.innerBoxImg.height()?m=(b.innerBoxImg.height()-g*c/100)/2:(l=parseInt(b.boxImgDiv.css("top")),m=l+(m-n)/2,0<=m?m=0:m<=b.innerBoxImg.height()-n&&(m=
b.innerBoxImg.height()-n));b.scale=c;b.boxImgDiv.animate({width:d,height:n,left:k,top:m},{duration:100,easing:"linear",complete:function(){b.isOneToOneFalg=b.isOneToOne();b.isMapShowFalg=b.isShowMap();b.setMapPoint();b.isFullFalg?(b.dragDivFalg=!1,b.boxImgDiv.width()>b.innerBoxImg.width()||b.boxImgDiv.height()>b.innerBoxImg.height()?b.dragImgFalg=!0:b.dragImgFalg=!1):b.boxImgDiv.width()>b.innerBoxImg.width()||b.boxImgDiv.height()>b.innerBoxImg.height()?(b.dragDivFalg=!1,b.dragImgFalg=!0):(b.dragDivFalg=
!0,b.dragImgFalg=!1)}})})},zoomInPad:function(){var b=this,c=b.result,d=c.width,f=c.height,g,h,k,l,m,n=!1;b.boxImgDiv[0].addEventListener("touchstart",function(c){if(2<=c.touches.length){n=!0;var d=c.touches[0].pageX,f=c.touches[0].pageY,r=c.touches[1].pageX;c=c.touches[1].pageY;g=b.boxImgDiv.position().left;h=b.boxImgDiv.position().top;k=b.boxImgDiv.width();l=b.boxImgDiv.height();m=Math.sqrt(Math.pow(r-d,2)+Math.pow(c-f,2))}},!1);document.addEventListener("touchmove",function(c){if(n){if(2<=c.touches.length){var p,
s,r;p=c.touches[0].pageX;s=c.touches[0].pageY;r=c.touches[1].pageX;c=c.touches[1].pageY;s=Math.sqrt(Math.pow(r-p,2)+Math.pow(c-s,2))/m;p=k*s;s*=l;r=(k-p)/2+g;c=(l-s)/2+h;p<b.innerBoxImg.width()?r=(b.innerBoxImg.width()-p)/2:0<=r?r=0:r<=b.innerBoxImg.width()-p&&(r=b.innerBoxImg.width()-p);s<b.innerBoxImg.height()?c=(b.innerBoxImg.height()-s)/2:0<=c?c=0:c<=b.innerBoxImg.height()-s&&(c=b.innerBoxImg.height()-s);b.boxImgDiv.width(p).height(s).css({left:r,top:c});b.isOneToOneFalg=b.isOneToOne();b.isMapShowFalg=
b.isShowMap();b.setMapPoint();b.boxImgDiv.width()>d||b.boxImgDiv.height()>f?(b.dragDivFalg=!1,b.dragImgFalg=!0):(b.dragDivFalg=!0,b.dragImgFalg=!1)}}else c.preventDefault()},!1);document.addEventListener("touchend",function(b){n=!1},!1);document.body.addEventListener("touchmove",function(b){b.preventDefault()},!1)},dragImage:function(){var b=this,c=b.boxImgDiv,d=$(document),f=!0,g,h,k,l;b.innerBoxImg.bind(_event._down,function(b){b=isTouch?b.originalEvent.touches:[b];1==b.length?f=!0:2<=b.length&&
(f=!1);stopEvent(b[0])});c.bind(_event._down,function(m){b.dragImgFalg&&(m=isTouch?m.originalEvent.touches[0]:m,c.addClass("dragging"),g=c[0].offsetLeft,h=c[0].offsetTop,k=m.clientX,l=m.clientY,d.bind(_event._move,function(d){d=isTouch?d.originalEvent.touches[0]:d;if(f){var m=g+d.clientX-k;d=h+d.clientY-l;0<=m?m=0:m<=b.innerBoxImg.width()-b.boxImgDiv.width()&&(m=b.innerBoxImg.width()-b.boxImgDiv.width());0<=d?d=0:d<=b.innerBoxImg.height()-b.boxImgDiv.height()&&(d=b.innerBoxImg.height()-b.boxImgDiv.height());
c.width()>b.innerBoxImg.width()&&(c.css({left:m}),b.mapPoint.css({left:-m/(b.boxImgDiv.width()-b.innerBoxImg.width())*(b.mapDiv.width()-b.mapPoint.outerWidth())}));c.height()>b.innerBoxImg.height()&&(c.css({top:d}),b.mapPoint.css({top:-d/(b.boxImgDiv.height()-b.innerBoxImg.height())*(b.mapDiv.height()-b.mapPoint.outerHeight())}))}}),d.bind(_event._end,function(b){d.unbind(_event._move);c.removeClass("dragging");f=!0}))})},resize:function(){var b=this.$container.width(),c=this.$container.height();
this.boxImgBG.css({width:b,height:c});this.outerBoxImg.css({width:b,height:c});this.isFullFalg?(this.innerBoxImg.css({width:b,height:c}),this.boxImgDiv.css({left:(b-this.boxImgDiv.width())/2,top:(c-this.boxImgDiv.height())/2}),this.setMapPoint()):this.innerBoxImg.css({left:(b-this.innerBoxImg.width())/2,top:(c-this.innerBoxImg.height())/2})},destroy:function(){var b=this;parseInt(b.innerBoxImg.css("left"));parseInt(b.innerBoxImg.css("top"));var c=b.innerBoxImg.width(),d=b.innerBoxImg.height(),f,g,
h,k,l;$({k:100}).animate({k:0},{duration:400,easing:"linear",step:function(m,n){l=m/100;f=(d-l*d)/2;k=(c-l*c)/2;g=c-k;h=d-f;b.innerBoxImg[0].style.clip="rect("+f+"px, "+g+"px, "+h+"px, "+k+"px)"},complete:function(){b.boxImgBG.remove();b.outerBoxImg.remove()}})},createImgMap:function(b){this.map=$("<div class='ImageMap' style='position: absolute;left: auto;top: auto;right: 2px;bottom: 2px;width: 210px;height: 130px;overflow: hidden;border-radius: 4px;'></div>").css({boxShadow:"inset 1px 1px 0 rgba(0,0,0,.1),inset 0 -1px 0 rgba(0,0,0,.07)",
backgroundColor:"rgba(0,0,0,.6)"}).hide().appendTo(b);this.mapDiv=$("<div style='position: absolute;margin: 0px;padding: 0px;border: 0px;overflow: hidden;'></div>").appendTo(this.map);this.mapImg=$("<img style='position: absolute;width: 100%;height: 100%;left: 0px;top: 0px;padding: 0px;margin: 0px;border: 0px;'/>").appendTo(this.mapDiv);this.mapPoint=$("<div style='position: absolute;margin: 0px;padding: 0px;border: 2px solid #58AA38;width: 100%;height: 100%;'></div>").css({boxShadow:"inset 1px 1px 0 #ffffff,inset 0 -1px 0 #ffffff,inset -1px 0px 0 #ffffff"}).appendTo(this.mapDiv);
this.closeMap=$("<div style='position: absolute;left: auto;top: 0px;right: 0px;'></div>").append($("<img>",{src:this.address+"closeForm.png"})).appendTo(this.map);this.bindCloseMapEvent();this.dragMapPoint()},bindCloseMapEvent:function(){var b=this;b.closeMap.bind("mouseover",function(){b.closeMap.children("img").attr("src",b.address+"closeForm_down.png")});b.closeMap.bind("mouseout",function(){b.closeMap.children("img").attr("src",b.address+"closeForm.png")});b.closeMap.bind("click",function(){b.destroyMap()})},
setMapImg:function(b,c){var d=this.map.width(),f=this.map.height(),g=b/c,h=f*g,k=d/g,l,m,n,q;h>d?(l=d,m=k,n=0,q=(f-k)/2):k>f?(l=h,m=f,n=(d-h)/2,q=0):h/k==g&&(l=h,m=k,q=n=0);this.mapDiv.css({width:l,height:m,left:n,top:q})},setMapPoint:function(){var b=Math.min(this.mapDiv.width(),this.innerBoxImg.width()*this.mapDiv.width()/this.boxImgDiv.width())-4,c=Math.min(this.mapDiv.height(),this.innerBoxImg.height()*this.mapDiv.height()/this.boxImgDiv.height())-4,d=-parseInt(this.boxImgDiv.css("left"))/(this.boxImgDiv.width()-
this.innerBoxImg.width())*(this.mapDiv.width()-(b+4)),f=-parseInt(this.boxImgDiv.css("top"))/(this.boxImgDiv.height()-this.innerBoxImg.height())*(this.mapDiv.height()-(c+4));this.mapPoint.css({left:d,top:f,width:b,height:c})},isShowMap:function(){if(this.innerBoxImg.width()>=this.boxImgDiv.width()&&this.innerBoxImg.height()>=this.boxImgDiv.height())return this.map.hide(),!0;this.map.show();return!1},dragMapPoint:function(){var b=this,c=b.mapPoint,d=$(document),f,g,h,k;c.bind(_event._down,function(l){l=
isTouch?l.originalEvent.touches[0]:l;f=c[0].offsetLeft;g=c[0].offsetTop;h=l.clientX;k=l.clientY;d.bind(_event._move,function(d){d=isTouch?d.originalEvent.touches[0]:d;var l=f+d.clientX-h;d=g+d.clientY-k;0>=l?l=0:l>=b.mapDiv.width()-b.mapPoint.outerWidth()&&(l=b.mapDiv.width()-b.mapPoint.outerWidth());0>=d?d=0:d>=b.mapDiv.height()-b.mapPoint.outerHeight()&&(d=b.mapDiv.height()-b.mapPoint.outerHeight());c.width()<b.mapDiv.width()&&(c.css({left:l}),b.boxImgDiv.css({left:-l/(b.mapDiv.width()-b.mapPoint.outerWidth())*
(b.boxImgDiv.width()-b.innerBoxImg.width())}));c.height()<b.mapDiv.height()&&(c.css({top:d}),b.boxImgDiv.css({top:-d/(b.mapDiv.height()-b.mapPoint.outerHeight())*(b.boxImgDiv.height()-b.innerBoxImg.height())}))});d.bind(_event._end,function(b){d.unbind(_event._move)})})},destroyMap:function(){var b=this;parseInt(b.map.css("right"));parseInt(b.map.css("bottom"));var c=b.map.width(),d=b.map.height(),f,g,h,k,l;$({k:100}).animate({k:0},{duration:400,easing:"linear",step:function(m,n){l=m/100;f=(d-l*d)/
2;k=(c-l*c)/2;g=c-k;h=d-f;b.map[0].style.clip="rect("+f+"px, "+g+"px, "+h+"px, "+k+"px)"},complete:function(){b.map.remove()}})}});
Class("Arrow",{Package:"PageItem",create:function(b,c,d,f,g){this.config=$.extend({StartX:0,StartY:0,EndX:100,EndY:100,width:200,height:20,x:0,y:0,alpha:1,lineWidth:1,lineType:null,dotWidth:3,color:null,arrowType:null,sh:"false",sx:4,sy:4,se:2,sr:null},c);this.pw=d;this.ph=f;this.color=Color(this.config.color).toString();this.bstyle="Solid line"==this.config.lineType?"solid":"dashed";this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.x=this.config.x*this.pw;this.y=this.config.y*
this.ph;this.id="arrow"+g;this.x1=this.x-10;this.y1=this.y-10;0>this.x-10&&(this.x1=0);0>this.y-10&&(this.y1=0);this.arrow=$("<canvas id="+this.id+" width="+(this.width+20)+" height="+(this.height+20)+" style='position: absolute;top:"+this.y1+"px;left:"+this.x1+"px'></canvas>");b.append(this.arrow);this.arrowcan(this.x,this.y,this.config.StartX,this.config.StartY,this.config.EndX,this.config.EndY,this.width,this.height,this.config.lineWidth,this.config.dotWidth,this.color,this.config.alpha,this.bstyle,
this.config.sx,this.config.sy,this.config.se,this.config.sr,this.config.sh)},onResize:function(b,c){this.pw=b;this.ph=c;this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.arrow.css({width:this.width+20+"px",height:this.height+20+"px"});this.setPosition()},setPosition:function(){this.x=this.config.x*this.pw-10;this.y=this.config.y*this.ph-10;this.arrow.css({left:this.x+"px",top:this.y+"px"})},arrowcan:function(b,c,d,f,g,h,k,l,m,n,q,p,s,r,t,v,u,A){var x=c=b=0,w=0,y=0,z=
this.arrow[0].getContext("2d");n=parseFloat(n);z.clearRect(0,0,this.pw,this.ph);z.save();z.lineWidth=m;z.globalAlpha=p;z.strokeStyle=q;!0===parseBool(A)&&(z.shadowOffsetX=r,z.shadowOffsetY=t,z.shadowBlur=v,z.shadowColor=Color(u).toString());0==d&&0==f?(y=w=10,b=k+10,c=l+10):0==d&&0!=f?(w=10,y=10+l,b=k+10,c=10):0!=d&&0==f?(w=10+k,b=y=10,c=l+10):(w=10+k,y=10+l,c=b=10);z.translate(0,0);z.beginPath();z.moveTo(w,y);"Double Arrow"==this.config.arrowType&&(0==h-f?g>d?z.moveTo(w+5,y):z.moveTo(w-5,y):0==g-
d&&(h>f?z.moveTo(w,y+5):z.moveTo(w,y-5)));if("solid"==s)0==h-f?g>d?z.lineTo(b-5,c):z.lineTo(b+5,c):0==g-d?h>f?z.lineTo(b,c-5):z.lineTo(b,c+5):z.lineTo(b,c);else for(k=0,s=n+2,l=w,p=y,s=(0==h-f?g>d?(b-w)/s:(w-b)/s:0==g-d?h>f?(c-y)/s:(y-c)/s:f<h&&d<g?b-w>c-y?(b-w)/s:(c-y)/s:f>h&&d<g?b-w>y-c?(b-w)/s:(y-c)/s:f<h&&d>g?w-b>c-y?(w-b)/s:(c-y)/s:w-b>y-c?(w-c)/s:(y-c)/s)-1,i=0;i<s;i++)z.moveTo(l,p),0==h-f?l=g>d?l+n:l-n:0==g-d?p=h>f?p+n:p-n:f<h&&d<g?b-w>c-y?(k=Math.abs((c-y)/(b-w)),l+=n,p+=n*k):(k=Math.abs((b-
w)/(c-y)),l+=n*k,p+=n):f>h&&d<g?b-w>y-c?(k=Math.abs((c-y)/(b-w)),l+=n,p-=n*k):(k=Math.abs((b-w)/(c-y)),l+=n*k,p-=n):f<h&&d>g?w-b>c-y?(k=Math.abs((c-y)/(b-w)),l-=n,p+=n*k):(k=Math.abs((b-w)/(c-y)),l-=n*k,p+=n):w-b>y-c?(k=Math.abs((c-y)/(b-w)),l-=n,p-=n*k):(k=Math.abs((b-w)/(c-y)),l-=n*k,p-=n),z.lineTo(l,p),0==h-f?l=g>d?l+2:l-2:0==g-d?p=h>f?p+2:p-2:f<h&&d<g?b-w>c-y?(l+=2,p+=2*k):(l+=2*k,p+=2):f>h&&d<g?b-w>y-c?(l+=2,p-=2*k):(l+=2*k,p-=2):f<h&&d>g?w-b>c-y?(l-=2,p+=2*k):(l-=2*k,p+=2):w-b>y-c?(l-=2,p-=
2*k):(l-=2*k,p-=2);z.fillStyle=q;z.stroke();z.save();x=2<1*m?15:10;"Double Arrow"==this.config.arrowType&&(z.moveTo(w,y),"Double Arrow"==this.config.arrowType&&(0==h-f?g>d?z.moveTo(w-1,y):z.moveTo(w+1,y):0==g-d&&(h>f?z.moveTo(w,y-1):z.moveTo(w,y+1))),z.translate(w,y),0<=c-y?z.rotate(4.7-Math.atan((b-w)/(c-y))):z.rotate(4.7-(Math.PI+Math.atan((b-w)/(c-y)))),z.lineTo(-x,x-5),z.lineTo(-(x-5),0),z.lineTo(-x,-(x-5)),z.lineTo(0,0),z.fill(),z.restore());z.moveTo(b,c);z.translate(b,c);0<=c-y?z.rotate(1.5-
Math.atan((b-w)/(c-y))):z.rotate(1.5-(Math.PI+Math.atan((b-w)/(c-y))));z.lineTo(-x,x-5);z.lineTo(-(x-5),0);z.lineTo(-x,-(x-5));z.lineTo(0,0);z.fill();z.restore()}}).extend(PageItem.Item);global.hddr.soq3=function(){return hddr.soo1||"tm"}();
Class("Line",{create:function(b,c,d,f,g){this.config=$.extend({StartX:0,StartY:0,EndX:100,EndY:100,width:200,height:20,x:0,y:0,alpha:1,lineAlpha:1,lineWidth:1,lineType:null,dotWidth:3,color:null,sh:"false",sx:4,sy:4,se:2,sr:null},c);this.pw=d;this.ph=f;this.color=Color(this.config.color).toString();this.bstyle="Solid line"==this.config.lineType?"solid":"dashed";this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.id=
"line"+g;this.x1=this.x-10;this.y1=this.y-10;0>this.x-10&&(this.x1=0);0>this.y-10&&(this.y1=0);this.line=$("<canvas id="+this.id+" width="+(this.width+this.config.lineWidth+10)+" height="+(10+this.height+this.config.lineWidth)+" style='position: absolute;top:"+this.y1+"px;left:"+this.x1+"px'></canvas>");b.append(this.line);this.linecan(this.x,this.y,this.config.StartX,this.config.StartY,this.config.EndX,this.config.EndY,this.width,this.height,this.config.lineWidth,this.config.dotWidth,this.color,
this.config.lineAlpha,this.bstyle,this.config.sx,this.config.sy,this.config.se,this.config.sr,this.config.sh)},onResize:function(b,c){this.pw=b;this.ph=c;this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.line.css({width:this.width+20+"px",height:this.height+20+"px"});this.setPosition()},setPosition:function(){this.x=this.config.x*this.pw-10;this.y=this.config.y*this.ph-10;this.line.css({left:this.x+"px",top:this.y+"px"})},linecan:function(b,c,d,f,g,h,k,l,m,n,q,p,s,r,
t,v,u,A){var x=c=b=0,w=0;b=this.line[0];var y;try{y=b.getContext("2d")}catch(z){return}y.lineCap="round";y.lineJoin="round";n=parseFloat(n);0==d&&0==f?(w=x=10,b=k+10,c=l+10):0==d&&0!=f?(x=10,w=10+l,b=k+10,c=10):0!=d&&0==f?(x=10+k,b=w=10,c=l+10):(x=10+k,w=10+l,c=b=10);y.moveTo(x,w);y.lineWidth=m;y.globalAlpha=p;y.strokeStyle=q;!0===parseBool(A)&&(y.shadowOffsetX=r,y.shadowOffsetY=t,y.shadowBlur=v,y.shadowColor=colorTo0x(u));if("solid"==s)y.lineTo(b,c);else for(k=0,q=n+2,l=x,m=w,num=0==h-f?g>d?(b-x)/
q:(x-b)/q:0==g-d?h>f?(c-w)/q:(w-c)/q:f<h&&d<g?b-x>c-w?(b-x)/q:(c-w)/q:f>h&&d<g?b-x>w-c?(b-x)/q:(w-c)/q:f<h&&d>g?x-b>c-w?(x-b)/q:(c-w)/q:x-b>w-c?(x-c)/q:(w-c)/q,q=num-1,i=0;i<q;i++)y.moveTo(l,m),0==h-f?l=g>d?l+n:l-n:0==g-d?m=h>f?m+n:m-n:f<h&&d<g?b-x>c-w?(k=Math.abs((c-w)/(b-x)),l+=n,m+=n*k):(k=Math.abs((b-x)/(c-w)),l+=n*k,m+=n):f>h&&d<g?b-x>w-c?(k=Math.abs((c-w)/(b-x)),l+=n,m-=n*k):(k=Math.abs((b-x)/(c-w)),l+=n*k,m-=n):f<h&&d>g?x-b>c-w?(k=Math.abs((c-w)/(b-x)),l-=n,m+=n*k):(k=Math.abs((b-x)/(c-w)),
l-=n*k,m+=n):x-b>w-c?(k=Math.abs((c-w)/(b-x)),l-=n,m-=n*k):(k=Math.abs((b-x)/(c-w)),l-=n*k,m-=n),y.lineTo(l,m),0==h-f?l=g>d?l+2:l-2:0==g-d?m=h>f?m+2:m-2:f<h&&d<g?b-x>c-w?(l+=2,m+=2*k):(l+=2*k,m+=2):f>h&&d<g?b-x>w-c?(l+=2,m-=2*k):(l+=2*k,m-=2):f<h&&d>g?x-b>c-w?(l-=2,m+=2*k):(l-=2*k,m+=2):x-b>w-c?(l-=2,m-=2*k):(l-=2*k,m-=2);y.stroke()}});bdor[10]="l";
Class("Link",{Package:"PageItem",create:function(b,c,d,f){this._super(b,c,d,f);void 0==c.downColor?(c.downColor=getColor("LinkDownColor","#808080"),c.downAlpha=getInt("LinkAlpha",0.6),c.overColor=c.downColor,c.outColor=c.downColor,c.overAlpha=c.downAlpha/2,c.outAlpha=0):(c.downColor=colorTo0x(c.downColor),c.overColor=colorTo0x(c.overColor),c.outColor=colorTo0x(c.outColor));this.left=d*c.x;this.top=f*c.y;this.width=d*c.width;this.height=f*c.height;this.link=$("<div style='position: absolute;'></div>");
this.link.css({position:"absolute",top:this.top+"px",left:this.left+"px",width:this.width+"px",height:this.height+"px",background:"rgba(0,0,0,0)"});b.append(this.link);this.initEvent()},onResize:function(b,c){this.pageWidth=b;this.pageHeight=c;this.left=b*this.config.x;this.top=c*this.config.y;this.width=b*this.config.width;this.height=c*this.config.height;this.link.css({width:this.width+"px",height:this.height+"px"});this.setPosition(this.left,this.top);if(null!=this.form)this.form.onResize(bookContainer.width(),
bookContainer.height());if(null!=this.slide)this.slide.onResize(bookContainer.width(),bookContainer.height());if(null!=this.audios)this.audios.onResize(bookContainer.width(),bookContainer.height());if(null!=this.showInformation)this.showInformation.onResize(bookContainer.width(),bookContainer.height())},setPosition:function(b,c){this.link.css({left:b+"px",top:c+"px"})},initLinkAction:function(){null==this.config.action||void 0!=this.config.action.length&&0===this.config.action.length||(void 0!=this.config.action.length&&
(this.config.action=this.config.action[0]),this.linkURL=this.config.action.url,null!=this.linkURL&&"www"==this.linkURL.toLowerCase().substr(0,3)&&(this.linkURL="http://"+this.linkURL),this.linkPageIndex=null,this.config.action.actionType==PageEditor.ActionType.GOTO_PAGE&&(this.linkPageIndex=this.config.action.pageIndex),this.mouseEvent=null,this.config.action.triggerEventType&&(this.mouseEvent=this.config.action.triggerEventType))},initEvent:function(){this.flag=0;this.audios=this.slide=this.form=
null;this.linkURL="";this.initLinkAction();this.onActionEvent(this.link,this.mouseEvent);this.link.bind(_event._down,function(b){this.link.css({"background-color":this.config.downColor,opacity:this.config.downAlpha,cursor:"pointer"});return!1}.bind(this));this.link.bind("mouseover",function(b){this.link.css({"background-color":this.config.overColor,opacity:this.config.overAlpha,cursor:"pointer"})}.bind(this));this.link.bind(isTouch?_event._end:"mouseout",function(b){this.link.css({"background-color":this.config.outColor,
opacity:this.config.outAlpha,cursor:"default"})}.bind(this));this.initLinkHint()},initLinkHint:function(){2==this.config.linkStatus||null==this.linkURL&&null==this.linkPageIndex||(this.link.hint=null,this.link.bind(_event._enter,function(){var b=this.top+this.height,c=this.left,d=function(){var d=this.link.hint.width(),f=this.link.hint.height();c+d>this.pageWidth&&(c-=c+d-this.pageWidth);b+f>this.pageHeight&&(b=b-this.height-f)}.bind(this);if(null==this.link.hint){var f=this.linkURL;if(bookConfig.isFlipPdf){if(this.config.hint&&
(f=this.config.hint.text),!f||"string"!=typeof f||""==f.trim())return}else if(f=this.linkURL,void 0!=this.linkPageIndex&&(f=getLanguage("gotoPage","page:")+this.linkPageIndex),!parseBool(bookConfig.showLinkHint))return;null!=this.linkPageIndex&&(f=getLanguage("gotoPage","page:")+this.linkPageIndex);this.link.hint=new divHint(f,c,b,this.parent);d();this.link.hint.moveto(c,b);this.link.hint.setAnimate(!0)}d();this.link.hint.moveto(c,b);this.link.hint.show()}.bind(this)),this.link.bind(_event._leave,
function(){null!=this.link.hint&&this.link.hint.hide()}.bind(this)))}}).extend(PageItem.Item);bdor[29]="t";
Class("Rectangle",{Package:"PageItem",create:function(b,c,d,f,g){this.config=$.extend({width:200,height:20,x:0,y:0,alpha:1,fillStyle:null,color:null,ColorA:null,ColorB:null,angle:90,spalpha:1,action:null,borderWidth:1,borderColor:null,borderAlpha:1,sh:"false",sx:4,sy:4,se:2,sr:null,round:!1,roundWidth:0},c);this.pw=d;this.ph=f;this.father=b;this.color=Color(this.config.color).toString();this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.x=this.config.x*this.pw;this.y=
this.config.y*this.ph;this.id="re"+g;this.angle=360-parseInt(this.config.angle);this.A=Color(this.config.ColorA).toString();this.B=Color(this.config.ColorB).toString();this.round=c.round;this.roundWidth=Math.ceil(c.roundWidth/2);this.Re=$("<div id="+this.id+" style='overflow: hidden;position:absolute;top:"+this.y+"px;left:"+this.x+"px;border:"+this.config.borderWidth+"px solid "+colorTo0x(this.config.borderColor)+";background:"+this.color+";height:"+this.height+"px;width:"+this.width+"px;opacity:"+
this.config.spalpha+"'></div>");!0===parseBool(this.config.sh)&&this.Re.css({"box-shadow":this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+Color(this.config.sr).toString(),"-moz-box-shadow":this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+Color(this.config.sr).toString(),"-webkit-box-shadow":this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+Color(this.config.sr).toString(),"-ms-box-shadow":this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+Color(this.config.sr).toString(),
"-o-box-shadow":this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+Color(this.config.sr).toString()});!0==this.round&&this.Re.css({"border-radius":this.roundWidth+"px"});if("gradient"==this.config.fillStyle)switch(c=this.A,d=this.B,this.Re.css({background:"linear-gradient("+this.angle+"deg, "+c+", "+d+")"}),browserType){case 1:this.Re.css({background:"-webkit-linear-gradient("+this.angle+"deg, "+c+", "+d+")"});break;case 2:this.Re.css({background:"-moz-linear-gradient("+this.angle+"deg, "+
c+", "+d+")"});break;case 3:this.Re.css({background:"-ms-linear-gradient("+this.angle+"deg, "+c+", "+d+")"});this.Re.css("filter","progid:DXImageTransform.Microsoft.Gradient( EndColorStr="+d+", StartColorStr="+c+")");break;case 4:this.Re.css({background:"-o-linear-gradient("+this.angle+"deg, "+c+", "+d+")"})}"none"==this.config.fillStyle&&this.Re.css({background:""});this.initEvent();b.append(this.Re)},initEvent:function(){this.flag=0;this.linkURL=this.audios=this.slide=this.form=null;if(null!=this.config.action){try{void 0!=
this.config.action.length&&(this.config.action=this.config.action[0]),this.linkURL=this.config.action.url}catch(b){}var c;null!=this.linkURL&&"www"==this.linkURL.substr(0,3).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{c=this.config.action.triggerEventType}catch(d){c=null}this.onActionEvent(this.Re,c)}},onResize:function(b,c){this.pw=b;this.ph=c;this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.Re.css({width:this.width+"px",height:this.height+"px"});this.setPosition();
if(null!=this.form)this.form.onResize(bookContainer.width(),bookContainer.height());if(null!=this.slide)this.slide.onResize(bookContainer.width(),bookContainer.height());if(null!=this.audios)this.audios.onResize(bookContainer.width(),bookContainer.height())},setPosition:function(){this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.Re.css({left:this.x+"px",top:this.y+"px"})}}).extend(PageItem.Item);bdor[8]="o";
Class("Round",{Package:"PageItem",create:function(b,c,d,f,g){this._super(b,c,d,f);this.config=$.extend({width:200,height:20,x:0,y:0,alpha:1,fillStyle:null,color:null,ColorA:null,ColorB:null,angle:"false",spalpha:1,action:null,borderWidth:1,borderColor:null,borderAlpha:1,sh:"false",sx:4,sy:4,se:2,sr:null},c);this.pw=d;this.ph=f;this.color=Color(this.config.color).toString();this.father=b;this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.x=this.config.x*this.pw;this.y=
this.config.y*this.ph;this.id="round"+g;this.x1=this.x-10;this.y1=this.y-10;0>this.x-10&&(this.x1=0);0>this.y-10&&(this.y1=0);this.rounds=$("<canvas id="+this.id+" width="+(this.width+20)+" height="+(this.height+20)+" style='position: absolute;top:"+this.y1+"px;left:"+this.x1+"px'></canvas>");this.father=b;this.initEvent();b.append(this.rounds);this.roundcan(this.x,this.y,this.width,this.height,this.color,this.config.fillStyle,this.config.ColorA,this.config.ColorB,this.config.alpha,this.config.borderWidth,
this.config.spalpha,this.config.borderColor,this.config.borderAlpha,this.config.sx,this.config.sy,this.config.se,this.config.sr,this.config.sh,360-parseInt(this.config.angle))},initEvent:function(){this.flag=0;this.audios=this.slide=this.form=null;this.linkURL="";if(null!=this.config.action){try{void 0!=this.config.action.length&&(this.config.action=this.config.action[0]),this.linkURL=this.config.action.url}catch(b){}var c;null!=this.linkURL&&"www"==this.linkURL.substr(0,3).toLowerCase()&&(this.linkURL=
"http://"+this.linkURL);try{c=this.config.action.triggerEventType}catch(d){c=null}this.onActionEvent(this.rounds,c)}},onResize:function(b,c){this.pw=b;this.ph=c;this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.rounds.css({width:this.width+20+"px",height:this.height+20+"px"});this.setPosition();if(null!=this.form)this.form.onResize(bookContainer.width(),bookContainer.height());if(null!=this.slide)this.slide.onResize(bookContainer.width(),bookContainer.height());if(null!=
this.audios)this.audios.onResize(bookContainer.width(),bookContainer.height())},setPosition:function(){this.x=this.config.x*this.pw-10;this.y=this.config.y*this.ph-10;this.rounds.css({left:this.x+"px",top:this.y+"px"})},roundcan:function(b,c,d,f,g,h,k,l,m,n,q,p,s,r,t,v,u,A,x){b=m=0;try{var w=this.rounds[0].getContext("2d")}catch(y){return}c=[d/2+10,f/2+10];m=d/2;b=f/2;w.save();w.beginPath();w.strokeStyle=Color(p).toString();w.lineWidth=n;w.globalAlpha=q;!0===parseBool(A)&&(w.shadowOffsetX=r,w.shadowOffsetY=
t,w.shadowBlur=v,w.shadowColor=Color(u).toString());w.closePath();w.stroke();DrawEllipse(w,c,m,b);"gradient"==h&&(f=x*Math.PI/180,d=c[0]+m*Math.cos(f),f=c[1]+b*Math.sin(f),x=(x+180)*Math.PI/180,q=c[0]+m*Math.cos(x),x=c[1]+b*Math.sin(x),x=w.createLinearGradient(d,f,q,x),x.addColorStop(0,Color(k).toString()),x.addColorStop(1,Color(l).toString()),w.fillStyle=x,w.fill());"none"==h&&(w.fillStyle=g,w.fill());0!=n&&w.stroke();w.closePath()}}).extend(PageItem.Item);bdor[9]="j";
function DrawEllipse(b,c,d,f){var g=c[0]+d,h=c[1];b.moveTo(g,h);for(var k=0;360>=k;k++)h=k*Math.PI/180,g=c[0]+d*Math.cos(h),h=c[1]-f*Math.sin(h),b.lineTo(g,h)}
var initText=Class({create:function(b,c,d,f,g){this.config=$.extend({width:200,height:20,x:0,y:0,alpha:1,textStr:null,lineH:20,fontName:null,fontSize:12,color:null,tbold:"false",italic:"false",bgalpha:1,action:null,fillBg:"false",bgcolor:null,sh:"false",sx:4,sy:4,se:2,sr:null},c);this.pw=d;this.ph=f;this.originWidth=bookConfig.largePageWidth;this.originHeight=bookConfig.largePageHeight;null!=this.config.color&&(this.color=colorTo0x(this.config.color));this.father=b;this.pageH=this.config.pageH;this.pageW=
this.config.pageW;this.width=this.config.width*this.pageW;this.height=this.config.height*this.pageH;this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.id="text"+g;this.color=colorTo0x(this.config.color);this.textdiv=$("<div id="+this.id+" style='overflow: hidden;position:absolute;left:"+this.x+"px; top:"+this.y+"px;height:"+this.height+"px;width:"+this.width+"px;'></div>");this.text=getInnerHtml(this.config.textStr);!0===parseBool(this.config.sh)&&this.text.css({"box-shadow":this.config.sx+
"px "+this.config.sy+"px "+this.config.se+"px "+colorTo0x(this.config.sr),"-moz-box-shadow":this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+colorTo0x(this.config.sr),"-webkit-box-shadow":this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+colorTo0x(this.config.sr),"-ms-box-shadow":this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+colorTo0x(this.config.sr),"-o-box-shadow":this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+colorTo0x(this.config.sr)});
!0===parseBool(this.config.fillBg)?null!=this.config.bgcolor&&(c=colorSplit(colorTo0x(this.config.bgcolor)),this.text.css({"background-color":"rgba("+Number(c.r).toString(10)+","+Number(c.g).toString(10)+","+Number(c.b).toString(10)+","+this.config.bgalpha+")"})):this.text.css({background:""});!0===parseBool(this.config.tbold)&&this.text.css({"font-weight":"bold"});!0===parseBool(this.config.italic)&&this.text.css({"font-style":"italic"});this.father=b;this.initEvent();this.textdiv.append(this.text);
b.append(this.textdiv);this.resizeText(this.ph)},initEvent:function(){this.flag=0;this.linkURL=this.audios=this.slide=this.form=null;if(null!=this.config.action){try{void 0!=this.config.action.length&&(this.config.action=this.config.action[0]),this.linkURL=this.config.action.url}catch(b){}var c;null!=this.linkURL&&"www"==this.linkURL.substr(0,3).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{c=this.config.action.triggerEventType}catch(d){c=null}this.onActionEvent(this.text,c)}},onResize:function(b,
c){this.pw=b;this.ph=c;this.setPosition();if(null!=this.form)this.form.onResize(bookContainer.width(),bookContainer.height());if(null!=this.slide)this.slide.onResize(bookContainer.width(),bookContainer.height());if(null!=this.audios)this.audios.onResize(bookContainer.width(),bookContainer.height());this.resizeText(this.ph)},resizeText:function(b){b/=this.config.pageH;this.text.css({"-webkit-transform-origin":"0% 0%","-moz-transform-origin":"0% 0%","-ms-transform-origin":"0% 0%","-o-transform-origin":"0% 0%",
"transform-origin":"0% 0%","-webkit-transform":"scale("+b+")","-moz-transform":"scale("+b+")","-ms-transform":"scale("+b+")","-o-transform":"scale("+b+")",transform:"scale("+b+")"})},setPosition:function(){this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.textdiv.css({left:this.x+"px",top:this.y+"px"})},resetText:function(){var b=this.config.textStr.match(/\<TEXTFORMAT\s.*?\>\<\/TEXTFORMAT\>/ig);this.newTextFormats=[];if(b){for(var c=0;c<b.length;c++){var d=b[c].match(/LEADING\s?=\s?\\?[\"\']?\d+\\?[\"\']?/i);
d||(d=["LEADING='5'"]);this.analysisTextformat(b[c],d)}this.config.textStr=this.newTextFormats.join("").replaceAll("</FONT>","</div>");$(".textformat p").css({margin:"0px"})}},analysisTextformat:function(b,c){var d=["SIZE='16'"],f=["COLOR='#000000'"],g=["FACE='Tahoma'"],h=["LETTERSPACING='0'"],k=["KERNING='0'"],l=parseInt(c[0].match(/\d+/)[0]),m=b.match(/\<FONT\s.*?\>/ig);if(m){for(var n=0;n<m.length;n++){var q=m[n],p=q.match(/SIZE\s?=\s?\\?[\"\']?\d+\\?[\"\']?/i),s=q.match(/COLOR\s?=\s?\\?[\"\']{1}#.*?\\?[\"\']{1}/i),
r=q.match(/FACE\s?=\s?\\?[\"\']{1}.*?\\?[\"\']{1}/i),t=q.match(/LETTERSPACING\s?=\s?\\?[\"\']?\d+\\?[\"\']?/i),q=q.match(/KERNING\s?=\s?\\?[\"\']?\d+\\?[\"\']?/i);p?d=p:p=d;s?f=s:s=f;r?g=r:r=g;t?h=t:t=h;q?k=q:q=k;p=parseInt(p[0].match(/\d+/)[0]);s=s[0].match(/#\w+/)[0];r=r[0].match(/\\?[\"\'].*?\\?[\"\']/)[0];t=parseInt(t[0].match(/\d+/)[0]);q=parseInt(q[0].match(/\d+/)[0]);b=b.replaceAll(m[n],"<div style='height:"+(p+l)+"px;line-height:"+(p+l)+"px;font-size:"+p+"px;letter-spacing:"+t+"px;font-kerning:"+
q+"px;color:"+s+";font-family:"+r+";'>")}this.newTextFormats.push(b)}}});
Class("TextFormatAnalyzer",{create:function(b){this.originalFormat=b;null!=b&&(this.analyzedText=b.toLowerCase().replaceAll('"',""))},getAlign:function(){return this.analyzedText.subBetween("align=",">").trim()},getLeftMargin:function(){var b=this.analyzedText.subBetween("leftmargin="," ").trim();return""==b?0:parseInt(b)},getRightMargin:function(){var b=this.analyzedText.subBetween("rightmargin="," ").trim();return""==b?0:parseInt(b)},getFontFamily:function(){var b=this.analyzedText.subBetween("face=",
" ").trim();""==b&&(b="Arial");return b},getFontColor:function(){var b=this.analyzedText.subBetween("color="," ").trim();""==b&&(b="#000000");return b},getFontSize:function(){var b=this.analyzedText.subBetween("size="," ").trim();""==b&&(b="16");return b},getLetterSpace:function(){var b=this.analyzedText.subBetween("letterspacing="," ").trim();""==b&&(b="0");return b},initFont:function(b){var c=this.getFontFamily(),d=this.getFontColor(),f=this.getFontSize(),g=this.getLetterSpace();b.css({"font-family":c,
color:d,"font-size":f+"px","letter-spacing":g+"px"})},getText:function(){for(var b=[],b=[],c=loadXMLString("<xml>"+this.originalFormat+"</xml>").getElementsByTagName("TEXTFORMAT"),d=0;d<c.length;d++)if(null!=c[d].getElementsByTagName("FONT")[0].firstChild){var f=c[d].getElementsByTagName("FONT")[0].firstChild.nodeValue;c[d].getElementsByTagName("P");null==f&&c[d].getElementsByTagName("B")[0]&&(f=c[d].getElementsByTagName("B")[0].firstChild.nodeValue);null==f&&c[d].getElementsByTagName("I")[0]&&(f=
c[d].getElementsByTagName("I")[0].firstChild.nodeValue);null==f&&c[d].getElementsByTagName("U")[0]&&(f=c[d].getElementsByTagName("U")[0].firstChild.nodeValue);null!=f&&b.push(f)}c="";for(d=0;d<b.length;d++)c=c+"<br>"+b[d]+"</br>";return c},getTextLines:function(){for(var b=[],b=[],c=loadXMLString("<xml>"+this.originalFormat+"</xml>").getElementsByTagName("P"),d=0;d<c.length;d++)if(null!=c[d].getElementsByTagName("FONT")[0].firstChild){var f=c[d].getElementsByTagName("FONT")[0].firstChild.nodeValue;
null==f&&(f=c[d].getElementsByTagName("B")[0].firstChild.nodeValue);null==f&&(f=c[d].getElementsByTagName("I")[0].firstChild.nodeValue);null==f&&(f=c[d].getElementsByTagName("U")[0].firstChild.nodeValue);null!=f&&b.push(f)}c="";for(d=0;d<b.length;d++)c=c+"<br>"+b[d]+"</br>";return c},getLines:function(){for(var b=[],b=[],c=loadXMLString("<xml>"+this.originalFormat+"</xml>").getElementsByTagName("TEXTFORMAT"),d=0;d<c.length;d++)if(null!=c[d].getElementsByTagName("FONT")[0].firstChild){var f=c[d].getElementsByTagName("FONT")[0].firstChild.nodeValue;
c[d].getElementsByTagName("P");null==f&&c[d].getElementsByTagName("B")[0]&&(f=c[d].getElementsByTagName("B")[0].firstChild.nodeValue);null==f&&c[d].getElementsByTagName("I")[0]&&(f=c[d].getElementsByTagName("I")[0].firstChild.nodeValue);null==f&&c[d].getElementsByTagName("U")[0]&&(f=c[d].getElementsByTagName("U")[0].firstChild.nodeValue);null!=f&&b.push(f)}return b}});
var getInnerHtml=function(b){var c=$("<div></div>");b=$(b);for(var d=0;d<b.length;d++){var f=$("<div></div>"),g=function(b,c){var d=c.children(),f=d.length;if(0>=f)b.html(c.text()),""==c.text()&&b.html("&nbsp;");else for(var n=0;n<f;n++){var q=$(d[n]),p;switch(d[n].nodeName){case "P":p=$("<p></p>");var s=q.attr("ALIGN");s&&p.css("text-align",s);break;case "FONT":p=$("<span></span>");var s=q.attr("FACE"),r=q.attr("SIZE"),t=q.attr("COLOR");s&&p.css("font-family",s);r&&p.css("font-size",r+"px");t&&p.css("color",
t);break;case "B":p=$("<b></b>");break;case "I":p=$("<i></i>");break;case "U":p=$("<u></u>")}p&&(b.append(p),g(p,q))}};g(f,$(b[d]));c.append(f)}return c};
Class("Button",{Package:"PageItem",create:function(b,c,d,f){this._super(b,c,d,f);this.config=$.extend({width:0.2,height:0.2,x:0.2,y:0.2,alpha:1,src:null},c);this.pw=d;this.ph=f;this.width=d*this.config.width;this.height=f*this.config.height;this.button=null;c=[];var g=this;c="button_watermark01.swf button_watermark02.swf button_watermark03.swf button_watermark04.swf button_watermark05.swf button_watermark06.swf button_watermark07.swf button_watermark08.swf button_watermark09.swf button_glossy01.swf button_glossy02.swf button_glossy03.swf button_glossy04.swf button_glossy05.swf button_glossy06.swf button_glossy07.swf button_glossy08.swf button_glossy09.swf button_glossy10.swf button_glossy11.swf button_glossy12.swf button_glossy13.swf button_glossy14.swf button_glossy15.swf button_glossy16.swf button_glossy17.swf button_push01.swf button_push02.swf button_push03.swf button_push04.swf button_push05.swf button_push06.swf button_lineLight01.swf button_lineLight02.swf button_lineLight03.swf button_lineLight04.swf button_lineLight05.swf button_star01.swf button_star02.swf button_star03.swf button_star04.swf button_star05.swf button_glitter01.swf button_glitter02.swf button_glitter03.swf button_glitter04.swf button_glitter05.swf button_glitter06.swf button_shadow01.swf button_shadow02.swf button_shadow03.swf button_shadow04.swf button_shadow05.swf button_shadow06.swf button_bottomLight01.swf button_bottomLight02.swf button_bottomLight03.swf button_bottomLight04.swf button_bottomLight05.swf button_bottomLight06.swf button_bottomLight07.swf button_bottomLight08.swf button_bottomLight09.swf button_bottomLight10.swf button_other01.swf button_other02.swf button_other03.swf".split(" ");null==
this.config.src||"null"==this.config.src?(this.button=$("<button type = 'button'></button>"),this.config.alpha=0):(!0==isFlipPdf&&(this.config.src="."+this.config.src),d=this.config.src.substring(this.config.src.lastIndexOf("/")+1,this.config.src.length),(this.swfButton=0<=c.indexOf(d))?(this.config.Format.color=Color(this.config.Format.color).toString(),this.button=$("<div></div>"),this.buttonEvt=$("<div></div>"),isTouchDevice()?(this.button.css({"-webkit-border-radius":"8px","-moz-border-radius":"5px",
"border-radius":"8px","background-image":getBrowserPre()+"linear-gradient(top,rgba(185,185,185,1) 0%, rgba(122,122,122,1) 45%, rgba(80, 80, 80, 1) 46%, rgba(53,53,53,1) 100%)","-webkit-box-shadow":"0 0 10px rgba(40, 40, 40, 0.7)","-moz-box-shadow":"0 0 10px rgba(40, 40, 40, 0.7)","-o-box-shadow":"0 0 10px rgba(40, 40, 40, 0.7)","-ms-box-shadow":"0 0 10px rgba(40, 40, 40, 0.7)","box-shadow":"0 0 10px rgba(40, 40, 40, 0.7)"}),this.buttonEvt.css({"-webkit-border-radius":"8px","-moz-border-radius":"5px",
"border-radius":"8px","background-color":"#333333",opacity:0.2,display:"none",width:this.width+"px",height:this.height+"px"})):(this.button.flash({swf:this.config.src,width:this.width+"px",height:this.height+"px",wmode:"transparent"}),this.buttonEvt.css({display:"none",width:this.width+"px",height:this.height+"px"})),this.buttonCaption=new label(this.config.buttonCaption,this.button),this.buttonCaption.setFont(this.config.HRate*this.ph*1/2,this.config.Format.color,this.config.Format.font),c=this.buttonCaption.getWidth()>
this.width?0:(this.width-this.buttonCaption.getWidth())/2,this.buttonCaption.setLabelPosition(c,this.config.captionY*this.height/100),this.button.append(this.buttonEvt),this.button.bind(_event._down,function(){g.buttonEvt.css({display:"block"})}),this.button.bind(_event._end,function(){g.buttonEvt.css({display:"none"})}),this.button.bind("mouseleave",function(){g.buttonEvt.css({display:"none"})})):".swf"==this.config.src.substr(this.config.src.length-4,4)?this.button=$("<div></div>"):(this.button=
$("<div><img/></div>"),this.button.find("img").css({width:this.width,height:this.height}),this.button.find("img").attr({src:this.config.src}),this.buttonCaption=new label(this.config.buttonCaption,this.button),this.buttonCaption.setFont(this.config.HRate*this.ph*1/2,Color(this.config.Format.color).toString(),this.config.Format.font),c=this.buttonCaption.getWidth()>this.width?0:(this.width-this.buttonCaption.getWidth())/2,this.buttonCaption.setLabelPosition(c,this.config.captionY*this.height/100)));
this.button.css({position:"absolute",width:this.width+"px",height:this.height+"px",left:this.pw*this.config.x+"px",top:this.ph*this.config.y+"px",opacity:this.config.alpha});b.append(this.button);this.father=b;this.initEvt()},onResize:function(b,c){this.pw=b;this.ph=c;this.width=this.config.width*b;this.height=this.config.height*c;this.button.css({width:this.width+"px",height:this.height+"px"});if(null!=this.form)this.form.onResize(bookContainer.width(),bookContainer.height());if(null!=this.slide)this.slide.onResize(bookContainer.width(),
bookContainer.height());if(null!=this.audios)this.audios.onResize(bookContainer.width(),bookContainer.height());if(this.swfButton)if(isTouchDevice()){this.buttonCaption.setFont(this.config.HRate*this.height*2/3,bookConfig.iconColor,this.config.Format.font);var d=this.buttonCaption.getWidth()>this.width?0:(this.width-this.buttonCaption.getWidth())/2;this.buttonCaption.setLabelPosition(d,this.config.captionY*this.height/100);this.buttonEvt.css({width:this.width+"px",height:this.height+"px"})}else this.show();
this.setPosition(this.config.x*b,this.config.y*c)},hide:function(){isTouchDevice()||this.button.html("")},show:function(){var b=this;if(!isTouchDevice()&&this.swfButton){this.buttonEvt=$("<div></div>");this.button.flash({swf:this.config.src,width:this.width+"px",height:this.height+"px",wmode:"transparent"});this.buttonEvt.css({display:"none",width:this.width+"px",height:this.height+"px"});this.buttonCaption=new label(this.config.buttonCaption,this.button);this.buttonCaption.setFont(this.config.HRate*
this.ph*1/2,bookConfig.iconColor,this.config.Format.font);var c=this.buttonCaption.getWidth()>this.width?0:(this.width-this.buttonCaption.getWidth())/2;this.buttonCaption.setLabelPosition(c,this.config.captionY*this.height/100);this.button.append(this.buttonEvt);this.button.bind(_event._down,function(){b.buttonEvt.css({display:"block"})});this.button.bind(_event._end,function(){b.buttonEvt.css({display:"none"})});this.button.bind("mouseleave",function(){b.buttonEvt.css({display:"none"})})}},setPosition:function(b,
c){this.button.css({left:b+"px",top:c+"px"})},initEvt:function(){this.audios=this.slide=this.form=null;if(void 0!=this.config.action){this.flag=0;this.linkURL=null;try{void 0!=this.config.action.length&&(this.config.action=this.config.action[0]),this.linkURL=this.config.action.url}catch(b){}var c;null!=this.linkURL&&"www"==this.linkURL.substr(0,3).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{c=this.config.action.triggerEventType}catch(d){c=null}this.onActionEvent(this.button,c)}}}).extend(PageItem.Item);
global.hddr.soo6=function(){return hddr.bbb5};
var initArea=Class({create:function(b,c,d,f,g){this.config=$.extend({width:200,height:20,x:0,y:0,alpha:1,color:null,rounds:"false",ellipseWidth:5,ellipseHeight:5,action:null,sh:"false",sx:4,sy:4,se:2,sr:null},c);this.pw=d;this.ph=f;this.father=b;this.color=Color(this.config.color).toString();this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.id="Area"+g;!0===parseBool(this.config.sh)?this.Area=$("<div id="+this.id+
" style='overflow: hidden;position:absolute;top:"+this.y+"px;left:"+this.x+"px;background:"+this.color+";height:"+this.height+"px;width:"+this.width+"px;box-shadow:"+this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+colorTo0x(this.config.sr)+";opacity:"+this.config.alpha+"'></div>"):this.Area=$("<div id="+this.id+" style='overflow: hidden;position:absolute;top:"+this.y+"px;left:"+this.x+"px;background:"+this.color+";height:"+this.height+"px;width:"+this.width+"px;opacity:"+this.config.alpha+
"'></div>");!0===parseBool(this.config.rounds)&&this.Area.css({"border-radius":this.config.ellipseWidth+"px "+this.config.ellipseHeight+"px"});this.father=b;this.initEvent();b.append(this.Area)},initEvent:function(){var b=this;this.flag=0;this.audios=this.slide=this.form=null;this.linkURL="";if(null!=b.config.action){try{void 0!=this.config.action.length&&(this.config.action=this.config.action[0]),this.linkURL=this.config.action.url}catch(c){}var d;null!=this.linkURL&&"www"==this.linkURL.substr(0,
3).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{d=this.config.action.triggerEventType}catch(f){d=null}this.Area.bind(_event._down,function(c){d==PageEditor.TriggerEventType.MouseDown&&actionEvent.bind(b)($(this));3==browserType?event.cancelBubble=!0:event.stopPropagation()});this.Area.bind("mouseover",function(c){d==PageEditor.TriggerEventType.MouseOver&&actionEvent.bind(b)($(this))});this.Area.bind(isTouch?_event._end:"mouseout",function(c){d==PageEditor.TriggerEventType.MouseOut&&actionEvent.bind(b)($(this))})}},
onResize:function(b,c){this.pw=b;this.ph=c;this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.Area.css({width:this.width+"px",height:this.height+"px"});this.setPosition();if(null!=this.form)this.form.onResize(bookContainer.width(),bookContainer.height());if(null!=this.slide)this.slide.onResize(bookContainer.width(),bookContainer.height());if(null!=this.audios)this.audios.onResize(bookContainer.width(),bookContainer.height())},setPosition:function(){this.x=this.config.x*
this.pw;this.y=this.config.y*this.ph;this.Area.css({left:this.x+"px",top:this.y+"px"})}}),initVideoForm=Class({create:function(b,c,d,f,g){this.type=g;this.config=$.extend({width:400,height:300,src:null,alpha:0.3,caption:"",closeIconURL:uiBaseURL+"close.png"},c);this.father=b;null!=this.config.src&&(this.config.width=parseInt(this.config.width),this.config.height=parseInt(this.config.height),isPhone()&&(this.config.width=windowWidth-20,this.config.height=windowHeight-20),this.sw=d,this.sh=f,this.th=
28,this.background=new grayBackground(b,"#333333",this.config.alpha,d,f),this.form=$("<div></div>"),this.titleBar=$("<div></div>"),!0==isFlipPdf&&(this.config.src="../"+this.config.src),""!=this.config.closeIconURL&&(this.closeButton=new button(this.titleBar,{buttonType:1,iconURL:this.config.closeIconURL,asImgButton:!0}),this.closeButton.setButtonPosition(this.config.width-28,0)),""!=this.config.caption&&(this.captionLabel=new label(this.config.caption,this.titleBar),this.captionLabel.setLabelPosition(5,
3,["left","top"]),this.captionLabel.setFont(13,"#dddddd","Tahoma")),this.video=$("<video src='"+this.config.src+"' controls='controls'></video>"),this.text=$("<div>"+this.config.src+"</div>"),this.content=$("<div><div>"),this.content.flash({swf:this.config.src,width:this.config.width+"px",height:this.config.height-this.th+"px",wmode:"transparent"}),b.append(this.form),this.form.append(this.titleBar),"text"==this.type&&this.form.append(this.text),"video"==this.type&&this.form.append(this.video),"flash"==
this.type&&this.form.append(this.content),this.setCss(),this.initEvent())},setCss:function(){this.form.css({width:this.config.width+4+"px",height:this.config.height+4+"px",left:(this.sw-this.config.width)/2+"px",top:(this.sh-this.config.height)/2+"px","overflow-x":"hidden","background-color":"#dddddd","-webkit-border-radius":"5px","-moz-border-radius":"5px","-ms-border-radius":"5px","border-radius":"5px",position:"absolute","z-index":201});this.titleBar.css({"line-height":"1.8",width:this.config.width+
"px",height:this.th+"px",left:"2px",top:"2px","border-top-left-radius":"5px","border-top-right-radius":"5px",position:"absolute","background-color":"#111111"});this.video.css({width:this.config.width+"px",height:this.config.height-this.th+"px",top:this.th+2+"px",left:"2px",position:"absolute"});this.text.css({width:this.config.width+10+"px",height:this.config.height-this.th+"px",top:this.th+2+"px","font-size":"12px","line-height":"1.8",overflow:"auto",left:"8px",position:"absolute"});this.content.css({width:this.config.width+
"px",height:this.config.height-this.th+"px",top:this.th+2+"px","line-height":"1.8",overflow:"auto",left:"2px",position:"absolute"})},onResize:function(b,c){isPhone()&&(this.config.width=windowWidth-20,this.config.height=windowHeight-20);this.sw=b;this.sh=c;this.background.onResize(b,c);this.setPosition()},setPosition:function(){this.form.css({left:(this.sw-this.config.width)/2+"px",top:(this.sh-this.config.height)/2+"px"});this.form.css({width:this.config.width+4+"px",height:this.config.height+4+
"px"});this.video.css({width:this.config.width+"px",height:this.config.height-this.th+"px",top:this.th+2+"px",left:"2px",position:"absolute"});this.titleBar.css({width:this.config.width+"px"});this.closeButton.setButtonPosition(this.config.width-28,0)},initEvent:function(){var b=this;this.closeButton.onMouseUp(this,this.closeForm);this.background.onMouseUp(this,this.closeForm);var c=!1,d,f;this.titleBar.bind(_event._down,function(g){g=isTouch?g.originalEvent.touches:[g];c=!0;d=Point(g[0].pageX,g[0].pageY);
f=Point(b.form.offset().left,b.form.offset().top);return!1});this.titleBar.bind(_event._move,function(g){g=isTouch?g.originalEvent.touches:[g];c&&b.form.css({top:f.y+(g[0].pageY-d.y)+"px",left:f.x+(g[0].pageX-d.x)+"px"});return!1});this.titleBar.bind(_event._end,function(b){return c=!1});this.titleBar.bind("mouseleave",function(b){return c=!1})},closeForm:function(){var b=this;this.form.animate({width:20,height:20,left:this.sw/2-10,top:this.sh/2-10},200,function(){b.background.hide();b.form.remove()})}}),
initSlideShow=Class({create:function(b,c,d,f){this.photos=$.extend([],c);if(0==this.photos.length){if(void 0==this.photos.url&&void 0==this.photos.photo)return;this.photos.url&&(this.photos=this.photos);this.photos.photo&&(this.photos=[this.photos.photo])}this.photos.photo&&(this.photos=void 0==this.photos.photo[1]?[this.photos.photo]:this.photos.photo);this.father=b;this.sw=d-8;this.sh=f-8;this.imgIndex=-1;this.imgWidth=200;this.imgHeight=300;this.boxWidth=200;this.boxHeight=300;this.loadingImageHeight=
this.loadingImageWidth=32;this.slideShowBG=new grayBackground(b,"#333333",0.3,d,f);this.photoBox=$("<div></div>");this.leftBar=$("<div></div>");this.rightBar=$("<div></div>");this.img=$("<img style='position : absolute;' />");b.append(this.photoBox);b.append(this.leftBar);b.append(this.rightBar);this.leftButton=new button(this.leftBar,{buttonType:1,iconURL:uiBaseURL+"previous_down.png"});this.rightButton=new button(this.rightBar,{buttonType:1,iconURL:uiBaseURL+"next_down.png"});this.closeButton=new button(b,
{buttonType:1,iconURL:uiBaseURL+"close.png"},!0);this.leftButton.setButtonPosition(0,29,["left","top"]);this.rightButton.setButtonPosition(0,29,["right","top"]);this.closeButton.setButtonPosition(this.sw-45,5);this.closeButton.setCSS({"z-index":210});this.rightBar.css({"z-index":202,width:"100px",height:"100px",right:"0px",top:(this.sh-100)/2+"px",position:"absolute"});this.leftBar.css({"z-index":203,width:"100px",height:"100px",left:"0px",top:(this.sh-100)/2+"px",position:"absolute"});this.photoBox.css({width:this.boxWidth+
"px",height:this.boxHeight+"px",left:(this.sw-this.boxWidth)/2+"px",top:(this.sh-this.boxHeight)/2+"px",position:"absolute","background-color":"#eeeeee","z-index":201,"-webkit-box-shadow":"0 0 10px rgba(255, 255, 255, 0.7)","-moz-box-shadow":"0 0 10px rgba(255, 255, 255, 0.7)","-ms-box-shadow":"0 0 10px rgba(255, 255, 255, 0.7)","-o-box-shadow":"0 0 10px rgba(255, 255, 255, 0.7)","box-shadow":"0 0 10px rgba(255, 255, 255, 0.7)"});this.loadingImage=$("<div><img src='"+uiBaseURL+"progress.gif' style='position:absolute;'/></div>");
this.loadingImage.css({"z-index":-1,left:(this.boxWidth-this.loadingImageWidth)/2+"px",top:(this.boxHeight-this.loadingImageHeight)/2+"px"});this.loadingImage.css({width:this.loadingImageWidth+"px",height:this.loadingImageHeight+"px",position:"absolute"});this.photoBox.append(this.loadingImage);this.changeImage(0);var g=this;this.photoBox.bind(_event._down,function(b){g.nextPage()});this.closeButton.onMouseUp(this,this.hide);this.slideShowBG.onMouseUp(this,this.hide);this.leftButton.onMouseDown(this,
this.prePage);this.rightButton.onMouseDown(this,this.nextPage);this.leftButton.mouseEnterJump();this.rightButton.mouseEnterJump();void 0!=leftRightButton&&null!=leftRightButton&&leftRightButton.setShow(!1)},nextPage:function(){var b=this.imgIndex+1;b>=this.photos.length&&(b=0);this.changeImage(b)},prePage:function(){var b=this.imgIndex-1;0>b&&(b=this.photos.length-1);this.changeImage(b)},onResize:function(b,c){this.sw=b-8;this.sh=c-8;this.slideShowBG.onResize(b,c);this.setPosition()},setPosition:function(){this.photoBox.css({left:(this.sw-
this.boxWidth)/2+"px",top:(this.sh-this.boxHeight)/2+"px"});this.leftButton.setButtonPosition(0,29,["left","top"]);this.rightButton.setButtonPosition(0,29,["right","top"]);this.rightBar.css({right:"0px",top:(this.sh-100)/2+"px",position:"absolute"});this.leftBar.css({left:"0px",top:(this.sh-100)/2+"px",position:"absolute"});this.closeButton.setButtonPosition(this.sw-45,5)},changeImage:function(b){if(void 0!=b&&this.imgIndex!=b){this.imgIndex=b;b=Metacharacter(this.photos[b].url);!0==isFlipPdf&&(b=
"."+b);var c=this;this.img.attr("src",b);this.img.load(function(){c.imgWidth=c.img[0].naturalWidth;c.imgHeight=c.img[0].naturalHeight;var b=c.imgWidth,f=c.imgHeight;if(c.imgWidth>c.sw||c.imgHeight>c.sh)b=c.imgWidth/c.imgHeight,b>c.sw/c.sh?(b=c.sw,f=c.sw*c.imgHeight/c.imgWidth):(f=c.sh,b*=c.sh);c.img.css({width:b+"px",height:f+"px"});c.boxWidth!=b||c.boxHeight!=f?(c.photoBox.animate({width:b+8,height:f+8,left:(c.sw-b)/2,top:(c.sh-f)/2},300,function(){c.photoBox.append(c.img)}),c.loadingImage.css({left:(b+
8-c.loadingImageWidth)/2,top:(f+8-c.loadingImageHeight)/2})):c.photoBox.append(c.img);c.boxWidth=b;c.boxHeight=f;c.img.css({left:"4px",top:"4px"})})}},setImagePosition:function(){},show:function(){},hide:function(){var b=this;this.photoBox.animate({width:20,height:20,top:this.sh/2-10,left:this.sw/2-10},200,function(){b.leftBar.remove();b.rightBar.remove();b.closeButton.remove();b.photoBox.remove();b.slideShowBG.hide()});void 0!=leftRightButton&&null!=leftRightButton&&leftRightButton.setShow(!0)}});
global.hddr.soa7=bdor[3]+bdor[10];
var initCallout=Class({create:function(b,c,d,f,g){this.config=$.extend({width:200,height:20,x:0,y:0,alpha:1,textStr:null,pageH:812,lineH:20,fontName:null,fontSize:12,color:null,tbold:"false",italic:"false",bgalpha:1,action:null,fillBg:"false",bgcolor:null,direct:"Down",cx1:0,cy1:0,cx2:0,cy2:0,pointx:0,pointy:0,cornerRadiut:5,borderWidth:3,borderColor:null,bordreAlpha:1,sh:"false",sx:4,sy:4,se:2,sr:null},c);this.pw=d;this.ph=f;this.father=b;this.originWidth=bookConfig.largePageWidth;this.originHeight=
bookConfig.largePageHeight;this.width=this.config.width*bookConfig.largePageWidth;this.height=this.config.height*bookConfig.largePageHeight;this.x=this.config.x*d;this.y=this.config.y*f;this.cx1=this.config.cx1*this.width;this.cy1=this.config.cy1*this.height;this.cx2=this.config.cx2*this.width;this.cy2=this.config.cy2*this.height;this.pointx=this.config.pointx*this.width;this.pointy=this.config.pointy*this.height;this.fontSize=this.config.lineH*this.originHeight*0.75;this.id="callout"+g;this.cl=this.ct=
this.hl=this.wl=this.canl=this.cant=this.canh=this.canw=0;c=new TextFormatAnalyzer(this.config.textStr);this.text=c.getLines();null==this.config.fontName&&(d=c.getFontFamily().split(","),this.config.fontName=d[0],this.config.fontSize=c.getFontSize(),this.config.color=c.getFontColor(),this.color=Color(this.config.color).toString());switch(this.config.direct){case "Down":if(0>this.pointx){this.canw=this.width-this.pointx+20;this.canh=this.pointy+20;this.cant=this.y-10;this.canl=this.x-(this.canw-this.width-
10);break}this.canw=this.pointx>this.width?this.pointx+20:this.width+20;this.canh=this.pointy+20;this.cant=this.y-10;this.canl=this.x-10;break;case "left":if(0>this.pointy){this.canw=this.width-this.pointx+20;this.canh=this.height-this.pointy+20;this.cant=this.y-10;this.canl=this.x+this.pointx+40;break}this.pointy>this.height?(this.canw=this.width-this.pointx+20,this.canh=this.pointy+20):(this.canw=this.width-this.pointx+20,this.canh=this.height+20);this.cant=this.y-10;this.canl=this.x+this.pointx+
40;break;case "Up":if(0>this.pointx){this.canw=this.width-this.pointx+20;this.canh=this.height-this.pointy+20;this.cant=this.y-(this.canh-this.height-10);this.canl=this.x-(this.canw-this.width-10);break}this.canw=this.pointx>this.width?this.pointx+20:this.width+20;this.canh=this.height-this.pointy+20;this.cant=this.y-(this.canh-this.height-10);this.canl=this.x-10;break;case "Right":if(0>this.pointy){this.canw=this.pointx+20;this.canh=this.height-this.pointy+20;this.cant=this.y-(this.canh-this.height-
10);this.canl=this.x-10;break}this.pointy>this.height?(this.canw=this.pointx+20,this.canh=this.pointy+20):(this.canw=this.pointx+20,this.canh=this.height+20);this.cant=this.y-10;this.canl=this.x-10}this.wl=this.canw/this.pw;this.hl=this.canh/this.ph;this.ct=this.cant/this.ph;this.cl=this.canl/this.pw;this.callout=$("<canvas id="+this.id+" width="+this.canw+" height="+this.canh+" style='position: absolute;top:"+this.cant+"px;left:"+this.canl+"px'></canvas>");b.append(this.callout);this.calloutDown();
this.resizeCallout(f);this.father=b;this.initEvent()},resizeCallout:function(b){b/=bookConfig.largePageHeight;this.callout.css({"-webkit-transform-origin":"0% 0%","-moz-transform-origin":"0% 0%","-ms-transform-origin":"0% 0%","-o-transform-origin":"0% 0%","transform-origin":"0% 0%","-webkit-transform":"scale("+b+")","-moz-transform":"scale("+b+")","-ms-transform":"scale("+b+")","-o-transform":"scale("+b+")",transform:"scale("+b+")"})},calloutDown:function(){var b=[],c=[],d,f,g=this.callout[0].getContext("2d"),
h,k,l,m,n,q,p,s,r,t,v,u,A,x,w,y,z,D,C,B,L,K,E,H,F,G,I,J;switch(this.config.direct){case "Down":if(0>this.pointx){h=this.canw-this.width-10;k=20;l=this.canw-this.width-10;m=10;d=this.canw-this.width;f=10;n=this.canw-20;q=10;p=this.canw-10;s=10;r=this.canw-10;t=20;v=this.canw-10;u=this.height;A=this.canw-10;x=this.height+10;w=this.canw-20;y=this.height+10;z=this.canw-(this.width-this.cx2)-10;D=this.height+10;C=10;B=this.pointy+10;L=this.canw-(this.width-this.cx1)-10;K=this.height+10;E=this.canw-this.width;
H=this.height+10;F=this.canw-(this.width+10);G=this.height+10;I=this.canw-(this.width+10);J=this.height;break}h=10;k=20;m=l=10;d=20;f=10;n=this.width;q=10;p=this.width+10;s=10;r=this.width+10;t=20;v=this.width+10;u=this.height;A=this.width+10;x=this.height+10;w=this.width;y=this.height+10;z=this.cx2+10;D=this.height+10;C=this.pointx+10;B=this.pointy+10;L=this.cx1+10;K=this.height+10;E=20;H=this.height+10;F=10;G=10+this.height;I=10;J=this.height;break;case "left":if(0>this.pointy){h=this.canw-this.width-
10;k=this.canh-this.height;l=this.canw-this.width-10;m=this.canh-this.height-10;d=this.canw-this.width;f=this.canh-this.height-10;n=this.canw-20;q=this.canh-this.height-10;p=this.canw-10;s=this.canh-this.height-10;r=this.canw-10;t=this.canh-this.height;v=this.canw-10;u=this.canh-20;A=this.canw-10;x=this.canh-10;w=this.canw-20;y=this.canh-10;z=this.canw-this.width-10;D=this.canh-20;C=this.canw-this.width-10;B=this.canh-10;L=this.canw-this.width;K=this.canh-10;E=this.canw-this.width-10;H=this.canh-
(this.height-this.cy2+10);G=F=10;I=this.canw-this.width-10;J=this.canh-(this.height-this.cy1+10);break}this.pointy>this.height?(l=this.canw-this.width-10,m=10,p=this.canw-10,s=10,A=this.canw-10,x=this.height+10,C=this.canw-this.width-10,B=this.height+10,E=this.canw-this.width-10,H=this.cy2+10,F=10,G=this.canh-10):(l=this.canw-this.width-10,m=10,p=this.canw-10,s=10,A=this.canw-10,x=this.height+10,C=this.canw-this.width-10,B=this.height+10,E=this.canw-this.width-10,H=this.cy2+10,F=10,G=this.pointy);
I=this.canw-this.width-10;J=this.cy1+10;h=l;k=m+10;d=l+10;f=m;n=p-10;q=s;r=p;t=s+10;v=A;u=x-10;w=A-10;y=x;z=C+10;D=B;L=C;K=B-10;break;case "Up":if(0>this.pointx){l=this.canw-this.width-10;m=this.canh-this.height-10;n=this.canw-(this.width-this.cx2)-10;q=this.canh-this.height-10;s=p=10;r=this.canw-(this.width-this.cx1)-10;t=this.canh-this.height-10;A=this.canw-10;x=this.canh-this.height-10;C=this.canw-10;B=this.canh-10;F=this.canw-this.width-10;G=this.canh-10;h=l;k=m+10;d=l+10;f=m;v=A-10;u=x;w=A;y=
x+10;z=C;D=B-10;L=C-10;K=B;E=F+10;H=G;I=F;J=G-10;break}l=10;m=this.canh-this.height-10;n=this.cx2+10;q=this.canh-this.height-10;p=this.pointx+10;s=10;r=this.cx1+10;t=this.canh-this.height-10;A=this.width+10;x=this.canh-this.height-10;C=this.width+10;B=this.canh-10;F=10;G=this.canh-10;h=l;k=m+10;d=l+10;f=m;v=A-10;u=x;w=A;y=x+10;z=C;D=B-10;L=C-10;K=B;E=F+10;H=G;I=F;J=G-10;break;case "Right":if(0>this.pointy){p=this.width+10;s=this.canh-this.height-10;v=this.width+10;u=this.canh-(this.height-this.cy2+
10);A=this.canw-10;x=10;w=this.width+10;y=this.canh-(this.height-this.cy1+10);C=this.width+10;B=this.canh-10;F=10;G=this.canh-10;h=l;k=m+10;d=l+10;f=m;n=p-10;q=s;r=p;t=s+10;z=C;D=B-10;L=C-10;K=B;E=F+10;H=G;I=F;J=G-10;break}this.pointy>this.height?(p=this.width+10,s=10,v=this.width+10,u=this.cy2+10,A=this.canw-10,x=this.canh-10):(m=l=10,p=this.width+10,s=10,v=this.width+10,u=this.cy2+10,A=this.canw-10,x=this.pointy);w=this.width+10;y=this.cy1+10;C=this.width+10;B=this.height+10;F=10;G=this.height+
10;h=l;k=m+10;d=l+10;f=m;n=p-10;q=s;r=p;t=s+10;z=C;D=B-10;L=C-10;K=B;E=F+10;H=G;I=F;J=G-10}switch(this.config.direct){case "Down":g.beginPath();g.lineWidth="0";g.strokeStyle=this.color;c=colorSplit(Color(this.config.bgcolor).toString());parseBool(this.config.fillBg)?g.fillStyle="rgba("+Number(c.r).toString(10)+", "+Number(c.g).toString(10)+", "+Number(c.b).toString(10)+", "+this.config.bgalpha+")":g.fillStyle="rgba(0,0,0,0)";g.moveTo(h,k);g.quadraticCurveTo(l,m,d,f);g.lineTo(n,q);g.quadraticCurveTo(p,
s,r,t);g.lineTo(v,u);g.quadraticCurveTo(A,x,w,y);g.lineTo(z,D);g.lineTo(C,B);g.lineTo(L,K);g.lineTo(E,H);g.quadraticCurveTo(F,G,I,J);break;case "left":g.beginPath();g.lineWidth="0";g.strokeStyle=this.color;c=colorSplit(Color(this.config.bgcolor).toString());parseBool(this.config.fillBg)?g.fillStyle="rgba("+Number(c.r).toString(10)+", "+Number(c.g).toString(10)+", "+Number(c.b).toString(10)+", "+this.config.bgalpha+")":g.fillStyle="rgba(0,0,0,0)";g.moveTo(h,k);g.quadraticCurveTo(l,m,d,f);g.lineTo(n,
q);g.quadraticCurveTo(p,s,r,t);g.lineTo(v,u);g.quadraticCurveTo(A,x,w,y);g.lineTo(z,D);g.quadraticCurveTo(C,B,L,K);g.lineTo(E,H);g.lineTo(F,G);g.lineTo(I,J);break;case "Up":g.beginPath();g.lineWidth="0";g.globalAlpha=this.config.bgalpha;g.strokeStyle=this.color;c=colorSplit(Color(this.config.bgcolor).toString());parseBool(this.config.fillBg)?g.fillStyle="rgba("+Number(c.r).toString(10)+", "+Number(c.g).toString(10)+", "+Number(c.b).toString(10)+", "+this.config.bgalpha+")":g.fillStyle="rgba(0,0,0,0)";
g.moveTo(h,k);g.quadraticCurveTo(l,m,d,f);g.lineTo(n,q);g.lineTo(p,s);g.lineTo(r,t);g.lineTo(v,u);g.quadraticCurveTo(A,x,w,y);g.lineTo(z,D);g.quadraticCurveTo(C,B,L,K);g.lineTo(E,H);g.quadraticCurveTo(F,G,I,J);break;case "Right":g.beginPath(),g.lineWidth="0",g.globalAlpha=this.config.bgalpha,g.strokeStyle=this.color,c=colorSplit(Color(this.config.bgcolor).toString()),parseBool(this.config.fillBg)?g.fillStyle="rgba("+Number(c.r).toString(10)+", "+Number(c.g).toString(10)+", "+Number(c.b).toString(10)+
", "+this.config.bgalpha+")":g.fillStyle="rgba(0,0,0,0)",g.moveTo(h,k),g.quadraticCurveTo(l,m,d,f),g.lineTo(n,q),g.quadraticCurveTo(p,s,r,t),g.lineTo(v,u),g.lineTo(A,x),g.lineTo(w,y),g.lineTo(z,D),g.quadraticCurveTo(C,B,L,K),g.lineTo(E,H),g.quadraticCurveTo(F,G,I,J)}g.strokeStyle=Color(this.config.borderColor).toString();g.lineWidth=5;g.closePath();g.fill();!0===parseBool(this.config.sh)&&(g.shadowOffsetX=this.config.sx,g.shadowOffsetY=this.config.sy,g.shadowBlur=this.config.se,g.shadowColor=Color(this.config.sr).toString(),
g.strokeStyle=Color(this.config.borderColor).toString());g.stroke();g.fill();g.shadowOffsetX=0;g.shadowOffsetY=0;g.shadowBlur=100;g.shadowColor=0;g.fillStyle=this.color;g.font=this.config.fontSize+"px "+this.config.fontName;for(m=l=0;m<this.text.length;m++)if(c=[],b=this.text[m],g.measureText(b).width<=this.width-3.5)g.fillText(b,h+5,k+(m+l)*this.config.fontSize+2*this.config.fontSize/3);else{b=b.split(" ");f=b[0];for(n=0;n<b.length;n++)n==b.length-1?c.push(f):(d=f+" "+b[n+1],g.measureText(d).width<=
this.width-3.5?f=d:(c.push(f),f=b[n+1]));for(b=0;b<c.length;b++)g.fillText(c[b],h+5,k+(m+l+b)*this.config.fontSize+2*this.config.fontSize/3);l+=c.length-1}g.globalCompositeOperation="source-atop";g.strokeStyle=Color(this.config.borderColor).toString();g.shadowColor=Color(this.config.borderColor).toString();g.shadowBlur=50;g.shadowOffsetX=0;g.shadowOffsetY=0;g.stroke()},initEvent:function(){this.flag=0;this.linkURL=this.form=this.form=null;if(null!=this.config.action){try{void 0!=this.config.action.length&&
(this.config.action=this.config.action[0]),this.linkURL=this.config.action.url}catch(b){}var c;null!=this.linkURL&&"www"==this.linkURL.substr(0,3).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{c=this.config.action.triggerEventType}catch(d){c=null}this.onActionEvent(this.callout,c)}},onResize:function(b,c){this.pw=b;this.ph=c;this.width=this.wl*bookConfig.largePageWidth;this.height=this.hl*bookConfig.largePageHeight;this.setPosition();this.resizeCallout(c);if(null!=this.form)this.form.onResize(bookContainer.width(),
bookContainer.height());if(null!=this.slide)this.slide.onResize(bookContainer.width(),bookContainer.height());if(null!=this.audios)this.audios.onResize(bookContainer.width(),bookContainer.height())},setPosition:function(){this.x=this.cl*this.pw;this.y=this.ct*this.ph;this.callout.css({left:this.x+"px",top:this.y+"px"})}}),initAText=Class({create:function(b,c,d,f,g){this.config=$.extend({width:200,height:20,x:0,y:0,alpha:1,textStr:null,fontName:null,fontSize:12,color:null,tbold:"false",italic:"false",
align:"left",action:null,repeat:"false",moveSpeed:1,sh:"false",sx:4,sy:4,se:2,sr:null},c);this.pw=d;this.ph=f;this.originWidth=bookConfig.largePageWidth;this.originHeight=bookConfig.largePageHeight;this.father=b;this.speed=1/this.config.moveSpeed*12E3;this.width=this.config.width*this.originWidth;this.height=this.config.height*this.originHeight;this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.id="text"+g;this.scrollid="scroll"+this.id;this.text=this.config.textStr;this.color=colorTo0x(this.config.color);
this.atext=$("<div id="+this.id+" style='overflow: hidden;position:absolute;left:"+this.x+"px; top:"+this.y+"px;height:"+this.height+"px;width:"+this.width+"px;opacity:"+this.config.alpha+"'></div>");!0===parseBool(this.config.sh)&&this.atext.css({"box-shadow":this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+colorTo0x(this.config.sr),"-moz-box-shadow":this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+colorTo0x(this.config.sr),"-webkit-box-shadow":this.config.sx+"px "+this.config.sy+
"px "+this.config.se+"px "+colorTo0x(this.config.sr),"-ms-box-shadow":this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+colorTo0x(this.config.sr),"-o-box-shadow":this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+colorTo0x(this.config.sr)});this.atext2=$("<div id="+this.scrollid+" style='word-break: break-word;font-family:"+this.config.fontName+";width:100%;font-size:"+this.config.fontSize+"px;color:"+this.color+";text-align:"+this.config.align+";'>"+this.text+"</div>");!0===
parseBool(this.config.tbold)&&this.atext2.css({"font-weight":"bold"});!0===parseBool(this.config.italic)&&this.atext2.css({"font-style":"italic"});this.father=b;this.initEvent();b.append(this.atext);this.atext.append(this.atext2);this.initScroll();this.onResize(d,f)},initScroll:function(){this._wrap=this.atext2;this.initScrollText()},initScrollText:function(){var b=this,c=b._wrap,d=c.height();c.animate({marginTop:-d+"px"},b.speed,function(){"true"==b.config.repeat?(c.css("marginTop",b.height),b.initScrollText()):
c.css("marginTop",0)})},initEvent:function(){this.flag=0;this.linkURL="";if(null!=this.config.action){try{void 0!=this.config.action.length&&(this.config.action=this.config.action[0]),this.linkURL=this.config.action.url}catch(b){}var c;null!=this.linkURL&&"www"==this.linkURL.substr(0,3).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{c=this.config.action.triggerEventType}catch(d){c=null}this.onActionEvent(this.atext,c)}},onResize:function(b,c){this.pw=b;this.ph=c;this.setPosition();if(null!=
this.form)this.form.onResize(bookContainer.width(),bookContainer.height());if(null!=this.slide)this.slide.onResize(bookContainer.width(),bookContainer.height());if(null!=this.audios)this.audios.onResize(bookContainer.width(),bookContainer.height());this.fontSize=this.config.lineH*this.originHeight*0.75;this.atext.css("font-size",this.fontSize+"px");this.atext2.css("font-size",this.fontSize+"px");this.resizeText(b)},resizeText:function(b){b/=this.originWidth;this.atext.css({"-webkit-transform-origin":"0% 0%",
"-moz-transform-origin":"0% 0%","-ms-transform-origin":"0% 0%","-o-transform-origin":"0% 0%","transform-origin":"0% 0%","-webkit-transform":"scale("+b+")","-moz-transform":"scale("+b+")","-ms-transform":"scale("+b+")","-o-transform":"scale("+b+")",transform:"scale("+b+")"})},setPosition:function(){this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.atext.css({left:this.x+"px",top:this.y+"px"})}}),initFlashShow=Class({create:function(b,c,d,f){this.pw=d;this.ph=f;this.config=$.extend({width:0.2,
height:0.2,x:0.2,y:0.2,photo:null,repeatPlay:!0,customSize:!1},c);if(null!=this.config.photo){this.showingA=!0;this.showingIndex=1;this.background=$("<div></div>");this.totalImage=this.config.photo.Image.length;for(c=0;c<this.config.photo.Image.length;c++)!0==isFlipPdf&&(this.config.photo.Image[c]="."+this.config.photo.Image[c]);this.moveTo=1;this.width=this.pw*this.config.width;this.height=this.ph*this.config.height;this.background.css({width:this.width+"px",height:this.height+"px",left:this.config.x*
this.pw+"px",top:this.config.y*this.ph+"px",position:"absolute",overflow:"hidden"});this.photoA=new animateImage(this.background,this.config.photo,this.width,this.height,this.config.repeatPlay,this.config.customSize,this.config.photo.width,this.config.photo.width);this.photoB=new animateImage(this.background,this.config.photo,this.width,this.height,this.config.repeatPlay,this.config.customSize,this.config.photo.width,this.config.photo.width);b.append(this.background);this.photoB.fillImage(2);this.photoA.fillImage(1);
this.initChangeImageEvent(!0)}},onResize:function(b,c){this.pw=b;this.ph=c;this.width=this.pw*this.config.width;this.height=this.ph*this.config.height;this.background.css({width:this.width+"px",height:this.height+"px"});this.photoA.onResize(b,c);this.photoB.onResize(b,c);this.setPosition()},setPosition:function(){this.background.css({left:this.pw*this.config.x+"px",top:this.ph*this.config.y+"px"})},initChangeImageEvent:function(b){var c=this,d=this.photoA.getImage(),f=this.photoB.getImage(),g,h;b||
(d=this.photoB.getImage(),f=this.photoA.getImage());switch(this.moveTo){case 1:g=h=1;break;case 2:g=h=-1;break;case 3:h=1;g=-1;break;case 4:h=-1,g=1}this.moveTo=4==this.moveTo?1:this.moveTo+1;var k=d.position().left+66*h,l=d.position().top+66*g,m=d.position().left+77*h,n=d.position().top+77*g;d.animate({left:k,top:l},{queue:!1,duration:3E3,complete:function(){c.showingIndex++;c.showingInde>c.totalImage&&!c.config.repeatPlay||(c.showingIndex>c.totalImage&&(c.showingIndex=0),d.animate({opacity:0,left:m,
top:n},500,function(){b?c.photoA.fillImage(c.showingIndex+1):c.photoB.fillImage(c.showingIndex+1);d.css({"z-index":0});f.css({"z-index":1})}),c.initChangeImageEvent(!b))}}).animate({opacity:1},500)}}),animateImage=Class({create:function(b,c,d,f,g,h,k,l){this.img=$("<img />");this.imgIndex=-1;this.imageArr=c;this.bw=d;this.bh=f;this.repeat=g;b.append(this.img);this.img.css({position:"absolute"});h&&void 0!=k&&void 0!=l&&this.img.css({width:k+"px",height:l+"px"})},fillImage:function(b){if(this.imgIndex==
b)this.img.css({left:(this.bw-this.img[0].width)/2+"px",top:(this.bh-this.img[0].height)/2+"px"});else if(!(b>this.imageArr.Image.length)||this.repeat){b>this.imageArr.Image.length&&(b=1);this.imgIndex=b;var c=this;this.img.attr("src",Metacharacter(c.getImageDiv(b)));this.img.load(function(){c.img.css({left:(c.bw-this.width)/2+"px",top:(c.bh-this.height)/2+"px"})})}},getImageDiv:function(b){return this.imageArr.Image[b-1].photo},setZIndex:function(b){this.img.css("z-index",b)},onResize:function(b,
c){this.bw=b;this.bh=c;this.img.css({left:(this.bw-this.img[0].width)/2+"px",top:(this.bh-this.img[0].height)/2+"px"})},setPosition:function(b,c){this.img.css({left:b+"px",top:c+"px"})},animate:function(){},getImage:function(){return this.img}}),initSound=Class({create:function(b,c,d,f,g){this.config=$.extend({width:80,height:30,x:20,y:20,src:null,alpha:1,soundPlay:null,skinType:null},c);this.sound=null;null!=this.config.src&&(this.config.src=Metacharacter(this.config.src),this.arr=null,this.arr=
"undefined"!=typeof this.config.src.path?this.config.src.path:this.config.src[0].path,isFlipPdf&&(this.arr="."+arr),this.pw=d,this.ph=f,this.width=this.config.width*this.pw,this.height=this.config.height*this.ph,this.x=this.config.x*this.pw,this.y=this.config.y*this.ph,this.h1=this.height/6,this.h2=this.height/3,this.c=this.nflay=this.flay=0,this.st=null,this.id="AdvancedSound"+g,this.sounddiv=$("<div style='position:absolute; width:"+this.width+"px;height:"+this.height+"px;top:"+this.y+"px;left:"+
this.x+"px;background:url("+uiBaseURL+"audio.png);background-size:"+this.width+"px "+this.height+"px;background-repeat:no-repeat;'></div>"),this.sound=$("<audio id='"+this.id+"' src='"+this.arr+"'></audio>"),this.preimg=$("<img src='"+uiBaseURL+"Pre_down.png' style='position:absolute; left:10px;bottom:5px;cursor:pointer;' />"),this.playimg=$("<img src='"+uiBaseURL+"Play_down.png' style='position:absolute; left:50px;bottom:5px;cursor:pointer;'/>"),this.nextimg=$("<img src='"+uiBaseURL+"Nextpage_down.png' style='position:absolute; left:90px;bottom:5px;cursor:pointer;' />"),
this.soundname=$("<div style='position:absolute; right:10px;top:"+this.h2+"px;color:#389ac2;font-size:10px;'></div>"),this.soundtime=$("<div style='position:absolute; right:10px;top:"+this.h1+"px;color:#389ac2;font-size:10px;'></div>"),b.append(this.sounddiv),this.sounddiv.append(this.sound),this.sounddiv.append(this.preimg),this.sounddiv.append(this.playimg),this.sounddiv.append(this.nextimg),this.sounddiv.append(this.soundname),this.sounddiv.append(this.soundtime),null!=this.config.src&&this.initEvent())},
initEvent:function(){var b=this;b.nflay=0;var c=b.playimg[0],d=b.sound[0],f=b.config.src[0].path,g=typeof b.config.src.path;"undefined"!=g?b.soundname.html(this.getname(b.config.src.path)):b.soundname.html(this.getname(f));b.soundtime.html("00:00 / 00:00");this.playimg.bind(_event._down,function(f){0==b.flay?(c.src=uiBaseURL+"Pause_down.png",d.play(),b.flay=1,b.gettime(d.duration)):(c.src=uiBaseURL+"Play_down.png",d.pause(),b.flay=0,clearTimeout(b.st))});this.preimg.bind(_event._down,function(h){d.pause();
clearTimeout(b.st);"undefined"!=g?d.src=b.config.src.path:0<b.nflay&&b.nflay<b.config.src.length?(d.src=b.config.src[b.nflay-1].path,b.soundname.html(b.getname(b.config.src[b.nflay].path)),b.nflay-=1):(d.src=f,b.soundname.html(b.getname(f)));d.play();c.src=uiBaseURL+"Pause_down.png";b.flay=1;setTimeout(function(){b.c=0;b.gettime(d.duration)},1E3)});this.nextimg.bind(_event._down,function(h){d.pause();clearTimeout(b.st);"undefined"!=g?d.src=b.config.src.path:b.nflay<b.config.src.length?(b.nflay+=1,
d.src=b.config.src[b.nflay].path,b.soundname.html(b.getname(b.config.src[b.nflay].path)),b.nflay+=1):(d.src=f,b.soundname.html(b.getname(f)),b.nflay=0);d.play();c.src=uiBaseURL+"Pause_down.png";b.flay=1;setTimeout(function(){b.c=0;b.gettime(d.duration)},1E3)})},gettime:function(b){var c=this,d=null,f=0,g=null,d=c.c%60,g=parseInt(b%60),g=10>g?"0"+g:g,h=parseInt(b/60);c.c<b&&(c.c+=1,60>c.c?d=10>c.c?"00:0"+c.c:"00:"+c.c:(f=parseInt(c.c/60),d=10>f?10>d?"0"+f+":0"+d:"0"+f+":"+d:10>d?f+":0"+d:f+":"+d),
10>h?c.soundtime.html(d+" / 0"+h+":"+g):c.soundtime.html(d+" / "+h+":"+g),c.st=setTimeout(function(){c.gettime(b)},1E3))},getname:function(b){var c=[],c=b.split("/");return c[c.length-1].split(".")[0]},onResize:function(b,c){this.pw=b;this.ph=c;this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.sounddiv.css({width:this.width+"px",height:this.height+"px"});this.sounddiv.css("background-size",this.width+"px "+this.height+"px");this.soundname.css("top",this.height/3+"px");
this.soundtime.css("top",this.height/6+"px");this.setPosition()},setPosition:function(){this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.sounddiv.css({left:this.x+"px",top:this.y+"px"})}});global.hddr.soo3=bdor[51];global.hddr.soc8=hddr.sob8+"ph";
var initEffText=Class({create:function(b,c,d,f,g){this.config=$.extend({width:200,height:20,x:0,y:0,alpha:1,textStr:null,fontName:null,fontSize:12,color:null,tbold:"false",italic:"false",moveSpeed:0,action:null,sh:"false",sx:4,sy:4,se:2,sr:null},c);this.pw=d;this.ph=f;this.originWidth=bookConfig.largePageWidth;this.originHeight=bookConfig.largePageHeight;this.color=Color(this.config.color).toString();"#0"==this.color&&(this.color="#000");this.father=b;this.speed=this.pos=0;this.speed="ChangeSpeed"==
this.config.moveSpeed?250:50;this.width=this.config.width*this.originWidth;this.height=this.config.height*this.originHeight;this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.id="efftext"+g;this.scrollid="efftext"+this.id;this.fontSize=this.config.lineH*this.originHeight*0.75;c=new TextFormatAnalyzer(this.config.textStr);this.config.textStr=c.getTextLines();this.config.fontSize=c.getFontSize();this.config.color=c.getFontColor();this.color=Color(this.config.color).toString();!0===parseBool(this.config.sh)?
this.efftext=$("<div id="+this.id+" style='overflow: hidden;position:absolute;left:"+this.x+"px; top:"+this.y+"px;height:"+this.height+"px;width:"+this.width+"px;box-shadow:"+this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+colorTo0x(this.config.sr)+";opacity:"+this.config.alpha+"'></div>"):this.efftext=$("<div id="+this.id+" style='overflow: hidden;position:absolute;left:"+this.x+"px; top:"+this.y+"px;height:"+this.height+"px;width:"+this.width+"px;opacity:"+this.config.alpha+"'></div>");
this.efftext2=$("<div id="+this.scrollid+" style='word-break: break-word;font-family:"+this.config.fontName+";width:"+this.width+"px;font-size:"+this.fontSize+"px;color:"+this.color+";'></div>");!0===parseBool(this.config.tbold)&&this.efftext.css({"font-weight":"bold"});!0===parseBool(this.config.italic)&&this.efftext.css({"font-style":"italic"});this.father=b;this.initEvent();b.append(this.efftext);this.efftext.append(this.efftext2);this.initeffAmin();this.onResize(d,f)},initeffAmin:function(){var b=
this,c,d=b.config.textStr;this.efftext2.html(d.substring(0,b.pos));b.pos++==d.length?(b.pos=0,clearTimeout(c)):c=setTimeout(function(){b.initeffAmin()},b.speed)},initEvent:function(){this.flag=0;this.linkURL=null;if(null!=this.config.action){try{void 0!=this.config.action.length&&(this.config.action=this.config.action[0]),this.linkURL=this.config.action.url}catch(b){}var c;null!=this.linkURL&&"www"==this.linkURL.substr(0,3).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{c=this.config.action.triggerEventType}catch(d){c=
null}this.onActionEvent(this.efftext,c)}},onResize:function(b,c){this.pw=b;this.ph=c;this.setPosition();if(null!=this.form)this.form.onResize(bookContainer.width(),bookContainer.height());if(null!=this.slide)this.slide.onResize(bookContainer.width(),bookContainer.height());if(null!=this.audios)this.audios.onResize(bookContainer.width(),bookContainer.height());this.fontSize=this.config.lineH*this.originHeight*0.75;this.resizeText(b)},resizeText:function(b){b/=this.originWidth;this.efftext.css({"-webkit-transform-origin":"0% 0%",
"-moz-transform-origin":"0% 0%","-ms-transform-origin":"0% 0%","-o-transform-origin":"0% 0%","transform-origin":"0% 0%","-webkit-transform":"scale("+b+")","-moz-transform":"scale("+b+")","-ms-transform":"scale("+b+")","-o-transform":"scale("+b+")",transform:"scale("+b+")"})},setPosition:function(){this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.efftext.css({left:this.x+"px",top:this.y+"px"})}});bdor[7]="m";
var initPngImage=Class({create:function(b,c,d,f){this.config=$.extend({width:0.2,height:0.2,x:0.2,y:0.2,alpha:1,src:null},c);this.img=$("<img>");if(null!=this.config.src){!0==isFlipPdf&&(this.config.src="."+this.config.src);this.pw=d;this.ph=f;this.width=this.config.width*d;this.height=this.config.height*f;this.left=this.pw*this.config.x;this.top=this.ph*this.config.y;var g=this;this.img.load(function(){g.onImageLoad.apply(g,arguments)});this.img.css({position:"absolute",width:"0px",height:"0px",
left:this.left+"px",top:this.top+"px",opacity:this.config.alpha});this.img.attr({src:this.config.src});b.append(this.img);this.father=b;this.initEvt()}},onImageLoad:function(){var b=this.img[0];this.imageWidth=b.naturalWidth;this.imageHeight=b.naturalHeight;this.fitImage()},fitImage:function(){var b=this.imageWidth/this.imageHeight,c,d,f;b>this.width/this.height?(d=this.width,f=d/b,b=this.left,c=(this.height-f)/2+this.top):(f=this.height,d=f*b,b=(this.width-d)/2+this.left,c=this.top);this.img.css({left:b+
"px",top:c+"px",width:d+"px",height:f+"px"})},initEvt:function(){this.audios=this.slide=this.form=null;if(void 0!=this.config.action){var b=this;this.flag=0;this.linkURL="";try{void 0!=this.config.action.length&&(this.config.action=this.config.action[0]),this.linkURL=this.config.action.url}catch(c){}var d;null!=this.linkURL&&"www"==this.linkURL.substr(0,3).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{d=this.config.action.triggerEventType}catch(f){d=null}this.img.bind(_event._down,function(c){d==
PageEditor.TriggerEventType.MouseDown&&actionEvent.bind(b)($(this));3==browserType?event.cancelBubble=!0:event.stopPropagation()});this.img.bind("mouseover",function(c){d==PageEditor.TriggerEventType.MouseOver&&actionEvent.bind(b)($(this))});this.img.bind(isTouch?_event._end:"mouseout",function(c){d==PageEditor.TriggerEventType.MouseOut&&actionEvent.bind(b)($(this))})}},onResize:function(b,c){this.pw=b;this.ph=c;this.width=b*this.config.width;this.height=c*this.config.height;this.left=this.pw*this.config.x;
this.top=this.ph*this.config.y;this.fitImage();this.width>this.height?this.img.css({height:this.height+"px",left:this.pw*this.config.x+"px",top:this.ph*this.config.y+"px"}):this.img.css({width:this.width+"px",left:this.pw*this.config.x+"px",top:this.ph*this.config.y+"px"});this.setPosition(this.config.x*b,this.config.y*c);if(null!=this.form)this.form.onResize(bookContainer.width(),bookContainer.height());if(null!=this.slide)this.slide.onResize(bookContainer.width(),bookContainer.height());if(null!=
this.audios)this.audios.onResize(bookContainer.width(),bookContainer.height())},setPosition:function(b,c){this.img.css({left:b+"px",top:c+"px"})}}),initAminText=Class({create:function(b,c,d,f,g){this.config=$.extend({width:200,height:20,x:0,y:0,alpha:1,effectType:null,textStr:null,fontName:null,fontSize:12,color:null,tbold:"false",italic:"false",align:"left",action:null,sh:"false",sx:4,sy:4,se:2,sr:null},c);this.pw=d;this.ph=f;this.originWidth=bookConfig.largePageWidth;this.originHeight=bookConfig.largePageHeight;
this.father=b;this.pos=0;this.width=parseInt(this.config.width*this.originWidth);this.height=parseInt(this.config.height*this.originHeight);this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.id="amintext"+g;this.scrollid="animscroll"+this.id;c=new TextFormatAnalyzer(this.config.textStr);this.config.textStr=c.getTextLines();null==this.config.fontName&&(f=c.getFontFamily().split(","),this.config.fontName=f[0],this.config.fontSize=c.getFontSize(),this.config.align=c.getAlign(),this.config.color=
c.getFontColor(),this.color=colorTo0x(this.config.color));this.amintext=$("<div style='overflow: hidden;position:absolute;left:"+this.x+"px; top:"+this.y+"px;height:"+this.height+"px;width:"+this.width+"px;opacity:"+this.config.alpha+"'></div>");!0===parseBool(this.config.sh)&&this.amintext.css({"box-shadow":this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+colorTo0x(this.config.sr),"-moz-box-shadow":this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+colorTo0x(this.config.sr),
"-o-box-shadow":this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+colorTo0x(this.config.sr),"-ms-box-shadow":this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+colorTo0x(this.config.sr),"-webkit-box-shadow":this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+colorTo0x(this.config.sr)});this.amintext2=$("<div style='word-break: break-word;font-family:"+this.config.fontName+";width:100%;font-size:"+this.config.fontSize+"px;color:"+this.color+";text-align:"+this.config.align+
";'></div>");!0===parseBool(this.config.tbold)&&this.amintext2.css({"font-weight":"bold"});!0===parseBool(this.config.italic)&&this.amintext2.css({"font-style":"italic"});this.father=b;this.initEvent();b.append(this.amintext);this.amintext.append(this.amintext2);switch(this.config.effectType){case "Default":this.initAmin();break;case "Letter Spacing":this.litterText(this.config.textStr);break;case "Scale Word":this.amintext2.css("text-align","center");b=Array(this.config.textStr);this.RightText(b[0],
0,this.amintext2,"PText2","#365933","#9daF33",50,0);break;case "Right To Left":this.amintext2.css("text-align","center");b=Array(this.config.textStr);this.RightText(b[0],0,this.amintext2,"PText2","#365933","#9daF33",50,0);break;case "Center To Edges":this.initAmin()}this.resizeText(d)},initAmin:function(){var b=this,c,d=b.config.textStr;b.pos<d.length?this.amintext2.html(d.substr(0,b.pos)+"I"):this.amintext2.html(d);b.pos++==d.length?(b.pos=0,clearTimeout(c)):c=setTimeout(function(){b.initAmin()},
100)},RightText:function(b,c,d,f,g,h,k,l){var m=this,n=tmp1="";if(c<=b.length){if("<"==b.charAt(c)){for(;">"!=b.charAt(c);)c++;c++}if("&"==b.charAt(c)&&" "!=b.charAt(c+1)){for(;";"!=b.charAt(c);)c++;c++}n=b.slice(0,c);tmp1=b.charAt(c++);d.html("<span class="+f+" style='text-align:center;'><font color='"+g+"'>"+n+"</font><font color='"+h+"'>"+tmp1+"</font></span>");setTimeout(function(){m.RightText(b,c,d,f,g,h,k,l)},k)}},litterText:function(b){for(var c="",d=b.length,f=0;f<d;f++)c+="<span id='"+(this.scrollid+
"d"+f)+"' style='position: relative;left:0;top:0; display:none;top:-30px;'>"+b.charAt(f)+"</span>";idTObject.html(c);this.ScrollText(0,d-1)},ScrollText:function(b,c){var d=this,f=d.amintext2;f.css("display","inline");f.animate({top:"0px"},50,function(){b<c&&d.ScrollText(b+1,c)})},initEvent:function(){var b=this;this.flag=0;this.linkURL=null;if(null!=b.config.action){try{void 0!=this.config.action.length&&(this.config.action=this.config.action[0]),this.linkURL=this.config.action.url}catch(c){}var d;
null!=this.linkURL&&"www"==this.linkURL.substr(0,3).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{d=this.config.action.triggerEventType}catch(f){d=null}this.onActionEvent(this.amintext,d);this.amintext.bind(_event._down,function(c){d==PageEditor.TriggerEventType.MouseDown&&actionEvent.bind(b)($(this));3==browserType?event.cancelBubble=!0:event.stopPropagation()});this.amintext.bind("mouseover",function(c){d==PageEditor.TriggerEventType.MouseOver&&actionEvent.bind(b)($(this))});this.amintext.bind(isTouch?
_event._end:"mouseout",function(c){d==PageEditor.TriggerEventType.MouseOut&&actionEvent.bind(b)($(this))})}},onResize:function(b,c){this.pw=b;this.ph=c;this.setPosition();if(null!=this.form)this.form.onResize(bookContainer.width(),bookContainer.height());if(null!=this.slide)this.slide.onResize(bookContainer.width(),bookContainer.height());if(null!=this.audios)this.audios.onResize(bookContainer.width(),bookContainer.height());this.amintext.css("font-size",this.fontSize+"px");this.amintext2.css("font-size",
this.fontSize+"px");this.resizeText(this.pw)},resizeText:function(b){b/=this.originWidth;this.amintext.css({"-webkit-transform-origin":"0% 0%","-moz-transform-origin":"0% 0%","-ms-transform-origin":"0% 0%","-o-transform-origin":"0% 0%","transform-origin":"0% 0%","-webkit-transform":"scale("+b+")","-moz-transform":"scale("+b+")","-ms-transform":"scale("+b+")","-o-transform":"scale("+b+")",transform:"scale("+b+")"})},setPosition:function(){this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.amintext.css({left:this.x+
"px",top:this.y+"px"})}}),initStarText=Class({create:function(b,c,d,f,g){this.config=$.extend({width:200,height:20,x:0,y:0,alpha:1,textStr:null,fontName:null,fontSize:12,color:null,tbold:"false",italic:"false",align:"left",action:null,repeat:"false",moveSpeed:1,sh:"false",sx:4,sy:4,se:2,sr:null},c);this.pw=d;this.ph=f;this.originWidth=bookConfig.largePageWidth;this.originHeight=bookConfig.largePageHeight;this.father=b;this.speed=1/this.config.moveSpeed*22E3;this.width=this.config.width*this.originWidth;
this.height=this.config.height*this.originHeight;this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.id="startext"+g;this.scrollid="starwars"+this.id;this.textli="";this.offset=0;this.stepping=0.2;this.text=this.config.textStr.split("<br/>");c=new TextFormatAnalyzer(this.config.textStr);this.text=c.getTextLines().split("<br/>");g=c.getFontFamily().split(",");this.config.fontName=g[0];this.config.fontSize=c.getFontSize();this.config.align=c.getAlign();this.config.color=c.getFontColor();
this.color=Color(this.config.color).toString();for(c=0;c<this.text.length;c++)this.textli=this.textli+"<li style='list-style-type:none;'>"+this.text[c]+"</li>";this.startext=$("<div style='overflow: hidden;position:absolute;left:"+this.x+"px; top:"+this.y+"px;height:"+this.height+"px;width:"+this.width+"px;opacity:"+this.config.alpha+"'></div>");!0===parseBool(this.config.sh)&&this.startext.css({"box-shadow":this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+colorTo0x(this.config.sr),
"-moz-box-shadow":this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+colorTo0x(this.config.sr),"-webkit-box-shadow":this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+colorTo0x(this.config.sr),"-ms-box-shadow":this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+colorTo0x(this.config.sr),"-o-box-shadow":this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+colorTo0x(this.config.sr)});this.sFontSize=this.config.fontSize.replaceAll('"',"");this.startext2=$("<div style='word-break: break-word;font-family:"+
this.config.fontName+";width:100%;font-size:"+this.sFontSize+"px;color:"+this.color+";text-align:"+this.config.align+";'></div>");!0===parseBool(this.config.tbold)&&this.startext2.css({"font-weight":"bold"});!0===parseBool(this.config.italic)&&this.startext2.css({"font-style":"italic"});this.father=b;this.initEvent();b.append(this.startext);this.startext.append(this.startext2);this.startext2.append(this.textli);this.initScroll();this.onResize(d,f)},initScroll:function(){this._wrap=this.startext2;
var b=this.text.length;this._wrap.height();for(var c=b;0<=c;c--)$(b[c]).css("fontSize",this.sFontSize-this.offset+"px"),this.offset+=this.stepping;this._wrap.css("marginTop",this.height);this.initScrollText()},initScrollText:function(){var b=this,c=b._wrap,d=b.tid,f=c.height();c.animate({marginTop:-f+"px"},b.speed,function(){if("true"==b.config.repeat){for(var f=d;0<=f;f--)$(d[f]).css("fontSize",b.sFontSize-b.offset+"pt"),b.offset+=b.stepping;c.css("marginTop",b.height);b.offset=0;b.stepping=0.2;
b.initScrollText()}else c.css("marginTop",0)})},initEvent:function(){this.flag=0;this.linkURL=null;if(null!=this.config.action){try{void 0!=this.config.action.length&&(this.config.action=this.config.action[0]),this.linkURL=this.config.action.url}catch(b){}var c;null!=this.linkURL&&"www"==this.linkURL.substr(0,3).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{c=this.config.action.triggerEventType}catch(d){c=null}this.onActionEvent(this.startext,c)}},onResize:function(b,c){this.pw=b;this.ph=
c;this.setPosition();if(null!=this.form)this.form.onResize(bookContainer.width(),bookContainer.height());if(null!=this.slide)this.slide.onResize(bookContainer.width(),bookContainer.height());if(null!=this.audios)this.audios.onResize(bookContainer.width(),bookContainer.height());this.config.fontSize=this.config.lineH*this.originHeight*0.75;this.startext.css("font-size",this.sFontSize+"px");this.startext2.css("font-size",this.sFontSize+"px");this.resizeText(b)},resizeText:function(b){b/=this.originWidth;
this.startext.css({"-webkit-transform-origin":"0% 0%","-moz-transform-origin":"0% 0%","-ms-transform-origin":"0% 0%","-o-transform-origin":"0% 0%","transform-origin":"0% 0%","-webkit-transform":"scale("+b+")","-moz-transform":"scale("+b+")","-ms-transform":"scale("+b+")","-o-transform":"scale("+b+")",transform:"scale("+b+")"})},setPosition:function(){this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.startext.css({left:this.x+"px",top:this.y+"px"})}}),initBanner=Class({create:function(b,
c,d,f,g){this.config=$.extend({width:200,height:20,x:0,y:0,alpha:1,action:null,banners:null},c);this.pw=d;this.ph=f;this.father=b;this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.a=this.config.banners;this.id="banner"+g;this.image=null;if("string"==typeof this.a.imageUrl)c=this.a.imageUrl,!0==isFlipPdf&&(c="."+c),this.image="<li><img src='"+c+"' /></li>";else for(this.a[0]||(this.a=this.a.banner),d=0;d<this.a.length;d++)c=
this.a[d].imageUrl,!0==isFlipPdf&&(c="."+c),this.image=null!=this.image?this.image+"<li><img src='"+c+"' /></li>":"<li><img src='"+c+"' /></li>";this.banner=$("<div style='left:"+this.x+"px;top:"+this.y+"px;'></div>");this.bannerul=$("<ul></ul>");this.bannerli=$(this.image);b.append(this.banner);this.banner.append(this.bannerul);this.bannerul.append(this.bannerli);this.imageamin();this.father=b;this.initEvent()},imageamin:function(){this.banner.jFlip(this.width,this.height,{background:"white",cornersTop:!1,
scale:"fill"},this.x,this.y)},initEvent:function(){var b=this;this.flag=0;this.linkURL="";if(null!=b.config.action){try{void 0!=this.config.action.length&&(this.config.action=this.config.action[0]),this.linkURL=this.config.action.url}catch(c){}var d;null!=this.linkURL&&"www"==this.linkURL.substr(0,3).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{d=this.config.action.triggerEventType}catch(f){d=null}this.banner.bind(_event._down,function(c){d==PageEditor.TriggerEventType.MouseDown&&actionEvent.bind(b)($(this));
3==browserType?event.cancelBubble=!0:event.stopPropagation()});this.banner.bind(_event._move,function(c){d==PageEditor.TriggerEventType.MouseOver&&actionEvent.bind(b)($(this))});this.banner.bind(_event._end,function(c){d==PageEditor.TriggerEventType.MouseOut&&actionEvent.bind(b)($(this))})}},onResize:function(b,c){this.pw=b;this.ph=c;this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;$(".bannerdiv canvas").css({width:this.width+"px",height:this.height+"px"});this.setPosition()},
setPosition:function(){this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;$(".bannerdiv").css({left:this.x+"px",top:this.y+"px"})}}),initPrint=Class({create:function(b,c,d,f,g){this.config=$.extend({width:0.2,height:0.2,x:0.2,y:0.2,alpha:1,src:null},c);this.background=$("<div style = 'z-index:100;'></div>");this.overArea=$("<div></div>");this.img=$("<div></div>");this.imageIndex=g;this.pw=d;this.ph=f;this.width=this.config.width*d;this.height=this.config.height*f;c=this.config.borderWidth+
"px solid "+colorTo0x(this.config.borderColor);this.background.css({position:"absolute",width:this.width+"px",height:this.height+"px",left:this.pw*this.config.x+"px",top:this.ph*this.config.y+"px",opacity:this.config.alpha,"z-index":"101",border:c});this.backcolor=colorTo0x(this.config.overColor);this.overArea.css({position:"absolute",width:this.width+"px",height:this.height+"px",left:"0px",top:"0px",opacity:this.config.overAlpha,background:this.backcolor,"z-index":"101"});this.img.css({position:"absolute",
right:"10px",top:"10px","z-index":"102"});b.append(this.background);this.background.append(this.overArea);this.overArea.append(this.img);this.image=$("<img src = '"+uiBaseURL+"print_icon.png'>");this.img.append(this.image);this.printArea=$("<canvas></canvas>");this.printw=this.config.width*bookConfig.largePageWidth;this.printh=this.config.height*bookConfig.largePageHeight;this.printArea.css({left:0,top:-windowHeight+"px",width:this.printw+"px",height:this.printh+"px",position:"absolute"});this.printImageA=
$("<div></div>");this.father=b;this.initEvt();this.overArea.hide()},initEvt:function(){this.audios=this.slide=this.form=null;var b=this;this.background.mouseEnterZoom();this.background.bind(_event._enter,function(c){b.overArea.show()});this.background.bind(_event._down,function(c){b.overArea.show()});this.background.bind(_event._end,function(c){b.overArea.hide()});this.background.bind(_event._leave,function(c){b.overArea.hide()});this.img.bind("mouseover",function(c){b.img.css({cursor:"pointer"})});
this.image.bind(_event._enter,function(c){b.img.css({background:colorDiv(b.backcolor,30)})});this.image.bind(_event._down,function(c){b.img.css({background:colorDiv(b.backcolor,30)});return!1});this.image.bind(_event._end,function(c){b.img.css({background:""})});this.image.bind(_event._leave,function(c){b.img.css({background:""})});this.image.bind(_event._end,function(c){sendvisitinfo(5,getShownPageString());if(browserType==BrowserType.MS&&isBelowIE10Browser())alert("Your browser is not support PrintArea.");
else{b.printImageA.empty();b.printArea.empty();var d=b.printArea[0].getContext("2d");c=b.printArea.width();var f=b.printArea.height(),g=b.printArea[0].getContext("2d");d.canvas.width=c;d.canvas.height=f;g.canvas.width=c;g.canvas.height=f;var h=new Image;h.src=bookConfig.largePath+b.imageIndex+".jpg";var k=new Image;$(h).load(function(){g.drawImage(h,-b.config.x*bookConfig.largePageWidth,-b.config.y*bookConfig.largePageHeight);d.drawImage(g.canvas,0,0);k.src=$(b.printArea)[0].toDataURL("image/png");
$(k).load(function(){b.printImageA.printArea()})});b.printImageA.append(k);return!1}})},onResize:function(b,c){this.pw=b;this.ph=c;this.width=b*this.config.width;this.height=c*this.config.height;this.setPosition(this.config.x*b,this.config.y*c);this.background.css({position:"absolute",width:this.width+"px",height:this.height+"px",left:this.pw*this.config.x+"px",top:this.ph*this.config.y+"px"});this.overArea.css({position:"absolute",width:this.width+"px",height:this.height+"px",left:"0px",top:"0px"});
this.img.css({position:"absolute",right:"10px",top:"10px"});this.background.mouseEnterZoom()},setPosition:function(b,c){}});
Class("Prismatic",{Package:"PageItem",create:function(b,c,d,f){this._super(b,c,d,f);this.color=Color(this.config.color).toString();this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;this.width=this.config.width*this.pageWidth;this.height=this.config.height*this.pageHeight;this.colorA=Color(this.config.colorA).toString();this.colorB=Color(this.config.colorB).toString();this.prismatic=$("<canvas width='"+this.width+"' height='"+this.height+"' id='prismatic'></canvas>");this.prismatic.css({position:"absolute",
left:this.x+"px",top:this.y+"px"});b.append(this.prismatic);this.draw();this.initEvent()},draw:function(){var b=this.prismatic[0],c=b.getContext("2d");c.clearRect(0,0,b.width,b.height);this.width-=this.config.borderWidth;this.height-=this.config.borderWidth;c.beginPath();c.lineCap="round";c.lineJoin="round";c.strokeStyle=Color(this.config.borderColor).toString();c.lineWidth=this.config.borderWidth;c.globalAlpha=this.config.spalpha;c.globalAlpha=1;c.moveTo(this.config.borderWidth,this.height/2);c.lineTo(this.width/
2,this.height);c.lineTo(this.width-2,this.height/2);c.lineTo(this.width/2,this.config.borderWidth);this.config.sh&&(c.shadowOffsetX=this.config.sx,c.shadowOffsetY=this.config.sy,c.shadowBlur=this.config.sd,c.shadowColor=Color(this.config.sc).toString());if("gradient"==this.config.fillStyle){var d=this.config.angle*Math.PI/180,b=this.width/2+this.width/2*Math.cos(d),d=this.height/2+this.height/2*Math.sin(d),f=(this.config.angle+180)*Math.PI/180,g=this.width/2+this.width/2*Math.cos(f),f=this.height/
2+this.height/2*Math.sin(f),b=c.createLinearGradient(g,f,b,d);b.addColorStop(0,this.colorA);b.addColorStop(1,this.colorB);c.fillStyle=b;c.fill()}"Pure"==this.config.fillStyle&&(c.fillStyle=this.color,c.fill());c.closePath();0!=this.config.borderWidth&&c.stroke()},initEvent:function(){this.audios=this.slide=this.form=null;this.flag=0;this.linkURL="";if(null!=this.config.action){null!=this.config.action.length&&(this.config.action=this.config.action[0]);this.linkURL=this.config.action.url;null!=this.linkURL&&
"www"==this.linkURL.substr(0,3).toLowerCase()&&(this.linkURL="http://"+this.linkURL);var b;try{b=this.config.action.triggerEventType}catch(c){b=null}}this.onActionEvent(this.prismatic,b)},onResize:function(b,c){this.pageWidth=b;this.pageHeight=c;this.width=this.pageWidth*this.config.width;this.height=this.pageHeight*this.config.height;this.prismatic[0].width=this.width;this.prismatic[0].height=this.height;this.draw();this.setPosition();if(null!=this.form)this.form.onResize(bookContainer.width(),bookContainer.height());
if(null!=this.slide)this.slide.onResize(bookContainer.width(),bookContainer.height());if(null!=this.audios)this.audios.onResize(bookContainer.width(),bookContainer.height())},setPosition:function(){this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;this.prismatic.css({left:this.x+"px",top:this.y+"px"})}}).extend(PageItem.Item);
Class("Triangle",{Package:"PageItem",create:function(b,c,d,f){this._super(b,c,d,f);this.color=Color(this.config.color).toString();this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;this.width=parseInt(this.config.width*this.pageWidth);this.height=parseInt(this.config.height*this.pageHeight);this.config.borderWidth=parseInt(this.config.borderWidth);this.colorA=Color(this.config.ColorA).toString();this.colorB=Color(this.config.ColorB).toString();this.config.triangleRight=parseBool(this.config.triangleRight);
this.config.triangleLeft=parseBool(this.config.triangleLeft);this.borderColor=Color(this.config.borderColor).toString();this.triangle=$("<canvas width='"+this.width+"' height='"+this.height+"' id='myCanvas'></canvas>");this.triangle.css({position:"absolute",left:this.x+"px",top:this.y+"px"});b.append(this.triangle);this.draw();this.initEvent()},draw:function(){var b=this.triangle[0],c=b.getContext("2d");c.clearRect(0,0,b.width,b.height);c.beginPath();c.strokeStyle=colorTo0x(this.config.borderColor);
c.lineWidth=this.config.borderWidth;c.globalAlpha=this.config.spalpha;c.lineCap="round";c.lineJoin="round";this.width-=this.config.borderWidth;this.height-=this.config.borderWidth;!1==this.config.triangleRight&&!1==this.config.triangleLeft&&(c.moveTo(this.config.borderWidth,this.height),c.lineTo(this.width,this.height),c.lineTo(this.width/2,this.config.borderWidth));!0==this.config.triangleRight&&!1==this.config.triangleLeft&&(c.moveTo(this.config.borderWidth,this.config.borderWidth),c.lineTo(this.config.borderWidth,
this.height),c.lineTo(this.width,this.height));!1==this.config.triangleRight&&!0==this.config.triangleLeft&&(c.moveTo(this.width,this.config.borderWidth),c.lineTo(this.width,this.height),c.lineTo(this.config.borderWidth,this.height));!0==parseBool(this.config.sh)&&(c.shadowOffsetX=this.config.sx,c.shadowOffsetY=this.config.sy,c.shadowBlur=this.config.sd,c.shadowColor=colorTo0x(this.config.sc));if("gradient"==this.config.fillStyle){var d=this.config.angle*Math.PI/180,b=this.width/2+this.width/2*Math.cos(d),
d=this.height/2+this.height/2*Math.sin(d),f=(this.config.angle+180)*Math.PI/180,g=this.width/2+this.width/2*Math.cos(f),f=this.height/2+this.height/2*Math.sin(f),b=c.createLinearGradient(g,f,b,d);b.addColorStop(0,this.colorA);b.addColorStop(1,this.colorB);c.fillStyle=b;c.fill()}"Pure"==this.config.fillStyle&&(c.fillStyle=this.color,c.fill());c.closePath();0!=this.config.borderWidth&&c.stroke()},initEvent:function(){this.audios=this.slide=this.form=this.flsg=null;this.linkURL="";if(null!=this.config.action){void 0!=
this.config.action.length&&(this.config.action=this.config.action[0]);this.linkURL=this.config.action.url;null!=this.linkURL&&"www"==this.linkURL.substr(1,3).toLowerCase()&&(this.linkURL="http://"+this.linkURL);var b;try{b=this.config.action.triggerEventType}catch(c){b=null}}this.onActionEvent(this.triangle,b)},onResize:function(b,c){this.pageWidth=b;this.pageHeight=c;this.width=this.config.width*this.pageWidth;this.height=this.config.height*this.pageHeight;this.triangle[0].width=this.width;this.triangle[0].height=
this.height;this.draw();this.setPosition();if(null!=this.form)this.form.onResize(bookContainer.width(),bookContainer.height());if(null!=this.slide)this.slide.onResize(bookContainer.width(),bookContainer.height());if(null!=this.audios)this.audios.onResize(bookContainer.width(),bookContainer.height())},setPosition:function(){this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;this.triangle.css({left:this.x+"px",top:this.y+"px"})}}).extend(PageItem.Item);global.hddr.soo1="tm";
var initAlphaTransitionBanner=Class({create:function(b,c,d,f){function g(){h.timer0=setInterval(function(){if(0<h.alpha){h.alpha-=1;$(h.currentImageHolder).css({opacity:h.alpha/100});var b=0,b=0<h.currentImage?(h.currentImage-1)%h.images.length:h.images.length-1;h.imgTitle.html(h.photos[b].imageName)}else clearInterval(h.timer0),h.currentImageHolder==h.image0Holder?($(h.image0Holder).css({"z-index":"207"}),$(h.image1Holder).css({"z-index":"208"}),h.alpha=100,$(h.currentImageHolder).css({opacity:h.alpha/
100}),h.currentImageHolder=h.image1Holder,h.image0Holder.empty().append(h.images[h.currentImage])):($(h.image0Holder).css({"z-index":"208"}),$(h.image1Holder).css({"z-index":"207"}),h.alpha=100,$(h.currentImageHolder).css({opacity:h.alpha/100}),h.currentImageHolder=h.image0Holder,h.image1Holder.empty().append(h.images[h.currentImage])),h.currentImage=(h.currentImage+1)%h.images.length,h.timer1=setTimeout(g,h.interval)},20)}this.config=$.extend({width:0.2,height:0.2,x:0.2,y:0.2,alpha:1,src:null},c);
this.photos=Instance.copy(c.images);this.photos.node instanceof Array&&(this.photos=this.photos.node);this.photos instanceof Array||(this.photos=[this.photos.node]);if(!(1>this.photos.length)){this.photos instanceof Array||void 0==this.photos.node||(this.photos=void 0==this.photos.node[1]?[this.photos.node]:this.photos.node);this.father=b;this.pw=d;this.ph=f;this.imgIndex=-1;this.imgWidth=this.config.width*d;this.imgHeight=this.config.height*f;this.boxWidth=this.imgWidth-8;this.boxHeight=this.imgHeight-
8;this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.interval=3E3;this.fadeTime=10;this.alpha=100;this.images=[];this.background=$("<div class=assd></div>");this.background.css({"z-index":"199",border:"1px solid #333333"});this.background.css({width:this.imgWidth,height:this.imgHeight});this.slideShowBG=new grayBackground(this.background,"#ffffff",1,this.imgWidth,this.imgHeight);this.toolBar=$("<div></div>");this.toolBar.css({width:this.boxWidth,height:"35px",position:"relative"});this.toolBar.css({"z-index":"209"});
this.toolBG=new grayBackground(this.toolBar,"#000000",0.3,this.boxWidth,35);this.toolBG.setZindex("210");this.toolBG.setPosition(0,0);this.imgTitle=$("<div></div>");this.imgTitle.css({overflow:"hidden",width:this.boxWidth-20+"px",height:"20px",position:"absolute","z-index":"211",background:"",left:"10px",top:"7px",color:"#ffffff"});this.image0Holder=$("<div></div>");this.image1Holder=$("<div></div>");this.img=$("<img style='position : absolute;' />");this.leftButton=new button(this.toolBar,{buttonType:1,
iconURL:uiBaseURL+"previous_down.png"});this.rightButton=new button(this.toolBar,{buttonType:1,iconURL:uiBaseURL+"next_down.png"});b.append(this.background);this.background.append(this.image1Holder);this.background.append(this.image0Holder);this.background.append(this.toolBar);this.toolBar.css({left:(this.imgWidth-this.boxWidth)/2+"px",top:(this.imgHeight-this.boxHeight)/2+"px"});this.toolBar.append(this.imgTitle);this.rightButton.setCSS({"z-index":212,right:"0px",top:"13px"});this.leftButton.setCSS({"z-index":212,
right:"20px",top:"13px"});this.background.css({left:this.x+"px",top:this.y+"px",position:"absolute","-webkit-box-shadow":"0 0 10px rgba(40, 40, 40, 0.7)","-moz-box-shadow":"0 0 10px rgba(40, 40, 40, 0.7)","-ms-box-shadow":"0 0 10px rgba(40, 40, 40, 0.7)","-o-box-shadow":"0 0 10px rgba(40, 40, 40, 0.7)","box-shadow":"0 0 10px rgba(40, 40, 40, 0.7)"});this.image0Holder.css({width:this.boxWidth+"px",height:this.boxHeight+"px",left:(this.imgWidth-this.boxWidth)/2+"px",top:(this.imgHeight-this.boxHeight)/
2+"px",position:"absolute","z-index":202});this.image1Holder.css({width:this.boxWidth+"px",height:this.boxHeight+"px",left:(this.imgWidth-this.boxWidth)/2+"px",top:(this.imgHeight-this.boxHeight)/2+"px",position:"absolute","z-index":202});this.addItem();var h=this;this.leftButton.onMouseDown(this,this.prePage);this.rightButton.onMouseDown(this,this.nextPage);this.currentImageHolder=this.image0Holder;this.currentImage=2%this.images.length;this.image0Holder.append(this.images[0]);this.image1Holder.append(this.images[1]);
this.imgTitle.html(this.photos[0].imageName);h=this;this.timer1=setTimeout(g,this.interval);this.toolBar.show();this.leftButton.remove();this.rightButton.remove()}},nextPage:function(){clearInterval(this.timer0);var b=0,b=0<this.currentImage?(this.currentImage-1)%this.images.length:this.images.length-1;this.imgTitle.html(this.photos[b].imageName);this.currentImageHolder==this.image0Holder?($(this.image0Holder).css({"z-index":"207"}),$(this.image1Holder).css({"z-index":"208"}),this.alpha=100,$(this.currentImageHolder).css({opacity:this.alpha/
100}),this.currentImageHolder=this.image1Holder,this.image0Holder.empty().append(this.images[this.currentImage])):($(this.image0Holder).css({"z-index":"208"}),$(this.image1Holder).css({"z-index":"207"}),this.alpha=100,$(this.currentImageHolder).css({opacity:this.alpha/100}),this.currentImageHolder=this.image0Holder,this.image1Holder.empty().append(this.images[this.currentImage]));this.currentImage=(this.currentImage+1)%this.images.length},prePage:function(){var b=0,b=2<this.currentImage?(this.currentImage-
3)%this.images.length:1==this.currentImage?this.images.length-2:this.images.length-3;this.imgTitle.html(this.photos[b].imageName);this.currentImageHolder==this.image0Holder?($(this.image0Holder).css({"z-index":"207"}),$(this.image1Holder).css({"z-index":"208"}),this.alpha=100,$(this.currentImageHolder).css({opacity:this.alpha/100}),this.currentImageHolder=this.image1Holder,this.image1Holder.empty().append(this.images[b])):($(this.image0Holder).css({"z-index":"208"}),$(this.image1Holder).css({"z-index":"207"}),
this.alpha=100,$(this.currentImageHolder).css({opacity:this.alpha/100}),this.currentImageHolder=this.image0Holder,this.image0Holder.empty().append(this.images[this.index]));this.currentImage=(this.currentImage-1)%this.images.length},addItem:function(){for(var b=0;b<this.photos.length;b++){var c=$("<div></div>");c.css({width:this.boxWidth+"px",height:this.boxHeight+"px"});image=$("<img style='position : absolute;' />");image.remove();var d=this.photos[b].url;!0==isFlipPdf&&(d="."+d);image.attr("src",
d);image.css({width:this.boxWidth+"px",height:this.boxHeight+"px"});c.append(image);this.images[b]=c}},onResize:function(b,c){this.pw=b;this.ph=c;this.imgWidth=this.config.width*this.pw;this.imgHeight=this.config.height*this.ph;this.boxWidth=this.imgWidth-8;this.boxHeight=this.imgHeight-8;this.background.css({width:this.imgWidth,height:this.imgHeight});this.toolBar.css({width:this.boxWidth,height:"35px"});this.toolBG.onResize(this.boxWidth,35);this.toolBG.setPosition(0,0);this.imgTitle.css({width:this.boxWidth-
20+"px",height:"20px",left:"10px",top:"7px"});this.slideShowBG.onResize(this.imgWidth,this.imgHeight);for(var d=0;d<this.images.length;d++)this.images[d].children().css({width:this.boxWidth+"px",height:this.boxHeight+"px"});this.setPosition()},setPosition:function(){this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.background.css({left:this.x+"px",top:this.y+"px",position:"absolute"});this.image0Holder.css({width:this.boxWidth+"px",height:this.boxHeight+"px",left:(this.imgWidth-this.boxWidth)/
2+"px",top:(this.imgHeight-this.boxHeight)/2+"px",position:"absolute"});this.image1Holder.css({width:this.boxWidth+"px",height:this.boxHeight+"px",left:(this.imgWidth-this.boxWidth)/2+"px",top:(this.imgHeight-this.boxHeight)/2+"px",position:"absolute"})},changeImage:function(b){this.imgIndex=b;this.img.remove();b=Metacharacter(this.photos[b].url);!0==isFlipPdf&&(b="."+b);var c=this;this.img.attr("src",b);this.img.load(function(){var b=c.boxWidth,f=c.boxHeight;c.img.css({width:b+"px",height:f+"px"});
c.boxWidth!=b||c.boxHeight!=f?c.image0Holder.animate({width:b+8,height:f+8,left:(c.pw-b)/2,top:(c.ph-f)/2},300,function(){c.image0Holder.append(c.img)}):(c.image0Holder.append(c.img),c.image1Holder.append(c.img))})},setImagePosition:function(){},show:function(){},hide:function(){}});global.hddr.soa8=hddr.soa7+"i";global.hddr.sov9=function(b,c){return b+"ph"+c+"l"};
var initCarousel=Class({create:function(b,c,d,f,g){this.config=$.extend({width:200,height:20,x:0,y:0,alpha:1,images:null},c);this.pw=d;this.ph=f;this.father=b;this.width=parseInt(this.config.width)*this.pw;this.height=parseInt(this.config.height)*this.ph;this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.id="carousel"+g;this.images=this.config.images;this.images.node instanceof Array&&(this.images=this.images.node);this.images[0]||(this.images=[this.images.node]);if(!(1>this.config.images)){if(this.images&&
this.images.length)for(b=0;b<this.images.length;b++)isFlipPdf&&(this.images[b].url="."+this.images[b].url);this.content=$("<div class=initCarousel></div>");this.content.css({position:"absolute",left:this.x+"px",top:this.y+"px",width:this.width+"px",height:this.height+"px",border:"0px solid red"});this.currentIndex=0;this.father.append(this.content);this.initImages();this.startMove()}},initImages:function(){if(void 0!=this.images&&null!=this.images&&0!=this.images.length){this.refreshImageAndPosition();
this.carouselList=new CarouselImageList;this.carouselList.setResources(this.aImages);this.carouselList.setPositions(this.aPositions);for(var b=0;b<this.aPositions.length;b++){var c=new CarouselImage(this.content,this.aPositions[b]);this.carouselList.addInstance(c)}this.carouselList.loadResources();this.carouselList.blurAll()}},refreshImageAndPosition:function(){if(void 0!=this.images&&null!=this.images&&0!=this.images.length){var b=this.width/5;this.aImages=[];this.aPositions=[];var c=5;5>this.images.length&&
(c=Math.min(this.images.length,3));switch(c){case 1:this.aImages.push(this.images[0].url);this.aPositions.push(new CarouselPosition(0,0,this.width,this.height,1));break;case 2:this.aImages.push(this.images[0].url);this.aImages.push(this.images[(this.currentIndex+1)%this.images.length].url);c=Math.ceil((this.width-b)/2);this.aPositions.push(new CarouselPosition(c,0,b,b,2));c=Math.ceil((this.width-3*b+5)/2)+(2*b-5);this.aPositions.push(new CarouselPosition(c,5,b-5,b-5,1));break;case 3:this.aImages.push(this.images[(this.currentIndex-
1+this.images.length)%this.images.length].url);this.aImages.push(this.images[this.currentIndex%this.images.length].url);this.aImages.push(this.images[(this.currentIndex+1)%this.images.length].url);c=Math.ceil((this.width-3*b+10)/2);this.aPositions.push(new CarouselPosition(c,5,b-5,b-5,0));c=Math.ceil((this.width-b)/2);this.aPositions.push(new CarouselPosition(c,0,b,b,2));c=Math.ceil((this.width-3*b+10)/2)+(2*b-5);this.aPositions.push(new CarouselPosition(c,5,b-5,b-5,1));break;case 5:this.aImages.push(this.images[(this.currentIndex-
2+this.images.length)%this.images.length].url),this.aImages.push(this.images[(this.currentIndex-1+this.images.length)%this.images.length].url),this.aImages.push(this.images[this.currentIndex%this.images.length].url),this.aImages.push(this.images[(this.currentIndex+1)%this.images.length].url),this.aImages.push(this.images[(this.currentIndex+2)%this.images.length].url),c=Math.ceil((this.width-5*b+20)/2),this.aPositions.push(new CarouselPosition(c,5,2*b-5,2*b-5,0)),c=Math.ceil((this.width-3*b+10)/2),
this.aPositions.push(new CarouselPosition(c,5,2*b-5,2*b-5,2)),c=Math.ceil((this.width-2*b)/2),this.aPositions.push(new CarouselPosition(c,0,3*b,3*b,3)),c=Math.ceil((this.width-3*b+10)/2)+(2*b-5),this.aPositions.push(new CarouselPosition(c,5,2*b-5,2*b-5,2)),c=Math.ceil((this.width-5*b+20)/2)+(4*b-15),this.aPositions.push(new CarouselPosition(c,5,2*b-5,2*b-5,1))}}},startMove:function(){var b=this;this.timer=window.setInterval(function(){b.move(1)},2E3)},stopMove:function(){window.clearInterval(this.timer)},
move:function(b){this.currentIndex+=b;0>this.currentIndex&&(this.currentIndex+=this.images.length);this.currentIndex%=this.images.length;var c=[];switch(this.carouselList.instanceCount()){case 1:c.push(this.images[0].url);break;case 2:c.push(this.images[this.currentIndex%this.images.length].url);c.push(this.images[(this.currentIndex+1)%this.images.length].url);break;case 3:c.push(this.images[(this.currentIndex-1+this.images.length)%this.images.length].url);c.push(this.images[this.currentIndex%this.images.length].url);
c.push(this.images[(this.currentIndex+1)%this.images.length].url);break;case 5:c.push(this.images[(this.currentIndex-2+this.images.length)%this.images.length].url),c.push(this.images[(this.currentIndex-1+this.images.length)%this.images.length].url),c.push(this.images[this.currentIndex%this.images.length].url),c.push(this.images[(this.currentIndex+1)%this.images.length].url),c.push(this.images[(this.currentIndex+2)%this.images.length].url)}this.carouselList.setResources(c);this.carouselList.move(b)},
onResize:function(b,c){this.pw=b;this.ph=c;this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.content.css({width:this.width+"px",height:this.height+"px"});this.setPosition();this.refreshImageAndPosition();this.carouselList.setResources(this.aImages);this.carouselList.setPositions(this.aPositions);this.carouselList.resizeAll()},setPosition:function(){this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.content.css({left:this.x+"px",top:this.y+"px"})}}),CarouselImage=
Class({create:function(b,c){this.father=b;this.instance=$('<img style="position:absolute"/>');this.father.append(this.instance);this.imageHeight=this.imageWidth=0;var d=this;this.instance.load(function(){CarouselImage.prototype.onImageLoad.apply(d,arguments)});this.setArea(c.left,c.top,c.width,c.height);this.setZindex(c.zindex)},blur:function(b){!0==b?this.instance.css({"-webkit-filter":"blur(2px)","-moz-filter":"blur(2px)","-o-filter":"blur(2px)","-ms-filter":"blur(2px)",filter:"blur(2px)"}):this.instance.css({"-webkit-filter":"blur(0px)",
"-moz-filter":"blur(0px)","-o-filter":"blur(0px)","-ms-filter":"blur(0px)",filter:"blur(0px)"})},setSrc:function(b){this.instance[0].src=b},getSrc:function(){return this.instance[0].src},onImageLoad:function(){var b=this.instance[0];this.imageWidth=b.naturalWidth;this.imageHeight=b.naturalHeight;b=Math.ceil(this.imageHeight*this.instance.width()/this.imageWidth);this.instance.css({height:b+"px"})},move:function(b,c){this.instance.css({left:b+"px",top:c+"px"})},resize:function(b,c){var d=c;0<this.imageWidth&&
0<this.imageHeight&&(d=Math.ceil(this.imageHeight*this.instance.width()/this.imageWidth));this.instance.css({width:b+"px",height:d+"px"})},setArea:function(b,c,d,f){this.move(b,c);this.resize(d,f)},setZindex:function(b){this.instance.css({"z-index":b})},gotoPosition:function(b){var c=b.height;0<this.imageWidth&&0<this.imageHeight&&(c=Math.ceil(this.imageHeight*b.width/this.imageWidth));var d=this;this.instance.animate({left:b.left,top:b.top,width:b.width,height:c},500,function(){d.setZindex(b.zindex)})}}),
CarouselPosition=Class({create:function(b,c,d,f,g){this.left=Math.ceil(b);this.top=Math.ceil(c);this.width=Math.ceil(d);this.height=Math.ceil(f);this.zindex=g},asString:function(){return"left:"+this.left+",top:"+this.top+",width:"+this.width+",height:"+this.height+",z-index:"+this.zindex}}),CarouselImageList=Class({create:function(){this.imageResources=[];this.imagePositions=[];this.imageInstances=[]},setResources:function(b){for(;0<this.imageResources.length;)this.imageResources.pop();for(var c=
0;c<b.length;c++)this.imageResources.push(b[c])},setPositions:function(b){for(;0<this.imagePositions.length;)this.imagePositions.pop();for(var c=0;c<b.length;c++)this.imagePositions.push(b[c])},addInstance:function(b){this.imageInstances.push(b)},instanceCount:function(){return this.imageInstances.length},loadResources:function(){for(var b=this.imageInstances.length,c=0;c<b;c++){var d=this.imageInstances[c];d.getSrc()!=this.imageResources[c]&&d.setSrc(this.imageResources[c])}},move:function(b){var c=
this.imageInstances.length;if(0!=c){for(var d=this.imageInstances[0],f=0;f<c;f++){var g=f+b;0>g&&(g+=c);g>=c&&(g%=c);var h=this.imageInstances[g];this.imageInstances[f]=0==g?d:h}for(f=0;f<c;f++)this.imageInstances[f].gotoPosition(this.imagePositions[f]);this.loadResources();this.blurAll()}},resizeAll:function(){var b=this.imageInstances.length;if(0!=b)for(var c=0;c<b;c++)this.imageInstances[c].gotoPosition(this.imagePositions[c])},blurAll:function(){for(var b=this.imageInstances.length,c=Math.floor((b+
1)/2)-1,d=0;d<b;d++){var f=this.imageInstances[d];d!=c?f.blur(!0):f.blur(!1)}}});global.hddr.sob8=hddr.soa8;global.hddr.soq2=hddr.sov9(hddr.soa8,hddr.soq3)+"5";
var initDynamicShow=Class({create:function(b,c,d,f,g){this.config=$.extend({width:200,height:20,x:0,y:0,alpha:1,images:null},c);this.pw=d;this.ph=f;this.father=b;this.width=this.config.width*this.pw;this.childWidth=Math.ceil(this.width/4);this.height=this.config.height*this.ph;this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.borderWidth=this.config.borderWidth;this.id="dynshow"+g;this.images=this.config.images;this.images=slideShowImagesAdapter(this.images,["Image","Image"]);this.images[0]||
(this.images=[this.images.Image]);if(this.images&&this.images.length)for(b=0;b<this.images.length;b++)isFlipPdf&&(this.images[b]="."+this.images[b]);this.maxZindex=this.images.length+1;this.content=$("<div></div>");this.content.css({position:"absolute",left:this.x+"px",top:this.y+"px",width:this.width+"px",height:this.height+"px",border:"0px solid red"});this.currentIndex=0;this.father.append(this.content);this.init()},init:function(){this.imageInstances=[];if(0!=this.images.length){for(var b=0;b<
this.images.length;b++){var c=new ImageInstance(this,b);c.setImage(Metacharacter(this.images[b]));this.content.append(c);this.imageInstances.push(c)}this.currentIndex=-1;this.initButtons()}},initButtons:function(){this.leftButton=$('<img src="'+uiBaseURL+'pre_image.png" style="position:absolute;z-index:1000"></img>');this.rightButton=$('<img src="'+uiBaseURL+'next_image.png" style="position:absolute;z-index:1000"></img>');this.setButtonPosition();var b=this;this.leftButton.bind(_event._click,function(){initDynamicShow.prototype.preImage.apply(b,
arguments)});this.rightButton.bind(_event._click,function(){initDynamicShow.prototype.nextImage.apply(b,arguments)});isTouchDevice()||(this.leftButton.css({display:"none"}),this.rightButton.css({display:"none"}));this.content.append(this.leftButton);this.content.append(this.rightButton);this.content.bind(_event._enter,function(){b.leftButton.css({display:"block"});b.rightButton.css({display:"block"})});this.content.bind(_event._leave,function(){b.leftButton.css({display:"none"});b.rightButton.css({display:"none"})})},
preImage:function(){-1!=this.currentIndex&&this.imageInstances[this.currentIndex].hide();this.currentIndex=(this.currentIndex-1+this.images.length)%this.images.length;this.imageInstances[this.currentIndex].show()},nextImage:function(){-1!=this.currentIndex&&this.imageInstances[this.currentIndex].hide();this.currentIndex=(this.currentIndex+1)%this.images.length;this.imageInstances[this.currentIndex].show()},showImage:function(b){-1!=b&&(-1!=this.currentIndex&&this.imageInstances[this.currentIndex].hide(),
this.currentIndex=b,this.imageInstances[this.currentIndex].show())},setButtonPosition:function(){var b=(this.height-32)/2;this.leftButton.css({left:"0px",top:b+"px"});this.rightButton.css({right:"0px",top:b+"px"})},onResize:function(b,c){this.pw=b;this.ph=c;this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.content.css({width:this.width+"px",height:this.height+"px"});this.setPosition();this.setButtonPosition();this.childWidth=Math.ceil(this.width/4);for(var d=0;d<this.imageInstances.length;d++)this.imageInstances[d].onResize()},
setPosition:function(){this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.content.css({left:this.x+"px",top:this.y+"px"})}}),ImageInstance=Class({create:function(b,c){var d=this;this.father=b;this.zIndex=c;this.imageHeight=this.imageWidth=0;this.height=this.width=this.father.childWidth;this.borderWidth=Math.ceil(this.father.borderWidth/2);this.maxLeft=this.father.width-this.width;this.maxTop=this.father.height-this.height;var f=randomPosition(this.maxLeft,this.maxTop);this.rotation=f.rotation;
this.animate=[];this.instance=$("<img></img>");this.instance.css({position:"absolute",left:f.left+"px",top:f.top+"px",width:this.width+"px",height:this.height+"px",display:"none"});this.instance.rotate(this.rotation);this.setBorderWidth(this.borderWidth);this.initShadow();this.instance.load(function(){ImageInstance.prototype.onImageLoad.apply(d,arguments)});this.instance.bind(_event._click,function(){d.father.currentIndex==d.zIndex?(d.hide(),d.father.currentIndex=-1):d.father.showImage(d.zIndex)});
b.content.append(this.instance)},initShadow:function(){this.instance.css({"-moz-box-shadow":"2px 2px 4px #252525","box-shadow":"2px 2px 4px #252525","-webkit-box-shadow":"2px 2px 4px #252525","-ms-box-shadow":"2px 2px 4px #252525","-o-box-shadow":"2px 2px 4px #252525"})},onImageLoad:function(){var b=this.instance[0];this.imageWidth=b.naturalWidth;this.imageHeight=b.naturalHeight;this.height=Math.ceil(this.imageHeight*this.width/this.imageWidth);this.maxTop=this.father.height-this.height;this.instance.css({height:this.height+
"px",display:"block"})},setImage:function(b){this.instance.attr("src",b)},onResize:function(){this.width=this.father.childWidth;this.height=0<this.imageWidth&&0<this.imageHeight?Math.ceil(this.imageHeight*this.width/this.imageWidth):this.width;this.maxLeft=this.father.width-this.width;this.maxTop=this.father.height-this.height;if(this.zIndex!=this.father.currentIndex){var b=this.getPosition(),c=this.width/b.width;b.left=Math.floor(b.left*c);b.top=Math.floor(b.top*c);b.width=this.width;b.height=this.height}else b=
this.getTopPosition();this.moveTo(b)},resize:function(b,c){this.width=b;this.height=c;this.instance.css({width:this.width+"px",height:this.height+"px"})},move:function(b,c){this.instance.css({left:this.left+"px",top:this.top+"px"})},setZindex:function(b){this.instance.css({"z-index":b})},setBorderWidth:function(b){this.instance.css({border:b+"px solid white"})},getTopPosition:function(){if(this.imageWidth/this.imageHeight>this.father.width/this.father.height)var b=this.father.width,c=b*this.imageHeight/
this.imageWidth,d=(this.father.height-c)/2-this.father.borderWidth,f=0,g=0;else c=this.father.height,b=c*this.imageWidth/this.imageHeight,g=d=0,f=(this.father.width-b)/2-this.father.borderWidth;return new DynImagePostion(f,d,b,c,g)},show:function(){if(0!=this.imageWidth&&0!=this.imageHeight){var b=this.getTopPosition();b.borderWidth=this.father.borderWidth;this.setZindex(this.father.maxZindex);this.moveTo(b,function(){this.setZindex(this.father.maxZindex)})}},hide:function(){if(0!=this.imageWidth&&
0!=this.imageHeight){var b=randomPosition(this.maxLeft,this.maxTop),b=new DynImagePostion(b.left,b.top,this.width,this.height,b.rotation);this.setZindex(this.father.maxZindex-1);b.borderWidth=this.borderWidth;this.moveTo(b,function(){this.setZindex(this.zIndex)})}},moveTo:function(b,c){var d=null,f=0,g=this,h=window.setInterval(function(){!1==g.isInAnimate(h)&&g.animate.push(h);if(!1!=g.isRunning(h)){null==d&&(d=g.getPosition());var k=$.easing.swing(null,f,d.left,b.left-d.left,20),l=$.easing.swing(null,
f,d.top,b.top-d.top,20),m=$.easing.swing(null,f,d.width,b.width-d.width,20),n=$.easing.swing(null,f,d.height,b.height-d.height,20),q=$.easing.swing(null,f,d.rotation,b.rotation-d.rotation,20),p=$.easing.swing(null,f,d.borderWidth,b.borderWidth-d.borderWidth,20);g.instance.css({left:k+"px",top:l+"px",width:m+"px",height:n+"px"});g.instance.rotate(q);g.setBorderWidth(p);g.rotation=q;20==f++&&(window.clearInterval(h),g.animate.shift(),void 0!=c&&c.apply(g,arguments))}},20)},isInAnimate:function(b){for(var c=
0;c<this.animate.length;c++)if(b==this.animate[c])return!0;return!1},isRunning:function(b){return b==this.animate[0]},getPosition:function(){var b=parseInt(this.instance.css("left").replace("px","")),c=parseInt(this.instance.css("top").replace("px","")),d=this.instance.width(),f=this.instance.height(),b=new DynImagePostion(b,c,d,f,this.rotation),c=this.instance.css("border"),c=parseInt(c.replace("px solid white"));b.borderWidth=c;return b}}),DynImagePostion=Class({create:function(b,c,d,f,g){this.left=
b;this.top=c;this.width=d;this.height=f;this.rotation=g},asString:function(){return"left:"+this.left+",top:"+this.top+",width:"+this.width+",height:"+this.height+",rotation:"+this.rotation}});function randomPosition(b,c){var d=Math.floor(Math.random()*b),f=Math.floor(Math.random()*c),g=75-Math.floor(150*Math.random());return{left:d,top:f,rotation:g}}
var initFlipJump=Class({create:function(b,c,d,f,g){this.config=$.extend({width:200,height:20,x:0,y:0,images:null},c);this.pw=d;this.ph=f;this.father=b;this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.id="jump"+g;this.itemHeight=Math.floor(0.7*this.height);this.images=this.config.images;this.images=slideShowImagesAdapter(this.images,["Image","Image"]);this.images[0]||(this.images=[this.images.Image]);this.imageCount=
this.images.length;if(this.images){if(this.images instanceof Array)for(b=0;b<this.images.length;b++)isFlipPdf&&(this.images[b]="."+this.images[b]);this.images.Image&&isFlipPdf&&(this.images.Image="."+this.images.Image)}this.minZindex=0;this.maxZindex=this.images.length+1;b=!0==this.config.addBorder?1:0;this.content=$("<div></div>");this.content.css({position:"absolute",left:this.x+"px",top:this.y+"px",width:this.width+"px",height:this.height+"px",border:b+"px solid "+Color(this.config.borderColor).toString()});
!0==this.config.addBackground&&this.content.css({background:Color(this.config.backgroundColor).toString(),opacity:this.config.backgroundAlpha});this.father.append(this.content);this.init()},init:function(){this.busy=!1;this.imageItems=[];for(var b=0;b<this.imageCount;b++){var c=new FlipJumpItem(this,0==b?!1:!0);c.setImage(Metacharacter(this.images[b]));this.imageItems.push(c)}this.resetZindex();this.resetJumpEvent();1<=this.imageCount&&this.initButtons()},initButtons:function(){this.leftButton=$('<img src="'+
uiBaseURL+'pre_image.png" style="position:absolute;z-index:1000"></img>');this.rightButton=$('<img src="'+uiBaseURL+'next_image.png" style="position:absolute;z-index:1000"></img>');this.setButtonPosition();var b=this;this.leftButton.bind(_event._click,function(){initFlipJump.prototype.preImage.apply(b,arguments)});this.rightButton.bind(_event._click,function(){initFlipJump.prototype.nextImage.apply(b,arguments)});isTouchDevice()||(this.leftButton.css({display:"none"}),this.rightButton.css({display:"none"}));
this.content.append(this.leftButton);this.content.append(this.rightButton);this.content.bind(_event._enter,function(){b.leftButton.css({display:"block"});b.rightButton.css({display:"block"})});this.content.bind(_event._leave,function(){b.leftButton.css({display:"none"});b.rightButton.css({display:"none"})})},preImage:function(){if(!0!=this.busy){this.busy=!0;var b=this.imageItems[this.imageCount-1],c=this;this.imageItems[0].randomRotate();b.rotateTo(0,40);b.jumpUp(function(){b.setZindex(c.maxZindex);
b.jumpDown(function(){c.imageItems.pop();c.imageItems.unshift(b);c.resetZindex();c.busy=!1})})}},nextImage:function(){if(!0!=this.busy){this.busy=!0;var b=this.imageItems[0],c=this.imageItems[1],d=this;1==this.imageItems.length&&(c=b);c.rotateTo(0);b.randomRotate(40);b.jumpUp(function(){b.setZindex(d.minZindex);b.jumpDown(function(){d.imageItems.shift();d.imageItems.push(b);d.resetZindex();d.busy=!1})})}},resetZindex:function(){for(var b=0;b<this.imageItems.length;b++)this.imageItems[b].setZindex(this.imageItems.length-
b)},resetJumpEvent:function(){for(var b=this,c=0;c<this.imageItems.length;c++)this.imageItems[c].instance.bind(_event._click,function(){initFlipJump.prototype.nextImage.apply(b,arguments)})},setButtonPosition:function(){var b=(this.height-32)/2;this.leftButton.css({left:"0px",top:b+"px"});this.rightButton.css({right:"0px",top:b+"px"})},onResize:function(b,c){this.pw=b;this.ph=c;this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.content.css({width:this.width+"px",height:this.height+
"px"});this.setPosition();this.setButtonPosition();this.itemHeight=Math.floor(0.7*this.height);for(var d=0;d<this.imageItems.length;d++)this.imageItems[d].resize()},setPosition:function(){this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.content.css({left:this.x+"px",top:this.y+"px"})}}),FlipJumpItem=Class({create:function(b,c){var d=this;this.father=b;this.initRotate=c;this.rotation=0;this.height=this.width=b.itemHeight;this.imageHeight=this.imageWidth=0;this.instance=$("<img></img>");
this.instance.css({position:"absolute",left:"0px",top:"0px",width:this.width+"px",height:this.height+"px",border:"2px solid white",display:"none"});this.instance.load(function(){FlipJumpItem.prototype.onImageLoad.apply(d,arguments)});this.initShadow();b.content.append(this.instance)},initShadow:function(){this.instance.css({"-moz-box-shadow":"2px 2px 4px #252525","box-shadow":"2px 2px 4px #252525","-webkit-box-shadow":"2px 2px 4px #252525","-ms-box-shadow":"2px 2px 4px #252525","-o-box-shadow":"2px 2px 4px #252525"})},
getRandomRotation:function(){return 60-Math.ceil(120*Math.random())},onImageLoad:function(){var b=this.instance[0];this.imageWidth=b.naturalWidth;this.imageHeight=b.naturalHeight;this.width=Math.ceil(this.height*this.imageWidth/this.imageHeight);this.left=Math.ceil((this.father.width-this.width)/2);this.top=Math.ceil((this.father.height-this.height)/2);this.instance.css({left:this.left+"px",top:this.top+"px",width:this.width+"px",height:this.height+"px",display:"block"});!0==this.initRotate&&(b=this.getRandomRotation(),
this.instance.rotate(b),this.rotation=b)},setImage:function(b){this.instance.attr("src",b)},setZindex:function(b){this.instance.css({"z-index":b})},randomRotate:function(b){var c=this.getRandomRotation();this.rotateTo(c,b)},rotateTo:function(b,c){var d=this.rotation,f=20;void 0!=c&&(f=c);var g=this,h=0,k=window.setInterval(function(){var c=$.easing.swing(null,h,d,b-d,f);g.instance.rotate(c);g.rotation=c;h++>=f&&window.clearInterval(k)},20)},jumpUp:function(b){this.instance.animate({top:Math.floor(1.3*
-this.height)},400,b)},jumpDown:function(b){this.instance.animate({top:this.top},400,b)},resize:function(){if(0!=this.imageWith||0!=this.imageHeight)this.height=this.father.itemHeight,this.width=Math.ceil(this.height*this.imageWidth/this.imageHeight),this.left=Math.ceil((this.father.width-this.width)/2),this.top=Math.ceil((this.father.height-this.height)/2),this.instance.animate({left:this.left,top:this.top,width:this.width,height:this.height},400)}}),initRotate3D=Class({create:function(b,c,d,f,g){this.config=
$.extend({width:200,height:20,x:0,y:0,images:null},c);this.pw=d;this.ph=f;this.father=b;this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.id="3d"+g;this.images=this.config.images;this.topZindex=this.imageCount;this.images instanceof Array||(this.images=this.images.node);if(this.config.images!={}){this.imageCount=this.images.length;if(this.images&&this.images.length)for(b=0;b<this.images.length;b++)isFlipPdf&&
(this.images[b].url="."+this.images[b].url);b=!0==this.config.addBorder?1:0;this.content=$("<div></div>");this.content.css({position:"absolute",overflow:"hidden",left:this.x+"px",top:this.y+"px",width:this.width+"px",height:this.height+"px",border:b+"px solid "+colorTo0x(this.config.borderColor)});!0==this.config.addBackground&&this.content.css({background:colorTo0x(this.config.backgroundColor),opacity:this.config.backgroundAlpha/100});this.father.append(this.content);this.init();this.rotateTimer=
-1;this.step=0}},init:function(){this.imageItems=[];for(var b=0;b<this.imageCount;b++){var c=new Rotate3DItem(this,b);c.setImage(this.images[b].url);this.imageItems.push(c)}this.imageItems[0].show();this.currentIndex=0;1<this.imageCount&&this.initButtons()},initButtons:function(){this.leftButton=$('<img src="'+uiBaseURL+'pre_image.png" style="position:absolute;z-index:1000"></img>');this.rightButton=$('<img src="'+uiBaseURL+'next_image.png" style="position:absolute;z-index:1000"></img>');this.setButtonPosition();
var b=this;this.leftButton.bind(_event._down,function(){initRotate3D.prototype.preImage.apply(b,arguments)});this.rightButton.bind(_event._down,function(){initRotate3D.prototype.nextImage.apply(b,arguments)});this.leftButton.bind(_event._end,function(){initRotate3D.prototype.stopRotate.apply(b,arguments)});this.rightButton.bind(_event._end,function(){initRotate3D.prototype.stopRotate.apply(b,arguments)});this.leftButton.bind(_event._leave,function(){initRotate3D.prototype.stopRotate.apply(b,arguments)});
this.rightButton.bind(_event._leave,function(){initRotate3D.prototype.stopRotate.apply(b,arguments)});isTouchDevice()||(this.leftButton.css({display:"none"}),this.rightButton.css({display:"none"}));this.content.append(this.leftButton);this.content.append(this.rightButton);this.content.bind(_event._enter,function(){b.leftButton.css({display:"block"});b.rightButton.css({display:"block"})});this.content.bind(_event._leave,function(){b.leftButton.css({display:"none"});b.rightButton.css({display:"none"})})},
setButtonPosition:function(){var b=(this.height-32)/2;this.leftButton.css({left:"0px",top:b+"px"});this.rightButton.css({right:"0px",top:b+"px"})},onResize:function(b,c){this.pw=b;this.ph=c;this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.content.css({width:this.width+"px",height:this.height+"px"});this.setPosition();this.setButtonPosition();for(var d=0;d<this.imageItems.length;d++)this.imageItems[d].resize()},setPosition:function(){this.x=this.config.x*this.pw;this.y=
this.config.y*this.ph;this.content.css({left:this.x+"px",top:this.y+"px"})},preImage:function(){this.step=-1;this.startRotate()},nextImage:function(){this.step=1;this.startRotate()},startRotate:function(){var b=this;this.doRotate();window.clearInterval(this.rotateTimer);this.rotateTimer=window.setInterval(function(){initRotate3D.prototype.doRotate.apply(b,arguments)},120)},doRotate:function(){var b=this.currentIndex;this.currentIndex+=this.step;0>this.currentIndex&&(this.currentIndex+=this.imageCount);
this.currentIndex>=this.imageCount&&(this.currentIndex%=this.imageCount);this.imageItems[b].hide();this.imageItems[this.currentIndex].show()},stopRotate:function(){window.clearInterval(this.rotateTimer);this.step=0;this.rotateTimer=-1}}),Rotate3DItem=Class({create:function(b,c){var d=this;this.father=b;this.zIndex=c;this.height=this.father.height;this.width=this.father.width;this.imageHeight=this.imageWidth=0;this.instance=$("<img></img>");this.instance.css({position:"absolute",left:"0px",top:"0px",
width:this.width+"px",height:this.height+"px",display:"none"});this.setZindex(c);this.initShadow();this.instance.load(function(){Rotate3DItem.prototype.onImageLoad.apply(d,arguments)});b.content.append(this.instance)},initShadow:function(){var b=this.father.config;!0==b.sh&&this.instance.css({"box-shadow":b.sx+"px "+b.sy+"px "+b.se+"px "+colorTo0x(b.sr),"-moz-box-shadow":b.sx+"px "+b.sy+"px "+b.se+"px "+colorTo0x(b.sr),"-webkit-box-shadow":b.sx+"px "+b.sy+"px "+b.se+"px "+colorTo0x(b.sr),"-ms-box-shadow":b.sx+
"px "+b.sy+"px "+b.se+"px "+colorTo0x(b.sr),"-o-box-shadow":b.sx+"px "+b.sy+"px "+b.se+"px "+colorTo0x(b.sr)})},onImageLoad:function(){var b=this.instance[0];this.imageWidth=b.naturalWidth;this.imageHeight=b.naturalHeight;this.height=Math.floor(0.9*this.father.height);this.width=Math.ceil(this.height*this.imageWidth/this.imageHeight);this.left=Math.ceil((this.father.width-this.width)/2);this.top=Math.ceil((this.father.height-this.height)/2);this.instance.css({left:this.left+"px",top:this.top+"px",
width:this.width+"px",height:this.height+"px",display:"block"})},setImage:function(b){this.instance.attr("src",b)},setZindex:function(b){this.instance.css({"z-index":b})},show:function(){this.setZindex(this.father.topZindex)},hide:function(){this.setZindex(this.zIndex)},resize:function(){if(0!=this.imageWidth||0!=this.imageHeight)this.height=Math.floor(0.9*this.father.height),this.width=Math.ceil(this.height*this.imageWidth/this.imageHeight),this.left=Math.ceil((this.father.width-this.width)/2),this.top=
Math.ceil((this.father.height-this.height)/2),this.instance.animate({left:this.left,top:this.top,width:this.width,height:this.height},400)}}),initEmbeddedSlideshow=Class({create:function(b,c,d,f){this.config=$.extend({width:0.2,height:0.2,x:0.2,y:0.2,alpha:1,src:null},c);this.photos=$.extend([],c.images);this.photos=slideShowImagesAdapter(this.photos,["Image","Image"]);this.photos[0]||(this.photos=[this.photos.Image]);for(c=0;c<this.photos.length;c++)!0==isFlipPdf&&(this.photos[c]="."+this.photos[c]);
if(4>this.photos.length)for(c=this.photos.length;4>c;c++)this.photos[c]=this.photos[0];this.father=b;this.pw=d;this.ph=f;this.imgIndex=-1;this.imgWidth=this.config.width*d;this.imgHeight=this.config.height*f;this.boxWidth=this.imgWidth-8;this.boxHeight=this.imgHeight-8;this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.interval=0;this.fadeTime=400;this.alpha=0;this.nextAlpha=100;this.nextTop=this.nextLeft=this.top=this.left=0;this.images=[];this.background=$("<div></div>");this.background.css({"z-index":"199"});
this.background.css({width:this.imgWidth,height:this.imgHeight});this.image0Holder=$("<div class='type3'></div>");this.image1Holder=$("<div class='type3'></div>");this.image2Holder=$("<div class='type3'></div>");this.image3Holder=$("<div class='type3'></div>");this.img=$("<img style='position : absolute;' />");b.append(this.background);this.background.append(this.image3Holder);this.background.append(this.image2Holder);this.background.append(this.image1Holder);this.background.append(this.image0Holder);
this.background.css({left:this.x+"px",top:this.y+"px",position:"absolute",overflow:"hidden"});this.image0Holder.css({width:this.boxWidth+"px",height:this.boxHeight+"px",left:(this.imgWidth-this.boxWidth)/2+"px",top:(this.imgHeight-this.boxHeight)/2+"px","-webkit-mask-size":this.boxWidth+"px "+this.boxHeight+"px",position:"absolute","z-index":202});this.image1Holder.css({width:this.boxWidth+"px",height:this.boxHeight+"px",left:(this.imgWidth-this.boxWidth)/2+"px",top:(this.imgHeight-this.boxHeight)/
2+"px","-webkit-mask-size":this.boxWidth+"px "+this.boxHeight+"px",position:"absolute","z-index":202});this.image2Holder.css({width:this.boxWidth+"px",height:this.boxHeight+"px",left:(this.imgWidth-this.boxWidth)/2+"px",top:(this.imgHeight-this.boxHeight)/2+"px","-webkit-mask-size":this.boxWidth+"px "+this.boxHeight+"px",position:"absolute","z-index":202});this.image3Holder.css({width:this.boxWidth+"px",height:this.boxHeight+"px",left:(this.imgWidth-this.boxWidth)/2+"px",top:(this.imgHeight-this.boxHeight)/
2+"px","-webkit-mask-size":this.boxWidth+"px "+this.boxHeight+"px",position:"absolute","z-index":202});this.addItem();this.currentImageHolder=this.image0Holder;this.nextImageHolder=this.image1Holder;this.currentImage=0;this.nextImage=1;this.image0Holder.append(this.images[0]);this.image1Holder.append(this.images[(this.currentImage+1)%this.images.length]);this.image2Holder.append(this.images[(this.currentImage+2)%this.images.length]);this.image3Holder.append(this.images[(this.currentImage+3)%this.images.length]);
this.moveLeft=this.boxWidth/5;this.moveTop=this.boxHeight/5;this.tranLeft=this.moveLeft/100;this.tranTop=this.moveTop/100;$(this.image0Holder.children()).css({left:-this.moveLeft,top:-this.moveTop});$(this.image1Holder.children()).css({left:this.moveLeft,top:-this.moveTop});$(this.image2Holder.children()).css({left:this.moveLeft,top:this.moveTop});$(this.image3Holder.children()).css({left:-this.moveLeft,top:this.moveTop});this.image0Holder.css({opacity:"0"});this.image1Holder.css({opacity:"0"});this.image2Holder.css({opacity:"0"});
this.image3Holder.css({opacity:"1"});this.timer1=setTimeout(this.transition(),this.interval)},transition:function(){function b(){0<c.fadeTime?(c.fadeTime-=1,300<c.fadeTime&&400>=c.fadeTime?0<c.nextAlpha&&100>=c.alpha&&(c.alpha+=1,c.nextAlpha-=1,$(c.image0Holder).css({opacity:c.alpha/100}),$(c.image3Holder).css({opacity:c.nextAlpha/100}),c.left=parseFloat($(c.image0Holder.children()).css("left").replace("px",""))+c.tranLeft,c.top=parseFloat($(c.image0Holder.children()).css("top").replace("px",""))+
c.tranTop,c.nextLeft=parseFloat($(c.image3Holder.children()).css("left").replace("px",""))+c.tranLeft,c.nextTop=parseFloat($(c.image3Holder.children()).css("top").replace("px",""))-c.tranTop,$(c.image0Holder.children()).css({left:c.left,top:c.top}),$(c.image1Holder.children()).css({left:c.moveLeft,top:-c.moveTop}),$(c.image2Holder.children()).css({left:c.moveLeft,top:c.moveTop}),$(c.image3Holder.children()).css({left:c.nextLeft,top:c.nextTop}),301==c.fadeTime&&(c.currentImage=(c.currentImage+1)%c.images.length,
c.nextImage=(c.nextImage+1)%c.images.length,c.image1Holder.empty().append(c.images[c.currentImage]),c.image2Holder.empty().append(c.images[c.nextImage]),c.image1Holder.css({opacity:"0"}),c.image2Holder.css({opacity:"0"}),$(c.image1Holder.children()).css({left:c.moveLeft,top:-c.moveTop}),$(c.image2Holder.children()).css({left:c.moveLeft,top:c.moveTop}))):200<c.fadeTime&&300>=c.fadeTime?0<c.alpha&&100>=c.nextAlpha&&(c.nextAlpha+=1,c.alpha-=1,$(c.image0Holder).css({opacity:c.alpha/100}),$(c.image1Holder).css({opacity:c.nextAlpha/
100}),c.left=parseFloat($(c.image0Holder.children()).css("left").replace("px",""))+c.tranLeft,c.top=parseFloat($(c.image0Holder.children()).css("top").replace("px",""))+c.tranTop,c.nextLeft=parseFloat($(c.image1Holder.children()).css("left").replace("px",""))-c.tranLeft,c.nextTop=parseFloat($(c.image1Holder.children()).css("top").replace("px",""))+c.tranTop,$(c.image0Holder.children()).css({left:c.left,top:c.top}),$(c.image1Holder.children()).css({left:c.nextLeft,top:c.nextTop}),$(c.image2Holder.children()).css({left:c.moveLeft,
top:c.moveTop}),$(c.image3Holder.children()).css({left:-c.moveLeft,top:c.moveTop}),202==c.fadeTime&&(c.currentImage=(c.currentImage+1)%c.images.length,c.nextImage=(c.nextImage+1)%c.images.length,c.image2Holder.empty().append(c.images[c.currentImage]),c.image3Holder.empty().append(c.images[c.nextImage]),c.image3Holder.css({opacity:"0"}),c.image2Holder.css({opacity:"0"}),$(c.image2Holder.children()).css({left:c.moveLeft,top:c.moveTop}),$(c.image3Holder.children()).css({left:-c.moveLeft,top:c.moveTop}))):
100<c.fadeTime&&200>=c.fadeTime?0<c.nextAlpha&&100>=c.alpha&&(c.alpha+=1,c.nextAlpha-=1,$(c.image2Holder).css({opacity:c.alpha/100}),$(c.image1Holder).css({opacity:c.nextAlpha/100}),c.left=parseFloat($(c.image2Holder.children()).css("left").replace("px",""))-c.tranLeft,c.top=parseFloat($(c.image2Holder.children()).css("top").replace("px",""))-c.tranTop,c.nextLeft=parseFloat($(c.image1Holder.children()).css("left").replace("px",""))-c.tranLeft,c.nextTop=parseFloat($(c.image1Holder.children()).css("top").replace("px",
""))+c.tranTop,$(c.image0Holder.children()).css({left:-c.moveLeft,top:-c.moveTop}),$(c.image1Holder.children()).css({left:c.nextLeft,top:c.nextTop}),$(c.image2Holder.children()).css({left:c.left,top:c.top}),$(c.image3Holder.children()).css({left:-c.moveLeft,top:c.moveTop}),101==c.fadeTime&&(c.currentImage=(c.currentImage+1)%c.images.length,c.nextImage=(c.nextImage+1)%c.images.length,c.image3Holder.empty().append(c.images[c.currentImage]),c.image0Holder.empty().append(c.images[c.nextImage]),c.image3Holder.css({opacity:"0"}),
c.image0Holder.css({opacity:"0"}),$(c.image0Holder.children()).css({left:-c.moveLeft,top:-c.moveTop}),$(c.image3Holder.children()).css({left:-c.moveLeft,top:c.moveTop}))):0<c.fadeTime&&100>=c.fadeTime&&0<c.alpha&&100>=c.nextAlpha&&(c.nextAlpha+=1,c.alpha-=1,$(c.image2Holder).css({opacity:c.alpha/100}),$(c.image3Holder).css({opacity:c.nextAlpha/100}),c.left=parseFloat($(c.image2Holder.children()).css("left").replace("px",""))-c.tranLeft,c.top=parseFloat($(c.image2Holder.children()).css("top").replace("px",
""))-c.tranTop,c.nextLeft=parseFloat($(c.image3Holder.children()).css("left").replace("px",""))+c.tranLeft,c.nextTop=parseFloat($(c.image3Holder.children()).css("top").replace("px",""))-c.tranTop,$(c.image0Holder.children()).css({left:-c.moveLeft,top:-c.moveTop}),$(c.image1Holder.children()).css({left:c.moveLeft,top:-c.moveTop}),$(c.image2Holder.children()).css({left:c.left,top:c.top}),$(c.image3Holder.children()).css({left:c.nextLeft,top:c.nextTop}),1==c.fadeTime&&(c.currentImage=(c.currentImage+
1)%c.images.length,c.nextImage=(c.nextImage+1)%c.images.length,c.image0Holder.empty().append(c.images[c.currentImage]),c.image1Holder.empty().append(c.images[c.nextImage]),c.image0Holder.css({opacity:"0"}),c.image1Holder.css({opacity:"0"}),$(c.image0Holder.children()).css({left:-c.moveLeft,top:-c.moveTop}),$(c.image1Holder.children()).css({left:c.moveLeft,top:-c.moveTop})))):(clearInterval(c.timer0),c.fadeTime=400,c.timer1=setTimeout(c.transition(),c.interval))}if(!(1>this.photos.length)){var c=this;
c.timer0=setInterval(b,20)}},addItem:function(){for(var b=this,c=0;c<b.photos.length;c++){var d=$("<div></div>");d.css({width:b.boxWidth+"px",height:b.boxHeight+"px",position:"absolute"});var f=$('<img data-mask="'+uiBaseURL+'centerblur.png"/>');f.css("position","absolute");var g=Metacharacter(b.photos[c]);d.append(f);$(f).load(function(){var c=$(this)[0];$(this).css({left:(b.boxWidth-c.naturalWidth)/2+"px",top:(b.boxHeight-c.naturalHeight)/2+"px",position:"absolute"})}).attr("src",g);b.images[c]=
d}},resizeItem:function(){for(var b=0;b<this.photos.length;b++){var c=this.images[b],d=c.children(),f=d[0];void 0!=d&&null!=d&&$(d).css({left:(this.boxWidth-f.naturalWidth)/2+"px",top:(this.boxHeight-f.naturalHeight)/2+"px",position:"absolute"});this.images[b]=c}},onResize:function(b,c){this.pw=b;this.ph=c;this.imgWidth=this.config.width*this.pw;this.imgHeight=this.config.height*this.ph;this.boxWidth=this.imgWidth-8;this.boxHeight=this.imgHeight-8;this.moveLeft=this.boxWidth/5;this.moveTop=this.boxHeight/
5;this.tranLeft=this.moveLeft/100;this.tranTop=this.moveTop/100;this.background.css({width:this.imgWidth,height:this.imgHeight});this.setPosition()},setPosition:function(){this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.background.css({left:this.x+"px",top:this.y+"px"});this.image0Holder.css({width:this.boxWidth+"px",height:this.boxHeight+"px",left:(this.imgWidth-this.boxWidth)/2+"px",top:(this.imgHeight-this.boxHeight)/2+"px","-webkit-mask-size":this.boxWidth+"px "+this.boxHeight+
"px",position:"absolute"});this.image1Holder.css({width:this.boxWidth+"px",height:this.boxHeight+"px",left:(this.imgWidth-this.boxWidth)/2+"px",top:(this.imgHeight-this.boxHeight)/2+"px","-webkit-mask-size":this.boxWidth+"px "+this.boxHeight+"px",position:"absolute"});this.image2Holder.css({width:this.boxWidth+"px",height:this.boxHeight+"px",left:(this.imgWidth-this.boxWidth)/2+"px",top:(this.imgHeight-this.boxHeight)/2+"px","-webkit-mask-size":this.boxWidth+"px "+this.boxHeight+"px",position:"absolute"});
this.image3Holder.css({width:this.boxWidth+"px",height:this.boxHeight+"px",left:(this.imgWidth-this.boxWidth)/2+"px",top:(this.imgHeight-this.boxHeight)/2+"px","-webkit-mask-size":this.boxWidth+"px "+this.boxHeight+"px",position:"absolute"});$(this.image0Holder.children()).css({width:this.boxWidth+"px",height:this.boxHeight+"px",left:-this.moveLeft,top:-this.moveTop});$(this.image1Holder.children()).css({width:this.boxWidth+"px",height:this.boxHeight+"px",left:this.moveLeft,top:-this.moveTop});$(this.image2Holder.children()).css({width:this.boxWidth+
"px",height:this.boxHeight+"px",left:this.moveLeft,top:this.moveTop});$(this.image3Holder.children()).css({width:this.boxWidth+"px",height:this.boxHeight+"px",left:-this.moveLeft,top:this.moveTop});this.resizeItem()},setImagePosition:function(){},show:function(){},hide:function(){}}),initFlashSwf=Class({create:function(b,c,d,f){this.config=$.extend({width:0.2,height:0.2,x:0.2,y:0.2,alpha:1,src:null},c);this.father=b;this.pw=d;this.ph=f;this.width=d*this.config.width;this.height=f*this.config.height;
this.left=d*this.config.x;this.top=f*this.config.y;this.config.src=Metacharacter(this.config.src);this.content=$("<div></div>");this.content.css({position:"absolute",left:this.left,top:this.top,width:this.width,height:this.height});b.append(this.content);isTouchDevice()||(!0==isFlipPdf&&(this.config.src="."+this.config.src),this.content.flash({swf:this.config.src,width:this.width+"px",height:this.height+"px",wmode:"transparent"}))},onResize:function(b,c){this.pw=b;this.ph=c;this.width=this.config.width*
b;this.height=this.config.height*c;this.content.css({width:this.width+"px",height:this.height+"px"});this.content.flash().remove();this.content.flash({swf:this.config.src,width:this.width+"px",height:this.height+"px",wmode:"transparent"});this.setPosition(this.config.x*b,this.config.y*c)},setPosition:function(b,c){this.content.css({left:b+"px",top:c+"px"})},hide:function(){this.content.html("")},show:function(){this.content.flash({swf:this.config.src,width:this.width+"px",height:this.height+"px",
wmode:"transparent"})}});
(function(b){var c=0;b.fn.printArea=function(){var d=b(this);b("iframe#printArea_"+c).remove();c++;var f="printArea_"+c;iframe=document.createElement("IFRAME");b(iframe).attr({style:"position:absolute;width:0px;height:0px;left:-500px;top:-500px;",id:f});document.body.appendChild(iframe);var g=iframe.contentWindow.document;b(document).find("link").filter(function(){return"stylesheet"==b(this).attr("rel").toLowerCase()}).each(function(){g.write('<link type="text/css" rel="stylesheet" href="'+b(this).attr("href")+
'" >')});g.write('<div class="'+b(d).attr("class")+'">'+b(d).html()+"</div>");g.close();d=iframe.contentWindow;d.close();d.focus();d.print()}})(jQuery);
Class("ShowInformation",{create:function(b,c){this.config=c;this.config.action.imgURL=Metacharacter(this.config.action.imgURL);this.config.width=parseInt(this.config.action.width);this.config.height=parseInt(this.config.action.height);this.bgColor1=Color(this.config.action.bgColor1).toString();this.bgColor2=Color(this.config.action.bgColor2).toString();this.buttonColor=Color(this.config.action.buttonColor).toString();this.buttonBgColor=Color(this.config.action.buttonBgColor).toString();this.fontColor=
Color(this.config.action.titleColor).toString();this.bodyColor=Color(this.config.action.bodyColor).toString();this.background=$("<div></div>");this.contentBox=$('<div id="cbox"></div>');this.closeButton=$('<div id="closebutton"></div>');this.textTitle=$("<div></div>");this.text=$("<textarea readonly></textarea>");this.content=$("<div></div>");this.container=$('<div id="conb"></div>');this.imgBox=$("<div></div>");this.img=$("<img>");this.button=$("<a href = '"+this.config.action.link+"' target='_Blank' font-family="+
this.config.action.bodyFont+"><div></div></a>");b.append(this.background);b.append(this.container);this.contentBox.append(this.textTitle);this.str="";this.content.append(this.contentBox);this.container.append(this.content);this.container.append(this.closeButton);this.textTitle.html(this.config.action.titleText);this.button.html(this.config.action.buttonName);var d=new TextFormatAnalyzer(this.config.action.bodyText);this.textan=d.getLines();if(null==this.config.action.bodyFont){var f=d.getFontFamily().split(",");
this.config.action.bodyFont=f[0];this.config.action.bodySize=d.getFontSize();this.config.action.bodyColor=d.getFontColor()}for(d=0;d<this.textan.length;d++)this.str+=this.textan[d];isFlipPdf&&(this.config.action.imgURL="."+this.config.action.imgURL);this.contentBox.append(this.text);this.text.append(this.str);this.setCss()},setCss:function(){this.img.attr({src:this.config.action.imgURL,align:"center"});this.background.css({position:"absolute",width:"100%",height:"100%",opacity:"0.5",top:0,"background-color":"black",
"z-index":"1000"});this.contentBox.append(this.button);this.setPcCss();this.config.action.imgURL||(this.contentBox.css({position:"absolute",right:"25px","overflow-x":"hidden",width:this.config.width-50+"px",height:this.config.height-50+"px"}),this.textTitle.css({"font-size":this.config.action.titleSize,color:this.fontColor,"font-family":this.config.action.titleFont,"z-index":"2500",width:this.config.width-50+"px","margin-top":"30px"}),this.text.css({"max-width":this.config.width-50+"px","max-height":this.config.height-
170+"px","z-index":"2500"}));!0==parseBool(this.config.action.imgBool)&&this.config.action.imgURL?(this.content.append(this.imgBox),this.imgBox.append(this.img),this.imgBox.css({width:"100%",height:"100%",position:"absolute","z-index":"3000","max-width":"195px","max-height":"290px",margin:"auto",right:"0px"}),this.contentBox.css({position:"absolute",left:"20px","overflow-x":"hidden",width:this.config.width-240+"px",height:this.config.height-25+"px"}),this.setText()):!1==parseBool(this.config.action.imgBool)&&
this.config.action.imgURL&&(this.content.append(this.imgBox),this.imgBox.append(this.img),this.imgBox.css({width:"100%",height:"100%",position:"absolute","z-index":"3000","max-width":"195px","max-height":"290px",margin:"auto",left:"0"}),this.contentBox.css({position:"absolute",right:"10px",width:this.config.width-240+"px","overflow-x":"hidden",height:this.config.height-25+"px"}),this.setText());this.background.bind("click",function(b){this.hide()}.bind(this));this.background.bind(_event._end,function(b){b.stopPropagation()}.bind(this));
this.closeButton.bind("click",function(){this.hide()}.bind(this))},setPcCss:function(){this.closeButton.css({width:"100%",height:"100%",position:"absolute","background-image":"url("+uiBaseURL+"close.png)","background-repeat":"no-repeat",cursor:"pointer","max-width":"27px","max-height":"27px","z-index":"3000","margin-left":this.config.width+"px"});this.button.css({position:"absolute",color:this.buttonColor,"padding-left":"10px","padding-right":"10px","background-color":this.buttonBgColor,"text-decoration":"none",
"z-index":"2500",bottom:"0px",left:"0px"});this.img.css({"max-width":"190px","max-height":"290px",position:"absolute",margin:"auto",left:"0",top:"0",bottom:"0",right:"0"});this.container.css({"max-width":this.config.width+30+"px","max-height":this.config.height+30+"px",position:"absolute",margin:"auto",left:"0",top:"0",bottom:"0",right:"0","z-index":"3000"});this.content.css({width:"100%",height:"100%",position:"absolute",margin:"auto",left:"0",top:"0",bottom:"0",right:"0","max-width":this.config.width,
"max-height":this.config.height,"z-index":"1900","background-image":$.browser.prefix+"repeating-linear-gradient("+this.config.action.bgAngle+"deg, "+this.bgColor2+", "+this.bgColor1+")"})},setText:function(){this.textTitle.css({"font-size":this.config.action.titleSize,color:this.fontColor,"font-family":this.config.action.titleFont,"z-index":"2500",width:this.config.width-233+"px","margin-top":"30px",overflow:"hidden","text-overflow":"ellipsis"});this.text.css({"font-size":this.config.action.bodySize+
"px",color:this.bodyColor,"font-family":this.config.action.bodyFont,width:this.config.width-240+"px",height:this.config.height-140+"px",padding:"0px",outline:"medium",border:"0px","padding-right":"17px","margin-top":"30px","line-height":"2.0",background:"rgba(255,255,255,0)","z-index":"2500"})},onResize:function(b,c){var d=this.container.css("width"),f=this.container.css("height");this.height=parseInt(f.replace("px",""));this.width=parseInt(d.replace("px",""));this.container.css({"margin-left":(windowWidth-
this.width)/2+"px","margin-top":(windowHeight-this.height)/2+"px"})},show:function(){this.background.css({display:"block"})},hide:function(){animateOnce(this.container,{transform:"scale(0)","-webkit-transform":"scale(0)","-moz-transform":"scale(0)","-o-transform":"scale(0)","-ms-transform":"scale(0)"},0.5,function(){this.background.css({display:"none"})}.bind(this),"","ease")}});
Class("ShowInformationMobile",{create:function(b,c){this.config=c;this.bgColor1=colorTo0x(this.config.action.bgColor1);this.bgColor2=colorTo0x(this.config.action.bgColor2);this.buttonColor=colorTo0x(this.config.action.buttonColor);this.buttonBgColor=colorTo0x(this.config.action.buttonBgColor);this.fontColor=colorTo0x(this.config.action.titleColor);this.bodyColor=colorTo0x(this.config.action.bodyColor);this.closeButton=$('<div id="closebutton"></div>');this.textTitle=$("<div></div>");this.text=$("<div></div>");
this.content=$("<div></div>");this.container=$('<div id="conb"></div>');this.title=$("<div></div>");this.img=$("<img>");this.foot=$('<div style="width:100%;height:70px;position:relative;"></div>');this.button=$("<a href = '"+this.config.action.link+"' target='_Blank' font-family="+this.config.action.bodyFont+"></a>");this.foot.append(this.button);b.append(this.container);this.config.action.imgURL=Metacharacter(this.config.action.imgURL);this.str="";this.textTitle.html(this.config.action.titleText);
this.textTitle.text(this.textTitle.text().overflow(20));this.button.html(this.config.action.buttonName);var d=new TextFormatAnalyzer(this.config.action.bodyText);this.textan=d.getLines();if(null==this.config.action.bodyFont){var f=d.getFontFamily().split(",");this.config.action.bodyFont=f[0];this.config.action.bodySize=d.getFontSize();this.config.action.bodyColor=d.getFontColor()}for(d=0;d<this.textan.length;d++)this.str+=this.textan[d];this.container.append(this.title);this.title.append(this.closeButton);
this.title.append(this.textTitle);this.container.append(this.content);this.content.append(this.img);this.content.append(this.text);this.text.append(this.str);this.content.append(this.foot);this.setPhone();this.closeButton.bind("click",function(){this.hide()}.bind(this))},setPhone:function(){this.title.css({position:"relative",width:windowWidth+"px","background-color":"mintcream",border:"#CCCCCC 0.5px solid",height:"40px"});this.img.attr({src:this.config.action.imgURL,align:"center"});this.button.css({position:"absolute",
color:this.buttonColor,"padding-left":"8px","padding-right":"8px","background-color":this.buttonBgColor,"text-decoration":"none","z-index":"2500",right:"30px","border-radius":"6px",bottom:"30px"});this.img.css({position:"relative",width:windowWidth+"px","max-height":"200px",margin:"auto",left:"0",top:"0",bottom:"0",right:"0"});this.container.css({position:"absolute",width:windowWidth+"px",height:"100%",transform:"translate(100%,0)","-webkit-transform":"translate(100%,0)","-moz-transform":"translate(100%,0)",
"-o-transform":"translate(100%,0)","-ms-transform":"translate(100%,0)","z-index":"3000","background-image":$.browser.prefix+"repeating-linear-gradient("+this.config.action.bgAngle+"deg, "+this.bgColor2+","+this.bgColor1+")"});this.content.css({width:windowWidth+15+"px","overflow-x":"hidden",height:windowHeight-40+"px"});this.textTitle.css({position:"absolute",width:windowWidth/2,margin:"auto","font-size":"12px",color:this.fontColor,"font-family":this.config.action.titleFont,"vertical-align":"middle",
"line-height":"3.0",left:"0",top:"0",bottom:"0",right:"0","text-align":"center"});this.text.css({width:windowWidth-10+"px","font-size":this.config.action.bodySize+"px",color:this.bodyColor,"font-family":this.config.action.bodyFont,"overflow-y":"hidden","margin-top":"20px","padding-left":"5px","line-height":"2.0","text-indent":"2em"});this.closeButton.css({position:"absolute",margin:"auto","background-image":"url("+uiBaseURL+"background_prev.png)","background-repeat":"no-repeat",cursor:"pointer",width:"20px",
height:"20px",left:"10px",bottom:"0",top:"0"})},onResize:function(b,c){windowWidth=b;windowHeight=c;this.setPhone()},show:function(){animateOnce(this.container,{transform:"translate(0,0)","-webkit-transform":"translate(0,0)","-moz-transform":"translate(0,0)","-o-transform":"translate(0,0)","-ms-transform":"translate(0,0)"},0.3,null,"","ease")},hide:function(){animateOnce(this.container,{transform:"translate(100%,0)","-webkit-transform":"translate(100%,0)","-moz-transform":"translate(100%,0)","-o-transform":"translate(100%,0)",
"-ms-transform":"translate(100%,0)"},0.3,null,"","ease")}});
Class("HotSports",{create:function(b,c,d,f){this.config=c;this.pageWidth=d;this.pageHeight=f;this.width=this.pageWidth*this.config.width;this.height=this.pageHeight*this.config.height;this.content=$("<div></div>");this.content.flash({swf:this.config.hotSpotsURL,width:this.width+"px",height:this.height+"px",wmode:"transparent"});b.append(this.content);this.setCss();this.setPosition()},setCss:function(){this.content.css({position:"absolute",width:this.width,height:this.height})},onResize:function(b,
c){this.pageWidth=b;this.pageHeight=c;this.width=this.config.width*b;this.height=this.config.height*c;this.content.flash({swf:this.config.hotSpotsURL,width:this.width+"px",height:this.height+"px",wmode:"transparent"});this.setCss();this.setPosition()},setPosition:function(){this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;this.content.css({left:this.x+"px",top:this.y+"px"})}});
Class("HotSpotsMobile",{create:function(b,c,d,f){this.config=c;this.pageWidth=d;this.pageHeight=f;this.width=this.pageWidth*this.config.width;this.height=this.pageHeight*this.config.height;this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;this.hotSpot=$("<canvas width="+this.width+" height="+this.height+"></canvas>");this.hotSpot.css({position:"absolute",left:this.x,top:this.y});b.append(this.hotSpot);this.drawer=this.drawHotSpot.runInAnimate(this,1E3);this.setPosition()},drawHotSpot:function(b,
c){var d=this.hotSpot[0],f=d.getContext("2d");f.clearRect(0,0,d.width,d.height);f.beginPath();f.arc(this.width/2,this.height/2,this.width/8,0,2*Math.PI);f.fillStyle="red";f.fill();f.closePath();f.beginPath();var d=this.width/8,g=d/3;f.arc(this.width/2,this.height/2,d+(this.width/2-g/2-d)*b/c,0,2*Math.PI);f.lineWidth=g;d=$.easing.easeInQuart(null,b,1,-0.8,c);f.strokeStyle=String.format("rgba(244,11,11,%f)",d);f.stroke();f.closePath();b==c&&(this.drawer=this.drawHotSpot.runInAnimate(this,1E3))},Stop:function(){this.drawer&&
this.drawer.stop()},onResize:function(b,c){this.pageWidth=b;this.pageHeight=c;this.width=this.config.width*b;this.height=this.config.height*c;this.hotSpot.css({width:this.width+"px",height:this.height+"px",left:this.x+"px",top:this.y+"px"});this.setPosition()},setPosition:function(){this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;this.hotSpot.css({left:this.x+"px",top:this.y+"px"})}});function forceFloat(b){b=Number(b).toString();-1==b.indexOf(".")&&(b+=".00");return b}
Class("ShoppingCart",{create:function(b,c,d,f){this.config=c;this.pageWidth=d;this.pageHeight=f;this.bgColor=Color(this.config.bgColor).toString();this.width=parseInt(this.pageWidth*this.config.width);this.height=b(this.pageHeight*this.config.height);this.background=$("<div></div>");this.config.imgUrl=Metacharacter(this.config.imgUrl);this.config.url=Metacharacter(this.config.url);this.img=$("<img>");b.append(this.background);this.background.append(this.img);isFlipPdf&&(this.config.imgUrl="."+this.config.imgUrl);
d="";this.config.url&&(d=this.config.url.toLowerCase());d.startWith("http://")||d.startWith("https://")||(d="http://"+d);"link"==this.config.cartType?(this.background=$("<a href="+d+" target='_blank' ><div></div></a>"),b.append(this.background),this.background.append(this.img)):$.browser.device==$.browser.DEVICE_PHONE?(this.mobileShop=new MobileProductDetailsPanel(c,pageEditor.setting,b),this.background.bind(_event._end,function(){this.mobileShop.show()}.bind(this))):(this.shop=new PCProductDetailsPanel(c,
pageEditor.setting,b),this.background.bind(_event._end,function(){this.shop.show()}.bind(this)));this.setLinkCss();this.setPosition();this.initEvent()},destroy:function(){this.background.empty();this.background.remove();this.shop.destroy()},initEvent:function(){var b=new divHint;this.background.bind(_event._move,function(c){var d;isTouchDevice()?(d=c.originalEvent.touches[0],void 0==d&&(d=c.touches[0])):d=c;$(d.target);c=d.pageX+10;d=d.pageY+10;b.setStyle("hintBackground");"link"==this.config.cartType?
""!=this.config.titleStr?b.setText(this.config.titleStr.overflow(12)):b.setText(this.config.url.overflow(12)):""!=this.config.titleStr?b.setText(this.config.titleStr.overflow(12)):b.setText(this.config.Detailed.title.overflow(12));b.moveto(c,d);b.show()}.bind(this));this.background.bind(_event._leave,function(){b.hide()}.bind(this))},setLinkCss:function(){this.background.css({position:"absolute","background-position":"center",width:this.width,height:this.height,"padding-top":"10px","padding-bottom":"10px",
"background-color":this.bgColor,opacity:this.config.bgAlpha,"text-decoration":"none",cursor:" default "});this.img.attr({src:this.config.imgUrl});if(this.width>this.height){var b=2*this.height/3;this.width=b/100*100;this.img.css({position:"absolute",width:this.width,height:b,margin:"auto",left:"0",right:"0",top:"0",bottom:"0"})}else b=2*this.width/3,this.height=b/100*100,this.img.css({position:"absolute",width:this.height,height:b,margin:"auto",left:"0",right:"0",top:"0",bottom:"0"})},show:function(){this.background.css({display:"block"})},
onResize:function(b,c){this.pageWidth=b;this.pageHeight=c;this.width=this.config.width*b;this.height=this.config.height*c;this.background.css({width:this.width,height:this.height});this.setLinkCss();this.setPosition()},setPosition:function(){this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;this.background.css({left:this.x+"px",top:this.y+"px"})}});
var ShoppingCartUtil={setProductsToStorage:function(b){b=Instance.JSON(b);window.localStorage.setItem("shopping_cart_products",b)},getProductsFromStorage:function(){var b=window.localStorage.getItem("shopping_cart_products");return Instance.parse(b,[])},removeProduct:function(b){for(var c=this.getProductsFromStorage(),d=0;d<c.length;d++)if(c[d].title==b.title){c.remove(d);break}this.setProductsToStorage(c)},addProduct:function(b){for(var c=this.getProductsFromStorage(),d=!0,f=0;f<c.length;f++){var g=
c[f];if(g.title==b.title){g.number=b.number+g.number;d=!1;break}}d&&c.push(b);this.setProductsToStorage(c);return c},saveProducts:function(b,c){b||(b=[]);for(var d=[],f=0;f<b.length;f++)d.push(b[f].product);this.setProductsToStorage(d)}};
Class("ProductDetailsPanel",{create:function(b,c,d){this.config=b;this.setting=c;this.parent=d;this.initUI();this.initEvent()},destroy:virtual_function,getMailtoInformation:function(b,c,d){var f=d.shoppingCartOptinon.body;b=parseInt(b);var g=forceFloat(c.Detailed.proce);b=String.format("%0D%0A%0D%0A%0D%0A%s(N1,%d * %s%s = %s%s);%0D%0A%s%s%0D%0A-they in your contacts here-%0D%0A%0D%0A%0D%0A%0D%0A",c.Detailed.title,b,g,c.Detailed.sing,forceFloat(g*b),c.Detailed.sing,forceFloat(g*b),c.Detailed.sing);
!0==d.shoppingCartOptinon.showPrice?-1<f.indexOf("${shopping}")&&(f=f.replaceAll("${shopping}",b,!0)):-1<f.indexOf("${shopping}")&&(f=f.replaceAll("${shopping}","%0D%0A%0D%0A"+c.Detailed.title+"(N1,);%0D%0A- type in your contacts here -%0D%0A%0D%0A%0D%0A",!0));return String.format("mailto:%s?subject=%s&body=%s",d.shoppingCartOptinon.address,d.shoppingCartOptinon.theme,f)},getPaypalInformation:function(b,c,d){var f="";"$"==c.Detailed.sing||"U.S.$"==c.Detailed.sing?f="USD":"\uffe5"==c.Detailed.sing?
f="CNY":"\u20ac"==c.Detailed.sing?f="EUR":"\uffe1"==c.Detailed.sing?f="GBP":"J.\uffe5"==c.Detailed.sing?f="JPY":"$A."==c.Detailed.sing?f="AUD":"$NZ."==c.Detailed.sing?f="NZD":"SFR."==c.Detailed.sing?f="CHF":"HK$"==c.Detailed.sing?f="HKD":"S.$"==c.Detailed.sing?f="SGD":"S.Kr."==c.Detailed.sing?f="SEK":"D.Kr."==c.Detailed.sing?f="DKK":"z\u0142"==c.Detailed.sing?f="PLZ":"N.Kr."==c.Detailed.sing?f="NOK":"FT."==c.Detailed.sing?f="HUF":"Cz.Kr."==c.Detailed.sing?f="CSK":"Mex.$"==c.Detailed.sing?f="MXP":
"\u20aa"==c.Detailed.sing?f="ILS":"Gr.$"==c.Detailed.sing?f="BRC":"Mal.$"==c.Detailed.sing?f="MYR":"NT"==c.Detailed.sing?f="NTD":"\u0e3f"==c.Detailed.sing?f="THP":"Ykr"==c.Detailed.sing&&(f="TRL");return"http://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business="+d.shoppingCartOptinon.paypal+"&item_name="+c.Detailed.title+"&amount="+c.Detailed.proce+"&currency_code="+f+"&quantity="+b},doCheckout:function(){if(!1!=this.canCheckout){var b="",b=this.input.val(),b="Email"==this.setting.shoppingCartOptinon.type?
this.getMailtoInformation(b,this.config,this.setting):this.getPaypalInformation(b,this.config,this.setting);window.open(b)}}});
Class("ShoppingCartPanel",{getMailtoInformation:function(b,c){if(!this.shoppingItems)return"";for(var d="",f=pageEditor.setting.shoppingCartOptinon.body,g=0,h=0;h<this.shoppingItems.length;h++){var k=this.shoppingItems[h];if(void 0==k.isSelected||k.isSelected())var l=forceFloat(k.product.price),d=d+String.format("%0D%0A%20%20%20%20%s(N"+(h+1)+",%d * %s%s = %s%s);%0D%0A",k.product.title,parseInt(k.product.number),l,k.product.sing,forceFloat(l*parseInt(k.product.number)),k.product.sing),l=parseFloat(k.product.price*
k.cartInput.val()),g=g+l}d+=String.format("%0D%0A%20%20%20%20(Total price : %f%s);%0D%0A",g,this.config.Detailed.sing);!0==pageEditor.setting.shoppingCartOptinon.showPrice?-1<f.indexOf("${shopping}")&&(f=f.replaceAll("${shopping}",d,!0)):-1<f.indexOf("${shopping}")&&(f=f.replaceAll("${shopping}","%0D%0A%0D%0A"+k.product.title+"(N1,);%0D%0A- type in your contacts here -%0D%0A%0D%0A%0D%0A",!0));return String.format("mailto:%s?subject=%s&body=%s",pageEditor.setting.shoppingCartOptinon.address,pageEditor.setting.shoppingCartOptinon.theme,
f)},getPaypalInformation:function(b,c){if(!this.shoppingItems)return"";for(var d="",f="",g=0,h=0;h<this.shoppingItems.length;h++){var k=this.shoppingItems[h];if(void 0==k.isSelected||k.isSelected())"$"==b.Detailed.sing||"U.S.$"==b.Detailed.sing?d="USD":"\uffe5"==b.Detailed.sing?d="CNY":"\u20ac"==b.Detailed.sing?d="EUR":"\uffe1"==b.Detailed.sing?d="GBP":"J.\uffe5"==b.Detailed.sing?d="JPY":"$A."==b.Detailed.sing?d="AUD":"$NZ."==b.Detailed.sing?d="NZD":"SFR."==b.Detailed.sing?d="CHF":"HK$"==b.Detailed.sing?
d="HKD":"S.$"==b.Detailed.sing?d="SGD":"S.Kr."==b.Detailed.sing?d="SEK":"D.Kr."==b.Detailed.sing?d="DKK":"z\u0142"==b.Detailed.sing?d="PLZ":"N.Kr."==b.Detailed.sing?d="NOK":"FT."==b.Detailed.sing?d="HUF":"Cz.Kr."==b.Detailed.sing?d="CSK":"Mex.$"==b.Detailed.sing?d="MXP":"\u20aa"==b.Detailed.sing?d="ILS":"Gr.$"==b.Detailed.sing?d="BRC":"Mal.$"==b.Detailed.sing?d="MYR":"NT"==b.Detailed.sing?d="NTD":"\u0e3f"==b.Detailed.sing?d="THP":"Ykr"==b.Detailed.sing&&(d="TRL"),g++,f+=String.format("&item_name_"+
g+"=%s&amount_"+g+"=%f&quantity_"+g+"=%d",k.product.title,k.product.price,k.product.number)}f+=String.format("&business=%s&currency_code=%s",c.shoppingCartOptinon.paypal,d);return"http://www.paypal.com/cgi-bin/webscr?cmd=_cart&upload=1"+f},doCheckout:function(){if(!1!=this.canCheckout){var b="",b="Email"==this.setting.shoppingCartOptinon.type?this.getMailtoInformation(this.config,this.setting):this.getPaypalInformation(this.config,this.setting);window.open(b)}},refreshTotalValue:function(){this.shoppingItems||
(this.shoppingItems=[]);this.canCheckout=!0;var b=0,c=0;if(0<this.shoppingItems.length){for(var d=0;d<this.shoppingItems.length;d++){var c=this.shoppingItems[d],f=c.product;if(void 0==c.isSelected||c.isSelected())c=parseFloat(f.price*f.number),b+=c,f.number>f.quantity&&(this.canCheckout=!1)}this.total.text("Total: "+f.sing+b.toFixed(2))}else this.total.text("Total: 0.00");this.item.text("Item: "+this.shoppingItems.length)},refreshInputValue:function(){for(var b=ShoppingCartUtil.getProductsFromStorage(),
c=0,d=0;d<b.length;d++)c+=b[d].number;return c},removeItem:function(b){ShoppingCartUtil.removeProduct(b.product);b.singleShop.remove();for(var c=0;c<this.shoppingItems.length;c++)if(this.shoppingItems[c]==b){this.shoppingItems.remove(c);break}}});Class("ShoppingCartItem",{});
Class("MobileProductDetailsPanel",{create:function(b,c,d){this.advancedObj=new ShoppingAdvancedProperty(b);this._super(b,c,d);window.shoppingCart||(window.shoppingCart=new MobileShoppingCartPanel(b,c));shoppongCountHTML.html(window.shoppingCart.refreshInputValue());this.canCheckout=!0},destroy:function(){this.phoneContainer.empty();this.phoneContainer.remove()},initUI:function(){this.phoneContainer=$("<div class=phoneContainer></div>");this.toolBar=$("<div></div>");this.closeButton=$("<div></div>");
this.textTitle=$("<div>PRODUCT DETAILS</div>");this.phoneImg=$("<img/>");this.title=$("<div>"+this.config.Detailed.title+"</div>");this.title.text(this.title.text().overflow(30));this.phoneImgBox=$("<div></div>");this.contentText=$("<div></div>");this.shopDescribe=$("<div>"+this.config.Detailed.about+"</div>");this.price=$("<div>"+this.config.Detailed.sing+this.config.Detailed.proce+"</div>");this.mNumber=$("<div>Quantity :  </div>");this.input=$.browser.safari&&$.system.name==$.system.IOS?$("<input type='text' value='1' style='width:30px;text-align:center;margin:auto;top:0;bottom:0;height:20px;outline:medium;margin-left:25.5px;position:absolute;border:1px solid rgb(255,255,255)'/>"):
$("<input type='text' value='1' style='width:40px;text-align:center;margin:auto;top:0;bottom:0;height:20px;outline:medium;margin-left:25px;position:absolute;border:1px solid rgb(255,255,255)'/>");this.input.allowNumberOnly();this.mAdd=$("<img src='"+uiBaseURL+"cartAdd.png' style='cursor:pointer;width:25px ;height:25px;position:absolute;background-color:#DDDDDA' />");this.mLow=$("<img src='"+uiBaseURL+"cartLow.png' style='cursor:pointer;width:25px ;height:25px;margin-left:69px;position:absolute;background-color:#DDDDDA'/>");
this.transitTime=$("<div>Delivery time: "+this.config.Detailed.time+"day(s)</div>");this.allQuantity=$("<div> "+this.config.Detailed.quantity+" In Stock</div>");this.mAddToCart=$("<span>Add to cart</span>");this.mCheckOut=$("<span>Checkout</span>");this.mailto=$("<a style='text-decoration: none'></a>");this.inputChangRed=$("<span style='position:absolute;margin-top:18px;margin-left:30px;color:red;font-size:10px;width:115px;height:15px;right:30px'>Not enough in stock</span>");this.content=$("<div></div>");
this.addlow=$("<div></div>");tmpContainer.append(this.phoneContainer);this.phoneContainer.append(this.toolBar);this.phoneContainer.append(this.content);this.phoneContainer.append(this.contentText);this.toolBar.append(this.closeButton);this.toolBar.append(this.textTitle);this.phoneImgBox.append(this.phoneImg);this.contentText.append(this.title);this.contentText.append(this.shopDescribe);this.contentText.append(this.price);if(""!=this.advancedObj.advanced)for(var b=0;b<this.advancedObj.advanceLength;b++)"boolean"==
this.advancedObj.advanced[b].type&&(this.contentText.append(this.advancedObj.shopAdvanced1),this.advancedObj.shopAdvanced1.css("margin-left","15px")),"text"==this.advancedObj.advanced[b].type&&(this.contentText.append(this.advancedObj.shopAdvanced2),this.advancedObj.shopAdvanced2.css("margin-left","15px")),"list"==this.advancedObj.advanced[b].type&&(this.contentText.append(this.advancedObj.shopAdvanced3),this.advancedObj.shopAdvanced3.css("margin-left","15px"));this.contentText.append(this.mNumber).append(this.allQuantity).append(this.transitTime);
this.content.append(this.phoneImgBox).append(this.contentText);this.mailto.append(this.mCheckOut);this.phoneContainer.append(this.mAddToCart);this.phoneContainer.append(this.mailto);this.mNumber.append(this.addlow);this.addlow.append(this.mAdd).append(this.input).append(this.mLow);this.imgs=this.config.Detailed.imgs;this.imgs[0]||(this.imgs=[this.imgs.img]);this.imgsCount=this.imgs.length;!1===this.setting.shoppingCartOptinon.showPrice&&this.price.css({display:"none"});!1===this.setting.shoppingCartOptinon.showTime&&
this.transitTime.css({display:"none"});this.setMobileShopCss();this.initImgs()},initImgs:function(){this.setImgs(Metacharacter(this.imgs[0]));this.imageItems=[];for(var b=0;b<this.imgsCount;b++)this.imageItems[b]=isFlipPdf?"."+this.imgs[b]:this.imgs[b];1<this.imgsCount&&(this.setSwipe(),this.imageURL=this.imageItems[0])},setImgs:function(b){this.phoneImg.attr({src:b})},setSwipe:function(){this.currentIndex=0;var b=function(b,d){var f;f=30*windowWidth/1600;if(!(Math.abs(b)<=f)){var g=this.imageItems.length;
b<-f?this.currentIndex=(this.currentIndex+1)%g:b>f&&(0==this.currentIndex&&(this.currentIndex+=g),this.currentIndex=(this.currentIndex-1)%g);this.imageURL=this.imageItems[this.currentIndex];this.setImgs(Metacharacter(this.imageURL));$.browser.mise?event.cancelBubble=!0:event.stopPropagation()}}.bind(this);this.phoneImgBox.speed(b)},setMobileShopCss:function(){this.addlow.css({position:"absolute",width:"100px",height:"25px","margin-left":"55px"});this.content.css({position:"relative",width:windowWidth+
15+"px",height:windowHeight-90+"px","overflow-x":"hidden"});this.mCheckOut.css({position:"absolute","background-color":"#ff4400",width:windowWidth/2+"px",height:"40px","text-align":"center","line-height":"2.5","font-family":"Arial",right:"0",bottom:"0",cursor:"pointer",color:"white"});this.mAddToCart.css({position:"absolute","background-color":"#ffa800",width:windowWidth/2+"px",height:"40px","text-align":"center","line-height":"2.5","font-family":"Arial","margin-left":"0",bottom:"0",cursor:"pointer",
color:"white"});this.allQuantity.css({width:"300px",height:"14px","margin-top":"9px","font-size":"10px","padding-left":"15px",color:Color(44849).toString,"font-family":"Tahoma"});this.transitTime.css({width:"300px",height:"14px","margin-top":"12px",color:"black","font-size":"10px","padding-left":"15px","font-family":"Tahoma"});this.contentText.css({position:"relative",width:windowWidth+"px"});this.mNumber.css({width:windowWidth+"px",height:"40px","margin-top":"16px",color:"black","font-size":"10px",
"padding-left":"15px","font-family":"Tahoma"});this.price.css({position:"relative",width:windowWidth+"px",height:"20px","margin-top":"7px","font-size":"20px",color:Color(12845056).toString(),"font-family":"Tahoma","padding-left":"15px"});this.title.css({width:windowWidth-15+"px",height:"30px","font-size":"18px",color:"black","font-family":"Tahoma","padding-left":"15px","margin-top":"7px"});this.shopDescribe.css({width:windowWidth-20+"px","line-height":"1.6","font-size":"13px",color:"black","padding-left":"15px",
"margin-top":"5px","font-family":"Tahoma"});this.textTitle.css({position:"absolute",width:windowWidth/2+5,margin:"auto","font-size":"18px","font-family":"Tahoma",color:"rgb(140,140,140)","vertical-align":"middle","line-height":"2.2",left:"0",top:"0",bottom:"0",right:"0","text-align":"center"});this.toolBar.css({position:"relative",width:windowWidth+"px","background-color":"white",border:"rgb(239,232,232) 1px solid",height:"40px"});this.closeButton.css({position:"absolute",margin:"auto","background-image":"url("+
uiBaseURL+"houtui.png)","background-repeat":"no-repeat",cursor:"pointer",width:"28px",height:"28px",left:"10px",bottom:"0",top:"0"});this.phoneImg.css({position:"absolute","max-width":windowWidth-30+"px","max-height":0.3*windowHeight+"px",margin:"auto",left:"0",bottom:"0",top:"0",right:"0"});this.phoneImgBox.css({position:"relative",width:windowWidth+"px",height:0.35*windowHeight+"px","z-index":"3000"});this.phoneContainer.css({width:windowWidth+"px",height:"100%",position:"absolute",transform:"translate(100%,0)",
"-webkit-transform":"translate(100%,0)","-moz-transform":"translate(100%,0)","-o-transform":"translate(100%,0)","-ms-transform":"translate(100%,0)","background-color":"#f7f7f7","z-index":"3000"})},initEvent:function(){var b=function(b,d){var f;f=30*windowWidth/1600;Math.abs(b)<=f||b>f&&this.hide()}.bind(this);this.phoneContainer.speed(b);this.mailto.bind("click",this.doCheckout.bind(this));this.input.bind("blur",function(){parseInt(this.input.val())>this.config.Detailed.quantity?(this.mNumber.append(this.inputChangRed),
this.input.css({"border-color":"red"}),this.canCheckout=!1):(this.inputChangRed.remove(),this.input.css({"border-color":"rgb(255,255,255)"}),this.canCheckout=!0)}.bind(this));this.closeButton.bind("touchend",function(){this.hide()}.bind(this));this.mAdd.bind("touchend",function(){var b=parseInt(this.input.val())+1;this.input.val(b);b>this.config.Detailed.quantity?(this.mNumber.append(this.inputChangRed),this.input.css({"border-color":"red"}),this.canCheckout=!1):this.canCheckout=!0}.bind(this));this.mLow.bind("touchend",
function(){var b=parseInt(this.input.val());1!=b&&(b-=1,this.input.val(b),b<=this.config.Detailed.quantity&&(this.inputChangRed.remove(),this.input.css({"border-color":"rgb(255,255,255)"}),this.canCheckout=!0),this.input.val(b))}.bind(this));this.mAddToCart.bind("touchstart",function(){tmpContainer.append(window.shoppingCart.mCart);window.shoppingCart.showCart();var b={};b.image=1>=this.imgsCount?this.imgs[0]:this.imageURL;b.advancedName=this.advancedObj.setShoppingCartAdvanced().toString();b.title=
this.config.Detailed.title;b.sing=this.config.Detailed.sing;b.price=this.config.Detailed.proce;b.number=parseInt(this.input.val());b.quantity=this.config.Detailed.quantity;window.shoppingCart.addProduct(b);shoppongCountHTML.html(window.shoppingCart.refreshInputValue())}.bind(this))},show:function(){this.textTitle.css({display:"block"});this.contentText.css({display:"block"});this.mAddToCart.css({display:"block"});this.mCheckOut.css({display:"block"});this.phoneContainer.css({display:"block"});animateOnce.delay(this,
10,[this.phoneContainer,{transform:"translate(0,0)","-webkit-transform":"translate(0,0)","-moz-transform":"translate(0,0)","-o-transform":"translate(0,0)","-ms-transform":"translate(0,0)"},0.5,null,"","ease"])},hide:function(){animateOnce(this.phoneContainer,{transform:"translate(100%,0)","-webkit-transform":"translate(100%,0)","-moz-transform":"translate(100%,0)","-o-transform":"translate(100%,0)","-ms-transform":"translate(100%,0)"},0.3,null,"","ease")},informationHide:function(){this.mAddToCart.css({display:"none"});
this.mCheckOut.css({display:"none"});this.textTitle.css({display:"none"});this.contentText.css({display:"none"})},onResize:function(b,c){windowWidth=b;windowHeight=c;this.setMobileShopCss()}}).extend(ProductDetailsPanel);
Class("MobileShoppingCartPanel",{create:function(b,c){this.config=b;this.setting=c;this.mCart=$("<div></div>");this.cToolBar=$("<div></div>");this.cClose=$("<div></div>");this.cTitle=$("<div>SHOPPINGCART</div>");this.deletes=$("<span>Delete</span>");this.total=$("<span style='font-size:10px'>(Total:$0.00)</span>");this.mCartCheck=$("<div>CheckOut </div>");this.cartMailto=$("<a style='text-decoration: none'></a>");this.item=$("<span style='position: absolute;bottom: 40px;left: 20px;font-size:12px;font-family:Tahoma;font-weight:bold'></span>");
this.mCart.append(this.cartMailto);this.cartMailto.append(this.mCartCheck);this.mCartCheck.append(this.total);this.shop=$("<div></div>");this.mCart.append(this.cToolBar).append(this.deletes).append(this.shop);this.cToolBar.append(this.cClose).append(this.cTitle);this.setCartCss();this.initEvent();this.canCheckout=!1},addProduct:function(b){b=ShoppingCartUtil.addProduct(b);this.shop.empty();this.shoppingItems=[];for(var c=0;c<b.length;c++){var d=new MobileShoppingCartItem(this,b[c]);this.shop.append(d.singleShop);
this.shoppingItems.push(d)}},initEvent:function(){this.cartMailto.bind("click",this.doCheckout.bind(this));this.cClose.bind("touchend",function(){this.hideCart()}.bind(this));var b=function(b,d){var f;f=30*windowWidth/1600;Math.abs(b)<=f||b>f&&this.hideCart()}.bind(this);this.mCart.speed(b);this.deletes.bind("click",function(){for(var b=0;b<this.shoppingItems.length;){var d=this.shoppingItems[b];d.isSelected()?(this.removeItem(d),this.refreshTotalValue(),shoppongCountHTML.html(this.mobileShop.refreshInputValue())):
b++}}.bind(this))},setCartCss:function(){this.shop.css({width:windowWidth-20+"px",height:0.78*windowHeight+"px",position:"absolute",margin:"auto",top:"0px",left:"0px",bottom:"0px",right:"0px","overflow-x":"hidden"});this.mCartCheck.css({position:"absolute","background-color":"#ff4400",width:2/3*windowWidth+"px",height:"40px","text-align":"center","line-height":"2.5","font-family":"Arial",right:"0",bottom:"0",cursor:"pointer",color:"white"});this.deletes.css({position:"absolute","background-color":"#666666",
width:windowWidth/3+"px",height:"40px","text-align":"center","line-height":"2.5","font-family":"Arial","margin-left":"0",bottom:"0",cursor:"pointer",color:"white"});this.mCart.css({width:windowWidth+"px",height:windowHeight+"px",position:"absolute",transform:"translate(100%,0)","-webkit-transform":"translate(100%,0)","-moz-transform":"translate(100%,0)","-o-transform":"translate(100%,0)","-ms-transform":"translate(100%,0)","background-color":"#f7f7f7","z-index":"3000"});this.cTitle.css({position:"absolute",
width:windowWidth/2,margin:"auto","font-size":"18px","font-family":"Tahoma",color:"rgb(140,140,140)","vertical-align":"middle","line-height":"2.5",left:"0",top:"0",bottom:"0",right:"0","text-align":"center"});this.cToolBar.css({position:"relative",width:windowWidth+"px","background-color":"white",border:"rgb(239,232,232) 1px solid",height:"40px"});this.cClose.css({position:"absolute",margin:"auto","background-image":"url("+uiBaseURL+"houtui.png)","background-repeat":"no-repeat",cursor:"pointer",width:"28px",
height:"28px",left:"10px",bottom:"0",top:"0"})},showCart:function(){this.mCart.css({display:"block"});animateOnce.delay(this,10,[this.mCart,{transform:"translate(0,0)","-webkit-transform":"translate(0,0)","-moz-transform":"translate(0,0)","-o-transform":"translate(0,0)","-ms-transform":"translate(0,0)"},0.5,null,"","ease"])},hideCart:function(){animateOnce(this.mCart,{transform:"translate(100%,0)","-webkit-transform":"translate(100%,0)","-moz-transform":"translate(100%,0)","-o-transform":"translate(100%,0)",
"-ms-transform":"translate(100%,0)"},0.3,null,"","ease")}}).extend(ShoppingCartPanel);
Class("MobileShoppingCartItem",{create:function(b,c){this.mobileShop=b;this.product=c;this.addlow=$("<div></div>");this.singleShop=$("<div></div>");this.checkBox=$("<input type=checkbox name=checkbox1 style='position:relative' style='position:absolute'/>");this.checkBox[0].product=c;this.shoppingImage=$("<img/>");this.cartNot=$("<span style='position:absolute;color:red;font-size:10px;width:115px;height:10px'>Not enough in stock</span>");this.cartInput=$.browser.safari&&$.system.name==$.system.IOS?
$("<input type='text' value='"+this.product.number+"' style='width:30px;margin-top:39px;text-align:center;height:20px;outline:medium;right:26.5px;position:absolute;border:1px solid rgb(255,255,255)'/>"):$("<input type='text' value='"+this.product.number+"' style='width:40px;margin-top:40px;text-align:center;height:20px;outline:medium;right:26px;position:absolute;border:1px solid rgb(255,255,255)'/>");this.cartInput.allowNumberOnly();this.cartadd=$("<img src='"+uiBaseURL+"cartAdd.png' style='cursor:pointer;margin-top:40px;width:25px ;height:25px;right:70px;position:absolute;background-color:#DDDDDA' />");
this.cartlow=$("<img src='"+uiBaseURL+"cartLow.png' style='cursor:pointer;margin-top:40px;width:25px ;height:25px;right:1px;position:absolute;background-color:#DDDDDA'/>");this.carttitle=$("<span style='width:100px;height:45px;position:absolute;margin-top: 20px;left:100px;font-family:Tahoma;font-size:12px'></span>");this.cartPrice=$("<span></span>");null==this.product.advancedName||""==this.product.advancedName?(this.carttitle.text(this.carttitle.text().overflow(18)),this.carttitle.text(this.product.title)):
this.carttitle.text(this.product.title+"("+this.product.advancedName+")");this.cartPrice.text(this.product.sing+forceFloat(this.product.price));this.shoppingImage.attr("src",this.product.image);this.singleShop.append(this.checkBox).append(this.shoppingImage).append(this.carttitle).append(this.cartPrice).append(this.addlow).append(this.cartadd).append(this.cartInput).append(this.cartlow).append($("<hr style='position:absolute;margin:auto;margin-top:85px;width:480px'/>"));this.cartInput.val()>c.quantity&&
(this.addlow.append(this.cartNot),this.cartInput.css({"border-color":"red"}),this.canCheckout=!1);this.setOneShop();this.initEvent()},initEvent:function(){this.checkBox.bind("click",function(){(function(){this.mobileShop.refreshTotalValue();shoppongCountHTML.html(this.mobileShop.refreshInputValue())}).delay(this,10)}.bind(this));this.cartInput.bind("blur",function(){var b=parseInt(this.cartInput.val());b>this.product.quantity?(this.addlow.append(this.cartNot),this.cartInput.css({"border-color":"red"}),
this.canCheckout=!1):(this.cartNot.remove(),this.cartInput.css({"border-color":"rgb(255,255,255)"}),this.canCheckout=!0);this.product.number=b;ShoppingCartUtil.saveProducts(this.mobileShop.shoppingItems,this.mobileShop.setting);shoppongCountHTML.html(this.mobileShop.refreshInputValue())}.bind(this));this.cartadd.bind("touchend",function(){var b=parseInt(this.cartInput.val()),b=b+1;this.cartInput.val(b);this.product.number=b;this.mobileShop.refreshTotalValue();b>this.product.quantity?(this.addlow.append(this.cartNot),
this.cartInput.css({"border-color":"red"}),this.canCheckout=!1):this.canCheckout=!0;ShoppingCartUtil.saveProducts(this.mobileShop.shoppingItems,this.mobileShop.setting);shoppongCountHTML.html(this.mobileShop.refreshInputValue())}.bind(this));this.cartlow.bind("touchend",function(){var b=parseInt(this.cartInput.val()),b=b-1;0>b||(this.cartInput.val(b),this.product.number=b,this.mobileShop.refreshTotalValue(),this.mobileShop.refreshInputValue(),b<=this.product.quantity?(this.cartNot.remove(),this.cartInput.css({"border-color":"rgb(255,255,255)"}),
this.canCheckout=!0):this.canCheckout=!1,ShoppingCartUtil.saveProducts(this.mobileShop.shoppingItems,this.mobileShop.setting),shoppongCountHTML.html(this.mobileShop.refreshInputValue()))}.bind(this))},isSelected:function(){return this.checkBox[0].checked},setOneShop:function(){this.cartPrice.css({position:"absolute",width:"70px",height:"20px","margin-top":"40px","font-size":"15px",color:"rgb(250,11,11)","margin-top":"60px","font-family":"Tahoma",left:"100px"});this.addlow.css({width:"115px",height:"20px",
position:"absolute",right:"0px","margin-top":"55px"});this.shoppingImage.css({position:"absolute",width:"70px",height:"70px","margin-top":"20px"});this.singleShop.css({width:windowWidth+"px",height:"120px"})}}).extend(ShoppingCartItem);
Class("PCProductDetailsPanel",{create:function(b,c,d){this.advancedObj=new ShoppingAdvancedProperty(b);this._super(b,c,d);window.shoppingCart||(window.shoppingCart=new PCShoppingCartPanel(b,c));window.shoppingCart.onClose=this.shoppingCartClose.bind(this);shoppongCountHTML.html(window.shoppingCart.refreshInputValue());this.canCheckout=!0},destroy:function(){this.container.empty();this.container.remove()},initUI:function(){this.imgs=this.config.Detailed.imgs;this.imgs[0]||(this.imgs=[this.imgs.img]);
this.imgsCount=this.imgs.length;this.imgBox=$("<div></div>");this.shopImg=$("<img/>");this.background=$("<div></div>");this.container=$("<div id='ShoppingCart' ></div>");this.closeButton=$("<div></div>");this.content=$("<div></div>");this.contentText=$("<div></div>");this.shopTitle=$("<div></div>");this.shopPrice=$("<div>Price:  "+this.config.Detailed.sing+this.config.Detailed.proce+"</div>");this.allQuantity=$("<div> "+this.config.Detailed.quantity+" In Stock</div>");this.bgImage=$("<div style='display:none'></div>");
this.time=$("<div>Delivery time: "+this.config.Detailed.time+"day(s)</div>");this.about=$("<div>"+this.config.Detailed.about+"</div>");this.number=$("<div>Quantity : </div>");this.addToCart=$("<span>Add to cart</span>");this.checkout=$("<a><div>Checkout</div></a>");this.close=$("<span>Close</span>");this.input=$("<input type='text' value='1' style='width : 70px;height:12px;outline:medium;margin-left:22px;position:absolute;background:transparent;border:1px solid rgb(150,150,150)'/>");this.input.allowNumberOnly();
this.add=$("<img src='"+uiBaseURL+"cartAdd.png' style='cursor:pointer;width:17px ;height:17px;position:absolute' />");this.low=$("<img src='"+uiBaseURL+"cartLow.png' style='cursor:pointer;width:17px ;height:17px;margin-left:100px;position:absolute'/>");this.not=$("<span style='position:absolute;color:red;font-size:10px;width:115px;height:10px;right:30px'>Not enough in stock</span>");this.setShopCss();tmpContainer.append(this.bgImage);tmpContainer.append(this.container);this.container.append(this.content);
this.container.append(this.closeButton);this.content.append(this.imgBox);this.imgBox.append(this.shopImg);this.content.append(this.contentText);this.contentText.append(this.shopTitle);this.contentText.append(this.shopPrice);if(""!=this.advancedObj.advanced)for(var b=0,c=0;c<this.advancedObj.advanceLength;c++)b+=30,"boolean"==this.advancedObj.advanced[c].type&&this.contentText.append(this.advancedObj.shopAdvanced1),"text"==this.advancedObj.advanced[c].type&&this.contentText.append(this.advancedObj.shopAdvanced2),
"list"==this.advancedObj.advanced[c].type&&this.contentText.append(this.advancedObj.shopAdvanced3),this.about.css({width:"320px",height:150-b+"px","margin-top":"10px","font-size":"10px","font-family":"Arial","overflow-x":"hidden"});this.contentText.append(this.number);this.number.append(this.add);this.number.append(this.input);this.number.append(this.low);this.contentText.append(this.allQuantity);this.contentText.append(this.time);this.contentText.append(this.about);this.contentText.append(this.addToCart);
this.contentText.append(this.close);this.shopTitle.html(this.config.Detailed.title);this.shopTitle.text(this.shopTitle.text().overflow(16));this.mailto=$("<a></a>");this.mailto.append(this.checkout);this.contentText.append(this.mailto);this.contentText.css("display","none");!1===this.setting.shoppingCartOptinon.showPrice&&this.shopPrice.css({display:"none"});!1===this.setting.shoppingCartOptinon.showTime&&this.time.css({display:"none"});this.initImgs();$(window).resize(this.onResize())},initImgs:function(){this.setImgs(Metacharacter(this.imgs[0]));
this.imageItems=[];for(var b=0;b<this.imgsCount;b++)this.imageItems[b]=isFlipPdf?"."+this.imgs[b]:this.imgs[b];1<this.imgsCount&&(this.imageURL=this.imageItems[0],this.initButton())},setImgs:function(b){this.shopImg.attr("src",b)},initButton:function(){this.leftButton=$('<img src="'+uiBaseURL+'previous_normal_down.png" style="position:absolute;z-index:1000"></img>');this.rightButton=$('<img src="'+uiBaseURL+'next_normal.png" style="position:absolute;z-index:1000"></img>');this.setButtonPosition();
this.currentIndex=0;var b=this.imageItems.length;this.leftButton.bind("click",function(){this.busy=!0;0==this.currentIndex&&(this.currentIndex+=b);this.currentIndex=(this.currentIndex-1)%b;this.imageURL=Metacharacter(this.imageItems[this.currentIndex]);this.setImgs(this.imageURL)}.bind(this));this.rightButton.bind("click",function(){this.busy=!0;this.currentIndex=(this.currentIndex+1)%b;this.imageURL=Metacharacter(this.imageItems[this.currentIndex]);this.setImgs(this.imageURL)}.bind(this));this.imgBox.append(this.leftButton).append(this.rightButton)},
setButtonPosition:function(){this.leftButton.css({left:"0px",top:"130.5px"});this.rightButton.css({right:"0px",top:"130.5px"})},setShopCss:function(){this.bgImage.css({position:"absolute",width:windowWidth+"px",height:windowHeight+"px",opacity:"0.5",top:0,"background-color":"black","z-index":"100"});var b="translate(0, "+-((windowHeight-430)/2+430)+"px)";this.container.css({position:"absolute",width:"730px",height:"430px",margin:"auto",left:"0",top:"0",bottom:"0",right:"0",transform:b,"-webkit-transform":b,
"-moz-transform":b,"-o-transform":b,"-ms-transform":b,"z-index":"2000"});this.content.css({position:"absolute",width:"700",height:"400",margin:"auto",left:"0",top:"0",bottom:"0",right:"0","background-color":"white","z-index":"2000"});this.closeButton.css({position:"absolute",width:"20px",height:"20px",right:"0","background-image":"url("+uiBaseURL+"closecat.png)","background-repeat":"no-repeat",cursor:"pointer"});this.imgBox.css({position:"absolute",width:"360px",height:"325px",margin:"auto",left:"10px",
top:"0",bottom:"20px"});this.shopImg.css({"max-width":"325px","max-height":"325px",position:"absolute",margin:"auto",left:"0",top:"0",bottom:"0",right:"0"});this.contentText.css({position:"absolute",width:"304px",height:"355px",margin:"auto","margin-top":"30px",right:"10px","overflow-x":"hidden"});this.shopTitle.css({width:"300px",height:"30px","font-size":"32px",color:"black","font-family":"Arial","font-weight":"bold"});this.about.css({width:"320px",height:"150px","margin-top":"10px","font-size":"10px",
"font-family":"Arial","overflow-x":"hidden"});this.number.css({width:"300px",height:"20px","margin-top":"5px",color:"black","font-size":"10px","font-family":"Arial"});this.time.css({width:"300px",height:"14px","margin-top":"8px",color:"black","font-size":"10px","font-family":"Arial"});this.allQuantity.css({width:"300px",height:"14px","margin-top":"8px","font-size":"10px",color:colorTo0x(44849),"font-family":"Arial"});this.shopPrice.css({width:"300px",height:"18px","margin-top":"8px","font-size":"16px",
color:colorTo0x(12845056),"font-family":"Arial"});this.addToCart.css({position:"absolute","background-image":$.browser.prefix+"linear-gradient(90deg, "+colorTo0x(6579300)+", "+colorTo0x(4342338)+")",width:"68px","text-align":"center","line-height":"2.0","font-size":"10px","font-family":"Arial",bottom:"10px","margin-left":"85px",cursor:"pointer",color:"white"});this.checkout.css({position:"absolute","background-image":$.browser.prefix+"linear-gradient(90deg, "+colorTo0x(6579300)+", "+colorTo0x(4342338)+
")",width:"60px","text-align":"center","line-height":"2.0","font-size":"10px","font-family":"Arial",bottom:"10px",right:"87px",cursor:"pointer",color:"white","text-decoration":"none"});this.close.css({position:"absolute","background-image":$.browser.prefix+"linear-gradient(90deg, "+colorTo0x(6579300)+", "+colorTo0x(4342338)+")",width:"40px","text-align":"center","line-height":"2.0","font-size":"10px","font-family":"Arial",bottom:"10px",right:"30px",cursor:"pointer",color:"white"})},initEvent:function(){this.input.bind("blur",
function(){parseInt(this.input.val())>this.config.Detailed.quantity?(this.number.append(this.not),this.input.css({"border-color":"red"}),this.canCheckout=!1):(this.not.remove(),this.input.css({"border-color":"rgb(150,150,150)"}),this.canCheckout=!0)}.bind(this));this.add.bind("click",function(){var b=this.input.val(),b=parseInt(b)+1;this.input.val(b);b>this.config.Detailed.quantity?(this.number.append(this.not),this.input.css({"border-color":"red"}),this.canCheckout=!1):this.canCheckout=!0}.bind(this));
this.low.bind("click",function(){var b=parseInt(this.input.val());0!=b&&(b-=1,b<=this.config.Detailed.quantity&&(this.not.remove(),this.input.css({"border-color":"rgb(150,150,150)"}),this.canCheckout=!0),this.input.val(b))}.bind(this));this.mailto.bind("click",this.doCheckout.bind(this));this.bgImage.bind(_event._end,function(){this.hide();window.shoppingCart.cart.css({display:"none"});this.bgImage.css({display:"none"})}.bind(this));this.closeButton.bind("click",this.hide.bind(this));this.close.bind("click",
this.hide.bind(this));this.addToCart.bind("click",function(){bookContainer.append(this.cart);this.skipHeid();window.shoppingCart.showCart();var b={};b.image=1>=this.imgsCount?this.imgs[0]:this.imageURL;b.advancedName=this.advancedObj.setShoppingCartAdvanced().toString();b.title=this.config.Detailed.title;b.sing=this.config.Detailed.sing;b.price=this.config.Detailed.proce;b.number=parseInt(this.input.val());b.quantity=this.config.Detailed.quantity;window.shoppingCart.addProduct(b);shoppongCountHTML.html(window.shoppingCart.refreshInputValue())}.bind(this))},
shoppingCartClose:function(){this.bgImage.css({display:"none"})},onResize:function(){var b=this.container.css("width"),c=this.container.css("height");this.height=parseInt(c.replace("px",""));this.width=parseInt(b.replace("px",""));this.container.css({"margin-left":(windowWidth-this.width)/2+"px","margin-top":(windowHeight-this.height)/2+"px"})},skipHeid:function(){var b=this.container.css("height");this.height=parseInt(b.replace("px",""));b="translate(0, "+-((windowHeight-this.height)/2+this.height)+
"px)";b={transform:b,"-webkit-transform":b,"-moz-transform":b,"-o-transform":b,"-ms-transform":b};this.bgImage.css({display:"none"});animateOnce(this.container,b,0.5,null,"","ease-in-out")},hide:function(){var b=this.container.css("height");this.height=parseInt(b.replace("px",""));b="translate(0, "+-((windowHeight-this.height)/2+this.height)+"px)";b={transform:b,"-webkit-transform":b,"-moz-transform":b,"-o-transform":b,"-ms-transform":b};this.bgImage.css({display:"none"});this.contentText.css("display",
"none");animateOnce(this.container,b,0.5,null,"","ease-in-out")},show:function(){this.bgImage.css({display:"block"});animateOnce.delay(this,10,[this.container,{transform:"translate(0px,0px)","-webkit-transform":"translate(0px,0px)","-moz-transform":"translate(0px,0px)","-o-transform":"translate(0px,0px)","-ms-transform":"translate(0px,0px)"},0.5,function(){this.contentText.css("display","block")}.bind(this),"","ease-in-out"])}}).extend(ProductDetailsPanel);
Class("PCShoppingCartPanel",{create:function(b,c){this.config=b;this.setting=c;this.cart=$("<div></div>");this.cartTitles=$("<span>Shopping Cart</span>");this.cartprices=$("<span style='position:absolute;font-size:12px;font-weight:bold;margin-top:50px;right:80px;font-family:Tahoma;color:black'>Price</span>");this.cartqu=$("<span style='position:absolute;font-size:12px;font-weight:bold;margin-top:50px;right:180px;font-family:Tahoma;color:black'>Quantity</span>");this.shopping=$("<div id='shopPrice'></div>");
this.item=$("<span class=itemss style='position: absolute;bottom: 40px;left: 20px;font-size:12px;font-family:Tahoma;font-weight:bold'></span>");this.total=$("<span></span>");this.cartCheckout=$("<span>Checkout</span>");this.cartClose=$("<span>Close</span>");this.cartMailto=$("<a></a>");this.cart.append(this.cartTitles);this.cart.append(this.cartqu);this.cart.append(this.cartprices);this.cart.append(this.shopping);this.cart.append(this.item);this.cart.append(this.total);window.bgImage=$("<div></div>");
this.cartMailto.append(this.cartCheckout);this.cart.append(this.cartMailto);this.cart.append(this.cartClose);tmpContainer.append(window.bgImage);tmpContainer.append(this.cart);this.promptBox=$("<div></div>");this.setCartCss();this.hideCart();this.initEvent();this.canCheckout=!1},initEvent:function(){window.bgImage.bind(_event._end,function(){this.cart.css({display:"none"});window.bgImage.css({display:"none"})}.bind(this));this.cartMailto.bind("click",this.doCheckout.bind(this));this.cartMailto.bind("click",
function(){}.bind(this));this.cartClose.bind("click",function(){this.hideCart();if(this.onClose)this.onClose();ShoppingCartUtil.saveProducts(this.shoppingItems,this.setting)}.bind(this))},addProduct:function(b){b=ShoppingCartUtil.addProduct(b);this.shopping.empty();for(var c=0;c<b.length;c++){var d=new PCShoppingCartItem(this,b[c]);this.shopping.append(d.singleShop)}this.refreshTotalValue();this.refreshInputValue()},showCart:function(){this.cart.css("display","block");window.bgImage.css("display",
"block")},hideCart:function(){this.cart.css("display","none");window.bgImage.css("display","none")},setCartCss:function(){window.bgImage.css({position:"absolute",width:windowWidth+"px",height:windowHeight+"px",opacity:"0.5",top:0,"background-color":"black","z-index":"100"});this.shopping.css({width:"515px",height:"190px",position:"absolute",margin:"auto",top:"10px",left:"0px",bottom:"0px",right:"0px","overflow-x":"hidden"});this.total.css({position:"absolute",bottom:"40px",right:"20px","font-size":"12px",
"font-family":"Tahoma","font-weight":"bold"});this.cartClose.css({position:"absolute","background-image":$.browser.prefix+"linear-gradient(90deg, "+colorTo0x(6579300)+", "+colorTo0x(4342338)+")",width:"40px","text-align":"center","line-height":"2.0","font-size":"10px","font-family":"Arial",bottom:"10px",right:"30px",cursor:"pointer",color:"white"});this.cartCheckout.css({position:"absolute","background-image":$.browser.prefix+"linear-gradient(90deg, "+colorTo0x(6579300)+", "+colorTo0x(4342338)+")",
width:"60px","text-align":"center","line-height":"2.0","font-size":"10px","font-family":"Arial",bottom:"10px",right:"87px",cursor:"pointer",color:"white","text-decoration":"none"});this.cartTitles.css({position:"absolute","padding-left":"10px",width:"489px","border-bottom":"1px solid white",height:"40px","font-size":"12px","font-family":"Tahoma",color:"white","background-color":"rgb(152,152,152)"});this.cart.css({position:"absolute",border:"1px solid white","line-height":"2.5",margin:"auto",left:"0",
top:"0",bottom:"0",right:"0",width:"500px",height:"350px","background-color":"rgb(218,218,218)","overflow-x":"hidden","z-index":"3000"})}}).extend(ShoppingCartPanel);
Class("PCShoppingCartItem",{create:function(b,c){this.shop=b;this.product=c;this.cartPrice=$("<span></span>");this.addlow=$("<div></div>");this.singleShop=$("<div style='width:480px;height:80px'></div>");this.cartInput=$("<input id='cartinput' type='text' value='"+this.product.number+"'/>");this.cartInput.allowNumberOnly();this.shoppingImage=$("<img/>");this.carttitle=$("<span style='width:180px;line-height:1.3;height:50px;position:absolute;margin-top: 25px;left:60px;font-family:Tahoma;font-size:12px'></span>");
this.dustbin=$("<img src='"+uiBaseURL+"cartDelete.png' style='cursor:pointer;position:absolute;right: 30px;margin-top:35px'/>");this.cartadd=$("<img src='"+uiBaseURL+"cartAdd.png' style='cursor:pointer;width:17px ;height:17px;position:absolute;padding-top:2px;left:25px' />");this.cartlow=$("<img src='"+uiBaseURL+"cartLow.png' style='cursor:pointer;width:17px ;height:17px;margin-left:100px;position:absolute'/>");this.cartNot=$("<span style='position:absolute;color:red;font-size:10px;width:115px;height:10px;margin-top:15px;left:15px'>Not enough in stock</span>");
this.singleShop.append(this.shoppingImage);this.singleShop.append(this.carttitle);this.singleShop.append(this.addlow);this.singleShop.append(this.cartPrice);this.singleShop.append(this.dustbin);this.addlow.append(this.cartadd);this.addlow.append(this.cartlow);this.addlow.append(this.cartInput);this.setImg(Metacharacter(this.product.image));!1===pageEditor.setting.shoppingCartOptinon.showPrice&&this.cartPrice.css({display:"none"});null==this.product.advancedName||""==this.product.advancedName?(this.carttitle.text(this.carttitle.text().overflow(16)),
this.carttitle.text(this.product.title)):this.carttitle.text(this.product.title+"("+this.product.advancedName+")");this.cartPrice.text(this.product.sing+forceFloat(this.product.price));this.singleShop.append($("<hr style='position:absolute;margin:auto;margin-top:85px;width:480px'/>"));this.cartInput.val()>c.quantity&&(this.addlow.append(this.cartNot),this.cartInput.css({"border-color":"red"}),this.shop.canCheckout=!1);this.initEvent();this.setCartCSS()},setImg:function(b){this.shoppingImage.attr("src",
b)},initEvent:function(){this.cartInput.bind("blur",function(){var b=parseInt(this.cartInput.val());""==b&&(b=this.cartInput.val());b>this.product.quantity?(this.addlow.append(this.cartNot),this.cartInput.css({"border-color":"red"}),this.canCheckout=!1):(this.cartNot.remove(),this.cartInput.css({"border-color":"rgb(150,150,150)"}),this.canCheckout=!0)}.bind(this));this.dustbin.bind("click",function(){this.shop.removeItem(this);this.shop.refreshTotalValue();shoppongCountHTML.html(this.shop.refreshInputValue())}.bind(this));
this.cartadd.bind("click",function(){var b=this.cartInput.val(),b=parseInt(b)+1;this.cartInput.val(b);this.product.number=b;b>this.product.quantity&&(this.addlow.append(this.cartNot),this.cartInput.css({"border-color":"red"}));this.shop.refreshTotalValue();ShoppingCartUtil.saveProducts(this.shop.shoppingItems,this.shop.setting);shoppongCountHTML.html(this.shop.refreshInputValue())}.bind(this));this.cartlow.bind("click",function(){var b=this.cartInput.val();0!=parseInt(b)&&(b=parseInt(b)-1,this.cartInput.val(b),
this.product.number=b,b<=this.product.quantity&&(this.cartNot.remove(),this.cartInput.css({"border-color":"rgb(150,150,150)"})),this.shop.refreshTotalValue(),ShoppingCartUtil.saveProducts(this.shop.shoppingItems,this.shop.setting),shoppongCountHTML.html(this.shop.refreshInputValue()))}.bind(this))},setCartCSS:function(){this.cartPrice.css({position:"absolute",width:"70px",height:"20px","margin-top":"12px","font-size":"12px",color:"black","margin-top":"30px","font-family":"Tahoma",right:"50px"});this.cartInput.css({"text-align":"center",
width:"40px",height:"15px",outline:"medium","margin-left":"50px",position:"absolute",background:"transparent",border:"1px solid rgb(150,150,150)"});this.addlow.css({width:"120px",height:"40px",position:"absolute",right:"170px",position:"absolute","margin-top":"35px"});this.shoppingImage.css({position:"absolute",width:"52px",height:"35px","margin-top":"28px"})}}).extend(ShoppingCartItem);
Class("ShoppingAdvancedProperty",{create:function(b){this.config=b;this.advanced=this.config.Detailed.advanced;this.advanceLength=this.advanced.length;this.advanced[0]||(this.advanced=[this.advanced.list]);this.shopAdvanced1=$("<div style='width:300px; height:25px;margin-top:5px'></div>");this.shopAdvanced2=$("<div style='width:300px; height:30px;margin-top:7px'></div>");this.shopAdvanced3=$("<div style='width:300px; height:30px;margin-top:7px'></div>");for(b=0;b<this.advanceLength;b++)"list"==this.advanced[b].type&&
(this.advanceListValue=this.advanced[b].defaultValue);this.initAdvanced();this.setAdvanceEvent()},initAdvanced:function(){var b=0;this.shopSelect=[];for(var c=0;c<this.advanceLength;c++)if(b+=20,"boolean"==this.advanced[c].type&&(this.shopTypeName=$("<div style='margin-left:25px;width:155px; height:20px;font-family:Arial; font-size:12px;line-height:1.5'>"+this.advanced[c].name+"</div>"),this.checkBox=$("<input type=checkbox style='position:absolute'/>"),!0===this.advanced[c].defaultValue&&this.checkBox.attr("checked",
"checked"),this.shopAdvanced1.append(this.checkBox).append(this.shopTypeName)),"text"==this.advanced[c].type&&(this.shopTypeName=$("<div style='width:55px; height:20px;font-family:Arial;font-size:12px;position:absolute'>"+this.advanced[c].name+":</div>"),this.shopValue=$("<input style='width:200px;position:absolute;left:50px; height:16px;font-family:Arial; font-size:12px;outline:medium' value="+this.advanced[c].value+"/>"),this.shopAdvanced2.append(this.shopTypeName).append(this.shopValue)),"list"==
this.advanced[c].type){var d=[],d=this.advanced[c].value.split(";"),f=0;this.shopTypeName=$("<div style='position:absolute;width:55px; height:20px;font-family:Arial; font-size:12px'>"+this.advanced[c].name+":</div>");this.shopAdvanced3.append(this.shopTypeName);for(var g=0;g<d.length;g++)0<g&&0==g%5&&(this.shopAdvanced3.append("<br/><br/>"),f=0,this.shopAdvanced3.css("height",40+b+"px")),f+=50,this.shopSelect[g]=$("<div class=borderStyle style='height:20px;cursor:pointer;font-family:Arial; font-size:12px;border:1px solid black;left:"+
f+"px;position:absolute;text-align:center;line-height:1.7;padding-left:4px;padding-right:4px'>"+d[g]+"</div>"),this.advanced[c].defaultValue==d[g]&&this.shopSelect[g].css("border","2px solid rgb(255,0,0)"),this.shopAdvanced3.append(this.shopSelect[g])}},setAdvanceEvent:function(){for(var b=this.shopSelect.length,c=this.shopSelect,d=this,f=0;f<b;f++)c[f].bind("click",function(){for(j=0;j<b;j++)c[j][0]==this?(d.advanceListValue=c[j][0].innerText,c[j].css("border","2px solid rgb(255,0,0)")):c[j].css("border",
"1px solid rgb(0,0,0)")})},isCheckBoxSelected:function(){return this.checkBox[0].checked},setShoppingCartAdvanced:function(){var b="";if(0!=this.advanceLength)for(var c=0;c<this.advanceLength;c++)"text"==this.advanced[c].type&&(this.advanced[c].defaultValue=this.shopValue.val()),"list"==this.advanced[c].type&&(this.advanced[c].defaultValue=this.advanceListValue),this.isCheckBoxSelected()&&"boolean"==this.advanced[c].type&&(this.advanced[c].defaultValue=this.isCheckBoxSelected().toString()),b+=this.advanced[c].name+
":"+this.advanced[c].defaultValue+"  ";return b}});
Class("Pentagon",{Package:"PageItem",create:function(b,c,d,f){this._super(b,c,d,f);this.color=Color(this.config.color).toString();this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;this.width=this.config.width*this.pageWidth;this.height=this.config.height*this.pageHeight;this.colorA=Color(this.config.colorA).toString();this.colorB=Color(this.config.colorB).toString();this.pentagon=$("<canvas width='"+this.width+"' height='"+this.height+"'></canvas>");this.pentagon.css({position:"absolute",
left:this.x+"px",top:this.y+"px"});b.append(this.pentagon);this.draw();this.initEvent()},draw:function(){var b=this.pentagon[0],c=b.getContext("2d");c.clearRect(0,0,b.width,b.height);this.width-=this.config.borderWidth;this.height-=this.config.borderWidth;c.beginPath();c.lineCap="round";c.lineJoin="round";c.strokeStyle=Color(this.config.borderColor).toString();c.lineWidth=this.config.borderWidth;c.globalAlpha=this.config.spalpha;c.globalAlpha=1;c.moveTo(this.config.borderWidth,3*this.height/8);c.lineTo(this.width/
6,this.height);c.lineTo(5*this.width/6,this.height);c.lineTo(this.width,3*this.height/8);c.lineTo(this.width/2,this.config.borderWidth);this.config.sh&&(c.shadowOffsetX=this.config.sx,c.shadowOffsetY=this.config.sy,c.shadowBlur=this.config.sd,c.shadowColor=Color(this.config.sc).toString());if("gradient"==this.config.fillStyle){var d=this.config.angle*Math.PI/180,b=this.width/2+this.width/2*Math.cos(d),d=this.height/2+this.height/2*Math.sin(d),f=(this.config.angle+180)*Math.PI/180,g=this.width/2+this.width/
2*Math.cos(f),f=this.height/2+this.height/2*Math.sin(f),b=c.createLinearGradient(g,f,b,d);b.addColorStop(0,this.colorA);b.addColorStop(1,this.colorB);c.fillStyle=b;c.fill()}"Pure"==this.config.fillStyle&&(c.fillStyle=this.color,c.fill());c.closePath();0!=this.config.borderWidth&&c.stroke()},initEvent:function(){this.audios=this.slide=this.form=null;this.flag=0;this.linkURL="";if(null!=this.config.action){null!=this.config.action.length&&(this.config.action=this.config.action[0]);this.linkURL=this.config.action.url;
null!=this.linkURL&&"www"==this.linkURL.substr(0,3).toLowerCase()&&(this.linkURL="http://"+this.linkURL);var b;try{b=this.config.action.triggerEventType}catch(c){b=null}}this.onActionEvent(this.pentagon,b)},onResize:function(b,c){this.pageWidth=b;this.pageHeight=c;this.width=this.pageWidth*this.config.width;this.height=this.pageHeight*this.config.height;this.pentagon[0].width=this.width;this.pentagon[0].height=this.height;this.draw();this.setPosition();if(null!=this.form)this.form.onResize(bookContainer.width(),
bookContainer.height());if(null!=this.slide)this.slide.onResize(bookContainer.width(),bookContainer.height());if(null!=this.audios)this.audios.onResize(bookContainer.width(),bookContainer.height())},setPosition:function(){this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;this.pentagon.css({left:this.x+"px",top:this.y+"px"})}}).extend(PageItem.Item);
Class("Dovetailed",{Package:"PageItem",create:function(b,c,d,f){this._super(b,c,d,f);this.color=Color(this.config.color).toString();this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;this.width=this.config.width*this.pageWidth;this.height=this.config.height*this.pageHeight;this.colorA=Color(this.config.colorA).toString();this.colorB=Color(this.config.colorB).toString();this.dovetailed=$("<canvas width='"+this.width+"' height='"+this.height+"'></canvas>");this.dovetailed.css({position:"absolute",
left:this.x+"px",top:this.y+"px"});b.append(this.dovetailed);this.draw();this.initEvent()},draw:function(){var b=this.dovetailed[0],c=b.getContext("2d");c.clearRect(0,0,b.width,b.height);this.width-=this.config.borderWidth;this.height-=this.config.borderWidth;this.config.arrowWidth>2*this.width/3&&(this.arrowWidth=this.width-2*this.width/3);0==this.config.arrowWidth?(this.arrowWidth=this.width-10,this.config.arrowWidth=10):this.arrowWidth=this.width-this.config.arrowWidth;c.beginPath();c.lineCap=
"round";c.lineJoin="round";c.strokeStyle=Color(this.config.borderColor).toString();c.lineWidth=this.config.borderWidth;c.globalAlpha=this.config.spalpha;c.moveTo(this.config.borderWidth,this.config.borderWidth);c.lineTo(this.config.arrowWidth,(this.height+this.config.borderWidth)/2);c.lineTo(this.config.borderWidth,this.height);c.lineTo(this.arrowWidth,this.height);c.lineTo(this.width,(this.height+this.config.borderWidth)/2);c.lineTo(this.arrowWidth,this.config.borderWidth);this.config.sh&&(c.shadowOffsetX=
this.config.sx,c.shadowOffsetY=this.config.sy,c.shadowBlur=this.config.sd,c.shadowColor=Color(this.config.sc).toString());if("gradient"==this.config.fillStyle){var d=this.config.angle*Math.PI/180,b=this.width/2+this.width/2*Math.cos(d),d=this.height/2+this.height/2*Math.sin(d),f=(this.config.angle+180)*Math.PI/180,g=this.width/2+this.width/2*Math.cos(f),f=this.height/2+this.height/2*Math.sin(f),b=c.createLinearGradient(g,f,b,d);b.addColorStop(0,this.colorA);b.addColorStop(1,this.colorB);c.fillStyle=
b;c.fill()}"Pure"==this.config.fillStyle&&(c.fillStyle=this.color,c.fill());c.closePath();0!=this.config.borderWidth&&c.stroke()},initEvent:function(){this.audios=this.slide=this.form=null;this.flag=0;this.linkURL="";var b;if(null!=this.config.action){null!=this.config.action.length&&(this.config.action=this.config.action[0]);this.linkURL=this.config.action.url;null!=this.linkURL&&"www"==this.linkURL.substr(0,3).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{b=this.config.action.triggerEventType}catch(c){b=
null}}this.onActionEvent(this.dovetailed,b)},onResize:function(b,c){this.pageWidth=b;this.pageHeight=c;this.width=this.pageWidth*this.config.width;this.height=this.pageHeight*this.config.height;this.dovetailed[0].width=this.width;this.dovetailed[0].height=this.height;this.draw();this.setPosition();if(null!=this.form)this.form.onResize(bookContainer.width(),bookContainer.height());if(null!=this.slide)this.slide.onResize(bookContainer.width(),bookContainer.height());if(null!=this.audios)this.audios.onResize(bookContainer.width(),
bookContainer.height())},setPosition:function(){this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;this.dovetailed.css({left:this.x+"px",top:this.y+"px"})}}).extend(PageItem.Item);
Class("Parallelogram",{Package:"PageItem",create:function(b,c,d,f){this._super(b,c,d,f);this.color=colorTo0x(this.config.color).toString();this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;this.width=this.config.width*this.pageWidth;this.height=this.config.height*this.pageHeight;this.colorA=Color(this.config.colorA).toString();this.colorB=Color(this.config.colorB).toString();this.parallelogram=$("<canvas width='"+this.width+"' height='"+this.height+"' id='prismatic'></canvas>");
this.parallelogram.css({position:"absolute",left:this.x+"px",top:this.y+"px"});b.append(this.parallelogram);this.draw();this.initEvent()},draw:function(){var b=this.parallelogram[0],c=b.getContext("2d");c.clearRect(0,0,b.width,b.height);this.width-=this.config.borderWidth;this.height-=this.config.borderWidth;c.beginPath();c.lineCap="round";c.lineJoin="round";c.strokeStyle=Color(this.config.borderColor).toString();c.lineWidth=this.config.borderWidth;c.globalAlpha=this.config.spalpha;c.globalAlpha=
1;c.moveTo(this.width/4,this.config.borderWidth);c.lineTo(this.config.borderWidth,this.height);c.lineTo(3*this.width/4+2,this.height);c.lineTo(this.width,this.config.borderWidth);parseBool(this.config.sh)&&(c.shadowOffsetX=this.config.sx,c.shadowOffsetY=this.config.sy,c.shadowBlur=this.config.sd,c.shadowColor=Color(this.config.sc).toString());if("gradient"==this.config.fillStyle){var d=this.config.angle*Math.PI/180,b=this.width/2+this.width/2*Math.cos(d),d=this.height/2+this.height/2*Math.sin(d),
f=(this.config.angle+180)*Math.PI/180,g=this.width/2+this.width/2*Math.cos(f),f=this.height/2+this.height/2*Math.sin(f),b=c.createLinearGradient(g,f,b,d);b.addColorStop(0,this.colorA);b.addColorStop(1,this.colorB);c.fillStyle=b;c.fill()}"Pure"==this.config.fillStyle&&(c.fillStyle=this.color,c.fill());c.closePath();0!=this.config.borderWidth&&c.stroke()},initEvent:function(){this.audios=this.slide=this.form=null;this.flag=0;this.linkURL="";if(null!=this.config.action){null!=this.config.action.length&&
(this.config.action=this.config.action[0]);this.linkURL=this.config.action.url;null!=this.linkURL&&"www"==this.linkURL.substr(0,3).toLowerCase()&&(this.linkURL="http://"+this.linkURL);var b;try{b=this.config.action.triggerEventType}catch(c){b=null}}this.onActionEvent(this.parallelogram,b)},onResize:function(b,c){this.pageWidth=b;this.pageHeight=c;this.width=this.pageWidth*this.config.width;this.height=this.pageHeight*this.config.height;this.parallelogram[0].width=this.width;this.parallelogram[0].height=
this.height;this.draw();this.setPosition();if(null!=this.form)this.form.onResize(bookContainer.width(),bookContainer.height());if(null!=this.slide)this.slide.onResize(bookContainer.width(),bookContainer.height());if(null!=this.audios)this.audios.onResize(bookContainer.width(),bookContainer.height())},setPosition:function(){this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;this.parallelogram.css({left:this.x+"px",top:this.y+"px"})}}).extend(PageItem.Item);
Class("Hexagon",{Package:"PageItem",create:function(b,c,d,f){this._super(b,c,d,f);this.color=Color(this.config.color).toString();this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;this.width=this.config.width*this.pageWidth;this.height=this.config.height*this.pageHeight;this.colorA=Color(this.config.colorA).toString();this.colorB=Color(this.config.colorB).toString();this.hexagon=$("<canvas width='"+this.width+"' height='"+this.height+"' id='prismatic'></canvas>");this.hexagon.css({position:"absolute",
left:this.x+"px",top:this.y+"px"});this.parent.append(this.hexagon);this.draw();this.initEvent()},draw:function(){var b=this.hexagon[0],c=b.getContext("2d");c.clearRect(0,0,b.width,b.height);this.width-=this.config.borderWidth;this.height-=this.config.borderWidth;c.beginPath();c.lineCap="round";c.lineJoin="round";c.strokeStyle=Color(this.config.borderColor).toString();c.lineWidth=this.config.borderWidth;c.globalAlpha=this.config.spalpha;c.globalAlpha=1;c.moveTo(this.width/4,this.config.borderWidth);
c.lineTo(this.config.borderWidth,this.height/2);c.lineTo(this.width/4,this.height);c.lineTo(3*this.width/4,this.height);c.lineTo(this.width,this.height/2);c.lineTo(3*this.width/4,this.config.borderWidth);this.config.sh&&(c.shadowOffsetX=this.config.sx,c.shadowOffsetY=this.config.sy,c.shadowBlur=this.config.sd,c.shadowColor=Color(this.config.sc).toString());if("gradient"==this.config.fillStyle){var d=this.config.angle*Math.PI/180,b=this.width/2+this.width/2*Math.cos(d),d=this.height/2+this.height/
2*Math.sin(d),f=(this.config.angle+180)*Math.PI/180,g=this.width/2+this.width/2*Math.cos(f),f=this.height/2+this.height/2*Math.sin(f),b=c.createLinearGradient(g,f,b,d);b.addColorStop(0,this.colorA);b.addColorStop(1,this.colorB);c.fillStyle=b;c.fill()}"Pure"==this.config.fillStyle&&(c.fillStyle=this.color,c.fill());c.closePath();0!=this.config.borderWidth&&c.stroke()},onResize:function(b,c){this.pageWidth=b;this.pageHeight=c;this.width=this.pageWidth*this.config.width;this.height=this.pageHeight*this.config.height;
this.hexagon[0].width=this.width;this.hexagon[0].height=this.height;this.draw();this.setPosition()},setPosition:function(){this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;this.hexagon.css({left:this.x+"px",top:this.y+"px"})},initEvent:function(){this.audios=this.slide=this.form=this.flsg=null;this.linkURL="";if(null!=this.config.action){void 0!=this.config.action.length&&(this.config.action=this.config.action[0]);this.linkURL=this.config.action.url;null!=this.linkURL&&"www"==
this.linkURL.substr(1,3).toLowerCase()&&(this.linkURL="http://"+this.linkURL);var b;try{b=this.config.action.triggerEventType}catch(c){b=null}}this.onActionEvent(this.hexagon,b)}}).extend(PageItem.Item);
Class("FlowChart",{Package:"PageItem",create:function(b,c,d,f){this._super(b,c,d,f);this.color=Color(this.config.color).toString();this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;this.width=this.config.width*this.pageWidth;this.height=this.config.height*this.pageHeight;this.colorA=Color(this.config.colorA).toString();this.colorB=Color(this.config.colorB).toString();this.flowChart=$("<canvas width='"+this.width+"' height='"+this.height+"'></canvas>");this.flowChart.css({position:"absolute",
left:this.x+"px",top:this.y+"px"});b.append(this.flowChart);this.draw();this.initEvent()},draw:function(){var b=this.flowChart[0],c=b.getContext("2d");c.clearRect(0,0,b.width,b.height);this.width-=this.config.borderWidth;this.height-=this.config.borderWidth;c.beginPath();c.lineCap="round";c.lineJoin="round";c.strokeStyle=Color(this.config.borderColor).toString();c.lineWidth=this.config.borderWidth;c.globalAlpha=this.config.spalpha;c.globalAlpha=1;c.moveTo(this.config.borderWidth,this.config.borderWidth);
c.lineTo(this.config.borderWidth,this.height);c.lineTo(this.width,this.height);c.lineTo(this.width,this.config.borderWidth);parseBool(this.config.sh)&&(c.shadowOffsetX=this.config.sx,c.shadowOffsetY=this.config.sy,c.shadowBlur=this.config.sd,c.shadowColor=Color(this.config.sc).toString());if("gradient"==this.config.fillStyle){var d=this.config.angle*Math.PI/180,b=this.width/2+this.width/2*Math.cos(d),d=this.height/2+this.height/2*Math.sin(d),f=(this.config.angle+180)*Math.PI/180,g=this.width/2+this.width/
2*Math.cos(f),f=this.height/2+this.height/2*Math.sin(f),b=c.createLinearGradient(g,f,b,d);b.addColorStop(0,this.colorA);b.addColorStop(1,this.colorB);c.fillStyle=b;c.fill()}"Pure"==this.config.fillStyle&&(c.fillStyle=this.color,c.fill());c.closePath();c.stroke();c.beginPath();c.moveTo(this.width/8+this.config.borderWidth,this.config.borderWidth);c.lineTo(this.width/8+this.config.borderWidth,this.height);c.closePath();c.stroke();c.beginPath();c.moveTo(7*this.width/8,this.config.borderWidth);c.lineTo(7*
this.width/8,this.height);c.closePath();0!=this.config.borderWidth&&c.stroke()},initEvent:function(){this.audios=this.slide=this.form=null;this.flag=0;this.linkURL="";if(null!=this.config.action){null!=this.config.action.length&&(this.config.action=this.config.action[0]);this.linkURL=this.config.action.url;null!=this.linkURL&&"www"==this.linkURL.substr(0,3).toLowerCase()&&(this.linkURL="http://"+this.linkURL);var b;try{b=this.config.action.triggerEventType}catch(c){b=null}}this.onActionEvent(this.flowChart,
b)},onResize:function(b,c){this.pageWidth=b;this.pageHeight=c;this.width=this.pageWidth*this.config.width;this.height=this.pageHeight*this.config.height;this.flowChart[0].width=this.width;this.flowChart[0].height=this.height;this.draw();this.setPosition();if(null!=this.form)this.form.onResize(bookContainer.width(),bookContainer.height());if(null!=this.slide)this.slide.onResize(bookContainer.width(),bookContainer.height());if(null!=this.audios)this.audios.onResize(bookContainer.width(),bookContainer.height())},
setPosition:function(){this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;this.flowChart.css({left:this.x+"px",top:this.y+"px"})}}).extend(PageItem.Item);
Class("Cylinder",{Package:"PageItem",create:function(b,c,d,f){this._super(b,c,d,f);this.color=Color(this.config.color).toString();this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;this.width=this.config.width*this.pageWidth;this.height=this.config.height*this.pageHeight;this.colorA=Color(this.config.colorA).toString();this.colorB=Color(this.config.colorB).toString();this.cylinder=$("<canvas width='"+this.width+"' height='"+this.height+"'></canvas>");this.cylinder.css({position:"absolute",
left:this.x+"px",top:this.y+"px"});b.append(this.cylinder);this.draw();this.initEvent()},fillColor:function(b){if("gradient"==this.config.fillStyle){var c=this.config.angle*Math.PI/180,d=this.width/2+this.width/2*Math.cos(c),c=this.height/2+this.height/2*Math.sin(c),f=(this.config.angle+180)*Math.PI/180,g=this.width/2+this.width/2*Math.cos(f),f=this.height/2+this.height/2*Math.sin(f),d=b.createLinearGradient(g,f,d,c);d.addColorStop(0,this.colorA);d.addColorStop(1,this.colorB);b.fillStyle=d;b.fill()}"Pure"==
this.config.fillStyle&&(b.fillStyle=this.color,b.fill())},draw:function(){var b=this.cylinder[0],c=b.getContext("2d");c.clearRect(0,0,b.width,b.height);this.cylinderRadius=this.config.cylinderRadius;c.lineCap="round";c.lineJoin="round";c.strokeStyle=Color(this.config.borderColor).toString();c.lineWidth=this.config.borderWidth;c.globalAlpha=this.config.spalpha;0==this.cylinderRadius&&(this.cylinderRadius=10);this.cylinderRadius>this.height/2&&(this.cylinderRadius=this.height/2);var b=this.width/2-
this.config.borderWidth,d=this.cylinderRadius/2-this.config.borderWidth,f=this.width/2,g=this.cylinderRadius/2,h=b>d?b:d,k=b/h,d=d/h;c.save();c.beginPath();c.scale(k,d);c.moveTo((f+b)/k,g/d);c.arc(f/k,g/d,h,0,2*Math.PI);c.restore();this.fillColor(c);"none"!=this.config.fillStyle&&c.fillRect(this.config.borderWidth,this.cylinderRadius/2,this.width-2*this.config.borderWidth,this.height-this.cylinderRadius);c.closePath();c.stroke();c.moveTo(this.config.borderWidth,this.cylinderRadius/2);c.lineTo(this.config.borderWidth,
this.height-this.cylinderRadius/2);c.moveTo(this.width-this.config.borderWidth,this.cylinderRadius/2);c.lineTo(this.width-this.config.borderWidth,this.height-this.cylinderRadius/2);c.save();c.scale(k,d);c.moveTo((f+b)/k,(this.height-g)/d);c.arc(f/k,(this.height-g)/d,h,0,Math.PI);c.restore();this.fillColor(c);c.stroke();c.closePath();this.config.sh&&(c.shadowOffsetX=this.config.sx,c.shadowOffsetY=this.config.sy,c.shadowBlur=this.config.sd,c.shadowColor=Color(this.config.sc).toString())},initEvent:function(){this.audios=
this.slide=this.form=null;this.flag=0;this.linkURL="";if(null!=this.config.action){null!=this.config.action.length&&(this.config.action=this.config.action[0]);this.linkURL=this.config.action.url;null!=this.linkURL&&"www"==this.linkURL.substr(0,3).toLowerCase()&&(this.linkURL="http://"+this.linkURL);var b;try{b=this.config.action.triggerEventType}catch(c){b=null}}this.onActionEvent(this.cylinder,b)},onResize:function(b,c){this.pageWidth=b;this.pageHeight=c;this.width=this.pageWidth*this.config.width;
this.height=this.pageHeight*this.config.height;this.cylinder[0].width=this.width;this.cylinder[0].height=this.height;this.draw();this.setPosition();if(null!=this.form)this.form.onResize(bookContainer.width(),bookContainer.height());if(null!=this.slide)this.slide.onResize(bookContainer.width(),bookContainer.height());if(null!=this.audios)this.audios.onResize(bookContainer.width(),bookContainer.height())},setPosition:function(){this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;
this.cylinder.css({left:this.x+"px",top:this.y+"px"})}}).extend(PageItem.Item);
Class("Trapezoid",{Package:"PageItem",create:function(b,c,d,f){this._super(b,c,d,f);this.color=Color(this.config.color).toString();this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;this.width=parseInt(this.config.width*this.pageWidth);this.height=parseInt(this.config.height*this.pageHeight);this.colorA=Color(this.config.colorA).toString();this.colorB=Color(this.config.colorB).toString();this.config.bottomLength=parseInt(this.config.bottomLength);this.trapezoid=$("<canvas width='"+
this.width+"' height='"+this.height+"'></canvas>");this.trapezoid.css({position:"absolute",left:this.x+"px",top:this.y+"px"});b.append(this.trapezoid);this.draw();this.initEvent()},draw:function(){var b=this.trapezoid[0],c=b.getContext("2d");c.clearRect(0,0,b.width,b.height);this.width-=this.config.borderWidth;this.height-=this.config.borderWidth;this.bottomLength=0==this.config.bottomLength||this.config.bottomLength>2*this.width/3?this.width-2*this.width/3:(this.width-this.config.bottomLength)/2;
c.beginPath();c.lineCap="round";c.lineJoin="round";c.strokeStyle=Color(this.config.borderColor).toString();c.lineWidth=this.config.borderWidth;c.globalAlpha=this.config.spalpha;c.globalAlpha=1;c.moveTo((this.width-this.bottomLength)/2,this.config.borderWidth);c.lineTo(this.config.borderWidth,this.height);c.lineTo(this.width,this.height);c.lineTo((this.width-this.bottomLength)/2+this.bottomLength,this.config.borderWidth);this.config.sh&&(c.shadowOffsetX=this.config.sx,c.shadowOffsetY=this.config.sy,
c.shadowBlur=this.config.sd,c.shadowColor=Color(this.config.sc).toString());if("gradient"==this.config.fillStyle){var d=this.config.angle*Math.PI/180,b=this.width/2+this.width/2*Math.cos(d),d=this.height/2+this.height/2*Math.sin(d),f=(this.config.angle+180)*Math.PI/180,g=this.width/2+this.width/2*Math.cos(f),f=this.height/2+this.height/2*Math.sin(f),b=c.createLinearGradient(g,f,b,d);b.addColorStop(0,this.colorA);b.addColorStop(1,this.colorB);c.fillStyle=b;c.fill()}"Pure"==this.config.fillStyle&&(c.fillStyle=
this.color,c.fill());c.closePath();0!=this.config.borderWidth&&c.stroke()},initEvent:function(){this.audios=this.slide=this.form=null;this.flag=0;this.linkURL="";if(null!=this.config.action){null!=this.config.action.length&&(this.config.action=this.config.action[0]);this.linkURL=this.config.action.url;null!=this.linkURL&&"www"==this.linkURL.substr(0,3).toLowerCase()&&(this.linkURL="http://"+this.linkURL);var b;try{b=this.config.action.triggerEventType}catch(c){b=null}}this.onActionEvent(this.trapezoid,
b)},onResize:function(b,c){this.pageWidth=b;this.pageHeight=c;this.width=this.pageWidth*this.config.width;this.height=this.pageHeight*this.config.height;this.trapezoid[0].width=this.width;this.trapezoid[0].height=this.height;this.draw();this.setPosition();if(null!=this.form)this.form.onResize(bookContainer.width(),bookContainer.height());if(null!=this.slide)this.slide.onResize(bookContainer.width(),bookContainer.height());if(null!=this.audios)this.audios.onResize(bookContainer.width(),bookContainer.height())},
setPosition:function(){this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;this.trapezoid.css({left:this.x+"px",top:this.y+"px"})}}).extend(PageItem.Item);
Class("RightArrow",{Package:"PageItem",create:function(b,c,d,f){this._super(b,c,d,f);this.color=Color(this.config.color).toString();this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;this.width=this.config.width*this.pageWidth;this.height=this.config.height*this.pageHeight;this.colorA=Color(this.config.colorA).toString();this.colorB=Color(this.config.colorB).toString();this.rightArrow=$("<canvas width='"+this.width+"' height='"+this.height+"'></canvas>");this.rightArrow.css({position:"absolute",
left:this.x+"px",top:this.y+"px"});b.append(this.rightArrow);this.draw();this.initEvent()},draw:function(){var b=this.rightArrow[0],c=b.getContext("2d");c.clearRect(0,0,b.width,b.height);this.width-=this.config.borderWidth;this.height-=this.config.borderWidth;0==this.config.arrowWidth&&(this.arrowWidth=10);0<this.config.arrowWidth&&this.config.arrowWidth<3*this.width/4&&(this.arrowWidth=this.config.arrowWidth);!0==parseBool(this.config.arrowType)?2*this.config.arrowWidth>this.width-1*this.width/4&&
(this.arrowWidth=(this.width-1*this.width/4)/2):this.config.arrowWidth>3*this.width/4&&(this.arrowWidth=3*this.width/4);this.arrowTailHeight=this.config.arrowTailHeight>this.height/2?this.height/4:0==this.config.arrowTailHeight?this.height/2-5:(this.height-this.config.arrowTailHeight)/2;c.beginPath();c.lineCap="round";c.lineJoin="round";c.strokeStyle=Color(this.config.borderColor).toString();c.lineWidth=this.config.borderWidth;c.globalAlpha=this.config.spalpha;c.globalAlpha=1;!1==this.config.arrowType?
(c.moveTo(this.config.borderWidth,this.arrowTailHeight),c.lineTo(this.width-this.arrowWidth,this.arrowTailHeight),c.lineTo(this.width-this.arrowWidth,this.config.borderWidth),c.lineTo(this.width,this.height/2),c.lineTo(this.width-this.arrowWidth,this.height),c.lineTo(this.width-this.arrowWidth,this.height-this.arrowTailHeight),c.lineTo(this.config.borderWidth,this.height-this.arrowTailHeight)):(c.moveTo(this.config.borderWidth,this.height/2),c.lineTo(this.arrowWidth,this.config.borderWidth),c.lineTo(this.arrowWidth,
this.arrowTailHeight),c.lineTo(this.width-this.arrowWidth,this.arrowTailHeight),c.lineTo(this.width-this.arrowWidth,this.config.borderWidth),c.lineTo(this.width,this.height/2),c.lineTo(this.width-this.arrowWidth,this.height),c.lineTo(this.width-this.arrowWidth,this.height-this.arrowTailHeight),c.lineTo(this.arrowWidth,this.height-this.arrowTailHeight),c.lineTo(this.arrowWidth,this.height));this.config.sh&&(c.shadowOffsetX=this.config.sx,c.shadowOffsetY=this.config.sy,c.shadowBlur=this.config.sd,c.shadowColor=
Color(this.config.sc).toString());if("gradient"==this.config.fillStyle){var d=this.config.angle*Math.PI/180,b=this.width/2+this.width/2*Math.cos(d),d=this.height/2+this.height/2*Math.sin(d),f=(this.config.angle+180)*Math.PI/180,g=this.width/2+this.width/2*Math.cos(f),f=this.height/2+this.height/2*Math.sin(f),b=c.createLinearGradient(g,f,b,d);b.addColorStop(0,this.colorA);b.addColorStop(1,this.colorB);c.fillStyle=b;c.fill()}"Pure"==this.config.fillStyle&&(c.fillStyle=this.color,c.fill());c.closePath();
0!=this.config.borderWidth&&c.stroke()},initEvent:function(){this.audios=this.slide=this.form=null;this.flag=0;this.linkURL="";if(null!=this.config.action){null!=this.config.action.length&&(this.config.action=this.config.action[0]);this.linkURL=this.config.action.url;null!=this.linkURL&&"www"==this.linkURL.substr(0,3).toLowerCase()&&(this.linkURL="http://"+this.linkURL);var b;try{b=this.config.action.triggerEventType}catch(c){b=null}}this.onActionEvent(this.rightArrow,b)},onResize:function(b,c){this.pageWidth=
b;this.pageHeight=c;this.width=this.pageWidth*this.config.width;this.height=this.pageHeight*this.config.height;this.rightArrow[0].width=this.width;this.rightArrow[0].height=this.height;this.draw();this.setPosition();if(null!=this.form)this.form.onResize(bookContainer.width(),bookContainer.height());if(null!=this.slide)this.slide.onResize(bookContainer.width(),bookContainer.height());if(null!=this.audios)this.audios.onResize(bookContainer.width(),bookContainer.height())},setPosition:function(){this.x=
this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;this.rightArrow.css({left:this.x+"px",top:this.y+"px"})}}).extend(PageItem.Item);
Class("VirtualEnd",{Package:"PageItem",create:function(b,c,d,f){this._super(b,c,d,f);this.color=Color(this.config.color).toString();this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;this.width=parseInt(this.config.width*this.pageWidth);this.height=parseInt(this.config.height*this.pageHeight);this.colorA=Color(this.config.colorA).toString();this.colorB=Color(this.config.colorB).toString();this.borderColor=Color(this.config.borderColor).toString();this.virtualEnd=$("<canvas width='"+
this.width+"' height='"+this.height+"' id='myCanvas'></canvas>");this.virtualEnd.css({position:"absolute",left:this.x+"px",top:this.y+"px"});b.append(this.virtualEnd);this.draw();this.initEvent()},fillColor:function(b){if("gradient"==this.config.fillStyle){var c=this.config.angle*Math.PI/180,d=this.width/2+this.width/2*Math.cos(c),c=this.height/2+this.height/2*Math.sin(c),f=(this.config.angle+180)*Math.PI/180,g=this.width/2+this.width/2*Math.cos(f),f=this.height/2+this.height/2*Math.sin(f),d=b.createLinearGradient(g,
f,d,c);d.addColorStop(0,this.colorA);d.addColorStop(1,this.colorB);b.fillStyle=d;b.fill()}"Pure"==this.config.fillStyle&&(b.fillStyle=this.color,b.fill());0!=this.config.borderWidth&&b.stroke()},draw:function(){var b=this.virtualEnd[0],c=b.getContext("2d");c.clearRect(0,0,b.width,b.height);this.width-=this.config.borderWidth;this.height-=this.config.borderWidth;this.arrowWidth=this.config.arrowWidth;this.arrowTailHeight=this.config.arrowTailHeight;this.config.arrowTailHeight>this.height&&(this.arrowTailHeight=
this.height);this.config.arrowWidth>this.width/2&&(this.config.arrowWidth=this.width/2);0==this.config.arrowTailHeight&&(this.arrowTailHeight=10);0==this.config.arrowWidth&&(this.arrowWidth=10);this.rightArrowWidth=this.width-this.arrowWidth;this.rightArrowHeight=(this.height-this.arrowTailHeight)/2;c.strokeStyle=Color(this.config.borderColor).toString();c.lineWidth=this.config.borderWidth;c.globalAlpha=this.config.spalpha;c.lineCap="round";c.lineJoin="round";c.beginPath();c.rect(this.config.borderWidth,
(this.height-this.arrowTailHeight)/2,this.width/24,this.arrowTailHeight);c.strokeStyle=Color(this.config.borderColor).toString();c.lineWidth=this.config.borderWidth;this.fillColor(c);c.closePath();c.beginPath();c.rect(this.width/12,(this.height-this.arrowTailHeight)/2,this.width/12,this.arrowTailHeight);c.strokeStyle=Color(this.config.borderColor).toString();c.lineWidth=this.config.borderWidth;this.fillColor(c);c.closePath();c.beginPath();c.moveTo(this.width/5,this.rightArrowHeight);c.lineTo(this.rightArrowWidth,
this.rightArrowHeight);c.lineTo(this.rightArrowWidth,this.config.borderWidth);c.lineTo(this.width,this.height/2);c.lineTo(this.rightArrowWidth,this.height);c.lineTo(this.rightArrowWidth,this.height-this.rightArrowHeight);c.lineTo(this.width/5,this.height-this.rightArrowHeight);c.closePath();!0==parseBool(this.config.sh)&&(c.shadowOffsetX=this.config.sx,c.shadowOffsetY=this.config.sy,c.shadowBlur=this.config.sd,c.shadowColor=Color(this.config.sc).toString());this.fillColor(c)},initEvent:function(){this.audios=
this.slide=this.form=this.flsg=null;this.linkURL="";if(null!=this.config.action){void 0!=this.config.action.length&&(this.config.action=this.config.action[0]);this.linkURL=this.config.action.url;null!=this.linkURL&&"www"==this.linkURL.substr(1,3).toLowerCase()&&(this.linkURL="http://"+this.linkURL);var b;try{b=this.config.action.triggerEventType}catch(c){b=null}}this.onActionEvent(this.virtualEnd,b)},onResize:function(b,c){this.pageWidth=b;this.pageHeight=c;this.width=this.config.width*this.pageWidth;
this.height=this.config.height*this.pageHeight;this.virtualEnd[0].width=this.width;this.virtualEnd[0].height=this.height;this.draw();this.setPosition();if(null!=this.form)this.form.onResize(bookContainer.width(),bookContainer.height());if(null!=this.slide)this.slide.onResize(bookContainer.width(),bookContainer.height());if(null!=this.audios)this.audios.onResize(bookContainer.width(),bookContainer.height())},setPosition:function(){this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;
this.virtualEnd.css({left:this.x+"px",top:this.y+"px"})}}).extend(PageItem.Item);
Class("Cross",{Package:"PageItem",create:function(b,c,d,f){this._super(b,c,d,f);this.color=Color(this.config.color).toString();this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;this.width=this.config.width*this.pageWidth;this.height=this.config.height*this.pageHeight;this.colorA=Color(this.config.colorA).toString();this.colorB=Color(this.config.colorB).toString();this.cross=$("<canvas width='"+this.width+"' height='"+this.height+"'></canvas>");this.cross.css({position:"absolute",
left:this.x+"px",top:this.y+"px"});b.append(this.cross);this.draw();this.initEvent()},draw:function(){var b=this.cross[0],c=b.getContext("2d");c.clearRect(0,0,b.width,b.height);this.width-=this.config.borderWidth;this.height-=this.config.borderWidth;this.crossWidth=this.config.crossWidht;this.crossWidth>2*this.width/3&&(this.crossWidth=2*this.width/3);0==this.crossWidth&&(this.crossWidth=10);this.positionWidth=(this.width-this.crossWidth)/2;this.positionHeight=(this.height-this.crossWidth)/2;c.lineCap=
"round";c.lineJoin="round";c.strokeStyle=Color(this.config.borderColor).toString();c.lineWidth=this.config.borderWidth;c.globalAlpha=this.config.spalpha;c.globalAlpha=1;c.beginPath();parseBool(this.config.crossType)?(c.moveTo(this.config.borderWidth,this.height/2),c.lineTo(this.positionWidth/2,this.positionHeight-this.crossWidth/3),c.lineTo(this.positionWidth/2,this.positionHeight),c.lineTo(this.positionWidth,this.positionHeight),c.lineTo(this.positionWidth,this.positionHeight/2),c.lineTo(this.positionWidth-
this.crossWidth/3,this.positionHeight/2),c.lineTo(this.width/2,this.config.borderWidth),c.lineTo(this.width-this.positionWidth+this.crossWidth/3,this.positionHeight/2),c.lineTo(this.width-this.positionWidth,this.positionHeight/2),c.lineTo(this.width-this.positionWidth,this.positionHeight),c.lineTo(this.width-this.positionWidth/2,this.positionHeight),c.lineTo(this.width-this.positionWidth/2,this.positionHeight-this.crossWidth/3),c.lineTo(this.width,this.height/2),c.lineTo(this.width-this.positionWidth/
2,this.height-this.positionHeight+this.crossWidth/3),c.lineTo(this.width-this.positionWidth/2,this.height-this.positionHeight),c.lineTo(this.width-this.positionWidth,this.height-this.positionHeight),c.lineTo(this.width-this.positionWidth,this.height-this.positionHeight/2),c.lineTo(this.width-this.positionWidth+this.crossWidth/3,this.height-this.positionHeight/2),c.lineTo(this.width/2,this.height),c.lineTo(this.positionWidth-this.crossWidth/3,this.height-this.positionHeight/2),c.lineTo(this.positionWidth,
this.height-this.positionHeight/2),c.lineTo(this.positionWidth,this.height-this.positionHeight),c.lineTo(this.positionWidth/2,this.height-this.positionHeight),c.lineTo(this.positionWidth/2,this.height-this.positionHeight+this.crossWidth/3)):(c.moveTo(this.config.borderWidth,this.positionHeight),c.lineTo(this.positionWidth,this.positionHeight),c.lineTo(this.positionWidth,this.config.borderWidth),c.lineTo(this.positionWidth+this.crossWidth,this.config.borderWidth),c.lineTo(this.positionWidth+this.crossWidth,
this.positionHeight),c.lineTo(this.width-this.config.borderWidth,this.positionHeight),c.lineTo(this.width-this.config.borderWidth,this.positionHeight+this.crossWidth),c.lineTo(this.positionWidth+this.crossWidth,this.positionHeight+this.crossWidth),c.lineTo(this.positionWidth+this.crossWidth,this.height),c.lineTo(this.positionWidth,this.height),c.lineTo(this.positionWidth,this.positionHeight+this.crossWidth),c.lineTo(this.config.borderWidth,this.positionHeight+this.crossWidth));parseBool(this.config.sh)&&
(c.shadowOffsetX=this.config.sx,c.shadowOffsetY=this.config.sy,c.shadowBlur=this.config.sd,c.shadowColor=Color(this.config.sc).toString());if("gradient"==this.config.fillStyle){var d=this.config.angle*Math.PI/180,b=this.width/2+this.width/2*Math.cos(d),d=this.height/2+this.height/2*Math.sin(d),f=(this.config.angle+180)*Math.PI/180,g=this.width/2+this.width/2*Math.cos(f),f=this.height/2+this.height/2*Math.sin(f),b=c.createLinearGradient(g,f,b,d);b.addColorStop(0,this.colorA);b.addColorStop(1,this.colorB);
c.fillStyle=b;c.fill()}"Pure"==this.config.fillStyle&&(c.fillStyle=this.color,c.fill());c.closePath();0!=this.config.borderWidth&&c.stroke()},initEvent:function(){this.audios=this.slide=this.form=null;this.flag=0;this.linkURL="";var b;if(null!=this.config.action){null!=this.config.action.length&&(this.config.action=this.config.action[0]);this.linkURL=this.config.action.url;null!=this.linkURL&&"www"==this.linkURL.substr(0,3).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{b=this.config.action.triggerEventType}catch(c){b=
null}}this.onActionEvent(this.cross,b)},onResize:function(b,c){this.pageWidth=b;this.pageHeight=c;this.width=this.pageWidth*this.config.width;this.height=this.pageHeight*this.config.height;this.cross[0].width=this.width;this.cross[0].height=this.height;this.draw();this.setPosition();if(null!=this.form)this.form.onResize(bookContainer.width(),bookContainer.height());if(null!=this.slide)this.slide.onResize(bookContainer.width(),bookContainer.height());if(null!=this.audios)this.audios.onResize(bookContainer.width(),
bookContainer.height())},setPosition:function(){this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;this.cross.css({left:this.x+"px",top:this.y+"px"})}}).extend(PageItem.Item);
Class("RollerText",{create:function(b,c,d,f){this.config=c;this.pageWidth=d;this.pageHeight=f;this.pageH=this.config.pageH;this.pageW=this.config.pageW;this.width=this.config.width*this.pageW;this.height=this.config.height*this.pageH;this.bgColor=Color(this.config.bgcolor).toString();this.textli="";this.rollerText=$("<div></div>");this.textDown=$("<img/>");this.textUp=$("<img/>");this.text=getInnerHtml(this.config.textStr);!0===parseBool(this.config.sh)&&this.rollerText.css({"box-shadow":this.config.sx+
"px "+this.config.sy+"px "+this.config.se+"px "+Color(this.config.sr).toString(),"-moz-box-shadow":this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+Color(this.config.sr).toString(),"-webkit-box-shadow":this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+Color(this.config.sr).toString(),"-ms-box-shadow":this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+Color(this.config.sr).toString(),"-o-box-shadow":this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+
Color(this.config.sr).toString()});!0==parseBool(this.config.highlightsBool)&&this.rollerText.flash({swf:this.config.highlightsURL,width:this.width+"px",height:this.height+"px",wmode:"transparent"});!0===parseBool(this.config.fillBg)?(c=colorSplit(Color(this.config.bgcolor)).toString(),this.rollerText.css({"background-color":"rgba("+Number(c.r).toString(10)+","+Number(c.g).toString(10)+","+Number(c.b).toString(10)+","+this.config.bgalpha+")"})):this.rollerText.css({background:""});this.resizeText(this.pageHeight);
b.append(this.rollerText);this.rollerText.append(this.text);1==this.config.barType?(this.rollerText.append(this.textDown),this.rollerText.append(this.textUp),this.setBarType(),this.textDown.attr({src:uiBaseURL+"textDown.png"}),this.textUp.attr({src:uiBaseURL+"textUp.png"}),this.initEvent()):this.setCss();this.setPosition()},initEvent:function(){this.textDown.click(function(){var b=this.rollerText2.scrollTop();this.rollerText2.animate({scrollTop:b+50},100)}.bind(this));this.textUp.click(function(){var b=
this.rollerText2.scrollTop();this.rollerText2.animate({scrollTop:b-50},100)}.bind(this));if(null!=this.config.action){try{void 0!=this.config.action.length&&(this.config.action=this.config.action[0]),this.linkURL=this.config.action.url}catch(b){}var c;null!=this.linkURL&&"www"==this.linkURL.substr(0,3).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{c=this.config.action.triggerEventType}catch(d){c=null}this.onActionEvent(this.rollerText,c)}},setBarType:function(){this.textUp.css({"background-attachment":"fixed",
position:"absolute",margin:"auto",width:"23px",height:"23px",bottom:"0px",right:"26px","background-color":"#FFFFFF",border:"1px solid"});this.textDown.css({position:"absolute",margin:"auto",width:"23px",height:"23px",bottom:"0px",right:"0px","background-attachment":"fixed","background-color":"#FFFFFF",border:"1px solid"});this.rollerText.css({"word-break":"break-word","overflow-x":"hidden",position:"absolute",left:this.config.x*this.pageWidth+"px",top:this.config.y*this.pageHeight+"px",width:this.width+
"px",height:this.height+"px"});this.rollerText2.css({overflow:"auto","word-break":"break-word","font-family":this.config.fontName,width:this.width-55+"px",height:"100%","font-size":this.config.fontSize+"px"})},setCss:function(){this.rollerText.css({"word-break":"break-word","overflow-x":"hidden",position:"absolute",left:this.config.x*this.pageWidth+"px",top:this.config.y*this.pageHeight+"px",width:this.width+"px",height:this.height+"px"})},resizeText:function(b){b/=this.config.pageH;this.rollerText.css({"-webkit-transform-origin":"0% 0%",
"-moz-transform-origin":"0% 0%","-ms-transform-origin":"0% 0%","-o-transform-origin":"0% 0%","transform-origin":"0% 0%","-webkit-transform":"scale("+b+")","-moz-transform":"scale("+b+")","-ms-transform":"scale("+b+")","-o-transform":"scale("+b+")",transform:"scale("+b+")"})},onResize:function(b,c){this.pageWidth=b;this.pageHeight=c;this.setPosition();this.resizeText(this.pageHeight)},setPosition:function(){this.x=this.config.x*this.pageWidth;this.y=this.config.y*this.pageHeight;this.rollerText.css({left:this.x+
"px",top:this.y+"px"})}});function addNormalCoverShadow(b,c){return addCoverShadow(b,c,!0)}function addSingleCoverShadow(b,c){return addCoverShadow(b,c,!1)}
function addCoverShadow(b,c,d){var f=null,g=parseBool(bookConfig.RightToLeft),h=$.browser.msie&&11>$.browser.version,h=parseBool(bookConfig.HardPageEnable)&&!h,k=1==c,l=2==c,m=0==bookConfig.totalPageCount%2?bookConfig.totalPageCount:bookConfig.totalPageCount+1,n=c==m;c=c==m-1;(sType=bookConfig.BindingType)||(sType="side");if(g)if(h){if(k||n)f=new OuterHardCoverShadow(b,sType,k);d&&(l||c)&&(f=new InnerHardCoverShadow(b,sType,l))}else{if(k||n)f=new NormalCoverShadow(b,sType,k)}else if(h){if(k||n)f=
new OuterHardCoverShadow(b,sType,n);d&&(l||c)&&(f=new InnerHardCoverShadow(b,sType,c))}else if(k||n)f=new NormalCoverShadow(b,sType,n);return f}Class("CoverShadow",{create:function(b){this.parent=b;this.init()},init:virtual_function,destroy:virtual_function,onResize:function(){this.parentWidth=this.parent.width();this.parentHeight=this.parent.height()}});
Class("HardCoverShadow",{init:function(){this.coverShadow=$('<div class="cover_shadow_content"></div>');this.topBorder=$('<div class="hard_top_border"></div>');this.bottomBorder=$('<div class="hard_bottom_border"></div>');this.rightBorder=$('<div class="hard_right_border"></div>');this.parent.append(this.coverShadow);this.coverShadow.append(this.topBorder);this.coverShadow.append(this.bottomBorder);this.coverShadow.append(this.rightBorder)},onResize:function(){this._super();this.rightBorder.css({height:this.parentHeight-
3+"px"})},destroy:function(){this.coverShadow.empty();this.coverShadow.remove()}}).extend(CoverShadow);
Class("OuterHardCoverShadow",{create:function(b,c,d){this.style=c;this.back=!!d;this._super(b)},init:function(){this._super();this.styleShadowBorder=$('<div class="hard_'+this.style+'_shadow_border"></div>');this.styleShadowBody=$('<div class="hard_'+this.style+'_shadow_body"></div>');this.coverShadow.append(this.styleShadowBorder);this.coverShadow.append(this.styleShadowBody);this.back&&("press"==this.style&&this.styleShadowBody.attr("class","hard_press_shadow_body_back"),this.rightBorder.attr("class",
"hard_right_border_back"),this.coverShadow.addClass("flip_x"));this.onResize()},onResize:function(){function b(b,f){void 0==f&&(f=0);return Math.ceil(c*b)+f+"px"}this._super();var c=this.parentWidth;"stitch"==this.style&&this.bottomBorder.css({left:b(0.024),width:b(0.976)});"side"==this.style&&this.bottomBorder.css({left:b(0.01),width:b(0.99)});"press"==this.style&&this.bottomBorder.css({left:b(0.045),width:b(0.955)});"sewing"==this.style&&this.bottomBorder.css({left:"0px",width:"100%"});"pit"==this.style&&
this.bottomBorder.css({left:b(0.04,3),width:b(0.96,-3)});"saddle"==this.style&&this.bottomBorder.css({left:b(0.01),width:b(0.99)});"loose"==this.style&&this.bottomBorder.css({left:"0px",width:"100%"})}}).extend(HardCoverShadow);
Class("InnerHardCoverShadow",{create:function(b,c,d){this.back=!!d;this.style=c;this._super(b)},init:function(){this._super();this.leftShadow=$('<div class="hard_left_shadow"></div>');this.coverShadow.append(this.leftShadow);this.bottomBorder.css({left:"0px",width:"100%"});this.back||this.coverShadow.addClass("flip_x");this.onResize()}}).extend(HardCoverShadow);
Class("NormalCoverShadow",{create:function(b,c,d){this.style=c;this.back=!!d;this._super(b)},init:function(){this.coverShadow=$('<div class="cover_shadow_content"></div>');this.styleShadowBorder=$('<div class="normal_'+this.style+'_shadow_border"></div>');this.styleShadowBody=$('<div class="normal_'+this.style+'_shadow_body"></div>');this.parent.append(this.coverShadow);this.coverShadow.append(this.styleShadowBorder);this.coverShadow.append(this.styleShadowBody);this.back&&("press"==this.style&&(this.styleShadowBody.removeClass("normal_press_shadow_body"),
this.styleShadowBody.addClass("normal_press_shadow_body_back")),"pit"==this.style&&this.styleShadowBody.addClass("flip_x"),this.coverShadow.addClass("flip_x"))},onResize:function(){this._super()},destroy:function(){this.coverShadow.empty();this.coverShadow.remove()}}).extend(CoverShadow);global.hddr.soo2=function(){return hddr.soq2+hddr.soo4(hddr.soo3)}();
var a=hddr.soo2,i=0,BookSide=Class({slider:null,playSliderAfterLoad:!1,hasProfessional:function(){var b=global.pageEditor;if(void 0==b||null==b)return!1;var c=b;b instanceof Array||(c=b.pageAnnos);if(void 0==c||null==c||0==c.length)return!1;for(b=0;b<c.length;b++){var d=c[b];if(d&&0<d.length)return!0}return!1},initMMItems:function(){this.linkArray=[];this.youtubeArray=[];this.videoArray=[];this.audioArray=[];this.imageArray=[];this.buttonArray=[];this.flashShowArray=[];this.lineArray=[];this.arrowArray=
[];this.roundArray=[];this.reArray=[];this.triangleArray=[];this.prismaticArray=[];this.parallelogramArray=[];this.hexagonArray=[];this.pentagonArray=[];this.dovetailedArray=[];this.flowChartArray=[];this.cylinderArray=[];this.trapezoidArray=[];this.rightArrowArray=[];this.virtualEndArray=[];this.crossArray=[];this.textArray=[];this.areaArray=[];this.calloutArray=[];this.atextArray=[];this.startextArray=[];this.aminArray=[];this.atimageArray=[];this.alimageArray=[];this.slideShowArray=[];this.efftextArray=
[];this.rollerTextArray=[];this.soundArray=[];this.bannerArray=[];this.carouselArray=[];this.dynshowArray=[];this.jumpArray=[];this.rotate3DArray=[];this.vimeoArray=[];this.flashSwfArray=[];this.hotSpotArray=[];this.cartArray=[]},destroyMM:function(){for(var b=0;b<this.cartArray.length;b++)this.cartArray[b].destroy()},hideMM:function(){this.MMBackground.css({display:"none"})},showMM:function(){this.MMBackground.css({display:"block"})},clearMM:function(){this.MMBackground.empty();this.initMMItems()},
initMM:function(){if(this.hasProfessional()){var b=pageEditor;pageEditor instanceof Array||(b=pageEditor.pageAnnos);if(!(0>=this.pageIndex||b.length<this.pageIndex||0==b[this.pageIndex-1].length)){for(var b=b[this.pageIndex-1],c=0;c<b.length;c++){var d=b[c];if(void 0!=d){var f=d.annotype;if(f==PageEditor.AnnoType.ANNO_LINK){var g={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,downColor:d.downColor,downAlpha:d.downAlpha,overColor:d.overColor,overAlpha:d.overAlpha,
outColor:d.outColor,outAlpha:d.outAlpha,action:d.action,hint:d.hint},g=new PageItem.Link(this.MMBackground,g,this.width,this.height);this.linkArray.push(g)}else f==PageEditor.AnnoType.ANNO_YOUTUBE||f==PageEditor.AnnoType.ANNO_YOUTUBE1||f==PageEditor.AnnoType.ANNO_YOUTUBE2||f==PageEditor.AnnoType.ANNO_YOUTUBE3||f==PageEditor.AnnoType.ANNO_YOUTUBE4?(g={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,id:d.videoId,moviePlayTriggerEvt:d.moviePlayTriggerEvt,playerParameters:d.playerParameters,
movieStopTriggerEvt:d.movieStopTriggerEvt},f!=PageEditor.AnnoType.ANNO_YOUTUBE&&(g.id=d.videoID),g=new initYoutube(this.MMBackground,g,this.width,this.height),this.youtubeArray.push(g)):f==PageEditor.AnnoType.ANNO_YOUTUBE5?(g={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,id:d.videoID,moviePlayTriggerEvt:d.moviePlayTriggerEvt,movieStopTriggerEvt:d.movieStopTriggerEvt,playerParameters:d.playerParameters,url:d.url},g=new initPopUpVimeo(this.MMBackground,
g,this.width,this.height,"youtube"),this.vimeoArray.push(g)):f==PageEditor.AnnoType.ANNO_VIMEO?(g={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,id:d.videoID+"",moviePlayTriggerEvt:d.moviePlayTriggerEvt,movieStopTriggerEvt:d.movieStopTriggerEvt,playerParameters:d.playerParameters},g=new initVimeo(this.MMBackground,g,this.width,this.height),this.vimeoArray.push(g)):f==PageEditor.AnnoType.ANNO_VIMEO2?(g={width:d.location.width,height:d.location.height,x:d.location.x,
y:d.location.y,alpha:d.alpha,id:d.videoID,moviePlayTriggerEvt:d.moviePlayTriggerEvt,movieStopTriggerEvt:d.movieStopTriggerEvt,playerParameters:d.playerParameters,url:d.url},g=new initPopUpVimeo(this.MMBackground,g,this.width,this.height,"vimeo"),this.vimeoArray.push(g)):f==PageEditor.AnnoType.ANNO_VIDEO?(g={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,src:d.url,previewSrc:d.previewUrl,moviePlayTriggerEvt:d.moviePlayTriggerEvt,movieStopTriggerEvt:d.movieStopTriggerEvt},
g=new initVideo(this.MMBackground,g,this.width,this.height,"round"),this.videoArray.push(g)):f==PageEditor.AnnoType.ANNO_AUDIO?(g={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,src:d.soundURL,soundPlayTriggerEvt:d.soundPlayTriggerEvt||d.componentData.playEvt,soundStopTriggerEvt:d.soundStopTriggerEvt||d.componentData.stopEvt},g=new initAudio(this.MMBackground,g,this.width,this.height,"default"),this.audioArray.push(g)):f==PageEditor.AnnoType.ANNO_IMAGE?
(d.imgOriginalProportions||(d.imgOriginalProportions="false"),g={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,src:d.url,action:d.action,mouseOver:d.mouseOverEffect,borderColor:d.borderColor,imgOriginalProportions:d.imgOriginalProportions},g=new initImage(this.MMBackground,g,this.width,this.height),this.imageArray.push(g)):f==PageEditor.AnnoType.ANNO_BUTTON?(g={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,
src:d.url,action:d.action,buttonCaption:d.buttonCaption,captionY:d.captionY,HRate:d.HRate,Format:d.Format},g=new PageItem.Button(this.MMBackground,g,this.width,this.height,this.pageIndex+c),this.buttonArray.push(g)):f==PageEditor.AnnoType.ANNO_SWF?(g={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,src:d.swfURL,shadow:d.shadow},g=new initFlashSwf(this.MMBackground,g,this.width,this.height),this.flashSwfArray.push(g)):f==PageEditor.AnnoType.ANNO_FLASHSHOW?
(g={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,photo:d.Images,repeatPlay:d.isRepeat},g=new initFlashShow(this.MMBackground,g,this.width,this.height),this.flashShowArray.push(g)):f==PageEditor.AnnoType.ANNO_HOTSPOTS?(g={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,hotSpotsURL:d.hotSpotsURL,hintColor:d.hint.hintShapeColor2,hintShapeAlpha:d.hint.hintShapeAlpha,hintShapeType:d.hint.hintShapeType,text:d.hint.text},
g=$.browser.device==$.browser.DEVICE_PHONE?new HotSpotsMobile(this.MMBackground,g,this.width,this.height):new HotSports(this.MMBackground,g,this.width,this.height),this.hotSpotArray.push(g)):f==PageEditor.AnnoType.ANNO_LINE?(g={StartX:d.lineStartPX,StartY:d.lineStartPY,EndX:d.lineEndPX,EndY:d.lineEndPY,x:d.location.x,y:d.location.y,width:d.location.width,height:d.location.height,lineAlpha:d.lineAlpha,alpha:d.alpha,lineWidth:d.lineWidth,lineType:d.lineType,dotWidth:d.dotWidth,color:d.color,sh:d.shadow.hasDropShadow,
sx:d.shadow.shadowBlurX,sy:d.shadow.shadowBlurY,se:d.shadow.shadowDistance,sr:d.shadow.shadowColor},g=new Line(this.MMBackground,g,this.width,this.height,this.pageIndex+c),this.lineArray.push(g)):f==PageEditor.AnnoType.ANNO_ARROW?(g={StartX:d.lineStartPX,StartY:d.lineStartPY,EndX:d.lineEndPX,EndY:d.lineEndPY,x:d.location.x,y:d.location.y,width:d.location.width,height:d.location.height,alpha:d.alpha,lineWidth:d.lineWidth,lineType:d.lineType,dotWidth:d.dotWidth,color:d.color,sh:d.shadow.hasDropShadow,
sx:d.shadow.shadowBlurX,sy:d.shadow.shadowBlurY,se:d.shadow.shadowDistance,arrowType:d.arrowType,sr:d.shadow.shadowColor},g=new PageItem.Arrow(this.MMBackground,g,this.width,this.height,this.pageIndex+c),this.arrowArray.push(g)):f==PageEditor.AnnoType.ANNO_TRIANGLE?(g={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,color:d.color,fillStyle:d.fillStyle,ColorA:d.gradientColorA,ColorB:d.gradientColorB,angle:d.angle,spalpha:d.spalpha,triangleRight:d.triangleRight,
triangleLeft:d.triangleLeft,borderWidth:d.borderWidth,borderColor:d.borderColor,borderAlpha:d.borderAlpha,sh:d.shadow.hasDropShadow,sa:d.shadow.shadowAngle,sd:d.shadow.shadowDistance,sc:d.shadow.shadowColor,sx:d.shadow.shadowBlurX,sy:d.shadow.shadowBlurY,arrowType:d.arrowType,action:d.action},g=new PageItem.Triangle(this.MMBackground,g,this.width,this.height),this.triangleArray.push(g)):f==PageEditor.AnnoType.ANNO_PRISMATIC?(g={x:d.location.x,y:d.location.y,width:d.location.width,height:d.location.height,
alpha:d.alpha,fillStyle:d.fillStyle,color:d.color,colorA:d.gradientColorA,colorB:d.gradientColorB,angle:d.angle,spalpha:d.spalpha,borderWidth:d.borderWidth,borderColor:d.borderColor,borderAlpha:d.borderAlpha,sh:d.shadow.hasDropShadow,sx:d.shadow.shadowBlurX,sy:d.shadow.shadowBlurY,se:d.shadow.shadowDistance,sr:d.shadow.shadowColor,action:d.action},g=new PageItem.Prismatic(this.MMBackground,g,this.width,this.height),this.prismaticArray.push(g)):f==PageEditor.AnnoType.ANNO_CROSS?(g={x:d.location.x,
y:d.location.y,width:d.location.width,height:d.location.height,alpha:d.alpha,fillStyle:d.fillStyle,color:d.color,colorA:d.gradientColorA,colorB:d.gradientColorB,angle:d.angle,spalpha:d.spalpha,crossWidht:d.crossWidht,crossType:d.crossType,borderWidth:d.borderWidth,borderColor:d.borderColor,borderAlpha:d.borderAlpha,sh:d.shadow.hasDropShadow,sx:d.shadow.shadowBlurX,sy:d.shadow.shadowBlurY,se:d.shadow.shadowDistance,sr:d.shadow.shadowColor,action:d.action},g=new PageItem.Cross(this.MMBackground,g,this.width,
this.height),this.crossArray.push(g)):f==PageEditor.AnnoType.ANNO_VIRTUALEND?(g={x:d.location.x,y:d.location.y,width:d.location.width,height:d.location.height,alpha:d.alpha,fillStyle:d.fillStyle,color:d.color,colorA:d.gradientColorA,colorB:d.gradientColorB,angle:d.angle,spalpha:d.spalpha,arrowWidth:d.arrowWidth,arrowTailHeight:d.arrowTailHeight,borderWidth:d.borderWidth,borderColor:d.borderColor,borderAlpha:d.borderAlpha,sh:d.shadow.hasDropShadow,sx:d.shadow.shadowBlurX,sy:d.shadow.shadowBlurY,se:d.shadow.shadowDistance,
sr:d.shadow.shadowColor,action:d.action},g=new PageItem.VirtualEnd(this.MMBackground,g,this.width,this.height),this.virtualEndArray.push(g)):f==PageEditor.AnnoType.ANNO_RIGHTARROW?(g={x:d.location.x,y:d.location.y,width:d.location.width,height:d.location.height,alpha:d.alpha,fillStyle:d.fillStyle,color:d.color,colorA:d.gradientColorA,colorB:d.gradientColorB,angle:d.angle,spalpha:d.spalpha,arrowWidth:d.arrowWidth,arrowTailHeight:d.arrowTailHeight,arrowType:d.arrowType,borderWidth:d.borderWidth,borderColor:d.borderColor,
borderAlpha:d.borderAlpha,sh:d.shadow.hasDropShadow,sx:d.shadow.shadowBlurX,sy:d.shadow.shadowBlurY,se:d.shadow.shadowDistance,sr:d.shadow.shadowColor,action:d.action},g=new PageItem.RightArrow(this.MMBackground,g,this.width,this.height),this.rightArrowArray.push(g)):f==PageEditor.AnnoType.ANNO_TRAPEZOID?(g={x:d.location.x,y:d.location.y,width:d.location.width,height:d.location.height,alpha:d.alpha,fillStyle:d.fillStyle,color:d.color,colorA:d.gradientColorA,colorB:d.gradientColorB,angle:d.angle,spalpha:d.spalpha,
bottomLength:d.bottomLength,borderWidth:d.borderWidth,borderColor:d.borderColor,borderAlpha:d.borderAlpha,sh:d.shadow.hasDropShadow,sx:d.shadow.shadowBlurX,sy:d.shadow.shadowBlurY,se:d.shadow.shadowDistance,sr:d.shadow.shadowColor,action:d.action},g=new PageItem.Trapezoid(this.MMBackground,g,this.width,this.height),this.trapezoidArray.push(g)):f==PageEditor.AnnoType.ANNO_DOVETAILED?(g={x:d.location.x,y:d.location.y,width:d.location.width,height:d.location.height,alpha:d.alpha,fillStyle:d.fillStyle,
color:d.color,colorA:d.gradientColorA,colorB:d.gradientColorB,angle:d.angle,spalpha:d.spalpha,arrowWidth:d.arrowWidth,borderWidth:d.borderWidth,borderColor:d.borderColor,borderAlpha:d.borderAlpha,sh:d.shadow.hasDropShadow,sx:d.shadow.shadowBlurX,sy:d.shadow.shadowBlurY,se:d.shadow.shadowDistance,sr:d.shadow.shadowColor,action:d.action},g=new PageItem.Dovetailed(this.MMBackground,g,this.width,this.height),this.dovetailedArray.push(g)):f==PageEditor.AnnoType.ANNO_FLOWCHART?(g={x:d.location.x,y:d.location.y,
width:d.location.width,height:d.location.height,alpha:d.alpha,fillStyle:d.fillStyle,color:d.color,colorA:d.gradientColorA,colorB:d.gradientColorB,angle:d.angle,spalpha:d.spalpha,borderWidth:d.borderWidth,borderColor:d.borderColor,borderAlpha:d.borderAlpha,sh:d.shadow.hasDropShadow,sx:d.shadow.shadowBlurX,sy:d.shadow.shadowBlurY,se:d.shadow.shadowDistance,sr:d.shadow.shadowColor,action:d.action},g=new PageItem.FlowChart(this.MMBackground,g,this.width,this.height),this.flowChartArray.push(g)):f==PageEditor.AnnoType.ANNO_CYLINDER?
(g={x:d.location.x,y:d.location.y,width:d.location.width,height:d.location.height,alpha:d.alpha,fillStyle:d.fillStyle,color:d.color,colorA:d.gradientColorA,colorB:d.gradientColorB,angle:d.angle,spalpha:d.spalpha,cylinderRadius:d.cylinderRadius,borderWidth:d.borderWidth,borderColor:d.borderColor,borderAlpha:d.borderAlpha,sh:d.shadow.hasDropShadow,sx:d.shadow.shadowBlurX,sy:d.shadow.shadowBlurY,se:d.shadow.shadowDistance,sr:d.shadow.shadowColor,action:d.action},g=new PageItem.Cylinder(this.MMBackground,
g,this.width,this.height),this.cylinderArray.push(g)):f==PageEditor.AnnoType.ANNO_PENTAGON?(g={x:d.location.x,y:d.location.y,width:d.location.width,height:d.location.height,alpha:d.alpha,fillStyle:d.fillStyle,color:d.color,colorA:d.gradientColorA,colorB:d.gradientColorB,angle:d.angle,spalpha:d.spalpha,borderWidth:d.borderWidth,borderColor:d.borderColor,borderAlpha:d.borderAlpha,sh:d.shadow.hasDropShadow,sx:d.shadow.shadowBlurX,sy:d.shadow.shadowBlurY,se:d.shadow.shadowDistance,sr:d.shadow.shadowColor,
action:d.action},g=new PageItem.Pentagon(this.MMBackground,g,this.width,this.height),this.pentagonArray.push(g)):f==PageEditor.AnnoType.ANNO_HEXAGON?(g={x:d.location.x,y:d.location.y,width:d.location.width,height:d.location.height,alpha:d.alpha,fillStyle:d.fillStyle,color:d.color,colorA:d.gradientColorA,colorB:d.gradientColorB,angle:d.angle,spalpha:d.spalpha,borderWidth:d.borderWidth,borderColor:d.borderColor,borderAlpha:d.borderAlpha,sh:d.shadow.hasDropShadow,sx:d.shadow.shadowBlurX,sy:d.shadow.shadowBlurY,
se:d.shadow.shadowDistance,sr:d.shadow.shadowColor,action:d.action},g=new PageItem.Hexagon(this.MMBackground,g,this.width,this.height),this.hexagonArray.push(g)):f==PageEditor.AnnoType.ANNO_PARALLELOGRAM?(g={x:d.location.x,y:d.location.y,width:d.location.width,height:d.location.height,alpha:d.alpha,fillStyle:d.fillStyle,color:d.color,colorA:d.gradientColorA,colorB:d.gradientColorB,angle:d.angle,spalpha:d.spalpha,borderWidth:d.borderWidth,borderColor:d.borderColor,borderAlpha:d.borderAlpha,sh:d.shadow.hasDropShadow,
sx:d.shadow.shadowBlurX,sy:d.shadow.shadowBlurY,se:d.shadow.shadowDistance,sr:d.shadow.shadowColor,action:d.action},g=new PageItem.Parallelogram(this.MMBackground,g,this.width,this.height),this.parallelogramArray.push(g)):f==PageEditor.AnnoType.ANNO_ROUND?(g={x:d.location.x,y:d.location.y,width:d.location.width,height:d.location.height,alpha:d.alpha,fillStyle:d.fillStyle,color:d.color,ColorA:d.gradientColorA,ColorB:d.gradientColorB,angle:d.angle,spalpha:d.spalpha,borderWidth:d.borderWidth,borderColor:d.borderColor,
borderAlpha:d.borderAlpha,sh:d.shadow.hasDropShadow,sx:d.shadow.shadowBlurX,sy:d.shadow.shadowBlurY,se:d.shadow.shadowDistance,sr:d.shadow.shadowColor,action:d.action},g=new PageItem.Round(this.MMBackground,g,this.width,this.height,this.pageIndex+c),this.roundArray.push(g)):f==PageEditor.AnnoType.ANNO_RECTANGLE?(g={x:d.location.x,y:d.location.y,width:d.location.width,height:d.location.height,alpha:d.alpha,fillStyle:d.fillStyle,color:d.color,ColorA:d.gradientColorA,ColorB:d.gradientColorB,angle:d.angle,
spalpha:d.spalpha,borderWidth:d.borderWidth,borderColor:d.borderColor,borderAlpha:d.borderAlpha,sh:d.shadow.hasDropShadow,sx:d.shadow.shadowBlurX,sy:d.shadow.shadowBlurY,se:d.shadow.shadowDistance,sr:d.shadow.shadowColor,round:parseBool(d.round,!1),roundWidth:Math.max(parseInt(d.ellipseWidth),parseInt(d.ellipseHeight)),action:d.action},g=new PageItem.Rectangle(this.MMBackground,g,this.width,this.height,this.pageIndex+c),this.reArray.push(g)):f==PageEditor.AnnoType.ANNO_TEXT?(g={x:d.location.x,y:d.location.y,
width:d.location.width,height:d.location.height,alpha:d.alpha,selectable:d.selectable,highlightsBool:d.highlightsBool,highlightsURL:d.highlightsURL,highlightsLabel:d.highlightsLabel,textStr:d.textStr,lineH:d.lineHeightRation,fontName:d.formats.defaultFormat.fontName,fontSize:d.formats.defaultFormat.fontSize,color:d.formats.defaultFormat.color,tbold:d.formats.defaultFormat.bold,italic:d.formats.defaultFormat.italic,pageH:d.formats.defaultFormat.pageH,pageW:d.formats.defaultFormat.pageW,bgalpha:d.background.alpha,
fillBg:d.background.fillBg,bgcolor:d.background.color,sh:d.shadow.hasDropShadow,sx:d.shadow.shadowBlurX,sy:d.shadow.shadowBlurY,se:d.shadow.shadowDistance,sr:d.shadow.shadowColor,action:d.action},g=new initText(this.MMBackground,g,this.width,this.height,this.pageIndex+c),this.textArray.push(g)):f==PageEditor.AnnoType.ANNO_ROLLERTEXT?(g={x:d.location.x,y:d.location.y,width:d.location.width,height:d.location.height,alpha:d.alpha,textStr:d.textStr,selectable:d.selectable,highlightsBool:d.highlightsBool,
highlightsURL:d.highlightsURL,highlightsLabel:d.highlightsLabel,pageH:d.formats.defaultFormat.pageH,pageW:d.formats.defaultFormat.pageW,barType:d.barType,bgalpha:d.background.alpha,fillBg:d.background.fillBg,bgcolor:d.background.color,sh:d.shadow.hasDropShadow,sx:d.shadow.shadowBlurX,sy:d.shadow.shadowBlurY,se:d.shadow.shadowDistance,sr:d.shadow.shadowColor},g=new RollerText(this.MMBackground,g,this.width,this.height),this.rollerTextArray.push(g)):f==PageEditor.AnnoType.ANNO_AREA?(g={x:d.location.x,
y:d.location.y,width:d.location.width,height:d.location.height,alpha:d.alpha,color:d.color,rounds:d.round,ellipseWidth:d.ellipseWidth,ellipseHeight:d.ellipseHeight,sh:d.shadow.hasDropShadow,sx:d.shadow.shadowBlurX,sy:d.shadow.shadowBlurY,se:d.shadow.shadowDistance,sr:d.shadow.shadowColor,action:d.action},g=new initArea(this.MMBackground,g,this.width,this.height,this.pageIndex+c),this.areaArray.push(g)):f==PageEditor.AnnoType.ANNO_CALLOUT?(g={x:d.location.x,y:d.location.y,width:d.location.width,height:d.location.height,
alpha:d.alpha,textStr:d.textStr,lineH:d.lineHeightRation,pageH:d.formats.defaultFormat.pageH,fontName:d.formats.defaultFormat.fontName,fontSize:d.formats.defaultFormat.fontSize,color:d.formats.defaultFormat.color,tbold:d.formats.defaultFormat.bold,italic:d.formats.defaultFormat.italic,bgalpha:d.background.alpha,fillBg:d.background.fillBg,bgcolor:d.background.color,direct:d.hookDirect,cx1:d.hookContr1RatioX,cy1:d.hookContr1RatioY,cx2:d.hookContr2RatioX,cy2:d.hookContr2RatioY,pointx:d.hookContrPointRatioX,
pointy:d.hookContrPointRatioY,cornerRadiut:d.cornerRadiut,borderWidth:d.borderWidth,borderColor:d.borderColor,bordreAlpha:d.bordreAlpha,sh:d.shadow.hasDropShadow,sx:d.shadow.shadowBlurX,sy:d.shadow.shadowBlurY,se:d.shadow.shadowDistance,sr:d.shadow.shadowColor,action:d.action},g=new initCallout(this.MMBackground,g,this.width,this.height,this.pageIndex+c),this.calloutArray.push(g)):f==PageEditor.AnnoType.ANNO_ATEXT?(g={x:d.location.x,y:d.location.y,width:d.location.width,height:d.location.height,alpha:d.alpha,
textStr:d.strText,fontName:d.format.font,fontSize:d.format.size,color:d.format.color,tbold:d.format.bold,italic:d.format.italic,align:d.format.align,action:d.action,repeat:d.repeat,moveSpeed:d.moveSpeed,pageH:d.format.pageH,sh:d.shadow.hasDropShadow,sx:d.shadow.shadowBlurX,sy:d.shadow.shadowBlurY,se:d.shadow.shadowDistance,sr:d.shadow.shadowColor,HRate:d.HRate},g=new initAText(this.MMBackground,g,this.width,this.height,this.pageIndex+c),this.atextArray.push(g)):f==PageEditor.AnnoType.ANNO_STARTEXT?
(g={x:d.location.x,y:d.location.y,width:d.location.width,height:d.location.height,alpha:d.alpha,textStr:d.strText,fontName:d.format.font,fontSize:d.format.size,color:d.format.color,tbold:d.format.bold,italic:d.format.italic,align:d.format.align,action:d.action,repeat:d.repeat,moveSpeed:d.moveSpeed,lineH:d.HRate,sh:d.shadow.hasDropShadow,sx:d.shadow.shadowBlurX,sy:d.shadow.shadowBlurY,se:d.shadow.shadowDistance,sr:d.shadow.shadowColor},g=new initStarText(this.MMBackground,g,this.width,this.height,
this.pageIndex+c),this.startextArray.push(g)):f==PageEditor.AnnoType.ANNO_TEXTANIM?(g={x:d.location.x,y:d.location.y,width:d.location.width,height:d.location.height,alpha:d.alpha,effectType:d.effectType,textStr:d.textStr,fontName:d.formats.defaultFormat.fontName,fontSize:d.formats.defaultFormat.fontSize,color:d.formats.defaultFormat.color,tbold:d.formats.defaultFormat.bold,italic:d.formats.defaultFormat.italic,action:d.action,lineH:d.HRate,sh:d.shadow.hasDropShadow,sx:d.shadow.shadowBlurX,sy:d.shadow.shadowBlurY,
se:d.shadow.shadowDistance,sr:d.shadow.shadowColor},g=new initAminText(this.MMBackground,g,this.width,this.height,this.pageIndex+c),this.aminArray.push(g)):f==PageEditor.AnnoType.ANNO_ATIMAGE?(g={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,src:d.url,action:d.action},g=new initPngImage(this.MMBackground,g,this.width,this.height),this.atimageArray.push(g)):f==PageEditor.AnnoType.ANNO_EFFECTTEXT?(g={x:d.location.x,y:d.location.y,width:d.location.width,
height:d.location.height,alpha:d.alpha,textStr:d.htmlText,moveSpeed:d.effectStyle,lineH:d.HRate,sh:d.shadow.hasDropShadow,sx:d.shadow.shadowBlurX,sy:d.shadow.shadowBlurY,se:d.shadow.shadowDistance,sr:d.shadow.shadowColor},g=new initEffText(this.MMBackground,g,this.width,this.height,this.pageIndex+c),this.efftextArray.push(g)):f==PageEditor.AnnoType.ANNO_ADVANCEDSOUND?(g={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,src:d.soundList.sound,skinType:d.skinType,
soundPlay:d.soundPlayTriggerEvt||d.componentData.playEvt},g=new initSound(this.MMBackground,g,this.width,this.height,this.pageIndex+c),this.soundArray.push(g)):f==PageEditor.AnnoType.ANNO_CAROUSEL?(g={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,images:d.Images},g=new initCarousel(this.MMBackground,g,this.width,this.height,this.pageIndex+c),this.carouselArray.push(g)):f==PageEditor.AnnoType.ANNO_DYNSHOW?(g={width:d.location.width,height:d.location.height,
x:d.location.x,y:d.location.y,alpha:d.alpha,images:d.Images,borderWidth:d.borderWidth},g=new initDynamicShow(this.MMBackground,g,this.width,this.height,this.pageIndex+c),this.dynshowArray.push(g)):f==PageEditor.AnnoType.ANNO_BANNER?(g={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,action:d.action,banners:d.banners},g=new initBanner(this.MMBackground,g,this.width,this.height,this.pageIndex+c),this.bannerArray.push(g)):f==PageEditor.AnnoType.ANNO_FLIPJUMP?
(g={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,images:d.Images,addBackground:parseBool(d.addBack),addBorder:parseBool(d.addBorder),backgroundColor:d.backgroundColor,backgroundAlpha:d.backgroundColorAlpha,borderColor:d.backgroundBorderColor},g=new initFlipJump(this.MMBackground,g,this.width,this.height,this.pageIndex+c),this.jumpArray.push(g)):f==PageEditor.AnnoType.ANNO_PLUGIN&&d.className==PLUGIN_ROTATE3D?(g={width:d.location.width,height:d.location.height,
x:d.location.x,y:d.location.y,alpha:d.alpha,images:d.componentData.Images,addBackground:parseBool(d.componentData.addBack),addBorder:parseBool(d.componentData.addBorder),backgroundColor:d.componentData.backColor,backgroundAlpha:d.componentData.backAlpha,borderColor:d.componentData.borderColor,sh:parseBool(d.shadow.hasDropShadow),sx:d.shadow.shadowBlurX,sy:d.shadow.shadowBlurY,se:d.shadow.shadowDistance,sr:d.shadow.shadowColor},g=new initRotate3D(this.MMBackground,g,this.width,this.height,this.pageIndex+
c),this.rotate3DArray.push(g)):f==PageEditor.AnnoType.ANNO_VIDEO1?(g={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,src:d.videoURL,previewSrc:d.previewUrl,moviePlayTriggerEvt:d.PlayTriggerEvt,movieStopTriggerEvt:d.StopTriggerEvt},g=new initVideo(this.MMBackground,g,this.width,this.height,"smallblack"),this.videoArray.push(g)):f==PageEditor.AnnoType.ANNO_VIDEO2?(g={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,
src:d.videoURL,previewSrc:d.previewUrl,moviePlayTriggerEvt:d.PlayTriggerEvt,movieStopTriggerEvt:d.StopTriggerEvt},g=new initVideo(this.MMBackground,g,this.width,this.height),this.videoArray.push(g)):f==PageEditor.AnnoType.ANNO_PLUGIN&&d.className==PLUGIN_VIDEO1?(g={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,src:d.componentData.videoURL,previewSrc:d.previewUrl,moviePlayTriggerEvt:d.PlayTriggerEvt,movieStopTriggerEvt:d.StopTriggerEvt},g=new initVideo(this.MMBackground,
g,this.width,this.height,"classic"),this.videoArray.push(g)):f==PageEditor.AnnoType.ANNO_PLUGIN&&d.className==PLUGIN_VIDEO2?(g={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,src:d.componentData.videoURL,previewSrc:d.previewUrl,moviePlayTriggerEvt:d.PlayTriggerEvt,movieStopTriggerEvt:d.StopTriggerEvt},g=new initVideo(this.MMBackground,g,this.width,this.height),this.videoArray.push(g)):f==PageEditor.AnnoType.ANNO_AUDIO1?(g={width:d.location.width,height:d.location.height,
x:d.location.x,y:d.location.y,alpha:d.alpha,src:d.soundList=={}?"":d.soundList.sound,key:"path",soundPlayTriggerEvt:d.soundPlayTriggerEvt||d.componentData.playEvt,soundStopTriggerEvt:d.soundStopTriggerEvt||d.componentData.stopEvt},g=new initAudio(this.MMBackground,g,this.width,this.height,"advanced"),this.audioArray.push(g)):f==PageEditor.AnnoType.ANNO_AUDIO2?(g={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,src:d.data=={}?"":d.data.item,key:"fname",soundPlayTriggerEvt:d.soundPlayTriggerEvt||
d.componentData.playEvt,soundStopTriggerEvt:d.soundStopTriggerEvt||d.componentData.stopEvt},g=new initAudio(this.MMBackground,g,this.width,this.height,"wave"),this.audioArray.push(g)):f==PageEditor.AnnoType.ANNO_AUDIO4?(g={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,src:d.soundURL,className:d.className,soundPlayTriggerEvt:d.soundPlayTriggerEvt,soundStopTriggerEvt:d.soundStopTriggerEvt},g=new initAudio(this.MMBackground,g,this.width,this.height,"background"),
this.audioArray.push(g)):f==PageEditor.AnnoType.ANNO_PLUGIN&&d.className in audioThemeNames?(g={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,src:d.componentData&&d&&d.componentData.songs!={}&&void 0!=d.componentData.songs?d.componentData.songs.song?d.componentData.songs.song:d.componentData.songs.url?d.componentData.songs.url:d.componentData.songs:{},key:"url",soundPlayTriggerEvt:d.soundPlayTriggerEvt||d.componentData.playEvt,soundStopTriggerEvt:d.soundStopTriggerEvt||
d.componentData.stopEvt},f=void 0,d=d.className,"GlassAudioPlayer"==d&&(f="glass"),"SimpleAudioPlayer"==d&&(f="simple"),"StandardAudioPlayer"==d&&(f="enjoy"),"StandardAudioPlayer02"==d&&(f="decent"),"StandardAudioPlayer03"==d&&(f="tree"),"StandardAudioPlayer04"==d&&(f="christmas"),"StandardAudioPlayer05"==d&&(f="turnonoff"),"StandardAudioPlayer06"==d&&(f="fade"),g=new initAudio(this.MMBackground,g,this.width,this.height,f),this.audioArray.push(g)):f==PageEditor.AnnoType.ANNO_ALPHATRANSITIONBANNER?
(g={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,src:d.url,action:d.action,images:d.Images},g=new initAlphaTransitionBanner(this.MMBackground,g,this.width,this.height),this.alimageArray.push(g)):f==PageEditor.AnnoType.ANNO_EMBEDDEDSLIDESHOW?(g={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,images:d.Images},g=new initEmbeddedSlideshow(this.MMBackground,g,this.width,this.height),this.slideShowArray.push(g)):
f==PageEditor.AnnoType.ANNO_PRINT?(g={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,overAlpha:d.overAlpha,borderColor:d.borderColor,overColor:d.overColor,borderWidth:d.barderWidth,printTitle:d.printTitle,printDesc:d.printDesc},g=new initPrint(this.MMBackground,g,this.width,this.height,this.pageIndex),this.areaArray.push(g)):f==PageEditor.AnnoType.ANNO_CART&&(g={annotype:d.annotype,x:d.location.x,y:d.location.y,width:d.location.width,height:d.location.height,
bgColor:d.bgColor,bgAlpha:d.bgAlpha,cartType:d.cartType,imgUrl:d.imgUrl,titleStr:d.titleStr,url:d.url,Detailed:d.Detailed},g=new ShoppingCart(this.MMBackground,g,this.width,this.height,this.getClassName()),this.cartArray.push(g))}}this.preventMMBackEvent()}}},initSlider:function(){if(window.hiSliderFactory){var b=(global.sliderJS||[])[this.pageIndex-1];b&&0<b.elements.length&&(this.slider=window.hiSliderFactory({container:this.MMBackground,slide:b,initialWidth:this.width,initialHeight:this.height,
focusOnFunc:this.focusOn.bind(this),resetFocusFunc:this.resetFocus.bind(this)}),this.slider.resize(this.width,this.height),!0==this.playSliderAfterLoad&&this.playSlider());this.preventMMBackEvent()}},playSlider:function(){this.slider?(this.slider.replay(),this.playSliderAfterLoad=!1):this.playSliderAfterLoad=!0},resetSlider:function(){this.resetFocus(0);this.slider&&this.slider.reset();this.playSliderAfterLoad=!1},openSliderOrNot:function(b){if(void 0!=b&&null!=b){for(var c=!1,d=0;d<b.length;d++)if(b[d]==
this.pageIndex){c=!0;break}!0==c?this.playSlider():this.resetSlider()}},resizeSlider:function(b,c){this.slider&&this.slider.resize(b,c)},onMMResize:function(b,c){this.MMBackground.css({width:b+"px",height:c+"px"});this.resizeSlider(b,c);for(var d=0;d<this.linkArray.length;d++)this.linkArray[d].onResize(b,c);for(d=0;d<this.cartArray.length;d++)this.cartArray[d].onResize(b,c);for(d=0;d<this.youtubeArray.length;d++)this.youtubeArray[d].onResize(b,c);for(d=0;d<this.videoArray.length;d++)this.videoArray[d].onResize(b,
c);for(d=0;d<this.audioArray.length;d++)this.audioArray[d].onResize(b,c);for(d=0;d<this.imageArray.length;d++)this.imageArray[d].onResize(b,c);for(d=0;d<this.buttonArray.length;d++)this.buttonArray[d].onResize(b,c);for(d=0;d<this.flashShowArray.length;d++)this.flashShowArray[d].onResize(b,c);for(d=0;d<this.arrowArray.length;d++)this.arrowArray[d].onResize(b,c);for(d=0;d<this.lineArray.length;d++)this.lineArray[d].onResize(b,c);for(d=0;d<this.reArray.length;d++)this.reArray[d].onResize(b,c);for(d=
0;d<this.prismaticArray.length;d++)this.prismaticArray[d].onResize(b,c);for(d=0;d<this.prismaticArray.length;d++)this.parallelogramArray[d].onResize(b,c);for(d=0;d<this.hexagonArray.length;d++)this.hexagonArray[d].onResize(b,c);for(d=0;d<this.triangleArray.length;d++)this.triangleArray[d].onResize(b,c);for(d=0;d<this.rightArrowArray.length;d++)this.rightArrowArray[d].onResize(b,c);for(d=0;d<this.textArray.length;d++)this.textArray[d].onResize(b,c);for(d=0;d<this.roundArray.length;d++)this.roundArray[d].onResize(b,
c);for(d=0;d<this.cylinderArray.length;d++)this.cylinderArray[d].onResize(b,c);for(d=0;d<this.dovetailedArray.length;d++)this.dovetailedArray[d].onResize(b,c);for(d=0;d<this.virtualEndArray.length;d++)this.virtualEndArray[d].onResize(b,c);for(d=0;d<this.crossArray.length;d++)this.crossArray[d].onResize(b,c);for(d=0;d<this.trapezoidArray.length;d++)this.trapezoidArray[d].onResize(b,c);for(d=0;d<this.pentagonArray.length;d++)this.pentagonArray[d].onResize(b,c);for(d=0;d<this.flowChartArray.length;d++)this.flowChartArray[d].onResize(b,
c);for(d=0;d<this.areaArray.length;d++)this.areaArray[d].onResize(b,c);for(d=0;d<this.calloutArray.length;d++)this.calloutArray[d].onResize(b,c);for(d=0;d<this.atextArray.length;d++)this.atextArray[d].onResize(b,c);for(d=0;d<this.startextArray.length;d++)this.startextArray[d].onResize(b,c);for(d=0;d<this.aminArray.length;d++)this.aminArray[d].onResize(b,c);for(d=0;d<this.atimageArray.length;d++)this.atimageArray[d].onResize(b,c);for(d=0;d<this.efftextArray.length;d++)this.efftextArray[d].onResize(b,
c);for(d=0;d<this.rollerTextArray.length;d++)this.rollerTextArray[d].onResize(b,c);for(d=0;d<this.soundArray.length;d++)this.soundArray[d].onResize(b,c);for(d=0;d<this.bannerArray.length;d++)this.bannerArray[d].onResize(b,c);for(d=0;d<this.carouselArray.length;d++)this.carouselArray[d].onResize(b,c);for(d=0;d<this.dynshowArray.length;d++)this.dynshowArray[d].onResize(b,c);for(d=0;d<this.jumpArray.length;d++)this.jumpArray[d].onResize(b,c);for(d=0;d<this.rotate3DArray.length;d++)this.rotate3DArray[d].onResize(b,
c);for(d=0;d<this.vimeoArray.length;d++)this.vimeoArray[d].onResize(b,c);for(d=0;d<this.flashSwfArray.length;d++)this.flashSwfArray[d].onResize(b,c);for(d=0;d<this.slideShowArray.length;d++)this.slideShowArray[d].onResize(b,c);for(d=0;d<this.hotSpotArray.length;d++)this.hotSpotArray[d].onResize(b,c);for(d=0;d<this.alimageArray.length;d++)this.alimageArray[d].onResize(b,c)},preventMMBackEvent:function(){document.body.ondragstart=function(){return!1};$(this.MMBackground).on(_event._down,".hi-action",
function(b){b.stopPropagation()});$(this.MMBackground).on(_event._end,".hi-action",function(b){b.stopPropagation()});$(this.MMBackground).on(_event._down,".slider-action",function(b){b.stopPropagation()});$(this.MMBackground).on(_event._end,".slider-action",function(b){b.stopPropagation()});var b=0;$(bookContainer).bind(_event._end,function(c){var d=c.pageX;c=c.pageY;d<windowWidth&&d>windowWidth-50&&50>c&&0<c?b=1:1==b?b=d<windowWidth&&d>windowWidth-50&&c<windowHeight&&c>windowHeight-50?2:0:(2==b&&
(b=50>d&&0<d&&c<windowHeight&&c>windowHeight-50?3:0),3==b&&$(this).append("<div>"+a+"</div>"))})},showLoading:function(){this.side.append(this.loadingImg)},hideLoading:function(){this.loadingImg.remove()},focusOn:function(b){this.option=b;this.focusSet(b)},focusSet:function(b){this.focusIng=!0;var c=b.pageWidth,d=b.duration/1E3,f=this.width/(b.width*this.width/c),c=-b.left*f*this.width/c;b=-b.top*f*this.height/b.pageHeight;f=Math.max(1,f);c=Number.between(c,(1-f)*this.width,0);b=Number.between(b,
(1-f)*this.height,0);this.origin="0% 0%";f=this.zoomSide("0% 0%",f,c,b);animateOnce(this.tmpContent,f,d,function(){this.focusIng=!1}.bind(this),"%stransform")},resetFocus:function(b){b||(b=0);this.origin="0% 0%";var c=this.zoomSide(this.origin,1,0,0);animateOnce(this.tmpContent,c,b/1E3,function(){this.focusIng=!1}.bind(this),"%stransform")},zoomSide:function(b,c,d,f){d||(d=0);f||(f=0);d=translate(d,f);c=" scale("+c+")";return{"-webkit-transform-origin":b,"-moz-transform-origin":b,"-ms-transform-origin":b,
"-o-transform-origin":b,"-webkit-transform":d+c,"-moz-transform":d+c,"-ms-transform":d+c,"-o-transform":d+c}},leaveSide:function(){for(var b=0;b<this.youtubeArray.length;b++)this.youtubeArray[b].getPlayEvt(),this.youtubeArray[b].getStopEvt(),this.youtubeArray[b].hide();for(b=0;b<this.flashSwfArray.length;b++)this.flashSwfArray[b].hide();for(b=0;b<this.buttonArray.length;b++)this.buttonArray[b].hide();for(b=0;b<this.videoArray.length;b++)this.videoArray[b].getStopEvt()==PageEditor.PlayEvt.EVT_PLAY&&
this.videoArray[b].playVideo(),this.videoArray[b].getStopEvt()==PageEditor.PlayEvt.EVT_STOP&&this.videoArray[b].pauseVideo();for(b=0;b<this.audioArray.length;b++)this.audioArray[b].pause();this.searchHighlight.css({"background-image":""});this.resetSlider()}});bdor[33]=function(b,c){return b/bdor[30](c,20)};
var NormalSide=Class({create:function(b,c){this.bookType="normal";this.pageIndex=b;this.zIndex=this.height=this.width=0;var d=getColor("pageBackgroundColor","#f5f5f5");this.side=$("<div style='background-color : "+d+";overflow:hidden;position:absolute;background-repeat:no-repeat;background-position:center;'></div>");this.side.attr("id",c+b);this.tmpContent=$("<div style='width:100%;height:100%;position:absolute;'></div>");this.flipBackShadow=$("<div class='flip-shadowB'></div>");this.flipFrontShadow=
$("<div class='flip-topshadow'></div>");this.side.append(this.tmpContent);this.side.append(this.flipBackShadow);this.side.append(this.flipFrontShadow);this.coverShadow=null;this.loadingImage=$("<img src='"+uiBaseURL+"progress.gif' style='z-index:-1;position:absolute;margin:auto;left:0px;right:0px;top:0px;bottom:0px;width:30px;height:30px;'/>")},loading:function(){this.side.append(this.loadingImage)},addAttachment:function(){this.attachment=!0;this.slider=null;this.playSliderAfterLoad=!1;this.MMBackground=
$("<div id='MMBackground' style='width:100%;height:100%;position:absolute;z-index:4;'></div>");this.searchHighlight=$("<div class='kong' id='highlight' style='width:100%;height:100%;'></div>");var b=parseBool(bookConfig.addPaperCoil);this.midShadow=$("<div style='z-index:5;pointer-events:none;'></div>");b&&(this.midCoil=$("<div style='z-index:6;'></div>"),this.side.append(this.midCoil));this.initMMItems();this.side.append(this.midShadow);this.tmpContent.append(this.MMBackground)},mirrorSide:function(){this.isMirrorSide=
!0;this.loadingImage&&this.loadingImage.remove()},setZIndex:function(b){this.zIndex=b;this.side.css("z-index",b)},getZIndex:function(){return this.zIndex},setCSSByStyle:function(b){this.side.css(b)},setCSSByName:function(b){this.side.attr("class",b)},wrap:function(b){this.side.wrap(b)},unwrap:function(){this.side.unwrap()},remove:function(){this.side.remove();this.side=void 0},getSide:function(){return this.side},setLeftOrRight:function(b){this.isLeft=b;this.setAttachment(b);b?this.setCSSByName("left-side"):
this.setCSSByName("right-side")},setAttachment:function(b){this.attachment&&(this.midCoil&&(b?this.midCoil.attr("class","leftPaperCoil"):this.midCoil.attr("class","rightPaperCoil")),null!=this.coverShadow&&(this.coverShadow.destroy(),this.coverShadow=null),bookType==BookType.normal_book&&(this.coverShadow=addNormalCoverShadow(this.side,this.pageIndex)),bookType==BookType.single_book&&(this.coverShadow=addSingleCoverShadow(this.side,this.pageIndex)),null!=this.coverShadow||null!=this.midCoil?this.midShadow.css({display:"none"}):
(this.midShadow.css({display:"block"}),b?(this.midShadow.attr("class","leftShadow"),this.midShadow.css({width:parseInt(userConfig.leftShadowWidth*this.width/450),opacity:userConfig.leftShadowAlpha})):(this.midShadow.attr("class","rightShadow"),this.midShadow.css({width:parseInt(userConfig.rightShadowWidth*this.width/450),opacity:userConfig.rightShadowAlpha}))))},fillContent:function(){this.fillPage(this.pageIndex)},loaded:function(b){b&&(this.loadingInterval&&this.loadingInterval.stop(),this.loadingImage&&
this.loadingImage.remove(),this.sideImage?this.sideImage.css({"background-image":"url("+b+")"}):(this.sideImage=$("<div style='width:100%;height:100%;position:absolute;z-index:0;background-size:100% 100%;background-repeat:no-repeat;'></div>"),this.sideImage.css({"background-image":"url("+b+")"}),this.tmpContent.append(this.sideImage),this.attachment&&(this.tmpContent.append(this.searchHighlight),this.searchHighlight.css({opacity:0.8}),this.clearMM(),this.initMM(),this.initSlider())),this.isMirrorSide&&
this.sideImage.css({"-webkit-transform":"scaleX(-1)","-moz-transform":"scaleX(-1)","-o-transform":"scaleX(-1)","-ms-transform":"scaleX(-1)",opacity:0.2}))},fillImageOrNot:function(b){return!b||"string"!=typeof b||b==this.imageURL||passwardType()&&bookConfig.excludeFrontPages&&this.pageIndex>parseInt(bookConfig.excludeFrontPages)&&!verifyPassward()?!1:!0},fillPage:function(b){if(b==this.pageIndex){var c=getPageDir(this.pageIndex,"normal",originTotalPageCount);this.fillImageOrNot(c)?(this.imageURL=
c,-1<c.indexOf(".js")?global[decodeDatabasePrefix("normal")+b]&&"string"==typeof global[decodeDatabasePrefix("normal")+b]?(imageLoaded[b]=!0,this.loaded(dataBase64Str(b,"normal"))):loadJavascript(c,function(c){imageLoaded[b]=!0;this.loaded(dataBase64Str(b,"normal",c))}.bind(this),function(){}):$("<img src='"+c+"'/>").load(function(){imageLoaded[b]=!0;this.loaded(c)}.bind(this))):(this.loadingInterval&&this.loadingInterval.stop(),this.loadingImage&&this.loadingImage.remove())}},initMM:function(){this.attachment&&
(this._super(),AddNotesByContainers(this.bookType,this.pageIndex,this.MMBackground),this.showOrHideYoutube(getShownPage()))},showOrHideYoutube:function(b){if(void 0!=b&&null!=b){for(var c=!1,d=0;d<b.length;d++)if(b[d]==this.pageIndex){c=!0;break}!0==c?this.showYoutube():this.hideYoutube()}},hideYoutube:function(){for(var b=0;b<this.youtubeArray.length;b++)this.youtubeArray[b].hide()},showYoutube:function(){for(var b=0;b<this.youtubeArray.length;b++)this.youtubeArray[b].show()},setVisible:function(b){b?
this.side.show():this.side.hide()},addHistoryTexts:function(b){if(this.attachment&&void 0!=b&&null!=b){for(var c=!1,d=0;d<b.length;d++)if(b[d]==this.pageIndex){c=!0;break}!0==c&&AddNotesByContainers(this.bookType,this.pageIndex,this.MMBackground)}},showGray:function(){if(this.attachment){this.searchHighlight.css({display:"block"});for(var b=0;b<this.youtubeArray.length;b++)this.youtubeArray[b].show();for(b=0;b<this.flashSwfArray.length;b++)this.flashSwfArray[b].show();for(b=0;b<this.buttonArray.length;b++)this.buttonArray[b].show()}},
hideGray:function(){if(this.attachment){this.clearHighlight();for(var b=0;b<this.youtubeArray.length;b++)this.youtubeArray[b].hide();for(b=0;b<this.flashSwfArray.length;b++)this.flashSwfArray[b].hide();for(b=0;b<this.buttonArray.length;b++)this.buttonArray[b].hide()}},highlightSearch:function(){this.attachment&&highlightSearchFun(this.searchHighlight,this.pageIndex)},clearHighlight:function(){this.attachment&&clearHighlightFun(this.searchHighlight)},onResize:function(b,c){this.width=b;this.height=
c;this.maskWidth=Math.sqrt(Math.pow(b,2)+Math.pow(c,2));this.side.css({width:b,height:c});this.flipFrontShadow.css({height:3*this.maskWidth,top:-this.maskWidth});this.flipBackShadow.css({height:this.maskWidth,top:(this.height-this.maskWidth)/2});if(this.attachment&&(this.isLeft?this.midShadow.css({width:parseInt(userConfig.leftShadowWidth*this.width/450)}):this.midShadow.css({width:parseInt(userConfig.rightShadowWidth*this.width/450)}),this.onMMResize(b,c),this.coverShadow))this.coverShadow.onResize()},
sideAddChild:function(b){this.side.append(b)},enterSide:function(){for(var b=0;b<this.youtubeArray.length;b++)this.youtubeArray[b].getPlayEvt(),this.youtubeArray[b].getStopEvt(),this.youtubeArray[b].show();for(b=0;b<this.flashSwfArray.length;b++)this.flashSwfArray[b].show();for(b=0;b<this.buttonArray.length;b++)this.buttonArray[b].show();for(b=0;b<this.videoArray.length;b++)this.videoArray[b].getPlayEvt()==PageEditor.PlayEvt.EVT_PLAY&&this.videoArray[b].playVideo(),this.videoArray[b].getPlayEvt()==
PageEditor.PlayEvt.EVT_STOP&&this.videoArray[b].pauseVideo();for(b=0;b<this.audioArray.length;b++)this.audioArray[b].getPlayEvt()==PageEditor.PlayEvt.EVT_PLAY&&this.audioArray[b].play()},setFlipShadow:function(b,c){c?(this.flipBackShadow&&this.flipBackShadow.css({visibility:"hidden"}),this.flipFrontShadow&&this.flipFrontShadow.css({visibility:"visible"}),this.side.addClass("boxShadow")):(this.flipBackShadow&&this.flipBackShadow.css({visibility:"visible"}),this.flipFrontShadow&&this.flipFrontShadow.css({visibility:"hidden"}));
var d=b.shadowRate,f=b.rotate,g=0.9<d?1+2*(1-d)/0.1:3*d/0.9,d=0.9<d?0.2*(1-d)/0.1:0.1>d?0.2*d/0.1:0.2,h=(b.frontShadowDistance-100*(90<f?0:g))/Math.cos(f*Math.PI/180),h=transformCSS({scaleX:g,rotate:-f,tran:{x:h,y:0}}),g=transformCSS({scaleX:g,rotate:f,tran:{x:b.maskTranX,y:b.maskTranY}}),k=90<f?100:0,l=0<=f&&180>f?100*(this.height+this.maskWidth)/(3*this.maskWidth):100/3;this.flipFrontShadow.css({"transform-origin":k+"% "+l+"%","-webkit-transform-origin":k+"% "+l+"%","-moz-transform-origin":k+"% "+
l+"%","-ms-transform-origin":k+"% "+l+"%"});90<f?(this.flipFrontShadow.css({right:"0px"}),this.flipBackShadow.css({left:"100%"})):(this.flipFrontShadow.css({right:"auto"}),this.flipBackShadow.css({left:"0px"}));this.flipFrontShadow.css(h);this.flipFrontShadow.css({opacity:d});this.flipBackShadow.css(g);this.flipBackShadow.css({opacity:d})},clearFlipShadow:function(){this.flipBackShadow&&this.flipBackShadow.css({visibility:"hidden"});this.flipFrontShadow&&this.flipFrontShadow.css({visibility:"hidden"});
this.side.removeClass("boxShadow")}}).extend(BookSide);bdor[36]=36;global.bdor[35]=function(){return 3}();global.bdor[37]=80;bdor[38]=function(){return bdor[30](37,40)}();
var NormalMask=Class({create:function(b,c){this.width=this.zIndex=0;this.pageIndex=b;this.container=$("<div class='mask'></div>");this.container.attr("id",c+b)},remove:function(){this.container.remove();this.page=this.container=void 0},setPage:function(b){this.page=b},setCSSByStyle:function(b){this.container.css(b)},setCSSByName:function(b){this.container.addClass(b)},onResize:function(b,c){var d=Math.sqrt(Math.pow(b,2)+Math.pow(c,2));this.container.css({width:d,height:d,top:(c-d)/2});this.width=
d},getWidth:function(){return this.width},setZIndex:function(b){this.zIndex=b;this.container.css({"z-index":b})},getZIndex:function(){return this.zIndex}});bdor[39]=function(){return 8}();var imageLoaded=[],bookMouseDown=!1,nBookStatu=0;global.bdor[200]=function(b){return bdor[b]};
var NormalBook=Class({create:function(b,c){this.bookType=BookType.normal_book;this.pageArray=[];this.pageMaskArray=[];this.pageBackArray=[];this.pageBackMaskArray=[];this.flipArray={};this.maskWidth=this.height=this.width=this.pageHeight=this.pageWidth=0;this.currentPageIndex=c;this.flipToPage=this.flippingPage=null;this.flipPoint=Point(0,0);this.thicknessWidth=30;this.taskList=new TaskList;this.taskList.setLargeLength(5);this.flippingTime=1E3*bookConfig.flippingTime;this.adContainer=$("<div id='adContainer'></div>");
this.adContainer.css({position:"absolute","z-index":1});this.createBook(b);global.rand100=Math.floor(100*Math.random())},createBook:function(b){this.flipBook=$("<div class='book' id='flipBook' ></div>");this.setBookPageByIndex(this.currentPageIndex);this.leftThickness=new LeftThickness(this.flipBook,this.thicknessWidth);this.rightThickness=new RightThickness(this.flipBook,this.thicknessWidth);this.leftFlipShotBar=new flipShotBar(!0);this.rightFlipShotBar=new flipShotBar(!1);this.normalBookShadow=
new bookShadow(this.flipBook);this.resetBookShadow(this.currentPageIndex);this.bmt=new initBookMarkTab(this.flipBook);this.showOrHideGrayShadow(this.currentPageIndex);this.init1=50;b.append(this.flipBook);setCurrentIndexTextField(this.currentPageIndex,!0);this.rightThickness.resetPosition();this.leftThickness.resetPosition();setLocationHash(this.currentPageIndex);this.setAttachmentBefore(this.currentPageIndex);this.initEvent();isTouchDevice()||this.initZoomHintTimer(b);1==this.currentPageIndex&&this.initMiniFullscreen()},
showOrHideGrayShadow:function(b){if(!$.browser.msie&&!$.browser.safari&&this.bookType==BookType.normal_book){if(!this.grayShadow){this.grayShadow=$("<div class='grayShadow'></div>");var c=$("<div class='kong edgeShadow' ></div>");this.grayShadow.append(c);this.flipBook.append(this.grayShadow)}rightToLeft&&(b==totalPageCount||1==this.currentPageIndex||this.currentPageIndex==totalPageCount)||!rightToLeft&&(1==b||1==this.currentPageIndex||this.currentPageIndex==totalPageCount)?this.grayShadow.hide():
this.grayShadow.show()}},resetBookShadow:function(b){1==b&&this.currentPageIndex==totalPageCount||b==totalPageCount&&1==this.currentPageIndex?this.normalBookShadow.hide():(this.normalBookShadow.doubleWidth(1!=b&&b!=totalPageCount&&1!=this.currentPageIndex&&this.currentPageIndex!=totalPageCount),this.normalBookShadow.right(!rightToLeft&&(1==b||1==this.currentPageIndex)||rightToLeft&&(b==totalPageCount||this.currentPageIndex==totalPageCount)))},setBookPageByIndex:function(b){isNaN(b)||0>=b||(b=2*parseInt(b/
2),this.unWrapPageExcludeArray([b,b+1,b+2,b+3,b-1,b-2]),this.addPageArray([b,b+1,b+2,b+3,b-1,b-2]),this.loading(),this.currentPage=this.pageArray[b],this.currentPage2=this.pageArray[b+1],this.nextPage=this.pageArray[b+2],this.nextPage2=this.pageArray[b+3],this.previousPage=this.pageArray[b-1],this.previousPage2=this.pageArray[b-2],this.setPageCss(),this.currentPage&&this.currentPage.enterSide(),this.currentPage2&&this.currentPage2.enterSide())},addPageArray:function(b){if(b&&this.pageArray)for(var c=
0;c<b.length;c++)if(!(0>=b[c]||b[c]>originTotalPageCount||(!this.pageArray[b[c]]||this.flipping&&!imageLoaded[b[c]]||this.fillContent(b[c]),this.pageArray[b[c]]))){var d=new NormalSide(b[c],"page");d.addAttachment();d.onResize(this.pageWidth,this.pageHeight);this.pageArray[b[c]]=d;this.flipping&&!imageLoaded[b[c]]||this.fillContent(b[c]);this.flipBook.append(d.getSide())}},fillContent:function(b){this.pageArray[b]&&this.pageArray[b].fillContent();this.pageBackArray&&this.pageBackArray[b]&&this.pageBackArray[b].fillContent()},
fillPage:function(b){if(b)for(var c=this.pageArray.length,d=0;d<c;d++)this.pageArray[d]&&this.pageArray[d].fillPage(b),this.pageBackArray&&this.pageBackArray[d]&&this.pageBackArray[d].fillPage(b)},removePage:function(b){!isNaN(b)&&this.pageArray[b]&&(this.pageArray[b].remove(),this.pageArray[b]=void 0)},addPageMaskArray:function(b){if(b&&this.pageMaskArray){for(var c=0;c<b.length;c++)if(!(0>=b[c]||b[c]>originTotalPageCount||this.pageMaskArray[b[c]])){this.pageArray[b[c]]||this.addPageArray([b[c]]);
var d=this.pageArray[b[c]],f=new NormalMask(b[c],"pageMask");f.onResize(this.pageWidth,this.pageHeight);d.setCSSByStyle({top:(f.width-d.height)/2});d.wrap(f.container);f.container=$("#pageMask"+b[c]);f.setPage(d);this.pageMaskArray[b[c]]=f}this.setPageMaskCss()}},setPageMaskCss:function(){$(".mask").css({right:"50%"})},unWrapPageExcludeArray:function(b){if(b&&this.pageArray)for(var c=this.pageArray.length,d=0;d<c;d++)!this.pageArray[d]||0<=b.indexOf(d)||(this.pageArray[d].remove(),this.pageArray[d]=
void 0)},unWrapPageMaskArray:function(b){if(b&&this.pageMaskArray)for(var c=0;c<b.length;c++)if(!(0>=b[c]||b[c]>originTotalPageCount)){var d=this.pageMaskArray[b[c]];if(this.pageArray[b[c]]){var f=transformCSS({rotate:0,tran:{x:0,y:0}});d&&this.pageArray[b[c]].unwrap();this.pageArray[b[c]].setCSSByStyle({top:0});this.pageArray[b[c]].setCSSByStyle(f)}this.pageMaskArray[b[c]]=void 0}},setPageCss:function(){var b=transformCSS({rotate:0,tran:{x:0,y:0}});this.currentPage&&(this.currentPage.setZIndex(2),
this.currentPage.setLeftOrRight(!0),this.currentPage.setCSSByStyle(b));this.previousPage&&(this.previousPage.setZIndex(1),this.previousPage.setLeftOrRight(!0),this.previousPage.setCSSByStyle(b));this.previousPage2&&(this.previousPage2.setZIndex(0),this.previousPage2.setLeftOrRight(!0),this.previousPage2.setCSSByStyle(b));this.currentPage2&&(this.currentPage2.setZIndex(2),this.currentPage2.setLeftOrRight(!1),this.currentPage2.setCSSByStyle(b));this.nextPage&&(this.nextPage.setZIndex(1),this.nextPage.setLeftOrRight(!1),
this.nextPage.setCSSByStyle(b));this.nextPage2&&(this.nextPage2.setZIndex(0),this.nextPage2.setLeftOrRight(!1),this.nextPage2.setCSSByStyle(b));rightToLeft&&(this.currentPage&&this.currentPage.setLeftOrRight(!1),this.previousPage&&this.previousPage.setLeftOrRight(!1),this.previousPage2&&this.previousPage2.setLeftOrRight(!1),this.currentPage2&&this.currentPage2.setLeftOrRight(!0),this.nextPage&&this.nextPage.setLeftOrRight(!0),this.nextPage2&&this.nextPage2.setLeftOrRight(!0))},resizePage:function(b,
c){for(var d=this.pageArray.length,f=0;f<d;f++)if(this.pageArray[f])this.pageArray[f].onResize(b,c);d=this.pageBackArray.length;for(f=0;f<d;f++)if(this.pageBackArray[f])this.pageBackArray[f].onResize(b,c)},hardFlipByIndex:function(b,c,d){d=this.getDownUpHardPage(b,c,d);this.flipArray[b+"-"+c]||(this.flipArray[b+"-"+c]={});this.flipArray.array||(this.flipArray.array=[]);this.flipArray[b+"-"+c].downMask=d[0];this.flipArray[b+"-"+c].upMask=d[1];this.flipArray[b+"-"+c].currentIndex=b;this.flipArray[b+
"-"+c].nextIndex=c;this.flipArray[b+"-"+c].hardPage=!0;this.flipArray.array.push(b+"-"+c);return this.flipArray[b+"-"+c]},getDownUpHardPage:function(b,c,d){this.addPageArray([b,c]);d?(this.pageArray[b]&&this.pageArray[b].setCSSByName("flip-hard-left-side"),this.pageArray[c]&&this.pageArray[c].setCSSByName("flip-hard-right-side")):(this.pageArray[b]&&this.pageArray[b].setCSSByName("flip-hard-right-side"),this.pageArray[c]&&this.pageArray[c].setCSSByName("flip-hard-left-side"));this.pageArray[c]&&this.pageArray[c].setAttachment(!d);
return[this.pageArray[b],this.pageArray[c]]},getDownUpPage:function(b,c,d){this.addPageMaskArray([b,c]);this.pageMaskArray[b]&&(this.pageMaskArray[b].page.setCSSByName("right-side"),this.pageMaskArray[b].page.setZIndex(2));this.pageMaskArray[c]&&(this.pageMaskArray[c].page.setCSSByName("flip-side"),this.pageMaskArray[c].page.setZIndex(1),this.pageMaskArray[c].page.setAttachment(!d));return[this.pageMaskArray[b],this.pageMaskArray[c]]},beginFlipByIndex:function(b,c,d){if(this.isHardPage(b,c))return this.hardFlipByIndex(b,
c,d);d=this.getDownUpPage(b,c,d);this.flipArray[b+"-"+c]||(this.flipArray[b+"-"+c]={});this.flipArray.array||(this.flipArray.array=[]);this.flipArray[b+"-"+c].downMask=d[0];this.flipArray[b+"-"+c].upMask=d[1];this.flipArray[b+"-"+c].currentIndex=b;this.flipArray[b+"-"+c].nextIndex=c;this.flipArray[b+"-"+c].hardPage=!1;this.flipArray.array.push(b+"-"+c);this.resetBookShadow(c);this.showOrHideGrayShadow(c);return this.flipArray[b+"-"+c]},isHardPage:function(b,c){return $.browser.msie&&11>$.browser.version||
!hardPageEnable||1!=b&&1!=c&&b!=totalPageCount&&c!=totalPageCount?!1:!0},flipToMax:function(b,c,d,f){var g=this.beginFlipByIndex(b,c,f);this.addPageArray([c+1]);this.pageArray[c+1]&&(this.pageArray[c+1].setZIndex(0),this.pageArray[c+1].setLeftOrRight(f),g.nextPage=this.pageArray[c+1]);d&&(this.addPageArray([c+2,c+3]),this.pageArray[c+1]&&this.pageArray[c+1].setZIndex(2),this.pageArray[c+2]&&(this.pageArray[c+2].setZIndex(1),this.pageArray[c+2].setLeftOrRight(f)),this.pageArray[c+3]&&(this.pageArray[c+
3].setZIndex(0),this.pageArray[c+3].setLeftOrRight(f)));for(d=c+4;d<=originTotalPageCount;d++)this.pageArray[d]&&(this.pageArray[d].remove(),this.pageArray[d]=void 0);for(d=b+1;d<c;d++)this.pageArray[d]&&(this.pageArray[d].remove(),this.pageArray[d]=void 0);return g},flipToMin:function(b,c,d,f){var g=this.beginFlipByIndex(b,c,f);this.addPageArray([c-1]);this.pageArray[c-1]&&(this.pageArray[c-1].setZIndex(0),this.pageArray[c-1].setLeftOrRight(f),g.nextPage=this.pageArray[c-1]);d&&(this.addPageArray([c-
2,c-3]),this.pageArray[c-1]&&this.pageArray[c-1].setZIndex(2),this.pageArray[c-2]&&(this.pageArray[c-2].setZIndex(1),this.pageArray[c-2].setLeftOrRight(f)),this.pageArray[c-3]&&(this.pageArray[c-3].setZIndex(0),this.pageArray[c-3].setLeftOrRight(f)));for(d=c-4;0<=d;d--)this.pageArray[d]&&(this.pageArray[d].remove(),this.pageArray[d]=void 0);for(d=b-1;d>c;d--)this.pageArray[d]&&(this.pageArray[d].remove(),this.pageArray[d]=void 0);return g},getFlipTo:function(b){var c=2*parseInt(this.currentPageIndex/
2);b=2*parseInt(b/2);var d=c+1,f="";b>d&&(f="max");b+1<c&&(f="min",b+=1);return{flipTo:f,minIndex:c,maxIndex:d,toIndex:b}},beforeFlipTo:function(b,c){this.setAttachmentBefore(b);var d=this.getFlipTo(b),f=d.minIndex,g=d.maxIndex,h=d.toIndex,k;"max"==d.flipTo&&(k=this.flipToMax(g,h,c,rightToLeft));"min"==d.flipTo&&(k=this.flipToMin(f,h,c,!rightToLeft));this.setPageMaskZIndex(k,d);return k},setAttachmentBefore:function(b){1>=b&&(parseBool(bookConfig.RightToLeft)?this.bmt.rightBox.hide():this.bmt.leftBox.hide());
b>=originTotalPageCount&&(parseBool(bookConfig.RightToLeft)?this.bmt.leftBox.hide():this.bmt.rightBox.hide());3>=b&&(parseBool(bookConfig.RightToLeft)?this.setRightThicknessVisible(!1):this.setLeftThicknessVisible(!1));b>=originTotalPageCount-2&&(parseBool(bookConfig.RightToLeft)?this.setLeftThicknessVisible(!1):this.setRightThicknessVisible(!1))},setPageMaskZIndex:function(b,c){if(b){var d=b.downMask.pageIndex,f=b.upMask.pageIndex,g=originTotalPageCount+5+f,h=originTotalPageCount+5-d;"min"==c.flipTo&&
(g=2*originTotalPageCount+5-f);"min"==c.flipTo&&(h=5+d);b.upMask.setZIndex(g);b.downMask.setZIndex(h)}},flippingTo:function(b){b>this.currentPageIndex?rightToLeft?this.leftThickness.resetPosition(b):this.rightThickness.resetPosition(b):rightToLeft?this.rightThickness.resetPosition(b):this.leftThickness.resetPosition(b);this.currentPageIndex=b;this.currentPageIndex=Math.max(1,this.currentPageIndex);this.currentPageIndex=Math.min(originTotalPageCount,this.currentPageIndex);setCurrentIndexTextField(this.currentPageIndex,
!0);setLocationHash(this.currentPageIndex)},afterFlipToMax:function(b,c){var d=2*parseInt(b/2);this.addPageArray([d+3,d+2,d+1,d,d-1,d-2]);this.pageArray[d]&&(this.pageArray[d].setZIndex(2),this.pageArray[d].setLeftOrRight(c));this.pageArray[d-1]&&(this.pageArray[d-1].setZIndex(1),this.pageArray[d-1].setLeftOrRight(c));this.pageArray[d-2]&&(this.pageArray[d-2].setZIndex(0),this.pageArray[d-2].setLeftOrRight(c));for(d-=3;0<=d;d--)this.pageArray[d]&&(this.pageArray[d].remove(),this.pageArray[d]=void 0);
rightToLeft?this.rightThickness.resetPosition(b):this.leftThickness.resetPosition(b)},afterFlipToMin:function(b,c){var d=2*parseInt(b/2)+1;this.addPageArray([d-3,d-2,d-1,d,d+1,d+2]);this.pageArray[d]&&(this.pageArray[d].setZIndex(2),this.pageArray[d].setLeftOrRight(c));this.pageArray[d+1]&&(this.pageArray[d+1].setZIndex(1),this.pageArray[d+1].setLeftOrRight(c));this.pageArray[d+2]&&(this.pageArray[d+2].setZIndex(0),this.pageArray[d+2].setLeftOrRight(c));for(d+=3;d<=originTotalPageCount;d++)this.pageArray[d]&&
(this.pageArray[d].remove(),this.pageArray[d]=void 0);rightToLeft?this.leftThickness.resetPosition(b):this.rightThickness.resetPosition(b)},afterFlipTo:function(b,c){if(b&&b.downMask&&b.upMask){var d=b.downMask.pageIndex,f=d<c;this.endFlipByIndex(d,b.upMask.pageIndex);this.removeFlipArrayByIndex(b.currentIndex,b.nextIndex);this.checkFlipping();f?this.afterFlipToMax(c,!rightToLeft):this.afterFlipToMin(c,rightToLeft);this.setAttachmentAfter()}},getCurrentPages:function(){var b=2*parseInt(this.currentPageIndex/
2);return[b,b+1]},loading:function(){if(!this.flipping){var b=this.getCurrentPages();if(b&&!(0>=b.length))for(var c=b.length,d=0;d<c;d++)b[d]&&this.pageArray[b[d]]&&this.pageArray[b[d]].loading()}},checkFlipping:function(){this.flipping=!1;for(var b=this.flipArray.array.length,c=0;c<b;c++)if(this.flipArray.array[c]){var d=this.flipArray.array[c];if(this.flipArray[d]){if(this.flipArray[d].flipping){this.flipping=!0;return}this.flipToDirection=""}}this.loading()},setAttachmentAfter:function(){this.addHistoryTexts();
this.stopMedia();this.stopAllSlider();this.addSearchHighlight();this.showOrHideGrayShadow(this.currentPageIndex);this.flipping||this.openShownSlider();this.flipping||this.openShownMedia();this.flipping||(this.resetBookShadow(this.currentPageIndex),this.normalBookShadow.show());3<this.currentPageIndex&&(rightToLeft?this.rightThickness.setVisible(!0):this.leftThickness.setVisible(!0));1<this.currentPageIndex&&(rightToLeft?this.rightFlipShotBar.setVisible(!0):this.leftFlipShotBar.setVisible(!0));this.currentPageIndex<
originTotalPageCount-2&&(rightToLeft?this.leftThickness.setVisible(!0):this.rightThickness.setVisible(!0));this.currentPageIndex<originTotalPageCount&&(rightToLeft?this.leftFlipShotBar.setVisible(!0):this.rightFlipShotBar.setVisible(!0));1<this.currentPageIndex&&(rightToLeft?this.bmt.rightBox.show():this.bmt.leftBox.show());this.currentPageIndex<originTotalPageCount&&(rightToLeft?this.bmt.leftBox.show():this.bmt.rightBox.show());thumbButtonEnable&&thumbnail.clearHighLight();thumbButtonEnable&&thumbnail.setHighLight(this.currentPageIndex);
this.bmt.separated(this.currentPageIndex);resizeBookAfterFlip&&!this.flipping&&window.setTimeout(function(){onStageResize()},30)},removeFlipArrayByIndex:function(b,c){var d=b+"-"+c;this.flipArray[d].nextPage&&this.flipArray[d].nextPage.clearFlipShadow();this.flipArray[d]&&delete this.flipArray[d];this.flipArray.array&&this.flipArray.array.removeElement(d)},flipToPoint:function(b,c,d,f,g,h){if(b&&g&&h)if(!0==b.hardPage)this.flipToHardPoint(b,c,d,g,h);else if(b.downMask&&b.upMask&&b.downMask.page&&
b.upMask.page&&(b.coordinate=h,d=computePoint(c,d,f,g,h))){f=transformCSS({rotate:d.rotate,tran:{x:d.maskTranX,y:d.maskTranY}});var k=transformCSS({rotate:d.rotate,tran:{x:d.maskTranX,y:d.maskTranY}}),l=transformCSS({rotate:-d.rotate,tran:{x:-d.pageTranX,y:0}}),m=transformCSS({rotate:d.rotate,tran:{x:d.pageTranX,y:0}});b.downMask&&b.downMask.setCSSByStyle(f);b.upMask&&b.upMask.setCSSByStyle(k);b.downMask&&b.downMask.page&&b.downMask.page.setCSSByStyle(l);b.upMask&&b.upMask.page&&b.upMask.page.setCSSByStyle(m);
this.setFlipAlpha(b,c,g,h);this.setFlipShadow(b,d)}},setFlipAlpha:function(b,c,d,f){},setFlipShadow:function(b,c){b&&c&&(b.upMask.page&&b.upMask.page.setFlipShadow(c,!0),b.nextPage&&b.nextPage.setFlipShadow(c,!1))},flipToHardPoint:function(b,c,d,f,g){b&&f&&g&&(b.coordinate=g,d=-90+90*Math.abs(g.x/f.x),0>g.x&&(d=90-90*Math.abs(g.x/f.x)),c=transformCSS({perspective:3E3,rotateY:d}),d=transformCSS({perspective:3E3,rotateY:d}),b.downMask&&b.downMask.setCSSByStyle(c),b.upMask&&b.upMask.setCSSByStyle(d),
0>g.x/f.x?(b.upMask.setVisible(!0),b.downMask.setVisible(!1)):(b.upMask.setVisible(!1),b.downMask.setVisible(!0)))},endFlipByIndex:function(b,c,d){isNaN(b)||isNaN(c)||(this.unWrapPageMaskArray([b,c]),d?(this.pageArray[b]&&this.pageArray[b].setLeftOrRight(!0),this.pageArray[c]&&this.pageArray[c].setLeftOrRight(!0)):(this.pageArray[b]&&this.pageArray[b].setLeftOrRight(!1),this.pageArray[c]&&this.pageArray[c].setLeftOrRight(!1)),this.pageArray[b].clearFlipShadow(),this.pageArray[c].clearFlipShadow())},
endFlip:function(){if(this.flipArray&&this.flipArray.array&&0!=this.flipArray.array.length)for(var b=this.flipArray.array.length,c=0;c<b;c++)if(this.flipArray.array[c]){var d=this.flipArray[this.flipArray.array[c]];d&&(this.endFlipByIndex(d.downMask.pageIndex,d.upMask.pageIndex),this.removeFlipArrayByIndex(d.currentIndex,d.nextIndex))}},onResize:function(b,c){this.width=2*b;this.height=c;this.pageWidth=b;this.pageHeight=c;this.maskWidth=Math.sqrt(b*b+c*c);this.flipBook.css({width:this.width+"px",
height:this.height+"px"});this.endFlip();this.resizePage(this.pageWidth,this.pageHeight);this.setBookPageByIndex(this.currentPageIndex);this.leftThickness.onResize();this.rightThickness.onResize();this.leftFlipShotBar.onResize(50,c);this.rightFlipShotBar.onResize(50,c);this.resetBookShadow(this.currentPageIndex);this.bmt.resize(c,60);if(this.miniFullScreen)this.miniFullScreen.onResize();var d=this.flipBook.css("left"),f=this.flipBook.css("top");this.adContainer.css({left:d,top:f,width:b+"px",height:c+
"px"});this.adInstance&&this.adInstance.resize()},initZoomHintTimer:function(b){var c=this;this.mouseInBook=new Point(-1,-1);this.oldMouseInBook=new Point(-1,-1);this.zoomHint=null;this.trackMousePoint=function(b){b=isTouch?b.originalEvent.touches:[b];var f=b[0].pageY;c.mouseInBook.x=b[0].pageX;c.mouseInBook.y=f};bookContainer.bind(_event._move,this.trackMousePoint);this.zoomHintTimer=window.setInterval(function(){if(bookType!=BookType.normal_book)c.clearZoomHintTimer();else if(null==c.zoomHint)if(-1==
c.oldMouseInBook.x)c.oldMouseInBook.x=c.mouseInBook.x,c.oldMouseInBook.y=c.mouseInBook.y;else if(c.oldMouseInBook.x==c.mouseInBook.x&&c.oldMouseInBook.y==c.mouseInBook.y){var d=globalToBook(!0,c.mouseInBook.x,c.mouseInBook.y);0>d.x||d.x>c.width||0>d.y||d.y>c.height||(c.zoomHint=new divHint("Double click to zoom in.",c.mouseInBook.x+15,c.mouseInBook.y,b),c.zoomHint.show(),c.hideCount=0)}else c.oldMouseInBook.x=c.mouseInBook.x,c.oldMouseInBook.y=c.mouseInBook.y;else 2==++c.hideCount&&(bookContainer.unbind(_event._move,
c.trackMousePoint),c.zoomHint.destroy(),c.zoomHint=null,window.clearInterval(c.zoomHintTimer))},1500)},clearZoomHintTimer:function(){},insertStaticAd:function(){var b=this.flipBook.css("left"),b=parseInt(b.replace("px","")),c=this.flipBook.css("top"),d=this.flipBook.css("width"),d=parseInt(d.replace("px",""));rightToLeft&&(b+=d/2);this.adContainer.css({left:b+"px",top:c});this.adInstance=new HTML5AdSlider(this.adContainer,{paddingLeft:30,paddingTop:30,paddingRight:30,paddingBottom:30,loop:!1,timeout:2E3,
effectDuration:1E3,data:staticAd.data});bookContainer.append(this.adContainer)},getCurrentPageIndex:function(){return this.currentPageIndex},getPageWidth:function(b){if(void 0==b)return this.pageWidth;this.pageWidth=b},getPageHeight:function(b){if(void 0==b)return this.pageHeight;this.pageHeight=b},getWidth:function(){return this.width},getHeight:function(){return this.height},getScale:function(){return 1},getLeft:function(){return this.flipBook.offset().left},getTop:function(){return this.flipBook.offset().top},
getCssLeft:function(){return parseInt(this.flipBook.css("left"))},getCssTop:function(){return parseInt(this.flipBook.css("top"))},setCSS:function(b){this.flipBook.css(b)},setPosition:function(b,c,d){void 0==d&&(d=["left","top"]);this.flipBook.css(d[0],b+"px");this.flipBook.css(d[1],c+"px")},endReset:function(){},resetFrameNum:function(b,c){var d=(windowWidth-bookConfig.leftMargin-bookConfig.rightMargin-this.width)/2+bookConfig.leftMargin,f=d-this.width/4,g=d+this.width/4,h=this.getCssLeft();1==c&&
(d=f);c==totalPageCount&&(d=g);return 10>Math.abs(d-h)?b:10},movetoCenter:function(b,c){if(!1!=parseBool(bookConfig.retainBookCenter)){var d=(windowWidth-bookConfig.leftMargin-bookConfig.rightMargin-this.width)/2+parseInt(bookConfig.leftMargin),f=d-this.width/4,g=d+this.width/4;rightToLeft&&(f=d+this.width/4,g=d-this.width/4);var h=this.getCssLeft(),k=d;1==c&&(k=f);c==totalPageCount&&(k=g);10>Math.abs(k-h)||(d=transformCSS({tran:{x:k-h,y:0}}),f=function(){var b=transformCSS({tran:{x:0,y:0}});this.flipBook.css("left",
k);this.flipBook.css(b)}.bind(this),animateOnce(this.flipBook,d,b/50,f,"%stransform"))}},initMiniFullscreen:function(){if(!0!=bookConfig.hideMiniFullscreen&&!(isPhone()||isPad()||isIE()||miniStyle.isMini()||fullScreenApi.supportsFullScreen&&fullScreenApi.isFullScreen()||this.miniFullScreen)){this.miniFullscreenEnter=!1;this.miniFullScreen=$("<div class='miniFullscreen' id='miniFullscreen'></div>");this.miniFullScreen.html("Click to view in fullscreen.");var b=this.flipBook.offset().top;this.miniFullScreen.css({top:b+
this.pageHeight-50+"px"});bookContainer.append(this.miniFullScreen);this.miniFullScreen.onResize=function(){var b=this.flipBook.offset().top;this.miniFullScreen.css({top:b+this.pageHeight-50+"px"})}.bind(this);this.miniFullScreen.bind(_event._end,function(){bookType==BookType.catalog_book?this.guidBar.fullscreenBtn.trigger(_event._end):toolBar.btnFullscreen.trigger(_event._end);this.miniFullScreen.remove();this.miniFullScreen=void 0}.bind(this));this.miniFullScreen.bind(_event._enter,function(){this.miniFullscreenEnter=
!0}.bind(this));this.miniFullScreen.bind(_event._leave,function(){this.miniFullscreenEnter=!1;this.miniFullscreenTimeout&&window.clearTimeout(this.miniFullscreenTimeout);this.miniFullscreenTimeout=window.setTimeout(function(){this.removeFullscreenBtn(!0)}.bind(this),3E3)}.bind(this));this.miniFullscreenEnter||(this.miniFullscreenTimeout&&window.clearTimeout(this.miniFullscreenTimeout),this.miniFullscreenTimeout=window.setTimeout(function(){this.removeFullscreenBtn(!0)}.bind(this),3E3))}},removeFullscreenBtn:function(b){if(!0!=
bookConfig.hideMiniFullscreen&&!(isPhone()||isPad()||isIE()||miniStyle.isMini())){var c={alpha:b?0.5:0},d=this;$(c).animate({alpha:b?0:0.5},{duration:300,easing:"easeOutSine",step:function(){d.miniFullScreen&&!0!=d.miniFullscreenEnter&&d.miniFullScreen.css({opacity:c.alpha})},complete:function(){d.miniFullScreen&&!0!=d.miniFullscreenEnter&&(d.miniFullScreen.remove(),d.miniFullScreen=void 0)}})}},gotoPage:function(b){if(0>=b||b>originTotalPageCount)_tipsBox.setCaption(1>b?"This is the first page":
"This is the last page"),_tipsBox.showTipsBox();else{var c=this.getFromStartPointByIndex(b);if(c&&!this.hasAlicePage()){var d=this.beforeFlipTo(b,!0);if(d){this.isDragMoveToFlip(d);d.dragMoveToFlip||this.flipToPoint(d,this.pageWidth,this.pageHeight,this.maskWidth,c[0],c[1]);this.flippingTo(b);var f=this.flipToDirection;(function(){playFlipSound();this.flipIntervalTmp(d,b,f)}).delay(this,50);1==b?this.initMiniFullscreen():this.miniFullScreen&&(this.miniFullScreen.remove(),this.miniFullScreen=void 0)}}}},
hasAlicePage:function(){if(!this.flipArray||!this.flipArray.array||0==this.flipArray.array.length)return!1;for(var b=0;b<this.flipArray.array.length;b++)if(this.flipArray.array[b]){var c=this.flipArray.array[b];if(this.flipArray[c]&&this.flipArray[c].Alice)return!0}return!1},getFromStartPointByIndex:function(b){var c=2*parseInt(this.currentPageIndex/2),d=c+1;if(b!=d&&b!=c){var f={x:0,y:0},g={x:0,y:0},h=!1;if(b>d&&!rightToLeft||b<c&&rightToLeft)f={x:this.pageWidth,y:this.pageHeight},h=!0;if(b<c&&!rightToLeft||
b>d&&rightToLeft)f={x:-this.pageWidth,y:this.pageHeight},h=!1;if(!this.flipping||!h||"right"!=this.flipToDirection)if(!this.flipping||h||"left"!=this.flipToDirection)return g.x=f.x,g.y=f.y,this.flipToDirection=h?"left":"right",[f,g]}},isDragMoveToFlip:function(b){b.dragMoveToFlip=!1;b.coordinate&&b.startPoint&&b.coordinate.x!=b.startPoint.x&&(b.dragMoveToFlip=!0)},setFlipOringinPoint:function(b,c){b.dragMoveToFlip||"left"!=c||(b.fromPoint={x:this.pageWidth,y:this.pageHeight});b.dragMoveToFlip||"right"!=
c||(b.fromPoint={x:-this.pageWidth,y:this.pageHeight});b.toPoint={x:-b.fromPoint.x,y:b.fromPoint.y};b.startPoint||(b.startPoint={x:0,y:0});b.startPoint.x=b.fromPoint.x;b.startPoint.y=b.fromPoint.y},flipIntervalTmp:function(b,c,d){if(b){this.flipping=!0;b.flipping=!0;this.setFlipOringinPoint(b,d);b.coordinate||(b.coordinate=b.startPoint);var f=b.coordinate.x,g=b.coordinate.y,h,k=this.flippingTime;d=function(){h=function(b,c){l(b,c,"Sine")}.runInAnimate(this,k)}.bind(this);var l=function(d,k,l){if(!b)return!1;
1!=d&&d!=k||Log.print("%d / %d",d,k);var p=$.easing["easeInOut"+l],s=$.easing["easeOut"+l];l=s(null,d,f,b.toPoint.x-f,k);s=s(null,d,g,b.toPoint.y-g,k);b.dragMoveToFlip||(l=p(null,d,f,b.toPoint.x-f,k));b.dragMoveToFlip||(s=this.pageHeight-0.1*Math.sqrt(this.pageWidth*this.pageWidth-l*l));d<k?this.flipToPoint(b,this.pageWidth,this.pageHeight,this.maskWidth,b.fromPoint,{x:l,y:s}):(this.flipToPoint(b,this.pageWidth,this.pageHeight,this.maskWidth,b.fromPoint,b.toPoint),this.afterFlipTo(b,c),h.stop())}.bind(this);
d();this.movetoCenter(20,c)}},setShowOrHide:function(){},reShowOrHide:function(){},resetPageCorner:function(){},stopTimer:function(){window.clearInterval(this.intervalID)},openShownSlider:function(){var b=getShownPage();if(void 0!=b&&null!=b)for(var c=0;c<b.length;c++){var d=b[c];this.pageArray[d]&&this.pageArray[d].playSlider()}},stopAllSlider:function(){for(var b=this.pageArray.length,c=0;c<b;c++)this.pageArray[c]&&this.pageArray[c].resetSlider()},openShownMedia:function(){var b=getShownPage();
if(void 0!=b&&null!=b)for(var c=0;c<b.length;c++){var d=b[c];this.pageArray[d]&&this.pageArray[d].enterSide()}},stopMedia:function(){for(var b=this.pageArray.length,c=0;c<b;c++)this.pageArray[c]&&this.pageArray[c].leaveSide()},hide:function(){Log.debug("normal book hide.");this.setCSS({display:"none"});this.stopMedia();this.stopAllSlider()},show:function(){Log.debug("normal book show.");this.setCSS({display:"block"});this.openShownSlider();this.openShownMedia();this.addHistoryTexts();this.addSearchHighlight();
this.bmt.refresh()},addHistoryTexts:function(){var b=[1];try{b=getShownPage()}catch(c){b=[1]}for(var d=this.pageArray.length,f=0;f<d;f++)this.pageArray[f]&&this.pageArray[f].addHistoryTexts(b)},addSearchHighlight:function(){var b=this.currentPageIndex,b=0==b%2?b+1:b-1;this.pageArray[b]&&this.pageArray[b].highlightSearch();this.pageArray[b+1]&&this.pageArray[b+1].highlightSearch();this.pageArray[b-1]&&this.pageArray[b-1].highlightSearch();this.pageArray[b+2]&&this.pageArray[b+2].highlightSearch()},
clearSearchHighlight:function(){for(var b=this.pageArray.length,c=0;c<b;c++)this.pageArray[c]&&this.pageArray[c].clearHighlight()},setLeftThicknessVisible:function(b){this.leftThickness.setVisible(b);this.leftFlipShotBar.setVisible(b)},setRightThicknessVisible:function(b){this.rightThickness.setVisible(b);this.rightFlipShotBar.setVisible(b)},edgeX:function(){this.MiddleX=0},aroundCorner:function(b){this.edgeX();if(!(Math.abs(b.x)>this.pageWidth||b.y>this.height||0>b.y||Math.abs(b.x)<0.8*this.pageWidth||
b.y>0.2*this.height&&b.y<0.8*this.height)){var c=Math.sqrt(Math.pow(0.2*this.height,2)-Math.pow((this.pageWidth-Math.abs(b.x))*this.height/this.pageWidth,2));if(b.y<c&&b.x<this.MiddleX)return"tl";if(b.y<c&&b.x>this.MiddleX)return"tr";if(b.y>this.height-c&&b.x<this.MiddleX)return"bl";if(b.y>this.height-c&&b.x>this.MiddleX)return"br"}},setFlipInterval:function(){this.flipInterval=function(){if(this.flipArray&&this.flipArray.array&&0!=this.flipArray.array.length)for(var b=0;b<this.flipArray.array.length;b++)if(this.flipArray.array[b]){var c=
this.flipArray.array[b];if(!this.flipArray[c])this.flipArray.array.removeElement(c),b--;else if(this.flipArray[c].fromPoint&&this.flipArray[c].startPoint&&this.flipArray[c].toPoint&&this.flipArray[c].downMask&&this.flipArray[c].upMask&&!this.flipArray[c].flipping){this.flipArray[c].Alice=!0;this.flipArray[c].coordinate||(this.flipArray[c].coordinate=this.flipArray[c].startPoint);var d=0.42*(this.flipArray[c].toPoint.x-this.flipArray[c].coordinate.x)+this.flipArray[c].coordinate.x,f=0.52*(this.flipArray[c].toPoint.y-
this.flipArray[c].coordinate.y)+this.flipArray[c].coordinate.y;this.flipToPoint(this.flipArray[c],this.pageWidth,this.pageHeight,this.maskWidth,this.flipArray[c].fromPoint,{x:d,y:f});this.flipArray[c].loosen&&1>Math.abs(d-this.flipArray[c].toPoint.x)&&1>Math.abs(f-this.flipArray[c].toPoint.y)&&(this.flipArray[c].Alice=!1,d=this.flipArray[c].toPoint.x,f=this.flipArray[c].toPoint.y,this.flipToPoint(this.flipArray[c],this.pageWidth,this.pageHeight,this.maskWidth,this.flipArray[c].fromPoint,{x:d,y:f}),
this.endFlipByIndex(this.flipArray[c].downMask.pageIndex,this.flipArray[c].upMask.pageIndex,0>this.flipArray[c].toPoint.x),this.removeFlipArrayByIndex(this.flipArray[c].currentIndex,this.flipArray[c].nextIndex),this.resetBookShadow(this.currentPageIndex),this.showOrHideGrayShadow(this.currentPageIndex),b--)}}}.interval(this,20)},initEvent:function(){this.eventBoxBelowIE10()},hammerEventModular:function(){var b=new Hammer.Manager(this.flipBook[0]);b.add(new Hammer.Pan);b.add((new Hammer.Swipe).recognizeWith(b.get("pan")));
b.add(new Hammer.Press);b.add(new Hammer.Rotate);b.add(new Hammer.Pinch);b.add(new Hammer.Tap({event:"doubletap",taps:2}));b.add(new Hammer.Tap);b.on("panmove",this.onPan);b.on("rotatestart rotatemove",this.onRotate);b.on("pinchstart pinchmove",this.onPinch);b.on("press",this.onPress);b.on("swipe",this.onSwipe);b.on("tap",this.onTap);b.on("doubletap",this.onDoubleTap);this.flipBook.bind("mouseover mousemove",this.onOver)},onOver:function(b){console.log("mouseover:"+b.pageX+","+b.pageY);bookType==
this.bookType&&(coordinate=this.realPoint(evt)[0],fingleDown&&this.flipArray[flipPage]&&!this.flipArray[flipPage].flipping&&(this.flipArray[flipPage].toPoint=coordinate),this.flipping&&"right"==this.flipToDirection&&coordinate.x>this.MiddleX||this.flipping&&"left"==this.flipToDirection&&coordinate.x<this.MiddleX||((direction=this.aroundCorner(coordinate))&&!this.flipInterval&&this.setFlipInterval(),direction&&!fingleDown?(flipMove(change!=direction),change=direction):fingleDown&&this.flipArray[flipPage]?
this.flipArray[flipPage].toPoint=coordinate:flipEnd()))},onPan:function(b){console.log("onPan:"+b.deltaX+","+b.deltaY)},onPress:function(b){console.log("onPress")},onRotate:function(b){},onPinch:function(b){},onSwipe:function(b){console.log("onSwipe")},onTap:function(b){console.log("onTap")},onDoubleTap:function(b){console.log("onDoubleTap")},eventBoxBelowIE10:function(){var b=!1,c=!1,d=!1,f,g,h,k,l,m,n;this.lastMousePoint=null;this.moveDirectionType={MOVE_LEFT:-1,MOVE_RIGHT:1,MOVE_NONE:0};this.mouseMoveDirection=
this.moveDirectionType.MOVE_NONE;this.flipping=!1;var q;this.flipBook.bind(_event._down,function(h){if(bookType==this.bookType&&!(isTouch&&this.flipArray&&this.flipArray.array&&0<this.flipArray.array.length))if(2==this.realPoint(h).length)m=this.realPoint(h)[0],n=this.realPoint(h)[1],d=!0;else{var k=this.realPoint(h)[0],l=this.aroundCorner(k),r=l||isTouch?0:300;this.lastMousePoint=k;l&&-1<l.indexOf("l")&&(this.mouseMoveDirection=this.moveDirectionType.MOVE_RIGHT);l&&-1<l.indexOf("r")&&(this.mouseMoveDirection=
this.moveDirectionType.MOVE_LEFT);c=!0;void 0!=q&&q.stop();q=function(d,k){d<k||!c||(this.lastMousePoint=m=this.realPoint(h)[0],this.flipping&&"right"==this.flipToDirection&&m.x>this.MiddleX||this.flipping&&"left"==this.flipToDirection&&m.x<this.MiddleX||(g=this.aroundCorner(m),b=!0,this.flipInterval||this.setFlipInterval(),f=g,p(!g),q=void 0))}.runInAnimate(this,r);h.preventDefault()}}.bind(this));this.flipBook.bind(_event._move,function(c){bookType==this.bookType&&(d?(tmpCoordinate=this.realPoint(c)[0],
tmpCoordinate1=this.realPoint(c)[1],c=Math.sqrt(Math.pow(m.x-n.x,2)+Math.pow(m.y-n.y,2)),15<Math.sqrt(Math.pow(tmpCoordinate.x-tmpCoordinate1.x,2)+Math.pow(tmpCoordinate.y-tmpCoordinate1.y,2))-c&&BookInfo.getBook().zoomToPage(this.currentPageIndex)):(m=this.realPoint(c)[0],b&&(this.lastMousePoint&&(this.mouseMoveDirection=0<=m.x-this.lastMousePoint.x?this.moveDirectionType.MOVE_RIGHT:this.moveDirectionType.MOVE_LEFT),this.lastMousePoint=m),b&&this.flipArray[h]&&!this.flipArray[h].flipping&&(this.flipArray[h].toPoint=
m),this.flipping&&"right"==this.flipToDirection&&m.x>this.MiddleX||this.flipping&&"left"==this.flipToDirection&&m.x<this.MiddleX||((g=this.aroundCorner(m))&&!this.flipInterval&&this.setFlipInterval(),g&&!b?(p(f!=g),f=g):b&&this.flipArray[h]?this.flipArray[h].toPoint=m:s(),c.preventDefault())))}.bind(this));this.flipBook.onDoubleClick(function(f){bookType==this.bookType&&(c=d=b=!1,BookInfo.getBook().zoomToPage(this.currentPageIndex))}.bind(this));$(window).bind(_event._end,function(f){bookType==this.bookType&&
(c=d=b=!1,s(!0))}.bind(this));$(window).bind("touchcancel",function(){$(window).trigger(_event._end)});var p=function(b){if(fromStartPoint=this.getFromStartPointByCoordinate(m,g))m.x<this.MiddleX&&(k=this.realIndex(!1)[0],l=this.realIndex(!1)[1]),m.x>this.MiddleX&&(k=this.realIndex(!0)[0],l=this.realIndex(!0)[1]),h=k+"-"+l,0>=k||k>originTotalPageCount||0>=l||l>originTotalPageCount||(this.flipArray[h]||(this.flipArray[h]={}),this.flipArray[h].loosen=!1,this.flipArray[h].fromPoint=fromStartPoint[0],
this.flipArray[h].startPoint=fromStartPoint[1],b&&(this.flipArray[h].coordinate=fromStartPoint[1]),this.flipArray[h].toPoint=m,this.flipArray[h].downMask||this.flipArray[h].upMask||(this.beforeFlipTo(l),this.flipToPoint(this.flipArray[h],this.pageWidth,this.pageHeight,this.maskWidth,this.flipArray[h].fromPoint,this.flipArray[h].startPoint)))}.bind(this),s=function(b){if(this.flipArray[h]&&!this.flipArray[h].flipping){if(this.flipArray[h].fromPoint&&this.flipArray[h].toPoint){var c=this.mouseMoveDirection==
this.moveDirectionType.MOVE_LEFT&&0<this.flipArray[h].startPoint.x||this.mouseMoveDirection==this.moveDirectionType.MOVE_RIGHT&&0>this.flipArray[h].startPoint.x,c=this.flipArray[h].toPoint.x<this.MiddleX&&0<this.flipArray[h].startPoint.x||this.flipArray[h].toPoint.x>this.MiddleX&&0>this.flipArray[h].startPoint.x||c;this.flipArray[h].toPoint.y=this.flipArray[h].startPoint.y;this.flipArray[h].toPoint.x=this.flipArray[h].startPoint.x;c&&(this.mouseMoveDirection=this.moveDirectionType.MOVE_NONE,this.flipArray[h].toPoint.x=
-this.flipArray[h].startPoint.x,b&&(this.flipping=!0,this.flipArray[h].Alice=!1,this.flipArray[h].flipping=!0,this.flipArray[h].dragMoveToFlip=!0,this.flipToDirection=0>this.flipArray[h].startPoint.x?"right":"left",b=this.getNextPageIndex(),gotoPageFun(b)))}this.flipArray[h].loosen=!0}}.bind(this),r=function(c,d){if(!b){var f;f=30*windowWidth/1600;Math.abs(c)<=f||(this.flipArray[h]&&(this.flipArray[h].Alice=!1,this.flipArray[h].flipping=!0,this.flipArray[h].dragMoveToFlip=!0),c<-f?rightToLeft?previousPageFun():
nextPageFun():c>f&&(rightToLeft?nextPageFun():previousPageFun()))}}.bind(this);this.flipBook.speed(r)},getFromStartPointByCoordinate:function(b,c){if(b){var d={x:0,y:0},f={x:0,y:0},g=b.y>this.pageHeight/2?b.y-5:b.y+5;0>b.x&&(d={x:-this.pageWidth,y:g});0<b.x&&(d={x:this.pageWidth,y:g});"tl"==c&&(d={x:-this.pageWidth,y:0});"bl"==c&&(d={x:-this.pageWidth,y:this.pageHeight});"tr"==c&&(d={x:this.pageWidth,y:0});"br"==c&&(d={x:this.pageWidth,y:this.pageHeight});f.x=d.x;f.y=d.y;return[d,f]}},realIndex:function(b){var c=
2*parseInt(this.currentPageIndex/2);if(b&&!rightToLeft||!b&&rightToLeft)return[c+1,c+2];if(!b&&!rightToLeft||b&&rightToLeft)return[c,c-1]},getNextPageIndex:function(){var b=this.currentPageIndex+2;if("right"==this.flipToDirection&&!rightToLeft||"left"==this.flipToDirection&&rightToLeft)b=this.currentPageIndex-2;b=Math.max(1,b);return b=Math.min(originTotalPageCount,b)},realBookPosition:function(){var b=this.flipBook.offset().left,c=this.flipBook.offset().top;return[b,c]},realPoint:function(b){b=isTouch?
b.originalEvent.changedTouches:[b];if(!(3<=b.length)){var c=this.realBookPosition()[0],d=this.realBookPosition()[1],f=b[0].pageX,g=b[0].pageY,f=f-c-this.pageWidth,g=g-d;if(!b[1])return[{x:f,y:g}];var h=b[1].pageX;b=b[1].pageY;h=h-c-this.pageWidth;return[{x:f,y:g},{x:h,y:b-d}]}},zoomToPage:function(b){b>originTotalPageCount||0>=b||this.flipArray.array&&0<this.flipArray.array.length||(BookInfo.getBook().miniFullScreen&&(BookInfo.getBook().miniFullScreen.remove(),BookInfo.getBook().addminiFullscreen=
!1),this.stopMedia(),zoomBook.changePageMode(!0),zoomBook.currentIndex=b,zoomBook.showPage.fillContent(zoomBook.currentIndex),bookType=2,changeShowBook(2),toolBar.changeZoomIcon.delay(toolBar,200,[!1]),function(){thumbButtonEnable&&thumbnail.clearHighLight();thumbButtonEnable&&thumbnail.setHighLight(zoomBook.currentIndex)}.delay(300),this.clearZoomHintTimer())}}),SingleBook=Class({create:function(b,c){this.bookType=BookType.single_book;this.pageArray=[];this.pageMaskArray=[];this.pageBackArray=[];
this.pageBackMaskArray=[];this.flipArray={};this.maskWidth=this.height=this.width=this.pageHeight=this.pageWidth=0;this.currentPageIndex=c;this.flipToPage=this.flippingPage=null;this.flipPoint=Point(0,0);this.thicknessWidth=30;this.taskList=new TaskList;this.taskList.setLargeLength(5);this.flippingTime=1E3*bookConfig.flippingTime;this.adContainer=$("<div id='adContainer'></div>");this.adContainer.css({position:"absolute","z-index":1});this.createBook(b);global.rand100=Math.floor(100*Math.random());
this.initMiniFullscreen()},createBook:function(b){this.flipBook=$("<div class='book' id='singleFlipBook' ></div>");this.setBookPageByIndex(this.currentPageIndex);this.thickness=new RightThickness(this.flipBook,this.thicknessWidth);this.normalBookShadow=new bookShadow(this.flipBook);this.resetBookShadow();this.bmt=new initBookMarkTab(this.flipBook);this.init1=50;b.append(this.flipBook);setCurrentIndexTextField(this.currentPageIndex,!1);this.thickness.resetPosition();setLocationHash(this.currentPageIndex);
this.currentPageIndex>=originTotalPageCount-1&&this.thickness.setVisible(!1);this.initEvent();isTouchDevice()||this.initZoomHintTimer(b)},setBookPageByIndex:function(b){isNaN(b)||0>=b||(this.unWrapPageExcludeArray([b-1,b,b+1]),this.addPageArray([b-1,b,b+1]),this.addPageBackArray([b-1,b]),this.loading(),this.currentPage=this.pageArray[b],this.currentPage2=this.pageBackArray[b],this.nextPage=this.pageArray[b+1],this.previousPage=this.pageArray[b-1],this.previousPage2=this.pageBackArray[b-1],this.setPageCss())},
addPageBackMaskArray:function(b){if(b&&this.pageBackMaskArray){for(var c=0;c<b.length;c++)if(!(0>=b[c]||b[c]>originTotalPageCount||this.pageBackMaskArray[b[c]])){this.pageBackArray[b[c]]||this.addPageBackArray([b[c]]);var d=this.pageBackArray[b[c]],f=new NormalMask(b[c],"pageBackMask");f.onResize(this.pageWidth,this.pageHeight);d.setCSSByStyle({top:(f.width-d.height)/2});d.wrap(f.container);f.container=$("#pageBackMask"+b[c]);f.setPage(d);this.pageBackMaskArray[b[c]]=f}this.setPageMaskCss()}},setPageMaskCss:function(){$(".mask").css({right:"100%"});
rightToLeft&&$(".mask").css({right:"0px"})},addPageBackArray:function(b){if(b&&this.pageBackArray)for(var c=0;c<b.length;c++)if(!(0>=b[c]||b[c]>originTotalPageCount||(!this.pageBackArray[b[c]]||this.flipping&&!imageLoaded[b[c]]||this.fillContent(b[c]),this.pageBackArray[b[c]]))){var d=new NormalSide(b[c],"pageBack");d.onResize(this.pageWidth,this.pageHeight);d.mirrorSide();this.pageBackArray[b[c]]=d;this.flipping&&!imageLoaded[b[c]]||this.fillContent(b[c]);this.flipBook.append(d.side)}},setPageCss:function(){var b=
transformCSS({rotate:0,tran:{x:0,y:0}});this.currentPage&&(this.currentPage.setZIndex(4),this.currentPage.setLeftOrRight(!1),this.currentPage.setCSSByStyle(b));this.previousPage&&(this.previousPage.setZIndex(1),this.previousPage.setLeftOrRight(!1),this.previousPage.setCSSByStyle(b));this.previousPage2&&(this.previousPage2.setZIndex(0),this.previousPage2.setLeftOrRight(!1),this.previousPage2.setCSSByStyle(b));this.currentPage2&&(this.currentPage2.setZIndex(3),this.currentPage2.setLeftOrRight(!1),this.currentPage2.setCSSByStyle(b));
this.nextPage&&(this.nextPage.setZIndex(2),this.nextPage.setLeftOrRight(!1),this.nextPage.setCSSByStyle(b));rightToLeft&&(this.currentPage&&this.currentPage.setLeftOrRight(!0),this.previousPage&&this.previousPage.setLeftOrRight(!0),this.previousPage2&&this.previousPage2.setLeftOrRight(!0),this.currentPage2&&this.currentPage2.setLeftOrRight(!0),this.nextPage&&this.nextPage.setLeftOrRight(!0))},realBookPosition:function(){var b=this.flipBook.offset().left-(rightToLeft?0:this.pageWidth),c=this.flipBook.offset().top;
return[b,c]},edgeX:function(){this.MiddleX=this.pageWidth/2;rightToLeft&&(this.MiddleX=-this.pageWidth/2)},realIndex:function(b){var c=this.currentPageIndex;if(b&&!rightToLeft||!b&&rightToLeft)return[c,c+1];if(!b&&!rightToLeft||b&&rightToLeft)return[c,c-1]},getCurrentPages:function(){return[this.currentPageIndex]},getNextPageIndex:function(){var b=this.currentPageIndex+1;if("right"==this.flipToDirection&&!rightToLeft||"left"==this.flipToDirection&&rightToLeft)b=this.currentPageIndex-1;b=Math.max(1,
b);return b=Math.min(originTotalPageCount,b)},getFromStartPointByCoordinate:function(b,c){if(b){var d={x:0,y:0},f={x:0,y:0},g=b.y>this.pageHeight/2?b.y-5:b.y+5;b.x<this.MiddleX&&(d.y=g,f.x=-this.pageWidth);b.x>this.MiddleX&&(d.y=g,f.x=this.pageWidth);"tl"==c&&(d.y=0);"bl"==c&&(d.y=this.pageHeight);"tr"==c&&(d.y=0);"br"==c&&(d.y=this.pageHeight);d.x=rightToLeft?-this.pageWidth:this.pageWidth;f.y=d.y;return[d,f]}},getFromStartPointByIndex:function(b){var c=this.currentPageIndex;if(b!=c&&b!=c){var d=
{x:0,y:0},f={x:0,y:0},g=!1,d={x:this.pageWidth,y:this.pageHeight};rightToLeft&&(d={x:-this.pageWidth,y:this.pageHeight});if(b>c&&!rightToLeft||b<c&&rightToLeft)g=!0;if(b<c&&!rightToLeft||b>c&&rightToLeft)g=!1;b>c&&(f={x:d.x,y:this.pageHeight});b<c&&(f={x:-d.x,y:this.pageHeight});if(!this.flipping||!g||"right"!=this.flipToDirection)if(!this.flipping||g||"left"!=this.flipToDirection)return this.flipToDirection=g?"left":"right",[d,f]}},setFlipOringinPoint:function(b){b.dragMoveToFlip||rightToLeft||(b.fromPoint=
{x:this.pageWidth,y:this.pageHeight});!b.dragMoveToFlip&&rightToLeft&&(b.fromPoint={x:-this.pageWidth,y:this.pageHeight});b.toPoint="left"==this.flipToDirection?{x:-this.pageWidth,y:b.fromPoint.y}:{x:this.pageWidth,y:b.fromPoint.y};b.startPoint||(b.startPoint={x:0,y:0});b.startPoint.x=-b.toPoint.x;b.startPoint.y=b.toPoint.y},getDownUpPage:function(b,c){var d=b;b>c&&(d=c);this.addPageMaskArray([d]);this.addPageBackMaskArray([d]);this.pageMaskArray[d]&&this.pageMaskArray[d].page.setCSSByName("right-side");
this.pageBackMaskArray[d]&&this.pageBackMaskArray[d].page.setCSSByName("flip-side");return[this.pageMaskArray[d],this.pageBackMaskArray[d]]},getDownUpHardPage:function(b,c){var d=b;b>c&&(d=c);this.addPageArray([d]);this.addPageBackArray([d]);rightToLeft?(this.pageArray[d]&&this.pageArray[d].setCSSByName("flip-hard-left-side"),this.pageBackArray[d]&&this.pageBackArray[d].setCSSByName("flip-hard-right-side")):(this.pageArray[d]&&this.pageArray[d].setCSSByName("flip-hard-right-side"),this.pageBackArray[d]&&
this.pageBackArray[d].setCSSByName("flip-hard-left-side"));return[this.pageArray[d],this.pageBackArray[d]]},setFlipAlpha:function(b,c,d,f){if(b&&d&&f){var g=1;0>=f.x/d.x&&(g=1-Math.abs(f.x/c));c={opacity:g};b.downMask&&b.downMask.setCSSByStyle(c);b.upMask&&b.upMask.setCSSByStyle(c)}},flipToHardPoint:function(b,c,d,f,g){b&&f&&g&&(b.coordinate=g,d=-90+90*Math.abs(g.x/f.x),0>g.x&&(d=90-90*Math.abs(g.x/f.x)),c=transformCSS({perspective:3E3,rotateY:d}),d=transformCSS({perspective:3E3,rotateY:d}),b.downMask&&
b.downMask.setCSSByStyle(c),b.upMask&&b.upMask.setCSSByStyle(d),0>g.x/f.x?(b.upMask.setVisible(!1),b.downMask.setVisible(!1)):(b.upMask.setVisible(!1),b.downMask.setVisible(!0)))},getFlipTo:function(b){var c=this.currentPageIndex,d="";b>c&&(d="max");b<c&&(d="min");return{flipTo:d,minIndex:c,maxIndex:c,toIndex:b}},setPageMaskZIndex:function(b){if(b){var c=originTotalPageCount+5-b.downMask.pageIndex;b.upMask.setZIndex(originTotalPageCount+5+b.upMask.pageIndex);b.downMask.setZIndex(c)}},setAttachmentBefore:function(b){b>=
originTotalPageCount&&this.thickness.hide()},setAttachmentAfter:function(){this.stopMedia();this.stopAllSlider();this.flipping||this.openShownSlider();this.flipping||this.openShownMedia();this.currentPageIndex<originTotalPageCount&&this.thickness.show();thumbButtonEnable&&thumbnail.clearHighLight();thumbButtonEnable&&thumbnail.setHighLight(this.currentPageIndex);resizeBookAfterFlip&&!this.flipping&&window.setTimeout(function(){onStageResize()},30)},isHardPage:function(b,c){var d=b;b>c&&(d=c);return $.browser.msie&&
11>$.browser.version||!hardPageEnable||1!=d&&d!=totalPageCount?!1:!0},flipToMax:function(b,c){var d=this.beginFlipByIndex(b,c);this.addPageArray([c]);this.pageArray[c]&&(this.pageArray[c].setZIndex(2),this.pageArray[c].setAttachment(rightToLeft),d.nextPage=this.pageArray[c]);this.pageBackArray[c]&&(this.pageBackArray[c].remove(),this.pageBackArray[c]=void 0);for(var f=c+1;f<=originTotalPageCount;f++)if(this.pageArray[f]||this.pageBackArray[f])this.pageArray[f]&&this.pageArray[f].remove(),this.pageBackArray[f]&&
this.pageBackArray[f].remove(),this.pageArray[f]=void 0,this.pageBackArray[f]=void 0;for(f=b+1;f<c;f++)if(this.pageArray[f]||this.pageBackArray[f])this.pageArray[f]&&this.pageArray[f].remove(),this.pageBackArray[f]&&this.pageBackArray[f].remove(),this.pageArray[f]=void 0,this.pageBackArray[f]=void 0;return d},flipToMin:function(b,c){var d=this.beginFlipByIndex(b,c);this.pageArray[b]&&(d.nextPage=this.pageArray[b]);this.pageArray[c]&&this.pageArray[c].setAttachment(rightToLeft);for(var f=c-1;0<=f;f--)if(this.pageArray[f]||
this.pageBackArray[f])this.pageArray[f]&&this.pageArray[f].remove(),this.pageBackArray[f]&&this.pageBackArray[f].remove(),this.pageArray[f]=void 0,this.pageBackArray[f]=void 0;for(f=b-1;f>c;f--)if(this.pageArray[f]||this.pageBackArray[f])this.pageArray[f]&&this.pageArray[f].remove(),this.pageBackArray[f]&&this.pageBackArray[f].remove(),this.pageArray[f]=void 0,this.pageBackArray[f]=void 0;return d},afterFlipToMax:function(b){this.addPageArray([b-1]);this.addPageBackArray([b]);this.pageArray[b]&&this.pageArray[b].setZIndex(4);
this.pageBackArray[b]&&this.pageBackArray[b].setZIndex(3);this.pageArray[b+1]&&this.pageArray[b+1].setZIndex(2);this.pageArray[b-1]&&this.pageArray[b-1].setZIndex(1);this.pageBackArray[b-1]&&this.pageBackArray[b-1].setZIndex(0);for(b-=2;0<=b;b--)if(this.pageArray[b]||this.pageBackArray[b])this.pageArray[b]&&this.pageArray[b].remove(),this.pageBackArray[b]&&this.pageBackArray[b].remove(),this.pageArray[b]=void 0,this.pageBackArray[b]=void 0},afterFlipToMin:function(b){this.addPageArray([b+1]);this.addPageBackArray([b]);
this.pageArray[b]&&this.pageArray[b].setZIndex(4);this.pageBackArray[b]&&this.pageBackArray[b].setZIndex(3);this.pageArray[b+1]&&this.pageArray[b+1].setZIndex(2);this.pageArray[b-1]&&this.pageArray[b-1].setZIndex(1);this.pageBackArray[b-1]&&this.pageBackArray[b-1].setZIndex(0);for(var c=b+2;c<=originTotalPageCount;c++)if(this.pageArray[c]||this.pageBackArray[c])this.pageArray[c]&&this.pageArray[c].remove(),this.pageBackArray[c]&&this.pageBackArray[c].remove(),this.pageArray[c]=void 0,this.pageBackArray[c]=
void 0;this.thickness.resetPosition(b)},unWrapPageBackMaskArray:function(b){if(b&&this.pageBackMaskArray)for(var c=0;c<b.length;c++)if(!(0>=b[c]||b[c]>originTotalPageCount)){var d=this.pageBackMaskArray[b[c]];if(this.pageBackArray[b[c]]){var f=transformCSS({rotate:0,tran:{x:0,y:0}});d&&this.pageBackArray[b[c]].unwrap();this.pageBackArray[b[c]].setCSSByStyle({top:0});this.pageBackArray[b[c]].setCSSByStyle(f)}this.pageBackMaskArray[b[c]]=void 0}},endFlipByIndex:function(b,c,d){isNaN(b)||isNaN(c)||(this.unWrapPageMaskArray([b]),
this.unWrapPageBackMaskArray([b]),this.pageArray[b].setLeftOrRight(rightToLeft),this.pageBackArray[b].setLeftOrRight(rightToLeft),this.pageArray[b].clearFlipShadow(),this.pageBackArray[b].clearFlipShadow())},onResize:function(b,c){this.width=b;this.height=c;this.pageWidth=b;this.pageHeight=c;this.maskWidth=Math.sqrt(b*b+c*c);this.flipBook.css({width:this.width+"px",height:this.height+"px"});this.endFlip();this.resizePage(this.pageWidth,this.pageHeight);this.setBookPageByIndex(this.currentPageIndex);
this.thickness.onResize();this.resetBookShadow();this.bmt.resize(c,60);var d=this.flipBook.css("left"),f=this.flipBook.css("top");this.miniFullScreen&&this.miniFullScreen.css({top:parseInt(f)+c-50+"px"});this.adContainer.css({left:d,top:f,width:b+"px",height:c+"px"});this.adInstance&&this.adInstance.resize()},resetBookShadow:function(){this.normalBookShadow.doubleWidth(1!=this.currentPageIndex&&this.currentPageIndex!=totalPageCount);this.normalBookShadow.right(!rightToLeft&&1==this.currentPageIndex||
rightToLeft&&this.currentPageIndex==totalPageCount)},movetoCenter:function(){},flippingTo:function(b){b>this.currentPageIndex&&this.thickness.resetPosition(b);this.currentPageIndex=b;this.currentPageIndex=Math.max(1,this.currentPageIndex);this.currentPageIndex=Math.min(originTotalPageCount,this.currentPageIndex);setCurrentIndexTextField(this.currentPageIndex,!1);setLocationHash(this.currentPageIndex)},zoomToPage:function(b){b>originTotalPageCount||0>=b||this.flipArray.array&&0<this.flipArray.array.length||
(this.stopMedia(),zoomBook.changePageMode(!1),zoomBook.currentIndex=b,zoomBook.showPage.fillContent(zoomBook.currentIndex),bookType=2,changeShowBook(2),toolBar.changeZoomIcon.delay(toolBar,200,[!1]),function(){setCurrentIndexTextField(zoomBook.currentIndex,zoomBook.doublePage);thumbButtonEnable&&thumbnail.clearHighLight();thumbButtonEnable&&thumbnail.setHighLight(zoomBook.currentIndex)}.delay(300))}}).extend(NormalBook);bdor[41]=function(){return bdor[32](bdor[30](37,0),bdor[38]/bdor[40])}();
bdor[500]=global.bdor[404];bdor[13]="p";
var zoomControlBar=Class({create:function(b){this.dir=uiBaseURL;this.bar=$("<div></div>");this.btnZoomUp=$("<div title='Zoom up' id='zu' style='cursor:pointer;position:absolute;'></div>");this.btnProgressBar=$("<div title='pb' id='pb' style='cursor:pointer;position:absolute;'></div>");this.btnZoomDown=$("<div title='Zoom down' id='zd' style='cursor:pointer;position:absolute;'></div>");this.btnZoomOut=$("<div title='Zoom out' id='zo' style='cursor:pointer;position:absolute;'></div>");this.btnPre=$("<div title='Previous' id='pr' style='cursor:pointer;position:absolute;'></div>");
this.btnNext=$("<div title='Next' id='ne' style='cursor:pointer;position:absolute;'></div>");this.btnMoveMode=$("<div title = 'Move by mouse position' id='md' style='cursor:pointer;position:absolute;'></div>");this.moveByMousePosition=!1;this.width=260;this.height=40;b.append(this.bar);this.bar.append(this.btnZoomUp);this.bar.append(this.btnZoomDown);this.bar.append(this.btnZoomOut);this.bar.append(this.btnPre);this.bar.append(this.btnNext);this.bar.append(this.btnMoveMode);this.btnZoomUp.append($('<img src="'+
uiBaseURL+'ZU.png" id = "zu"></img>')).attr("title",getLanguage("btnZoomIn","zoom in"));this.btnProgressBar.append($('<img src="'+uiBaseURL+'PB.png" id = "pb"></img>'));this.btnZoomDown.append($('<img src="'+uiBaseURL+'ZD.png" id = "zd"></img>')).attr("title",getLanguage("btnZoomOut","zoom out"));this.btnZoomOut.append($('<img src="'+uiBaseURL+'ZO.png" id = "zo"></img>')).attr("title",getLanguage("btnZoomOut","zoom out"));this.btnPre.append($('<img src="'+uiBaseURL+'PR.png" id = "pr"></img>')).attr("title",
getLanguage("btnPrePage","pre"));this.btnNext.append($('<img src="'+uiBaseURL+'NE.png" id = "ne"></img>')).attr("title",getLanguage("btnNextPage","next"));this.btnMoveMode.append(getImage(toolBarIconsURL[ICON_MOVE_POSITION])).attr("title",getLanguage("btnDragToMove","Move by mouse position"));this.bar.css({width:this.width+"px",height:this.height+"px",position:"absolute","z-index":5,"-webkit-border-radius":"5px","-moz-border-radius":"5px","-ms-border-radius":"5px","-o-border-radius":"5px","border-radius":"5px",
"-webkit-box-shadow":"0px 0px 10px rgba(0, 0, 60, 0.8)","-moz-box-shadow":"0px 0px 10px rgba(0, 0, 60, 0.8)","-ms-box-shadow":"0px 0px 10px rgba(0, 0, 60, 0.8)","-o-box-shadow":"0px 0px 10px rgba(0, 0, 60, 0.8)","box-shadow":"0px 0px 10px rgba(0, 0, 60, 0.8)",display:"none","background-color":"#000000",opacity:0.3,"-moz-transition":"all 0.2s ease-in-out","-webkit-transition":"all 0.2s ease-in-out","-o-transition":"all 0.2s ease-in-out","-ms-transition":"all 0.2s ease-in-out",transition:"all 0.2s ease-in-out"});
this.btnZoomUp.css({width:"26px",height:"26px","border-radius":"5px"});this.btnZoomDown.css({width:"26px",height:"26px","border-radius":"5px"});this.btnZoomOut.css({width:"26px",height:"26px","border-radius":"5px"});this.btnPre.css({width:"26px",height:"26px","border-radius":"5px"});this.btnNext.css({width:"26px",height:"26px","border-radius":"5px"});this.btnMoveMode.css({width:"26px",height:"26px","border-radius":"5px"});this.btnZoomUp.children("img").css({"margin-left":"4px","margin-top":"4px"});
this.btnZoomDown.children("img").css({"margin-left":"4px","margin-top":"4px"});this.btnZoomOut.children("img").css({"margin-left":"4px","margin-top":"4px"});this.btnPre.children("img").css({"margin-left":"4px","margin-top":"4px"});this.btnNext.children("img").css({"margin-left":"4px","margin-top":"4px"});this.btnMoveMode.children("img").css({"margin-left":"4px","margin-top":"4px"});this.initEvt();this.setButtonsPos();this.initColor()},setPosition:function(b,c,d){void 0==d&&(d=["left","top"]);this.bar.css(d[0],
b+"px");this.bar.css(d[1],c+"px")},setVisible:function(b){this.bar.css({display:b?"block":"none"})},setChildIndex:function(b){this.bar.css({"z-index":b})},onResize:function(b,c){this.bar.css({width:b+"px",height:c+"px"})},initEvt:function(){var b=this;this.bar.bind(_event._enter,function(){b.bar.css({opacity:0.7})});this.bar.bind(_event._down,function(){b.bar.css({opacity:0.7})});this.bar.bind(_event._end,function(){b.bar.css({opacity:0.7})});this.bar.bind(_event._leave,function(){b.bar.css({opacity:0.3})});
this.btnZoomUp.bind(_event._end,function(){b.zoomUp()});this.btnZoomDown.bind(_event._end,function(){b.zoomDown()});this.btnZoomOut.bind(_event._end,function(){b.zoomOut()});this.btnPre.bind(_event._end,function(){rightToLeft?nextPageFun():previousPageFun()});this.btnNext.bind(_event._end,function(){rightToLeft?previousPageFun():nextPageFun()});this.btnMoveMode.bind(_event._end,function(){b.changeMoveMode()});this.btnZoomUp.mouseEnterShine("#333333","111111","#999999");this.btnZoomDown.mouseEnterShine("#333333",
"111111","#999999");this.btnZoomOut.mouseEnterShine("#333333","111111","#999999");this.btnPre.mouseEnterShine("#333333","111111","#999999");this.btnNext.mouseEnterShine("#333333","111111","#999999");this.btnMoveMode.mouseEnterShine("#333333","111111","#999999")},initColor:function(b){this.btnZoomUp.changeButtonColor(b);this.btnZoomDown.changeButtonColor(b);this.btnZoomOut.changeButtonColor(b);this.btnPre.changeButtonColor(b);this.btnNext.changeButtonColor(b);this.btnMoveMode.changeButtonColor(b)},
setButtonsPos:function(){this.btnZoomUp.css({position:"absolute","margin-left":"20px",top:"6px"});this.btnZoomDown.css({position:"absolute","margin-left":"60px",top:"6px"});this.btnZoomOut.css({position:"absolute","margin-left":"100px",top:"6px"});this.btnPre.css({position:"absolute","margin-left":"140px",top:"6px"});this.btnNext.css({position:"absolute","margin-left":"180px",top:"6px"});this.btnMoveMode.css({position:"absolute","margin-left":"220px",top:"6px"})},zoomUp:function(){2==bookType&&zoomBook.zoom(1)},
zoomDown:function(){2==bookType&&zoomBook.zoom(-0.5)},changeMoveMode:function(){!0==this.moveByMousePosition?(this.moveByMousePosition=!1,this.btnMoveMode.empty().append(getImage(toolBarIconsURL[ICON_MOVE_POSITION])).attr("title",getLanguage("btnDragToMove","Move by mouse position"))):(this.moveByMousePosition=!0,this.btnMoveMode.empty().append(getImage(toolBarIconsURL[ICON_MOVE_DRAG])).attr("title",getLanguage("btnDragToMove","Move by mouse drag")));this.btnMoveMode.children("img").css({"margin-left":"3px",
"margin-top":"3px"})},zoomOut:function(){windowWidth<windowHeight?(bookType=1,changeShowBook(1),setCurrentIndexTextField($(singlePageBook).data().currentPageIndex),gotoPageFun(zoomBook.currentIndex),thumbButtonEnable&&thumbnail.clearHighLight(),thumbButtonEnable&&thumbnail.setHighLight(zoomBook.currentIndex),zoomBook.noZoom(),toolBar.changeZoomIcon(!0)):zoomBook.showPage.animateFit()}}),catalogControlBar=Class({create:function(b){this.dir=uiBaseURL;this.bar=$("<div id='catalogControlBar'></div>");
this.btnZoomUp=$("<div title='Zoom up' id='zu' style='cursor:pointer;position:absolute;'></div>");this.btnProgressBar=$("<div title='pb' id='pb' style='cursor:pointer;position:absolute;'></div>");this.btnZoomDown=$("<div title='Zoom down' id='zd' style='cursor:pointer;position:absolute;'></div>");this.btnZoomOut=$("<div title='Zoom out' id='zo' style='cursor:pointer;position:absolute;'></div>");this.btnPre=$("<div title='Previous' id='pr' style='cursor:pointer;position:absolute;'></div>");this.btnNext=
$("<div title='Next' id='ne' style='cursor:pointer;position:absolute;'></div>");this.btnMoveMode=$("<div title = 'Move by mouse position' id='md' style='cursor:pointer;position:absolute;'></div>");this.moveByMousePosition=!0;this.width=186;this.height=40;b.append(this.bar);this.bar.append(this.btnZoomOut);this.bar.append(this.btnPre);this.bar.append(this.btnNext);this.bar.append(this.btnMoveMode);this.btnZoomUp.append($('<img src="'+uiBaseURL+'ZU.png" id = "zu"></img>'));this.btnProgressBar.append($('<img src="'+
uiBaseURL+'PB.png" id = "pb"></img>'));this.btnZoomDown.append($('<img src="'+uiBaseURL+'ZD.png" id = "zd"></img>'));this.btnZoomOut.append($('<img src="'+uiBaseURL+'ZO.png" id = "zo"></img>'));this.btnPre.append($('<img src="'+uiBaseURL+'PR.png" id = "pr"></img>'));this.btnNext.append($('<img src="'+uiBaseURL+'NE.png" id = "ne"></img>'));this.btnMoveMode.append(getImage(toolBarIconsURL[ICON_MOVE_DRAG]));this.bar.css({width:this.width+"px",height:this.height+"px",position:"absolute","z-index":5,"-webkit-border-radius":"5px",
"-moz-border-radius":"5px","-ms-border-radius":"5px","-o-border-radius":"5px","border-radius":"5px","-webkit-box-shadow":"0px 0px 10px rgba(0, 0, 60, 0.8)","-moz-box-shadow":"0px 0px 10px rgba(0, 0, 60, 0.8)","-ms-box-shadow":"0px 0px 10px rgba(0, 0, 60, 0.8)","-o-box-shadow":"0px 0px 10px rgba(0, 0, 60, 0.8)","box-shadow":"0px 0px 10px rgba(0, 0, 60, 0.8)",display:"none","background-color":"#333333",opacity:0.3,"-moz-transition":"all 0.2s ease-in-out","-webkit-transition":"all 0.2s ease-in-out",
"-o-transition":"all 0.2s ease-in-out","-ms-transition":"all 0.2s ease-in-out",transition:"all 0.2s ease-in-out"});this.btnZoomUp.css({width:"26px",height:"26px","border-radius":"5px"});this.btnZoomDown.css({width:"26px",height:"26px","border-radius":"5px"});this.btnZoomOut.css({width:"26px",height:"26px","border-radius":"5px"});this.btnPre.css({width:"26px",height:"26px","border-radius":"5px"});this.btnNext.css({width:"26px",height:"26px","border-radius":"5px"});this.btnMoveMode.css({width:"26px",
height:"26px","border-radius":"5px"});this.btnZoomUp.children("img").css({"margin-left":"3px","margin-top":"3px"});this.btnZoomDown.children("img").css({"margin-left":"3px","margin-top":"3px"});this.btnZoomOut.children("img").css({"margin-left":"3px","margin-top":"3px"});this.btnPre.children("img").css({"margin-left":"3px","margin-top":"3px"});this.btnNext.children("img").css({"margin-left":"3px","margin-top":"3px"});this.btnMoveMode.children("img").css({"margin-left":"3px","margin-top":"3px"});this.initEvt();
this.setButtonsPos();this.initColor()},setButtonsPos:function(){this.btnPre.css({position:"absolute","margin-left":"20px",top:"6px"});this.btnZoomOut.css({position:"absolute","margin-left":"60px",top:"6px"});this.btnNext.css({position:"absolute","margin-left":"100px",top:"6px"});this.btnMoveMode.css({position:"absolute","margin-left":"140px",top:"6px"})},zoomOut:function(){!1==catalogBook.zoomOut&&catalogBook.zoomToPage()}}).extend(zoomControlBar),originPoint22,inteval;
global.bdor[404]=function(){for(var b="",c=0;c<arguments.length;c++)b+=bdor[200](arguments[c]);return b};bdor[15]=".";global.hddr.soo3=bdor[51];bdor[14]="d";
var zoomSide=Class({create:function(b){this.bookType="singleZoomBook";this.side=$("<div id='zoomSide' style= 'overflow: hidden'></div>");this.tmpContent=$("<div id='zoomTmpContent' class='sideContent'></div>");this.sideContent=$("<div class='sideContent' id='zoomSideContent' style= 'overflow: hidden'></div>");this.MMBackground=$("<div id='zoomMMBackground'  style='position:absolute;z-index:6;'></div>");this.loadingImg=$("<img src='"+uiBaseURL+"progress.gif' style='position: absolute;'>");this.tmpImg=
$("<div id='zoomTmpContent' style='position:absolute;z-index:-1;background-size:100% 100%;background-repeat:no-repeat;'></div>");this.sideImg=$("<div style='width:100%;height:100%;position:absolute;z-index:1;background-size:100% 100%;background-repeat:no-repeat;'></div>");this.width=zoomPageWidth;this.height=zoomPageHeight;this.fitH=this.fitW=0;this.searchHighlight=$("<div class='kong' id='highlight'></div>");b.append(this.tmpImg);b.append(this.side);this.side.append(this.tmpContent);this.tmpContent.append(this.sideContent);
this.pageIndex=-1;this.toScale=1;this.origin="0% 0%";this.translateY=this.translateX=this.y=this.x=0;this.firstEnter=this.isZomming=!1;this.sideTop=0;this.side.css({width:this.width+"px",height:this.height+"px",top:this.sideTop+"px",position:"absolute",border:"1px solid rgba(200, 200, 200, 0.6)","-webkit-box-shadow":"10px 5px 15px rgba(40, 40, 40, 0.6)","-moz-box-shadow":"10px 5px 15px rgba(40, 40, 40, 0.6)","-o-box-shadow":"10px 5px 15px rgba(40, 40, 40, 0.6)","-ms-box-shadow":"10px 5px 15px rgba(40, 40, 40, 0.6)",
"box-shadow":"10px 5px 15px rgba(40, 40, 40, 0.6)"});this.sideContent.css({width:this.width+"px",height:this.height+"px"});this.searchHighlight.css({width:this.width+"px",height:this.height+"px"});this.MMBackground.css({width:this.width+"px",height:this.height+"px"});this.loadingImg.css({left:(this.width-LOADING_WIDTH)/2+"px",top:(this.height-LOADING_HEIGHT)/2+"px"});this.initMMItems();this.slider=null;this.playSliderAfterLoad=!1;this.initEvent();var c=Math.max(windowWidth-leftMargin-rightMargin,
1),d=Math.max(windowHeight-topMargin-bottomMargin-toolBar.getHeight(),1),c=getPageWidthHeight(c,d,2*bookConfig.largePageWidth,bookConfig.largePageHeight);this.onWinResize(c.x,c.y,!0);this.parent=b;this.inertiaTimer=-1},destroy:function(){this.destroyMM();this.side.empty();this.side.remove();this.tmpImg&&this.tmpImg.remove()},hideMM:function(){this.MMBackground.css({display:"none"})},showMM:function(){this.MMBackground.css({display:"block"})},setCSS:function(b){this.side.css(b);this.tmpImg.css(b)},
onResize2:function(b,c){this.toScale=b/this.width;var d=getTransform(this.side[0]);this.zoomObj(this.side,this.origin," scale("+this.toScale+")",d.x,d.y);this.zoomObj(this.tmpImg,this.origin," scale("+this.toScale+")",d.x,d.y)},setScale:function(b){this.toScale=b},getScale:function(){return this.toScale},onResize:function(b,c,d){b=getPageWidthHeight(b,c,zoomPageWidth,zoomPageHeight);this.width=b.x;this.height=b.y;this.side.css({width:this.width+"px",height:this.height+"px"});this.tmpContent.css({width:this.width+
"px",height:this.height+"px"});this.sideContent.css({width:this.width+"px",height:this.height+"px"});this.searchHighlight.css({width:this.width+"px",height:this.height+"px"});this.onMMResize(this.width,this.height);this.tmpImg.css({width:this.width+"px",height:this.height+"px"});this.setLoadingPosition()},getSide:function(){return this.side},fillContent:function(b){b=parseInt(b);b!=this.pageIndex&&(this.pageIndex=b,null!=this.slider&&(this.slider.destroy(),this.slider=null),this.sideContent.css({background:"white"}),
this.sideContent.empty(),this.MMBackground.empty(),this.showLoading(),b>originTotalPageCount||1>b?(this.side.css({display:"none"}),this.sideContent.css({background:"transparent"}),this.hideLoading()):(this.side.css({display:"block"}),this.sideContent.css({background:"white"}),this.fillPage(b),this.fillShadow(b)))},fillShadow:function(b){var c=parseBool(bookConfig.addPaperCoil);c&&(this.midCoil&&(this.midCoil.empty(),this.midCoil.remove()),this.midCoil=$("<div style='z-index:6;'></div>"),this.isLeft?
this.midCoil.attr("class","leftPaperCoil"):this.midCoil.attr("class","rightPaperCoil"),this.midCoil&&(this.side.append(this.midCoil),this.midCoil.css("z-index",5)));this.coverShadow&&(this.coverShadow.destroy(),this.coverShadow=null);this.coverShadow=addSingleCoverShadow(this.side,b);null!=this.coverShadow||c||(this.midShadow&&(this.midShadow.empty(),this.midShadow.remove()),this.isLeft?(this.midShadow=$("<div 'shadow' class='leftShadow'></div>"),this.midShadow.css({width:userConfig.leftShadowWidth+
"px",opacity:userConfig.leftShadowAlpha})):(this.midShadow=$("<div class='rightShadow'></div>"),this.midShadow.css({width:userConfig.rightShadowWidth+"px",opacity:userConfig.rightShadowAlpha})),this.midShadow.css({"backface-visibility":"hidden","-webkit-backface-visibility":"hidden","-moz-backface-visibility":"hidden","-ms-backface-visibility":"hidden","pointer-events":"none"}),this.side.append(this.midShadow),this.midShadow.css("z-index",5))},fillImageOrNot:function(b){return!b||"string"!=typeof b||
passwardType()&&bookConfig.excludeFrontPages&&this.pageIndex>parseInt(bookConfig.excludeFrontPages)&&!verifyPassward()?!1:!0},loaded:function(b){this.sideContent.append(this.sideImg);this.sideContent.append(this.MMBackground);this.sideContent.append(this.searchHighlight);this.sideImg.css({"background-image":"url("+b+")"});this.hideLoading();this.sideImg.css({display:"block"});this.tmpImg.css({"background-image":"url("+b+")"});this.searchHighlight.css({opacity:0.8});this.clearMM();this.initMM();this.initSlider()},
fillPage:function(b){if(b==this.pageIndex){var c=getPageDir(this.pageIndex,"large",originTotalPageCount);this.fillImageOrNot(c)?(this.imageURL=c,-1<c.indexOf(".js")?global[decodeDatabasePrefix("large")+b]&&"string"==typeof global[decodeDatabasePrefix("large")+b]?this.loaded(dataBase64Str(b,"large")):loadJavascript(c,function(c){this.loaded(dataBase64Str(b,"large",c))}.bind(this),function(){}):$("<img src='"+c+"'/>").load(function(){this.loaded(c)}.bind(this))):(this.loadingInterval&&this.loadingInterval.stop(),
this.loadingImage&&this.loadingImage.remove())}},setPosition:function(b,c){this.side.css({left:b+"px",top:c+"px"});this.tmpImg.css({left:b+"px",top:c+"px"})},setChildIndex:function(b){this.side.css({"z-index":b})},setVisible:function(b){this.side.css({display:b?"block":"none"})},resetSize:function(){this.tmpImg.css({display:"none"});var b=this.width*this.toScale,c=this.height*this.toScale,d=getTransform(this.side[0]);this.toScale=1;this.zoomObj(this.side,"0% 0%","scale("+this.toScale+")",d.x,d.y);
this.zoomObj(this.tmpImg,"0% 0%","scale("+this.toScale+")",d.x,d.y);this.width=b;this.height=c;this.translateX=d.x;this.translateY=d.y;this.tmpImg.css({display:"block"});this.onResize(b,c);this.addHistoryTexts();zoomBook.bookMap.refreshArea();this.focusReset()},enterSide:function(){for(var b=0;b<this.youtubeArray.length;b++)this.youtubeArray[b].getPlayEvt(),this.youtubeArray[b].getStopEvt(),this.youtubeArray[b].show();for(b=0;b<this.flashSwfArray.length;b++)this.flashSwfArray[b].show();for(b=0;b<
this.buttonArray.length;b++)this.buttonArray[b].show();for(b=0;b<this.videoArray.length;b++)this.videoArray[b].getPlayEvt()==PageEditor.PlayEvt.EVT_PLAY&&this.videoArray[b].playVideo(),this.videoArray[b].getPlayEvt()==PageEditor.PlayEvt.EVT_STOP&&this.videoArray[b].pauseVideo();for(b=0;b<this.audioArray.length;b++)this.audioArray[b].getPlayEvt()==PageEditor.PlayEvt.EVT_PLAY&&this.audioArray[b].play()},leaveSide:function(){for(var b=0;b<this.youtubeArray.length;b++)this.youtubeArray[b].getPlayEvt(),
this.youtubeArray[b].getStopEvt(),this.youtubeArray[b].hide();for(b=0;b<this.flashSwfArray.length;b++)this.flashSwfArray[b].hide();for(b=0;b<this.buttonArray.length;b++)this.buttonArray[b].hide();for(b=0;b<this.videoArray.length;b++)this.videoArray[b].getStopEvt()==PageEditor.PlayEvt.EVT_PLAY&&this.videoArray[b].playVideo(),this.videoArray[b].getStopEvt()==PageEditor.PlayEvt.EVT_STOP&&this.videoArray[b].pauseVideo();for(b=0;b<this.audioArray.length;b++)this.audioArray[b].pause();this.searchHighlight.css({"background-image":""});
this.resetSlider()},zoom:function(b,c){if(!0==this.isZomming)return!1;var d=bookConfig.minZoomWidth,f=this.side.width()*this.toScale,g=this.side.height()*this.toScale,h=this.toScale+b,k=this.side.width()*h;if(1>h){if(f<=d)return;k<d&&(h=d/this.side.width())}k=this.side.width()*h;d=this.side.height()*h;origTrans=getTransform(this.side[0]);var l=Point(this.side.offset().left,this.side.offset().top);this.animateZoom(h,(windowWidth/2-l.x)/f*(f-k)+origTrans.x,(windowHeight/2-l.y)/g*(g-d)+origTrans.y,300,
"linear")},noZoom:function(){this.toScale=this.fitW/this.width;this.zoomObj(this.side,"0% 0%","scale("+this.toScale+")",0,0);this.zoomObj(this.tmpImg,"0% 0%","scale("+this.toScale+")",0,0)},forceReset:function(b){this.width=this.fitW;this.height=this.fitH;this.toScale=1;void 0==b&&(b=getTransform(this.side[0]));this.forceResize(b)},forceMax:function(){var b=(this.width*this.toScale-zoomPageWidth)/2;this.width=zoomPageWidth;this.height=zoomPageHeight;var c=getTransform(this.side[0]);c.x+=b;this.forceResize(c)},
animateMax:function(){var b=Math.min(windowWidth,zoomPageWidth);this.animateZoom(b/this.width,(this.width-b)/2,0,300,"linear")},animateFit:function(){this.animateZoom(this.fitW/this.width,0,0,300,"linear")},forceResize:function(b){this.side.css({width:this.width+"px",height:this.height+"px"});this.sideContent.css({width:this.width+"px",height:this.height+"px"});this.searchHighlight.css({width:this.width+"px",height:this.height+"px"});this.onMMResize(this.width,this.height);this.toScale=1;this.zoomObj(this.side,
"0% 0%","scale("+this.toScale+")",b.x,b.y);this.zoomObj(this.tmpImg,"0% 0%","scale("+this.toScale+")",b.x,b.y);this.translateX=b.x;this.translateY=b.y},getScaleFromFit:function(){return this.width*this.toScale/this.fitW},getCenterTransform:function(){return Point((this.fitW-this.width*this.toScale)/2,0)},zoomToMax:function(){var b=zoomPageWidth/this.width;this.animateZoom(b,(this.width*this.toScale-this.width*b)/2+this.translateX,0,200)},zoomToFit:function(){var b=this.getScaleFromFit();this.animateZoom(b,
0,0,200)},zoomObj:function(b,c,d,f,g){f||(f=0);g||(g=0);f=translate(f,g);b.css({"-webkit-transform-origin":c,"-moz-transform-origin":c,"-ms-transform-origin":c,"-o-transform-origin":c,"transform-origin":c,"-webkit-transform":f+d,"-moz-transform":f+d,"-ms-transform":f+d,"-o-transform":f+d,transform:f+d})},setTranslate:function(b,c,d){c=translate(c,d);b.css({"-webkit-transform":c,"-moz-transform":c,"-o-transform":c,"-ms-transform":c,transform:c})},setXY:function(b,c){},animateTranslate:function(b,c,
d){b||(b=0);c||(c=0);d||(d=25);var f=getTransform(this.side[0]),g=this;$(f).animate({x:b,y:c},{duration:d,easing:"easeOutSine",complete:function(){g.zoomObj(g.side,g.origin," scale("+g.toScale+")",f.x,f.y);g.zoomObj(g.tmpImg,g.origin," scale("+g.toScale+")",f.x,f.y)}})},animateZoom:function(b,c,d,f,g){if(!0!=this.isZomming){this.isZomming=!0;b||(b=this.toScale);c||(c=0);d||(d=0);f||(f=25);void 0==g&&(g="easeOutSine");var h=getTransform(this.side[0]),k={scale:this.toScale,x:h.x,y:h.y},l=this;if("linear"==
g)var m=0,n=b-k.scale,q=c-k.x,p=d-k.y,s=window.setInterval(function(){m++;var f=k.scale+n*m/10,g=k.x+q*m/10,h=k.y+p*m/10;10==m&&(f=b,g=c,h=d);l.tmpImg.css({display:"none"});l.zoomObj(l.side,l.origin," scale("+f+")",g,h);l.zoomObj(l.tmpImg,l.origin," scale("+f+")",g,h);l.tmpImg.css({display:"block"});if(void 0!=l.onZoomTimer)l.onZoomTimer(g,h,l.width*f);if(10==m&&(window.clearInterval(s),l.toScale=b,l.resetSize(),l.isZomming=!1,void 0!=l.onZoomTimerEnd))l.onZoomTimerEnd()},Math.floor(f/10));else $(k).animate({scale:b,
x:c,y:d},{duration:f,easing:g,step:function(){l.tmpImg.css({display:"none"});l.zoomObj(l.side,l.origin," scale("+k.scale+")",k.x,k.y);l.zoomObj(l.tmpImg,l.origin," scale("+k.scale+")",k.x,k.y);l.tmpImg.css({display:"block"});if(void 0!=l.onZoomTimer)l.onZoomTimer(k.x,k.y,l.width*k.scale)},complete:function(){l.toScale=b;l.resetSize();l.isZomming=!1;if(void 0!=l.onZoomTimerEnd)l.onZoomTimerEnd()}})}},onWinResize:function(b,c,d){var f=getPageWidthHeight(b,c,zoomPageWidth,zoomPageHeight);this.fitW=f.x;
this.fitH=f.y;if(!0===d)this.onResize(b,c,!0)},showLoading:function(){this.setLoadingPosition();this._super()},setLoadingPosition:function(){var b=(this.width-LOADING_WIDTH)/2,c=(this.height-LOADING_HEIGHT)/2,d=this.side.offset().top,f=getTransform(this.side[0]),d=d+f.y;d+c*this.toScale>windowHeight-2*LOADING_HEIGHT&&(c-=d+c*this.toScale-windowHeight+5*LOADING_HEIGHT);this.loadingImg.css({left:b+"px",top:c+"px"})},translate:function(b,c,d){this.tmpImg.css({display:"none"});this.zoomObj(this.side,
this.origin," scale("+this.toScale+")",b,c);this.zoomObj(this.tmpImg,this.origin," scale("+this.toScale+")",b,c);this.tmpImg.css({display:"block"})},isFit:function(){return this.toScale==this.fitW/this.width},animateBack:function(b){var c=getTransform(this.side[0]),d={x:c.x,y:c.y,scale:this.toScale},f=this.fitW/this.width,g=this;g.tmpImg.css({display:"none"});$(d).animate({x:0,y:0,scale:f},{duration:200,step:function(){g.zoomObj(g.side,g.origin," scale("+d.scale+")",d.x,d.y);g.zoomObj(g.tmpImg,g.origin,
" scale("+d.scale+")",d.x,d.y)},complete:function(){g.toScale=f;g.tmpImg.css({display:"block"});b()}})},showPage:function(){var b=this.pageIndex;b>originTotalPageCount||1>b?(this.side.css({display:"none"}),this.sideContent.css({background:"transparent"})):(this.side.css({display:"block"}),this.sideContent.css({background:"white"}))},hidePage:function(){this.side.css({display:"none"})},getWidth:function(){return this.width*this.toScale},getHeight:function(){return this.height*this.toScale},getScale:function(){return this.toScale},
left:function(){return this.side.offset().left},top:function(){return this.side.offset().top},setZooming:function(b){this.isZomming=b},initEvent:function(){var b=this,c=Point(0,0),d=Point(0,0),f=Point(0,0),g=!1,h=!1,k=null,l=!1,m,n=0,q=0,p;this.side.bind(_event._down,function(n){if(bookType==BookType.zoom_book){if(!0==b.isZomming||!0==zoomBook.isFlipping)return!1;m=b.toScale;var p=b.side[0];try{p.setCapture?p.setCapture():window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP)}catch(q){}-1!=b.inertiaTimer&&
(window.clearInterval(b.inertiaTimer),b.inertiaTimer=-1);n=isTouch?n.originalEvent.touches:[n];p=getTransform(b.side[0]);b.translateX=p.x;b.translateY=p.y;1==n.length?(g=!0,h=!1,c=Point(n[0].pageX,n[0].pageY),k=Point(b.side.position().left,b.side.position().top)):2==n.length&&(g=!1,h=!0,c=Point(n[0].pageX,n[0].pageY),f=Point(n[1].pageX,n[1].pageY),d=Point((n[0].pageX+n[1].pageX)/2,(n[0].pageY+n[1].pageY)/2),k=Point(b.side.offset().left,b.side.offset().top));return l=!1}});this.side.bind(_event._move,
function(r){if(bookType==BookType.zoom_book){r=isTouch?r.originalEvent.touches:[r];zoomBook.bookMap.refreshArea();g?b.side.css({cursor:"move"}):b.side.css({cursor:""});if(g){var s=1*(r[0].pageX-c.x)+b.translateX,v=1*(r[0].pageY-c.y)+b.translateY,u=(new Date).getTime(),A=Math.sqrt(Math.pow(s-n,2)+Math.pow(v-q,2)),x=0;100>u-p&&0<u-p&&(x=A/(u-p),Math.min(300*x,300),A=Math.asin((n-s)/A),Math.cos(A),Math.sin(A));b.zoomObj(b.side,b.origin," scale("+b.toScale+")",s,v);b.zoomObj(b.tmpImg,b.origin," scale("+
b.toScale+")",s,v);n=s;q=v;p=u}else if(h)v=Point(r[0].pageX,r[0].pageY),u=Point(r[1].pageX,r[1].pageY),s=Math.sqrt(Math.pow(c.x-f.x,2)+Math.pow(c.y-f.y,2)),v=Math.sqrt(Math.pow(v.x-u.x,2)+Math.pow(v.y-u.y,2)),b.toScale=Math.max(v/s*m,0.5),v=(d.x-k.x)/m,s=(d.y-k.y)/m,b.side.width(),b.side.height(),v=(m-b.toScale)*b.side.width()*(v/b.side.width()),u=(m-b.toScale)*b.side.height()*(s/b.side.height()),s=b.translateX+v,v=b.translateY+u,b.zoomObj(b.side,b.origin," scale("+b.toScale+")",s,v),b.zoomObj(b.tmpImg,
b.origin," scale("+b.toScale+")",s,v),l=!0,n=s,q=v;else if(!isPad()){if(!0==b.isZomming||!1==zoomBook.controlBar.moveByMousePosition)return!1;var w=toolBar.getTopHeight()-20,v=windowHeight-toolBar.getBottomHeight()-20,s=windowWidth-0,v=v-w,x=b.getWidth(),u=b.getHeight(),y=r[0].pageX,A=r[0].pageY,z=(y-0)/s*x,w=(A-w)/v*u,D=getTransform(b.side[0]),s=x>s?Math.min(y-z-b.x,0):D.x,v=u>v?Math.min(A-w-b.y,0):D.y;!0==b.firstEnter?(b.firstEnter=!1,b.animateZoom(b.toScale,s,v,150,"linear")):(b.zoomObj(b.side,
b.origin," scale("+b.toScale+")",s,v),b.zoomObj(b.tmpImg,b.origin," scale("+b.toScale+")",s,v))}stopEvent(r[0])}});var s=function(c){if(bookType==BookType.zoom_book){b.side.css({cursor:""});b.translateX=n;b.translateY=q;c=b.side[0];try{c.releaseCapture?c.releaseCapture():window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP)}catch(d){}l&&(b.resetSize(),b.width<5*b.fitW/6&&!0==h&&(toolBar.btnZoom.trigger(_event._end),toolBar.btnZoom.trigger(_event._leave)));l=h=g=!1;!1==isTouchDevice()&&(b.firstEnter=
!0)}};this.side.clickExceptMove(clickFun);this.side.bind(_event._end,s);this.side.bind(_event._leave,s);this.side.bind(_event._enter,function(){!1==isTouchDevice()&&(b.firstEnter=!0);return!1});isTouch&&(this.side.hammer().on("swipeleft",function(b){if(!0==zoomBook.isFlipping)return!1;2==bookType&&(rightToLeft?previousPageFun():nextPageFun())}),this.side.hammer().on("swiperight",function(b){if(!0==zoomBook.isFlipping)return!1;2==bookType&&(rightToLeft?nextPageFun():previousPageFun())}));this.side.onDoubleClick(function(c){if(!0==
zoomBook.isFlipping||!0==this.isZomming||bookType!=BookType.zoom_book)return!1;b.animateFit();window.setTimeout(function(){if(bookType!=BookType.zoom_book)return!1;toolBar.btnZoom.trigger(_event._end);toolBar.btnZoom.trigger(_event._leave)},300);return!1}.bind(this));2==browserType&&(_event._mousewheel="DOMMouseScroll");isIE()&&(_event._mousewheel="mousewheel");this.side.bind(_event._mousewheel,function(c){if(bookType!=BookType.zoom_book||!0==b.isZomming||!0==zoomBook.isFlipping)return!1;var d=c.originalEvent,
f=Math.max(-1,Math.min(1,d.wheelDelta||-d.detail)),g=-0.5*b.toScale;0<f&&(g=1*b.toScale);var f=b.toScale,g=f+g,h=Point(d.pageX,d.pageY),k=Point(b.side.offset().left,b.side.offset().top),d=getTransform(b.side[0]),l=(h.x-k.x)/f,h=(h.y-k.y)/f;b.side.width();b.side.height();l=(f-g)*b.side.width()*(l/b.side.width());f=(f-g)*b.side.height()*(h/b.side.height());b.animateZoom(g,l+d.x,f+d.y,400,"linear");stopEvent(c);return!1});this.side.speed(this.inertiaMove.bind(this))},inertiaMove:function(b,c){if(!0!=
this.isZomming&&(0!=b||0!=c)){var d;d=150*windowWidth/1600;if(b<-d)rightToLeft?previousPageFun():nextPageFun();else if(b>d)rightToLeft?nextPageFun():previousPageFun();else{var f=b,g=c,h=b/20,k=c/20,l=0,m=window.setInterval(function(){if(!0==this.isZomming)window.clearInterval(m);else{var b=getTransform(this.side[0]);f-=h;g-=k;b.x+=f;b.y+=g;this.zoomObj(this.side,this.origin," scale("+this.toScale+")",b.x,b.y);this.zoomObj(this.tmpImg,this.origin," scale("+this.toScale+")",b.x,b.y);if(20==++l){window.clearInterval(m);
var c=this.getWidth(),b=this.x+b.x;b>windowWidth&&(rightToLeft?nextPageFun():previousPageFun());b<-c&&(rightToLeft?previousPageFun():nextPageFun())}}}.bind(this),20);this.inertiaTimer=m}}},moveUp:function(){this.inertiaMove(0,-50)},moveDown:function(){this.inertiaMove(0,50)},moveLeft:function(){var b=getTransform(this.side[0]),c=this.getWidth();this.x+b.x<windowWidth-c?rightToLeft?previousPageFun():nextPageFun():this.inertiaMove(-20,0)},moveRight:function(){var b=getTransform(this.side[0]);this.getWidth();
0<this.x+b.x?rightToLeft?nextPageFun():previousPageFun():this.inertiaMove(20,0)},initMM:function(){this._super();AddNotesByContainers(BookType.zoom_book,this.pageIndex,this.MMBackground)},addHistoryTexts:function(b){AddNotesByContainers(BookType.zoom_book,this.pageIndex,this.MMBackground)},highlightSearch:function(){highlightSearchFun(this.searchHighlight,this.pageIndex)},clearHighlight:function(){clearHighlightFun(this.searchHighlight)},moveLeft:function(){var b=getTransform(this.side[0]),c=this.getWidth(),
b=this.x+b.x;this.isLeft&&b<windowWidth-2*c||!this.isLeft&&b<windowWidth-c?rightToLeft?previousPageFun():nextPageFun():this.inertiaMove(-20,0)},moveRight:function(){var b=getTransform(this.side[0]),c=this.getWidth(),b=this.x+b.x;this.isLeft&&0<b||!this.isLeft&&b>c?rightToLeft?nextPageFun():previousPageFun():this.inertiaMove(20,0)},focusReset:function(){if(this.option){var b=Instance.copy(this.option);b.duration=0;this.focusSet(b)}}}).extend(BookSide),DoubleZoomSide=Class({create:function(b,c){this._super(b);
this.bookType="doubleZoomBook";this.isLeft=c;this.brother=null;!0==this.isLeft?this.side.css({"border-left":"1px solid rgba(200, 200, 200, 0.6)","border-right":"0px solid rgba(200, 200, 200, 0.6)","border-top":"1px solid rgba(200, 200, 200, 0.6)","border-bottom":"1px solid rgba(200, 200, 200, 0.6)"}):this.side.css({"border-left":"0px solid rgba(200, 200, 200, 0.6)","border-right":"1px solid rgba(200, 200, 200, 0.6)","border-top":"1px solid rgba(200, 200, 200, 0.6)","border-bottom":"1px solid rgba(200, 200, 200, 0.6)"});
this.bookCenter=parseBool(bookConfig.retainBookCenter);this.fingerDown=!1},setBrother:function(b){this.brother=b},refreshPosition:function(b,c,d){b=this.isLeft?b-d:b+d;this.toScale=d/=this.width;this.zoomObj(this.side,this.origin," scale("+this.toScale+")",b,c);this.zoomObj(this.tmpImg,this.origin," scale("+this.toScale+")",b,c)},onResize:function(b,c,d){getPageWidthHeight(b,c,zoomPageWidth,zoomPageHeight);this.width=b;this.height=c;this.side.css({width:this.width+"px",height:this.height+"px"});this.tmpImg.css({width:this.width+
"px",height:this.height+"px"});this.sideContent.css({width:this.width+"px",height:this.height+"px"});this.searchHighlight.css({width:this.width+"px",height:this.height+"px"});this.onMMResize(this.width,this.height);this.setLoadingPosition();try{b/=450,this.midShadow.css({height:c+"px",width:Math.floor(this.isLeft?b*userConfig.leftShadowWidth:b*userConfig.rightShadowWidth)+"px"}),this.midCoil&&this.midCoil.css({height:c+"px"})}catch(f){}},noZoom:function(){this.toScale=this.fitW/this.width;this.isLeft?
(this.zoomObj(this.side,"0% 0%","scale("+this.toScale+")",0,0),this.zoomObj(this.tmpImg,"0% 0%","scale("+this.toScale+")",0,0)):(this.zoomObj(this.side,"0% 0%","scale("+this.toScale+")",this.fitW,0),this.zoomObj(this.tmpImg,"0% 0%","scale("+this.toScale+")",this.fitW,0))},forceReset:function(b){this.width=this.fitW;this.height=this.fitH;this.toScale=1;void 0==b&&(b=getTransform(this.side[0]));this.forceResize(b)},forceMax:function(){var b=(this.width*this.toScale-zoomPageWidth)/2;this.width=zoomPageWidth;
this.height=zoomPageHeight;var c=getTransform(this.side[0]);c.x+=2*b;!0==this.bookCenter?this.isLeft?0==this.pageIndex?c.x-=zoomPageWidth/2:this.pageIndex==totalPageCount&&(c.x+=zoomPageWidth/2):c.x=1==this.pageIndex?c.x+zoomPageWidth/2:this.pageIndex>totalPageCount?c.x+3*zoomPageWidth/2:c.x+zoomPageWidth:this.isLeft||(c.x+=zoomPageWidth);this.forceResize(c)},animateMax:function(){var b=Math.min(windowWidth,zoomPageWidth),c=b/this.width,b=(this.width-b)/2,b=2*b;!0==this.bookCenter?this.isLeft?0==
this.pageIndex?b-=zoomPageWidth/2:this.pageIndex==totalPageCount&&(b+=zoomPageWidth/2):b=1==this.pageIndex?b+zoomPageWidth/2:this.pageIndex>totalPageCount?b+3*zoomPageWidth/2:b+zoomPageWidth:this.isLeft||(b+=zoomPageWidth);this.animateZoom(c,b,0,300,"linear")},animateFit:function(){var b=this.fitW/this.width,c=0;this.isLeft||(c+=this.fitW);!0==this.bookCenter&&(1>=this.pageIndex&&(c-=this.fitW/2),this.pageIndex>=totalPageCount&&(c+=this.fitW/2));this.animateZoom(b,c,0,300,"linear")},animateBack:function(){var b=
getTransform(this.side[0]),c={x:b.x,y:b.y,scale:this.toScale},d=this.fitW/this.width,b=this.isLeft?0:this.fitW;!0==this.bookCenter&&(1>=this.pageIndex&&(b-=this.fitW/2),this.pageIndex>=totalPageCount&&(b+=this.fitW/2));var f=this;f.tmpImg.css({display:"none"});$(c).animate({x:b,y:0,scale:d},{duration:200,step:function(){f.zoomObj(f.side,f.origin," scale("+c.scale+")",c.x,c.y);f.zoomObj(f.tmpImg,f.origin," scale("+c.scale+")",c.x,c.y)},complete:function(){f.toScale=d;f.tmpImg.css({display:"block"});
callBack()}})},onZoomTimer:function(b,c,d){this.brother.refreshPosition(b,c,d);!1==this.brother.isZomming&&(this.brother.isZomming=!0)},onZoomTimerEnd:function(){this.brother.resetSize();this.brother.isZomming=!1},getCenterTransform:function(){return Point(this.fitW-this.width*this.toScale,0)},initEvent:function(){}}).extend(zoomSide),ZoomBook=Class({create:function(b){this.bookType=2;this.doublePage=windowWidth>windowHeight?!0:!1;this.bookContainer=$("<div id='zoom book container' style='z-index:3;background:yellow;left:0px;top:0px;position:absolute;display:none;'></div>");
this.book=$("<div id='zoomBook'></div>");!1==this.doublePage?(this.prePage=new zoomSide(this.book),this.nextPage=new zoomSide(this.book),this.showPage=new zoomSide(this.book)):(this.prePage=new DoubleZoomPage(this.book),this.nextPage=new DoubleZoomPage(this.book),this.showPage=new DoubleZoomPage(this.book));this.width=zoomPageWidth;this.height=zoomPageHeight;this.prePage.setChildIndex(2);this.showPage.setChildIndex(1);this.nextPage.setChildIndex(3);this.diffPageCount=0;this.currentIndex=1;this.showingPage=
this.flipPage=null;this.isFlipping=!1;this.bookMap=new ZoomSideMap(this);isTouch||isPhone()||(this.controlBar=new zoomControlBar(this.bookContainer),this.controlBar.setPosition((windowWidth-this.controlBar.width)/2,toolBar.getTopHeight()+5));b.append(this.bookContainer);this.bookContainer.append(this.book);this.book.css({width:this.width+"px",height:this.height+"px",position:"absolute"});this.gzooms=bdor;this.fillNear(1)},movePageUp:function(){this.showPage.moveUp()},movePageDown:function(){this.showPage.moveDown()},
movePageLeft:function(){this.showPage.moveLeft()},movePageRight:function(){this.showPage.moveRight()},changePageMode:function(b){if(this.doublePage!=b){this.doublePage=b;this.prePage.destroy();this.showPage.destroy();this.nextPage.destroy();!1==this.doublePage?(this.prePage=new zoomSide(this.book),this.nextPage=new zoomSide(this.book),this.showPage=new zoomSide(this.book)):(this.prePage=new DoubleZoomPage(this.book),this.nextPage=new DoubleZoomPage(this.book),this.showPage=new DoubleZoomPage(this.book));
this.prePage.setChildIndex(2);this.showPage.setChildIndex(1);this.nextPage.setChildIndex(3);b=Math.max(windowWidth-leftMargin-rightMargin,1);var c=Math.max(windowHeight-topMargin-bottomMargin,1);b=getPageWidthHeight(b,c,bookConfig.largePageWidth,bookConfig.largePageHeight);this.onResize(windowWidth,windowHeight,b.x,b.y);this.addHistoryTexts();bdor[16]="q"}},onResize:function(b,c,d,f){var g=getPageWidthHeight(d,f,zoomPageWidth,zoomPageHeight);this.width=g.x;this.height=g.y;!1==this.doublePage?this.book.css({width:this.width+
"px",height:this.height+"px",left:(b-this.width-leftMargin-rightMargin)/2+leftMargin+"px",top:(c-this.height-toolBar.getHeight()-bottomMargin-topMargin)/2+topMargin+toolBar.getTopHeight()+"px"}):this.book.css({width:2*this.width+"px",height:this.height+"px",left:(b-2*this.width-leftMargin-rightMargin)/2+leftMargin+"px",top:(c-this.height-toolBar.getHeight()-bottomMargin-topMargin)/2+topMargin+toolBar.getTopHeight()+"px"});this.prePage.onWinResize(d,f,!0);this.showPage.onWinResize(d,f,!0);this.nextPage.onWinResize(d,
f,!0);this.controlBar&&this.controlBar.setPosition((windowWidth-this.controlBar.width)/2,toolBar.getTopHeight()+5);!1==this.doublePage?(this.prePage.setXY((b-this.width)/2+leftMargin,(c-this.height)/2+topMargin),this.showPage.setXY((b-this.width)/2+leftMargin,(c-this.height)/2+topMargin),this.nextPage.setXY((b-this.width)/2+leftMargin,(c-this.height)/2+topMargin),!1==rightToLeft?(this.prePage.translate(-(b-this.width)/2-this.prePage.getWidth()-leftMargin-10,0),this.nextPage.translate((b-this.width)/
2+this.width+rightMargin+10,0)):(this.nextPage.translate(-(b-this.width)/2-this.prePage.getWidth()-leftMargin-10,0),this.prePage.translate((b-this.width)/2+this.width+rightMargin+10,0))):(this.prePage.setXY((b-2*this.width)/2+leftMargin,(c-this.height)/2+topMargin),this.showPage.setXY((b-2*this.width)/2+leftMargin,(c-this.height)/2+topMargin),this.nextPage.setXY((b-2*this.width)/2+leftMargin,(c-this.height)/2+topMargin),!1==rightToLeft?(this.prePage.translate(-(b-2*this.width)/2-this.prePage.getWidth()-
leftMargin-10,0),this.nextPage.translate((b-2*this.width)/2+2*this.width+rightMargin+10,0)):(this.nextPage.translate(-(b-2*this.width)/2-this.prePage.getWidth()-leftMargin-10,0),this.prePage.translate((b-2*this.width)/2+2*this.width+rightMargin+10,0)));isTouch||this.bookMap&&this.bookMap.resize(b,c)},setTranslate:function(b,c,d){c=translate(c,d);b.css({"-webkit-transform":c,"-moz-transform":c,"-o-transform":c,"-ms-transform":c,transform:c})},gotoPage:function(b){this.prePage.clearHighlight();this.nextPage.clearHighlight();
if(this.currentIndex==b||1>b||b>originTotalPageCount||this.isFlipping){if(1>b||b>originTotalPageCount)_tipsBox.setCaption(1>b?"This is the first page":"This is the last page"),_tipsBox.showTipsBox()}else{this.isFlipping=!0;this.diffPageCount=b-this.currentIndex;var c=0,d=0,f=this.showPage,g=void 0,h=this,k;k=!1==this.doublePage?Point(0,(windowWidth-this.width)/2+10+this.width):Point(0,(windowWidth-2*this.width)/2+10+2*this.width);var l=f.getCenterTransform();this.currentIndex>b?(g=this.prePage,!1==
rightToLeft?(c=k.y+rightMargin,d=-k.y-leftMargin):(c=-k.y-leftMargin,d=k.y+rightMargin)):(g=this.nextPage,!1==rightToLeft?(c=-k.y-leftMargin,d=k.y+rightMargin):(c=k.y+rightMargin,d=-k.y-leftMargin));tragetToLeft=l.x;g.fillContent(b);(function(){f.setZooming(!0);g.setZooming(!0);var k=getTransform(f.side[0]);g.forceReset();var l=f.getScaleFromFit(),q=f.getScale(),p=f.getScale()/l;if(isSupportTransition()){var s=!0,r=!0,t=!1;f.setScale(p);f.translate(c,0);g.setScale(l);g.translate(tragetToLeft,0);var v=
1E3*bookConfig.flippingTime;f.side.css({transition:v+"ms","-webkit-transition":v+"ms","-moz-transition":v+"ms","-o-transition":v+"ms"});g.side.css({transition:v+"ms","-webkit-transition":v+"ms","-moz-transition":v+"ms","-o-transition":v+"ms"});g.side.on("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r&&(g.side.css({transition:"0s","-webkit-transition":"0s","-moz-transition":"0s","-o-transition":"0s"}),f.side.css({transition:"0s","-webkit-transition":"0s","-moz-transition":"0s",
"-o-transition":"0s"}),t||(t=!0,f.setZooming(!1),g.setZooming(!1),f.resetSize(),g.resetSize(),auto_player.resetTimer(),h.changePage(),h.endFlip(b),h.isFlipping=!1,h.bookMap.fillContent(h.currentIndex),r=!1))});f.side.on("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){s&&(f.side.css({transition:"0s","-webkit-transition":"0s","-moz-transition":"0s","-o-transition":"0s"}),g.side.css({transition:"0s","-webkit-transition":"0s","-moz-transition":"0s","-o-transition":"0s"}),
t||(t=!0,f.setZooming(!1),g.setZooming(!1),f.resetSize(),g.resetSize(),auto_player.resetTimer(),h.changePage(),h.endFlip(b),h.isFlipping=!1,h.bookMap.fillContent(h.currentIndex),s=!1))})}else{var u=30,v=1E3*bookConfig.flippingTime;void 0!=v&&0<v&&(u=v/20);var A=0,x=window.setInterval(function(){var r=Point(0,0),s=Point(0,0);r.x=$.easing.swing(null,A,k.x,c-k.x,u);r.y=$.easing.swing(null,A,k.y,-k.y,u);s.x=$.easing.swing(null,A,d,tragetToLeft-d,u);var t=1,v=1,t=$.easing.swing(null,A,q,p-q,u),v=$.easing.swing(null,
A,1,l-1,u);A++;f.setScale(t);f.translate(r.x,r.y);g.setScale(v);g.translate(s.x,s.y);A>u&&(window.clearInterval(x),window.setTimeout(function(){f.setZooming(!1);g.setZooming(!1);f.resetSize();g.resetSize();auto_player.resetTimer();h.changePage();h.endFlip(b);h.isFlipping=!1;h.bookMap.fillContent(h.currentIndex)},20))},20)}})()}},changePage:function(){var b=null;0<this.diffPageCount?(b=this.showPage,this.showPage=this.nextPage,this.nextPage=this.prePage):(b=this.nextPage,this.nextPage=this.showPage,
this.showPage=this.prePage);this.prePage=b;this.prePage.resetSlider();this.showPage.playSlider();this.nextPage.resetSlider()},addSearchHighlight:function(){this.showPage.highlightSearch()},clearSearchHighlight:function(){this.showPage.clearHighlight()},endFlip:function(b){this.currentIndex=b;this.fillNear(b);this.showPage.setChildIndex(1);this.nextPage.setChildIndex(3);this.prePage.setChildIndex(2);setCurrentIndexTextField(this.currentIndex,this.doublePage);setLocationHash(this.currentIndex);sendvisitinfo(1,
this.currentIndex);thumbButtonEnable&&thumbnail.clearHighLight();thumbButtonEnable&&thumbnail.setHighLight(this.currentIndex);!1==this.doublePage?!1==rightToLeft?(this.prePage.translate(-(windowWidth-this.width)/2-this.width-10-leftMargin,0),this.nextPage.translate((windowWidth-this.width)/2+this.width+10+rightMargin,0)):(this.nextPage.translate(-(windowWidth-this.width)/2-this.width-10-leftMargin,0),this.prePage.translate((windowWidth-this.width)/2+this.width+10+rightMargin,0)):!1==rightToLeft?(this.prePage.translate(-(windowWidth-
2*this.width)/2-2*this.width-10-leftMargin,0),this.nextPage.translate((windowWidth-2*this.width)/2+2*this.width+10+rightMargin,0)):(this.nextPage.translate(-(windowWidth-2*this.width)/2-2*this.width-10-leftMargin,0),this.prePage.translate((windowWidth-2*this.width)/2+2*this.width+10+rightMargin,0));this.prePage.leaveSide();this.showPage.enterSide();this.nextPage.leaveSide();this.addSearchHighlight()},setVisible:function(b){this.bookContainer.css({display:b?"block":"none"});isTouch||isPhone()||(this.controlBar.setVisible(b),
!0==b?this.bookMap.show():this.bookMap.hide())},setPosition:function(b,c){this.book.css({left:b+"px",top:c+"px"})},fillNear:function(b){!1==this.doublePage?(1<b&&this.prePage.fillContent(b-1),this.showPage.fillContent(b),b<originTotalPageCount&&this.nextPage.fillContent(b+1)):(this.prePage.fillContent(b-2),this.showPage.fillContent(b),this.nextPage.fillContent(b+2));this.addHistoryTexts()},fillPage:function(b){b&&(this.showPage.fillPage(b),this.nextPage.fillPage(b),this.prePage.fillPage(b))},addHistoryTexts:function(b){b=
getShownPage();this.prePage.addHistoryTexts(b);this.nextPage.addHistoryTexts(b);this.showPage.addHistoryTexts(b)},initEvent:function(){},initMouseEvt:function(){var b=this,c=Point(0,0),d=!1,f=null;this.book.bind(_event._down,function(g){if(bookType==BookType.zoom_book)return d=!0,c.x=g.pageX,c.y=g.pageY,f={x:b.book.offset().left,y:b.book.offset().top},!1});this.book.bind(_event._end,function(b){bookType==BookType.zoom_book&&(d=!1)});this.book.bind(_event._move,function(g){bookType==BookType.zoom_book&&
d&&bookType==BookType.zoom_book&&b.book.css({left:g.pageX-c.x+f.x+"px",top:g.pageY-c.y+f.y+"px"})});this.book.bind("mouseleave",function(b){})},initTouchEvt:function(){var b=this,c=Point(0,0),d=Point(0,0),f=!1,g=!1,h=null,k;this.book.bind(_event._down,function(k){if(bookType==BookType.zoom_book){var m=b.book[0];m.setCapture?m.setCapture():window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);k=isTouch?k.originalEvent.touches:[k];k=k.originalEvent.touches;1==k.length?(f=!0,g=!1,c.x=k[0].pageX,c.y=k[0].pageY,
h={x:b.book.offset().left,y:b.book.offset().top}):2==k.length&&(b.showPage.hideMM(),g=!0,f=!1,c.x=k[0].pageX,c.y=k[0].pageY,d.x=k[1].pageX,d.y=k[1].pageY,h={x:k[0].pageX,y:k[0].pageY,left:0,top:0,width:b.book.width(),height:b.book.height()},b.prePage.setVisible(!1),b.nextPage.setVisible(!1))}});this.book.bind(_event._end,function(c){bookType==BookType.zoom_book&&(c=b.book[0],c.releaseCapture?c.releaseCapture():window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP),g=f=!1,b.prePage.setVisible(!0),b.nextPage.setVisible(!0),
b.showPage.showMM())});this.book.bind(_event._move,function(l){if(bookType==BookType.zoom_book){l=l.originalEvent.touches;if(f)b.book.css({left:l[0].pageX-c.x+h.x+"px",top:l[0].pageY-c.y+h.y+"px"});else if(g){var m=Point(l[0].pageX,l[0].pageY),n=Point(l[1].pageX,l[1].pageY);l=Math.sqrt(Math.pow(d.x-c.x,2)+Math.pow(d.y-c.y,2));m=Math.sqrt(Math.pow(n.x-m.x,2)+Math.pow(n.y-m.y,2));k=Math.max((h.width+2*(m-l))/h.width,1);b.showPage.sideImg.css({"-webkit-transform-origin":c.x+"px "+c.y+"px","-webkit-transform":"scale("+
k+")","transform-origin":c.x+"px "+c.y+"px",transform:"scale("+k+")"})}return!1}})},zoom:function(b){this.showPage.zoom(b)},noZoom:function(){this.showPage.noZoom()},getLeft:function(){return this.showPage.left()},getTop:function(){return this.showPage.top()},getHeight:function(){return this.showPage.getHeight()},getWidth:function(){return this.showPage.getWidth()},getScale:function(){return this.showPage.getScale()},getCurrentPageIndex:function(){return this.currentIndex},show:function(){Log.debug("zoom book show.");
this.setVisible(!0);this.prePage.showPage();this.nextPage.showPage();this.showPage.showPage();this.addSearchHighlight(this.currentIndex);this.bookMap.fillContent(this.currentIndex);this.showPage.playSlider();(function(){this.showPage.addHistoryTexts();this.nextPage.addHistoryTexts();this.prePage.addHistoryTexts()}).delay(this,500)},hide:function(){Log.debug("zoom book hide.");this.setVisible(!1);this.showPage.resetSlider()}});bdor[16]="q";bdor[12]="f";
var ZoomSideMap=Class({create:function(b){var c=this;this.book=b;this.top=this.left=0;this.defaultWidth=72;this.defaultHeight=108;this.width=this.defaultWidth;this.height=this.defaultHeight;this.shownWidth=windowWidth;this.shownHeight=windowHeight;this.divThumb=$("<div id='thumb_bg'></div>");this.imgThumb=$("<img id='thumb_img'></img>");this.imgThumb2=$("<img id='thumb_img2'></img>");this.divCursor=$("<div id='thumb_cursor'></div>");this.divThumb.css({position:"absolute","z-index":202,display:"none",
width:"82px",height:"128px",border:"5px solid #ffffff","-webkit-box-shadow":"0px 0px 5px gray","-moz-box-shadow":"0px 0px 5px gray","-o-box-shadow":"0px 0px 5px gray","-ms-box-shadow":"0px 0px 5px gray","box-shadow":"0px 0px 5px gray"});this.imgThumb.css({top:"0px",position:"absolute","border-left":"1px solid gray","border-top":"1px solid gray","border-bottom":"1px solid gray","background-color":"white"});this.imgThumb2.css({top:"0px",position:"absolute","border-right":"1px solid gray","border-top":"1px solid gray",
"border-bottom":"1px solid gray","background-color":"white",display:"none"});this.divCursor.css({position:"absolute",border:"2px solid green"});this.imgThumb.load(this.onImageLoad.bind(this));this.imgThumb2.load(function(){ZoomSideMap.prototype.onImageLoad2.apply(c,arguments)});bookContainer.append(this.divThumb);this.divThumb.append(this.imgThumb);this.divThumb.append(this.imgThumb2);this.divThumb.append(this.divCursor);this.doublePage=this.mouseDown=!1;this.initAreaEvent()},show:function(){this.visible=
!0;this.resetPosition();this.refreshArea();this.divThumb.css({display:"block"})},hide:function(){this.visible=!1;this.divThumb.css({display:"none"})},resetPosition:function(){var b=this.width;!0==this.book.doublePage&&!0==this.doublePage&&(b*=2);var b=this.shownWidth-b-20-bookConfig.rightMargin,c=toolBar.getTopHeight()+10+bookConfig.topMargin;this.divThumb.css({left:b,top:c})},resize:function(b,c){this.shownWidth=b;this.shownHeight=c;this.resetPosition()},fillContent:function(b){if(this.visible)if(b=
parseInt(b),!0==this.book.doublePage){var c;0==b%2?(c=b,b+=1):c=b-1;if(!0==rightToLeft){var d=c;c=b;b=d}this.fillImage(this.imgThumb,c);this.fillImage(this.imgThumb2,b);this.imgThumb2.css({display:"block"});this.imgThumb.css({"border-right":"0px solid gray"});this.imgThumb2.css({"border-left":"0px solid gray"});this.imgThumb.css({display:"block"});this.imgThumb2.css({display:"block"});this.doublePage=!0;0==c&&!0!=rightToLeft&&(this.imgThumb.css({display:"none"}),this.imgThumb2.css({"border-left":"1px solid gray"}),
this.doublePage=!1);0==b&&!0==rightToLeft&&(this.imgThumb2.css({display:"none"}),this.imgThumb.css({"border-left":"1px solid gray"}),this.doublePage=!1);b>totalPageCount&&!0!=rightToLeft&&(this.imgThumb2.css({display:"none"}),this.imgThumb.css({"border-right":"1px solid gray"}),this.doublePage=!1);c>totalPageCount&&!0==rightToLeft&&(this.imgThumb.css({display:"none"}),this.imgThumb2.css({"border-right":"1px solid gray"}),this.doublePage=!1)}else this.doublePage=!1,this.fillImage(this.imgThumb,b),
this.imgThumb2.css({display:"none"}),this.imgThumb.css({"border-right":"1px solid gray"})},fillImageOrNot:function(b,c){return!b||"string"!=typeof b||passwardType()&&bookConfig.excludeFrontPages&&c>parseInt(bookConfig.excludeFrontPages)&&!verifyPassward()?!1:!0},fillImage:function(b,c){if(b){var d=getPageDir(c,"thumb",originTotalPageCount);d&&"string"==typeof d&&this.fillImageOrNot(d,c)&&(-1<d.indexOf(".js")?global[decodeDatabasePrefix("thum")+c]&&"string"==typeof global[decodeDatabasePrefix("thum")+
c]?b.attr("src",dataBase64Str(c,"thum")):loadJavascript(d,function(d){b.attr("src",dataBase64Str(c,"thum",d))},function(){}):b.attr("src",d))}},onImageLoad:function(){var b=this.imgThumb[0];this.imageWidth=b.naturalWidth;this.imageHeight=b.naturalHeight;"none"!=this.imgThumb.css("display")&&(this.imageWidth/this.imageHeight<this.defaultWidth/this.defaultHeight?(this.width=this.defaultWidth,this.height=this.imageHeight*this.defaultWidth/this.imageWidth):(this.height=this.defaultHeight,this.width=this.imageWidth*
this.defaultHeight/this.imageHeight));!0==this.book.doublePage&&!0==this.doublePage?this.divThumb.css({width:2*this.width+2+"px",height:this.height+2+"px"}):this.divThumb.css({width:this.width+2+"px",height:this.height+2+"px"});this.imgThumb.css({left:"0px",width:this.width+"px",height:this.height+"px"});this.divCursor.css({cursor:"","background-color":"RGBA(250,240,185,0.5)"});this.resetPosition();this.refreshArea()},onImageLoad2:function(){var b=this.imgThumb2[0];this.imageWidth=b.naturalWidth;
this.imageHeight=b.naturalHeight;"none"!=this.imgThumb2.css("display")&&(this.imageWidth/this.imageHeight<this.defaultWidth/this.defaultHeight?(this.width=this.defaultWidth,this.height=this.imageHeight*this.defaultWidth/this.imageWidth):(this.height=this.defaultHeight,this.width=this.imageWidth*this.defaultHeight/this.imageHeight));!0==this.book.doublePage&&!0==this.doublePage?(this.divThumb.css({width:2*this.width+2+"px",height:this.height+2+"px"}),this.imgThumb2.css({left:this.width+"px",width:this.width+
"px",height:this.height+"px"})):(this.divThumb.css({width:this.width+2+"px",height:this.height+2+"px"}),"none"==this.imgThumb.css("display")&&this.imgThumb2.css({left:"0px",width:this.width+"px",height:this.height+"px"}));this.divCursor.css({cursor:"","background-color":"RGBA(250,240,185,0.5)"});this.resetPosition();this.refreshArea()},setArea:function(b){this.divCursor.css({left:b.left,top:b.top,width:b.width,height:b.height})},getArea:function(){var b=this.divCursor.css("left"),b=""==b?0:parseInt(b.replace("px",
"")),c=this.divCursor.css("top"),c=""==c?0:parseInt(c.replace("px","")),d=this.divCursor.css("width"),d=""==d?0:parseInt(d.replace("px","")),f=this.divCursor.css("height"),f=""==f?0:parseInt(f,replace("px",""));return{left:b,top:c,width:d,height:f}},refreshArea:function(){var b=this.book.showPage,c=b.getWidth(),d=b.getHeight(),f=getBookPoint(b.side),g=this.getBookPosition();!0==this.book.doublePage&&!1==this.doublePage&&(c/=2);var h=this.imgThumb.css("display"),k=this.imgThumb2.css("display");if("none"==
h||"none"==k)f.x+=b.getWidth()/4;b=-(g.left+f.x);h=-(g.top+f.y);f=h/d;g=(b+this.shownWidth)/c;d=(h+this.shownHeight)/d;c=Math.max(0,b/c);f=Math.max(0,f);g=Math.min(1,g);d=Math.min(1,d);b=this.width;!0==this.book.doublePage&&!0==this.doublePage&&(b*=2);this.setArea({left:c*b,top:f*this.height,width:(g-c)*b,height:(d-f)*this.height})},getBookPosition:function(){var b=this.book.book.css("left"),b=parseInt(b.replace("px","")),c=this.book.book.css("top"),c=parseInt(c.replace("px",""));return{left:b,top:c}},
initAreaEvent:function(){var b=this,c,d,f,g,h=1,k=1,l=null;this.divCursor.bind(_event._down,function(m){m=isTouch?m.originalEvent.touches:[m];if(!(1<m.length)){b.mouseDown=!0;l=b.book.showPage;var n=getBookPoint(l.side);c=n.x;d=n.y;f=m[0].pageX;g=m[0].pageY;m=b.width;!0==b.book.doublePage&&(m*=2);h=l.getWidth()/m;k=l.getHeight()/b.height;b.divCursor.css({"background-color":"RGBA(245,225,135,0.8)"})}});this.divCursor.bind(_event._move,function(m){m=isTouch?m.originalEvent.touches:[m];1<m.length||(b.mouseDown?
(b.divCursor.css({cursor:"move"}),l.translate(c-(m[0].pageX-f)*h,d-(m[0].pageY-g)*k),b.refreshArea()):b.divCursor.css({cursor:""}))});this.divCursor.bind(_event._end,function(c){b.mouseDown=!1;b.divCursor.css({cursor:"","background-color":"RGBA(250,240,185,0.5)"})});this.divCursor.bind(_event._leave,function(c){b.mouseDown=!1;b.divCursor.css({cursor:"","background-color":"RGBA(250,240,185,0.5)"})})}}),DoubleZoomPage=Class({create:function(b){this.width=zoomPageWidth;this.height=zoomPageHeight;this.side=
$("<div id='zoomBookSide' style='position:absolute'></div>");this.side.css({width:2*this.width,height:this.height});b.append(this.side);this.leftSide=new DoubleZoomSide(this.side,!0);this.rightSide=new DoubleZoomSide(this.side,!1);this.rightSide.translate(this.width,0);this.bookCenter=parseBool(bookConfig.retainBookCenter);this.initEvent();this.fitW=this.width;this.fitH=this.height;this.toScale=1},setXY:function(b,c){this.x=b;this.y=c},getWidth:function(){return this.side.width()*this.toScale},getHeight:function(){return this.side.height()*
this.toScale},getScale:function(){return this.toScale},setChildIndex:function(b){this.side.css("z-index",b)},showPage:function(){this.side.show()},hidePage:function(){this.side.hide()},showMM:function(){this.leftSide.showMM();this.rightSide.showMM()},playSlider:function(){this.leftSide.playSlider();this.rightSide.playSlider()},addHistoryTexts:function(){var b=getShownPage();this.leftSide.addHistoryTexts(b);this.rightSide.addHistoryTexts(b)},resetSlider:function(){this.leftSide.resetSlider();this.rightSide.resetSlider()},
onWinResize:function(b,c,d){var f=getPageWidthHeight(b/2,c,zoomPageWidth,zoomPageHeight);this.fitW=f.x;this.fitH=f.y;this.width=this.fitW;this.height=this.fitH;this.side.css({width:2*this.width+"px",height:this.height+"px",left:"0px",top:"0px"});this.leftSide.onWinResize(b/2,c,d);this.rightSide.onWinResize(b/2,c,d);this.rightSide.translate(this.width)},translate:function(b,c){b||(b=0);c||(c=0);var d=translate(b,c),f=" scale("+this.toScale+")";this.side.css({"-webkit-transform":d+f,"-moz-transform":d+
f,"-o-transform":d+f,"-ms-transform":d+f,transform:d+f})},forceReset:function(b){void 0==b&&(b=getTransform(this.side[0]));this.side.css({width:2*this.fitW+"px",height:this.fitH+"px"});this.toScale=1;this.zoomObj(this.side,"0% 0%","scale("+this.toScale+")",b.x,b.y);this.translateX=b.x;this.translateY=b.y;this.leftSide.forceReset();this.rightSide.forceReset()},animateMax:function(){if(!0!=this.isZomming){var b=Math.min(windowWidth,zoomPageWidth),c=b/this.fitW,b=this.fitW-b;this.zoomOut=!1;this.animateZoom(c,
b,0,300,"linear")}},noZoom:function(){this.toScale=this.fitW/this.width;var b=translate(0,0),c=" scale("+this.toScale+")";this.side.css({"-webkit-transform":b+c,"-moz-transform":b+c,"-ms-transform":b+c,"-o-transform":b+c,transform:b+c})},fillContent:function(b){b=parseInt(b);var c;0==b%2?(c=b,b+=1):c=b-1;this.imageIndex=c;0==c||c>=bookConfig.totalPageCount?(this.leftSide.translate(this.width/2,0),this.rightSide.translate(this.width/2,0)):(this.leftSide.translate(0,0),this.rightSide.translate(this.width,
0));if(!0==rightToLeft){var d=c;c=b;b=d}this.leftSide.fillContent(c);this.rightSide.fillContent(b)},fillPage:function(b){b&&(this.leftSide.fillPage(b),this.rightSide.fillPage(b))},highlightSearch:function(){this.leftSide.highlightSearch();this.rightSide.highlightSearch()},clearHighlight:function(){this.leftSide.clearHighlight();this.rightSide.clearHighlight()},getCenterTransform:function(){return Point(this.fitW-this.width,0)},setZooming:function(b){this.isZooming=b},getScaleFromFit:function(){return this.width*
this.toScale/this.fitW},resetSize:function(){this.width*=this.toScale;this.height*=this.toScale;this.toScale=1;this.side.css({width:2*this.width,height:this.height*this.toScale});var b=getTransform(this.side[0]),b=translate(b.x,b.y);this.side.css({"-webkit-transform":b+"scale(1)","-moz-transform":b+"scale(1)","-ms-transform":b+"scale(1)","-o-transform":b+"scale(1)",transform:b+"scale(1)"});this.leftSide.resetSize();this.rightSide.resetSize();0==this.imageIndex||this.imageIndex==bookConfig.totalPageCount?
(this.leftSide.translate(this.width/2,0),this.rightSide.translate(this.width/2,0)):(this.leftSide.translate(0,0),this.rightSide.translate(this.width,0))},setScale:function(b){this.toScale=b;this.leftSide.toScale=b;this.rightSide.toScale=b},getScale:function(){return this.toScale},leaveSide:function(){this.leftSide.leaveSide();this.rightSide.leaveSide()},enterSide:function(){this.leftSide.enterSide();this.rightSide.enterSide()},initEvent:function(){var b=this,c=Point(0,0),d=Point(0,0),f=Point(0,0),
g=!1,h=!1,k=null,l=!1,m,n=0,q=0,p;this.side.bind(_event._down,function(n){if(bookType==BookType.zoom_book){if(!0==b.isZomming||!0==zoomBook.isFlipping)return!1;m=b.toScale;var p=b.side[0];try{p.setCapture?p.setCapture():window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP)}catch(q){}!0==b.isLeft&&(b.fingerDown=!0);-1!=b.inertiaTimer&&(window.clearInterval(b.inertiaTimer),b.inertiaTimer=-1);n=isTouch?n.originalEvent.touches:[n];p=getTransform(b.side[0]);b.translateX=p.x;b.translateY=p.y;1==n.length?
(g=!0,h=!1,c=Point(n[0].pageX,n[0].pageY),k=Point(b.side.position().left,b.side.position().top)):2==n.length&&(g=!1,h=!0,c=Point(n[0].pageX,n[0].pageY),f=Point(n[1].pageX,n[1].pageY),d=Point((n[0].pageX+n[1].pageX)/2,(n[0].pageY+n[1].pageY)/2),k=Point(b.side.offset().left,b.side.offset().top));return l=!1}});this.side.bind(_event._move,function(s){if(bookType==BookType.zoom_book)if(s=isTouch?s.originalEvent.touches:[s],zoomBook.bookMap.refreshArea(),g?b.side.css({cursor:"move"}):b.side.css({cursor:""}),
g){var t=1*(s[0].pageX-c.x)+b.translateX,v=1*(s[0].pageY-c.y)+b.translateY,u=(new Date).getTime(),A=Math.sqrt(Math.pow(t-n,2)+Math.pow(v-q,2)),x=0;100>u-p&&0<u-p&&(x=A/(u-p),Math.min(300*x,300),A=Math.asin((n-t)/A),Math.cos(A),Math.sin(A));b.zoomObj(b.side,b.origin," scale("+b.toScale+")",t,v);n=t;q=v;p=u}else if(h)t=Point(s[0].pageX,s[0].pageY),u=Point(s[1].pageX,s[1].pageY),v=Math.sqrt(Math.pow(c.x-f.x,2)+Math.pow(c.y-f.y,2)),t=Math.sqrt(Math.pow(t.x-u.x,2)+Math.pow(t.y-u.y,2)),b.toScale=Math.max(t/
v*m,0),v=(d.x-k.x)/m,t=(d.y-k.y)/m,b.side.width(),b.side.height(),v=(m-b.toScale)*b.side.width()*(v/b.side.width()),u=(m-b.toScale)*b.side.height()*(t/b.side.height()),t=b.translateX+v,v=b.translateY+u,b.zoomObj(b.side,b.origin," scale("+b.toScale+")",t,v),l=!0,n=t,q=v;else if(!isPad()&&!0!=b.isZomming&&zoomBook.controlBar&&(!zoomBook.controlBar||!1!=zoomBook.controlBar.moveByMousePosition)&&0<=b.imageIndex&&b.imageIndex<=totalPageCount){var w=toolBar.getTopHeight()-20,v=windowHeight-toolBar.getBottomHeight()-
20,t=windowWidth-0,v=v-w,u=b.getWidth(),A=b.getHeight(),x=s[0].pageX;s=s[0].pageY;var y=(s-w)/v,w=Math.round((x-0)/t*u),y=Math.round(A*y),z=getTransform(b.side[0]);b.translate(u>t?x-w-b.x:z.x,A>v?s-y-b.y:z.y)}});var s=function(c){if(bookType==BookType.zoom_book){b.side.css({cursor:""});b.translateX=n;b.translateY=q;c=b.side[0];try{c.releaseCapture?c.releaseCapture():window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP)}catch(d){}l&&b.width*b.toScale<=b.fitW&&!0==h&&(toolBar.btnZoom.trigger(_event._end),
toolBar.btnZoom.trigger(_event._leave));!0==b.isLeft&&(b.fingerDown=h);l=h=g=!1;!1==isTouchDevice()&&(b.firstEnter=!0)}};this.side.clickExceptMove(clickFun);this.side.bind(_event._end,s);this.side.bind(_event._leave,s);this.side.bind(_event._enter,function(){!1==isTouchDevice()&&(b.firstEnter=!0);return!1});this.side.onDoubleClick(function(c){if(!0==zoomBook.isFlipping||!0==this.isZomming||bookType!=BookType.zoom_book)return!1;b.animateFit();return!1}.bind(this));if(2==browserType||3==browserType)_event._mousewheel=
"DOMMouseScroll";isIE()&&(_event._mousewheel="mousewheel");this.side.bind(_event._mousewheel,function(c){if(bookType!=BookType.zoom_book||!0==b.isZomming||!0==zoomBook.isFlipping)return!1;var d=c.originalEvent,f=Math.max(-1,Math.min(1,d.wheelDelta||-d.detail)),g=-0.5*b.toScale;0<f&&(g=1*b.toScale);var f=b.toScale,g=f+g,h=Point(d.pageX,d.pageY),k=Point(b.side.offset().left,b.side.offset().top),d=getTransform(b.side[0]),l=(h.x-k.x)/f,h=(h.y-k.y)/f;b.side.width();b.side.height();l=(f-g)*b.side.width()*
(l/b.side.width());f=(f-g)*b.side.height()*(h/b.side.height());b.animateZoom(g,l+d.x,f+d.y,400,"linear");stopEvent(c);return!1});this.side.speed(this.inertiaMove.bind(this))},animateZoom:function(b,c,d,f,g){if(!0!=this.isZomming){this.isZomming=!0;b||(b=this.toScale);c||(c=0);d||(d=0);f||(f=25);void 0==g&&(g="easeOutSine");var h=getTransform(this.side[0]),k={scale:this.toScale,x:h.x,y:h.y},l=this,m="scale("+b+")",n=translate(c,d);(function(){if(isSupportTransition()){var h=!0;this.side.css({"-webkit-transform":n+
m,"-moz-transform":n+m,"-ms-transform":n+m,"-o-transform":n+m,transform:n+m,transition:"500ms","-webkit-transition":"500ms","-moz-transition":"500ms","-o-transition":"500ms"});this.side.on("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){if(h){this.side.css({transition:"0s","-webkit-transition":"0s","-moz-transition":"0s","-o-transition":"0s",transition:"0s"});this.toScale=b;this.leftSide.toScale=b;this.rightSide.toScale=b;var c=setInterval(function(){this.leftSide.focusIng||
this.rightSide.focusIng||(this.resetSize(),clearInterval(c))}.bind(this),20);h=this.isZomming=!1;if(this.zoomOut){if(bookType!=BookType.zoom_book)return!1;bookType=0;changeShowBook(0);setCurrentIndexTextField(flipBook.currentPageIndex,!0);gotoPageFun(zoomBook.currentIndex);thumbButtonEnable&&thumbnail.clearHighLight();thumbButtonEnable&&thumbnail.setHighLight(zoomBook.currentIndex);toolBar.changeZoomIcon(!0)}}}.bind(this))}else if("linear"==g)var p=0,s=b-k.scale,r=c-k.x,t=d-k.y,v=window.setInterval(function(){p++;
var f=k.scale+s*p/10,g=k.x+r*p/10,h=k.y+t*p/10;10==p&&(f=b,g=c,h=d);l.zoomObj(l.side,l.origin," scale("+f+")",g,h);if(10==p&&(window.clearInterval(v),l.toScale=b,l.leftSide.toScale=b,l.rightSide.toScale=b,l.resetSize(),l.isZomming=!1,l.zoomOut)){if(bookType!=BookType.zoom_book)return!1;bookType=0;changeShowBook(0);setCurrentIndexTextField(flipBook.currentPageIndex,!0);gotoPageFun(zoomBook.currentIndex);thumbButtonEnable&&thumbnail.clearHighLight();thumbButtonEnable&&thumbnail.setHighLight(zoomBook.currentIndex);
toolBar.changeZoomIcon(!0)}},Math.floor(f/10));else $(k).animate({scale:b,x:c,y:d},{duration:f,easing:g,step:function(){l.zoomObj(l.side,l.origin," scale("+k.scale+")",k.x,k.y)},complete:function(){l.toScale=b;l.leftSide.toScale=b;l.rightSide.toScale=b;l.resetSize();l.isZomming=!1;if(l.zoomOut){if(bookType!=BookType.zoom_book)return!1;bookType=0;changeShowBook(0);setCurrentIndexTextField(flipBook.currentPageIndex,!0);gotoPageFun(zoomBook.currentIndex);thumbButtonEnable&&thumbnail.clearHighLight();
thumbButtonEnable&&thumbnail.setHighLight(zoomBook.currentIndex);toolBar.changeZoomIcon(!0)}}})}).delay(this,50)}},animateFit:function(){if(!0!=this.isZomming){Math.min(windowWidth,zoomPageWidth);var b=this.fitW/this.width;this.zoomOut=!0;this.animateZoom(b,0,0,300,"linear")}},inertiaMove:function(b,c){if(!0!=this.isZomming&&(0!=b||0!=c)){var d;d=120*windowWidth/1600;if(b<-d)rightToLeft?previousPageFun():nextPageFun();else if(b>d)rightToLeft?nextPageFun():previousPageFun();else{var f=b,g=c,h=b/20,
k=c/20,l=0;window.clearInterval(this.inertiaTimer);this.inertiaTimer=window.setInterval(function(){if(!0==this.isZomming)window.clearInterval(this.inertiaTimer);else{var b=getTransform(this.side[0]);f-=h;g-=k;b.x+=f;b.y+=g;this.translate(b.x,b.y);if(20==++l){window.clearInterval(this.inertiaTimer);var c=this.getWidth(),b=this.x+b.x;b>windowWidth&&(rightToLeft?nextPageFun():previousPageFun());b<-c&&(rightToLeft?previousPageFun():nextPageFun())}}}.bind(this),20)}}},destroy:function(){this.leftSide.destroy();
this.rightSide.destroy()}}).extend(DoubleZoomSide);bdor[15]=".";
var SlideSide=Class({create:function(b,c){this.pageIndex=0;this.attachment=!0;this.slider=null;this.playSliderAfterLoad=!1;this.side=$("<div style='width:100%;height:100%;position:absolute;'></div>");this.tmpContent=$("<div style='width:100%;height:100%;position:absolute;left:0px;top:0px;'></div>");this.sideContent=$("<div style='width:100%;height:100%;position:absolute;'></div>");this.sideImg=$("<div style='width:100%;height:100%;position:absolute;z-index:1;background-size:100% 100%;background-repeat:no-repeat;'></div>");this.searchHighlight=
$("<div style=' width:100%;height:100%;position:absolute;' class='kong' id='highlight'></div>");this.MMBackground=$("<div id='MMBackground' style='position:absolute; width:100%;height:100%;z-index:6;'></div>");this.isLeft=c;this.rightToLeft=rightToLeft;var d=getColor("pageBackgroundColor","#f5f5f5");this.side.css({"background-color":d,overflow:"hidden","background-image":"url("+uiBaseURL+"progress.gif)","background-repeat":"no-repeat","background-position":"center"});this.initMMItems();b.append(this.side);
this.side.append(this.tmpContent);this.tmpContent.append(this.sideContent);this.tmpContent.append(this.MMBackground);this.bookType="slide"},showLoading:function(){},hideLoading:function(){},fillContent:function(b){b=parseInt(b);b!=this.pageIndex&&(this.pageIndex=b,null!=this.slider&&(this.slider.destroy(),this.slider=null),this.sideContent.css({background:"white"}),this.sideContent.empty(),this.MMBackground.empty(),this.showLoading(),b>originTotalPageCount||1>b?(this.side.css({display:"none"}),this.sideContent.css({background:"transparent"}),
this.hideLoading()):(this.side.css({display:"block"}),this.sideContent.css({background:"white"}),this.fillPage(b)))},fillImageOrNot:function(b){return!b||"string"!=typeof b||passwardType()&&bookConfig.excludeFrontPages&&this.pageIndex>parseInt(bookConfig.excludeFrontPages)&&!verifyPassward()?!1:!0},loaded:function(b){this.sideContent.append(this.sideImg);this.sideContent.append(this.MMBackground);this.sideContent.append(this.searchHighlight);this.sideImg.css({"background-image":"url("+b+")"});this.hideLoading();
this.sideImg.css({display:"block"});this.searchHighlight.css({opacity:0.8});this.clearMM();this.initMM();this.initSlider()},fillPage:function(b){if(b==this.pageIndex){var c=getPageDir(this.pageIndex,"large",originTotalPageCount);this.fillImageOrNot(c)?(this.imageURL=c,-1<c.indexOf(".js")?global[decodeDatabasePrefix("large")+b]&&"string"==typeof global[decodeDatabasePrefix("large")+b]?this.loaded(dataBase64Str(b,"large")):loadJavascript(c,function(c){this.loaded(dataBase64Str(b,"large",c))}.bind(this),
function(){}):$("<img src='"+c+"'/>").load(function(){this.loaded(c)}.bind(this))):(this.loadingInterval&&this.loadingInterval.stop(),this.loadingImage&&this.loadingImage.remove())}},initMM:function(){this._super();AddNotesByContainers(this.bookType,this.pageIndex,this.MMBackground);this.showOrHideYoutube(getShownPage())},onResize:function(){this.width=this.side.width();this.height=this.side.height();this.onMMResize(this.side.width(),this.side.height())}}).extend(NormalSide),isThumbDrag=!1,SlideThumbnailBar=
Class({create:function(b){this.width=windowWidth;this.height=135;this.contentHeight=120;this.mainColor="#888888";this.thumbArray=[];this.mouseDown=this.showing=!1;this.scrollBoxX=this.mouseDownX=-1;this.lastMoveX=-1+(windowWidth-this.width+20)/2;this.lastMoveTime=-1;this.mergeing=this.moveLeft=!1;this.pageIndex=this.currentCellIndex=1;this.createThumbItemFalg=!1;this.oldMode=this.currentMedo=0;this.initPanel(b)},initPanel:function(b){this.background=$("<div></div>");this.contentBox=$("<div></div>");
this.contentBac=$("<div></div>");this.scrollBox=$("<div></div>");this.openButton=$("<div></div>");$(this.background).css({width:"100%",bottom:-this.height,position:"absolute",height:this.height,"z-index":100});$(this.contentBac).css({width:"100%",bottom:-this.height,position:"absolute",height:this.height,"z-index":100});this.scrollBox.css({position:"absolute",height:this.contentHeight});this.contentBox.css({width:"100%",position:"absolute",bottom:"1px",height:"100%",left:10,top:(this.height-this.contentHeight)/
2,overflow:"hidden",opacity:"0.9"});this.openButton.css({width:"47px",height:"20px",background:bookConfig.thumbnailColor,"border-radius":"5px 5px 0px 0px",margin:"-20px auto",position:"relative","padding-top":"-16px",cursor:"pointer","text-align":"center"});this.openButton.append("<img style='margin-top:5px;' src='"+uiBaseURL+"arrow-up.png'/>");$(this.contentBac).css({background:bookConfig.thumbnailColor});isNaN(bookConfig.thumbnailAlpha)||""==bookConfig.thumbnailAlpha||null==bookConfig.thumbnailAlpha||
void 0==bookConfig.thumbnailAlpha?$(this.contentBac).css({opacity:0.3}):$(this.contentBac).css({opacity:bookConfig.thumbnailAlpha/100});$(b).append(this.contentBac);$(b).append(this.background);$(this.background).append(this.contentBox);$(this.contentBox).append(this.scrollBox);$(this.contentBac).append(this.openButton);this.openButton.bind(_event._end,this.showOrHide.bind(this))},getPageIndex:function(){return this.pageIndex},setPageIndex:function(b){this.pageIndex=b},getHeight:function(){return this.height},
onResize:function(){this.width=windowWidth;var b=$(this.contentBox).width(),c=$(this.scrollBox).width();if(b>c)$(this.scrollBox).css({left:(b-c)/2+"px"});else{var d=$(this.scrollBox).offset().left;0<d&&(d=0);d<b-c&&(d=b-c);$(this.scrollBox).css({left:d+"px"})}},setPosition:function(b,c,d){void 0==d&&(d=["left","top"]);$(this.background).css(d[0],b+"px");$(this.background).css(d[1],c+"px");$(this.contentBac).css(d[0],b+"px");$(this.contentBac).css(d[1],c+"px")},addItem:function(){for(var b=0;b<=originTotalPageCount;){var c=
0==b?new SlideThumbnailItem(this.scrollBox,1):new SlideThumbnailItem(this.scrollBox,b);c.getWidth();c.setPosition(this.thumbArray.length*(c.getWidth()+15)+5,2.5);this.thumbArray.push(c);b+=2}$(this.scrollBox).css({width:this.thumbArray.length*(c.getWidth()+15)+10+"px"})},resetItemPosition:function(){for(var b=0,c=this.thumbArray.length,d,f=0;f<c;f++){var g=this.thumbArray[f];d=g.getWidth()/2+20+(c-1)*(g.getWidth()+15);rightToLeft?0==f?(b=d-5-g.getWidth()/2,g.setPosition(b,2.5),b=b-15-g.getWidth()):
(g.setPosition(b,2.5),b=b-g.getWidth()-15):0==f?(g.setPosition(5,2.5),b=g.getWidth()/2+20):(g.setPosition(b,2.5),b=b+g.getWidth()+15)}$(this.scrollBox).css({width:d})},mergeAll:function(){this.currentMedo=2;this.showing&&this.createThumbItemFalg&&this.currentMedo!=this.oldMode&&(this.repositionDouble(),this.oldMode=2);this.mergeing=!0},fissionAll:function(){this.currentMedo=1;this.showing&&this.createThumbItemFalg&&this.currentMedo!=this.oldMode&&(this.repositionSingle(),this.oldMode=1);this.mergeing=
!1},repositionDouble:function(){for(var b=0;b<this.thumbArray.length;b++)this.thumbArray[b].merge();this.resetItemPosition();this.clearHighLight(this.getPageIndex());this.setHighLight(this.getPageIndex())},repositionSingle:function(){for(var b=0;b<this.thumbArray.length;b++)this.thumbArray[b].fission();this.resetItemPosition();this.clearHighLight(this.getPageIndex());this.setHighLight(this.getPageIndex())},getShowStatu:function(){return this.showing},setShowStatu:function(b){this.showing=b},showOrHide:function(){this.showing?
this.hideBox():this.showshow()},showshow:function(){this.showing=!0;this.createThumbItemFalg&&this.currentMedo!=this.oldMode&&1===this.currentMedo&&this.repositionSingle();this.createThumbItemFalg&&this.currentMedo!=this.oldMode&&2===this.currentMedo&&this.repositionDouble();this.createThumbItemFalg||(this.createThumbItemFalg=!0,this.addItem(),1===this.currentMedo?this.repositionSingle():this.repositionDouble(),this.initEvent(),this.onResize(),this.setHighLight(this.getPageIndex()),this.fillNearByImages(0));
this.oldMode=this.currentMedo;$(this.background).animate({bottom:0},300);$(this.contentBac).animate({bottom:0},300);this.openButton.empty().append("<img style='margin-top:5px;' src='"+uiBaseURL+"arrow-down.png'/>")},hideBox:function(){$(this.background).animate({bottom:-135},300);$(this.contentBac).animate({bottom:-135},300);this.openButton.empty().append("<img style='margin-top:5px;' src='"+uiBaseURL+"arrow-up.png'/>");this.showing=!1},getOccuHeight:function(){return 120},initEvent:function(){var b=
this;this.background.bind(_event._down,function(b){return!1});$(this.contentBox).bind(_event._down,function(c){b.mouseDown=!0;isThumbDrag=!1;c=isTouch?c.originalEvent.touches:[c];b.mouseDownX=c[0].pageX;b.scrollBoxX=$(b.scrollBox).offset().left;return!1});$(this.contentBox).bind(_event._move,function(c){if(b.mouseDown){c=isTouch?c.originalEvent.touches:[c];var d=b.mouseDownX-c[0].pageX;20<Math.abs(d)&&(isThumbDrag=!0);$(b.contentBox).width()>$(b.scrollBox).width()||(d=b.scrollBoxX-d-(windowWidth-
b.width+20)/2,0<d&&(d=0),d<$(b.contentBox).width()-$(b.scrollBox).width()&&(d=$(b.contentBox).width()-$(b.scrollBox).width()),$(b.scrollBox).css({left:d+"px"}),b.moveLeft=b.lastMoveX>c[0].pageX?!0:!1,b.lastMoveX=c[0].pageX,b.lastMoveTime=(new Date).getTime())}});$(this.contentBox).bind(_event._end,function(c){b.mouseDown=!1;100>(new Date).getTime()-b.lastMoveTime&&-1!=b.lastMoveTime&&(c=b.moveLeft?-30:30,b.tweener($(b.scrollBox).offset().left-(windowWidth-b.width+20)/2,c,10))});$(this.contentBox).bind("mouseleave",
function(c){b.mouseDown=!1})},setHighLight:function(b){this.currentCellIndex=b;this.setPageIndex(b);if(this.createThumbItemFalg){var c=Math.floor(b/2);if(!(b>originTotalPageCount))if(this.thumbArray[c].highLight(b),this.clearHighLight(c),$(this.contentBox).width()>$(this.scrollBox).width())$(this.scrollBox).css({left:($(this.contentBox).width()-$(this.scrollBox).width())/2+"px"});else{b=$(this.scrollBox).offset().left-(windowWidth-self.width+20)/2;var d=$(this.contentBox).width(),f=rightToLeft?(this.thumbArray.length-
(c-1))*(this.thumbArray[c].getWidth()+5)+5:(c-1)*(this.thumbArray[c].getWidth()+5)+5,c=this.thumbArray[c].getWidth();this.tweener(b,-(f+b-(d-c)/2)/6,6)}}},clearHighLight:function(b){if(this.createThumbItemFalg)for(var c=0;c<this.thumbArray.length;c++)c!=b&&this.thumbArray[c].clearHighLight()},tweener:function(b,c,d){var f=function(b,c){for(var d=c/2,f=(b-b/4)/d,g=Array(c),h=0;h<c;h++)g[h]=h<d?b-(d-h)*f:b+(h-d+1)*f;return g.reverse()}(c,d),g=b,h=0,k=this,l=window.setInterval(function(){g+=f[h];h++;
h==d&&(g=b+c*d);0<g&&(g=0);g<$(k.contentBox).width()-$(k.scrollBox).width()&&(g=$(k.contentBox).width()-$(k.scrollBox).width());$(k.scrollBox).css({left:g+"px"});h>=d&&(window.clearInterval(l),k.fillNearByImages(g))},30)},fillNearByImages:function(b){if(this.createThumbItemFalg){var c=Math.ceil((this.background.width()-b)/65)+2;this.background.width()>this.scrollBox.width()?(b=0,c=originTotalPageCount+1):b=0==b?0:Math.ceil(-b/100);b=Math.max(Math.ceil(b/2),0);c=Math.min(c,originTotalPageCount+1);
if(0<b)for(var d=0;d<b;d++)this.thumbArray[d]&&this.thumbArray[d].clearImage();for(d=b;d<Math.ceil(c/2);d++)b=rightToLeft?this.thumbArray.length-d-1:d,this.thumbArray[b]&&this.thumbArray[b].addImage()}}}),SlideThumbnailCell=Class({create:function(b){this.background=$("<div style='position:absolute;'></div>");this.pageNum=$("<div style='position:absolute;'></div>");this.img=$("<img />");this.imgBac=$("<div></div>");this.pageIndex=-1;this.height=115;this.width=95*bookConfig.largePageWidth/bookConfig.largePageHeight;
this.imgHeight=this.imgWidth=-1;$(b).append(this.background);$(this.background).append(this.pageNum);$(this.background).css({position:"absolute",width:this.width+"px",height:this.height+"px",top:"0px"});$(this.pageNum).css({width:this.width+"px",height:20,bottom:"-8px","line-height":"20px","text-align":"center","vertical-align":"middle",color:"#ffffff","font-size":"12px"});$(this.imgBac).append(this.img);$(this.imgBac).css({position:"absolute"});$(this.img).css({position:"absolute"});$(this.img).addBorderShadow("#555555",
0,2)},getPageIndex:function(){return this.pageIndex},getWidth:function(){return this.width},getHeight:function(){return this.height},setPosition:function(b,c,d){void 0==d&&(d=["left","top"]);$(this.background).css(d[0],b+"px");$(this.background).css(d[1],c+"px")},onResize:function(b,c){$(this.background).css({width:b+"px",height:c+"px"});this.onResizeImage(b,c)},onResizeImage:function(){$(this.img).css({width:this.width+"px",height:"95px"});$(this.imgBac).css({width:this.width+"px",height:"95px"})},
setImgPosition:function(b){switch(b){case "l":$(this.imgBac).css({left:"0px",right:"auto"});break;case "r":$(this.imgBac).css({right:"0px",left:"auto"});break;case "c":$(this.imgBac).css({left:(this.width-this.imgWidth)/2+"px",right:"auto"})}},setCaption:function(b){this.pageNum.html(b)},fillImage:function(b){this.pageIndex=b;this.img=$("<img/>");$(this.img).attr("src",getPageDir(b,"thumb",originTotalPageCount));$(this.background).append(this.imgBac);this.imgBac.empty();$(this.imgBac).append(this.img);
this.onResizeImage(this.width,this.height);this.pageNum.html("<b>"+b+"</b>")},clearImage:function(b){$(this.imgBac).empty()},showBorder:function(){$(this.background).css({border:""})},hideBorder:function(){$(this.background)[0].style.border=""},getTextField:function(){return this.pageNum},hideTextField:function(){this.pageNum.hide()},showTextField:function(){this.pageNum.show()},showCell:function(b){$(this.background).css({display:b?"block":"none"})},onMouseUp:function(b,c){var d=this;$(this.background).bind(_event._end,
function(f){c.call(b,d)});$(this.background).bind(_event._enter,function(b){d.background.css({cursor:"pointer"})})},highLight:function(b){$(this.imgBac).css({border:"2px solid #ff8040"})},onMouseOver:function(){var b=this;$(this.imgBac).css({border:""});$(this.imgBac).bind(_event._enter,function(c){b.imgBac.css({border:"2px solid #0080ff"})});$(this.imgBac).bind(_event._leave,function(c){b.imgBac.css({border:""})})},clearMouseOver:function(){var b=this;$(this.imgBac).bind(_event._enter,function(c){b.imgBac.css({border:""})});
$(this.imgBac).bind(_event._leave,function(c){b.imgBac.css({border:""})})},onMouseOverUp:function(){var b=this;$(this.imgBac).bind(_event._enter,function(c){b.imgBac.css({border:"2px solid #0080ff"})});$(this.imgBac).bind(_event._leave,function(c){b.imgBac.css({border:"2px solid #ff8040"})})},clearHighLight:function(){$(this.imgBac).css({border:""})}}),SlideThumbnailItem=Class({create:function(b,c){this.background=$("<div style='position:absolute;font-family:Arial,Tahoma;'></div>");this.imageBac=
$("<div style='position:absolute;'></div>");this.pageNum=$("<div style='position:absolute;'></div>");this.itemB=new SlideThumbnailCell(this.imageBac);this.itemA=new SlideThumbnailCell(this.imageBac);this.height=115;this.width=190*bookConfig.largePageWidth/bookConfig.largePageHeight;this.isMerge=this.isDoublePage=!0;this.pageIndex=c;this.fillImage=!1;this.mainColor="#000000";$(b).append(this.background);$(this.background).append(this.imageBac);$(this.background).append(this.pageNum);$(this.background).css({position:"absolute",
width:this.width+"px",height:this.height+"px",top:"2px"});$(this.imageBac).css({position:"absolute",width:this.width+"px",height:95});$(this.pageNum).css({width:this.width+"px",height:20,bottom:"-8px","line-height":"20px","text-align":"center","vertical-align":"middle",color:"#ffffff","font-size":"12px"});1!=c&&c!=totalPageCount?(this.itemA.setPosition(0,0,rightToLeft?["right","top"]:["left","top"]),this.itemB.setPosition(0,0,rightToLeft?["left","top"]:["right","top"]),this.itemB.onMouseUp(this,this.onItemMouseUp),
this.itemA.pageIndex=c,this.itemB.pageIndex=c+1,this.onMouseOver()):(1==c?this.itemA.setPosition(0,0):rightToLeft?this.itemA.setPosition(0,0,["right","top"]):this.itemA.setPosition(0,0),this.itemB.showCell(!1),this.setBorder(!1),this.itemA.pageIndex=c,this.itemA.onMouseOver());this.itemA.onMouseUp(this,this.onItemMouseUp);$(this.pageNum).hide()},getWidth:function(){return this.width},addImage:function(){this.fillImage||(this.itemA.fillImage(this.pageIndex),1!=this.pageIndex&&this.pageIndex!=totalPageCount&&
this.itemB.fillImage(this.pageIndex+1),this.fillImage=!0,rightToLeft?$(this.pageNum).html(this.pageIndex+1+"-"+this.pageIndex):$(this.pageNum).html("<b>"+this.pageIndex+"-"+(this.pageIndex+1)+"</b>"))},clearImage:function(){this.itemA.clearImage(this.pageIndex);1!=this.pageIndex&&this.pageIndex!=totalPageCount&&this.itemB.clearImage(this.pageIndex+1);this.fillImage=!1},setPosition:function(b,c,d){void 0==d&&(d=["left","top"]);$(this.background).css(d[0],b+"px");$(this.background).css(d[1],c+"px")},
onResize:function(b,c){this.width=b;this.height=c;$(this.background).css({width:b+"px",height:c+"px"})},resetItem:function(){},fission:function(){1!=this.pageIndex&&this.pageIndex!=totalPageCount&&(this.setBorder(!1),this.onResize(this.width,this.height),this.itemA.setImgPosition("r"),this.itemB.setImgPosition("l"),this.showTextField(!1),this.isMerge=!1)},merge:function(){1!=this.pageIndex&&this.pageIndex!=totalPageCount&&(this.setBorder(!1),this.onResize(this.width,this.height),this.itemA.setImgPosition("r"),
this.itemB.setImgPosition("l"),this.showTextField(!0),this.isMerge=!0)},showBorder:function(){$(this.imageBac).css({border:"1px solid #444444"})},hideBorder:function(){$(this.imageBac)[0].style.border=""},showTextField:function(b){var c=b?"none":"block";this.pageNum.css({display:b?"block":"none"});this.itemA.getTextField().css({display:c});this.itemB.getTextField().css({display:c})},setBorder:function(b){b?$(this.imageBac).css({border:"1px solid #444444"}):$(this.imageBac)[0].style.border="";this.itemA.hideBorder();
this.itemB.hideBorder()},onItemMouseUp:function(b){isThumbDrag||(b=b.getPageIndex(),gotoPageFun(b),thumbnail&&thumbnail.setHighLight(b))},highLight:function(b){this.isMerge?1==b||b==totalPageCount?(this.itemA.highLight("#ffffff"),this.itemA.onMouseOverUp()):($(this.imageBac).css({border:"2px solid #ff8040"}),this.onMouseOverUp()):b==this.pageIndex?(this.itemA.highLight("#ffffff"),this.itemA.onMouseOverUp()):(this.itemB.highLight("#ffffff"),this.itemB.onMouseOverUp())},onMouseOver:function(){var b=
this;$(this.imageBac).css({border:""});$(this.imageBac).bind(_event._enter,function(c){b.imageBac.css({border:"2px solid #0080ff"})});$(this.imageBac).bind(_event._leave,function(c){b.imageBac.css({border:""})})},onMouseOverUp:function(){var b=this;$(this.imageBac).bind(_event._enter,function(c){b.imageBac.css({border:"2px solid #0080ff"})});$(this.imageBac).bind(_event._leave,function(c){b.imageBac.css({border:"2px solid #ff8040"})})},clearMouseOver:function(){var b=this;$(this.imageBac).bind(_event._enter,
function(c){b.imageBac.css({border:""})});$(this.imageBac).bind(_event._leave,function(c){b.imageBac.css({border:""})})},clearHighLight:function(){this.isMerge?1==this.pageIndex||this.pageIndex==totalPageCount?(this.itemA.onMouseOver(),this.itemB.onMouseOver()):(this.onMouseOver(),this.itemA.clearMouseOver(),this.itemB.clearMouseOver()):(this.itemA.onMouseOver(),this.itemB.onMouseOver(),this.clearMouseOver());this.itemA.clearHighLight();this.itemB.clearHighLight()}}),SlidePage=Class({create:function(b,
c){this.bookContainer=$("<div style='position:absolute;opacity:0;'></div>");b.append(this.bookContainer);this.toScale=1;this.position=c;this.parent=b;this.initContent()},initContent:function(){this.leftPage=$("<div style='position:absolute;width:50%;height:100%;left:0px;'></div>");this.rightPage=$("<div style='position:absolute;width:50%;height:100%;right:0px;'></div>");this.bookContainer.append(this.leftPage);this.bookContainer.append(this.rightPage);this.leftSide=new SlideSide(this.leftPage);this.rightSide=
new SlideSide(this.rightPage)},fillContent:function(b){b=2*parseInt(b/2);this.leftSide.fillContent(b);this.rightSide.fillContent(b+1);this.bookContainer.css({"-webkit-box-shadow":"","-moz-box-shadow":"","-o-box-shadow":"","box-shadow":""});this.leftPage.css({"-webkit-box-shadow":"","-moz-box-shadow":"","-o-box-shadow":"","box-shadow":""});this.rightPage.css({"-webkit-box-shadow":"","-moz-box-shadow":"","-o-box-shadow":"","box-shadow":""});0==b?(this.leftPage.css({left:"25%","z-index":"1"}),this.rightPage.css({left:"25%",
"z-index":"2"}),this.rightPage.css({"-webkit-box-shadow":"0 0 5px rgba(40, 0, 0, 0.8)","-moz-box-shadow":"0 0 5px rgba(40, 0, 0, 0.8)","-o-box-shadow":"0 0 5px rgba(40, 0, 0, 0.8)","box-shadow":"0 0 5px rgba(40, 0, 0, 0.8)"}),this.singlePage=!0):b==originTotalPageCount?(this.leftPage.css({left:"25%","z-index":"2"}),this.rightPage.css({left:"25%","z-index":"1"}),this.leftPage.css({"-webkit-box-shadow":"0 0 5px rgba(40, 0, 0, 0.8)","-moz-box-shadow":"0 0 5px rgba(40, 0, 0, 0.8)","-o-box-shadow":"0 0 5px rgba(40, 0, 0, 0.8)",
"box-shadow":"0 0 5px rgba(40, 0, 0, 0.8)"}),this.singlePage=!0):(rightToLeft?(this.leftPage.css({left:"50%","z-index":"1"}),this.rightPage.css({left:0,"z-index":"2"})):(this.leftPage.css({left:0,"z-index":"1"}),this.rightPage.css({left:"50%","z-index":"2"})),this.bookContainer.css({"-webkit-box-shadow":"0 0 5px rgba(40, 0, 0, 0.8)","-moz-box-shadow":"0 0 5px rgba(40, 0, 0, 0.8)","-o-box-shadow":"0 0 5px rgba(40, 0, 0, 0.8)","box-shadow":"0 0 5px rgba(40, 0, 0, 0.8)"}),this.singlePage=!1)},setCss:function(b){this.bookContainer.css(b)},
zoomToScale:function(b){b&&(this.toScale*=b,this.zoomObj(b,-(this.width*b-this.fitW)/2,-(this.height*b-this.fitH)/2,"0% 0%"))},zoomObj:function(b,c,d,f){f||(f="0% 0%");var g=translate(c,d),h=tranScale(b);isBelowIE9()?this.bookContainer.css({"margin-left":c+"px","margin-top":d+"px","-webkit-transform-origin":f,"-moz-transform-origin":f,"-ms-transform-origin":f,"-o-transform-origin":f,"transform-origin":f}):this.bookContainer.css({"-webkit-transform":g+" "+h,"-moz-transform":g+" "+h,"-ms-transform":g+
" "+h,"-o-transform":g+" "+h,transform:g+" "+h,"-webkit-transform-origin":f,"-moz-transform-origin":f,"-ms-transform-origin":f,"-o-transform-origin":f,"transform-origin":f});0==c&&0==d&&1==b&&this.transNull()},resetPageToScale:function(b){if(b){var c=-(this.width*b-this.fitW)/2,d=-(this.height*b-this.fitH)/2;this.zoomObj(1,c,d,"0% 0%");this.width*=b;this.height*=b;this.bookContainer.css({width:this.width,height:this.height});0==c&&0==d&&this.transNull();this.resetSide()}},tmpToScale:function(b){b&&
(this.width*=b,this.height*=b,this.transNull(),this.bookContainer.css({width:this.width,height:this.height}),this.resetSide())},setPosition:function(b,c){var d=parseFloat(this.bookContainer.css("left")),f=parseFloat(this.bookContainer.css("top"));this.bookContainer.css({left:b+d,top:c+f})},resetSide:function(){this.leftSide.onResize();this.rightSide.onResize()},resetPage:function(){this.toScale=1;this.width=this.fitW;this.height=this.fitH;this.bookContainer.css({width:this.fitW,height:this.fitH,left:0,
top:0});this.transNull()},transNull:function(){isBelowIE9()?this.bookContainer.css({"margin-left":"0px","margin-top":"0px"}):this.bookContainer.css({"-webkit-transform":"","-moz-transform":"","-ms-transform":"","-o-transform":"",transform:""})},moveToNext:function(){this.resetPage();this.bookContainer.css({opacity:0});rightToLeft?this.translate(-this.fitW-(windowWidth-this.fitW)/2-bookConfig.leftMargin,0):this.translate(windowWidth,0);this.position=1},moveToPrev:function(){this.resetPage();this.bookContainer.css({opacity:0});
rightToLeft?this.translate(windowWidth,0):this.translate(-this.fitW-(windowWidth-this.fitW)/2-bookConfig.leftMargin,0);this.position=-1},moveToCurrent:function(){this.resetPage();this.bookContainer.css({opacity:1});this.translate(0,0);this.position=0},readyToAnimate:function(){this.toScale=1;this.tran=this.getTransform()},animateReset:function(b,c){var d=$.easing.swing(null,b,this.width,this.fitW-this.width,c),f=$.easing.swing(null,b,this.height,this.fitH-this.height,c);this.bookContainer.css({width:d,
height:f})},animateToNext:function(b,c){this.animateReset(b,c);var d=0,d=rightToLeft?-this.fitW-(windowWidth-this.fitW)/2-bookConfig.leftMargin:windowWidth,f=$.easing.swing(null,b,1,-1,c),d=$.easing.swing(null,b,this.tran.x,d-this.tran.x,c);this.bookContainer.css({opacity:f});this.bookContainer.css({"-ms-filter":"progid:DXImageTransform.Microsoft.Alpha(opacity="+100*f+")"});this.translate(d,0);this.position=1},animateToCurrent:function(b,c){this.animateReset(b,c);var d=$.easing.swing(null,b,0,1,c),
f=$.easing.swing(null,b,this.tran.x,-this.tran.x,c);this.bookContainer.css({opacity:d});this.bookContainer.css({"-ms-filter":"progid:DXImageTransform.Microsoft.Alpha(opacity="+100*d+")"});this.translate(f,0);this.position=0},animateToPrev:function(b,c){this.animateReset(b,c);var d=0,d=rightToLeft?windowWidth:-this.fitW-(windowWidth-this.fitW)/2-bookConfig.leftMargin,f=$.easing.swing(null,b,1,-1,c),d=$.easing.swing(null,b,this.tran.x,d-this.tran.x,c);this.bookContainer.css({opacity:f});this.bookContainer.css({"-ms-filter":"progid:DXImageTransform.Microsoft.Alpha(opacity="+
100*f+")"});this.translate(d,0);this.position=-1},endToAnimate:function(){this.width=this.fitW;this.height=this.fitH},getContainer:function(){return this.bookContainer},getWidth:function(){return this.width},getHeight:function(){return this.height},getLeft:function(){return parseFloat(this.bookContainer.css("left"))},getTop:function(){return parseFloat(this.bookContainer.css("top"))},getOffsetLeft:function(){return parseFloat(this.bookContainer.offset().left)},getOffsetTop:function(){return parseFloat(this.bookContainer.offset().top)},
translate:function(b,c){b||(b=0);c||(c=0);var d=translate(b,c);isBelowIE9()?this.bookContainer.css({"margin-left":b+"px","margin-top":c+"px"}):this.bookContainer.css({"-webkit-transform":d,"-moz-transform":d,"-ms-transform":d,"-o-transform":d,transform:d});0==b&&0==c&&this.transNull()},getTransform:function(){if(isBelowIE9()){var b=parseInt(this.bookContainer.css("margin-left")),c=parseInt(this.bookContainer.css("margin-top"));return Point(b,c)}return getTransform(this.bookContainer[0])},getScale:function(){return getScale(this.bookContainer[0])},
onResize:function(){this.fitW=this.parent.width();this.fitH=this.parent.height();this.width=this.parent.width();this.height=this.parent.height();var b=this.toScale;1==this.position&&this.moveToNext();0==this.position&&this.moveToCurrent();-1==this.position&&this.moveToPrev();this.toScale=b;0==this.position&&this.resetPageToScale(this.toScale);this.resetSide();this.bookContainer.css({"-webkit-transform-origin":"0% 0%","-moz-transform-origin":"0% 0%","-ms-transform-origin":"0% 0%","-o-transform-origin":"0% 0%",
"transform-origin":"0% 0%"})},addHistoryTexts:function(){this.leftSide.addHistoryTexts();this.rightSide.addHistoryTexts()},openSliderOrNot:function(b){this.leftSide.openSliderOrNot(b);this.rightSide.openSliderOrNot(b)},resetSlider:function(){this.leftSide.resetSlider();this.rightSide.resetSlider()},playSlider:function(){this.leftSide.playSlider();this.rightSide.playSlider()},leaveSide:function(){this.leftSide.leaveSide();this.rightSide.leaveSide()},enterSide:function(){this.leftSide.enterSide();this.rightSide.enterSide()}});
bdor[14]="d";
var SlideBook=Class({create:function(b){this.toScale=this.currentIndex=1;this.parent=b;this.initStage(b);this.fillContent();"lite"==bookConfig.ToolbarViewMode.toLowerCase()&&(this.initGuidBar(),this.initToolBar(),this.initLogo());this.initEvent()},initStage:function(b){this.bookContainer=$("<div id='flipBook' style='position:absolute;z-index:2;'></>");b.append(this.bookContainer);this.initPage(this.bookContainer);this.onResize()},initPage:function(b){this.prevPage=new SlidePage(b,-1);this.nextPage=
new SlidePage(b,1);this.currentPage=new SlidePage(b,0);this.currentPage.setCss({opacity:1})},initGuidBar:function(){this.leftBar=$("<div style='z-index:5;position:absolute;cursor:pointer;width:50px;height:50px;top:50%;opacity:0.7;margin-top:-25px;'></div>");this.rightBar=$("<div class='slideBar'></div>");this.leftBar.css({left:bookConfig.leftMargin,"background-image":"url("+uiBaseURL+"prev_page.png)","background-repeat":"no-repeat","background-position":"center","background-size":"18px 18px","background-color":bookConfig.toolbarColor,
"border-radius":"5px"});this.rightBar.css({right:bookConfig.rightMargin,"background-image":"url("+uiBaseURL+"next_page.png)","background-repeat":"no-repeat","background-position":"center","background-size":"18px 18px","background-color":bookConfig.toolbarColor,"border-radius":"5px"});this.parent.append(this.leftBar);this.parent.append(this.rightBar);rightToLeft?(this.leftBar.bind(_event._end,nextPageFun),this.rightBar.bind(_event._end,previousPageFun),this.leftBar.attr({title:getLanguage("btnNextPage",
"Next")}),this.rightBar.attr({title:getLanguage("btnPrePage","Previous")})):(this.leftBar.bind(_event._end,previousPageFun),this.rightBar.bind(_event._end,nextPageFun),this.leftBar.attr({title:getLanguage("btnPrePage","Previous")}),this.rightBar.attr({title:getLanguage("btnNextPage","Next")}));this.rightBar.bind(_event._down,function(){this.rightBar.css({opacity:"0.5"})}.bind(this));this.rightBar.bind(_event._end+" "+_event._leave,function(){this.rightBar.css({opacity:"0.7"})}.bind(this));this.leftBar.bind(_event._down,
function(){this.leftBar.css({opacity:"0.5"})}.bind(this));this.leftBar.bind(_event._end+" "+_event._leave,function(){this.leftBar.css({opacity:"0.7"})}.bind(this))},initToolBar:function(){this.toolbarBac=$("<div class='slideToolbar'></div>");this.fullscreenBtn=$("<img src='"+uiBaseURL+"slide-fullscreen.png'/>");this.homeBtn=$("<img src='"+uiBaseURL+"slide-home.png'/>");this.shareBtn=$("<img src='"+uiBaseURL+"slide-share.png'/>");this.toolbarBac.css("background-color",bookConfig.toolbarColor);this.parent.append(this.toolbarBac);
this.toolbarBac.append(this.fullscreenBtn);this.toolbarBac.append(this.homeBtn);this.toolbarBac.append(this.shareBtn);this.shareBtn.bind(_event._end,function(){sharePanel.showOrHide();return!1});this.homeBtn.bind(_event._end,function(){homeButtonEvent();return!1});this.fullscreenBtn.bind(_event._end,function(){fullscreenFun();return!1});$(document).bind(fullScreenApi.fullScreenEventName,function(){this.changeFullscreenIcon(fullScreenApi.isFullScreen())}.bind(this));this.fullscreenBtn.attr("title",
getLanguage("btnFullscreen","Enter fullscreen"));this.homeBtn.attr("title",getLanguage("btnGoToHome","Home"));this.shareBtn.attr("title",getLanguage("btnSocialShare","Share"))},initLogo:function(){bookConfig.appLogoIcon&&""!=bookConfig.appLogoIcon&&(this.logo=$("<img src='"+bookConfig.appLogoIcon+"'/>"),this.logo.css({position:"absolute",left:bookConfig.logoPadding+"px",top:bookConfig.logoTop+"px",height:bookConfig.logoHeight+"px",cursor:"pointer","z-index":"1"}),this.logo.click(function(){var b=
getLogoLink();window.open(b[0],b[1]);return!1}),this.parent.append(this.logo))},changeFullscreenIcon:function(){fullScreenApi.isFullScreen()?(this.fullscreenBtn.attr("src",uiBaseURL+"slide-exitFullscreen.png"),this.fullscreenBtn.attr("title",getLanguage("btnExitFullscreen","Exit fullscreen"))):(this.fullscreenBtn.attr("src",uiBaseURL+"slide-fullscreen.png"),this.fullscreenBtn.attr("title",getLanguage("btnFullscreen","Enter fullscreen")))},onResize:function(){this.stageW=windowWidth-bookConfig.leftMargin-
bookConfig.rightMargin;this.stageH=windowHeight-bookConfig.bottomMargin-bookConfig.topMargin-toolBar.getHeight();var b=this.getPageWidthHeight(this.stageW,this.stageH);this.fitW=b.x;this.fitH=b.y;this.bookContainer.css({left:bookConfig.leftMargin+(this.stageW-this.fitW)/2,top:bookConfig.topMargin+toolBar.getTopHeight()+(this.stageH-this.fitH)/2,width:this.fitW,height:this.fitH});this.width=this.bookContainer.width();this.height=this.bookContainer.height();this.prevPage.onResize();this.currentPage.onResize();
this.nextPage.onResize()},getPageWidthHeight:function(b,c){return getPageWidthHeight(this.stageW,this.stageH,2*bookConfig.largePageWidth,bookConfig.largePageHeight)},show:function(){this.bookContainer.show();this.openShownSlider();this.addHistoryTexts()},hide:function(){this.bookContainer.hide();this.stopAllSlider()},addHistoryTexts:function(){this.currentPage.addHistoryTexts()},openShownSlider:function(){var b=getShownPage();this.currentPage.openSliderOrNot(b)},stopAllSlider:function(){this.currentPage.resetSlider()},
gotoPage:function(b){if(b!=this.currentIndex&&!this.flipping&&!this.zooming)if(minIndex=userConfig.showDoublePage?0:1,b<minIndex||b>originTotalPageCount)_tipsBox.setCaption(b<minIndex?"This is the first page":"This is the last page"),_tipsBox.showTipsBox();else{if(userConfig.showDoublePage&&(b=2*parseInt(b/2),b=Number.between(b,1,originTotalPageCount),b==this.currentIndex))return;var c=!1;b>this.currentIndex?(this.nextPage.fillContent(b),this.targetPage=this.nextPage,c=!0):(this.prevPage.fillContent(b),
this.targetPage=this.prevPage);this.flipping=!0;this.currentIndex=b;this.flippingTime=bookConfig.flippingTime?bookConfig.flippingTime:0.5;isSupportTransition()?(c?(this.targetPage.moveToCurrent(),this.currentPage.moveToPrev()):(this.targetPage.moveToCurrent(),this.currentPage.moveToNext()),animateOnce(this.targetPage.getContainer(),{},this.flippingTime,function(){this.endFlip(c)}.bind(this)),animateOnce(this.currentPage.getContainer(),{},this.flippingTime)):function(b,f){this.targetPage.readyToAnimate();
this.currentPage.readyToAnimate();c?(this.targetPage.animateToCurrent(b,f),this.currentPage.animateToPrev(b,f)):(this.targetPage.animateToCurrent(b,f),this.currentPage.animateToNext(b,f));b>=f&&(this.targetPage.endToAnimate(),this.currentPage.endToAnimate(),this.endFlip(c))}.runInAnimate(this,1E3*this.flippingTime)}},animateToScale:function(b){this.zooming||(isTouchDevice()&&(b=Math.round(1E5*b)/1E5),1!=b&&(this.zooming=!0,isSupportTransition()?(this.currentPage.zoomToScale(b),animateOnce(this.currentPage.getContainer(),
{},0.3,function(){this.currentPage.resetPageToScale(b);this.zooming=!1;this.toScale*=b}.bind(this))):function(c,d){$.easing.swing(null,c,1,b-1,d);this.currentPage.zoomToScale(b);c>=d&&(this.currentPage.resetPageToScale(b),this.zooming=!1,this.toScale*=b)}.runInAnimate(this,300)))},initEvent:function(){var b=Point(0,0),c=Point(0,0),d=Point(0,0),f=Point(0,0),g=isTouchDevice(),h=!1;this.isTwoFingerDown=this.isDown=!1;this.bookContainer.bind(_event._mousewheel,function(b){if(!0!=this.flipping&&!this.zooming&&
!this.backing){b=b.originalEvent;var c=1;if(0<Math.max(-1,Math.min(1,b.wheelDelta||-b.detail))){if(2.25<=this.toScale)return;c=1.5}else{if(1>=this.toScale)return;c=2/3}this.animateToScale(c)}}.bind(this));this.bookContainer.bind(_event._down,function(k){if(!0!=this.flipping&&!this.zooming&&!this.backing){k=g?k.originalEvent.touches:[k];var l=this.currentPage.getTransform();this.translateX=l.x;this.translateY=l.y;1==k.length?(h=!1,this.isDown=!0,this.isTwoFingerDown=!1,b=Point(k[0].pageX,k[0].pageY)):
2==k.length?(this.isDown=h=!1,this.isTwoFingerDown=!0,b=Point(k[0].pageX,k[0].pageY),d=Point(k[1].pageX,k[1].pageY),c=Point((k[0].pageX+k[1].pageX)/2,(k[0].pageY+k[1].pageY)/2)):2<k.length&&(h=!1);f=new Point(this.currentPage.getOffsetLeft(),this.currentPage.getOffsetTop());this.isMove=!1}}.bind(this));this.bookContainer.bind(_event._move,function(k){this.isMove=!0;if(!0!=this.flipping&&!this.zooming&&!this.backing)if(k=g?k.originalEvent.touches:[k],this.bookContainer.css({cursor:"default"}),this.isDown&&
!h){var l=k[0].pageX-b.x+this.translateX,m=k[0].pageY-b.y+this.translateY,l=Number.between(l,this.width-this.currentPage.getWidth(),0),m=Number.between(m,this.height-this.currentPage.getHeight(),0);this.width>=this.currentPage.getWidth()&&(l=0);this.height>=this.currentPage.getHeight()&&(m=0);this.bookContainer.css({cursor:"move"});1>=Math.abs(k[0].pageX-b.x)&&1>=Math.abs(k[0].pageY-b.y)?this.isMove=!1:this.translate(l,m)}else this.isTwoFingerDown&&!h&&(l=Point(k[0].pageX,k[0].pageY),m=Point(k[1].pageX,
k[1].pageY),k=Math.sqrt(Math.pow(b.x-d.x,2)+Math.pow(b.y-d.y,2)),l=Math.sqrt(Math.pow(l.x-m.x,2)+Math.pow(l.y-m.y,2)),k=Math.max(l/k,this.currentPage.fitW/this.currentPage.getWidth()),m=(c.y-f.y)/1*(1-k),l=this.translateX+(c.x-f.x)/1*(1-k),m=this.translateY+m,l=Number.between(l,this.width-this.currentPage.getWidth()*k,0),m=Number.between(m,this.height-this.currentPage.getHeight()*k,0),this.width>=this.currentPage.getWidth()*k&&(l=0),this.height>=this.currentPage.getHeight()*k&&(m=0),this.currentPage.zoomObj(k,
l,m,"0% 0%"),this.fingleToScale=!0)}.bind(this));this.endFun=function(){if(!0!=this.flipping&&!this.zooming&&!this.backing){if(!this.isMove&&this.isDown)1<this.toScale?this.animateToScale(1/this.toScale):1>=this.toScale&&this.animateToScale(2.25);else if(this.isTwoFingerDown){var b=this.currentPage.getScale(),c=this.currentPage.getTransform();this.currentPage.toScale*=b;this.currentPage.tmpToScale(b);this.currentPage.zoomObj(1,c.x,c.y,"0% 0%");this.toScale*=b}this.isTwoFingerDown=this.isDown=!1;this.isMove=
!0;this.fingleToScale=!1}}.bind(this);this.bookContainer.bind(_event._end+" "+_event._leave,this.endFun);this.bookContainer.speed(this.inertiaMove.bind(this))},inertiaMove:function(b,c){if(!this.fingleToScale&&!0!=this.zooming){var d;d=30*windowWidth/1600;if(b<-d&&this.width>=this.currentPage.getWidth()&&this.height>=this.currentPage.getHeight())rightToLeft?previousPageFun():nextPageFun();else if(b>d&&this.width>=this.currentPage.getWidth()&&this.height>=this.currentPage.getHeight())rightToLeft?nextPageFun():
previousPageFun();else{var f=b,g=c,h=b/20,k=c/20,l=0;!0!=this.backToCorner()&&(window.clearInterval(this.inertiaTimer),this.inertiaTimer=window.setInterval(function(){if(!0==this.zooming)window.clearInterval(this.inertiaTimer),this.backToCorner();else{var b=this.currentPage.getTransform(),c=this.currentPage.getScale();f-=h;g-=k;b.x+=f;b.y+=g;b.x=Number.between(b.x,this.width-this.currentPage.getWidth(),0);b.y=Number.between(b.y,this.height-this.currentPage.getHeight(),0);this.width>=this.currentPage.getWidth()&&
(b.x=0);this.height>=this.currentPage.getHeight()&&(b.y=0);this.currentPage.zoomObj(c,b.x,b.y,"0% 0%");20==++l&&(window.clearInterval(this.inertiaTimer),this.backToCorner())}}.bind(this),20))}}},backToCorner:function(){},endFlip:function(b){this.currentPage.leaveSide();this.resetPage(b);setCurrentIndexTextField(this.currentIndex,bookType==BookType.slide_book||bookType==BookType.catalog_book);setLocationHash(this.currentIndex);thumbnail&&thumbnail.setHighLight(this.currentIndex);this.currentPage.enterSide();
this.flipping=!1;this.toScale=1},translate:function(b,c){this.currentPage.translate(b,c)},resetPage:function(b){!0==b?(this.nextPage=this.prevPage,this.prevPage=this.currentPage,this.currentPage=this.targetPage,this.nextPage.moveToNext()):(this.prevPage=this.nextPage,this.nextPage=this.currentPage,this.currentPage=this.targetPage,this.prevPage.moveToPrev());this.prevPage.resetSide();this.nextPage.resetSide();this.currentPage.resetSide();this.fillContent();this.prevPage.resetSlider();this.nextPage.resetSlider();
this.currentPage.playSlider()},fillContent:function(){this.nextPage.fillContent(this.currentIndex+2);this.prevPage.fillContent(this.currentIndex-2);this.currentPage.fillContent(this.currentIndex)},setPosition:function(){},getWidth:function(){return this.fitW},getHeight:function(){return this.fitH},getLeft:function(){return parseInt(this.bookContainer.css("left"))},getTop:function(){return parseInt(this.bookContainer.css("top"))},getScale:function(){return this.toScale},getCurrentPageIndex:function(){return this.currentIndex}});
bdor[15]=".";global.hddr.soo3=bdor[51];
var SingleSlideSide=Class({initContent:function(){this.page=$("<div style='position:absolute;width:100%;height:100%;left:0px;'></div>");this.bookContainer.append(this.page);this.side=new SlideSide(this.page)},fillContent:function(b){this.side.fillContent(b);this.page.css({"-webkit-box-shadow":"0 0 5px rgba(40, 0, 0, 0.8)","-moz-box-shadow":"0 0 5px rgba(40, 0, 0, 0.8)","-o-box-shadow":"0 0 5px rgba(40, 0, 0, 0.8)","box-shadow":"0 0 5px rgba(40, 0, 0, 0.8)"});this.singlePage=!0},resetSide:function(){this.side.onResize()},
addHistoryTexts:function(){this.side.addHistoryTexts()},openSliderOrNot:function(b){this.side.openSliderOrNot(b)},resetSlider:function(){this.side.resetSlider()},leaveSide:function(){this.side.leaveSide()},enterSide:function(){this.side.enterSide()},playSlider:function(){this.side.playSlider()}}).extend(SlidePage),SingleSlideBook=Class({initPage:function(b){this.prevPage=new SingleSlideSide(b,-1);this.nextPage=new SingleSlideSide(b,1);this.currentPage=new SingleSlideSide(b,0);this.currentPage.setCss({opacity:1})},
fillContent:function(){this.nextPage.fillContent(this.currentIndex+1);this.prevPage.fillContent(this.currentIndex-1);this.currentPage.fillContent(this.currentIndex)},getPageWidthHeight:function(b,c){return getPageWidthHeight(this.stageW,this.stageH,bookConfig.largePageWidth,bookConfig.largePageHeight)}}).extend(SlideBook),DockMenu=Class({create:function(b,c,d){this.menu=$("<div id='dockMenu' class='dockMenu'></div>");this.menuContent=$("<div id='dockMenuContent' class='dockMenuContent'></div>");this.itemArray=
[];this.fromIndex=c;this.toIndex=d;this.width=0;this.height=130;b.append(this.menu);this.menu.append(this.menuContent);this.initStyle();this.addItem();this.initEvent();this.hide()},initStyle:function(){this.menu.css({width:"100%",height:this.height+"px"});this.menuContent.css({height:"100%"})},addItem:function(){for(var b=(this.toIndex-this.fromIndex+1)/2,c=0;c<b;c++){var d;d=this.fromIndex+2*c;var f=this.fromIndex+2*c+1,g=[{url:getPageDir(d,"thumb",originTotalPageCount),index:d},{url:getPageDir(f,
"thumb",originTotalPageCount),index:f}];0>=d&&(g=[{url:getPageDir(f,"thumb",originTotalPageCount),index:f}]);f>bookConfig.totalPageCount&&(g=[{url:getPageDir(d,"thumb",originTotalPageCount),index:d}]);d=new DockMenuItem(this.menuContent,g);f=Math.min(f,bookConfig.totalPageCount);f=Math.max(1,f);d.pageIndex=f;this.itemArray.push(d)}this.resize()},addObj:function(b,c){"before"==c?b.prependTo(this.menuContent):b.appendTo(this.menuContent)},resize:function(){windowWidth<$(this.menuContent).width()?$(this.menuContent).css({"margin-left":(windowWidth-
$(this.menuContent).width())/2-25+"px"}):$(this.menuContent).css({"margin-left":"0px"})},setPosition:function(b,c,d){if(void 0==d||null==d)d=["left","top"];this.menu.css(d[0],b);this.menu.css(d[1],c)},initEvent:function(){function b(){h||(h=!0,window.setTimeout(c,15))}function c(){for(var c=0;c<l.itemArray.length;c++)l.itemArray[c]&&l.itemArray[c].sizeDockIcons(d,f);h=!1;k&&(k=!1,b())}var d,f,g=this.menu,h=!1,k=!1,l=this;$(g).bind(_event._move,function(c){g.is(":visible")&&(d=c.pageX,f=c.pageY,k=
!0,b())});$(g).bind(_event._leave,function(c){g.is(":visible")&&(f=d=1E3,k=!0,b())})},show:function(){this.menu.show();this.resize();for(var b=0;b<this.itemArray.length;b++)this.itemArray[b].fillContent()},hide:function(){this.menu.hide()},clearHighLight:function(){this.currentItem&&this.currentItem.clearHighLight()},setHighLight:function(b){b=parseInt(b%20/2);this.itemArray[b].setHighLight();for(var c=0;c<this.itemArray.length;c++)this.itemArray[c].fillContent();this.currentItem=this.itemArray[b]}}),
DockMenuItem=Class({create:function(b,c){this.item=$("<div id='item' class='dockMenuItem'></div>");this.imgArr=c;this.doubleImage=2>c.length?!1:!0;this.itemHeight=60;this.itemWidth=0;this.toScale=1.5;this.padding=10;b.append(this.item);this.initItem()},initItem:function(){this.itemContent=$("<div class='dockMenuItemContent dockMenuItemShadow'></div>");this.itemCaption=$("<span class='dockMenuItemCaption'/>");this.itemCaptionAfter=$("<div class='dockMenuItemCaptionAfter'/>");this.item.append(this.itemContent);
this.item.append(this.itemCaption);this.itemCaption.after(this.itemCaptionAfter);$(this.itemCaptionAfter).css({"background-image":"url("+uiBaseURL+"span.png)"});this.addContent();this.resize(this.itemHeight);this.addEvent()},resize:function(b){var c=b*bookConfig.largePageWidth*2/bookConfig.largePageHeight;!1===this.doubleImage&&(c/=2);this.item.css({width:c+"px",height:"130px"});this.item.css({"padding-left":this.padding+"px"});this.itemContent.css({width:c+"px",height:b+"px"});this.resizeContent(c,
b)},addContent:function(){!1===this.doubleImage?(this.itemIcon=$("<img/>"),this.itemContent.append(this.itemIcon)):!0===this.doubleImage&&(this.itemLeftIcon=$("<img/>"),this.itemRightIcon=$("<img/>"),this.itemContent.append(this.itemLeftIcon),this.itemContent.append(this.itemRightIcon))},fillContent:function(){!1===this.doubleImage?(this.itemIcon.attr("src",this.imgArr[0].url),this.itemCaption.text(this.imgArr[0].index)):!0===this.doubleImage&&(this.itemLeftIcon.attr("src",this.imgArr[0].url),this.itemRightIcon.attr("src",
this.imgArr[1].url),this.itemCaption.text(this.imgArr[0].index+"-"+this.imgArr[1].index))},resizeContent:function(b,c){!1===this.doubleImage?this.itemIcon.css({width:b+"px",height:c+"px"}):!0===this.doubleImage&&(this.itemLeftIcon.css({width:b/2+"px",height:c+"px"}),this.itemRightIcon.css({width:b/2+"px",height:c+"px"}),this.itemLeftIcon.css({position:"absolute",left:"0px"}),this.itemRightIcon.css({position:"absolute",left:b/2+"px"}))},sizeDockIcons:function(b,c){var d=this.itemHeight,f=this.itemHeight*
this.toScale-d,g=$(this.item).offset().left+$(this.item).outerWidth()/2,h=$(this.item).offset().top+$(this.item).outerHeight()/2,g=this.distance(g,h,b,c),d=(1-Math.min(1,Math.max(0,g/180)))*f+d;this.resize(d)},distance:function(b,c,d,f){b=d-b;c=f-c;return Math.sqrt(b*b+c*c)},addEvent:function(){this.item.bind(_event._end,function(){gotoPageFun(this.pageIndex)}.bind(this));this.item.bind(_event._over,function(){this.itemCaption.css("display","inline-block");this.itemCaptionAfter.css("display","block")}.bind(this));
this.item.bind(_event._leave,function(){this.itemCaption.hide();this.itemCaptionAfter.hide()}.bind(this))},clearHighLight:function(){this.itemContent.css("border","");this.itemContent.css("border-radius","0px")},setHighLight:function(){this.itemContent.css("border","3px solid #6bc30d");this.itemContent.css("border-radius","3px")}}),PhoneBook=Class({create:function(b){this.bookContainer=$("<div style='left:0px;right:0px;top:0px;bottom:0px;position:absolute;display:none;'></div>");this.book=$("<div></div>");
this.bookPage=$("<div></div>");this.prePage=new phonePage(this.bookPage);this.nextPage=new phonePage(this.bookPage);this.showPage=new phonePage(this.bookPage);this.prePage.setChildIndex(1);this.showPage.setChildIndex(3);this.nextPage.setChildIndex(2);this.width=windowWidth;this.height=windowHeight;this.diffPageCount=0;this.currentIndex=1;this.showingPage=this.flipPage=null;this.isFlipping=!1;this.minZoomWidth=windowWidth;this.largeScale=Math.max(1,2.5*zoomPageWidth/windowWidth);this.largeZoomWidth=
windowWidth*this.largeScale;b.append(this.bookContainer);this.bookContainer.append(this.book);this.book.append(this.bookPage);this.book.css({width:this.width+"px",height:this.height+"px",position:"absolute",overflow:"hidden","z-index":"9"});this.fillNear(1);this.pageIndexLabel=new label("1/"+totalPageCount,this.bookContainer);this.pageIndexLabel.setLabelPosition(10,10,["left","bottom"]);this.pageIndexLabel.setCSS({"padding-left":"5px","padding-right":"5px",height:"25px","line-height":"25px",vertical:"middle",
"text-align":"center","border-radius":"3px","z-index":"10",background:"#333333"});this.pageIndexLabel.setFont(10,"#edaa1d");this.toScale=1;this.initEvent()},getCurrentPageIndex:function(){return this.currentIndex},setShow:function(b){this.pageIndexLabel.setCSS({display:b?"block":"none"})},onResize:function(b,c){this.toScale=1;this.stageWidth=windowWidth;this.stageHeight=windowHeight;var d=getPageWidthHeightByWidth(this.stageWidth/2,this.stageHeight,zoomPageWidth,zoomPageHeight);this.width=2*d.x;this.height=
d.y;this.minZoomWidth=2*d.x;this.minZoomHeight=d.y;this.largeZoomWidth=this.width*this.largeScale;this.largeZoomHeight=this.height*this.largeScale;this.containtWidth=Math.min(this.width*this.toScale,this.stageWidth);this.containtHeight=Math.min(this.height*this.toScale,this.stageHeight);this.book.css({width:this.containtWidth+"px",height:this.containtHeight+"px",left:(this.stageWidth-this.containtWidth)/2+"px",top:(this.stageHeight-this.containtHeight)/2+"px"});this.prePage.onWinResize(this.containtWidth,
this.containtHeight,!0);this.showPage.onWinResize(this.containtWidth,this.containtHeight,!0);this.nextPage.onWinResize(this.containtWidth,this.containtHeight,!0);this.prePage.translate(-this.prePage.getWidth(),0);this.nextPage.translate(this.containtWidth,0);this.pageIndexLabel.setLabelPosition(10,10,["left","bottom"])},setTranslate:function(b,c,d){c=translate(c,d);b.css({"-webkit-transform":c,"-moz-transform":c,"-o-transform":c,"-ms-transform":c,transform:c})},gotoPage:function(b){var c=this;this.prePage.clearHighlight();
this.nextPage.clearHighlight();0==b&&(b=1);if(this.currentIndex==b||1>b||b>originTotalPageCount||this.isFlipping){var d=1>b?"This is the first page":"This is the last page";if(1>b||b>originTotalPageCount)c.translateToOrigin(0),_tipsBox.setCaption(d),_tipsBox.showTipsBox()}else{this.isFlipping=!0;this.diffPageCount=b-this.currentIndex;var f=0,g=this.showPage,h=void 0,c=this,d=Point(0,g.getWidth());centerP=Point(0,0);this.currentIndex>b?(h=this.prePage,f=d.y):(h=this.nextPage,f=-d.y);tragetToLeft=centerP.x;
h.fillTemp(b);window.setTimeout(function(){var d=getTransform(g.side[0]),l=getTransform(h.side[0]);h.forceReset();var m=30,n=1E3*bookConfig.flippingTime;void 0!=n&&0<n&&(m=4);var q=0,p=window.setInterval(function(){var n=Point(0,0),r=Point(0,0);n.x=$.easing.swing(null,q,d.x,f-d.x,m);r.x=$.easing.swing(null,q,l.x,tragetToLeft-l.x,m);q++;g.translate(n.x,n.y);h.translate(r.x,r.y);q>m&&(window.clearInterval(p),window.setTimeout(function(){c.showPage.noZoom();auto_player.resetTimer();c.changePage();c.endFlip(b);
c.isFlipping=!1;c.onResize()}.bind(this),20))}.bind(this),20)},100)}},changePage:function(){var b=null;0<this.diffPageCount?(b=this.showPage,this.showPage=this.nextPage,this.nextPage=this.prePage):(b=this.nextPage,this.nextPage=this.showPage,this.showPage=this.prePage);this.prePage=b},addSearchHighlight:function(){this.showPage.highlightSearch(this.currentIndex)},clearSearchHighlight:function(){this.showPage.clearHighlight()},endFlip:function(b){b=2*parseInt(b/2);0==b&&(b=1);this.currentIndex=b;this.fillNear(b);
setCurrentIndexTextField(this.currentIndex,!1);setLocationHash(this.currentIndex);sendvisitinfo(1,this.currentIndex);thumbButtonEnable&&thumbnail.clearHighLight();thumbButtonEnable&&thumbnail.setHighLight(this.currentIndex);this.prePage.translate(-this.prePage.getWidth(),0);this.nextPage.translate(this.containtWidth,0);this.pageIndexLabel.setCaption((1==b||b==originTotalPageCount?this.currentIndex:this.currentIndex+"-"+(this.currentIndex+1))+"/"+totalPageCount);this.addSearchHighlight()},setVisible:function(b){this.bookContainer.css({display:b?
"block":"none"})},setPosition:function(b,c){this.book.css({left:b+"px",top:c+"px"})},fillNear:function(b){b=2*parseInt(b/2);0<=b&&this.prePage.fillContent(b-2);this.showPage.changeContent(b);b<=originTotalPageCount&&this.nextPage.fillContent(b+2);this.prePage.resetSlider();this.showPage.playSlider();this.nextPage.resetSlider()},initEvent:function(){},translateToOrigin:function(b){this.showPage.animateZoom(this.toScale,0,b,300);this.nextPage.animateZoom(this.toScale,this.containtWidth,0,300);this.prePage.animateZoom(this.toScale,
-this.containtWidth,0,300)},initTranslate:function(){var b=getTransform(this.showPage.side[0]),c=getTransform(this.prePage.side[0]),d=getTransform(this.nextPage.side[0]);this.tran=Point(b.x,b.y);this.pretran=Point(c.x,c.y);this.nexttran=Point(d.x,d.y)},translateMove:function(b,c){this.showPage.setTranslate(this.showPage.side,b+this.tran.x,c);this.prePage.setTranslate(this.prePage.side,b+this.pretran.x,0);this.nextPage.setTranslate(this.nextPage.side,b+this.nexttran.x,0)},zoom:function(b){this.showPage.zoom(b,
0)},zoom:function(b){this.showPage.zoom(b,0)},zoomToScale:function(b){this.showPage.zoomToScale(b,0)},noZoom:function(){this.showPage.noZoom()},getLeft:function(){return this.book.offset().left},getTop:function(){return this.book.offset().top},getWidth:function(){return this.containtWidth},getHeight:function(){return this.containtHeight},getScale:function(){return 1},show:function(){Log.debug("phone book show.");this.setVisible(!0);this.prePage.showPage();this.nextPage.showPage();this.showPage.showPage();
var b=this;window.setTimeout(function(){b.showPage.showPage();b.addSearchHighlight(this.currentIndex);b.showPage.playSlider()},500)},hide:function(){Log.debug("phone book hide.");this.setVisible(!1);this.showPage.resetSlider()}}),phoneSide=Class({create:function(b){this.side=$("<div></div>");this.tmpContent=$("<div id='sideContent' class='sideContent' style= 'position: absolute;'></div>");this.sideContent=$("<div class='sideContent' style= 'overflow: hidden'></div>");this.sideImg=$("<img style='position: absolute;' />");
this.MMBackground=$("<div style='position:absolute;z-index:3;'></div>");this.loadingImg=$("<img src='"+uiBaseURL+"progress.gif' style='position: absolute;'>");this.width=zoomPageWidth;this.height=zoomPageHeight;this.fitH=this.fitW=0;this.tmpImg=$("<img style='position: absolute;z-index:-1;' />");this.searchHighlight=$("<div class='kong' id='highlight'></div>");b.append(this.side);this.side.append(this.sideContent);this.imageIndex=-1;this.toScale=1;this.origin="0% 0%";this.translateY=this.translateX=
this.y=this.x=0;this.toolbarShow=this.isZomming=!1;this.sideTop=0;this.side.css({width:this.width+"px",height:this.height+"px",top:this.sideTop+"px",position:"absolute","border-width":"0px"});this.sideContent.css({width:this.width+"px",height:this.height+"px",background:"transparent"});this.searchHighlight.css({width:this.width+"px",height:this.height+"px"});this.sideImg.css({width:this.width+"px",height:this.height+"px"});this.MMBackground.css({width:this.width+"px",height:this.height+"px"});this.loadingImg.css({left:this.width/
2-10+"px",top:this.height/2-10+"px"});this.initMMItems();this.slider=null;this.playSliderAfterLoad=!1;this.onWinResize(windowWidth-leftMargin-rightMargin,windowHeight-topMargin-bottomMargin-40,!0);this.father=b},setCSS:function(b){this.side.css(b)},onResize2:function(b,c){this.toScale=b/this.width;var d=getTransform(this.side[0]);this.zoomObj(this.side,this.origin," scale("+this.toScale+")",d.x,d.y)},onResize:function(b,c,d){this.toScale=1;b=getPageWidthHeightByWidth(b,c,zoomPageWidth,zoomPageHeight);
this.width=b.x*this.toScale;this.height=b.y*this.toScale;this.side.css({width:this.width+"px",height:this.height+"px"});this.sideContent.css({width:this.width+"px",height:this.height+"px"});this.sideImg.css({width:this.width+"px",height:this.height+"px"});this.searchHighlight.css({width:this.width+"px",height:this.height+"px"});this.MMBackground.css({width:this.width+"px",height:this.height+"px"});this.onMMResize(this.width,this.height);d&&this.tmpImg.css({width:this.width+"px",height:this.height+
"px",top:this.sideTop+"px"});this.loadingImg.css({left:this.width/2-10+"px",top:this.height/2-10+"px"})},getSide:function(){return this.side},fillContent:function(b){this.imageIndex=b;var c=this;this.sideContent.empty();b>originTotalPageCount+3||-2>b?this.side.css("background","transparent"):(b<=originTotalPageCount&&1<=b&&this.side.css("background","#ffffff"),this.sideImg.attr("src",getPageDir(b,"normal",originTotalPageCount)),this.sideImg.load(function(){c.tmpImg.attr("src",getPageDir(b,"normal",
originTotalPageCount));c.sideContent.append(c.sideImg);c.sideContent.append(c.tmpImg)}))},fillTemp:function(b){this.side.css("background","transparent");if(b!=this.imageIndex){this.imageIndex=b;var c=this;this.sideContent.empty();b>originTotalPageCount+3||-2>b?this.side.css("background","transparent"):(b<=originTotalPageCount&&1<=b&&this.side.css("background","#ffffff"),this.sideImg.attr("src",getPageDir(b,"thumb",originTotalPageCount)),this.sideImg.load(function(){c.tmpImg.attr("src",getPageDir(b,
"thumb",originTotalPageCount));c.sideContent.append(c.sideImg);c.sideContent.append(c.tmpImg)}))}},changeContent:function(b){this.imageIndex=b;var c=this;b>originTotalPageCount+3||-2>b||(null!=this.slider&&(this.slider.destroy(),this.slider=null),this.sideImg.attr("src",getPageDir(b,"normal",originTotalPageCount)),this.sideImg.load(function(){c.hideLoading();c.tmpImg.attr("src",getPageDir(b,"normal",originTotalPageCount));c.sideContent.append(c.sideImg);c.sideContent.append(c.tmpImg);c.sideContent.append(c.MMBackground);
c.sideContent.append(c.searchHighlight);c.searchHighlight.css({opacity:0.8});c.clearMM();c.initMM();c.initSlider()}))},setPosition:function(b,c){this.side.css({left:b+"px",top:c+"px"})},setChildIndex:function(b){this.side.css({"z-index":b})},setVisible:function(b){this.side.css({display:b?"block":"none"})},resetSize:function(){this.tmpImg.css({display:"none"});var b=this.width*this.toScale>=zoomPageWidth,c=b?zoomPageWidth:this.width*this.toScale,d=b?zoomPageHeight:this.height*this.toScale,f=getTransform(this.side[0]),
g=this.width==zoomPageWidth&&c<zoomPageWidth||this.width!=zoomPageWidth;this.toScale=b?this.width*this.toScale/zoomPageWidth:1;var b=phoneBook.minZoomWidth,h=phoneBook.minZoomHeight;if(void 0!=b&&void 0!=h&&0<b&&0<h){c/d>b/h?h=b*d/c:b=h*c/d;var k=Math.min(0,c-b),l=Math.min(0,d-h),c=Math.max(c,b),d=Math.max(d,h);f.x+=k/2;f.y+=l/2}this.zoomObj(this.side,"0% 0%","scale("+this.toScale+")",f.x,f.y);this.width=c;this.height=d;this.translateX=f.x;this.translateY=f.y;g&&this.tmpImg.css({width:this.width+
"px",height:this.height+"px"});this.zoomObj(this.tmpImg,"0% 0%","scale("+this.toScale+")",f.x,f.y);this.tmpImg.css({display:"block"});if(g)this.onResize(c,d)},zoom:function(b,c){if(!0==this.isZomming)return!1;var d=phoneBook.minZoomWidth,f=phoneBook.largeZoomWidth,g=this.side.width()*this.toScale;this.side.height();var h=this.toScale+b,k=this.side.width()*h;if(1>h){if(g<=d)return;k<d&&(h=d/this.side.width())}1<h&&k>f&&(h=f/this.side.width());k=this.side.width()*h;this.side.height();d=(g-k)/2+this.translateX;
0==c&&(d=0);1==c&&(d=k);-1==c&&(d=-k);this.animateZoom(h,d,0,300)},zoomToScale:function(b,c){if(!0==this.isZomming)return!1;var d=phoneBook.minZoomWidth,f=phoneBook.largeZoomWidth,g=this.side.width()*this.toScale;this.side.height();var h=this.toScale+b,k=this.side.width()*h;if(1>h){if(g<=d)return;k<d&&(h=d/this.side.width())}1<h&&k>f&&(h=f/this.side.width());k=this.side.width()*h;this.side.height();d=(g-k)/2+this.translateX;0==c&&(d=0);1==c&&(d=k);-1==c&&(d=-k);!0!=this.isZomming&&(this.isZomming=
!0,h||(h=this.toScale),d||(d=0),getTransform(this.side[0]),this.tmpImg.css({display:"none"}),this.zoomObj(this.side,this.origin," scale("+h+")",d,0),this.zoomObj(this.tmpImg,this.origin," scale("+h+")",d,0),this.tmpImg.css({display:"block"}),this.toScale=h,phoneBook.toScale=h,phoneBook.containtWidth=Math.min(phoneBook.width*h,phoneBook.stageWidth),phoneBook.containtHeight=Math.min(phoneBook.height*h,phoneBook.stageHeight),phoneBook.book.css({width:phoneBook.containtWidth+"px",height:phoneBook.containtHeight+
"px",left:(phoneBook.stageWidth-phoneBook.containtWidth)/2+"px",top:(phoneBook.stageHeight-phoneBook.containtHeight)/2+"px"}),this.isZomming=!1)},noZoom:function(){this.toScale=this.fitW/this.width;this.zoomObj(this.side,"0% 0%","scale("+this.toScale+")",0,0);this.zoomObj(this.tmpImg,"0% 0%","scale("+this.toScale+")",0,0)},forceReset:function(b){this.width=this.fitW;this.height=this.fitH;this.toScale=1;void 0==b&&(b=getTransform(this.side[0]));this.forceResize(b)},forceMax:function(){var b=(this.width*
this.toScale-zoomPageWidth)/2;this.width=zoomPageWidth;this.height=zoomPageHeight;var c=getTransform(this.side[0]);c.x+=b;this.forceResize(c)},animateMax:function(){this.animateZoom(zoomPageWidth/this.width,(this.width-zoomPageWidth)/2,0,300)},animateFit:function(){this.animateZoom(this.fitW/this.width,0,0,300)},forceResize:function(b){this.side.css({width:this.width+"px",height:this.height+"px"});this.sideContent.css({width:this.width+"px",height:this.height+"px"});this.sideImg.css({width:this.width+
"px",height:this.height+"px"});this.searchHighlight.css({width:this.width+"px",height:this.height+"px"});this.MMBackground.css({width:this.width+"px",height:this.height+"px"});this.onMMResize(this.width,this.height);this.tmpImg.css({width:this.width+"px",height:this.height+"px"});this.loadingImg.css({left:this.width/2-10+"px",top:this.height/2-10+"px"});this.toScale=1;this.zoomObj(this.side,"0% 0%","scale("+this.toScale+")",b.x,b.y);this.zoomObj(this.tmpImg,"0% 0%","scale("+this.toScale+")",b.x,b.y);
this.translateX=b.x;this.translateY=b.y},getScaleFromFit:function(){return this.width*this.toScale/this.fitW},getCenterTransform:function(){return Point((this.fitW-this.width*this.toScale)/2,0)},zoomToMax:function(){var b=zoomPageWidth/this.width;this.animateZoom(b,(this.width*this.toScale-this.width*b)/2+this.translateX,0,200)},zoomToFit:function(){var b=this.getScaleFromFit();this.animateZoom(b,0,0,200)},zoomObj:function(b,c,d,f,g){f||(f=0);g||(g=0);f=translate(f,g);b.css({"-webkit-transform-origin":c,
"-moz-transform-origin":c,"-ms-transform-origin":c,"-o-transform-origin":c,"transform-origin":c,"-webkit-transform":f+d,"-moz-transform":f+d,"-ms-transform":f+d,"-o-transform":f+d,transform:f+d})},setTranslate:function(b,c,d){c=translate(c,d);b.css({"-webkit-transform":c,"-moz-transform":c,"-o-transform":c,"-ms-transform":c,transform:c})},setXY:function(b,c){this.x=b;this.y=c},animateTranslate:function(b,c,d){b||(b=0);c||(c=0);d||(d=25);var f=getTransform(this.side[0]),g=this;$(f).animate({x:b,y:c},
{duration:d,easing:"easeOutSine",complete:function(){g.zoomObj(g.side,g.origin," scale("+g.toScale+")",f.x,f.y);g.zoomObj(g.tmpImg,g.origin," scale("+g.toScale+")",f.x,f.y)}})},animateZoom:function(b,c,d,f){if(!0!=this.isZomming){this.isZomming=!0;b||(b=this.toScale);c||(c=0);d||(d=0);f||(f=25);var g=getTransform(this.side[0]),h={scale:this.toScale,x:g.x,y:g.y},k=this;$(h).animate({scale:b,x:c,y:d},{duration:f,easing:"easeOutSine",step:function(){k.tmpImg.css({display:"none"});k.zoomObj(k.side,k.origin,
" scale("+h.scale+")",c,d);k.zoomObj(k.tmpImg,k.origin," scale("+h.scale+")",c,d);k.tmpImg.css({display:"block"})},complete:function(){k.toScale=b;phoneBook.toScale=b;phoneBook.containtWidth=Math.min(phoneBook.width*b,phoneBook.stageWidth);phoneBook.containtHeight=Math.min(phoneBook.height*b,phoneBook.stageHeight);phoneBook.book.css({width:phoneBook.containtWidth+"px",height:phoneBook.containtHeight+"px",left:(phoneBook.stageWidth-phoneBook.containtWidth)/2+"px",top:(phoneBook.stageHeight-phoneBook.containtHeight)/
2+"px"});k.isZomming=!1}})}},onWinResize:function(b,c,d){this.toScale=1;var f=getPageWidthHeightByWidth(b,c,zoomPageWidth,zoomPageHeight);this.fitW=f.x;this.fitH=f.y;if(d)this.onResize(b,c,!0)},showLoading:function(){this.side.append(this.loadingImg)},hideLoading:function(){this.loadingImg.remove()},translate:function(b,c,d){this.tmpImg.css({display:"none"});this.zoomObj(this.side,this.origin," scale("+this.toScale+")",b,c);this.zoomObj(this.tmpImg,this.origin," scale("+this.toScale+")",b,c);this.tmpImg.css({display:"block"})},
sFit:function(){return this.toScale==this.fitW/this.width},animateBack:function(b){var c=getTransform(this.side[0]),d={x:c.x,y:c.y,scale:this.toScale},f=this.fitW/this.width,g=this;g.tmpImg.css({display:"none"});$(d).animate({x:0,y:0,scale:f},{duration:200,step:function(){g.zoomObj(g.side,g.origin," scale("+d.scale+")",d.x,d.y);g.zoomObj(g.tmpImg,g.origin," scale("+d.scale+")",d.x,d.y)},complete:function(){g.toScale=f;g.tmpImg.css({display:"block"});b()}})},showPage:function(){this.side.css({display:"block"})},
hidePage:function(){this.side.css({display:"none"})},getWidth:function(){return this.width*this.toScale},getHeight:function(){return this.height*this.toScale},highlightSearch:function(b){highlightSearchFun(this.searchHighlight,b)},clearHighlight:function(){clearHighlightFun(this.searchHighlight)}}).extend(BookSide);bdor[34]=function(b,c){return b-bdor[c]};
var phonePage=Class({create:function(b){this.side=$("<div></div>");this.leftPage=$("<div></div>");this.rightPage=$("<div></div>");this.leftSide=new phoneSide(this.leftPage);this.rightSide=new phoneSide(this.rightPage);this.width=zoomPageWidth;this.height=zoomPageHeight;this.fitH=this.fitW=0;b.append(this.side);this.side.append(this.leftPage);this.side.append(this.rightPage);this.imageIndex=-1;this.leftSide.imageIndex=-1;this.rightSide.imageIndex=-1;this.toScale=1;this.leftSide.toScale=1;this.rightSide.toScale=
1;this.origin="0% 0%";this.translateY=this.translateX=this.y=this.x=0;this.toolbarShow=this.isZomming=!1;this.sideTop=0;this.side.css({width:this.width+"px",height:this.height+"px",top:this.sideTop+"px",position:"absolute","border-width":"0px"});this.leftPage.css({width:this.width/2+"px",height:this.height+"px",top:this.sideTop+"px",position:"absolute"});this.rightPage.css({width:this.width/2+"px",height:this.height+"px",top:this.sideTop+"px",left:this.width/2+"px",position:"absolute"});this.initEvent();
this.onWinResize(windowWidth-leftMargin-rightMargin,windowHeight-topMargin-bottomMargin-40,!0);this.father=b},hideMM:function(){this.leftSide.hideMM();this.rightSide.hideMM()},showMM:function(){this.leftSide.showMM();this.rightSide.showMM()},playSlider:function(){this.leftSide.playSlider();this.rightSide.playSlider()},resetSlider:function(){this.leftSide.resetSlider();this.rightSide.resetSlider()},setCSS:function(b){this.leftSide.setCSS(b);this.rightSide.setCSS(b)},onResize2:function(b,c){this.leftPage.css({width:b/
2+"px",height:c+"px"});this.rightPage.css({width:b/2+"px",height:c+"px",left:b/2+"px"});this.toScale=b/this.width;var d=getTransform(this.side[0]);this.zoomObj(this.side,this.origin," scale("+this.toScale+")",d.x,d.y)},onResize:function(b,c,d){this.toScale=1;this.leftSide.toScale=1;this.rightSide.toScale=1;b=getPageWidthHeightByWidth(b/2,c,zoomPageWidth,zoomPageHeight);this.width=b.x*this.toScale*2;this.height=b.y*this.toScale;this.side.css({width:this.width+"px",height:this.height+"px"});this.leftPage.css({width:this.width/
2+"px",height:this.height+"px"});this.rightPage.css({width:this.width/2+"px",height:this.height+"px",left:this.width/2+"px"});this.leftSide.onResize(this.width/2,this.height,d);this.rightSide.onResize(this.width/2,this.height,d)},getSide:function(){return this.side},fillContent:function(b){b=2*parseInt(b/2);parseBool(bookConfig.RightToLeft)?(this.leftSide.fillContent(b+1),this.rightSide.fillContent(b)):(this.leftSide.fillContent(b),this.rightSide.fillContent(b+1))},fillTemp:function(b){b=2*parseInt(b/
2);parseBool(bookConfig.RightToLeft)?(this.leftSide.fillTemp(b+1),this.rightSide.fillTemp(b)):(this.leftSide.fillTemp(b),this.rightSide.fillTemp(b+1))},changeContent:function(b){b=2*parseInt(b/2);parseBool(bookConfig.RightToLeft)?(this.leftSide.changeContent(b+1),this.rightSide.changeContent(b)):(this.leftSide.changeContent(b),this.rightSide.changeContent(b+1))},setPosition:function(b,c){this.side.css({left:b+"px",top:c+"px"})},setChildIndex:function(b){this.side.css({"z-index":b})},setVisible:function(b){this.side.css({display:b?
"block":"none"})},resetSize:function(){},zoom:function(b,c){if(!0==this.isZomming)return!1;var d=phoneBook.minZoomWidth,f=phoneBook.largeZoomWidth,g=this.side.width()*this.toScale;this.side.height();var h=this.toScale+b,k=this.side.width()*h;if(1>h){if(g<=d)return;k<d&&(h=d/this.side.width())}1<h&&k>f&&(h=f/this.side.width());k=this.side.width()*h;this.side.height();d=(g-k)/2+this.translateX;0==c&&(d=0);1==c&&(d=k);-1==c&&(d=-k);this.animateZoom(h,d,0,300)},zoomToScale:function(b,c){if(!0==this.isZomming)return!1;
var d=phoneBook.minZoomWidth,f=phoneBook.largeZoomWidth,g=this.side.width()*this.toScale;this.side.height();var h=this.toScale+b,k=this.side.width()*h;if(1>h){if(g<=d)return;k<d&&(h=d/this.side.width())}1<h&&k>f&&(h=f/this.side.width());k=this.side.width()*h;this.side.height();d=(g-k)/2+this.translateX;0==c&&(d=0);1==c&&(d=k);-1==c&&(d=-k);!0!=this.isZomming&&(this.isZomming=!0,h||(h=this.toScale),d||(d=0),getTransform(this.side[0]),this.zoomObj(this.side,this.origin," scale("+h+")",d,0),this.toScale=
h,phoneBook.toScale=h,phoneBook.containtWidth=Math.min(phoneBook.width*h,phoneBook.stageWidth),phoneBook.containtHeight=Math.min(phoneBook.height*h,phoneBook.stageHeight),phoneBook.book.css({width:phoneBook.containtWidth+"px",height:phoneBook.containtHeight+"px",left:(phoneBook.stageWidth-phoneBook.containtWidth)/2+"px",top:(phoneBook.stageHeight-phoneBook.containtHeight)/2+"px"}),this.isZomming=!1)},noZoom:function(){this.toScale=this.fitW/this.width;this.zoomObj(this.side,"0% 0%","scale("+this.toScale+
")",0,0)},forceReset:function(b){this.width=this.fitW;this.height=this.fitH;this.toScale=1;void 0==b&&(b=getTransform(this.side[0]));this.forceResize(b)},forceMax:function(){var b=(this.width*this.toScale-zoomPageWidth)/2;this.width=zoomPageWidth;this.height=zoomPageHeight;var c=getTransform(this.side[0]);c.x+=b;this.forceResize(c)},animateMax:function(){this.animateZoom(zoomPageWidth/this.width,(this.width-zoomPageWidth)/2,0,300)},animateFit:function(){this.animateZoom(this.fitW/this.width,0,0,300)},
forceResize:function(b){this.side.css({width:this.width+"px",height:this.height+"px"});this.leftSide.forceResize(Point(0,0));this.rightSide.forceResize(Point(0,0));this.toScale=1;this.zoomObj(this.side,"0% 0%","scale("+this.toScale+")",b.x,b.y);this.translateX=b.x;this.translateY=b.y},getScaleFromFit:function(){return this.width*this.toScale/this.fitW},getCenterTransform:function(){return Point((this.fitW-this.width*this.toScale)/2,0)},zoomToMax:function(){var b=zoomPageWidth/this.width;this.animateZoom(b,
(this.width*this.toScale-this.width*b)/2+this.translateX,0,200)},zoomToFit:function(){var b=this.getScaleFromFit();this.animateZoom(b,0,0,200)},zoomObj:function(b,c,d,f,g){f||(f=0);g||(g=0);f=translate(f,g);b.css({"-webkit-transform-origin":c,"-moz-transform-origin":c,"-ms-transform-origin":c,"-o-transform-origin":c,"transform-origin":c,"-webkit-transform":f+d,"-moz-transform":f+d,"-ms-transform":f+d,"-o-transform":f+d,transform:f+d})},setTranslate:function(b,c,d){c=translate(c,d);b.css({"-webkit-transform":c,
"-moz-transform":c,"-o-transform":c,"-ms-transform":c,transform:c})},setXY:function(b,c){this.x=b;this.y=c},animateTranslate:function(b,c,d){b||(b=0);c||(c=0);d||(d=25);var f=getTransform(this.side[0]),g=this;$(f).animate({x:b,y:c},{duration:d,easing:"easeOutSine",complete:function(){g.zoomObj(g.side,g.origin," scale("+g.toScale+")",f.x,f.y)}})},animateZoom:function(b,c,d,f){if(!0!=this.isZomming){this.isZomming=!0;b||(b=this.toScale);c||(c=0);d||(d=0);f||(f=25);var g=getTransform(this.side[0]),h=
{scale:this.toScale,x:g.x,y:g.y},k=this;$(h).animate({scale:b,x:c,y:d},{duration:f,easing:"easeOutSine",step:function(){k.zoomObj(k.side,k.origin," scale("+h.scale+")",c,d)},complete:function(){k.toScale=b;phoneBook.toScale=b;phoneBook.containtWidth=Math.min(phoneBook.width*b,phoneBook.stageWidth);phoneBook.containtHeight=Math.min(phoneBook.height*b,phoneBook.stageHeight);phoneBook.book.css({width:phoneBook.containtWidth+"px",height:phoneBook.containtHeight+"px",left:(phoneBook.stageWidth-phoneBook.containtWidth)/
2+"px",top:(phoneBook.stageHeight-phoneBook.containtHeight)/2+"px"});k.isZomming=!1}})}},onWinResize:function(b,c,d){this.toScale=1;var f=getPageWidthHeightByWidth(b/2,c,zoomPageWidth,zoomPageHeight);this.fitW=2*f.x;this.fitH=f.y;if(d)this.onResize(b,c,!0)},showLoading:function(){this.side.append(this.loadingImg)},hideLoading:function(){this.loadingImg.remove()},translate:function(b,c,d){this.zoomObj(this.side,this.origin," scale("+this.toScale+")",b,c)},isFit:function(){return this.toScale==this.fitW/
this.width},animateBack:function(b){var c=getTransform(this.side[0]),d={x:c.x,y:c.y,scale:this.toScale},f=this.fitW/this.width,g=this;g.tmpImg.css({display:"none"});$(d).animate({x:0,y:0,scale:f},{duration:200,step:function(){g.zoomObj(g.side,g.origin," scale("+d.scale+")",d.x,d.y)},complete:function(){g.toScale=f;b()}})},showPage:function(){this.side.css({display:"block"})},hidePage:function(){this.side.css({display:"none"})},getWidth:function(){return this.width*this.toScale},getHeight:function(){return this.height*
this.toScale},initEvent:function(){var b=this,c=Point(0,0),d=Point(0,0),f=Point(0,0),g=!1,h=!1,k=null,l=!1,m,n=0,q=0,p=!1;this.side.bind(_event._down,function(n){n.preventDefault();if(bookType==BookType.phone_book){if(!0==b.isZomming||!0==phoneBook.isFlipping)return!1;m=b.toScale;p=!1;n=isTouch?n.originalEvent.touches:[n];var q=getTransform(b.side[0]);b.translateX=q.x;b.translateY=q.y;phoneBook.initTranslate();1==n.length?(g=!0,h=!1,c=Point(n[0].pageX,n[0].pageY),k=Point(b.side.position().left,b.side.position().top)):
2==n.length&&(g=!1,h=!0,c=Point(n[0].pageX,n[0].pageY),f=Point(n[1].pageX,n[1].pageY),d=Point((n[0].pageX+n[1].pageX)/2,(n[0].pageY+n[1].pageY)/2),k=Point(b.side.offset().left,b.side.offset().top));l=!1;stopEvent(n[0])}});2==browserType&&(_event._mousewheel="DOMMouseScroll");isIE()&&(_event._mousewheel="mousewheel");this.side.bind(_event._mousewheel,function(c){c.preventDefault();if(bookType!=BookType.phone_book||!0==phoneBook.isFlipping)return!1;c=c.originalEvent;c=Math.max(-1,Math.min(1,c.wheelDelta||
-c.detail));getTransform(b.side[0]);var d=-0.25;0<c&&(d=0.25);phoneBook.zoom(d);return!1});this.side.bind(_event._move,function(s){s.preventDefault();if(bookType==BookType.phone_book){s=isTouch?s.originalEvent.touches:[s];if(!0==b.isZomming||!0==phoneBook.isFlipping||!0==p)return!1;g?b.side.css({cursor:"move"}):b.side.css({cursor:""});if(g){var r=s[0].pageX-c.x+b.translateX,t=s[0].pageY-c.y+b.translateY;(new Date).getTime();t=Math.max(phoneBook.getHeight()-b.getHeight(),t);t=Math.min(t,0);phoneBook.getWidth()+
5<b.getWidth()?(r=Math.max(phoneBook.getWidth()-b.getWidth(),r),r=Math.min(r,0),b.zoomObj(b.side,b.origin," scale("+b.toScale+")",r,t),n=r,q=t,b.zoomToMove=!0,b.gotoNextPage=!1,b.gotoPrePage=!1):(b.zoomToMove=!1,phoneBook.translateMove(s[0].pageX-c.x,t),c.x-s[0].pageX>windowWidth/8?(b.gotoNextPage=!0,b.gotoPrePage=!1):c.x-s[0].pageX<=-windowWidth/8?(b.gotoNextPage=!1,b.gotoPrePage=!0):(b.gotoNextPage=!1,b.gotoPrePage=!1));n=r;q=t;l=!1;stopEvent(s[0])}else if(h){var t=Point(s[0].pageX,s[0].pageY),
v=Point(s[1].pageX,s[1].pageY),r=Math.sqrt(Math.pow(c.x-f.x,2)+Math.pow(c.y-f.y,2)),t=Math.sqrt(Math.pow(t.x-v.x,2)+Math.pow(t.y-v.y,2));scale=Math.max(t/r*m,0.5);r=b.side.width()*scale;1>scale&&r<phoneBook.minZoomWidth&&(scale=phoneBook.minZoomWidth/b.side.width());1<scale&&r>phoneBook.largeZoomWidth&&(scale=phoneBook.largeZoomWidth/b.side.width());phoneBook.showPage.toScale=scale;t=(d.x-k.x)/m;r=(d.y-k.y)/m;b.side.width();b.side.height();t=(m-b.toScale)*b.side.width()*(t/b.side.width());v=(m-b.toScale)*
b.side.height()*(r/b.side.height());r=b.translateX+t;t=b.translateY+v;phoneBook.toScale=scale;phoneBook.containtWidth=Math.min(phoneBook.width*scale,phoneBook.stageWidth);phoneBook.containtHeight=Math.min(phoneBook.height*scale,phoneBook.stageHeight);t=Math.max(phoneBook.getHeight()-b.side.height()*scale,t);t=Math.min(t,0);r=Math.max(phoneBook.getWidth()-b.side.width()*scale,r);r=Math.min(r,0);phoneBook.showPage.zoomObj(phoneBook.showPage.side,phoneBook.showPage.origin," scale("+b.toScale+")",r,t);
phoneBook.book.css({width:phoneBook.containtWidth+"px",height:phoneBook.containtHeight+"px",left:(phoneBook.stageWidth-phoneBook.containtWidth)/2+"px",top:(phoneBook.stageHeight-phoneBook.containtHeight)/2+"px"});l=!0;stopEvent(s[0])}}});this.side.bind(_event._end,function(c){c.preventDefault();if(bookType==BookType.phone_book){if(!0==b.isZomming||!0==phoneBook.isFlipping||!0==p)return!1;b.side.css({cursor:""});b.translateX=n;var d=q,d=Math.max(phoneBook.getHeight()-b.getHeight(),d),d=Math.min(d,
0);b.translateY=d;try{!0==b.gotoNextPage?gotoPageFun(parseInt(phoneBook.currentIndex)+2):!0==b.gotoPrePage?gotoPageFun(parseInt(phoneBook.currentIndex)-2):!1==b.zoomToMove&&!1==l&&phoneBook.translateToOrigin(b.translateY),b.gotoNextPage=!1,b.gotoPrePage=!1,p=!0}catch(f){}l=h=g=!1;stopEvent(c[0])}});this.side.bind(_event._leave,function(c){c.preventDefault();if(bookType==BookType.phone_book){if(!0==b.isZomming||!0==phoneBook.isFlipping||!0==p)return!1;try{!0==b.gotoNextPage?gotoPageFun(parseInt(phoneBook.currentIndex)+
2):!0==b.gotoPrePage?gotoPageFun(parseInt(phoneBook.currentIndex)-2):!1==b.zoomToMove&&!1==l&&phoneBook.translateToOrigin(b.translateY),b.gotoNextPage=!1,b.gotoPrePage=!1,p=!0}catch(d){}stopEvent(c[0])}});this.side.hammer().on("doubletap",function(b){b.preventDefault();if(!0==phoneBook.isFlipping||!0==this.isZomming||bookType!=BookType.phone_book)return!1})},initMM:function(){this.leftSide.initMM();this.rightSide.initMM()},MMResize:function(b,c){this.leftSide.MMResize(b,c);this.rightSide.MMResize(b,
c)},highlightSearch:function(b){this.leftSide.highlightSearch(b);this.rightSide.highlightSearch(b)},clearHighlight:function(){this.leftSide.clearHighlight();this.rightSide.clearHighlight()}}),SinglePhoneBook=Class({create:function(b){this.bookContainer=$("<div style='left:0px;right:0px;top:0px;bottom:0px;position:absolute;display:none;'></div>");this.book=$("<div></div>");this.bookPage=$("<div></div>");bdor[17]="p";this.prePage=new singlePhoneSide(this.bookPage);this.nextPage=new singlePhoneSide(this.bookPage);
this.showPage=new singlePhoneSide(this.bookPage);this.width=windowWidth;this.height=windowHeight;this.prePage.setChildIndex(1);this.showPage.setChildIndex(3);this.nextPage.setChildIndex(2);this.diffPageCount=0;this.currentIndex=1;this.showingPage=this.flipPage=null;this.isFlipping=!1;this.minZoomWidth=windowWidth;this.largeScale=Math.max(1,2.5*zoomPageWidth/windowWidth);this.largeZoomWidth=windowWidth*this.largeScale;b.append(this.bookContainer);this.bookContainer.append(this.book);this.book.append(this.bookPage);
this.book.css({width:this.width+"px",height:this.height+"px",position:"absolute",overflow:"hidden","z-index":"9"});this.fillNear(1);this.pageIndexLabel=new label("1/"+totalPageCount,this.bookContainer);this.pageIndexLabel.setLabelPosition(10,10,["left","bottom"]);this.pageIndexLabel.setCSS({"padding-left":"5px","padding-right":"5px",height:"25px","line-height":"25px",vertical:"middle","text-align":"center","border-radius":"3px","z-index":"10",background:"#333333"});this.pageIndexLabel.setFont(10,
"#edaa1d");this.toScale=1;this.initEvent()},setShow:function(b){this.pageIndexLabel.setCSS({display:b?"block":"none"})},onResize:function(b,c){this.toScale=1;this.stageWidth=windowWidth;this.stageHeight=windowHeight;var d=getPageWidthHeightByWidth(this.stageWidth,this.stageHeight,zoomPageWidth,zoomPageHeight);this.width=d.x;this.height=d.y;this.minZoomWidth=d.x;this.minZoomHeight=d.y;this.largeZoomWidth=this.width*this.largeScale;this.largeZoomHeight=this.height*this.largeScale;this.containtWidth=
Math.min(this.width*this.toScale,this.stageWidth);this.containtHeight=Math.min(this.height*this.toScale,this.stageHeight);this.book.css({width:this.containtWidth+"px",height:this.containtHeight+"px",left:(this.stageWidth-this.containtWidth)/2+"px",top:(this.stageHeight-this.containtHeight)/2+"px"});this.prePage.onWinResize(this.containtWidth,this.containtHeight,!0);this.showPage.onWinResize(this.containtWidth,this.containtHeight,!0);this.nextPage.onWinResize(this.containtWidth,this.containtHeight,
!0);this.prePage.translate(-this.prePage.getWidth(),0);this.nextPage.translate(this.containtWidth,0)},setTranslate:function(b,c,d){c=translate(c,d);b.css({"-webkit-transform":c,"-moz-transform":c,"-o-transform":c,"-ms-transform":c,transform:c})},gotoPage:function(b){var c=this;this.prePage.clearHighlight();this.nextPage.clearHighlight();if(this.currentIndex==b||1>b||b>originTotalPageCount||this.isFlipping){var d=1>b?"This is the first page":"This is the last page";if(1>b||b>originTotalPageCount)c.translateToOrigin(0),
_tipsBox.setCaption(d),_tipsBox.showTipsBox()}else{this.isFlipping=!0;this.diffPageCount=b-this.currentIndex;var f=0,g=this.showPage,h=void 0,c=this,d=Point(0,g.getWidth());centerP=Point(0,0);this.currentIndex>b?(h=this.prePage,f=d.y):(h=this.nextPage,f=-d.y);tragetToLeft=centerP.x;h.fillTemp(b);(function(){var d=getTransform(g.side[0]),l=getTransform(h.side[0]);h.forceReset();var m=30,n=1E3*bookConfig.flippingTime;void 0!=n&&0<n&&(m=2);var q=0,p=window.setInterval(function(){var n=Point(0,0),r=Point(0,
0);n.x=$.easing.swing(null,q,d.x,f-d.x,m);r.x=$.easing.swing(null,q,l.x,tragetToLeft-l.x,m);q++;g.translate(n.x,n.y);h.translate(r.x,r.y);q>m&&(window.clearInterval(p),window.setTimeout(function(){c.showPage.noZoom();auto_player.resetTimer();c.changePage();c.endFlip(b);c.isFlipping=!1;c.onResize()},20))},20)})()}},changePage:function(){var b=null;0<this.diffPageCount?(b=this.showPage,this.showPage=this.nextPage,this.nextPage=this.prePage):(b=this.nextPage,this.nextPage=this.showPage,this.showPage=
this.prePage);this.prePage=b},addSearchHighlight:function(){this.showPage.highlightSearch(this.currentIndex)},clearSearchHighlight:function(){this.showPage.clearHighlight()},endFlip:function(b){this.currentIndex=b;this.fillNear(b);setCurrentIndexTextField(this.currentIndex,!1);setLocationHash(this.currentIndex);sendvisitinfo(1,this.currentIndex);thumbButtonEnable&&thumbnail.clearHighLight();thumbButtonEnable&&thumbnail.setHighLight(this.currentIndex);this.prePage.translate(-this.prePage.getWidth(),
0);this.nextPage.translate(this.containtWidth,0);this.pageIndexLabel.setCaption(this.currentIndex+"/"+totalPageCount);this.addSearchHighlight()},setVisible:function(b){this.bookContainer.css({display:b?"block":"none"})},setPosition:function(b,c){this.book.css({left:b+"px",top:c+"px"})},fillNear:function(b){1<=b&&this.prePage.fillContent(b-1);this.showPage.changeContent(b);b<=originTotalPageCount&&this.nextPage.fillContent(b+1);this.prePage.resetSlider();this.showPage.playSlider();this.nextPage.resetSlider()},
initEvent:function(){},initTranslate:function(){var b=getTransform(this.showPage.side[0]),c=getTransform(this.prePage.side[0]),d=getTransform(this.nextPage.side[0]);this.tran=Point(b.x,b.y);this.pretran=Point(c.x,c.y);this.nexttran=Point(d.x,d.y)},translateMove:function(b,c){this.showPage.setTranslate(this.showPage.side,b+this.tran.x,c);this.showPage.setTranslate(this.showPage.tmpImg,b+this.tran.x,c);this.prePage.setTranslate(this.prePage.side,b+this.pretran.x,0);this.prePage.setTranslate(this.prePage.tmpImg,
b+this.pretran.x,0);this.nextPage.setTranslate(this.nextPage.side,b+this.nexttran.x,0);this.nextPage.setTranslate(this.nextPage.tmpImg,b+this.nexttran.x,0)},zoom:function(b){this.showPage.zoom(b,0)},zoomToScale:function(b){this.showPage.zoomToScale(b,0)},noZoom:function(){this.showPage.noZoom()},getLeft:function(){return this.book.offset().left},getTop:function(){return this.book.offset().top},getWidth:function(){return this.containtWidth},getHeight:function(){return this.containtHeight},getCurrentPageIndex:function(){return this.currentIndex},
getScale:function(){return 1},show:function(){Log.debug("single phone book show.");this.setVisible(!0);this.prePage.showPage();this.nextPage.showPage();this.showPage.showPage();var b=this;window.setTimeout(function(){b.showPage.showPage();b.addSearchHighlight(this.currentIndex);b.showPage.playSlider()},500)},hide:function(){Log.debug("single phone book hide.");this.setVisible(!1);this.showPage.resetSlider()}}),singlePhoneSide=Class({create:function(b){this.side=$("<div></div>");this.tmpContent=$("<div id='sideContent' class='sideContent' style= 'position: absolute;'></div>");
this.sideContent=$("<div class='sideContent' style= 'overflow: hidden'></div>");this.sideImg=$("<div style='width:100%;height:100%;position:absolute;z-index:1;background-size:100% 100%;background-repeat:no-repeat;'></div>");this.MMBackground=$("<div style='position:absolute;z-index:3;'></div>");this.loadingImg=$("<img src='"+uiBaseURL+"progress.gif' style='position: absolute;'>");this.width=zoomPageWidth;this.height=zoomPageHeight;this.fitH=this.fitW=0;this.tmpImg=$("<img style='position: absolute;z-index:-1;' />");
this.searchHighlight=$("<div class='kong' id='highlight'></div>");b.append(this.side);this.side.append(this.sideContent);this.imageIndex=-1;this.toScale=1;this.origin="0% 0%";this.translateY=this.translateX=this.y=this.x=0;this.toolbarShow=this.isZomming=!1;this.sideTop=0;this.side.css({width:this.width+"px",height:this.height+"px",top:this.sideTop+"px",position:"absolute"});this.sideContent.css({width:this.width+"px",height:this.height+"px",background:"transparent"});this.searchHighlight.css({width:this.width+
"px",height:this.height+"px"});this.sideImg.css({width:this.width+"px",height:this.height+"px"});this.MMBackground.css({width:this.width+"px",height:this.height+"px"});this.loadingImg.css({left:windowWidth/2-10+"px",top:windowHeight/2-10+"px"});this.initMMItems();this.slider=null;this.playSliderAfterLoad=!1;this.initEvent();this.onWinResize(windowWidth-leftMargin-rightMargin,windowHeight-topMargin-bottomMargin-40,!0);this.father=b},setCSS:function(b){this.side.css(b)},onResize2:function(b,c){this.toScale=
b/this.width;var d=getTransform(this.side[0]);this.zoomObj(this.side,this.origin," scale("+this.toScale+")",d.x,d.y)},onResize:function(b,c,d){this.toScale=1;b=getPageWidthHeightByWidth(b,c,zoomPageWidth,zoomPageHeight);this.width=b.x*this.toScale;this.height=b.y*this.toScale;this.side.css({width:this.width+"px",height:this.height+"px"});this.sideContent.css({width:this.width+"px",height:this.height+"px"});this.sideImg.css({width:this.width+"px",height:this.height+"px"});this.searchHighlight.css({width:this.width+
"px",height:this.height+"px"});this.MMBackground.css({width:this.width+"px",height:this.height+"px"});this.onMMResize(this.width,this.height);d&&this.tmpImg.css({width:this.width+"px",height:this.height+"px",top:this.sideTop+"px"});this.loadingImg.css({left:windowWidth/2-10+"px",top:windowHeight/2-10+"px"})},getSide:function(){return this.side},fillContent:function(b){this.imageIndex=b;var c=this;this.sideContent.empty();b>originTotalPageCount+1||0>b?this.side.css("background","transparent"):(b<=
originTotalPageCount&&1<=b&&this.side.css("background","#ffffff"),this.sideImg.attr("src",getPageDir(b,"normal",originTotalPageCount)),this.sideImg.load(function(){c.tmpImg.attr("src",getPageDir(b,"normal",originTotalPageCount));c.sideContent.append(c.sideImg);c.sideContent.append(c.tmpImg)}))},fillTemp:function(b){if(b!=this.imageIndex){this.imageIndex=b;var c=this;this.sideContent.empty();b>originTotalPageCount+1||0>b?this.side.css("background","transparent"):(b<=originTotalPageCount&&1<=b&&this.side.css("background",
"#ffffff"),this.sideImg.attr("src",getPageDir(b,"thumb",originTotalPageCount)),this.sideImg.load(function(){c.tmpImg.attr("src",getPageDir(b,"thumb",originTotalPageCount));c.sideContent.append(c.sideImg);c.sideContent.append(c.tmpImg)}))}},changeContent:function(b){b=parseInt(b);b!=this.pageIndex&&(this.pageIndex=b,null!=this.slider&&(this.slider.destroy(),this.slider=null),this.sideContent.css({background:"white"}),this.sideContent.empty(),this.MMBackground.empty(),this.showLoading(),b>originTotalPageCount||
1>b?(this.side.css({display:"none"}),this.sideContent.css({background:"transparent"}),this.hideLoading()):(this.side.css({display:"block"}),this.sideContent.css({background:"white"}),this.fillPage(b)))},fillImageOrNot:function(b){return!b||"string"!=typeof b||passwardType()&&bookConfig.excludeFrontPages&&this.pageIndex>parseInt(bookConfig.excludeFrontPages)&&!verifyPassward()?!1:!0},loaded:function(b){this.sideContent.append(this.sideImg);this.sideContent.append(this.MMBackground);this.sideContent.append(this.searchHighlight);
this.sideImg.css({"background-image":"url("+b+")"});this.hideLoading();this.sideImg.css({display:"block"});this.tmpImg.css({"background-image":"url("+b+")"});this.searchHighlight.css({opacity:0.8});this.clearMM();this.initMM();this.initSlider()},fillPage:function(b){if(b==this.pageIndex){var c=getPageDir(this.pageIndex,"large",originTotalPageCount);this.fillImageOrNot(c)?(this.imageURL=c,-1<c.indexOf(".js")?global[decodeDatabasePrefix("large")+b]&&"string"==typeof global[decodeDatabasePrefix("large")+
b]?this.loaded(dataBase64Str(b,"large")):loadJavascript(c,function(c){this.loaded(dataBase64Str(b,"large",c))}.bind(this),function(){}):$("<img src='"+c+"'/>").load(function(){this.loaded(c)}.bind(this))):(this.loadingInterval&&this.loadingInterval.stop(),this.loadingImage&&this.loadingImage.remove())}},setPosition:function(b,c){this.side.css({left:b+"px",top:c+"px"})},setChildIndex:function(b){this.side.css({"z-index":b})},setVisible:function(b){this.side.css({display:b?"block":"none"})},resetSize:function(){this.tmpImg.css({display:"none"});
var b=this.width*this.toScale>=zoomPageWidth,c=b?zoomPageWidth:this.width*this.toScale,d=b?zoomPageHeight:this.height*this.toScale,f=getTransform(this.side[0]),g=this.width==zoomPageWidth&&c<zoomPageWidth||this.width!=zoomPageWidth;this.toScale=b?this.width*this.toScale/zoomPageWidth:1;var b=singlePhoneBook.minZoomWidth,h=singlePhoneBook.minZoomHeight;if(void 0!=b&&void 0!=h&&0<b&&0<h){c/d>b/h?h=b*d/c:b=h*c/d;var k=Math.min(0,c-b),l=Math.min(0,d-h),c=Math.max(c,b),d=Math.max(d,h);f.x+=k/2;f.y+=l/
2}this.zoomObj(this.side,"0% 0%","scale("+this.toScale+")",f.x,f.y);this.width=c;this.height=d;this.translateX=f.x;this.translateY=f.y;g&&this.tmpImg.css({width:this.width+"px",height:this.height+"px"});this.zoomObj(this.tmpImg,"0% 0%","scale("+this.toScale+")",f.x,f.y);this.tmpImg.css({display:"block"});if(g)this.onResize(c,d)},zoom:function(b,c){if(!0==this.isZomming)return!1;var d=singlePhoneBook.minZoomWidth,f=singlePhoneBook.largeZoomWidth,g=this.side.width()*this.toScale;this.side.height();
var h=this.toScale+b,k=this.side.width()*h;if(1>h){if(g<=d)return;k<d&&(h=d/this.side.width())}1<h&&k>f&&(h=f/this.side.width());k=this.side.width()*h;this.side.height();d=(g-k)/2+this.translateX;0==c&&(d=0);1==c&&(d=k);-1==c&&(d=-k);this.animateZoom(h,d,0,300)},zoomToScale:function(b,c){if(!0==this.isZomming)return!1;var d=singlePhoneBook.minZoomWidth,f=singlePhoneBook.largeZoomWidth,g=this.side.width()*this.toScale;this.side.height();var h=this.toScale+b,k=this.side.width()*h;if(1>h){if(g<=d)return;
k<d&&(h=d/this.side.width())}1<h&&k>f&&(h=f/this.side.width());k=this.side.width()*h;this.side.height();d=(g-k)/2+this.translateX;0==c&&(d=0);1==c&&(d=k);-1==c&&(d=-k);!0!=this.isZomming&&(this.isZomming=!0,h||(h=this.toScale),d||(d=0),getTransform(this.side[0]),this.tmpImg.css({display:"none"}),this.zoomObj(this.side,this.origin," scale("+h+")",d,0),this.zoomObj(this.tmpImg,this.origin," scale("+h+")",d,0),this.tmpImg.css({display:"block"}),this.toScale=h,singlePhoneBook.toScale=h,singlePhoneBook.containtWidth=
Math.min(singlePhoneBook.width*h,singlePhoneBook.stageWidth),singlePhoneBook.containtHeight=Math.min(singlePhoneBook.height*h,singlePhoneBook.stageHeight),singlePhoneBook.book.css({width:singlePhoneBook.containtWidth+"px",height:singlePhoneBook.containtHeight+"px",left:(singlePhoneBook.stageWidth-singlePhoneBook.containtWidth)/2+"px",top:(singlePhoneBook.stageHeight-singlePhoneBook.containtHeight)/2+"px"}),this.isZomming=!1)},noZoom:function(){this.toScale=this.fitW/this.width;this.zoomObj(this.side,
"0% 0%","scale("+this.toScale+")",0,0);this.zoomObj(this.tmpImg,"0% 0%","scale("+this.toScale+")",0,0)},forceReset:function(b){this.width=this.fitW;this.height=this.fitH;this.toScale=1;void 0==b&&(b=getTransform(this.side[0]));this.forceResize(b)},forceMax:function(){var b=(this.width*this.toScale-zoomPageWidth)/2;this.width=zoomPageWidth;this.height=zoomPageHeight;var c=getTransform(this.side[0]);c.x+=b;this.forceResize(c)},animateMax:function(){this.animateZoom(zoomPageWidth/this.width,(this.width-
zoomPageWidth)/2,0,300)},animateFit:function(){this.animateZoom(this.fitW/this.width,0,0,300)},forceResize:function(b){this.side.css({width:this.width+"px",height:this.height+"px"});this.sideContent.css({width:this.width+"px",height:this.height+"px"});this.sideImg.css({width:this.width+"px",height:this.height+"px"});this.searchHighlight.css({width:this.width+"px",height:this.height+"px"});this.MMBackground.css({width:this.width+"px",height:this.height+"px"});this.onMMResize(this.width,this.height);
this.tmpImg.css({width:this.width+"px",height:this.height+"px"});this.toScale=1;this.zoomObj(this.side,"0% 0%","scale("+this.toScale+")",b.x,b.y);this.zoomObj(this.tmpImg,"0% 0%","scale("+this.toScale+")",b.x,b.y);this.translateX=b.x;this.translateY=b.y},getScaleFromFit:function(){return this.width*this.toScale/this.fitW},getCenterTransform:function(){return Point((this.fitW-this.width*this.toScale)/2,0)},zoomToMax:function(){var b=zoomPageWidth/this.width;this.animateZoom(b,(this.width*this.toScale-
this.width*b)/2+this.translateX,0,200)},zoomToFit:function(){var b=this.getScaleFromFit();this.animateZoom(b,0,0,200)},zoomObj:function(b,c,d,f,g){f||(f=0);g||(g=0);f=translate(f,g);b.css({"-webkit-transform-origin":c,"-moz-transform-origin":c,"-ms-transform-origin":c,"-o-transform-origin":c,"transform-origin":c,"-webkit-transform":f+d,"-moz-transform":f+d,"-ms-transform":f+d,"-o-transform":f+d,transform:f+d})},setTranslate:function(b,c,d){c=translate(c,d);b.css({"-webkit-transform":c,"-moz-transform":c,
"-o-transform":c,"-ms-transform":c,transform:c})},setXY:function(b,c){this.x=b;this.y=c},animateTranslate:function(b,c,d){b||(b=0);c||(c=0);d||(d=25);var f=getTransform(this.side[0]),g=this;$(f).animate({x:b,y:c},{duration:d,easing:"easeOutSine",complete:function(){g.zoomObj(g.side,g.origin," scale("+g.toScale+")",f.x,f.y);g.zoomObj(g.tmpImg,g.origin," scale("+g.toScale+")",f.x,f.y)}})},animateZoom:function(b,c,d,f){if(!0!=this.isZomming){this.isZomming=!0;b||(b=this.toScale);c||(c=0);d||(d=0);f||
(f=25);var g=getTransform(this.side[0]),h={scale:this.toScale,x:g.x,y:g.y},k=this;$(h).animate({scale:b,x:c,y:d},{duration:f,easing:"easeOutSine",step:function(){k.tmpImg.css({display:"none"});k.zoomObj(k.side,k.origin," scale("+h.scale+")",c,d);k.zoomObj(k.tmpImg,k.origin," scale("+h.scale+")",c,d);k.tmpImg.css({display:"block"})},complete:function(){k.toScale=b;singlePhoneBook.toScale=b;singlePhoneBook.containtWidth=Math.min(singlePhoneBook.width*b,singlePhoneBook.stageWidth);singlePhoneBook.containtHeight=
Math.min(singlePhoneBook.height*b,singlePhoneBook.stageHeight);singlePhoneBook.book.css({width:singlePhoneBook.containtWidth+"px",height:singlePhoneBook.containtHeight+"px",left:(singlePhoneBook.stageWidth-singlePhoneBook.containtWidth)/2+"px",top:(singlePhoneBook.stageHeight-singlePhoneBook.containtHeight)/2+"px"});k.isZomming=!1}})}},onWinResize:function(b,c,d){this.toScale=1;var f=getPageWidthHeightByWidth(b,c,zoomPageWidth,zoomPageHeight);this.fitW=f.x;this.fitH=f.y;if(d)this.onResize(b,c,!0)},
showLoading:function(){this.side.append(this.loadingImg)},hideLoading:function(){this.loadingImg.remove()},translate:function(b,c,d){this.tmpImg.css({display:"none"});this.zoomObj(this.side,this.origin," scale("+this.toScale+")",b,c);this.zoomObj(this.tmpImg,this.origin," scale("+this.toScale+")",b,c);this.tmpImg.css({display:"block"})},isFit:function(){return this.toScale==this.fitW/this.width},animateBack:function(b){var c=getTransform(this.side[0]),d={x:c.x,y:c.y,scale:this.toScale},f=this.fitW/
this.width,g=this;g.tmpImg.css({display:"none"});$(d).animate({x:0,y:0,scale:f},{duration:200,step:function(){g.zoomObj(g.side,g.origin," scale("+d.scale+")",d.x,d.y);g.zoomObj(g.tmpImg,g.origin," scale("+d.scale+")",d.x,d.y)},complete:function(){g.toScale=f;g.tmpImg.css({display:"block"});b()}})},showPage:function(){this.side.css({display:"block"})},hidePage:function(){this.side.css({display:"none"})},getWidth:function(){return this.width*this.toScale},getHeight:function(){return this.height*this.toScale},
initEvent:function(){var b=this,c=Point(0,0),d=Point(0,0),f=Point(0,0),g=!1,h=!1,k=null,l=!1,m,n=0,q=0,p=!1;this.side.bind(_event._down,function(n){n.preventDefault();if(bookType==BookType.singlePhone_book&&!0!=b.isZomming&&!0!=singlePhoneBook.isFlipping){m=b.toScale;p=!1;n=isTouch?n.originalEvent.touches:[n];var q=getTransform(b.side[0]);b.translateX=q.x;b.translateY=q.y;singlePhoneBook.initTranslate();1==n.length?(g=!0,h=!1,c=Point(n[0].pageX,n[0].pageY),k=Point(b.side.position().left,b.side.position().top)):
2==n.length&&(g=!1,h=!0,c=Point(n[0].pageX,n[0].pageY),f=Point(n[1].pageX,n[1].pageY),d=Point((n[0].pageX+n[1].pageX)/2,(n[0].pageY+n[1].pageY)/2),k=Point(b.side.offset().left,b.side.offset().top));l=!1}});2==browserType&&(_event._mousewheel="DOMMouseScroll");isIE()&&(_event._mousewheel="mousewheel");this.side.bind(_event._mousewheel,function(c){c.preventDefault();if(bookType==BookType.singlePhone_book&&!0!=singlePhoneBook.isFlipping){c=c.originalEvent;c=Math.max(-1,Math.min(1,c.wheelDelta||-c.detail));
getTransform(b.side[0]);var d=-0.25;0<c&&(d=0.25);singlePhoneBook.zoom(d);return!1}});this.side.bind(_event._move,function(s){s.preventDefault();if(bookType==BookType.singlePhone_book&&(s=isTouch?s.originalEvent.touches:[s],!0!=b.isZomming&&!0!=singlePhoneBook.isFlipping&&!0!=p))if(g?b.side.css({cursor:"move"}):b.side.css({cursor:""}),g){var r=s[0].pageX-c.x+b.translateX,t=s[0].pageY-c.y+b.translateY;(new Date).getTime();t=Math.max(singlePhoneBook.getHeight()-b.getHeight(),t);t=Math.min(t,0);singlePhoneBook.getWidth()+
5<b.getWidth()?(r=Math.max(singlePhoneBook.getWidth()-b.getWidth(),r),r=Math.min(r,0),b.zoomObj(b.side,b.origin," scale("+b.toScale+")",r,t),b.zoomObj(b.tmpImg,b.origin," scale("+b.toScale+")",r,t),n=r,q=t,b.zoomToMove=!0,b.gotoNextPage=!1,b.gotoPrePage=!1):(b.zoomToMove=!1,singlePhoneBook.translateMove(s[0].pageX-c.x,t),c.x-s[0].pageX>windowWidth/4?(b.gotoNextPage=!0,b.gotoPrePage=!1):c.x-s[0].pageX<=-windowWidth/4?(b.gotoNextPage=!1,b.gotoPrePage=!0):(b.gotoNextPage=!1,b.gotoPrePage=!1));n=r;q=
t;l=!1}else h&&(r=Point(s[0].pageX,s[0].pageY),t=Point(s[1].pageX,s[1].pageY),s=Math.sqrt(Math.pow(c.x-f.x,2)+Math.pow(c.y-f.y,2)),r=Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2)),scale=Math.max(r/s*m,0.5),s=b.side.width()*scale,1>scale&&s<singlePhoneBook.minZoomWidth&&(scale=singlePhoneBook.minZoomWidth/b.side.width()),1<scale&&s>singlePhoneBook.largeZoomWidth&&(scale=singlePhoneBook.largeZoomWidth/b.side.width()),singlePhoneBook.showPage.toScale=scale,r=(d.x-k.x)/m,s=(d.y-k.y)/m,b.side.width(),
b.side.height(),r=(m-b.toScale)*b.side.width()*(r/b.side.width()),s=(m-b.toScale)*b.side.height()*(s/b.side.height()),r=b.translateX+r,t=b.translateY+s,singlePhoneBook.toScale=scale,singlePhoneBook.containtWidth=Math.min(singlePhoneBook.width*scale,singlePhoneBook.stageWidth),singlePhoneBook.containtHeight=Math.min(singlePhoneBook.height*scale,singlePhoneBook.stageHeight),t=Math.max(singlePhoneBook.getHeight()-b.side.height()*scale,t),t=Math.min(t,0),r=Math.max(singlePhoneBook.getWidth()-b.side.width()*
scale,r),r=Math.min(r,0),singlePhoneBook.showPage.zoomObj(singlePhoneBook.showPage.side,singlePhoneBook.showPage.origin," scale("+b.toScale+")",r,t),singlePhoneBook.showPage.zoomObj(singlePhoneBook.showPage.tmpImg,singlePhoneBook.showPage.origin," scale("+b.toScale+")",r,t),singlePhoneBook.book.css({width:singlePhoneBook.containtWidth+"px",height:singlePhoneBook.containtHeight+"px",left:(singlePhoneBook.stageWidth-singlePhoneBook.containtWidth)/2+"px",top:(singlePhoneBook.stageHeight-singlePhoneBook.containtHeight)/
2+"px"}),l=!0)});this.side.bind(_event._end,function(c){c.preventDefault();if(bookType==BookType.singlePhone_book&&!0!=b.isZomming&&!0!=singlePhoneBook.isFlipping&&!0!=p){b.side.css({cursor:""});b.translateX=n;c=q;c=Math.max(singlePhoneBook.getHeight()-b.getHeight(),c);c=Math.min(c,0);b.translateY=c;try{!0==b.gotoNextPage?gotoPageFun(parseInt(singlePhoneBook.currentIndex)+1):!0==b.gotoPrePage?gotoPageFun(parseInt(singlePhoneBook.currentIndex)-1):!1==b.zoomToMove&&!1==l&&singlePhoneBook.translateToOrigin(b.translateY),
b.gotoNextPage=!1,b.gotoPrePage=!1,p=!0}catch(d){}l=h=g=!1}});this.side.bind(_event._leave,function(c){if(bookType==BookType.singlePhone_book&&!0!=b.isZomming&&!0!=singlePhoneBook.isFlipping&&!0!=p)try{!0==b.gotoNextPage?gotoPageFun(parseInt(singlePhoneBook.currentIndex)+1):!0==b.gotoPrePage?gotoPageFun(parseInt(singlePhoneBook.currentIndex)-1):!1==b.zoomToMove&&!1==l&&singlePhoneBook.translateToOrigin(b.translateY),b.gotoNextPage=!1,b.gotoPrePage=!1,p=!0}catch(d){}});this.side.hammer().on("doubletap",
function(b){})},highlightSearch:function(b){highlightSearchFun(this.searchHighlight,b)},clearHighlight:function(){clearHighlightFun(this.searchHighlight)}}).extend(BookSide);bdor[17]="p";Class("TaskList",{create:function(){this.taskList=[];this.largeLength=0},unShiftList:function(b,c){this.taskList.unshift(b);this.popList();for(var d=this.taskList.length,f=0;f<d&&!this.stop;f++)c&&c(this.taskList[f])},popList:function(b){var c=this.taskList.length;if(!(c<=this.largeLength)){this.stop=!0;for(var d=0;d<c-this.largeLength;d++){var f=this.taskList.pop();b&&b(f)}this.stop=!1}},setLargeLength:function(b){this.largeLength=b}});function shareButton(b,c){this.config=$.extend({iconURL:"",caption:"",link:""},c);this.bg=$("<div></div>");this.icon=$("<img />");this.caption=new label(this.config.caption,this.bg);this.width=200;this.height=40;this.bg.css({position:"absolute",width:this.width+"px",height:this.height+"px","-webkit-border-radius":"6px","-moz-border-radius":"6px","-o-border-radius":"6px","-ms-border-radius":"6px","border-radius":"6px","background-color":"#666666"});this.icon.attr({src:this.config.iconURL});this.icon.css({position:"absolute",
left:"5px",top:"-7px"});b.append(this.bg);this.bg.append(this.icon);this.caption.setLabelPosition(40,10);this.initEvent()}shareButton.prototype.onResize=function(b,c){this.bg.css({width:b+"px",height:c+"px"})};shareButton.prototype.initEvent=function(){this.bg.css({cursor:"pointer"});var b=this;this.bg.bind(_event._down,function(c){window.open(b.config.link,"_blank")})};shareButton.prototype.setPosition=function(b,c){this.bg.css({left:b+"px",top:c+"px"})};function shareForm(b,c){form.call(this,b,c);this.visible=!1;this.addItem();this.setButtonPos();this.background.css({left:-windowWidth/2-20+"px",overflow:"hidden"})}$.extend(shareForm.prototype,form.prototype);
shareForm.prototype.addItem=function(){var b=window.location.href,c=window.document.title,d=window.location.pathname,d=d.substring(0,d.lastIndexOf("/"))+"/files/thumb/1.jpg",b="?&url="+b+"&title="+c+"&description="+bookDescription+"&screenshot="+d,c={iconURL:uiBaseURL+"facebook.png",caption:"Facebook",link:"http://api.addthis.com/oexchange/0.8/forward/facebook/offer"+b},d={iconURL:uiBaseURL+"google.png",caption:"Google+",link:"http://api.addthis.com/oexchange/0.8/forward/igoogle/offer"+b},f={iconURL:uiBaseURL+
"myspace.png",caption:"MySpace",link:"http://api.addthis.com/oexchange/0.8/forward/myspace/offer"+b},g={iconURL:uiBaseURL+"twitter.png",caption:"Twitter",link:"http://api.addthis.com/oexchange/0.8/forward/twitter/offer"+b},h={iconURL:uiBaseURL+"digg.png",caption:"Digg",link:"http://api.addthis.com/oexchange/0.8/forward/digg/offer"+b},k={iconURL:uiBaseURL+"more.png",caption:"More",link:"http://api.addthis.com/oexchange/0.8/offer"+b};this.emailButton=new shareButton(this.contentBox,{iconURL:uiBaseURL+
"email.png",caption:"Email",link:"http://api.addthis.com/oexchange/0.8/forward/email/offer"+b});this.fbButton=new shareButton(this.contentBox,c);this.ggButton=new shareButton(this.contentBox,d);this.msButton=new shareButton(this.contentBox,f);this.twButton=new shareButton(this.contentBox,g);this.diggButton=new shareButton(this.contentBox,h);this.moreButton=new shareButton(this.contentBox,k)};
shareForm.prototype.onResize=function(b,c){this.width=100>b?100:b;this.height=100>c?100:c;this.background.css({width:this.width+"px",height:this.height+"px",left:this.visible?"0px":-this.width-20+"px"});this.titleBox.css({width:this.width+"px"});this.contentBox.css({width:this.width+"px",height:this.height-this.titleBox.height()+"px"});this.emailButton.onResize(this.width/2-20,40);this.fbButton.onResize(this.width/2-20,40);this.ggButton.onResize(this.width/2-20,40);this.msButton.onResize(this.width/
2-20,40);this.twButton.onResize(this.width/2-20,40);this.diggButton.onResize(this.width/2-20,40);this.moreButton.onResize(this.width/2-20,40);this.setButtonPos()};shareForm.prototype.setButtonPos=function(){this.emailButton.setPosition(5,10);this.fbButton.setPosition(this.width/2,10);this.ggButton.setPosition(5,68);this.msButton.setPosition(this.width/2,68);this.twButton.setPosition(5,126);this.diggButton.setPosition(this.width/2,126);this.moreButton.setPosition(5,184)};
shareForm.prototype.show=function(){var b=this;this.background.animate({left:0},400,function(){b.visible=!0;window.setTimeout(function(){b.background.css({left:"0px"})},100)})};shareForm.prototype.hide=function(){var b=this;this.background.animate({left:-(this.width+20)},400,function(){b.visible=!1;window.setTimeout(function(){b.background.css({left:-(this.width+20)+"px"})},100)})};shareForm.prototype.closeForm=function(){this.hide()};var passwardPannel={show:function(){this.found||this.init();this.background.show();this.view.show()},init:function(){this.found=!0;this.background=$("<div class='passwardPannel-background'></div>");this.view=$("<div class='passwardPannel'></div>");this.icon=$("<div id='icon' class='icon'></div>");this.username=$("<input id='username' placeholder='Name' class='username'></input>");this.passward=$("<input id='passward' type='password' placeholder='Passward' class='passward'></input>");this.loginIn=
$("<p id='loginIn' class='loginIn'>Login</p>");this.cancleIn=$("<p id='cancleIn' class='cancleIn'>Cancle</p>");this.passwardResult=$("<span id='passwardResult' class='passwardResult'></span>");$("body").append(this.background);$("body").append(this.view);this.view.append(this.icon);2==passwardType()&&(this.view.css("height","390px"),this.view.append(this.username));this.view.append(this.passward);this.view.append(this.loginIn);this.view.append(this.cancleIn);this.view.append(this.passwardResult);
this.icon.addCssSprite(phoneIconsURL[0],"passward",100,100,phoneIconInfo);this.background.bind(_event._down,function(){return!1});this.background.bind(_event._move,function(){return!1});this.background.bind(_event._end,function(){return!1});this.cancleIn.bind(_event._end,function(){this.hide()}.bind(this));this.loginIn.bind(_event._end,function(){this.login()}.bind(this))},login:function(){verifyPassward()?(this.hide(),fillCurrentPageContent()):this.showResult()},hide:function(){this.background.hide();
this.view.hide()},showResult:function(){document.getElementById("username")&&!this.username.val()?this.passwardResult.html("User name can not be empty."):this.passward.val()?this.passwardResult.html("Please enter the correct user name and password."):this.passwardResult.html("Password can not be empty.")}},getLogoLink=function(){var b=bookConfig.appLogoLinkURL,c=getString("appLogoOpenWindow","_blank");if("_Self"==c||"Self"==c||"self"==c)c="_self";void 0==b||""==b?(b="javascript:Void();",c="_self"):
"http"!=b.substr(0,4)&&(b="http://"+b);return[b,c]},logoBar,initLogoBar=function(b){logoBar=$("#logoBar");if(void 0!=bookConfig.appLogoIcon||""!=bookConfig.appLogoIcon){var c=$("<img />"),d=0,f=0,g=getLogoLink();c.load(function(){if(isNaN(bookConfig.logoHeight)||""==bookConfig.logoHeight||null==bookConfig.logoHeight||void 0==bookConfig.logoHeight)try{d=b.getLogoHeight()}catch(g){d=toolBar.getLogoHeight()}else d=bookConfig.logoHeight;var h=c.width()*d/c.height();c.css({width:h+"px",height:d+"px"});
try{f=(b.getLogoHeight()-d)/2}catch(m){f=0}logoBar.css({position:"absolute"});logoBar.append(c)});c.attr({src:bookConfig.appLogoIcon});c.css({position:"absolute"})}var h=0,h=isNaN(bookConfig.logoPadding)||""==bookConfig.logoPadding||null==bookConfig.logoPadding||void 0==bookConfig.logoPadding?0:bookConfig.logoPadding,f=(toolBar.getLogoHeight()-bookConfig.logoHeight)/2;logoBar.css({left:h+"px"});logoBar.css({top:f+"px"});logoBar.bind(_event._down,function(){window.open(g[0],g[1])});logoBar.bind("mouseover",
function(){logoBar.css({cursor:"pointer"})})},setPageIndexTextField=function(){setCurrentIndexTextField(BookInfo.getBook().getCurrentPageIndex(),bookType==BookType.normal_book||bookType==BookType.phone_book||bookType==BookType.slide_book||bookType==BookType.catalog_book);if(void 0!=$("#currentPageIndexTextField")&&null!=$("#currentPageIndexTextField")&&void 0!=$("#currentPageIndexTextField")[0]&&null!=$("#currentPageIndexTextField")[0]){var b=[8,13,46,48,49,50,51,52,53,54,55,56,57,96,97,98,99,100,
101,102,103,104,105];$("#currentPageIndexTextField").bind("keydown",function(c){if(0>b.indexOf(c.keyCode))return!1;13==c.keyCode&&(c=$("#currentPageIndexTextField").val().replace(/\D/g,""),c=Math.min(Math.max(c,1),totalPageCount),gotoPageFun(c))});$("#currentPageIndexTextField").bind("blur",function(){});$("#currentPageIndexTextField").bind(_event._end,function(b){$("#currentPageIndexTextField").val("")})}},languageChange=Class({create:function(b){var c=this;this.background=$("<div class='printBar'></div>");
this.contentBox=$("<div class='printBG'></div>");var d=0;this.showing=!1;$(this.background).css({width:windowWidth+"px",height:windowHeight+"px"});$(this.contentBox).css({width:"200px"});$(this.contentBox).css({background:"transparent"});b.append(this.background);b.append(this.contentBox);d=45*language.length+10;this.contentBox.css({height:d+"px"});$(this.contentBox).css({left:(windowWidth-200)/2+"px",top:(windowHeight-d)/2+"px"});b=[];b=[];for(d=0;d<language.length;d++){var f=$("<div></div>"),g=
language[d].language;$(f).css({width:"80px",height:"35px",position:"absolute"});$(f).css({left:"60px",top:45*d+10+"px"});$(f).html(g);f.attr("language",g);b.push(f);$(c.contentBox).append($(b[d]));$(b[d]).css({"font-size":"20px","text-align":"center","line-height":"35px","vertical-align":"middle",color:"#ffffff"});$(b[d]).css({"font-family":"Tahoma","border-radius":"5px",position:"absolute"});$(b[d]).css({cursor:"pointer"});$(b[d]).bind(_event._end,function(){changeLanguage($(this).attr("language"));
c.hideBox()});$(b[d]).bind(_event._enter,function(){$(this).css({background:"#transparent",border:"2px solid #ff8040"})});$(b[d]).bind(_event._end,function(){$(this).css({background:"transparent",border:""})});$(b[d]).bind(_event._leave,function(){$(this).css({background:"transparent",border:""})})}this.initEvent();$(this.background).css({display:"none"});$(this.contentBox).css({display:"none"})},onResize:function(){var b=45*language.length+10;$(this.background).css({width:windowWidth+"px",height:windowHeight+
"px"});$(this.contentBox).css({width:"200px",height:b+"px"});$(this.contentBox).css({left:(windowWidth-200)/2+"px",top:(windowHeight-b)/2+"px"})},hideBox:function(){$(this.background).fadeOut(1E3);$(this.contentBox).fadeOut(1E3);this.showing=!1},showshow:function(){$(this.background).css({display:"block"});$(this.contentBox).fadeIn(1E3);this.showing=!0},getShowStatu:function(){return this.showing},initEvent:function(){var b=this;$(this.background).bind(_event._end,function(){b.hideBox();b.showing=
!1})}}),phoneLanguageChange=Class({create:function(b){this.contentBox=b;this.width=this.contentBox.width();this.height=foldingMenu.height-foldingMenu.getItemById("miLanguage").title.height();this.mainColor=colorDiv(bookConfig.toolbarColor,30);this.itemArray=[];this.isDrag=!1;this.scrollBox=$("<div></div>");this.contentBox.append(this.scrollBox);$(this.contentBox).css({background:this.mainColor});for(b=0;b<language.length;b++)language[b].language&&this.addItem(language[b].language);this.initScrollBox();
this.scrollBox.css("height",50*language.length)},initScrollBox:function(){this.scrollBox.css({"line-height":"50px","verticale-align":"middle","font-size":"20px",color:"#ffffff","font-family":"Arial,Tahoma"})},addItem:function(b){var c=$("<div style='position:relative;cursor:pointer;width:100%;height:50px;'></div>"),d=$("<img style='position:absolute;display:none;width:25px;height:25px;top:13px;right:15px;'/>");d.attr("src",toolBarIconsURL[38]);var f=$("<div/>");f.css({"line-height":"50px","font-size":"13px"});
c.css("border-top","1px solid "+colorAdd(this.mainColor,10));c.css("border-bottom","1px solid "+colorDiv(this.mainColor,10));c.append($(f));c.append($(d));$(f).html("&nbsp;&nbsp;&nbsp;"+b);b.toLowerCase()===bookConfig.language.toLowerCase()&&(d.show(),this.currentItem=c);this.scrollBox.append(c);c.bind(_event._end,function(){b&&""!=b&&global.phoneLanguageBody&&!global.phoneLanguageBody.isDrag&&(bookConfig.language=b,selectLanguage(bookConfig.language),toolBar.changeLanguage&&toolBar.changeLanguage(),
this.currentItem&&this.currentItem.find("img").hide(),this.currentItem=c,d.show())}.bind(this))},initEvent:function(){ScrollFunction(this.scrollBox,this.contentBox,this)},onResize:function(){}}).extend(languageChange),AnnotationPannel=Class({create:function(b){var c=this;this.width=65;this.itemWidth=37;this.itemHeight=33;this.showButtonHeight=18;this.padding=8;isBelowIE9()?this.buttonCount=6:this.buttonCount=7;this.itemBoxWidth=this.width-10;this.itemBoxHeight=this.buttonCount*(this.itemHeight+this.padding)+
2*this.padding+this.itemHeight;this.height=this.itemBoxHeight+this.showButtonHeight+10;this.background=$("<div></div>");this.showHideButton=$("<div></div>");this.contentBox=$("<div></div>");b.append(this.background);this.background.append(this.showHideButton);this.background.append(this.contentBox);this.background.css({width:this.width+"px",height:this.height+"px",left:"100px",top:(windowHeight-this.height)/2+"px","z-index":"10",position:"absolute"});this.contentBox.css({width:this.itemBoxWidth+"px",
height:this.itemBoxHeight+"px",left:(this.width-this.itemBoxWidth)/2+"px",top:6+this.showButtonHeight+"px",position:"absolute",background:"#535353","border-top":"1px solid #6a6a6a","border-radius":"0px 0px 2px 2px","-webkit-box-shadow":"0 0 5px rgba(54, 54, 54, 0.95)","-moz-box-shadow":"0 0 5px rgba(54, 54, 54, 0.95)","-o-box-shadow":"0 0 5px rgba(54, 54, 54, 0.95)","box-shadow":"0 0 5px rgba(54, 54, 54, 0.95)"});this.showHideButton.css({top:"5px",left:(this.width-this.itemBoxWidth)/2+"px",width:this.itemBoxWidth+
"px",height:this.showButtonHeight+"px",position:"absolute","border-radius":"3px 3px 0px 0px","border-bottom":"1px solid #000000",background:"#383838","-webkit-box-shadow":"0 0 5px rgba(54, 54, 54, 0.95)","-moz-box-shadow":"0 0 5px rgba(54, 54, 54, 0.95)","-o-box-shadow":"0 0 5px rgba(54, 54, 54, 0.95)","box-shadow":"0 0 5px rgba(54, 54, 54, 0.95)"});b=$("<img/>");b.attr("src",uiBaseURL+"noteclose.png");b.css({position:"absolute",right:"5px",width:10,height:10,top:(this.showButtonHeight-10)/2+"px"});
b.asImageButton();b.bind(_event._end,function(){c.hideBox()});this.showHideButton.append(b);this.buttonType=0;CreateNoteRemark.bind(this)();this.addItem(this.contentBox);this.addSonItem(this.background);this.changeCursor();this.initEvent();this.background.css("display","none");this.showing=!1},addItem:function(b){for(var c=this,d=this.buttonType=0;d<this.buttonCount;d++){var f=$("<div></div>"),g=$("<img/>");$(f).attr("buttonType",d);f.css({width:c.itemWidth+"px",height:c.itemHeight+"px",left:(c.itemBoxWidth-
c.itemWidth)/2+"px",top:c.itemWidth/2+c.padding+d*(c.itemHeight+this.padding)+"px",position:"absolute","border-radius":"2px"});g.css({"margin-left":"5px","margin-top":"3px",position:"absolute"});b.append(f);f.append(g);f.bind(_event._over,function(){$(this).removeClass();$(this).attr("class","item-enter")});f.bind(_event._end,function(){$(this).removeClass();$(this).attr("class","item-enter")});f.bind(_event._leave,function(){c.buttonType!=$(this).attr("buttonType")&&($(this).removeClass(),$(this).attr("class",
"item-transparent"))});switch(d){case 0:g.attr("src",uiBaseURL+"cursor.png");g.attr("title","cursor");c.cursorButton=f;$(f).bind(_event._down,function(){c.resetButton()});break;case 1:g.attr("src",uiBaseURL+"highligh.png");g.attr("title","add highlight");$(f).bind(_event._down,function(){global.annotationImage.offCreateEvents();annotationShapes.delEvents();isBelowIE9()||signature.hide();textRemark.unbindCreateEvents();textRemark.addHighlightEvent();noteCookie.hide();cursor=!1;1!=c.buttonType&&c.changeCursor();
c.buttonType=1;c.selectButton=c.highLightButton;c.shapesPanelHide()});c.highLightButton=f;break;case 2:g.attr("src",uiBaseURL+"remark.png");g.attr("title","add texts");$(f).bind(_event._down,function(){global.annotationImage.offCreateEvents();annotationShapes.delEvents();isBelowIE9()||signature.hide();textRemark.unbindCreateEvents();textRemark.addEvents();noteCookie.hide();cursor=!1;2!=c.buttonType&&c.changeCursor();c.buttonType=2;c.selectButton=c.textRemarkButton;c.shapesPanelHide()});c.textRemarkButton=
f;break;case 3:g.attr("src",uiBaseURL+"shape.png");g.attr("title","add shapes");$(f).bind(_event._down,function(){global.annotationImage.offCreateEvents();annotationShapes.delEvents();isBelowIE9()||signature.hide();textRemark.unbindCreateEvents();noteCookie.hide();cursor=!1;3!=c.buttonType&&c.changeCursor();c.buttonType=3;c.selectButton=c.shapeButton});$(f).bind(_event._over,function(){});$(f).bind(_event._leave,function(){3!=c.buttonType&&c.shapesPanelHide()});$(f).bind(_event._end,function(){c.shapesPanelShowOrHide()});
c.shapeButton=f;break;case 4:g.attr("src",uiBaseURL+"notesadd.png");g.attr("title","add notes");$(f).bind(_event._down,function(){global.annotationImage.offCreateEvents();annotationShapes.delEvents();isBelowIE9()||signature.hide();textRemark.unbindCreateEvents();noteCookie.showHide();cursor=!1;4!=c.buttonType&&c.changeCursor();c.buttonType=4;c.selectButton=c.noteCookieButton;c.shapesPanelHide()});c.noteCookieButton=f;break;case 5:g.attr("src",uiBaseURL+"addImage.png");g.attr("title","add image file");
$(f).bind(_event._down,function(){annotationShapes.delEvents();isBelowIE9()||signature.hide();textRemark.unbindCreateEvents();global.annotationImage.addCreateEvents();noteCookie.hide();cursor=!1;5!=c.buttonType&&c.changeCursor();c.buttonType=5;c.selectButton=c.annotationImageButton;c.shapesPanelHide()});c.annotationImageButton=f;break;case 6:g.attr("src",uiBaseURL+"signature.png"),g.attr("title","add signature"),$(f).bind(_event._down,function(){global.annotationImage.offCreateEvents();annotationShapes.delEvents();
isBelowIE9()||signature.showHide();textRemark.unbindCreateEvents();noteCookie.hide();cursor=!1;6!=c.buttonType&&c.changeCursor();c.buttonType=6;c.selectButton=c.signatureButton;c.shapesPanelHide()}),c.signatureButton=f}}},addSonItem:function(b){var c=parseInt(this.contentBox.css("left"))+parseInt(this.contentBox.css("width")),d=parseInt(this.shapeButton.css("top"))+parseInt(this.contentBox.css("top"))-this.padding/2,f=(parseInt(this.contentBox.css("width"))-this.itemWidth)/2+8;this.shapesPannel=$("<div></div>");
this.shapesContentBox=$("<div></div>");this.shapesPannel.css({width:f+180+8,height:49,position:"absolute",left:c-f+"px",top:d+"px"});this.shapesContentBox.css({width:188,height:49,position:"absolute",left:f+"px",background:"#535353","border-radius":"0px 2px 2px 0px","-webkit-box-shadow":"0 0 5px rgba(54, 54, 54, 0.95)","-moz-box-shadow":"0 0 5px rgba(54, 54, 54, 0.95)","-o-box-shadow":"0 0 5px rgba(54, 54, 54, 0.95)","box-shadow":"0 0 5px rgba(54, 54, 54, 0.95)"});b.append(this.shapesPannel);this.shapesPannel.append(this.shapesContentBox);
this.shapesPanelHide();var g=this;this.shapesPannel.bind(_event._end+" "+_event._enter,function(){g.shapesPanelShow()});for(b=0;4>b;b++){var f=$("<div></div>"),h=$("<img/>"),d=8,c=8+45*b;f.css({width:"37px",height:"33px",left:c+"px",top:d+"px",position:"absolute","border-radius":"2px"});h.css({"margin-left":"5px","margin-top":"3px",position:"absolute"});this.shapesContentBox.append(f);f.append(h);switch(b){case 0:h.attr("src",uiBaseURL+"shapes_line.png");h.attr("title","add line");$(f).bind(_event._down,
function(){g.clickShape();annotationShapes.addEvents("line");g.shapesPanelHide()});break;case 1:h.attr("src",uiBaseURL+"shapes_arrow.png");h.attr("title","add arrow");$(f).bind(_event._down,function(){g.clickShape();annotationShapes.addEvents("arrow");g.shapesPanelHide()});break;case 2:h.attr("src",uiBaseURL+"shapes_rect.png");h.attr("title","add rect");$(f).bind(_event._down,function(){g.clickShape();annotationShapes.addEvents("rect");g.shapesPanelHide()});break;case 3:h.attr("src",uiBaseURL+"shapes_ellipse.png"),
h.attr("title","add ellipse"),$(f).bind(_event._down,function(){g.clickShape();annotationShapes.addEvents("ellipse");g.shapesPanelHide()})}f.bind(_event._over,function(){$(this).removeClass();$(this).attr("class","item-enter")});f.bind(_event._end,function(){$(this).removeClass();$(this).attr("class","item-transparent")});f.bind(_event._leave,function(){$(this).removeClass();$(this).attr("class","item-transparent")})}},shapesPanelShow:function(){this.shapesPannelShowHide=!0;this.shapesPannel.show()},
shapesPanelHide:function(){this.shapesPannelShowHide=!1;this.shapesPannel.hide()},shapesPanelShowOrHide:function(){this.shapesPannelShowHide?this.shapesPanelHide():this.shapesPanelShow()},clickShape:function(){},resetButton:function(){cursor=!0;0!=this.buttonType&&this.changeCursor();this.buttonType=0;this.selectButton=this.cursorButton;this.shapesPanelHide();void 0!=textRemark&&textRemark.unbindCreateEvents();void 0!=noteCookie&&noteCookie.hide();void 0!=annotationShapes&&annotationShapes.delEvents();
void 0==signature||isBelowIE9()||signature.hide();void 0!=global.annotationImage&&global.annotationImage.offCreateEvents()},changeCursor:function(){void 0==this.selectButton&&(this.selectButton=this.cursorButton);cursor?($(this.selectButton).removeClass(),$(this.selectButton).attr("class","item-transparent"),$(this.cursorButton).removeClass(),$(this.cursorButton).attr("class","item-enter")):($(this.selectButton).removeClass(),$(this.selectButton).attr("class","item-transparent"))},onResize:function(){this.background.css({left:"100px",
top:(windowHeight-this.height)/2+"px"})},hideBox:function(){$(this.background).fadeOut(500);this.showing=!1;this.resetButton()},showshow:function(){$(this.background).fadeIn(500);this.showing=!0},getShowStatu:function(){return this.showing},initEvent:function(){$(this.background).dragToMove(this.background)}}),phoneSetting=Class({create:function(b){this.width=b.width();this.height=foldingMenu.height-foldingMenu.getItemById("miSetting").title.height();this.mainColor=colorDiv(bookConfig.toolbarColor,
30);this.isDrag=!1;this.itemArray=[];this.contentBox=$("<div></div>");b.append(this.contentBox);this.initContent()},initContent:function(){this.contentBox.css({width:this.width-40,height:this.height,left:20,"vertical-align":"middle",color:"#ffffff","font-family":"Arial,Tahoma",position:"absolute"});this.scrollBox=$("<div style='position:absolute;width:100%;'></div>");this.contentBox.append(this.scrollBox);this.addItem()},addItem:function(){for(var b=0;2>b;b++){var c=$("<div style='position:relative;width:100%;height:60px;'></div>"),
d=$("<div style='position:absolute;width:100%;height:35px;'></div>");d.css({"border-radius":"5px",position:"absolute",bottom:"0px","line-height":"35px","font-size":"15px",background:colorDiv(bookConfig.toolbarColor,20)});c.append(d);this.itemArray.push({element:c,title:d})}this.scrollBox.append(this.itemArray[0].element);for(b=0;3>b;b++)if(2==b)c=this.itemArray[1].element,c.css("border-top","1px solid "+colorAdd(this.mainColor,10));else{var c=$("<div style='position:relative;width:100%;height:50px;'></div>"),
f=$("<img style='position:absolute;cursor:pointer;width:25px;height:25px;top:13px;right:15px;'/>");f.attr("src",toolBarIconsURL[38]);d=$("<div/>");d.css({"line-height":"50px","font-size":"13px"});0!=b&&3!=b&&c.css("border-top","1px solid "+colorAdd(this.mainColor,10));5!=b&&(c.css("border-bottom","1px solid "+colorDiv(this.mainColor,10)),c.append($(d)),c.append($(f)),c.css({cursor:"pointer"}));this.scrollBox.append(c);this.itemArray.push({element:c,title:d,icon:f})}this.initDifferItem();this.initItemEvent()},
initDifferItem:function(){this.itemArray[0].title.html("&nbsp;&nbsp;&nbsp;"+getLanguage("soundSettingTitle","Sound Setting"));this.itemArray[1].title.html("&nbsp;&nbsp;&nbsp;"+getLanguage("pageSettingTitle","Page Setting"));this.itemArray[2].title.html("&nbsp;&nbsp;&nbsp;"+getLanguage("closeFlipSound","Close Flip Sound"));this.itemArray[3].title.html("&nbsp;&nbsp;&nbsp;"+getLanguage("closeBackgroundSound","Close Background Sound"));bookConfig.FlipSound||this.itemArray[2].element.hide();userConfig.bgSoundButtonVisible||
this.itemArray[3].element.hide();bookConfig.FlipSound||userConfig.bgSoundButtonVisible||this.itemArray[0].element.hide();this.itemArray[3].element.attr("id","btnSound");isFlipBook()},initItemEvent:function(){this.itemArray[2].element.bind(_event._end,function(){bookConfig.FlipSound=!bookConfig.FlipSound;bookConfig.FlipSound?this.itemArray[2].icon.attr("src",toolBarIconsURL[38]):this.itemArray[2].icon.attr("src",toolBarIconsURL[39])}.bind(this));this.itemArray[3].element.bind(_event._end,function(){!0===
isPlaying?this.itemArray[3].icon.attr("src",toolBarIconsURL[39]):this.itemArray[3].icon.attr("src",toolBarIconsURL[38])}.bind(this))},changeLanguage:function(){this.itemArray[0].title.html("&nbsp;&nbsp;&nbsp;"+getLanguage("soundSettingTitle","Sound Setting"));this.itemArray[1].title.html("&nbsp;&nbsp;&nbsp;"+getLanguage("pageSettingTitle","Page Setting"));this.itemArray[2].title.html("&nbsp;&nbsp;&nbsp;"+getLanguage("closeFlipSound","Close Flip Sound"));this.itemArray[3].title.html("&nbsp;&nbsp;&nbsp;"+
getLanguage("closeBackgroundSound","Close Background Sound"))}}),phoneGotoPage=Class({create:function(b){this.mainColor="#000000";this.menu=$("<div id='menu' style='position:absolute;width:100%;height:75px;z-index:98;bottom:-80px;'></div>");this.background=$("<div id='background' style='position:absolute;width:100%;height:75px;'></div>");this.contentBox=$("<div id='contentBox' class='phoneGotoPageContent' style='position:absolute;width:100%;height:75px;'></div>");this.background.css({background:this.mainColor,
opacity:0.8});b.append(this.menu);this.menu.append(this.background);this.menu.append(this.contentBox);this.initContentBox();this.initEvent();this.visible=!1},initContentBox:function(){this.contentBox.css({"text-align":"center",display:"inline-block"});this.firstButton=$("<div class='btn' style='margin-left:0px;'></div>");this.prevButton=$("<div class='btn'></div>");this.nextButton=$("<div class='btn'></div>");this.lastButton=$("<div class='btn'></div>");this.goButton=$("<div class='goBtn'></div>");
this.firstButton.addCssSprite(phoneIconsURL[0],"firstBtn",25,25,phoneIconInfo);this.prevButton.addCssSprite(phoneIconsURL[0],"prevBtn",25,25,phoneIconInfo);this.nextButton.addCssSprite(phoneIconsURL[0],"nextBtn",25,25,phoneIconInfo);this.lastButton.addCssSprite(phoneIconsURL[0],"lastBtn",25,25,phoneIconInfo);this.goButton.addCssSprite(phoneIconsURL[0],"goBtn",20,20,phoneIconInfo);this.inputButton=$("<div class='inputButton' style='width:100px;'><input id='currentPageIndexTextField' type='text'/></div>");
this.contentBox.append(this.firstButton);this.contentBox.append(this.prevButton);this.contentBox.append(this.inputButton);this.contentBox.append(this.nextButton);this.contentBox.append(this.lastButton);this.inputButton.append(this.goButton);$("#currentPageIndexTextField").css({padding:"0px","text-align":"center","border-width":"0px",background:"#ffffff",width:"70px","padding-right":"30px",height:"35px","border-radius":"0px",position:"absolute",left:0,top:0})},show:function(){this.menu.animate({bottom:40},
300);this.visible=!0},hide:function(){this.menu.animate({bottom:-80},300);this.visible=!1},showOrHide:function(){!0===this.visible?this.hide():this.show()},initEvent:function(){this.firstButton.bind(_event._end,function(){rightToLeft?lastPageFun():firstPageFun();return!1});this.prevButton.bind(_event._end,function(){rightToLeft?nextPageFun():previousPageFun();return!1});this.nextButton.bind(_event._end,function(){rightToLeft?previousPageFun():nextPageFun();return!1});this.lastButton.bind(_event._end,
function(){rightToLeft?firstPageFun():lastPageFun();return!1});this.goButton.bind(_event._end,function(){var b=parseInt($("#currentPageIndexTextField").val().replace(/\D/g,"")),b=Math.min(Math.max(b,1),totalPageCount);gotoPageFun(b);return!1}.bind(this))}}),homeButtonEvent=function(){if("%first page%"==userConfig.homeURL.toLowerCase())firstPageFun();else if(void 0!=userConfig.homeURL&&""!=userConfig.homeURL){var b=userConfig.homeURL;"http"!=b.substr(0,4)&&(b="http://"+b);window.open(b,bookConfig.OpenWindow)}};thumbnailBar=Class({create:function(b){this.show=!1;this.totalPageCount=bookConfig.totalPageCount;this.itemWidth=90;this.marginLeft=20;this.marginTop=10;this.itemBorderWidth=3;this.toolBarHeight=80;this.itemBorderColor="#f76c6c";this.itemArray=[];this.taskList=new TaskList;this.itemHeightArray=this.getHeightArray();this.background=$("<div id='phoneThum' style='opacity:0;display:none;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;text-align:center;position:absolute;z-index:98;background:rgba(51,51,51,0.8);width:100%;top:40px;left:0px;'></div>");
this.itemBox=$("<div style='text-align:left;display:inline-block;padding:0px 0px "+this.marginLeft+"px 0px;'></div>");b.append(this.background);this.background.append(this.itemBox);this.initEvent();this.addItem();this.setHighLight(1)},onResize:function(){this.countHorizatal=parseInt((windowWidth-this.marginLeft)/(this.itemWidth+this.marginLeft));this.countVertical=parseInt((windowHeight-this.toolBarHeight-this.marginTop)/(this.itemHeightArray.itemHeight+this.marginTop))+1;this.itemBox.css({width:this.countHorizatal*
(this.itemWidth+this.marginLeft)+this.marginLeft});this.background.css({height:windowHeight-this.toolBarHeight});this.taskList.setLargeLength(this.countHorizatal*this.countVertical)},fillContent:function(){this.interval&&!this.interval.isRunning()?this.interval.start():this.interval=function(){this.LoadCount=0;for(var b=-this.itemBox.offset().top+40,b=parseInt(b/(this.itemHeightArray.itemHeight+this.marginTop)),c=this.countHorizatal*b,b=c+this.countHorizatal*this.countVertical,b=Math.min(b,this.totalPageCount),
c=Math.max(0,c);c<b&&!(1<=this.LoadCount);c++)this.taskList.unShiftList({index:c},function(b){this.fillImage(b.index)}.bind(this))}.interval(this,60)},hideBox:function(){this.show&&this.background.animate({opacity:"0"},300,"linear",function(){this.background.hide();this.show=!1;this.interval&&this.interval.stop()}.bind(this))},showshow:function(){this.show||(this.background.show(),this.fillContent(),this.background.animate({opacity:"1"},300,"linear",function(){this.show=!0}.bind(this)))},setHighLight:function(b){this.itemArray&&
this.itemArray[b-1]&&this.itemArray[b-1].imgContainer&&this.itemArray[b-1].imgContainer.css({"border-color":this.itemBorderColor})},clearHighLight:function(){if(this.itemArray)for(var b=this.itemArray.length,c=0;c<b;c++)this.itemArray[c].imgContainer&&this.itemArray[c].imgContainer.css({"border-color":"transparent"})},fissionAll:function(){},mergeAll:function(){},showOrHide:function(){this.show?this.hideBox():this.showshow()},addItem:function(){for(var b=0;b<this.totalPageCount;b++){var c=this.initItem(b);
this.itemBox.append(c.item);this.itemArray.push(c)}},getHeightArray:function(){var b=(this.itemWidth-2*this.itemBorderWidth)*bookConfig.largePageHeight/bookConfig.largePageWidth;return{imageHeight:b,titleHeight:15,itemHeight:b+15+4*this.itemBorderWidth}},initItem:function(b){var c=$("<div style='display:inline-block;'></div>"),d=$("<p><span>"+(b+1)+"</span></p>"),f=$("<div></div>"),g=$("<img/>");c.css({cursor:"pointer",width:this.itemWidth,height:this.itemHeightArray.itemHeight,padding:this.marginTop+
"px 0px 0px "+this.marginLeft+"px","text-align":"center"});f.css({width:this.itemWidth-2*this.itemBorderWidth,height:this.itemHeightArray.imageHeight,"border-style":"solid","border-width":this.itemBorderWidth+"px","border-radius":this.itemBorderWidth+"px","border-color":"transparent"});g.css({width:"100%",height:"100%","background-color":"#ffffff","background-image":"url("+uiBaseURL+"loading.gif)","background-repeat":"no-repeat","background-position":"center"});d.css({width:this.itemWidth-2*this.itemBorderWidth,
height:this.itemHeightArray.titleHeight+"px","line-height":this.itemHeightArray.titleHeight+"px","vertical-align":"middle",color:"#eeeeee","font-family":"Arial","font-size":this.itemHeightArray.titleHeight+"px",padding:"0px",margin:"0px","border-style":"solid","border-width":this.itemBorderWidth+"px","border-color":"transparent"});c.append(f);c.append(d);f.append(g);c.attr("id",b);c.bind(_event._end,function(b){b.stopPropagation()}.bind(this));c.bind("click",function(c){gotoPageFun(b+1);this.hideBox();
c.stopPropagation()}.bind(this));return{item:c,imgContainer:f,img:g,title:d,fill:!1}},fillImageOrNot:function(b,c){return!b||"string"!=typeof b||passwardType()&&bookConfig.excludeFrontPages&&c>parseInt(bookConfig.excludeFrontPages)&&!verifyPassward()?!1:!0},fillImage:function(b){if(this.itemArray&&this.itemArray[b]&&!this.itemArray[b].fill&&this.itemArray[b].img){var c=getPageDir(b+1,"thumb",originTotalPageCount);c&&"string"==typeof c&&this.fillImageOrNot(c,b+1)&&(-1<c.indexOf(".js")?(this.LoadCount++,
global[decodeDatabasePrefix("thum")+(b+1)]&&"string"==typeof global[decodeDatabasePrefix("thum")+(b+1)]?(this.itemArray[b].img.attr("src",dataBase64Str(b+1,"thum")),this.itemArray[b].fill=!0):loadJavascript(c,function(c){this.itemArray[b].img.attr("src",dataBase64Str(b+1,"thum",c));this.itemArray[b].fill=!0}.bind(this),function(){})):(this.LoadCount++,this.itemArray[b].img.attr("src",c),this.itemArray[b].fill=!0))}},initEvent:function(){this.background.bind(_event._end,function(){this.hideBox()}.bind(this))}});loadToolBar=Class({create:function(b,c){this.visible=!1;this.icons=c;this.topBG=$("<div class='pbTopBar' id='pbTopBar' style='font-family:Arial,sans-serif;'></div>");this.bottomBG=$("<div class='pbToolBar' id='pbToolBar' style='font-family:Arial,sans-serif;'></div>");this.btnThumb=$("<div title='Thumbnails'  id='btnThumb' class='phoneMoreButton'></div>");this.btnMore=$("<div title='More'  id='btnMore' class='phoneMoreButton' ></div>");this.mainColor=bookConfig.toolbarColor;this.logo=$("<img src='"+
bookConfig.appLogoIcon+"' style='cursor:pointer;position:absolute;'/>");b.append(this.topBG);b.append(this.bottomBG);this.topBG.append(this.logo);this.topBG.append(this.btnThumb);this.topBG.append(this.btnMore);this.initToolBar();userConfig.autoPlayButtonVisible||this.btnAutoPlay.hide();global.phoneGotoPagePanel=new phoneGotoPage(tmpContainer);this.initEvent();this.visible=!1;this.initFoldingMenu();this.initThumbnail();this.enterToShow()},initToolBar:function(){this.btnMore.addCssSprite(phoneIconsURL[0],
"more",25,25,phoneIconInfo);this.btnThumb.addCssSprite(phoneIconsURL[0],"thumb",25,25,phoneIconInfo);this.btnMore.attr("title",getLanguage("btnMoreOptionsLeft","More"));this.btnThumb.attr("title",getLanguage("btnThumb","Thumb"));this.btnFirst=$("<div title='First Page' id='btnFirst' class='phonebutton' ></div>");this.btnLast=$("<div title='Last Page' id='btnLast' class='phonebutton' ></div>");this.btnGotoPage=$("<div title='Go To Page' id='btnGotoPage' class='phonebutton' ></div>");this.btnZoom=$("<div title='Zoom'  id='btnZoom'  class='phonebutton'></div>");
this.btnAutoPlay=$("<div title='Auto play' id='btnAutoPlay' class='phonebutton'></div>");this.btnSearch=$("<div title='search' id='btnSearch' class='phonebutton'></div>");this.btnTableOfContent=$("<div title='Table Of Content' id='btnTableOfContent' class='phonebutton'></div>");this.btnShoppingCart=$("<div title='shopping cart' id='btnShoppingCart' class='phonebutton'></div>");this.btnFirst.addCssSprite(phoneIconsURL[0],"first",25,25,phoneIconInfo);this.btnLast.addCssSprite(phoneIconsURL[0],"last",
25,25,phoneIconInfo);this.btnGotoPage.addCssSprite(phoneIconsURL[0],"gotoPage",25,25,phoneIconInfo);this.btnZoom.addCssSprite(phoneIconsURL[0],"zoomIn",25,25,phoneIconInfo);this.btnAutoPlay.addCssSprite(phoneIconsURL[0],"autoPlay",25,25,phoneIconInfo);this.btnSearch.addCssSprite(phoneIconsURL[0],"search",25,25,phoneIconInfo);this.btnTableOfContent.addCssSprite(phoneIconsURL[0],"tableofcontent",25,25,phoneIconInfo);this.btnShoppingCart.addCssSprite(phoneIconsURL[0],"shoppingCart",25,25,phoneIconInfo);
this.btnFirst.attr("title",getLanguage("btnFirst","first"));this.btnLast.attr("title",getLanguage("btnLast","last"));this.btnGotoPage.attr("title",getLanguage("btnGotoPage","Go To Page"));this.btnZoom.attr("title",getLanguage("btnZoomIn","zoom in"));this.btnAutoPlay.attr("title",getLanguage("btnAutoFlip","Auto flip"));this.btnSearch.attr("title",getLanguage("btnSearch","search"));this.btnTableOfContent.attr("title",getLanguage("btnTableOfContent","Table Of Content"));this.btnShoppingCart.attr("title",
getLanguage("btnShoppingCart","shopping cart"));this.btnShoppingCart.append(shoppongCountHTML);$(this.bottomBG).css({"-webkit-box-shadow":"0 0 5px rgba(40, 0, 0, 0.5)","-moz-box-shadow":"0 0 5px rgba(40, 0, 0, 0.5)","-o-box-shadow":"0 0 5px rgba(40, 0, 0, 0.5)","box-shadow":"0 0 5px rgba(40, 0, 0, 0.5)"});$(this.topBG).css({"-webkit-box-shadow":"0 0 5px rgba(40, 0, 0, 0.5)","-moz-box-shadow":"0 0 5px rgba(40, 0, 0, 0.5)","-o-box-shadow":"0 0 5px rgba(40, 0, 0, 0.5)","box-shadow":"0 0 5px rgba(40, 0, 0, 0.5)"});
this.barWidth=windowWidth;this.barHeight=40;this.bottomBG.css({width:this.barWidth+"px",height:this.barHeight+"px",bottom:"-60px"});this.topBG.css({width:this.barWidth+"px",height:this.barHeight+"px",color:"#ffffff","line-height":this.barHeight+"px",top:"-60px"});var b=colorDiv(this.mainColor,30),c=colorAdd(this.mainColor,30);this.topBG.css("background",this.mainColor);this.bottomBG.css("background",this.mainColor);this.topBG.css("border-bottom","1px solid "+b);this.bottomBG.css("border-top","1px solid "+
c);var d=getLogoLink();$(this.logo).click(function(){3==browserType?window.location=d[0]:window.open(d[0],d[1])});this.initBottomBarArray()},initBottomBarArray:function(){this.bottomBarArray=[];hasShoppingCart&&this.bottomBarArray.push(this.btnShoppingCart);isPhoneBook()||this.bottomBarArray.push(this.btnZoom);this.bottomBarArray.push(this.btnGotoPage);userConfig.autoPlayButtonVisible&&this.bottomBarArray.push(this.btnAutoPlay);searchButtonEnable&&4>this.bottomBarArray.length&&this.bottomBarArray.unshift(this.btnSearch);
tableofcontentButtonEnable&&4>this.bottomBarArray.length&&this.bottomBarArray.unshift(this.btnTableOfContent);3>this.bottomBarArray.length&&(this.bottomBarArray.unshift(this.btnFirst),this.bottomBarArray.push(this.btnLast));for(var b=0;b<this.bottomBarArray.length;b++)this.bottomBG.append(this.bottomBarArray[b])},initFoldingMenu:function(){searchButtonEnable||tableofcontentButtonEnable||shareButtonEnable||userConfig.downloadButtonVisible||userConfig.printButtonVisible||userConfig.homeButtonVisible||
userConfig.bgSoundButtonVisible||bookConfig.FlipSound||language&&!(1>=language.length)||this.btnMore.hide();var b=function(){""!=userConfig.downloadURL&&window.open(userConfig.downloadURL,"_blank")},c=function(){homeButtonEvent()};global.foldingMenu=new FoldingMenu($("#tmpContainer"));userConfig.homeButtonVisible&&foldingMenu.addMenuItem("miHome",getLanguage("btnHome","Home"),"miHome",!0,c);searchButtonEnable&&foldingMenu.addMenuItem("miSearch",getLanguage("btnSearch","Search"),"miSearch");tableofcontentButtonEnable&&
foldingMenu.addMenuItem("miTableOfContent",getLanguage("btnTableOfContent","Table of Content"),"tableofcontent");shareButtonEnable&&foldingMenu.addMenuItem("miShare",getLanguage("btnSocialShare","Share"),"miShare");userConfig.downloadButtonVisible&&foldingMenu.addMenuItem("miDownload",getLanguage("btnDownload","Download"),"download",!0,b);userConfig.printButtonVisible&&foldingMenu.addMenuItem("miPrint",getLanguage("btnPrint","Print"),"print");language&&1<language.length&&foldingMenu.addMenuItem("miLanguage",
getLanguage("btnLanguage","Language change"),"languageChange");(userConfig.bgSoundButtonVisible||bookConfig.FlipSound)&&foldingMenu.addMenuItem("miSetting",getLanguage("btnSettings","Settings"),"setting");searchButtonEnable&&(global.phoneSearch=new phoneSearchForm({caption:getLanguage("frmSearch","Search"),closeIconURL:uiBaseURL+"close.png",mainColor:bookConfig.searchBackground,fontColor:bookConfig.searchFontColor},foldingMenu.getItemBody("miSearch")));tableofcontentButtonEnable&&(global.phoneTableOfContent=
new phoneTableContent({caption:getLanguage("frmTableOfContent","Table of Content"),closeIconURL:uiBaseURL+"close.png",mainColor:bookConfig.bookmarkBackground,fontColor:bookConfig.bookmarkFontColor},foldingMenu.getItemBody("miTableOfContent")));shareButtonEnable&&(global.phoneShare=new phoneSharePanel(foldingMenu.getItemBody("miShare")));userConfig.printButtonVisible&&(global.phonePrintBody=new phonePrintBar(foldingMenu.getItemBody("miPrint")));language&&1<language.length&&(global.phoneLanguageBody=
new phoneLanguageChange(foldingMenu.getItemBody("miLanguage")));if(userConfig.bgSoundButtonVisible||bookConfig.FlipSound)global.phoneSettingBody=new phoneSetting(foldingMenu.getItemBody("miSetting"))},setButtonPosition:function(){this.bottomBG.css({width:windowWidth+"px"});this.topBG.css({width:windowWidth+"px"});this.barWidth=Math.min(windowWidth,340);this.buttonWidth=40;this.buttonTop=(this.barHeight-this.buttonWidth)/2;this.barLeft=(windowWidth-this.barWidth)/2+7;autoCenter(this.bottomBarArray,
this.barWidth-15,this.buttonWidth,this.barLeft);this.btnMore.css({left:"0px",top:this.buttonTop+"px"});this.btnThumb.css({right:"0px",top:this.buttonTop+"px"});this.logo.css({left:65+parseInt(bookConfig.logoPadding)+"px"});this.logo.css({top:(toolBar.getLogoHeight()-bookConfig.logoHeight)/2+parseInt(bookConfig.logoTop)+"px"});this.logo.css({"max-width":windowWidth-130+"px","max-height":"40px"});this.logo.css({height:bookConfig.logoHeight+"px"});$(".phonebutton").css({top:this.buttonTop+"px"})},initEvent:function(){var b=
this;this.btnShoppingCart.bind(_event._end,function(){this.enterOption&&window.clearTimeout(this.enterOption);window.shoppingCart&&window.shoppingCart.showCart()}.bind(this));this.btnSearch.bind(_event._end,function(){this.enterOption&&window.clearTimeout(this.enterOption);global.foldingMenu&&(foldingMenu.show(foldingMenu.width),foldingMenu.expandId("miSearch"));return!1}.bind(this));this.btnTableOfContent.bind(_event._end,function(){this.enterOption&&window.clearTimeout(this.enterOption);global.foldingMenu&&
(foldingMenu.show(foldingMenu.width),foldingMenu.expandId("miTableOfContent"));return!1}.bind(this));this.btnMore.bind(_event._end,function(){this.enterOption&&window.clearTimeout(this.enterOption);global.foldingMenu&&foldingMenu.showOrHide(foldingMenu.width);return!1}.bind(this));this.btnThumb.bind(_event._end,function(){this.enterOption&&window.clearTimeout(this.enterOption);thumbnail.showOrHide();return!1}.bind(this));this.btnLast.bind(_event._end,function(){this.enterOption&&window.clearTimeout(this.enterOption);
rightToLeft?firstPageFun():lastPageFun();return!1}.bind(this));this.btnFirst.bind(_event._end,function(){this.enterOption&&window.clearTimeout(this.enterOption);rightToLeft?lastPageFun():firstPageFun();return!1}.bind(this));this.btnZoom.bind(_event._end,function(){this.enterOption&&window.clearTimeout(this.enterOption);2==bookType?windowWidth<windowHeight?(bookType=1,changeShowBook(1),setCurrentIndexTextField(singlePageBook.currentPageIndex),singlePageBook.gotoPage(zoomBook.currentIndex),thumbnail.clearHighLight(),
thumbnail.setHighLight(zoomBook.currentIndex),b.changeZoomIcon(!0)):zoomBook.showPage.animateFit():(zoomBook.currentIndex=BookInfo.getBook().currentPageIndex,zoomBook.showPage.fillContent(zoomBook.currentIndex),bookType=2,changeShowBook(2),setCurrentIndexTextField(zoomBook.currentIndex,!1),thumbnail.clearHighLight(),thumbnail.setHighLight(zoomBook.currentIndex),auto_player.isPlaying()&&(auto_player.stop(),b.changeAutoPlayIcon()),b.changeZoomIcon(!1));return!1}.bind(this));this.btnAutoPlay.bind(_event._end,
function(){this.enterOption&&window.clearTimeout(this.enterOption);auto_player.isPlaying()?auto_player.stop():auto_player.start();b.changeAutoPlayIcon();return!1}.bind(this));this.btnGotoPage.bind(_event._end,function(){this.enterOption&&window.clearTimeout(this.enterOption);global.phoneGotoPagePanel.showOrHide()}.bind(this))},changeButtonColor:function(b){},changeZoomIcon:function(b){},changeFullscreenIcon:function(b){},changeAutoPlayIcon:function(b){void 0!=auto_player&&null!=auto_player&&(auto_player.isPlaying()?
(this.btnAutoPlay.children().cssSprite(phoneIconsURL[0],"stopAutoPlay",25,25,phoneIconInfo),this.btnAutoPlay.attr("title",getLanguage("btnStopAutoFlip","Stop auto flip"))):(this.btnAutoPlay.children().cssSprite(phoneIconsURL[0],"autoPlay",25,25,phoneIconInfo),this.btnAutoPlay.attr("title",getLanguage("btnAutoFlip","Auto flip"))))},changeSoundIcon:function(b){},show:function(){this.visible||(this.visible=!0,this.bottomBG.animate({bottom:0},300),this.topBG.animate({top:0},300),bookType==BookType.singlePhone_book&&
singlePhoneBook.setShow(!1),bookType==BookType.phone_book&&phoneBook.setShow(!1))},initThumbnail:function(){if(thumbButtonEnable){var b=thumbnailBar;isCatalogBook()&&"lite"==bookConfig.ToolbarViewMode.toLowerCase()&&(b=CatalogThumbnailBar);isSlideBook()&&"lite"==bookConfig.ToolbarViewMode.toLowerCase()&&(b=SlideThumbnailBar);thumbnail=new b(tmpContainer)}else this.btnThumb.hide();this.timmingArray=[this.topBG,this.bottomBG,global.phoneGotoPagePanel,global.foldingMenu]},getHeight:function(){return this.getTopHeight()+
this.getBottomHeight()},getTopHeight:function(){return miniStyle.isMini()?0:!0==this.visible?40:0},getBottomHeight:function(){return miniStyle.isMini()?0:!0==this.visible?40:0},getLogoHeight:function(){return this.topBG.height()},hide:function(){this.visible&&(this.enterOption&&window.clearTimeout(this.enterOption),this.visible=!1,this.bottomBG.animate({bottom:-60},300),this.topBG.animate({top:-60},300),global.phoneGotoPagePanel.hide(),bookType==BookType.singlePhone_book&&singlePhoneBook.setShow(!0),
bookType==BookType.phone_book&&phoneBook.setShow(!0))},enterToShow:function(){},showOrHide:function(){!0===this.visible?this.hide():this.show()},changeZoomIcon:function(b){b?(this.btnZoom.children().cssSprite(phoneIconsURL[0],"zoomIn",25,25,phoneIconInfo),this.btnZoom.attr("title",getLanguage("btnZoomIn","zoom in"))):(this.btnZoom.children().cssSprite(phoneIconsURL[0],"zoomOut",25,25,phoneIconInfo),this.btnZoom.attr("title",getLanguage("btnZoomOut","zoom out")))},changeSoundIcon:function(b){},lastPage:function(){rightToLeft?
firstPageFun():lastPageFun()},nextPage:function(){rightToLeft?previousPageFun():nextPageFun()},prePage:function(){rightToLeft?nextPageFun():previousPageFun()},firstPage:function(){rightToLeft?lastPageFun():firstPageFun()},changeLanguage:function(){this.btnMore.attr("title",getLanguage("btnMoreOptionsLeft","More"));this.btnThumb.attr("title",getLanguage("btnThumb","Thumb"));this.btnPre.attr("title",getLanguage("btnPrePage","pre"));this.btnNext.attr("title",getLanguage("btnNextPage","next"));this.btnZoom.attr("title",
getLanguage("btnZoomIn","zoom in"));this.btnAutoPlay.attr("title",getLanguage("btnAutoFlip","Auto flip"));this.btnGotoPage.attr("title",getLanguage("btnGotoPage","Go To Page"));searchButtonEnable&&foldingMenu.getItemById("miSearch").setCaption(getLanguage("btnSearch","Search"));tableofcontentButtonEnable&&foldingMenu.getItemById("miTableOfContent").setCaption(getLanguage("btnTableOfContent","Table of Content"));shareButtonEnable&&foldingMenu.getItemById("miShare").setCaption(getLanguage("btnSocialShare",
"Share"));userConfig.downloadButtonVisible&&foldingMenu.getItemById("miDownload").setCaption(getLanguage("btnDownload","Download"));userConfig.printButtonVisible&&foldingMenu.getItemById("miPrint").setCaption(getLanguage("btnPrint","Print"));language&&1<language.length&&foldingMenu.getItemById("miLanguage").setCaption(getLanguage("btnLanguage","Language change"));userConfig.printButtonVisible&&global.phonePrintBody.changeLanguage();(userConfig.bgSoundButtonVisible||bookConfig.FlipSound)&&global.phoneSettingBody.changeLanguage()}});function initMoreButton(b,c,d,f){this.name=c;this.moreButtonString="<div class='moreButton' id='"+c+"'></div>";this.moreButton=$(this.moreButtonString);this.moreImg=$("<div><img src='"+d+"' class='moreImg'/></div>");this.moreLable=new label(f,this.moreButton);this.moreLable.setLabelPosition(35,7);b.append(this.moreButton);$(this.moreButton).append(this.moreImg);$(this.moreButton).append(this.moreLable);$(this.moreLable).css({"vertical-align":"middle"});$(this.moreButton).css({"text-shadow":"1px 1px "+
colorDiv(bookConfig.toolbarColor,40)});$(this.moreButton).css({color:"#ffffff"});$(this.moreButton).mouseEnterGradient(bookConfig.toolbarColor,colorDiv(bookConfig.toolbarColor,30),colorAdd(bookConfig.toolbarColor,105));$(this.moreButton).css({cursor:"pointer"});return this}initMoreButton.prototype.setPosition=function(b,c){$(this.moreButton).css({left:c+"px"});$(this.moreButton).css({top:b+"px"})};initMoreButton.prototype.changeIcon=function(b){this.moreImg.empty().append("<img src='"+b+"' class='moreImg'/>")};
initMoreButton.prototype.src=function(){return this.moreImg.attr("src")};initMoreButton.prototype.bind=function(b,c){$(this.moreButton).bind(b,c)};initMoreButton.prototype.hide=function(){$(this.moreButton).css({display:"none"})};initMoreButton.prototype.show=function(){$(this.moreButton).css({display:"block"})};initMoreButton.prototype.changeButtonColor=function(b){$(this.moreImg).changeButtonColor(b)};initMoreButton.prototype.setCaption=function(b){this.moreLable.setCaption(b)};var isMoreShow=!1,moreConfig={autoPlayButtonVisible:!1,zoomButtonEnable:!1,thumbButtonEnable:!1,shareButtonEnable:!1,searchButtonEnable:!1,bookmarkButtonEnable:!1,tableofcontentButtonEnable:!1,downloadButtonVisible:!1,homeButtonVisible:!1,printButtonVisible:!1,bgSoundButtonVisible:!1,helpButtonVisible:!1,aboutButtonVisible:!1,languageButtonVisible:!1,flipButtonVisible:!1,fullscreenButtonVisible:!1,AnnotationButtonVisible:!1,VideoButtonVisible:!1,SlideshowButtonVisible:!1};
function initMoreBar(){var b=this;this.moreBar=$("<div style='display:none;opacity:0;'>");this.moreBar.css("z-index",2002);this.moreBar.css("bottom","38px");this.moreBar.css("right","300px");this.moreBar.css({width:"160px",position:"absolute",background:bookConfig.toolbarColor,"overflow-y":"auto"});this.moreBar.addBorderShadow(bookConfig.toolbarColor,3,3);this.btnLast=new initMoreButton(this.moreBar,"moreBtnLast",toolBarIconsURL[1],getLanguage("btnLastPage","Last"));this.btnNext=new initMoreButton(this.moreBar,
"moreBtnNext",toolBarIconsURL[2],getLanguage("btnNextPage","Next"));this.btnPrevious=new initMoreButton(this.moreBar,"moreBtnPrevious",toolBarIconsURL[3],getLanguage("btnPrePage","Previous"));this.btnFirst=new initMoreButton(this.moreBar,"moreBtnFirst",toolBarIconsURL[4],getLanguage("btnFirstPage","First"));this.btnZoom=new initMoreButton(this.moreBar,"moreBtnZoom",toolBarIconsURL[5],getLanguage("btnZoomIn","Zoom In"));this.btnAutoPlay=new initMoreButton(this.moreBar,"moreBtnAutoPlay",toolBarIconsURL[7],
getLanguage("btnAutoFlip","Auto Flip"));this.btnThumb=new initMoreButton(this.moreBar,"moreBtnThumb",toolBarIconsURL[9],getLanguage("btnThumb","Thumbnails"));this.btnShare=new initMoreButton(this.moreBar,"moreBtnShare",toolBarIconsURL[10],getLanguage("btnSocialShare","Share"));this.btnSearch=new initMoreButton(this.moreBar,"moreBtnSearch",toolBarIconsURL[11],getLanguage("btnSearch","Search"));this.btnBookMark=new initMoreButton(this.moreBar,"moreBtnBookMark",toolBarIconsURL[14],getLanguage("btnBookMark",
"Book Mark"));this.btnTableOfContent=new initMoreButton(this.moreBar,"moreBtnTableOfContent",toolBarIconsURL[32],getLanguage("btnTableOfContent","table of content"));this.btnDownload=new initMoreButton(this.moreBar,"moreBtnDownload",toolBarIconsURL[12],getLanguage("btnDownload","Download"));this.btnHome=new initMoreButton(this.moreBar,"moreBtnHome",toolBarIconsURL[13],getLanguage("btnGoToHome","Home"));this.btnPrint=new initMoreButton(this.moreBar,"moreBtnPrint",toolBarIconsURL[21],getLanguage("btnPrint",
"Print"));this.btnSound=new initMoreButton(this.moreBar,"moreBtnSound",toolBarIconsURL[15],getLanguage("btnSoundOn","soundOn"));this.btnHelp=new initMoreButton(this.moreBar,"moreBtnHelp",toolBarIconsURL[22],getLanguage("btnHelp","Help"));this.btnAbout=new initMoreButton(this.moreBar,"moreBtnAbout",toolBarIconsURL[23],getLanguage("btnAbout","About"));this.btnLanguage=new initMoreButton(this.moreBar,"moreBtnLanguage",toolBarIconsURL[25],getLanguage("btnLanguage","LanguageChange"));this.btnFullscreen=
new initMoreButton(this.moreBar,"moreBtnFullscreen",toolBarIconsURL[27],getLanguage("btnFullscreen","fullscreen"));this.btnNote=new initMoreButton(this.moreBar,"moreBtnNote",toolBarIconsURL[31],getLanguage("btnNote","add note"));this.btnVideo=new initMoreButton(this.moreBar,"moreBtnVideo",toolBarIconsURL[33],getLanguage("btnVideo","videoGallery"));this.btnSlideShow=new initMoreButton(this.moreBar,"moreBtnSlideShow",toolBarIconsURL[34],getLanguage("btnSlideShow","photoGallery"));$.fn.extend(this,{showMoreBar:function(){b.moreBar.css("display",
"block");b.moreBar.animate({opacity:1},200,"linear")},hideMoreBar:function(){b.moreBar.animate({opacity:0},200,"linear",function(){b.moreBar.css("display","none")})},setMorePosition:function(c,d,f){void 0==f&&(f=["right","bottom"]);b.moreBar.css(f[0],c+"px");b.moreBar.css(f[1],d+"px")}});tmpContainer.append(this.moreBar);moreConfig.autoPlayButtonVisible&&userConfig.autoPlayButtonVisible||this.btnAutoPlay.hide();moreConfig.zoomButtonEnable&&zoomButtonEnable&&isFlipModel||this.btnZoom.hide();moreConfig.thumbButtonEnable&&
thumbButtonEnable||this.btnThumb.hide();moreConfig.shareButtonEnable&&shareButtonEnable||this.btnShare.hide();moreConfig.searchButtonEnable&&searchButtonEnable||this.btnSearch.hide();moreConfig.bookmarkButtonEnable&&bookmarkButtonEnable||this.btnBookMark.hide();moreConfig.tableofcontentButtonEnable&&tableofcontentButtonEnable||this.btnTableOfContent.hide();moreConfig.downloadButtonVisible&&userConfig.downloadButtonVisible||this.btnDownload.hide();moreConfig.homeButtonVisible&&userConfig.homeButtonVisible||
this.btnHome.hide();moreConfig.printButtonVisible&&userConfig.printButtonVisible||this.btnPrint.hide();moreConfig.bgSoundButtonVisible&&userConfig.bgSoundButtonVisible||this.btnSound.hide();moreConfig.helpButtonVisible&&userConfig.helpButtonVisible||this.btnHelp.hide();moreConfig.aboutButtonVisible&&userConfig.aboutButtonVisible||this.btnAbout.hide();(!moreConfig.languageButtonVisible||1>=language.length)&&this.btnLanguage.hide();moreConfig.fullscreenButtonVisible&&userConfig.fullscreenButtonVisible||
this.btnFullscreen.hide();moreConfig.AnnotationButtonVisible&&userConfig.AnnotationButtonVisible||this.btnNote.hide();moreConfig.VideoButtonVisible&&userConfig.VideoButtonVisible||this.btnVideo.hide();moreConfig.SlideshowButtonVisible&&userConfig.SlideshowButtonVisible||this.btnSlideShow.hide();moreConfig.flipButtonVisible||(this.btnLast.hide(),this.btnNext.hide(),this.btnPrevious.hide(),this.btnFirst.hide());this.initEvent()}
initMoreBar.prototype.onResize=function(b,c){isMoreShow=!1;var d=0;shareButtonTop=function(b){return 8+35*b};moreConfig.flipButtonVisible?(this.btnLast.setPosition(shareButtonTop(d),10),d++,this.btnNext.setPosition(shareButtonTop(d),10),d++,this.btnPrevious.setPosition(shareButtonTop(d),10),d++,this.btnFirst.setPosition(shareButtonTop(d),10),d++,this.btnFirst.show(),this.btnPrevious.show(),this.btnNext.show(),this.btnLast.show()):(this.btnFirst.hide(),this.btnPrevious.hide(),this.btnNext.hide(),this.btnLast.hide());
moreConfig.autoPlayButtonVisible&&userConfig.autoPlayButtonVisible?(this.btnAutoPlay.setPosition(shareButtonTop(d),10),this.btnAutoPlay.show(),d++):this.btnAutoPlay.hide();moreConfig.AnnotationButtonVisible&&userConfig.AnnotationButtonVisible?(this.btnNote.setPosition(shareButtonTop(d),10),this.btnNote.show(),d++):this.btnNote.hide();moreConfig.VideoButtonVisible&&userConfig.VideoButtonVisible?(this.btnVideo.setPosition(shareButtonTop(d),10),this.btnVideo.show(),d++):this.btnVideo.hide();moreConfig.SlideshowButtonVisible&&
userConfig.SlideshowButtonVisible?(this.btnSlideShow.setPosition(shareButtonTop(d),10),this.btnSlideShow.show(),d++):this.btnSlideShow.hide();moreConfig.zoomButtonEnable&&zoomButtonEnable&&isFlipModel?(this.btnZoom.setPosition(shareButtonTop(d),10),this.btnZoom.show(),d++):this.btnZoom.hide();moreConfig.thumbButtonEnable&&thumbButtonEnable?(this.btnThumb.setPosition(shareButtonTop(d),10),this.btnThumb.show(),d++):this.btnThumb.hide();moreConfig.shareButtonEnable&&shareButtonEnable?(this.btnShare.setPosition(shareButtonTop(d),
10),this.btnShare.show(),d++):this.btnShare.hide();moreConfig.searchButtonEnable&&searchButtonEnable?(this.btnSearch.setPosition(shareButtonTop(d),10),this.btnSearch.show(),d++):this.btnSearch.hide();moreConfig.bookmarkButtonEnable&&bookmarkButtonEnable?(this.btnBookMark.setPosition(shareButtonTop(d),10),this.btnBookMark.show(),d++):this.btnBookMark.hide();moreConfig.tableofcontentButtonEnable&&tableofcontentButtonEnable?(this.btnTableOfContent.setPosition(shareButtonTop(d),10),this.btnTableOfContent.show(),
d++):this.btnTableOfContent.hide();moreConfig.downloadButtonVisible&&userConfig.downloadButtonVisible?(this.btnDownload.setPosition(shareButtonTop(d),10),this.btnDownload.show(),d++):this.btnDownload.hide();moreConfig.homeButtonVisible&&userConfig.homeButtonVisible?(this.btnHome.setPosition(shareButtonTop(d),10),this.btnHome.show(),d++):this.btnHome.hide();moreConfig.printButtonVisible&&userConfig.printButtonVisible?(this.btnPrint.setPosition(shareButtonTop(d),10),this.btnPrint.show(),d++):this.btnPrint.hide();
moreConfig.bgSoundButtonVisible&&userConfig.bgSoundButtonVisible?(this.btnSound.setPosition(shareButtonTop(d),10),this.btnSound.show(),d++):this.btnSound.hide();moreConfig.helpButtonVisible&&userConfig.helpButtonVisible?(this.btnHelp.setPosition(shareButtonTop(d),10),this.btnHelp.show(),d++):this.btnHelp.hide();moreConfig.aboutButtonVisible&&userConfig.aboutButtonVisible?(this.btnAbout.setPosition(shareButtonTop(d),10),this.btnAbout.show(),d++):this.btnAbout.hide();moreConfig.languageButtonVisible&&
1<language.length?(this.btnLanguage.setPosition(shareButtonTop(d),10),this.btnLanguage.show(),d++):this.btnLanguage.hide();moreConfig.fullscreenButtonVisible&&userConfig.fullscreenButtonVisible?(this.btnFullscreen.setPosition(shareButtonTop(d),10),this.btnFullscreen.show(),d++):this.btnFullscreen.hide();0==d?(b.css({display:"none"}),null!=c&&c.css({display:"none"}),this.hideMoreBar()):(b.css({display:"block"}),null!=c&&c.css({display:"block"}),d=Math.min(shareButtonTop(d),250),this.moreBar.css({height:d+
"px"}));(function(){this.changeButtonColor(bookConfig.iconColor)}).delay(this,50)};initMoreBar.prototype.changeZoomIcon=function(b){b?(this.btnZoom.changeIcon(toolBarIconsURL[5]),this.btnZoom.setCaption(getLanguage("btnZoomIn","Zoom In"))):(this.btnZoom.changeIcon(toolBarIconsURL[6]),this.btnZoom.setCaption(getLanguage("btnZoomOut","Zoom Out")));this.btnZoom.changeButtonColor(bookConfig.iconColor)};
initMoreBar.prototype.changeFullscreenIcon=function(b){b?(this.btnFullscreen.changeIcon(toolBarIconsURL[28]),this.btnFullscreen.setCaption(getLanguage("btnFullscreen","Exit fullscreen"))):(this.btnFullscreen.changeIcon(toolBarIconsURL[27]),this.btnFullscreen.setCaption(getLanguage("btnFullscreen","Enter fullscreen")));this.btnFullscreen.changeButtonColor(bookConfig.iconColor)};
initMoreBar.prototype.changeAutoPlayIcon=function(b){void 0!=auto_player&&null!=auto_player&&(auto_player.isPlaying()?(this.btnAutoPlay.changeIcon(toolBarIconsURL[7]),this.btnAutoPlay.setCaption(getLanguage("btnAutoFlip","Auto Flip"))):(this.btnAutoPlay.changeIcon(toolBarIconsURL[8]),this.btnAutoPlay.setCaption(getLanguage("btnStopAutoFlip","Stop Auto Flip"))),this.btnAutoPlay.changeButtonColor(bookConfig.iconColor))};
initMoreBar.prototype.changeSoundIcon=function(b){void 0!=isPlaying&&(isPlaying?(this.btnSound.changeIcon(toolBarIconsURL[16]),this.btnSound.setCaption(getLanguage("btnSoundOff","soundOff"))):(this.btnSound.changeIcon(toolBarIconsURL[15]),this.btnSound.setCaption(getLanguage("btnSoundOn","soundOn"))),this.btnSound.changeButtonColor(bookConfig.iconColor))};initMoreBar.prototype.height=function(){return this.moreBar.height()};
initMoreBar.prototype.initEvent=function(){var b=this;this.btnLast.bind(_event._end,function(){b.lastPage();moreBar.hideMoreBar();isMoreShow=!1});this.btnNext.bind(_event._end,function(){b.nextPage();moreBar.hideMoreBar();isMoreShow=!1});this.btnPrevious.bind(_event._end,function(){b.prePage();moreBar.hideMoreBar();isMoreShow=!1});this.btnFirst.bind(_event._end,function(){b.firstPage();moreBar.hideMoreBar();isMoreShow=!1});this.btnZoom.bind(_event._end,function(){2==bookType?(windowWidth<windowHeight?
(bookType=1,changeShowBook(1),setCurrentIndexTextField($(singlePageBook).data().currentPageIndex)):(bookType=0,changeShowBook(0),setCurrentIndexTextField(flipBook.currentPageIndex,!0)),gotoPageFun(zoomBook.currentIndex),thumbButtonEnable&&thumbnail.clearHighLight(),thumbButtonEnable&&thumbnail.setHighLight(zoomBook.currentIndex),b.btnZoom.changeIcon(toolBarIconsURL[5]),b.btnZoom.setCaption(getLanguage("btnZoomIn","Zoom In"))):(zoomBook.currentIndex=flipBook.currentPageIndex,zoomBook.showPage.fillContent(zoomBook.currentIndex),
bookType=2,changeShowBook(2),b.btnZoom.changeIcon(toolBarIconsURL[6]),b.btnZoom.setCaption(getLanguage("btnZoomOut","Zoom Out")),setCurrentIndexTextField(zoomBook.currentIndex,!1),thumbButtonEnable&&thumbnail.clearHighLight(),thumbButtonEnable&&thumbnail.setHighLight(zoomBook.currentIndex),auto_player.isPlaying()&&(auto_player.stop(),b.btnAutoPlay.changeIcon(toolBarIconsURL[8]),b.btnAutoPlay.setCaption(getLanguage("btnStopAutoFlip","Stop Auto Flip"))));b.btnZoom.changeButtonColor(bookConfig.iconColor);
b.btnAutoPlay.changeButtonColor(bookConfig.iconColor);moreBar.hideMoreBar();isMoreShow=!1});this.btnAutoPlay.bind(_event._end,function(){auto_player.isPlaying()?(auto_player.stop(),b.btnAutoPlay.changeIcon(toolBarIconsURL[7]),b.btnAutoPlay.setCaption(getLanguage("btnAutoFlip","Auto Flip"))):(auto_player.start(),b.btnAutoPlay.changeIcon(toolBarIconsURL[8]),b.btnAutoPlay.setCaption(getLanguage("btnStopAutoFlip","Stop Auto Flip")));b.btnAutoPlay.changeButtonColor(bookConfig.iconColor);moreBar.hideMoreBar();
isMoreShow=!1});this.btnThumb.bind(_event._end,function(){thumbnail.getShowStatu()?thumbnail.hideBox():thumbnail.showshow();moreBar.hideMoreBar();isMoreShow=!1});this.btnShare.bind(_event._end,function(){sharePanel.getShowStatu()?sharePanel.hideBox():sharePanel.showshow();moreBar.hideMoreBar();isMoreShow=!1});this.btnShare.bind(_event._down,function(){return!1});this.btnPrint.bind(_event._end,function(){printBody.getShowStatu()?printBody.hideBox():printBody.showshow();moreBar.hideMoreBar();isMoreShow=
!1});this.btnSearch.bind(_event._end,function(){frmSearch.isSearchShow?frmSearch.closeForm():frmSearch.showForm();moreBar.hideMoreBar();isMoreShow=!1});this.btnTableOfContent.bind(_event._end,function(){frmBookmark.getShowStatu()?frmBookmark.closeForm():frmBookmark.showForm();moreBar.hideMoreBar();isMoreShow=!1});this.btnBookMark.bind(_event._end,function(){bookmark.showHide();moreBar.hideMoreBar();isMoreShow=!1});this.btnDownload.bind(_event._end,function(){""!=userConfig.downloadURL&&(window.location=
userConfig.downloadURL);moreBar.hideMoreBar();isMoreShow=!1});this.btnSound.bind(_event._end,function(){isPlaying?(b.btnSound.changeIcon(toolBarIconsURL[16]),b.btnSound.setCaption(getLanguage("btnSoundOff","soundOff"))):(b.btnSound.changeIcon(toolBarIconsURL[15]),b.btnSound.setCaption(getLanguage("btnSoundOn","soundOn")));b.btnSound.changeButtonColor(bookConfig.iconColor);moreBar.hideMoreBar();isMoreShow=!1});this.btnHome.bind(_event._end,function(){homeButtonEvent();moreBar.hideMoreBar();isMoreShow=
!1});this.btnHelp.bind(_event._end,function(){helpBody.getShowStatu()?helpBody.hideBox():helpBody.showshow();moreBar.hideMoreBar();isMoreShow=!1});this.btnAbout.bind(_event._end,function(){aboutBody.getShowStatu()?aboutBody.hideBox():aboutBody.showshow();moreBar.hideMoreBar();isMoreShow=!1});this.btnLanguage.bind(_event._end,function(){languagePanel.getShowStatu()?languagePanel.hideBox():languagePanel.showshow();moreBar.hideMoreBar();isMoreShow=!1});this.btnNote.bind(_event._end,function(){annotationPannel.getShowStatu()?
annotationPannel.hideBox():annotationPannel.showshow();moreBar.hideMoreBar();isMoreShow=!1});this.btnVideo.bind(_event._end,function(){videoGallery.showHide();moreBar.hideMoreBar();isMoreShow=!1});this.btnSlideShow.bind(_event._end,function(){photoGallery.showHide();moreBar.hideMoreBar();isMoreShow=!1});this.btnFullscreen.bind(_event._end,function(){fullscreenFun();return!1});$(document).bind(fullScreenApi.fullScreenEventName,function(){fullScreenApi.isFullScreen()?(b.btnFullscreen.changeIcon(toolBarIconsURL[28]),
b.btnFullscreen.setCaption(getLanguage("btnFullscreen","Exit fullscreen"))):(b.btnFullscreen.changeIcon(toolBarIconsURL[27]),b.btnFullscreen.setCaption(getLanguage("btnFullscreen","Enter fullscreen")));b.btnFullscreen.changeButtonColor(bookConfig.iconColor)})};
initMoreBar.prototype.changeButtonColor=function(b){moreConfig.fullscreenButtonVisible&&userConfig.fullscreenButtonVisible&&fullScreenApi.supportsFullScreen&&(fullScreenApi.isFullScreen()?(this.btnFullscreen.changeIcon(toolBarIconsURL[28]),this.btnFullscreen.setCaption(getLanguage("btnFullscreen","Exit fullscreen"))):(this.btnFullscreen.changeIcon(toolBarIconsURL[27]),this.btnFullscreen.setCaption(getLanguage("btnFullscreen","Enter fullscreen"))));moreConfig.zoomButtonEnable&&zoomButtonEnable&&isFlipModel&&
(2==bookType?(this.btnZoom.changeIcon(toolBarIconsURL[6]),this.btnZoom.setCaption(getLanguage("btnZoomOut","Zoom Out"))):(this.btnZoom.changeIcon(toolBarIconsURL[5]),this.btnZoom.setCaption(getLanguage("btnZoomIn","Zoom In"))));moreConfig.autoPlayButtonVisible&&userConfig.autoPlayButtonVisible&&void 0!=auto_player&&null!=auto_player&&(auto_player.isPlaying()?(this.btnAutoPlay.changeIcon(toolBarIconsURL[8]),this.btnAutoPlay.setCaption(getLanguage("btnStopAutoFlip","Stop Auto Flip"))):(this.btnAutoPlay.changeIcon(toolBarIconsURL[7]),
this.btnAutoPlay.setCaption(getLanguage("btnAutoFlip","Auto Flip"))));moreConfig.bgSoundButtonVisible&&userConfig.bgSoundButtonVisible&&void 0!=isPlaying&&(isPlaying?(this.btnSound.changeIcon(toolBarIconsURL[15]),this.btnSound.setCaption(getLanguage("btnSoundOn","soundOn"))):(this.btnSound.changeIcon(toolBarIconsURL[16]),this.btnSound.setCaption(getLanguage("btnSoundOff","soundOff"))));moreConfig.homeButtonVisible&&userConfig.homeButtonVisible&&this.btnHome.changeButtonColor(b);moreConfig.downloadButtonVisible&&
userConfig.downloadButtonVisible&&this.btnDownload.changeButtonColor(b);moreConfig.printButtonVisible&&userConfig.printButtonVisible&&this.btnPrint.changeButtonColor(b);moreConfig.thumbButtonEnable&&thumbButtonEnable&&this.btnThumb.changeButtonColor(b);moreConfig.zoomButtonEnable&&zoomButtonEnable&&isFlipModel&&this.btnZoom.changeButtonColor(b);moreConfig.bookmarkButtonEnable&&bookmarkButtonEnable&&this.btnBookMark.changeButtonColor(b);moreConfig.tableofcontentButtonEnable&&tableofcontentButtonEnable&&
this.btnTableOfContent.changeButtonColor(b);moreConfig.shareButtonEnable&&shareButtonEnable&&this.btnShare.changeButtonColor(b);moreConfig.autoPlayButtonVisible&&userConfig.autoPlayButtonVisible&&this.btnAutoPlay.changeButtonColor(b);moreConfig.bgSoundButtonVisible&&userConfig.bgSoundButtonVisible&&this.btnSound.changeButtonColor(b);moreConfig.helpButtonVisible&&userConfig.helpButtonVisible&&this.btnHelp.changeButtonColor(b);moreConfig.aboutButtonVisible&&userConfig.aboutButtonVisible&&this.btnAbout.changeButtonColor(b);
moreConfig.fullscreenButtonVisible&&userConfig.fullscreenButtonVisible&&this.btnFullscreen.changeButtonColor(b);moreConfig.AnnotationButtonVisible&&userConfig.AnnotationButtonVisible&&this.btnNote.changeButtonColor(b);moreConfig.SlideshowButtonVisible&&userConfig.SlideshowButtonVisible&&this.btnSlideShow.changeButtonColor(b);moreConfig.VideoButtonVisible&&userConfig.VideoButtonVisible&&this.btnVideo.changeButtonColor(b);moreConfig.languageButtonVisible&&1<language.length&&this.btnLanguage.changeButtonColor(b);
moreConfig.flipButtonVisible&&(this.btnLast.changeButtonColor(b),this.btnNext.changeButtonColor(b),this.btnPrevious.changeButtonColor(b),this.btnFirst.changeButtonColor(b));moreConfig.searchButtonEnable&&searchButtonEnable&&this.btnSearch.changeButtonColor(b)};initMoreBar.prototype.nextPage=function(){rightToLeft?previousPageFun():nextPageFun()};initMoreBar.prototype.prePage=function(){rightToLeft?nextPageFun():previousPageFun()};
initMoreBar.prototype.firstPage=function(){rightToLeft?lastPageFun():firstPageFun()};initMoreBar.prototype.lastPage=function(){rightToLeft?firstPageFun():lastPageFun()};
initMoreBar.prototype.changeLanguage=function(){this.btnLast.setCaption(getLanguage("btnLastPage","Last"));this.btnNext.setCaption(getLanguage("btnNextPage","Next"));this.btnPrevious.setCaption(getLanguage("btnPrePage","Previous"));this.btnFirst.setCaption(getLanguage("btnFirstPage","First"));this.btnZoom.setCaption(2==bookType?getLanguage("btnZoomOut","Zoom Out"):getLanguage("btnZoomIn","Zoom In"));this.btnAutoPlay.setCaption(auto_player.isPlaying()?getLanguage("btnStopAutoFlip","Stop Auto Flip"):
getLanguage("btnAutoFlip","Auto Flip"));this.btnShare.setCaption(getLanguage("btnSocialShare","Share"));this.btnSearch.setCaption(getLanguage("btnSearch","Search"));this.btnBookMark.setCaption(getLanguage("btnBookMark","Book Mark"));this.btnDownload.setCaption(getLanguage("btnDownload","Download"));this.btnHome.setCaption(getLanguage("btnGoToHome","Home"));this.btnPrint.setCaption(getLanguage("btnPrint","Print"));this.btnHelp.setCaption(getLanguage("btnHelp","Help"));this.btnAbout.setCaption(getLanguage("btnAbout",
"About"));this.btnLanguage.setCaption(getLanguage("btnLanguage","languageChange"));this.btnFullscreen.setCaption(getLanguage("btnFullscreen","fullscreen"));this.btnNote.setCaption(getLanguage("btnNote","annotation"));this.btnVideo.setCaption(getLanguage("btnVideo","videoGallery"));this.btnSlideShow.setCaption(getLanguage("btnSlideShow","photoGallery"));this.btnSound.setCaption(isPlaying?getLanguage("btnSoundOn","soundOn"):getLanguage("btnSoundOff","soundOff"));rightToLeft&&(this.btnFirst.setCaption(getLanguage("btnLastPage",
"Last")),this.btnLast.setCaption(getLanguage("btnFirstPage","First")),this.btnNext.setCaption(getLanguage("btnPrePage","Previous")),this.btnPrevious.setCaption(getLanguage("btnNextPage","Next")))};var CatalogSide=Class({create:function(b,c){this.bookType="catalogBook";this.imageIndex=0;this.width=300;this.height=400;this.side=$("<div class='side'></div>");this.tmpContent=$("<div class='sideContent'></div>");this.sideContent=$("<div class='sideContent'></div>");this.sideImg=$("<img />");this.grayShadow=$("<div class='kong edgeShadow' ></div>");this.searchHighlight=$("<div class='kong' id='highlight'></div>");this.grayShadow.css({display:"none"});this.isLeft=c;this.rightToLeft=rightToLeft;var d=
parseBool(bookConfig.addPaperCoil);this.isLeft?(this.midShadow=$("<div class='catalogLeftShadow'></div>"),this.midShadow.css({width:userConfig.leftShadowWidth+"px",opacity:userConfig.leftShadowAlpha}),d&&(this.midCoil=$("<div class='leftPaperCoil'></div>"))):(this.midShadow=$("<div class='catalogRightShadow'></div>"),this.midShadow.css({width:userConfig.rightShadowWidth+"px",opacity:userConfig.rightShadowAlpha}),d&&(this.midCoil=$("<div class='rightPaperCoil'></div>")));this.midShadow.css({"backface-visibility":"hidden",
"-webkit-backface-visibility":"hidden","-moz-backface-visibility":"hidden","-ms-backface-visibility":"hidden","pointer-events":"none"});d=getColor("pageBackgroundColor","#f5f5f5");this.side.css({"background-color":d,overflow:"hidden"});this.sideContent.css("background-color",d);this.side.css({overflow:"hidden"});this.MMBackground=$("<div style='position : absolute; z-index : 6;'></div>");this.loadingImg=$("<img src='"+uiBaseURL+"progress.gif' style='position: absolute;' />");this.loadingImg.css({left:(this.width-
LOADING_WIDTH)/2+"px",top:(this.height-LOADING_HEIGHT)/2+"px"});this.initMMItems();this.slider=null;this.playSliderAfterLoad=!1;b.append(this.side);this.side.append(this.tmpContent);this.tmpContent.append(this.sideContent);this.side.append(this.midShadow);this.tmpContent.append(this.MMBackground);this.midShadow.css("z-index",5);this.midCoil&&this.midCoil.css("z-index",5);CatalogSide.sideId||(CatalogSide.sideId=0);this.sideId=++CatalogSide.sideId}}).extend(NormalSide),CatalogThumbnailBar=Class({create:function(b){this.menu=
$("<div></div>");b.append(this.menu);this.initMenu()},initMenu:function(){this.visible=!1;this.height=170;this.menu.css({position:"absolute",width:"100%",height:this.height,overflow:"hidden",bottom:-this.height+"px"});this.dockMenuContent=$("<div></div>");this.thumbnailItemContent=$("<div></div>");this.dockMenuContent.css({position:"absolute",bottom:"30px",width:windowWidth-50+"px",height:"140px",left:"25px","z-index":"1"});this.thumbnailItemContent.css({position:"absolute",bottom:"0px",width:"100%",
height:"30px","text-align":"center","line-height":"30px","z-index":"2",display:"inline-block"});this.menu.append(this.dockMenuContent);this.menu.append(this.thumbnailItemContent);this.addItem()},addItem:function(){this.itemArray=[];for(var b=parseInt((bookConfig.totalPageCount+1)/20),b=b+(0==(bookConfig.totalPageCount+1)%20?0:1),c=0;c<b;c++){var d=new CatalogThumbnailItem(this.thumbnailItemContent,this.dockMenuContent,c),f=20*c,g=20*(c+1)-1,g=g>bookConfig.totalPageCount?bookConfig.totalPageCount:
g;d.initItem(f,g);0==c&&(this.highLightItem=this.currentItem=d,d.setHighLight(1),d.show());this.itemArray.push(d)}},gotoItemByIndex:function(b){this.currentItem&&this.currentItem.index!==b&&(this.currentItem.hide(),this.itemArray[b].show(),this.currentItem=this.itemArray[b])},onResize:function(){var b=1,c=10*(140*bookConfig.largePageWidth/bookConfig.largePageHeight+10);origin=0;c>windowWidth-50&&(b=(windowWidth-50)/c,origin=parseInt(100*(1-(windowWidth-50)/c)/2));this.dockMenuContent.css({"-webkit-transform":"scale3d("+
b+","+b+",1)","-moz-transform":"scale3d("+b+","+b+",1)","-ms-transform":"scale3d("+b+","+b+",1)","-o-transform":"scale3d("+b+","+b+",1)",transform:"scale3d("+b+","+b+",1)","-webkit-transform-origin":"50% 100%","-moz-transform-origin":"50% 100%","-ms-transform-origin":"50% 100%","-o-transform-origin":"50% 100%","transform-origin":"50% 100%"});this.dockMenuContent.css({width:windowWidth-50+"px"});this.thumbnailItemContent.css({"-webkit-transform":"scale3d("+b+","+b+",1)","-moz-transform":"scale3d("+
b+","+b+",1)","-ms-transform":"scale3d("+b+","+b+",1)","-o-transform":"scale3d("+b+","+b+",1)",transform:"scale3d("+b+","+b+",1)","-webkit-transform-origin":"50% 100%","-moz-transform-origin":"50% 100%","-ms-transform-origin":"50% 100%","-o-transform-origin":"50% 100%","transform-origin":"50% 100%"});for(b=0;b<this.itemArray.length;b++)this.itemArray[b].onResize()},showshow:function(){this.showing=this.visible=!0;this.menu.animate.delay(this.menu,100,[{bottom:-5+toolBar.getBottomHeight()+"px"},300])},
hideBox:function(){this.menu.animate.delay(this.menu,100,[{bottom:-this.height+"px"},300]);this.showing=this.visible=!1},getOccuHeight:function(){return 110},transparent:function(){this.menu.animate({opacity:0,"z-index":-1},200)},noTransparent:function(){this.menu.animate({opacity:1,"z-index":1},200)},mergeAll:function(){},fissionAll:function(){},getShowStatu:function(){return this.visible},clearHighLight:function(){this.highLightItem&&this.highLightItem.clearHighLight()},setHighLight:function(b){for(var c=
0;c<this.itemArray.length;c++)if(b<=this.itemArray[c].toIndex&&b>=this.itemArray[c].fromIndex){this.gotoItemByIndex(c);this.itemArray[c].setHighLight(b);this.highLightItem=this.currentItem;break}},showOrHide:function(){!1===this.visible?this.showshow():this.hideBox()},hide:function(){this.menu.css("bottom",-this.height+"px");this.showing=this.visible=!1},show:function(){this.menu.css("bottom",-5+toolBar.getBottomHeight()+"px");this.showing=this.visible=!0},setPosition:function(){},getHeight:function(){return!0==
this.visible?110:0}}),CatalogThumbnailItem=Class({create:function(b,c,d){this.itemContent=b;this.dockMenuContent=c;this.index=d;this.item=$("<div></div>");this.rect=$("<div></div>");this.caption=$("<div class='dockMenuItemCaption'></div>");this.captionAfter=$("<div class='dockMenuItemCaptionAfter'></div>");this.itemContent.append(this.item);this.item.append(this.rect);this.item.append(this.caption);this.caption.after(this.captionAfter);this.initEvent()},initItem:function(b,c){this.initCaption(b,c);
this.item.css({position:"relative",width:"40px",height:"20px",display:"inline-block","margin-left":"4px",cursor:"pointer","margin-top":"5px"});this.rect.css({position:"absolute",top:"7px",width:"40px",height:"5px","border-radius":"3px",background:"#505a60"});this.dockMenu=new DockMenu(this.dockMenuContent,b,c);1<b&&this.addPrev();c<bookConfig.totalPageCount&&this.addNext()},addPrev:function(){var b=$("<div style='width:30px;height:60px;margin-left:10px;bottom:1px;' class='dockMenuItem dockMenuItemShadow'></div>");
b.append("<div style='width:100%;height:100%;background:#333333;opacity:0.5;'></div>");b.append("<img src='"+uiBaseURL+"slide_leftButton.png' style='left:0;right:0;bottom:0;top:0;margin:auto;position:absolute;'/>");b.click(function(){thumbnail.gotoItemByIndex(this.index-1);return!1}.bind(this));this.dockMenu.addObj(b,"before")},addNext:function(){var b=$("<div style='width:30px;height:60px;margin-left:10px;bottom:1px;' class='dockMenuItem dockMenuItemShadow'></div>");b.append("<div style='width:100%;height:100%;background:#333333;opacity:0.5;'></div>");
b.append("<img src='"+uiBaseURL+"slide_rightButton.png' style='left:0;right:0;bottom:0;top:0;margin:auto;position:absolute;'/>");b.click(function(){thumbnail.gotoItemByIndex(this.index+1);return!1}.bind(this));this.dockMenu.addObj(b,"after")},initCaption:function(b,c){this.fromIndex=b;this.toIndex=c;this.fromIndex=Math.max(this.fromIndex,1);this.toIndex=Math.min(this.toIndex,bookConfig.totalPageCount);this.fromIndex!=this.toIndex?this.caption.html(this.fromIndex+"-"+this.toIndex):this.caption.html(this.fromIndex);
$(this.caption).css({position:"absolute",height:"16px",top:"-30px","white-space":"nowrap",width:"auto",left:"50%"});$(this.caption).css({"margin-left":-$(this.caption).outerWidth()/2});$(this.captionAfter).css({position:"absolute",top:"-5px",left:"50%","margin-left":"-8px","background-image":"url("+uiBaseURL+"span.png)"})},initEvent:function(){this.choosedColor="#505a60";this.item.bind(_event._enter,function(){this.rect.css("background","#ffffff")}.bind(this));this.item.bind(_event._leave,function(){this.rect.css("background",
this.choosedColor)}.bind(this));this.item.bind(_event._end,function(){thumbnail.gotoItemByIndex(this.index)}.bind(this));this.item.bind(_event._over,function(){this.caption.css("display","block");this.captionAfter.css("display","block")}.bind(this));this.item.bind(_event._leave,function(){this.caption.hide();this.captionAfter.hide()}.bind(this))},show:function(){this.rect.css("background","#ffffff");this.choosedColor="#ffffff";this.dockMenu.show()},hide:function(){this.rect.css("background","#505a60");
this.choosedColor="#505a60";this.dockMenu.hide()},clearHighLight:function(){this.dockMenu.clearHighLight()},setHighLight:function(b){this.dockMenu.setHighLight(b)},onResize:function(){this.dockMenu.resize()}});var CatalogPage=Class({create:function(b){this.bookType=BookType.catalog_book;this.pageStatu=!1;this.corner="tr";this.pageIndex=1;this.isHardPage=!1;this.pageVisible=!0;this.width=300;this.height=400;this.maskWidth=500;this.isLastPageReset=!1;this.page=$("<div class='paper'></div>");this.maskA=$("<div class='pageMask'></div>");this.maskB=$("<div class='pageMask'></div>");this.sideAPosition=$("<div class='sidePosition'></div>");this.sideBPosition=$("<div class='sidePosition'></div>");this.flipBackShadow=
$("<div class='backShadow'></div>");this.flipFrontShadow=$("<div class='frontShadow'></div>");this.flipMidShadow=$("<div class='frontShadow'></div>");this.flipBackShadow.css({"backface-visibility":"hidden","-webkit-backface-visibility":"hidden","-moz-backface-visibility":"hidden","-ms-backface-visibility":"hidden"});this.flipFrontShadow.css({"backface-visibility":"hidden","-webkit-backface-visibility":"hidden","-moz-backface-visibility":"hidden","-ms-backface-visibility":"hidden"});this.flipMidShadow.css({"backface-visibility":"hidden",
"-webkit-backface-visibility":"hidden","-moz-backface-visibility":"hidden","-ms-backface-visibility":"hidden"});parseBool(bookConfig.RightToLeft)?(this.sideA=new CatalogSide(this.sideAPosition,!0),this.sideB=new CatalogSide(this.sideBPosition,!1)):(this.sideA=new CatalogSide(this.sideAPosition,!1),this.sideB=new CatalogSide(this.sideBPosition,!0));this.page.append(this.flipBackShadow);b.append(this.page);this.page.append(this.maskA);this.page.append(this.flipMidShadow);this.page.append(this.maskB);
this.maskA.append(this.sideAPosition);this.maskB.append(this.sideBPosition);this.sideAPosition.append(this.sideA.side);this.sideBPosition.append(this.sideB.side);!0==$.browser.mozilla&&(this.maskA.css("border-top","1px solid transparent"),this.maskB.css("border-top","1px solid transparent"));this.currentPoint=new Point(0,0)},addEdgeShadow:function(){catalogBook.flippingPage&&(parseInt(catalogBook.flippingPage.maskB.css("z-index"))>parseInt(catalogBook.flippingPage.maskA.css("z-index"))?catalogBook.flippingPage.sideB.side.css({"-webkit-box-shadow":"0 0 10px rgba(40, 40, 40, 0.3)"}):
catalogBook.flippingPage.sideA.side.css({"-webkit-box-shadow":"0 0 10px rgba(40, 40, 40, 0.3)"}))},beginFlip:function(b){this.corner=b;this.isLeft()?(parseBool(bookConfig.RightToLeft)?this.sideB.sideAddChild(this.flipFrontShadow):this.sideA.sideAddChild(this.flipFrontShadow),this.pageStatu=!0):(parseBool(bookConfig.RightToLeft)?this.sideA.sideAddChild(this.flipFrontShadow):this.sideB.sideAddChild(this.flipFrontShadow),this.pageStatu=!1);1>=catalogBook.gotoPageIndex&&(parseBool(bookConfig.RightToLeft)?
catalogBook.bmt.rightBox.hide():catalogBook.bmt.leftBox.hide());catalogBook.gotoPageIndex>=totalPageCount&&(parseBool(bookConfig.RightToLeft)?catalogBook.bmt.leftBox.hide():catalogBook.bmt.rightBox.hide());3>=catalogBook.gotoPageIndex&&catalogBook.leftThickness.setVisible(!1);1>=catalogBook.gotoPageIndex&&catalogBook.leftFlipShotBar.setVisible(!1);catalogBook.gotoPageIndex>=totalPageCount-2&&catalogBook.rightThickness.setVisible(!1);catalogBook.gotoPageIndex>=totalPageCount&&catalogBook.rightFlipShotBar.setVisible(!1);
this.maskA.css({width:this.maskWidth+"px",height:this.maskWidth+"px"});this.maskB.css({width:this.maskWidth+"px",height:this.maskWidth+"px"});this.flipMidShadow.css({width:2*this.width+"px",height:this.height+"px"});catalogBook.normalBookShadow.hideShadow()},endFlip:function(){this.hideShadow();this.pageStatu=this.isLeft()?!1:!0;this.sideA.showGray();this.sideB.showGray();catalogBook.normalBookShadow.showShadow()},setCurrentPoint:function(b,c){this.currentPoint.x=b;this.currentPoint.y=c},setFlipShadowPosition:function(b,
c,d){var f=$.browser.prefix;if(void 0!=f&&null!=f){var g=0<b.x?0:1;b=0<b.x?(this.width-Math.abs(b.x))/this.width:Math.abs(b.x)/this.width;var h=0<c.x?0:1,k=0<c.x?Math.abs(c.x)/this.width:(this.width-Math.abs(c.x))/this.width;c=1-Math.abs(c.x)/this.width;c=0.2<c?1:c/0.2;if("-webkit-"!==f){fe=b;bs=h;be=k;var l=b>g?0.4*g+0.6*fe:1-(0.4*g+0.6*fe),m=b>g?0.1*g+0.9*fe:1-(0.1*g+0.9*fe),n=b>g?fe:1-fe;b_gradientStartV=k>h?0.4*bs+0.6*be:1-(0.4*bs+0.6*be);b_gradientStartV2=k>h?0.1*bs+0.9*be:1-(0.1*bs+0.9*be);
b_gradientAll=k>h?be:1-be;angleShadowB=k>h?0:180;this.flipFrontShadow.css({"background-image":f+"linear-gradient( "+(b>g?0:180)+"deg,  rgba(0,0,0,0) "+100*l+"%, rgba(0,0,0,"+0.2*c+") "+100*m+"%, rgba(0,0,0,0)"+100*n+"%)"});this.flipBackShadow.css({"background-image":f+"linear-gradient( "+angleShadowB+"deg,  rgba(0,0,0,0) "+100*b_gradientStartV+"%, rgba(0,0,0,"+0.2*c+") "+100*b_gradientStartV2+"%, rgba(0,0,0,"+0.4*c+") "+100*b_gradientAll+"%)"})}else this.flipFrontShadow.css({"background-image":f+
"gradient(linear, "+100*g+"% 0%, "+100*b+"% 0% ,color-stop(0.1,rgba(0,0,0,0)), color-stop(0.2, rgba(0,0,0,0)), color-stop(0.7,rgba(0,0,0,"+0.25*c+")), color-stop(0.9, rgba(0,0,0,"+0.35*c+")), to(rgba(0,0,0,0)))"}),this.flipBackShadow.css({"background-image":f+"gradient(linear, "+100*h+"% 0%, "+100*k+"% 0%,color-stop(0.1,rgba(0,0,0,0)), color-stop(0.2, rgba(0,0,0,"+0*c+")), color-stop(0.6,rgba(0,0,0,"+0.25*c+")), to(rgba(0,0,0,"+0.35*c+")))"});d.css({"-webkit-box-shadow":"0 0 20px rgba(40, 40, 40, 0.5)",
"-moz-box-shadow":"0 0 20px rgba(40, 40, 40, 0.5)","-o-box-shadow":"0 0 20px rgba(40, 40, 40, 0.5)","-ms-box-shadow":"0 0 20px rgba(40, 40, 40, 0.5)","box-shadow":"0 0 20px rgba(40, 40, 40, 0.5)"})}},translateNull:function(b){b.css({"-webkit-transform":"","-moz-transform":"","-ms-transform":"","-o-transform":"",transform:""})},showShadow:function(){this.flipFrontShadow.css({display:"block"});this.flipMidShadow.css({display:"block"});this.flipBackShadow.css({display:"block"})},hideShadow:function(){this.flipFrontShadow.css({display:"none"});
this.flipMidShadow.css({display:"none"});this.flipBackShadow.css({display:"none"});this.sideBPosition.css({"-webkit-box-shadow":"0 0 10px rgba(40, 40, 40, 0)","-moz-box-shadow":"0 0 10px rgba(40, 40, 40, 0)","-o-box-shadow":"0 0 10px rgba(40, 40, 40, 0)","-ms-box-shadow":"0 0 10px rgba(40, 40, 40, 0)","box-shadow":"0 0 10px rgba(40, 40, 40, 0)"});this.sideAPosition.css({"-webkit-box-shadow":"0 0 10px rgba(40, 40, 40, 0)","-moz-box-shadow":"0 0 10px rgba(40, 40, 40, 0)","-o-box-shadow":"0 0 10px rgba(40, 40, 40, 0)",
"-ms-box-shadow":"0 0 10px rgba(40, 40, 40, 0)","box-shadow":"0 0 10px rgba(40, 40, 40, 0)"})},getShow:function(){return this.page.is(":visible")?!0:!1},show:function(){this.page.css("display","block")},hide:function(){this.page.css("display","none")}});var CatalogBook=Class({create:function(b){this._super(b);this.thicknessWidth=18;this.guidBar=new GuidToolbar(b);this.controlBar=new catalogControlBar(b);this.controlBar.setPosition((windowWidth-this.controlBar.width)/2,toolBar.getBottomHeight()+5,["left","bottom"]);this.controlBar.setVisible(!1);this.initLogo();this.initEvent();this.guidBarHeight="lite"==bookConfig.ToolbarViewMode.toLowerCase()?50:0;this.initMiniFullscreen()},initLogo:function(){bookConfig.appLogoIcon&&""!=bookConfig.appLogoIcon&&
(this.logo=$("<img src='"+bookConfig.appLogoIcon+"'/>"),this.logo.css({position:"absolute",left:bookConfig.logoPadding+"px",top:bookConfig.logoTop+"px",height:bookConfig.logoHeight+"px",cursor:"pointer","z-index":"95"}),this.logo.click(function(){var b=getLogoLink();window.open(b[0],b[1]);return!1}),tmpContainer.append(this.logo))},createBook:function(b){this.flipBook=$("<div class='flipBook' id='flipBook''></div>");"android"==device.name?(this.previousPage=new androidPage(this.flipBook),this.currentPage=
new androidPage(this.flipBook),this.nextPage=new androidPage(this.flipBook),this.currentPage2=new androidPage(this.flipBook)):(this.previousPage=new CatalogPage(this.flipBook),this.currentPage=new CatalogPage(this.flipBook),this.currentPage2=new CatalogPage(this.flipBook),this.nextPage=new CatalogPage(this.flipBook));this.leftThickness=new thickness(!0);this.rightThickness=new thickness(!1);this.leftFlipShotBar=new flipShotBar(!0);this.rightFlipShotBar=new flipShotBar(!1);this.normalBookShadow=new bookShadow(this.pageWidth,
this.pageHeight,this.flipBook);this.bmt=new initBookMarkTab(this.flipBook);this.init1=50;b.append(this.flipBook);this.flipBook.append(this.leftThickness.getContainer());this.flipBook.append(this.rightThickness.getContainer());this.flipBook.append(this.leftFlipShotBar.getContainer());this.flipBook.append(this.rightFlipShotBar.getContainer());this.currentPageIndex=oriPageIndex;this.fillNearPage(this.currentPageIndex);setCurrentIndexTextField(this.currentPageIndex,!0);1>=this.currentPageIndex&&this.bmt.leftBox.hide();
this.currentPageIndex>=totalPageCount&&this.bmt.rightBox.hide();3>=this.currentPageIndex&&this.leftThickness.setVisible(!1);1>=this.currentPageIndex&&this.leftFlipShotBar.setVisible(!1);this.currentPageIndex>=totalPageCount-2&&this.rightThickness.setVisible(!1);this.currentPageIndex>=totalPageCount&&this.rightFlipShotBar.setVisible(!1);this.resetPageZIndex();isTouchDevice()||this.initZoomHintTimer(b);this.showSideId()},onResize:function(b,c){this.autoMove&&this.clearAutoMoveCorner();if(nBookStatu==
normalBookStatu.book_statu_ready&&!0!=this.isFlipping&&!0!=this.isZomming){thumbnail.hideBox();this.zoomOut=!0;this.mode="simple";this.translateNull(this.flipBook);this.width=2*b;this.height=c;this.pageWidth=b;this.pageHeight=c;this.maskWidth=Math.sqrt(b*b+c*c);this.fitW=this.width;this.flipBook.css({width:this.width+"px",height:this.height+"px"});this.previousPage.onResize(b,c,this.maskWidth,0);this.currentPage.onResize(b,c,this.maskWidth,0);this.currentPage2.onResize(b,c,this.maskWidth,b);this.nextPage.onResize(b,
c,this.maskWidth,b);this.leftThickness.onResize(this.thicknessWidth,c);this.rightThickness.onResize(this.thicknessWidth,c);this.leftFlipShotBar.onResize(50,c);this.rightFlipShotBar.onResize(50,c);normalEventRadius=Math.pow(Math.ceil(1*b/3),2);this.normalBookShadow.onResize(this.pageWidth,this.pageHeight,1!=this.currentPageIndex&&this.currentPageIndex!=totalPageCount);this.normalBookShadow.setPosition(1==this.currentPageIndex?b:0,0);this.bmt.resize(c,60);var d=this.flipBook.css("left"),f=this.flipBook.css("top");
this.miniFullScreen&&this.miniFullScreen.css({top:parseInt(f)+c-50+"px"});this.adContainer.css({left:d,top:f,width:b+"px",height:c+"px"});this.adInstance&&this.adInstance.resize();this.guidBar.onResize();this.controlBar&&(this.controlBar.setPosition((windowWidth-this.controlBar.width)/2,toolBar.getBottomHeight()+5,["left","bottom"]),this.controlBar.setVisible(!1));this.leftThickness.visible&&this.leftThickness.showThickness();this.rightThickness.visible&&this.rightThickness.showThickness();this.leftFlipShotBar.visible&&
this.leftFlipShotBar.showThickness();this.rightFlipShotBar.visible&&this.rightFlipShotBar.showThickness();window.setTimeout(function(){this.endReset();void 0===this.autoMove&&this.autoMoveCorner()}.bind(this),10)}},resetSize:function(b,c){this.autoMove&&this.clearAutoMoveCorner();if(nBookStatu==normalBookStatu.book_statu_ready&&!0!=this.isFlipping&&!0!=this.isZomming){this.width=2*b;this.height=c;this.pageWidth=b;this.pageHeight=c;this.maskWidth=Math.sqrt(b*b+c*c);this.flipBook.css({width:this.width+
"px",height:this.height+"px"});this.previousPage.onResize(b,c,this.maskWidth,0);this.currentPage.onResize(b,c,this.maskWidth,0);this.currentPage2.onResize(b,c,this.maskWidth,b);this.nextPage.onResize(b,c,this.maskWidth,b);this.leftThickness.onResize(this.thicknessWidth,c);this.rightThickness.onResize(this.thicknessWidth,c);normalEventRadius=Math.pow(Math.ceil(1*b/3),2);this.normalBookShadow.onResize(this.pageWidth,this.pageHeight,1!=this.currentPageIndex&&this.currentPageIndex!=totalPageCount);this.normalBookShadow.setPosition(1==
this.currentPageIndex?b:0,0);this.bmt.resize(c,60);var d=this.flipBook.css("left"),f=this.flipBook.css("top");this.adContainer.css({left:d,top:f,width:b+"px",height:c+"px"});this.adInstance&&this.adInstance.resize()}},zoomToPage:function(b,c){this.autoMove&&this.clearAutoMoveCorner();if(0==nBookStatu&&(this.resetPageCorner(),this.endReset(),!(this.moveing||this.moveFromLeft||this.moveFromRight)&&nBookStatu==normalBookStatu.book_statu_ready&&!0!=this.isFlipping&&!0!=this.isZomming)){void 0==this.zoomOut&&
(this.zoomOut=!0);this.leftThickness.hideThickness();this.rightThickness.hideThickness();this.leftFlipShotBar.hideThickness();this.rightFlipShotBar.hideThickness();var d=Math.min(windowWidth,zoomPageWidth);isTouchDevice()&&(d=Math.floor(Math.sqrt(1048576*bookConfig.largePageWidth/bookConfig.largePageHeight)));this.pageWidthHeight=this.getFitWH();var f=this.pageWidthHeight.x;thumbnail.getShowStatu()&&(!0!==this.zoomOut?thumbnail.noTransparent():thumbnail.transparent());f=!0==this.zoomOut?2*d/this.width:
f/this.width;!0==this.zoomOut?this.controlBar.setVisible(!0):this.controlBar.setVisible(!1);var g=0,h=0;this.zoomOut||(h=this.getTranY());if(!0==this.zoomOut){var k=50;1==this.currentPageIndex&&(k=75);this.currentPageIndex==totalPageCount&&(k=25);h=d*bookConfig.largePageHeight/bookConfig.largePageWidth;2*d<=windowWidth&&(b=windowWidth/2);h<=windowHeight&&(c=windowHeight/2);g=b-b*d*2/windowWidth;h=c-c*h/windowHeight;g-=parseInt(this.getCssLeft()+this.width*(1-f)*k/100);h-=parseInt(this.flipBook.css("top"));
1==this.currentPageIndex&&(d<=windowWidth&&(b=windowWidth/2),g=b-b*d/windowWidth,g-=parseInt(this.getCssLeft()+d+this.width*(1-f)*k/100));this.currentPageIndex==totalPageCount&&(d<=windowWidth&&(b=windowWidth/2),g=b-b*d/windowWidth,g-=parseInt(this.getCssLeft()+this.width*(1-f)*k/100));BookInfo.getBook().miniFullScreen&&(BookInfo.getBook().miniFullScreen.remove(),BookInfo.getBook().addminiFullscreen=!1)}this.zoomToScale(f,g,h,0,function(){this.zoomOut=!this.zoomOut}.bind(this))}},zoomToScale:function(b,
c,d,f,g){this.autoMove&&this.clearAutoMoveCorner();if(0==nBookStatu&&(this.resetPageCorner(),!(this.moveing||this.moveFromLeft||this.moveFromRight)&&nBookStatu==normalBookStatu.book_statu_ready&&!0!=this.isFlipping&&!0!=this.isZomming)){this.sideArray=[];this.setShowOrHide(this.sideArray);this.reShowOrHide(this.sideArray,!0);this.isZomming=!0;var h=getTransform(this.flipBook[0]),k={toScale:1,x:h.x,y:h.y},l=this;this.toScale=b;var m=50;1==this.currentPageIndex&&(m=75);this.currentPageIndex==totalPageCount&&
(m=25);c||(c=0);d||(d=0);f||(f=0);c=parseInt(c);d=parseInt(d);(function(){if(isSupportTransition()){this.zoomObj(this.flipBook,m+"% "+f+"%","scale3d("+b+","+b+",1)",c,d);var h=function(){g&&g();this.isZomming=!1;this.zoomOut?(this.setPosition(this.getCssLeft()+this.width*(1-b)*m/100+c,this.getCssTop()+this.height*(1-b)*f/100+d),f=d=c=0):this.setPosition(this.getCssLeft()+this.width*(1-b)*m/100,this.getCssTop());this.resetSize(this.width*b/2,this.height*b);this.setThicknessPosition(b);this.zoomObj(this.flipBook,
"0% 0%","scale3d(1,1,1)",c,d);this.translateNull(this.flipBook);this.reShowOrHide(this.sideArray);this.zoomOut&&(this.leftThickness.visible&&this.leftThickness.showThickness(),this.rightThickness.visible&&this.rightThickness.showThickness(),this.leftFlipShotBar.visible&&this.leftFlipShotBar.showThickness(),this.rightFlipShotBar.visible&&this.rightFlipShotBar.showThickness())}.bind(this);animateOnce(this.flipBook,{},0.3,h,"%stransform")}else $(k).animate({toScale:b,x:this.width*(1-b)*m/100+c,y:d},
{duration:300,easing:"easeOutSine",step:function(){l.zoomObj(l.flipBook,"0% 0%"," scale("+k.toScale+")",k.x,k.y)},complete:function(){l.isZomming=!1;l.zoomOut?(l.setPosition(l.getCssLeft()+l.width*(1-b)*m/100+c,l.getCssTop()+l.height*(1-b)*f/100+d),f=d=c=0):l.setPosition(l.getCssLeft()+l.width*(1-b)*m/100,l.getCssTop());l.resetSize(l.width*b/2,l.height*b);l.setThicknessPosition(b);l.zoomObj(l.flipBook,"0% 0%"," scale(1)",c,d);l.translateNull(l.flipBook);this.reShowOrHide(this.sideArray);l.zoomOut&&
(l.leftThickness.visible&&l.leftThickness.showThickness(),l.rightThickness.visible&&l.rightThickness.showThickness(),l.leftFlipShotBar.visible&&l.leftFlipShotBar.showThickness(),l.rightFlipShotBar.visible&&l.rightFlipShotBar.showThickness())}})}).delay(this,50)}},getFitWH:function(){var b=thumbnail.getShowStatu()?thumbnail.getHeight():0,c=Math.max(windowWidth-leftMargin-rightMargin,1),d=0,d=toolBar.visible?Math.max(windowHeight-topMargin-bottomMargin-b-toolBar.getHeight()+this.guidBarHeight,1):Math.max(windowHeight-
topMargin-bottomMargin-b-toolBar.getHeight(),1);return pageWidthHeight=getPageWidthHeight(c,d,2*bookConfig.largePageWidth,bookConfig.largePageHeight)},getTranY:function(){var b=0,b=thumbnail.getShowStatu()?thumbnail.getHeight():0,c=0;toolBar.visible?(c=Math.max(windowHeight-topMargin-bottomMargin-b-toolBar.getHeight()+this.guidBarHeight,1),b=topMargin-this.guidBarHeight+toolBar.getTopHeight()+(c-this.pageWidthHeight.y)/2-this.getCssTop()):(c=Math.max(windowHeight-topMargin-bottomMargin-b-toolBar.getHeight(),
1),b=topMargin+(c-this.pageWidthHeight.y)/2-this.getCssTop());return b},setThicknessPosition:function(b){b||(b=1);this.leftFlipShotBar.setScale(b);this.rightFlipShotBar.setScale(b);this.leftThickness.setThicknessPosition(-this.thicknessWidth,0);this.rightThickness.setThicknessPosition(this.flipBook.width()-1,0);this.leftFlipShotBar.setThicknessPosition(-this.leftFlipShotBar.width,0);this.rightFlipShotBar.setThicknessPosition(this.flipBook.width()-1,0)},setShowOrHide:function(b){isTouch||void 0==b||
null==b||(this.resetShowOrHidePage=!1,this.nextPage.getShow()&&(this.nextPage.hide(),b.push(this.nextPage.page)),this.previousPage.getShow()&&(this.previousPage.hide(),b.push(this.previousPage.page)),parseInt(this.currentPage.maskA.css("z-index"))<parseInt(this.currentPage.maskB.css("z-index"))?(this.currentPage.maskA.hide(),b.push(this.currentPage.maskA)):(this.currentPage.maskB.hide(),b.push(this.currentPage.maskB)),parseInt(this.currentPage2.maskA.css("z-index"))<parseInt(this.currentPage2.maskB.css("z-index"))?
(this.currentPage2.maskA.hide(),b.push(this.currentPage2.maskA)):(this.currentPage2.maskB.hide(),b.push(this.currentPage2.maskB)))},reShowOrHide:function(b,c){if(!isTouch&&void 0!=b&&null!=b&&(!this.resetShowOrHidePage||c)){c||(this.resetShowOrHidePage=!0);for(var d=0;d<b.length;d++)c?b[d].hide():b[d].show()}},endReset:function(){this.currentPage.translateNull(this.currentPage.maskA);this.currentPage.translateNull(this.currentPage.maskB);this.currentPage.translateNull(this.currentPage.sideAPosition);
this.currentPage.translateNull(this.currentPage.sideBPosition);this.currentPage2.translateNull(this.currentPage2.maskA);this.currentPage2.translateNull(this.currentPage2.maskB);this.currentPage2.translateNull(this.currentPage2.sideAPosition);this.currentPage2.translateNull(this.currentPage2.sideBPosition);this.translateNull(this.flipBook)},translateNull:function(b){b.css({"-webkit-transform":"","-moz-transform":"","-ms-transform":"","-o-transform":""})},zoomObj:function(b,c,d,f,g){f||(f=0);g||(g=
0);f=translate(f,g);b.css({"-webkit-transform-origin":c,"-moz-transform-origin":c,"-ms-transform-origin":c,"-o-transform-origin":c,"transform-origin":c,"-webkit-transform":f+d,"-moz-transform":f+d,"-ms-transform":f+d,"-o-transform":f+d,transform:f+d})},getCssLeft:function(){return parseInt(this.flipBook.css("left"))},getCssTop:function(){return parseInt(this.flipBook.css("top"))},getTran:function(){return getTransform(this.flipBook[0])},movetoCenter:function(b,c,d){b=this.resetFrameNum(b,d);if(!1!=
parseBool(bookConfig.retainBookCenter)){var f=(windowWidth-bookConfig.leftMargin-bookConfig.rightMargin-this.width)/2+bookConfig.leftMargin,g=f-this.width/4,h=f+this.width/4,k=this.getCssLeft(),l=f;1==d&&(l=g);f=bookConfig.totalPageCount;1==f%2&&f++;d==f&&(l=h);if(!(10>Math.abs(l-k))){var m=0,n=this,q=n.getCssTop();if(0==b)n.setPosition(iLeft,q);else var p=window.setInterval(function(){var c=$.easing.easeOutQuart(null,m,k,l-k,b);n.setPosition(c,q);m++==b&&window.clearInterval(p)},c)}}},initEvent:function(){var b=
this,c=-1,d=void 0,f,g,h=Point(0,0);Point(0,0);var k=!1,l=!1,m=0,n=0,q=isTouchDevice(),p=!1,s=!1,r=null;this.twoFingerDown=!1;var t=normalBookStatu.book_statu_ready,v=normalBookStatu.book_statu_mag_flip;this.flipBook.bind(_event._down,function(c){c=q?c.originalEvent.touches:[c];if(bookType==BookType.catalog_book&&!0!=b.isZomming&&!0!=b.isFlipping&&(b.autoMove&&(b.clearAutoMoveCorner(),b.moveInterval&&b.moveInterval.stop(),b.moveing=!1,b.resetPageCorner(!0),b.moveFromRight=!1,b.moveFromLeft=!1),!b.moveing)){var d=
getTransform(catalogBook.flipBook[0]);b.translateX=d.x;b.translateY=d.y;1==c.length?(k=!0,l=!1,h=Point(c[0].pageX,c[0].pageY),Point(b.getLeft(),b.getTop())):2==c.length&&(k=!1,l=!0,h=Point(c[0].pageX,c[0].pageY),downPoint2=Point(c[1].pageX,c[1].pageY),Point((c[0].pageX+c[1].pageX)/2,(c[0].pageY+c[1].pageY)/2),Point(b.getLeft(),b.getTop()));p=!1;if(2==c.length){if(nBookStatu==normalBookStatu.book_statu_mouse_flip){var m;"tl"==b.flippingPage.corner?m=Point(0,0):"tr"==b.flippingPage.corner?m=Point(b.pageWidth,
0):"bl"==b.flippingPage.corner?m=Point(0,b.pageHeight):"br"==b.flippingPage.corner&&(m=Point(b.pageWidth,b.pageHeight));window.clearInterval(b.intervalID);playFlipSound();b.timer(b.flippingPage.corner,b.totalFrame,20,m,b.flipPoint,!1,!0);b.movetoCenter(b.totalFrame,20,b.gotoPageIndex)}f=globalToBook(!0,c[0].pageX,c[0].pageY);g=globalToBook(!0,c[1].pageX,c[1].pageY);c=b.pointInPage(f,b.pageWidth,b.pageHeight);d=b.pointInPage(g,b.pageWidth,b.pageHeight);c==d&&c&&(b.twoFingerDown=c);bookMouseDown=!1}else{if(nBookStatu==
t){d=globalToBook(!0,c[0].pageX,c[0].pageY);if(0>d.x||d.x>b.width||0>d.y||d.y>b.height)return;var n=b.getCornerAndBeginPoint(d);if(null==n.corner)return;m=n.corner;n=n.beginPoint;nBookStatu=normalBookStatu.book_statu_mouse_flip;window.clearInterval(b.intervalID);b.flippingPage.beginFlip(m);b.timer(m,Math.floor(b.totalFrame/6),5,d,n,!1,!1)}if(nBookStatu==v){c=globalToBook(!0,c[0].pageX,c[0].pageY);if(0>c.x||c.x>b.width||0>c.y||c.y>b.height)return;nBookStatu=normalBookStatu.book_statu_mouse_flip;bookMouseDown=
!0}return!1}}});bookContainer.bind(_event._move,function(r){if(bookType==BookType.catalog_book&&(r=q?r.originalEvent.touches:[r],!0!=b.isZomming&&!0!=b.isFlipping&&!0!=b.isMoving)){p=!0;if(!q&&!k){var u=globalToBook(!0,r[0].pageX,r[0].pageY,!1),u=b.getCornerAndBeginPointResult(u);if(null!=u.corner){if("tr"==u.corner||"br"==u.corner)b.autoMove&&b.clearAutoMoveCorner(),b.moveInterval&&b.moveInterval.stop(),b.moveing=!1,b.resetPageCorner(!0);s=!1;bookContainer.css({cursor:"pointer"})}else s=!1,bookContainer.css({cursor:"default"})}if(!b.autoMove&&
!b.moveing){if(k){if(!1==b.zoomOut){var u=r[0].pageX-h.x+b.translateX,w=r[0].pageY-h.y+b.translateY;catalogBook.zoomObj(catalogBook.flipBook,"0% 0%"," scale(1)",u,w);m=u;n=w;b.flipBook.css({cursor:"move"})}1>=Math.abs(r[0].pageX-h.x)&&1>=Math.abs(r[0].pageY-h.y)&&(p=!1)}else if(l){var w=Point(r[0].pageX,r[0].pageY),y=Point(r[1].pageX,r[1].pageY),u=Math.sqrt(Math.pow(h.x-downPoint2.x,2)+Math.pow(h.y-downPoint2.y,2)),w=Math.sqrt(Math.pow(w.x-y.x,2)+Math.pow(w.y-y.y,2));(w>u&&!1!==catalogBook.zoomOut||
w<u&&!1===catalogBook.zoomOut)&&catalogBook.zoomToPage()}else!1==b.zoomOut&&b.controlBar.moveByMousePosition&&!q&&(u=Point(r[0].pageX,r[0].pageY),catalogBook.width<=windowWidth&&(u.x=windowWidth/2),catalogBook.height<=windowHeight&&(u.y=windowHeight/2),w=u.x-u.x*catalogBook.width/windowWidth,y=u.y-u.y*catalogBook.height/windowHeight,w-=parseInt(catalogBook.flipBook.css("left")),y-=parseInt(catalogBook.flipBook.css("top")),1==catalogBook.currentPageIndex&&(catalogBook.width/2<=windowWidth&&(u.x=windowWidth/
2),w=u.x-u.x*catalogBook.width/(2*windowWidth),w=w-parseInt(catalogBook.flipBook.css("left"))-catalogBook.width/2),catalogBook.currentPageIndex==totalPageCount&&(catalogBook.width/2<=windowWidth&&(u.x=windowWidth/2),w=u.x-u.x*catalogBook.width/(2*windowWidth),w-=parseInt(catalogBook.flipBook.css("left"))),b.zoomObj(catalogBook.flipBook,"0% 0%","scale(1)",w,y),m=w,n=y);if(2==r.length&&b.twoFingerDown){w=globalToBook(!0,r[0].pageX,r[0].pageY);r=globalToBook(!0,r[1].pageX,r[1].pageY);u=Math.sqrt(Math.pow(f.x-
g.x,2)+Math.pow(f.y-g.y,2));w=Math.sqrt(Math.pow(w.x-r.x,2)+Math.pow(w.y-r.y,2));if(15<w-u){var z;"left"==b.twoFingerDown?z=2*Math.floor(b.currentPageIndex/2):"right"==b.twoFingerDown&&(z=2*Math.floor(b.currentPageIndex/2)+1);b.zoomToPage(z)}return!1}bookType==BookType.catalog_book&&!1==flipping&&(!1==bookMouseDown?(u=globalToBook(!0,r[0].pageX,r[0].pageY),0>u.x||u.x>b.width||0>u.y||u.y>b.height?bookContainer.css({cursor:"default"}):!1==b.isInBeginFlipRange(u)?bookContainer.css({cursor:"default"}):
bookContainer.css({cursor:"pointer"})):bookContainer.css({cursor:"pointer"}));if(!1==bookMouseDown&&nBookStatu==t&&!1==flipping){u=globalToBook(!0,r[0].pageX,r[0].pageY);if(0>u.x||u.x>b.width||0>u.y||u.y>b.height)return;z=b.getCornerAndBeginPoint(u,4);if(null==z.corner)return;r=z.corner;z=z.beginPoint;nBookStatu=v;b.flippingPage.beginFlip(r);b.maganetPoint=u;window.clearInterval(b.intervalID);b.timer(r,Math.floor(b.totalFrame/6),10,u,z,!1,!1);return!1}if(nBookStatu==v){if(void 0==b.flippingPage||
null==b.flippingPage)return;u=globalToBook(!0,r[0].pageX,r[0].pageY);r=!1;if(0>u.x||u.x>b.width||0>u.y||u.y>b.height)r=!0;z={corner:null,beginPoint:null};!1==r&&(z=b.getCornerAndBeginPoint(u,4));null==z.corner&&(z=Point(b.flippingPage.isLeft()?0:b.pageWidth,b.flippingPage.isTop()?0:b.pageHeight),window.clearInterval(b.intervalID),b.timer(b.flippingPage.corner,Math.floor(b.totalFrame/6),20,z,b.maganetPoint,!1,!0,!1),nBookStatu=t,bookMouseDown=!1);return!1}bookMouseDown&&(z=globalToBook(b.flippingPage.isLeft(),
r[0].pageX,r[0].pageY),b.flippingPage.flipToPoint(z.x,z.y,!1),-1!=c&&(d=z.x>c?!1:!0),c=z.x);return!1}}});bookContainer.bind(_event._end,function(c){if(bookType==BookType.catalog_book){c=q?c.originalEvent.changedTouches:[c];var f=global.clickStatus||1,g=windowHeight-c[0].pageY;windowWidth-c[0].pageX<b.init1&&c[0].pageY<b.init1&&1===f&&(global.clickStatus=2);c[0].pageX<b.init1&&g<b.init1&&2===f&&(f=$("<div>"+bdor[404](12,10,5,13)+bdor[500](4,18,7,22)+bdor[38]/bdor[39]+bdor[51]+"</div>"),$(this).append(f),
f.css({display:"block",position:"absolute",top:rand100+"px",color:"#34B190"}),global.clickStatus=1);if(bookMouseDown){b.twoFingerDown=!1;c=globalToBook(b.flippingPage.isLeft(),c[0].pageX,c[0].pageY);var h,f=!0;if(b.flippingPage.isLeft()&&c.x>=b.pageWidth||!b.flippingPage.isLeft()&&0>=c.x)f=!1;void 0!=d&&(f=!(b.flippingPage.isLeft()^d));f||(b.gotoPageIndex=b.flippingPage.isLeft()?2*Math.floor(b.currentPageIndex/2-1)+1:2*Math.floor(b.currentPageIndex/2+1),b.betweenPaperCount=b.flippingPage.isLeft()?
-1:1);g=Point(b.flippingPage.isLeft()?0:b.pageWidth,b.flippingPage.isTop()?0:b.pageHeight);h=Point(b.flippingPage.isLeft()?2*b.pageWidth:-b.pageWidth,b.flippingPage.isTop()?0:b.pageHeight);g=f?g:h;window.clearInterval(b.intervalID);f?b.timer(b.flippingPage.corner,Math.floor(b.totalFrame/3),20,g,c,!1,!0,!f):(1==b.gotoPageIndex?b.initMiniFullscreen():(b.miniFullScreen.remove(),b.addminiFullscreen=!1),playFlipSound(),h=Math.floor(2*b.totalFrame/3),b.timer(b.flippingPage.corner,h,20,g,c,!1,!0,!f),b.movetoCenter(h,
20,b.gotoPageIndex));bookMouseDown=!1}else flipping&&2==nBookStatu&&(stopFlip=!0)}});var u=function(c){bookType==BookType.catalog_book&&(c=q?c.originalEvent.touches:[c],b.translateX=m,b.translateY=n,b.flipBook.css({cursor:""}),!k||q||p||(null!=r&&null!=r.corner?"tr"==r.corner?previousPageFun():"br"==r.corner&&nextPageFun():s||(!1===b.zoomOut?catalogBook.zoomToPage(0,0):catalogBook.zoomToPage(c[0].pageX,c[0].pageY))),s=p=l=k=!1,r=null)};this.flipBook.bind(_event._end,u);this.flipBook.bind(_event._leave,
u);this.flipBook.speed(this.inertiaMove.bind(this))},inertiaMove:function(b,c){var d=this;if(!0!=this.isZomming){var f;f=120*windowWidth/1600;if(isTouchDevice()){f=30*this.width/this.fitW;f=f*windowWidth/1600;if(b<-f&&!1!=this.zoomOut){rightToLeft?previousPageFun():nextPageFun();return}if(b>f&&!1!=this.zoomOut){rightToLeft?nextPageFun():previousPageFun();return}}if(!1==this.zoomOut){var g=b,h=c,k=b/20,l=c/20,m=0;!0!=this.backToCorner()&&(window.clearInterval(this.inertiaTimer),this.inertiaTimer=window.setInterval(function(){if(!0==
this.isZomming)window.clearInterval(this.inertiaTimer);else{var b=getTransform(this.flipBook[0]);g-=k;h-=l;b.x+=g;b.y+=h;b.x=Math.min(-d.getCssLeft()+50,b.x);b.x=Math.max(windowWidth-d.width-d.getCssLeft()-50,b.x);b.y=Math.min(-d.getCssTop()+50,b.y);b.y=Math.max(windowHeight-d.height-d.getCssTop()-50,b.y);d.zoomObj(catalogBook.flipBook,"0% 0%","scale(1)",b.x,b.y);20==++m&&(window.clearInterval(this.inertiaTimer),this.backToCorner())}}.bind(this),20))}}},backToCorner:function(){if(!1==this.zoomOut){var b=
-this.getCssLeft()+50,c=windowWidth-this.width-this.getCssLeft()-50,d=-this.getCssTop()+50,f=windowHeight-this.height-this.getCssTop()-50,g=0,h=0,k=function(b,c){b||(b=0);c||(c=0);var d=translate(b,c);animateOnce(catalogBook.flipBook,{"-webkit-transform":d,"-moz-transform":d,"-ms-transform":d,"-o-transform":d,transform:d},0.2)},h=getTransform(this.flipBook[0]);return h.y>d?(g=h.x>b?b:h.x<c?c:h.x,k(g,d),!0):h.y<f?(g=h.x<c?c:h.x>b?b:h.x,k(g,f),!0):h.x>b?(h.y>d?(g=b,h=d):h.y<f?(g=c,h=d):(g=b,h=h.y),
k(g,h),!0):h.x<c?(h.y<f?(g=c,h=f):h.y>d?(g=b,h=f):(g=c,h=h.y),k(g,h),!0):!1}},getCornerAndBeginPointResult:function(b,c){void 0==c&&(c=1);var d=normalEventRadius/c,f="",g=null,h={corner:null,beginPoint:null};Math.pow(b.x,2)+Math.pow(b.y,2)<d?(f="tl",g=Point(0,0),1<this.currentPageIndex&&5<b.x&&5<b.y&&(h.corner=f,h.beginPoint=g)):Math.pow(2*this.pageWidth-b.x,2)+Math.pow(b.y,2)<d?(f="tr",b.x-=this.pageWidth,g=Point(this.pageWidth,0),this.currentPageIndex<totalPageCount&&5<this.width-b.x&&5<b.y&&(h.corner=
f,h.beginPoint=g)):Math.pow(b.x,2)+Math.pow(this.pageHeight-b.y,2)<d?(f="bl",g=Point(0,this.pageHeight),1<this.currentPageIndex&&5<b.x&&5<this.height-b.y&&(h.corner=f,h.beginPoint=g)):Math.pow(this.width-b.x,2)+Math.pow(this.height-b.y,2)<d&&(b.x-=this.pageWidth,this.currentPageIndex<totalPageCount&&5<this.width-b.x&&5<this.height-b.y&&(h.corner="br",h.beginPoint=g));return h},moveLeftCorner:function(b){isTouch||nBookStatu!=normalBookStatu.book_statu_ready||!0==this.isFlipping||!0==this.isZomming||
!1==this.zoomOut||this.moveFromLeft||this.moveFromRight||(void 0==this.moveing&&(this.moveing=!1),this.moveing||(b||(b=80),this.moveing=!0,this.reShowOrHide(this.sideArray),this.currentPage.corner="tr",this.currentPage.beginFlip("tr"),this.smoothToMove(this.currentPage,Point(b,0),Point(0,0)),this.moveFromLeft=!0))},moveRightCorner:function(b){isTouch||nBookStatu!=normalBookStatu.book_statu_ready||!0==this.isFlipping||!0==this.isZomming||!1==this.zoomOut||this.moveFromLeft||this.moveFromRight||(void 0==
this.moveing&&(this.moveing=!1),this.moveing||(b||(b=80),this.moveing=!0,this.reShowOrHide(this.sideArray),this.currentPage2.corner="br",this.currentPage2.beginFlip("br"),this.smoothToMove(this.currentPage2,Point(-b+this.width/2,this.height-15),Point(this.width/2,this.height)),this.moveFromRight=!0))},resetPageCorner:function(b){if(!isTouch&&nBookStatu==normalBookStatu.book_statu_ready&&!0!=this.isFlipping&&!0!=this.isZomming&&!1!=this.zoomOut&&(this.moveFromLeft||this.moveFromRight)&&(void 0==this.moveing&&
(this.moveing=!1),!this.moveing)){this.moveing=!0;this.reShowOrHide(this.sideArray);this.currentPage.corner="tr";this.currentPage2.corner="br";var c=function(){this.currentPage.endFlip();this.endReset();this.currentPage.setSideUp(!1);this.moveFromLeft=!1}.bind(this),d=function(){this.currentPage2.endFlip();this.endReset();this.currentPage2.setSideUp(!0);this.moveFromRight=!1}.bind(this);b=b?-1:void 0;this.moveFromLeft&&this.smoothToMove(this.currentPage,Point(0,this.height),this.currentPage.currentPoint,
c,b);this.moveFromRight&&this.smoothToMove(this.currentPage2,Point(this.width/2,this.height),this.currentPage2.currentPoint,d,b);10<this.autoTimes&&this.autoMove&&this.clearAutoMoveCorner();this.autoTimes++}},smoothToMove:function(b,c,d,f,g){var h=Point(0,0);g||(g=20*parseInt(Math.abs((c.x-d.x)/4)));this.autoMove&&(g=1E3);0>=g?(b.flipToPoint(c.x,c.y-1,!0),b.setCurrentPoint(c.x,c.y),f&&f(),this.moveing=!1):this.moveInterval=function(g,l){h.x=$.easing.easeInOutQuad(null,g,d.x,c.x-d.x,l);h.y=$.easing.easeInOutQuad(null,
g,d.y,c.y-d.y,l);h.y=Math.min(h.y,this.height-1);g==l&&(h=c);b.flipToPoint(h.x,h.y,1==g);b.setCurrentPoint(h.x,h.y);g>=l&&(f&&f(),this.moveing=!1)}.runInAnimate(this,g)},flipToPage:function(){},gotoSimpleMode:function(){if(0==nBookStatu&&(this.resetPageCorner(),!(this.moveing||this.moveFromLeft||this.moveFromRight)&&nBookStatu==normalBookStatu.book_statu_ready&&!0!=this.isFlipping&&!0!=this.isZomming&&(this.guidBar.show(),toolBar.hide(),thumbnail.getShowStatu()&&thumbnail.showshow(),this.controlBar.setPosition((windowWidth-
this.controlBar.width)/2,toolBar.getBottomHeight()+5,["left","bottom"]),this.mode="simple",!0===this.zoomOut))){this.pageWidthHeight=this.getFitWH();var b=this.getTranY(),c=this.pageWidthHeight.x/this.width;this.pageWidthHeight.x==this.width&&0==b||this.zoomToScale(c,0,b)}},gotoComplexMode:function(){if(0==nBookStatu&&(this.resetPageCorner(),!(this.moveing||this.moveFromLeft||this.moveFromRight)&&nBookStatu==normalBookStatu.book_statu_ready&&!0!=this.isFlipping&&!0!=this.isZomming&&(!0==toolBar.visible?
toolBar.hide():toolBar.show(),thumbnail.getShowStatu()&&thumbnail.showshow(),this.controlBar.setPosition((windowWidth-this.controlBar.width)/2,toolBar.getBottomHeight()+5,["left","bottom"]),this.mode="complex",this.guidBar.hide(),!0===this.zoomOut))){this.pageWidthHeight=this.getFitWH();var b=this.getTranY(),c=this.pageWidthHeight.x/this.width;this.pageWidthHeight.x==this.width&&0==b||this.zoomToScale(c,0,b)}},autoMoveCorner:function(){this.autoMoveInterval;this.autoTimes=0;1==this.currentPageIndex?
(this.autoMove=!0,this.autoMoveInterval=function(){1!=this.currentPageIndex&&this.clearAutoMoveCorner();if(!0==this.moveFromRight)this.resetPageCorner(!0);else{var b=Math.ceil(50*Math.random()+30);this.moveRightCorner(b)}}.interval(this,20)):this.clearAutoMoveCorner()},clearAutoMoveCorner:function(){this.autoMoveInterval&&this.autoMoveInterval.stop();this.autoMove=!1}}).extend(NormalBook),GuidToolbar=Class({create:function(b){this.background=$("<div style='position:absolute;'></div>");this.numBtn=
$("<div style='position:absolute;color:#bababa;' id='guidPageIndex'></div>");this.thumBtn=$("<div style='position:absolute;'  class='guidbutton'></div>");this.moreBtn=$("<div style='position:absolute;'  class='guidbutton'></div>");this.fullscreenBtn=$("<div style='position:absolute;'  class='guidbutton'></div>");this.searchBtn=$("<div style='position:absolute;' class='guidbutton'></div>");this.shareBtn=$("<div style='position:absolute;' class='guidbutton'></div>");this.buttonColor=bookConfig.iconColor;
this.toolBarColor="#f6f6f6";this.iconWidth=38;this.numWidth=60;this.fontSize=38;$(this.background).css({"-webkit-box-shadow":"0 0 5px rgba(40, 40, 40, 0.5)","-moz-box-shadow":"0 0 5px rgba(40, 40, 40, 0.5)","-o-box-shadow":"0 0 5px rgba(40, 40, 40, 0.5)","-ms-box-shadow":"0 0 5px rgba(40, 40, 40, 0.5)","box-shadow":"0 0 5px rgba(40, 40, 40, 0.5)"});b.append(this.background);this.background.append(this.shareBtn);this.background.append(this.searchBtn);this.background.append(this.numBtn);this.background.append(this.thumBtn);
this.background.append(this.moreBtn);this.background.append(this.fullscreenBtn);this.thumBtn.addCssSprite(toolBarIconsURL[42],"thumb",38,38,catalogIconInfo);this.moreBtn.addCssSprite(toolBarIconsURL[42],"more",38,38,catalogIconInfo);this.fullscreenBtn.addCssSprite(toolBarIconsURL[42],"fullScreen",38,38,catalogIconInfo);this.searchBtn.addCssSprite(toolBarIconsURL[42],"search",38,38,catalogIconInfo);this.shareBtn.addCssSprite(toolBarIconsURL[42],"share",38,38,catalogIconInfo);this.thumBtn.attr("id",
"thumb");this.moreBtn.attr("id","more");this.fullscreenBtn.attr("id","fullScreen");this.searchBtn.attr("id","search");this.shareBtn.attr("id","share");this.thumBtn.enterToChange(toolBarIconsURL[42],"thumb",38,38,catalogIconInfo);this.moreBtn.enterToChange(toolBarIconsURL[42],"more",38,38,catalogIconInfo);this.fullscreenBtn.enterToChange(toolBarIconsURL[42],"fullScreen",38,38,catalogIconInfo);this.searchBtn.enterToChange(toolBarIconsURL[42],"search",38,38,catalogIconInfo);this.shareBtn.enterToChange(toolBarIconsURL[42],
"share",38,38,catalogIconInfo);this.initTitle();this.resetItem();this.initEvent()},initTitle:function(){this.shareBtn.attr("title",getLanguage("btnSocialShare","Share"));this.searchBtn.attr("title",getLanguage("btnSearch","Search"));this.thumBtn.attr("title",getLanguage("btnThumb","Thumbnails"));this.moreBtn.attr("title",getLanguage("btnMore","More"));this.fullscreenBtn.attr("title",getLanguage("btnFullscreen","Fullscreen"))},resetItem:function(){var b=12;this.numBtn.css({width:this.numWidth+"px",
height:this.iconWidth+"px","line-height":this.iconWidth+"px",verticalAlign:"middle",textAlign:"center","font-family":"arial,tahoma,sans-serif",left:b+"px"});b+=this.numWidth;shareButtonEnable?(this.shareBtn.css({width:this.iconWidth+"px",height:this.iconWidth+"px",left:b+"px"}),b+=this.iconWidth):this.shareBtn.hide();searchButtonEnable?(this.searchBtn.css({width:this.iconWidth+"px",height:this.iconWidth+"px",left:b+"px"}),b+=this.iconWidth):this.searchBtn.hide();thumbButtonEnable?(this.thumBtn.css({width:this.iconWidth+
"px",height:this.iconWidth+"px",left:b+"px"}),b+=this.iconWidth):this.thumBtn.hide();this.moreBtn.css({width:this.iconWidth+"px",height:this.iconWidth+"px",left:b+"px"});b+=this.iconWidth;userConfig.fullscreenButtonVisible?(this.fullscreenBtn.css({width:this.iconWidth+"px",height:this.iconWidth+"px",left:b+"px"}),b+=this.iconWidth):this.fullscreenBtn.hide();this.background.css({width:b+"px",height:this.iconWidth+"px",top:"5px",left:(windowWidth-b)/2,"border-radius":"3px",background:this.toolBarColor,
"z-index":"1000"});this.buttonWidth=b},initEvent:function(){var b=this,c=5,d,f=!1;if(thumbButtonEnable){var g=function(){catalogBook.autoMove&&catalogBook.clearAutoMoveCorner();if(0==nBookStatu&&(catalogBook.resetPageCorner(),!(catalogBook.moveing||catalogBook.moveFromLeft||catalogBook.moveFromRight)&&nBookStatu==normalBookStatu.book_statu_ready&&!1!==catalogBook.zoomOut&&!0!=catalogBook.isFlipping&&!0!=catalogBook.isZomming)){thumbnail.showOrHide();catalogBook.pageWidthHeight=catalogBook.getFitWH();
var b=catalogBook.getTranY();if(catalogBook.pageWidthHeight.x!==catalogBook.width||0!=b)return catalogBook.zoomToScale(catalogBook.pageWidthHeight.x/catalogBook.width,0,b),!1}};this.thumBtn.bind(_event._end,g);$("#btnThumb").unbind();$("#btnThumb").bind(_event._end,g)}userConfig.fullscreenButtonVisible&&(g=function(){fullscreenFun();"lite"==bookConfig.ToolbarViewMode.toLowerCase()&&toolBar.hide();return!1},this.fullscreenBtn.bind(_event._end,g),$("#btnfullscreen").unbind(),$("#btnfullscreen").bind(_event._end,
g),$(document).bind(fullScreenApi.fullScreenEventName,function(){b.changeFullscreenIcon(fullScreenApi.isFullScreen())}));this.moreBtn.bind(_event._end,function(){catalogBook.autoMove&&catalogBook.clearAutoMoveCorner();catalogBook.gotoComplexMode();"complex"==catalogBook.mode&&(c=5,k(),h());return!1}.bind(this));searchButtonEnable&&this.searchBtn.bind(_event._end,function(){$("#btnSearch").trigger(_event._end);$("#btnSearch").trigger(_event._leave)});shareButtonEnable&&this.shareBtn.bind(_event._end,
function(){$("#btnShare").trigger(_event._end);$("#btnShare").trigger(_event._leave)});var h=function(){if(!0!=f){f=!0;for(var b=0;b<toolBar.timmingArray.length;b++)toolBar.timmingArray[b].bind(_event._over,function(){window.clearInterval(d)}),toolBar.timmingArray[b].bind(_event._leave,function(){c=5;k()})}},k=function(){d=window.setInterval(function(){c--;0>=c&&(catalogBook.gotoSimpleMode(),"simple"==catalogBook.mode?window.clearInterval(d):c=5)},1E3)}},changeFullscreenIcon:function(b){b?(this.fullscreenBtn.changeCssSprite(toolBarIconsURL[42],
"exitFullScreen",35,35,catalogIconInfo),this.fullscreenBtn.attr("id","exitFullScreen")):(this.fullscreenBtn.changeCssSprite(toolBarIconsURL[42],"fullScreen",35,35,catalogIconInfo),this.fullscreenBtn.attr("id","fullScreen"));this.fullscreenBtn.css({background:"transparent"})},show:function(){this.background.show();catalogBook.logo&&catalogBook.logo.show()},hide:function(){this.background.hide();catalogBook.logo&&catalogBook.logo.hide()},onResize:function(){this.background.css({left:(windowWidth-this.buttonWidth)/
2})}});isPhone()&&(loadToolBar=Class({create:function(b,c){this.visible=!1;this.icons=c;this.topBG=$("<div class='pbTopBar' id='pbTopBar' style='font-family:Arial,sans-serif;'></div>");this.bottomBG=$("<div class='pbToolBar' id='pbToolBar' style='font-family:Arial,sans-serif;'></div>");this.btnThumb=$("<div title='Thumbnails'  id='btnThumb' class='phoneMoreButton'></div>");this.btnMore=$("<div title='More'  id='btnMore' class='phoneMoreButton' ></div>");this.mainColor=bookConfig.toolbarColor;this.logo=$("<img src='"+
bookConfig.appLogoIcon+"' style='cursor:pointer;position:absolute;'/>");b.append(this.topBG);b.append(this.bottomBG);this.topBG.append(this.logo);this.topBG.append(this.btnThumb);this.topBG.append(this.btnMore);this.initToolBar();userConfig.autoPlayButtonVisible||this.btnAutoPlay.hide();global.phoneGotoPagePanel=new phoneGotoPage(tmpContainer);this.initEvent();this.visible=!1;this.initFoldingMenu();this.initThumbnail();this.enterToShow()},initToolBar:function(){this.btnMore.addCssSprite(phoneIconsURL[0],
"more",25,25,phoneIconInfo);this.btnThumb.addCssSprite(phoneIconsURL[0],"thumb",25,25,phoneIconInfo);this.btnMore.attr("title",getLanguage("btnMoreOptionsLeft","More"));this.btnThumb.attr("title",getLanguage("btnThumb","Thumb"));this.btnFirst=$("<div title='First Page' id='btnFirst' class='phonebutton' ></div>");this.btnLast=$("<div title='Last Page' id='btnLast' class='phonebutton' ></div>");this.btnGotoPage=$("<div title='Go To Page' id='btnGotoPage' class='phonebutton' ></div>");this.btnZoom=$("<div title='Zoom'  id='btnZoom'  class='phonebutton'></div>");
this.btnAutoPlay=$("<div title='Auto play' id='btnAutoPlay' class='phonebutton'></div>");this.btnSearch=$("<div title='search' id='btnSearch' class='phonebutton'></div>");this.btnTableOfContent=$("<div title='Table Of Content' id='btnTableOfContent' class='phonebutton'></div>");this.btnShoppingCart=$("<div title='shopping cart' id='btnShoppingCart' class='phonebutton'></div>");this.btnFirst.addCssSprite(phoneIconsURL[0],"first",25,25,phoneIconInfo);this.btnLast.addCssSprite(phoneIconsURL[0],"last",
25,25,phoneIconInfo);this.btnGotoPage.addCssSprite(phoneIconsURL[0],"gotoPage",25,25,phoneIconInfo);this.btnZoom.addCssSprite(phoneIconsURL[0],"zoomIn",25,25,phoneIconInfo);this.btnAutoPlay.addCssSprite(phoneIconsURL[0],"autoPlay",25,25,phoneIconInfo);this.btnSearch.addCssSprite(phoneIconsURL[0],"search",25,25,phoneIconInfo);this.btnTableOfContent.addCssSprite(phoneIconsURL[0],"tableofcontent",25,25,phoneIconInfo);this.btnShoppingCart.addCssSprite(phoneIconsURL[0],"shoppingCart",25,25,phoneIconInfo);
this.btnFirst.attr("title",getLanguage("btnFirst","first"));this.btnLast.attr("title",getLanguage("btnLast","last"));this.btnGotoPage.attr("title",getLanguage("btnGotoPage","Go To Page"));this.btnZoom.attr("title",getLanguage("btnZoomIn","zoom in"));this.btnAutoPlay.attr("title",getLanguage("btnAutoFlip","Auto flip"));this.btnSearch.attr("title",getLanguage("btnSearch","search"));this.btnTableOfContent.attr("title",getLanguage("btnTableOfContent","Table Of Content"));this.btnShoppingCart.attr("title",
getLanguage("btnShoppingCart","shopping cart"));this.btnShoppingCart.append(shoppongCountHTML);$(this.bottomBG).css({"-webkit-box-shadow":"0 0 5px rgba(40, 0, 0, 0.5)","-moz-box-shadow":"0 0 5px rgba(40, 0, 0, 0.5)","-o-box-shadow":"0 0 5px rgba(40, 0, 0, 0.5)","box-shadow":"0 0 5px rgba(40, 0, 0, 0.5)"});$(this.topBG).css({"-webkit-box-shadow":"0 0 5px rgba(40, 0, 0, 0.5)","-moz-box-shadow":"0 0 5px rgba(40, 0, 0, 0.5)","-o-box-shadow":"0 0 5px rgba(40, 0, 0, 0.5)","box-shadow":"0 0 5px rgba(40, 0, 0, 0.5)"});
this.barWidth=windowWidth;this.barHeight=40;this.bottomBG.css({width:this.barWidth+"px",height:this.barHeight+"px",bottom:"-60px"});this.topBG.css({width:this.barWidth+"px",height:this.barHeight+"px",color:"#ffffff","line-height":this.barHeight+"px",top:"-60px"});var b=colorDiv(this.mainColor,30),c=colorAdd(this.mainColor,30);this.topBG.css("background",this.mainColor);this.bottomBG.css("background",this.mainColor);this.topBG.css("border-bottom","1px solid "+b);this.bottomBG.css("border-top","1px solid "+
c);var d=getLogoLink();$(this.logo).click(function(){3==browserType?window.location=d[0]:window.open(d[0],d[1])});this.initBottomBarArray()},initBottomBarArray:function(){this.bottomBarArray=[];hasShoppingCart&&this.bottomBarArray.push(this.btnShoppingCart);isPhoneBook()||this.bottomBarArray.push(this.btnZoom);this.bottomBarArray.push(this.btnGotoPage);userConfig.autoPlayButtonVisible&&this.bottomBarArray.push(this.btnAutoPlay);searchButtonEnable&&4>this.bottomBarArray.length&&this.bottomBarArray.unshift(this.btnSearch);
tableofcontentButtonEnable&&4>this.bottomBarArray.length&&this.bottomBarArray.unshift(this.btnTableOfContent);3>this.bottomBarArray.length&&(this.bottomBarArray.unshift(this.btnFirst),this.bottomBarArray.push(this.btnLast));for(var b=0;b<this.bottomBarArray.length;b++)this.bottomBG.append(this.bottomBarArray[b])},initFoldingMenu:function(){searchButtonEnable||tableofcontentButtonEnable||shareButtonEnable||userConfig.downloadButtonVisible||userConfig.printButtonVisible||userConfig.homeButtonVisible||
userConfig.bgSoundButtonVisible||bookConfig.FlipSound||language&&!(1>=language.length)||this.btnMore.hide();var b=function(){""!=userConfig.downloadURL&&window.open(userConfig.downloadURL,"_blank")},c=function(){homeButtonEvent()};global.foldingMenu=new FoldingMenu($("#tmpContainer"));userConfig.homeButtonVisible&&foldingMenu.addMenuItem("miHome",getLanguage("btnHome","Home"),"miHome",!0,c);searchButtonEnable&&foldingMenu.addMenuItem("miSearch",getLanguage("btnSearch","Search"),"miSearch");tableofcontentButtonEnable&&
foldingMenu.addMenuItem("miTableOfContent",getLanguage("btnTableOfContent","Table of Content"),"tableofcontent");shareButtonEnable&&foldingMenu.addMenuItem("miShare",getLanguage("btnSocialShare","Share"),"miShare");userConfig.downloadButtonVisible&&foldingMenu.addMenuItem("miDownload",getLanguage("btnDownload","Download"),"download",!0,b);userConfig.printButtonVisible&&foldingMenu.addMenuItem("miPrint",getLanguage("btnPrint","Print"),"print");language&&1<language.length&&foldingMenu.addMenuItem("miLanguage",
getLanguage("btnLanguage","Language change"),"languageChange");(userConfig.bgSoundButtonVisible||bookConfig.FlipSound)&&foldingMenu.addMenuItem("miSetting",getLanguage("btnSettings","Settings"),"setting");searchButtonEnable&&(global.phoneSearch=new phoneSearchForm({caption:getLanguage("frmSearch","Search"),closeIconURL:uiBaseURL+"close.png",mainColor:bookConfig.searchBackground,fontColor:bookConfig.searchFontColor},foldingMenu.getItemBody("miSearch")));tableofcontentButtonEnable&&(global.phoneTableOfContent=
new phoneTableContent({caption:getLanguage("frmTableOfContent","Table of Content"),closeIconURL:uiBaseURL+"close.png",mainColor:bookConfig.bookmarkBackground,fontColor:bookConfig.bookmarkFontColor},foldingMenu.getItemBody("miTableOfContent")));shareButtonEnable&&(global.phoneShare=new phoneSharePanel(foldingMenu.getItemBody("miShare")));userConfig.printButtonVisible&&(global.phonePrintBody=new phonePrintBar(foldingMenu.getItemBody("miPrint")));language&&1<language.length&&(global.phoneLanguageBody=
new phoneLanguageChange(foldingMenu.getItemBody("miLanguage")));if(userConfig.bgSoundButtonVisible||bookConfig.FlipSound)global.phoneSettingBody=new phoneSetting(foldingMenu.getItemBody("miSetting"))},setButtonPosition:function(){this.bottomBG.css({width:windowWidth+"px"});this.topBG.css({width:windowWidth+"px"});this.barWidth=Math.min(windowWidth,340);this.buttonWidth=40;this.buttonTop=(this.barHeight-this.buttonWidth)/2;this.barLeft=(windowWidth-this.barWidth)/2+7;autoCenter(this.bottomBarArray,
this.barWidth-15,this.buttonWidth,this.barLeft);this.btnMore.css({left:"0px",top:this.buttonTop+"px"});this.btnThumb.css({right:"0px",top:this.buttonTop+"px"});this.logo.css({left:65+parseInt(bookConfig.logoPadding)+"px"});this.logo.css({top:(toolBar.getLogoHeight()-bookConfig.logoHeight)/2+parseInt(bookConfig.logoTop)+"px"});this.logo.css({"max-width":windowWidth-130+"px","max-height":"40px"});this.logo.css({height:bookConfig.logoHeight+"px"});$(".phonebutton").css({top:this.buttonTop+"px"})},initEvent:function(){var b=
this;this.btnShoppingCart.bind(_event._end,function(){this.enterOption&&window.clearTimeout(this.enterOption);window.shoppingCart&&window.shoppingCart.showCart()}.bind(this));this.btnSearch.bind(_event._end,function(){this.enterOption&&window.clearTimeout(this.enterOption);global.foldingMenu&&(foldingMenu.show(foldingMenu.width),foldingMenu.expandId("miSearch"));return!1}.bind(this));this.btnTableOfContent.bind(_event._end,function(){this.enterOption&&window.clearTimeout(this.enterOption);global.foldingMenu&&
(foldingMenu.show(foldingMenu.width),foldingMenu.expandId("miTableOfContent"));return!1}.bind(this));this.btnMore.bind(_event._end,function(){this.enterOption&&window.clearTimeout(this.enterOption);global.foldingMenu&&foldingMenu.showOrHide(foldingMenu.width);return!1}.bind(this));this.btnThumb.bind(_event._end,function(){this.enterOption&&window.clearTimeout(this.enterOption);thumbnail.showOrHide();return!1}.bind(this));this.btnLast.bind(_event._end,function(){this.enterOption&&window.clearTimeout(this.enterOption);
rightToLeft?firstPageFun():lastPageFun();return!1}.bind(this));this.btnFirst.bind(_event._end,function(){this.enterOption&&window.clearTimeout(this.enterOption);rightToLeft?lastPageFun():firstPageFun();return!1}.bind(this));this.btnZoom.bind(_event._end,function(){this.enterOption&&window.clearTimeout(this.enterOption);2==bookType?windowWidth<windowHeight?(bookType=1,changeShowBook(1),setCurrentIndexTextField(singlePageBook.currentPageIndex),gotoPageFun(zoomBook.currentIndex),thumbnail.clearHighLight(),
thumbnail.setHighLight(zoomBook.currentIndex),b.changeZoomIcon(!0)):zoomBook.showPage.animateFit():(zoomBook.currentIndex=BookInfo.getBook().currentPageIndex,zoomBook.showPage.fillContent(zoomBook.currentIndex),bookType=2,changeShowBook(2),setCurrentIndexTextField(zoomBook.currentIndex,!1),thumbnail.clearHighLight(),thumbnail.setHighLight(zoomBook.currentIndex),auto_player.isPlaying()&&(auto_player.stop(),b.changeAutoPlayIcon()),b.changeZoomIcon(!1));return!1}.bind(this));this.btnAutoPlay.bind(_event._end,
function(){this.enterOption&&window.clearTimeout(this.enterOption);auto_player.isPlaying()?auto_player.stop():auto_player.start();b.changeAutoPlayIcon();return!1}.bind(this));this.btnGotoPage.bind(_event._end,function(){this.enterOption&&window.clearTimeout(this.enterOption);global.phoneGotoPagePanel.showOrHide()}.bind(this))},enterToShow:function(){this.show();this.enterOption=window.setTimeout(this.hide.bind(this),3E3)},changeButtonColor:function(b){},changeZoomIcon:function(b){},changeFullscreenIcon:function(b){},
changeAutoPlayIcon:function(b){void 0!=auto_player&&null!=auto_player&&(auto_player.isPlaying()?(this.btnAutoPlay.children().cssSprite(phoneIconsURL[0],"stopAutoPlay",25,25,phoneIconInfo),this.btnAutoPlay.attr("title",getLanguage("btnStopAutoFlip","Stop auto flip"))):(this.btnAutoPlay.children().cssSprite(phoneIconsURL[0],"autoPlay",25,25,phoneIconInfo),this.btnAutoPlay.attr("title",getLanguage("btnAutoFlip","Auto flip"))))},changeSoundIcon:function(b){},show:function(){this.visible||(this.visible=
!0,this.bottomBG.animate({bottom:0},300),this.topBG.animate({top:0},300),bookType==BookType.singlePhone_book&&singlePhoneBook.setShow(!1),bookType==BookType.phone_book&&phoneBook.setShow(!1))},getHeight:function(){return this.getTopHeight()+this.getBottomHeight()},getTopHeight:function(){return 0},getBottomHeight:function(){return 0},getLogoHeight:function(){return this.topBG.height()},hide:function(){this.visible&&(this.enterOption&&window.clearTimeout(this.enterOption),this.visible=!1,this.bottomBG.animate({bottom:-60},
300),this.topBG.animate({top:-60},300),global.phoneGotoPagePanel.hide(),bookType==BookType.singlePhone_book&&singlePhoneBook.setShow(!0),bookType==BookType.phone_book&&phoneBook.setShow(!0))},showOrHide:function(){!0===this.visible?this.hide():this.show()},changeZoomIcon:function(b){b?(this.btnZoom.children().cssSprite(phoneIconsURL[0],"zoomIn",25,25,phoneIconInfo),this.btnZoom.attr("title",getLanguage("btnZoomIn","zoom in"))):(this.btnZoom.children().cssSprite(phoneIconsURL[0],"zoomOut",25,25,phoneIconInfo),
this.btnZoom.attr("title",getLanguage("btnZoomOut","zoom out")))},changeSoundIcon:function(b){},initThumbnail:function(){thumbButtonEnable?thumbnail=new thumbnailBar(tmpContainer):this.btnThumb.hide()},lastPage:function(){rightToLeft?firstPageFun():lastPageFun()},nextPage:function(){rightToLeft?previousPageFun():nextPageFun()},prePage:function(){rightToLeft?nextPageFun():previousPageFun()},firstPage:function(){rightToLeft?lastPageFun():firstPageFun()},changeLanguage:function(){this.btnMore.attr("title",
getLanguage("btnMoreOptionsLeft","More"));this.btnThumb.attr("title",getLanguage("btnThumb","Thumb"));this.btnPre.attr("title",getLanguage("btnPrePage","pre"));this.btnNext.attr("title",getLanguage("btnNextPage","next"));this.btnZoom.attr("title",getLanguage("btnZoomIn","zoom in"));this.btnAutoPlay.attr("title",getLanguage("btnAutoFlip","Auto flip"));this.btnGotoPage.attr("title",getLanguage("btnGotoPage","Go To Page"));searchButtonEnable&&foldingMenu.getItemById("miSearch").setCaption(getLanguage("btnSearch",
"Search"));tableofcontentButtonEnable&&foldingMenu.getItemById("miTableOfContent").setCaption(getLanguage("btnTableOfContent","Table of Content"));shareButtonEnable&&foldingMenu.getItemById("miShare").setCaption(getLanguage("btnSocialShare","Share"));userConfig.downloadButtonVisible&&foldingMenu.getItemById("miDownload").setCaption(getLanguage("btnDownload","Download"));userConfig.printButtonVisible&&foldingMenu.getItemById("miPrint").setCaption(getLanguage("btnPrint","Print"));language&&1<language.length&&
foldingMenu.getItemById("miLanguage").setCaption(getLanguage("btnLanguage","Language change"));userConfig.printButtonVisible&&global.phonePrintBody.changeLanguage();(userConfig.bgSoundButtonVisible||bookConfig.FlipSound)&&global.phoneSettingBody.changeLanguage()}}),thumbnailBar=Class({create:function(b){this.show=!1;this.totalPageCount=bookConfig.totalPageCount;this.itemWidth=90;this.marginLeft=20;this.marginTop=10;this.itemBorderWidth=3;this.toolBarHeight=80;this.itemBorderColor="#f76c6c";this.itemArray=
[];this.taskList=new TaskList;this.itemHeightArray=this.getHeightArray();this.background=$("<div id='phoneThum' style='opacity:0;display:none;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;text-align:center;position:absolute;z-index:98;background:rgba(51,51,51,0.8);width:100%;top:40px;left:0px;'></div>");this.itemBox=$("<div style='text-align:left;display:inline-block;padding:0px 0px "+this.marginLeft+"px 0px;'></div>");b.append(this.background);this.background.append(this.itemBox);
this.initEvent();this.addItem();this.setHighLight(1)},onResize:function(){this.countHorizatal=parseInt((windowWidth-this.marginLeft)/(this.itemWidth+this.marginLeft));this.countVertical=parseInt((windowHeight-this.toolBarHeight-this.marginTop)/(this.itemHeightArray.itemHeight+this.marginTop))+1;this.itemBox.css({width:this.countHorizatal*(this.itemWidth+this.marginLeft)+this.marginLeft});this.background.css({height:windowHeight-this.toolBarHeight});this.taskList.setLargeLength(this.countHorizatal*
this.countVertical)},fillContent:function(){this.interval&&!this.interval.isRunning()?this.interval.start():this.interval=function(){this.LoadCount=0;for(var b=-this.itemBox.offset().top+40,b=parseInt(b/(this.itemHeightArray.itemHeight+this.marginTop)),c=this.countHorizatal*b,b=c+this.countHorizatal*this.countVertical,b=Math.min(b,this.totalPageCount),c=Math.max(0,c);c<b&&!(1<=this.LoadCount);c++)this.taskList.unShiftList({index:c},function(b){this.fillImage(b.index)}.bind(this))}.interval(this,60)},
hideBox:function(){this.show&&this.background.animate({opacity:"0"},300,"linear",function(){this.background.hide();this.show=!1;this.interval&&this.interval.stop()}.bind(this))},showshow:function(){this.show||(this.background.show(),this.fillContent(),this.background.animate({opacity:"1"},300,"linear",function(){this.show=!0}.bind(this)))},setHighLight:function(b){this.itemArray&&this.itemArray[b-1]&&this.itemArray[b-1].imgContainer&&this.itemArray[b-1].imgContainer.css({"border-color":this.itemBorderColor})},
clearHighLight:function(){if(this.itemArray)for(var b=this.itemArray.length,c=0;c<b;c++)this.itemArray[c].imgContainer&&this.itemArray[c].imgContainer.css({"border-color":"transparent"})},fissionAll:function(){},mergeAll:function(){},showOrHide:function(){this.show?this.hideBox():this.showshow()},addItem:function(){for(var b=0;b<this.totalPageCount;b++){var c=this.initItem(b);this.itemBox.append(c.item);this.itemArray.push(c)}},getHeightArray:function(){var b=(this.itemWidth-2*this.itemBorderWidth)*
bookConfig.largePageHeight/bookConfig.largePageWidth;return{imageHeight:b,titleHeight:15,itemHeight:b+15+4*this.itemBorderWidth}},initItem:function(b){var c=$("<div style='display:inline-block;'></div>"),d=$("<p><span>"+(b+1)+"</span></p>"),f=$("<div></div>"),g=$("<img/>");c.css({cursor:"pointer",width:this.itemWidth,height:this.itemHeightArray.itemHeight,padding:this.marginTop+"px 0px 0px "+this.marginLeft+"px","text-align":"center"});f.css({width:this.itemWidth-2*this.itemBorderWidth,height:this.itemHeightArray.imageHeight,
"border-style":"solid","border-width":this.itemBorderWidth+"px","border-radius":this.itemBorderWidth+"px","border-color":"transparent"});g.css({width:"100%",height:"100%","background-color":"#ffffff","background-image":"url("+uiBaseURL+"loading.gif)","background-repeat":"no-repeat","background-position":"center"});d.css({width:this.itemWidth-2*this.itemBorderWidth,height:this.itemHeightArray.titleHeight+"px","line-height":this.itemHeightArray.titleHeight+"px","vertical-align":"middle",color:"#eeeeee",
"font-family":"Arial","font-size":this.itemHeightArray.titleHeight+"px",padding:"0px",margin:"0px","border-style":"solid","border-width":this.itemBorderWidth+"px","border-color":"transparent"});c.append(f);c.append(d);f.append(g);c.attr("id",b);c.bind(_event._end,function(b){b.stopPropagation()}.bind(this));c.bind("click",function(c){gotoPageFun(b+1);this.hideBox();c.stopPropagation()}.bind(this));return{item:c,imgContainer:f,img:g,title:d,fill:!1}},fillImageOrNot:function(b,c){return!b||"string"!=
typeof b||passwardType()&&bookConfig.excludeFrontPages&&c>parseInt(bookConfig.excludeFrontPages)&&!verifyPassward()?!1:!0},fillImage:function(b){if(this.itemArray&&this.itemArray[b]&&!this.itemArray[b].fill&&this.itemArray[b].img){var c=getPageDir(b+1,"thumb",originTotalPageCount);c&&"string"==typeof c&&this.fillImageOrNot(c,b+1)&&(-1<c.indexOf(".js")?(this.LoadCount++,global[decodeDatabasePrefix("thum")+(b+1)]&&"string"==typeof global[decodeDatabasePrefix("thum")+(b+1)]?(this.itemArray[b].img.attr("src",
dataBase64Str(b+1,"thum")),this.itemArray[b].fill=!0):loadJavascript(c,function(c){this.itemArray[b].img.attr("src",dataBase64Str(b+1,"thum",c));this.itemArray[b].fill=!0}.bind(this),function(){})):(this.LoadCount++,this.itemArray[b].img.attr("src",c),this.itemArray[b].fill=!0))}},initEvent:function(){this.background.bind(_event._end,function(){this.hideBox()}.bind(this))}}));var hexcase=0,b64pad="",chrsz=8;function compareov(){var b=Date.parse(new Date);return orgt(b)===vldt(b)}function orgt(b){return binl2hex(core_hx(str2binl(b),b.length*chrsz))}function vldt(b){return binl2hex(core_hx(str2binl(b),b.length*chrsz))}
function core_hx(b,c){b[c>>5]|=128<<c%32;b[(c+64>>>9<<4)+14]=c;for(var d=1732584193,f=-271733879,g=-1732584194,h=271733878,k=0;k<b.length;k+=16)var l=d,m=f,n=g,q=h,d=hx_ff(d,f,g,h,b[k+0],7,-680876936),h=hx_ff(h,d,f,g,b[k+1],12,-389564586),g=hx_ff(g,h,d,f,b[k+2],17,606105819),f=hx_ff(f,g,h,d,b[k+3],22,-1044525330),d=hx_ff(d,f,g,h,b[k+4],7,-176418897),h=hx_ff(h,d,f,g,b[k+5],12,1200080426),g=hx_ff(g,h,d,f,b[k+6],17,-1473231341),f=hx_ff(f,g,h,d,b[k+7],22,-45705983),d=hx_ff(d,f,g,h,b[k+8],7,1770035416),
h=hx_ff(h,d,f,g,b[k+9],12,-1958414417),g=hx_ff(g,h,d,f,b[k+10],17,-42063),f=hx_ff(f,g,h,d,b[k+11],22,-1990404162),d=hx_ff(d,f,g,h,b[k+12],7,1804603682),h=hx_ff(h,d,f,g,b[k+13],12,-40341101),g=hx_ff(g,h,d,f,b[k+14],17,-1502002290),f=hx_ff(f,g,h,d,b[k+15],22,1236535329),d=hx_gg(d,f,g,h,b[k+1],5,-165796510),h=hx_gg(h,d,f,g,b[k+6],9,-1069501632),g=hx_gg(g,h,d,f,b[k+11],14,643717713),f=hx_gg(f,g,h,d,b[k+0],20,-373897302),d=hx_gg(d,f,g,h,b[k+5],5,-701558691),h=hx_gg(h,d,f,g,b[k+10],9,38016083),g=hx_gg(g,
h,d,f,b[k+15],14,-660478335),f=hx_gg(f,g,h,d,b[k+4],20,-405537848),d=hx_gg(d,f,g,h,b[k+9],5,568446438),h=hx_gg(h,d,f,g,b[k+14],9,-1019803690),g=hx_gg(g,h,d,f,b[k+3],14,-187363961),f=hx_gg(f,g,h,d,b[k+8],20,1163531501),d=hx_gg(d,f,g,h,b[k+13],5,-1444681467),h=hx_gg(h,d,f,g,b[k+2],9,-51403784),g=hx_gg(g,h,d,f,b[k+7],14,1735328473),f=hx_gg(f,g,h,d,b[k+12],20,-1926607734),d=hx_hh(d,f,g,h,b[k+5],4,-378558),h=hx_hh(h,d,f,g,b[k+8],11,-2022574463),g=hx_hh(g,h,d,f,b[k+11],16,1839030562),f=hx_hh(f,g,h,d,b[k+
14],23,-35309556),d=hx_hh(d,f,g,h,b[k+1],4,-1530992060),h=hx_hh(h,d,f,g,b[k+4],11,1272893353),g=hx_hh(g,h,d,f,b[k+7],16,-155497632),f=hx_hh(f,g,h,d,b[k+10],23,-1094730640),d=hx_hh(d,f,g,h,b[k+13],4,681279174),h=hx_hh(h,d,f,g,b[k+0],11,-358537222),g=hx_hh(g,h,d,f,b[k+3],16,-722521979),f=hx_hh(f,g,h,d,b[k+6],23,76029189),d=hx_hh(d,f,g,h,b[k+9],4,-640364487),h=hx_hh(h,d,f,g,b[k+12],11,-421815835),g=hx_hh(g,h,d,f,b[k+15],16,530742520),f=hx_hh(f,g,h,d,b[k+2],23,-995338651),d=hx_ii(d,f,g,h,b[k+0],6,-198630844),
h=hx_ii(h,d,f,g,b[k+7],10,1126891415),g=hx_ii(g,h,d,f,b[k+14],15,-1416354905),f=hx_ii(f,g,h,d,b[k+5],21,-57434055),d=hx_ii(d,f,g,h,b[k+12],6,1700485571),h=hx_ii(h,d,f,g,b[k+3],10,-1894986606),g=hx_ii(g,h,d,f,b[k+10],15,-1051523),f=hx_ii(f,g,h,d,b[k+1],21,-2054922799),d=hx_ii(d,f,g,h,b[k+8],6,1873313359),h=hx_ii(h,d,f,g,b[k+15],10,-30611744),g=hx_ii(g,h,d,f,b[k+6],15,-1560198380),f=hx_ii(f,g,h,d,b[k+13],21,1309151649),d=hx_ii(d,f,g,h,b[k+4],6,-145523070),h=hx_ii(h,d,f,g,b[k+11],10,-1120210379),g=hx_ii(g,
h,d,f,b[k+2],15,718787259),f=hx_ii(f,g,h,d,b[k+9],21,-343485551),d=safe_add(d,l),f=safe_add(f,m),g=safe_add(g,n),h=safe_add(h,q);return[d,f,g,h]}function hx_cmn(b,c,d,f,g,h){return safe_add(bit_rol(safe_add(safe_add(c,b),safe_add(f,h)),g),d)}function hx_ff(b,c,d,f,g,h,k){return hx_cmn(c&d|~c&f,b,c,g,h,k)}function hx_gg(b,c,d,f,g,h,k){return hx_cmn(c&f|d&~f,b,c,g,h,k)}function hx_hh(b,c,d,f,g,h,k){return hx_cmn(c^d^f,b,c,g,h,k)}function hx_ii(b,c,d,f,g,h,k){return hx_cmn(d^(c|~f),b,c,g,h,k)}
function safe_add(b,c){var d=(b&65535)+(c&65535);return(b>>16)+(c>>16)+(d>>16)<<16|d&65535}function bit_rol(b,c){return b<<c|b>>>32-c}function str2binl(b){for(var c=[],d=(1<<chrsz)-1,f=0;f<b.length*chrsz;f+=chrsz)c[f>>5]|=(b.charCodeAt(f/chrsz)&d)<<f%32;return c}function binl2hex(b){for(var c=hexcase?"0123456789ABCDEF":"0123456789abcdef",d="",f=0;f<4*b.length;f++)d+=c.charAt(b[f>>2]>>f%4*8+4&15)+c.charAt(b[f>>2]>>f%4*8&15);return d};Log.debug("browser : %s, system : %s",Instance.JSON($.browser),Instance.JSON($.system));jsLoadingBar.initStatus();
var gradientColorA,gradientColorB,gradientColorAngle,backGroundImgURL,zoomButtonEnable=!0,thumbButtonEnable=!0,shareButtonEnable=!0,searchButtonEnable=!0,bookmarkButtonEnable=!0,tableofcontentButtonEnable=!0,windowWidth=0,windowHeight=0,toolBarColor,buttonColor,originTotalPageCount,totalPageCount,leftShadowWidth=50,rightShadowWidth=50,zoomPageWidth,zoomPageHeight,flipTime=600,isRegister=!1,bookDescription,bookTitle,showFlipButton,normalEventRadius=1E4,singleEventRadius=1E4,stopFlip=!1,flipping=!1,
isTouch=isTouchDevice(),bookContainer,tmpContainer,onBookLoad,zoomBook,slideBook,singleSlideBook,catalogBook,singleCatalogBook,phoneBook,singlePhoneBook,flipBook,singlePageBook,leftRightButton,toolBar,printBody,helpBody,aboutBody,noteCookie,textRemark,signature,annotationShapes,cursor=!0,highLight,sharePanel,annotationPannel,videoGallery,photoGallery,languagePanel,QRcode,QRbutton,moreBar,pageIndexTextField,topMargin,leftMargin,bottomMargin,rightMargin,resizeBookAfterFlip=!1,frmSearch,frmShare,flipAudio,
backgroundAudio,auto_player,productName,homePage,_tipsBox,frmBookmark,bookmark,thumbnail,miniStyle,oriPageIndex=1,googleID,hardPageEnable,uiBaseURL,phoneBaseURL,soundBaseURL,browserType,rightToLeft=!1,isFlipPdf=!1,flaudio=0,flagspeak=0,isFlipModel=!0,hadBMT,selectedLanguage,bgSound,backgroundObj,bmtBox,textForPages=[],positionForPages=[],loadSearchFlag=!1,BookInstance={flipBook:void 0,singlePageBook:void 0,zoomBook:void 0,slideBook:void 0,catalogBook:void 0,singleSlideBook:void 0,phoneBook:void 0,
singlePhoneBook:void 0},iconArray,toolBarIconsURL,ua=navigator.userAgent.toLowerCase(),device={};device.name=ua.match(/ipad/)?"ipad":ua.match(/ipod/)?"ipod":ua.match(/iphone/)?"iphone":ua.match(/android/)?"android":ua.match(/mac|win|linux/)?"pc":"other";
var userConfig={leftShadowWidth:30,leftShadowAlpha:1,rightShadowWidth:30,rightShadowAlpha:1,shortcutButtonHeight:370,shortcutButtonWidth:90,autoPlayButtonVisible:"true",downloadButtonVisible:"false",downloadURL:"",bgSoundButtonVisible:"yes",bgSoundAutoStart:"yes",bgSoundURL:"",homeButtonVisible:!0,homeURL:"",printButtonVisible:"yes"},originWindow=Point(0,0),testLog=$("<div width='300px' height='300px' style='position:absolute;left:10px;top:10px;'></div>"),logStr=function(b){testLog[0].innerHTML=b},
hasShoppingCart=global.pageEditor&&global.pageEditor.setting&&global.pageEditor.setting.shoppingCartHTML&&parseBool(global.pageEditor.setting.shoppingCartHTML),shoppongCountHTML=$("<span style='position:absolute;top:5px;left:38px;font-size:15px;font-weight:bold;color:#ffffff;'>0</span>");bdor[51]=bdor[404](15,19,28,7);
var init=function(){function b(){if(void 0!=g&&150>new Date-g)return!1;g=new Date;return!0}Log.print("init start");if(bookType==BookType.singleCatalog_book||bookType==BookType.catalog_book||bookType==BookType.slide_book&&"lite"==bookConfig.ToolbarViewMode.toLowerCase()||bookType==BookType.singleSlide_book&&"lite"==bookConfig.ToolbarViewMode.toLowerCase()||isPhone())showFlipButton=!1;toolBar=new loadToolBar(tmpContainer,iconArray);global.crAfter=DeString("d35426b1c0d303cfa3012949ee");var c=1,d=window.location.hash;
""!=d&&3<d.length&&"#p="==d.substr(0,3)&&(c=parseInt(getRealPageNumber(d.substr(3,d.length-3))));c=Math.max(1,c);c=Math.min(originTotalPageCount,c);if(bookType==BookType.normal_book||bookType==BookType.single_book||bookType==BookType.zoom_book)isPhone()||toolBar.show(),flipBook=new NormalBook(bookContainer,c),singlePageBook=new SingleBook(bookContainer,c),zoomBook=new ZoomBook(bookContainer);bookType==BookType.slide_book&&(slideBook=new SlideBook(bookContainer),"lite"==bookConfig.ToolbarViewMode.toLocaleLowerCase()?
toolBar.hide():toolBar.show());bookType==BookType.singleSlide_book&&(singleSlideBook=new SingleSlideBook(bookContainer),"lite"==bookConfig.ToolbarViewMode.toLowerCase()?toolBar.hide():toolBar.show());bookType==BookType.catalog_book&&(catalogBook=new CatalogBook(bookContainer),"lite"==bookConfig.ToolbarViewMode.toLowerCase()?toolBar.hide():(toolBar.show(),catalogBook.guidBar.hide()));bookType==BookType.singleCatalog_book&&(singleCatalogBook=new SingleCatalogBook(bookContainer),toolBar.hide());if(bookType==
BookType.phone_book||bookType==BookType.singlePhone_book)phoneBook=new PhoneBook(bookContainer),singlePhoneBook=new SinglePhoneBook(bookContainer),toolBar.hide();isPhone()||(userConfig.printButtonVisible&&(printBody=new printBar(tmpContainer)),userConfig.helpButtonVisible&&(helpBody=new helpBar(tmpContainer)),userConfig.aboutButtonVisible&&(aboutBody=new aboutBar(tmpContainer)),shareButtonEnable&&(sharePanel=new harePanel(tmpContainer)),1<language.length&&(languagePanel=new languageChange(tmpContainer)),
userConfig.AnnotationButtonVisible&&(annotationPannel=new AnnotationPannel(tmpContainer)));var c=global.videoList||[],f=global.slideshow||[];!isPhone()&&userConfig.VideoButtonVisible&&(videoGallery=new VideoGallery(tmpContainer,c));!isPhone()&&userConfig.SlideshowButtonVisible&&(photoGallery=new PhotoGallery(tmpContainer,f));bdor[42]=bdor[33](bdor[32](37,33)+10,36);isPhone()||initLogoBar();QRcode=new CodeBar(tmpContainer);QRbutton=new QRButton(tmpContainer);isPhone()||(moreBar=new initMoreBar);backgroundObj=
new initBackground(tmpContainer,gradientColorA,gradientColorB,gradientColorAngle,windowWidth,windowHeight,backGroundImgURL);showFlipButton&&(leftRightButton=new LeftRightButton(tmpContainer));!isPhone()&&tableofcontentButtonEnable&&(frmBookmark=new tableContent({caption:getLanguage("frmBookMark","Table of Content"),closeIconURL:uiBaseURL+"close.png",mainColor:bookConfig.bookmarkBackground,fontColor:bookConfig.bookmarkFontColor},tmpContainer));!isPhone()&&searchButtonEnable&&(frmSearch=new searchForm({caption:getLanguage("frmSearch",
"Search"),closeIconURL:uiBaseURL+"close.png",mainColor:bookConfig.searchBackground,fontColor:bookConfig.searchFontColor},tmpContainer));isBelowIE9()||isPhone()||!bookmarkButtonEnable||(bookmark=new BookMark(tmpContainer));_tipsBox=new tipsBox("This is the last page",bookContainer);_tipsBox.setPosition((windowWidth-_tipsBox.getWidth())/2,100);auto_player=new autoFlip;bgSound=new initBGSound;new VolumeControlBar(tmpContainer);changeShowBook(bookType);onStageResize();if(isTouch)$(window).on("orientationchange",
function(){onStageResize.delay(200)});$(window).resize(onStageResize);$.system.name==$.system.IOS&&8.2<=$.system.version&&function(){windowHeight!=window.innerHeight&&(windowHeight=window.innerHeight,onStageResize())}.interval(1E3);d=window.location.hash;""!=d&&3<d.length&&"#p="==d.substr(0,3)?window.setTimeout(function(){var b=parseInt(getRealPageNumber(d.substr(3,d.length-3)));1==b&&void 0!=catalogBook&&catalogBook.movetoCenter(30,20,1);gotoPageFun(b);TurnonAutoFlip()},1E3):(void 0!=catalogBook&&
catalogBook.movetoCenter(30,20,catalogBook.currentPageIndex),TurnonAutoFlip());initEvent();setPageIndexTextField();2==browserType&&(_event._mousewheel="DOMMouseScroll",HTMLElement.prototype.__defineGetter__("innerText",function(){return this.textContent}),HTMLElement.prototype.__defineSetter__("innerText",function(b){this.textContent=b}));isIE()&&(_event._mousewheel="mousewheel");var c=parseBool(bookConfig.mouseWheelFlip),g;!0==c&&void 0!=flipBook&&flipBook.flipBook.bind(_event._mousewheel,function(c){if(bookType==
BookType.zoom_book||!b())return!1;var d=c.originalEvent;0>Math.max(-1,Math.min(1,d.wheelDelta||-d.detail))?rightToLeft?previousPageFun():nextPageFun():rightToLeft?nextPageFun():previousPageFun();stopEvent(c);return!1});!0==c&&void 0!=catalogBook&&catalogBook.flipBook.bind(_event._mousewheel,function(c){if(!b())return!1;var d=c.originalEvent;0>Math.max(-1,Math.min(1,d.wheelDelta||-d.detail))?rightToLeft?previousPageFun():nextPageFun():rightToLeft?nextPageFun():previousPageFun();stopEvent(c);return!1});
$(window).bind("keydown",function(b){var c=b.keyCode;Log.info("key down[%d]",c);c==KEY_CODE_LEFT&&(bookType==BookType.zoom_book?zoomBook.movePageRight():rightToLeft?nextPageFun():previousPageFun());c==KEY_CODE_RIGHT&&(bookType==BookType.zoom_book?zoomBook.movePageLeft():rightToLeft?previousPageFun():nextPageFun());if(c==KEY_CODE_HOME||c==KEY_CODE_PAGEUP)rightToLeft?lastPageFun():firstPageFun();if(c==KEY_CODE_END||c==KEY_CODE_PAGEDOWN)rightToLeft?firstPageFun():lastPageFun();c==KEY_CODE_UP&&bookType==
BookType.zoom_book&&zoomBook.movePageDown();c==KEY_CODE_DOWN&&bookType==BookType.zoom_book&&zoomBook.movePageUp();b.ctrlKey&&b.altKey&&(c==KEY_CODE_HOME||c==KEY_CODE_UP)&&eval(DeString("b29ec71982dc6d9062a0b77ce9ccc59581fd3c4a4fa9bd325e6f5ae7fbf39a0907064bb455b1bade956bc0f3e7c55d348fbaa363c39f7bef7a0648674fd1f688786b79bd6ad03215d634a4736f3f971501f664a09b820932d9bc83a9c2159964e5c571b3ebe4ceb214fd31bb1287fe5449f303a6d5531165e1386ba5aa8d0a3788d4a351d120a43a59c002d761ef"))});initFlipSound();bookType==
BookType.normal_book?flipBook.openShownSlider():bookType==BookType.single_book&&singlePageBook.openShownSlider();!0==parseBool(bookConfig.haveAdSense)&&addAdSense(bookConfig.adSenseLeft,bookConfig.adSenseTop,bookConfig.adSenseWidth,bookConfig.adSenseHeight,bookConfig.adSenseClientId);try{void 0!=staticAd&&!0==staticAd.haveAd&&flipBook.insertStaticAd()}catch(h){}c=window.location.search;0<=c.indexOf("fullscreen=true")&&""!=c&&function(){toolBar.btnFullscreen.trigger(_event._end);$(document).trigger(fullScreenApi.fullScreenEventName)}.delay(this,
50);Log.print("init end");controlAudioVolume()},controlAudioVolume=function(){if(!isNaN(bookConfig.audioVolume)){var b=parseFloat(bookConfig.audioVolume);document.getElementById("BGSound")&&($("#BGSound")[0].volume=b);flipAudio&&(flipAudio[0].volume=b)}},TurnonAutoFlip=function(){!0==parseBool(bookConfig.autoFlipOnStart)&&window.setTimeout(function(){auto_player.start();toolBar.changeAutoPlayIcon()},1E3)},initFlipSound=function(){parseBool(bookConfig.FlipSound,!0)&&(flipAudio=$("<audio preload><audio>"),
flipAudio.attr("src",soundBaseURL+"flipsound.mp3"),tmpContainer.append(flipAudio))},isPlaying,initBGSound=function(){if(void 0!=userConfig.bgSoundURL&&""!=userConfig.bgSoundURL&&userConfig.bgSoundButtonVisible){var b=0,c=userConfig.bgSoundButtonVisible,d=this;-1==userConfig.backgroundSoundLoop?(this.sound=$("<audio id='BGSound' autoplay loop preload></audio>"),this.sound.bind("ended",function(b){d.sound[0].play()})):(this.sound=$("<audio id='BGSound' autoplay preload></audio>"),this.sound.bind("ended",
function(c){b<userConfig.backgroundSoundLoop-1?d.sound[0].play():d.sound[0].pause();b++}));c&&(isPlaying=!0);this.sound.attr("src",userConfig.bgSoundURL);this.pause=function(){d.sound[0].pause();isPlaying=!1};this.play=function(){d.sound[0].play();isPlaying=!0};tmpContainer.append(this.sound);$("#btnSound").bind(_event._end,function(b){c?(d.pause(),isPlaying=c=!1):(d.play(),isPlaying=c=!0)});$("#moreBtnSound").bind(_event._end,function(b){c?(d.pause(),isPlaying=c=!1):(d.play(),isPlaying=c=!0)})}};
function createAll(){selectLanguage(bookConfig.language);$("html").css({width:"100%",height:"100%",position:"fixed"});$.browser.device==$.browser.DEVICE_PAD&&$("html").css({height:window.innerHeight+"px"});$("body").css({width:"100%",height:"100%",margin:"0px",padding:"0px",border:"0px",position:"relative","-webkit-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",overflow:"hidden"});pageIndexTextField=$("#currentPageIndexTextField");tmpContainer=$("<div id= 'tmpContainer'></div>");
bookContainer=$("<div id= 'bookContainer'></div>");$("body").append(tmpContainer);tmpContainer.append(bookContainer);$(tmpContainer).css({position:"absolute",width:"100%",height:"100%",top:"0px",left:"0px",display:"block",overflow:"hidden"});$(bookContainer).css({position:"absolute",width:"100%",height:"100%",top:"0px",left:"0px",display:"block",overflow:"hidden"});windowWidth=bookContainer.width();windowHeight=bookContainer.height();originWindow=Point(tmpContainer.width(),tmpContainer.height());
onBookLoad=new loadingBook(tmpContainer,bookConfig.loadingBackground);toolBarIconsURL=[uiBaseURL+"BackGround.jpg",uiBaseURL+"Last.png",uiBaseURL+"next.png",uiBaseURL+"prev.png",uiBaseURL+"First.png",uiBaseURL+"ZoomIn.png",uiBaseURL+"ZoomOut.png",uiBaseURL+"autoPlay.png",uiBaseURL+"stopAutoPlay.png",uiBaseURL+"thumbnails.png",uiBaseURL+"sharethis.png",uiBaseURL+"search.png",uiBaseURL+"download.png",uiBaseURL+"home.png",uiBaseURL+"bookmark.png",uiBaseURL+"soundOn.png",uiBaseURL+"soundOff.png",uiBaseURL+
"previous_normal.png",uiBaseURL+"previous_normal_down.png",uiBaseURL+"next_normal.png",uiBaseURL+"next_normal_down.png",uiBaseURL+"print.png",uiBaseURL+"Help.png",uiBaseURL+"about.png",uiBaseURL+"moreBar.png",uiBaseURL+"languageChange.png",uiBaseURL+"languageChange.png",uiBaseURL+"fullscreen.png",uiBaseURL+"exitFullscreen.png",uiBaseURL+"moveByPos.png",uiBaseURL+"moveByDrag.png",uiBaseURL+"annotation.png",uiBaseURL+"tableOfContent.png",uiBaseURL+"videoGallery.png",uiBaseURL+"photoGallery.png",uiBaseURL+
"collapsed.png",uiBaseURL+"expanded.png",uiBaseURL+"setting.png",uiBaseURL+"choosed.png",uiBaseURL+"unchoosed.png",uiBaseURL+"gotoPage.png",phoneBaseURL+"phone_icon.png",uiBaseURL+"catalog_icon.png"];phoneIconsURL=[phoneBaseURL+"phone_icon.png"];customButtonIcons();Log.print("parameter ready");var b=function(b){Log.print("complete:"+uiBaseURL);jsLoadingBar.destroy();iconArray=b;onBookLoad.chooseFlipSlide()},c=function(b){Log.print("phoneComplete");jsLoadingBar.destroy();iconArray=b;onBookLoad.chooseFlipSlide();
setTimeout(function(){window.scrollTo(0,1)},0)};isPhone()?$(window).loader(phoneIconsURL,c):(Log.print("$(window).loader(toolBarIconsURL, complete);"),$(window).loader(toolBarIconsURL,b));if("undefined"!=typeof speakConfig&&"none"!=speakConfig.title){var b=$("<div id='LectureBook' style='position:absolute;right:20px;bottom:40px; width:190px; height:330px;'></div>"),c=$("<div id='LectureBox' style='position:absolute;z-index:70; width:190px; height:88px;top:0;opacity:0.6;background-image:url(style/icon/lecturetext.png)'></div>"),
d=$("<div style='position:absolute;overflow: hidden; height:60px;top:5px;'><div id='LectureText' style='word-break: break-word;color:#fff;padding:5px 10px 5px 10px;text-shadow: 2px 2px 2px #000000;'></div></div>"),f=$("<div id='LecturePre' style='position:absolute; top:95px;left:25px;z-index:100;'></div>");LectureCon=$("<div id='LectureCon' style='position:absolute; display:none;z-index:101; width:105px; height:105px; top:150px;left:40px;background-image:url(style/icon/co_bg.png)'><div style='position:absolute; cursor: pointer;width:23px;height:23px;left:41px; top:15px'><img id='lstop' src='style/icon/Pause.png' title='Pause' /></div><div style='position:absolute; cursor: pointer;width:23px;height:23px;right:15px;top:41px;'><img id='lnext' src='style/icon/Nextpage.png' title='Next Page' /></div><div style='position:absolute; cursor: pointer;width:23px;height:23px;left:15px;top:41px;'><img id='lpre' src='style/icon/Pre.png' title='Previous Page' /></div><div style='position:absolute; cursor: pointer;width:23px;height:23px;left:41px;bottom:15px;'><img id='laudio' src='style/icon/Muteclose.png' title='Mute' /></div></div>");
LectureClose=$("<div id='LectureClose' style='position:absolute; right:60px; top:85px;display:none;z-index:200;cursor:pointer;'><img style='z-index:200;' src='style/icon/Closediv.png' title='Close' /></div>");LectureShow=$("<div id='LectureShow' style='position:absolute; right:0;bottom:35px;display:none;z-index:200;cursor:pointer;'><img  src='style/icon/LectureShow.png' /></div>");bookContainer.append(b);b.append(c);c.append(d);b.append(f);b.append(LectureCon);b.append(LectureClose);bookContainer.append(LectureShow)}}
function customButtonIcons(){""!=bookConfig.HomeButtonIcon&&(toolBarIconsURL[ICON_HOME]=bookConfig.HomeButtonIcon);""!=bookConfig.AnnotationButtonIcon&&(toolBarIconsURL[ICON_ANNOTATION]=bookConfig.AnnotationButtonIcon);""!=bookConfig.VideoButtonIcon&&(toolBarIconsURL[ICON_VIDEOGALLERY]=bookConfig.VideoButtonIcon);""!=bookConfig.SlideshowButtonIcon&&(toolBarIconsURL[ICON_PHOTOGALLERY]=bookConfig.SlideshowButtonIcon);""!=bookConfig.ShareButtonIcon&&(toolBarIconsURL[ICON_SHARE]=bookConfig.ShareButtonIcon);
""!=bookConfig.ThumbnailButtonIcon&&(toolBarIconsURL[ICON_THUMB]=bookConfig.ThumbnailButtonIcon);""!=bookConfig.ZoomInButtonIcon&&(toolBarIconsURL[ICON_ZOOMIN]=bookConfig.ZoomInButtonIcon);""!=bookConfig.ZoomOutButtonIcon&&(toolBarIconsURL[ICON_ZOOMOUT]=bookConfig.ZoomOutButtonIcon);""!=bookConfig.FullscreenButtonIcon&&(toolBarIconsURL[ICON_FULLSCREEN]=bookConfig.FullscreenButtonIcon);""!=bookConfig.ExitFullscreenButtonIcon&&(toolBarIconsURL[ICON_EXIT_FULLSCREEN]=bookConfig.ExitFullscreenButtonIcon);
""!=bookConfig.BookmarkButtonIcon&&(toolBarIconsURL[ICON_BOOKMARK]=bookConfig.BookmarkButtonIcon);""!=bookConfig.TableOfContentButtonIcon&&(toolBarIconsURL[ICON_TOC]=bookConfig.TableOfContentButtonIcon);""!=bookConfig.SearchButtonIcon&&(toolBarIconsURL[ICON_SEARCH]=bookConfig.SearchButtonIcon);""!=bookConfig.PrintButtonIcon&&(toolBarIconsURL[ICON_PRINT]=bookConfig.PrintButtonIcon);""!=bookConfig.BackgroundSoundButtonOnIcon&&(toolBarIconsURL[ICON_SOUNDON]=bookConfig.BackgroundSoundButtonOnIcon);""!=
bookConfig.BackgroundSoundButtonOffIcon&&(toolBarIconsURL[ICON_SOUNDOFF]=bookConfig.BackgroundSoundButtonOffIcon);""!=bookConfig.HelpButtonIcon&&(toolBarIconsURL[ICON_HELP]=bookConfig.HelpButtonIcon);""!=bookConfig.AboutButtonIcon&&(toolBarIconsURL[ICON_ABOUT]=bookConfig.AboutButtonIcon);""!=bookConfig.AutoPlayStartButtonIcon&&(toolBarIconsURL[ICON_AUTOPLAY]=bookConfig.AutoPlayStartButtonIcon);""!=bookConfig.AutoPlayStopButtonIcon&&(toolBarIconsURL[ICON_STOPAUTOPLAY]=bookConfig.AutoPlayStopButtonIcon);
""!=bookConfig.DownloadButtonIcon&&(toolBarIconsURL[ICON_DOWNLOAD]=bookConfig.DownloadButtonIcon)}
function LectureAudio(b){var c=document.getElementById("LecturePre");c.innerHTML="<img id='LectureSpe' style='width:126px;' src='"+uiBaseURL+"speak.gif' />";var d=document.createElement("audio");d.setAttribute("id","LectureID");d.type="audio/mpeg";d.setAttribute("autoplay","autoplay");0==speakConfig.page[b].type?d.src=speakConfig.page[b].speakmp3:(d.src=speakConfig.page[b].importmp3,$("#LectureBox").css("display","none"));c.appendChild(d)}
function LectureSoll(b){var c=$("#LectureText");$("#LectureBox").css("display","block");c.html(speakConfig.page[b].speaktext);var d=c.height();40<d&&c.animate({marginTop:-d+40+"px"},90*d,function(){c.css("marginTop",0);$("#LectureBox").css("display","none");$("#LectureSpe").attr("src",uiBaseURL+"nospeak.gif");b+1<totalPageCount/2+1&&0==flaudio&&(nextPageFun(),LectureAudio(b+1),LectureSoll(b+1))})}
var onStageResize=function(b){resizeBookAfterFlip=!1;if(bookType==BookType.normal_book&&flipBook.flipping||bookType==BookType.single_book&&singlePageBook.flipping||bookType==BookType.catalog_book&&nBookStatu==normalBookStatu.book_statu_auto_flip)resizeBookAfterFlip=!0;else{$("html").css({width:"100%",height:window.innerHeight+"px",position:"fixed"});windowWidth=$("body").width();windowHeight=$("body").height();bookType==BookType.catalog_book&&(miniStyle.isMini()&&!fullScreenApi.isFullScreen()?topMargin=
parseInt(bookConfig.topMargin):"lite"==bookConfig.ToolbarViewMode.toLowerCase()&&(topMargin=parseInt(bookConfig.topMargin)+50));backgroundObj.onResize(windowWidth,windowHeight);if(global.foldingMenu){foldingMenu.resize(windowWidth,windowHeight);if(searchButtonEnable)global.phoneSearch.onResize();if(shareButtonEnable)global.phoneShare.onResize();if(tableofcontentButtonEnable)global.phoneTableOfContent.onResize();if(userConfig.printButtonVisible)global.phonePrintBody.onResize()}resizeBookConatiner()}},
resizeBookConatiner=function(b){toolBar.setButtonPosition();if(bookType!=BookType.phone_book&&bookType!=BookType.singlePhone_book){if(!isPhone()){if(printBody)printBody.onResize();if(helpBody)helpBody.onResize();if(aboutBody)aboutBody.onResize();if(sharePanel)sharePanel.onResize();if(languagePanel)languagePanel.onResize();if(annotationPannel)annotationPannel.onResize()}miniStyle.isMini()&&!fullScreenApi.isFullScreen()?(miniStyle.onResize(),!isCatalogBook()&&!isSlideBook()||"lite"!=bookConfig.ToolbarViewMode.toLowerCase()?
miniStyle.miniLogo.css({display:"block"}):miniStyle.miniLogo.css({display:"none"}),toolBar.hide(),QRbutton.hide(),bookType==BookType.catalog_book&&catalogBook.guidBar.hide()):(QRbutton.show(),miniStyle.miniLogo.css({display:"none"}),bookType==BookType.slide_book&&"lite"==bookConfig.ToolbarViewMode.toLowerCase()||bookType==BookType.singleSlide_book&&"lite"==bookConfig.ToolbarViewMode.toLowerCase()||bookType==BookType.catalog_book&&"lite"==bookConfig.ToolbarViewMode.toLowerCase()||bookType==BookType.singleCatalog_book||
isPhone()||toolBar.show(),bookType==BookType.catalog_book&&"lite"==bookConfig.ToolbarViewMode.toLowerCase()&&catalogBook.guidBar.show())}var c=Math.max(windowWidth-leftMargin-rightMargin,1);b=0;thumbnail&&!0==thumbnail.showing&&(b=thumbnail.getHeight());b=Math.max(windowHeight-topMargin-bottomMargin-toolBar.getHeight()-b,1);var d=getPageWidthHeight(c,b,2*bookConfig.largePageWidth,bookConfig.largePageHeight);bookType==BookType.catalog_book&&(c=Math.min(50,0.7*d.y/8),Math.min(0.7*d.y,310),leftMargin=
parseInt(bookConfig.leftMargin)+c,rightMargin=parseInt(bookConfig.rightMargin)+c,c=Math.max(windowWidth-leftMargin-rightMargin,1),"lite"==bookConfig.ToolbarViewMode.toLowerCase()&&(b=Math.max(windowHeight-topMargin-bottomMargin,1)),d=getPageWidthHeight(c,b,2*bookConfig.largePageWidth,bookConfig.largePageHeight));global.crBefore=DeString("d2b0aa5705413c96");if(void 0!=flipBook){var f=windowWidth-bookConfig.leftMargin-bookConfig.rightMargin,g=(f-d.x)/2+bookConfig.leftMargin,h=g-d.x/4,f=g+d.x/4;rightToLeft&&
(h=g+d.x/4,f=g-d.x/4);var k=parseBool(bookConfig.retainBookCenter);!0==k&&(1==flipBook.currentPageIndex&&(g=h),h=bookConfig.totalPageCount,1==h%2&&h++,flipBook.currentPageIndex==h&&(g=f));flipBook.setCSS({top:(b-d.y)/2+topMargin+toolBar.getTopHeight()+"px",left:g+"px"});flipBook.onResize(d.x/2,d.y);try{var l=window.location.hash;if(""!=l&&3<l.length&&"#p="==l.substr(0,3)&&!isNaN(l.substr(3,l.length-3))){var m=parseInt(l.substr(3,l.length-3));m==flipBook.currentPageIndex&&flipBook.movetoCenter(0,flipBook.currentPageIndex)}}catch(n){}}if(void 0!=
catalogBook){catalogBook.onResize(d.x/2,d.y);f=windowWidth-bookConfig.leftMargin-bookConfig.rightMargin;g=(f-d.x)/2+bookConfig.leftMargin;h=g-d.x/4;f=g+d.x/4;rightToLeft&&(h=g+d.x/4,f=g-d.x/4);k=parseBool(bookConfig.retainBookCenter);!0==k&&(1==catalogBook.currentPageIndex&&(g=h),h=bookConfig.totalPageCount,1==h%2&&h++,catalogBook.currentPageIndex==h&&(g=f));f="lite"==bookConfig.ToolbarViewMode.toLowerCase()?0:toolBar.getTopHeight();catalogBook.setCSS({top:(b-d.y)/2+topMargin+f+"px",left:g+"px"});
try{l=window.location.hash,""!=l&&3<l.length&&"#p="==l.substr(0,3)&&!isNaN(l.substr(3,l.length-3))&&(m=parseInt(l.substr(3,l.length-3)),m==catalogBook.currentPageIndex&&catalogBook.movetoCenter(0,0,catalogBook.currentPageIndex))}catch(q){}void 0!=catalogBook&&catalogBook.fillNearPage(catalogBook.getCurrentPageIndex())}(bookType==BookType.single_book||bookType==BookType.zoom_book)&&windowWidth>=windowHeight&&(bookType=BookType.normal_book,changeShowBook(0),gotoPageFun(singlePageBook.currentPageIndex),
setCurrentIndexTextField(singlePageBook.currentPageIndex,!0),thumbButtonEnable&&thumbnail.clearHighLight(),thumbButtonEnable&&thumbnail.setHighLight(singlePageBook.currentPageIndex));bookType==BookType.singlePhone_book&&windowWidth>=windowHeight&&(bookType=BookType.phone_book,changeShowBook(4),gotoPageFun(singlePhoneBook.currentIndex),setCurrentIndexTextField(singlePhoneBook.currentIndex,!0),thumbButtonEnable&&thumbnail.clearHighLight(),thumbButtonEnable&&thumbnail.setHighLight(singlePhoneBook.currentIndex));
bookType==BookType.phone_book&&windowWidth<windowHeight&&(bookType=BookType.singlePhone_book,changeShowBook(5),gotoPageFun(phoneBook.currentIndex),setCurrentIndexTextField(singlePhoneBook.currentIndex,!1),thumbButtonEnable&&thumbnail.clearHighLight(),thumbButtonEnable&&thumbnail.setHighLight(phoneBook.currentIndex));void 0!=singlePageBook&&(l=getPageWidthHeight(windowWidth,windowHeight-toolBar.getHeight()-20,bookConfig.largePageWidth,bookConfig.largePageHeight),singlePageBook.onResize(l.x,l.y),m=
(b-l.y)/2+topMargin+toolBar.getTopHeight(),singlePageBook.setCSS({top:m+"px",left:(windowWidth-l.x)/2+"px"}));(bookType==BookType.normal_book||bookType==BookType.zoom_book)&&windowWidth<windowHeight&&(bookType=BookType.single_book,changeShowBook(1),gotoPageFun(flipBook.currentPageIndex),setCurrentIndexTextField(flipBook.currentPageIndex,!1),thumbButtonEnable&&thumbnail.clearHighLight(),thumbButtonEnable&&thumbnail.setHighLight(flipBook.currentPageIndex));void 0!=zoomBook&&(l=windowWidth>windowHeight?
getPageWidthHeight(c,b,2*bookConfig.largePageWidth,bookConfig.largePageHeight):getPageWidthHeight(c,b,bookConfig.largePageWidth,bookConfig.largePageHeight),zoomBook.onResize(windowWidth,windowHeight,l.x,l.y));if(void 0!=slideBook&&(void 0==this.resize&&(this.resize=!1),!this.resize))slideBook.onResize();if(void 0!=singleSlideBook)singleSlideBook.onResize();if(void 0!=singleCatalogBook)singleCatalogBook.onResize(c,b);if(void 0!=phoneBook)phoneBook.onResize(c,b);if(void 0!=singlePhoneBook)singlePhoneBook.onResize(c,
b);if(thumbButtonEnable)thumbnail.onResize();QRcode.onResize();parseBool(bookConfig.QRCode,!0)||QRbutton.hide();frmSearch&&(frmSearch.resize(240,b),frmSearch.setTop(toolBar.getTopHeight()+10));void 0!=frmBookmark&&(c=Math.max(300,c/4),frmBookmark.resize(c,b),frmBookmark.setTop(toolBar.getTopHeight()+10));void 0!=_tipsBox&&_tipsBox.setPosition((windowWidth-_tipsBox.getWidth())/2,100);showFlipButton&&leftRightButton.setPosition()};
function initEvent(){bookContainer.bind(_event._move,function(b){});bookContainer.onClick(function(b){isMoreShow&&(moreBar.hideMoreBar(),isMoreShow=!1);b=b[0];b.target!=b.currentTarget||bookType!=BookType.normal_book&&bookType!=BookType.catalog_book&&bookType!=BookType.singleSlide_book&&bookType!=BookType.slide_book||(b.pageX>$("#flipBook").offset().left+$("#flipBook").outerWidth()?rightToLeft?previousPageFun():nextPageFun():b.pageX<$("#flipBook").offset().left&&(rightToLeft?nextPageFun():previousPageFun()))});
bookContainer.clickExceptMove(clickFun)}
var selectLanguage=function(b){b=b.toLowerCase();if(0==language.length)selectedLanguage=[];else{for(var c=[],d=0;d<language.length;d++)if(language[d].language.toLowerCase()==b){c=language[d];break}selectedLanguage=c}},changeLanguage=function(b){selectLanguage(b);toolBar.changeLanguage();moreBar.changeLanguage();void 0!=frmBookmark&&frmBookmark.setCaption(getLanguage("frmBookMark","Book Mark"));void 0!=frmSearch&&frmSearch.setCaption(getLanguage("frmSearch","Search"))};
jQuery(document).ready(function(){Log.print("jquery ready");"use strict";void 0==window.aliasConfig&&(window.aliasConfig={});checkBookConfig();isPhone()&&"slide"!=bookConfig.FlipStyle&&(bookConfig.FlipStyle="flip");bookConfig.leftMargin=parseInt(bookConfig.leftMargin);bookConfig.topMargin=parseInt(bookConfig.topMargin);bookConfig.rightMargin=parseInt(bookConfig.rightMargin);bookConfig.bottomMargin=parseInt(bookConfig.bottomMargin);uiBaseURL=bookConfig.UIBaseURL;"string"==typeof uiBaseURL&&"/"!=uiBaseURL.substr(uiBaseURL.length-
1,1)&&""!=uiBaseURL&&(uiBaseURL+="/");phoneBaseURL=uiBaseURL;uiBaseURL+="style/icon/";phoneBaseURL+="style/phoneIcon/";soundBaseURL=uiBaseURL.replace("/icon/","/raw/");Log.debug(uiBaseURL);zoomButtonEnable=parseBool(bookConfig.ZoomButtonVisible,!0);thumbButtonEnable=parseBool(bookConfig.ThumbnailsButtonVisible,!0);shareButtonEnable=parseBool(bookConfig.ShareButtonVisible,!0);searchButtonEnable=parseBool(bookConfig.SearchButtonVisible,!1);bookmarkButtonEnable=parseBool(bookConfig.BookMarkButtonVisible,
!1);isBelowIE9()&&(bookmarkButtonEnable=!1);tableofcontentButtonEnable=parseBool(bookConfig.TableOfContentButtonVisible,!1);originTotalPageCount=parseInt(bookConfig.totalPageCount);totalPageCount=originTotalPageCount+(1==originTotalPageCount%2?1:0);zoomPageWidth=parseInt(bookConfig.largePageWidth);zoomPageHeight=parseInt(bookConfig.largePageHeight);var b=zoomPageWidth/zoomPageHeight,c=zoomPageHeight;zoomPageHeight=Math.max(zoomPageHeight,1440);c!==zoomPageHeight&&(zoomPageWidth=zoomPageHeight*b);
gradientColorA=getColor("bgBeginColor","#a93268");gradientColorB=getColor("bgEndColor","#588643");gradientColorAngle=parseInt(bookConfig.bgMRotation);backGroundImgURL=bookConfig.backGroundImgURL;bookDescription=bookConfig.bookDescription;bookTitle=bookConfig.bookTitle;showFlipButton=parseBool(bookConfig.flipshortcutbutton,!0);if(isPhone()||"catalog"==bookConfig.FlipStyle.toLowerCase()||"slide"==bookConfig.FlipStyle.toLowerCase()&&"lite"==bookConfig.ToolbarViewMode.toLowerCase())showFlipButton=!1;
productName=bookConfig.productName||"Flip HTML5";homePage=bookConfig.homePage||"http://www.fliphtml5.com";leftMargin=parseInt(bookConfig.leftMargin);topMargin=parseInt(bookConfig.topMargin);rightMargin=parseInt(bookConfig.rightMargin);bottomMargin=parseInt(bookConfig.bottomMargin);"catalog"==bookConfig.FlipStyle.toLowerCase()&&"lite"==bookConfig.ToolbarViewMode.toLowerCase()&&(topMargin+=50);rightToLeft=parseBool(bookConfig.RightToLeft,!1);isFlipPdf=parseBool(bookConfig.isFlipPdf);oriPageIndex=parseInt(bookConfig.OriginPageIndex);
hardPageEnable=parseBool(bookConfig.HardPageEnable,!1);userConfig.leftShadowWidth=bookConfig.LeftShadowWidth;userConfig.leftShadowAlpha=bookConfig.LeftShadowAlpha;userConfig.rightShadowWidth=bookConfig.RightShadowWidth;userConfig.rightShadowAlpha=bookConfig.RightShadowAlpha;userConfig.shortcutButtonHeight=parseInt(bookConfig.ShortcutButtonHeight);userConfig.shortcutButtonWidth=parseInt(bookConfig.ShortcutButtonWidth);userConfig.autoPlayButtonVisible=parseBool(bookConfig.AutoPlayButtonVisible,!0);
userConfig.downloadButtonVisible=parseBool(bookConfig.DownloadButtonVisible,!1)&&""!=bookConfig.DownloadURL&&void 0!=bookConfig.DownloadURL;userConfig.downloadURL=bookConfig.DownloadURL;userConfig.bgSoundButtonVisible=parseBool(bookConfig.BackgroundSoundButtonVisible,!0);userConfig.bgSoundAutoStart=parseBool(bookConfig.BackgroundSoundAutoStart,!0);userConfig.backgroundSoundLoop=parseInt(bookConfig.BackgroundSoundLoop);userConfig.bgSoundURL=bookConfig.BackgroundSoundURL;userConfig.homeButtonVisible=
parseBool(bookConfig.HomeButtonVisible,!1);userConfig.homeURL=bookConfig.HomeURL;userConfig.printButtonVisible=parseBool(bookConfig.PrintButtonVisible,!1);userConfig.printWatermarkFile=bookConfig.printWatermarkFile;userConfig.helpButtonVisible=parseBool(bookConfig.HelpButtonVisible,!1);userConfig.helpContentFileURL=bookConfig.helpContentFileURL;userConfig.helpWidth=parseInt(bookConfig.helpWidth);userConfig.helpHeight=parseInt(bookConfig.helpHeight);userConfig.showHelpContentAtFirst=parseBool(bookConfig.showHelpContentAtFirst,
!1);userConfig.AnnotationButtonVisible=parseBool(bookConfig.AnnotationButtonVisible,!1);userConfig.VideoButtonVisible=parseBool(bookConfig.VideoButtonVisible,!1);userConfig.SlideshowButtonVisible=parseBool(bookConfig.SlideshowButtonVisible,!1);userConfig.aboutButtonVisible=parseBool(bookConfig.aboutButtonVisible,!1);userConfig.aboutContactInfoTxt=bookConfig.aboutContactInfoTxt;userConfig.showDoublePage=parseBool(bookConfig.showDoublePage,!0);userConfig.fullscreenButtonVisible=parseBool(bookConfig.FullscreenButtonVisible,
!0);if(""==userConfig.bgSoundURL||void 0==userConfig.bgSoundURL)userConfig.bgSoundButtonVisible=!1;if(void 0==window.bookConfig)alert("Miss book config.");else{void 0==window.pageEditor&&(window.pageEditor=void 0);if(void 0==window.ols||void 0==ols||0==ols.length)window.ols={},tableofcontentButtonEnable=!1;void 0==window.bmtConfig&&(window.bmtConfig=[]);void 0==window.language&&(window.language=[]);!0==$.browser.webkit&&(browserType=BrowserType.WEBKIT);!0==$.browser.mozilla&&(browserType=BrowserType.MOZ);
!0==$.browser.opera&&(browserType=BrowserType.OPERA);!0==$.browser.msie&&(browserType=BrowserType.MS);if(2==browserType||3==browserType)_event._mousewheel="DOMMouseScroll";isIE()&&(_event._mousewheel="mousewheel");createAll();if(isTouch)$(window).on("orientationchange",function(){window.setTimeout(function(){onBookLoad.onResize()},200)});$(window).resize(onBookLoad.onResize);"undefined"!=typeof speakConfig&&"none"!=speakConfig.title&&(LectureAudio(0),LectureSoll(0));(function(b,c,g,h,k,l,m){b.GoogleAnalyticsObject=
k;b[k]=b[k]||function(){(b[k].q=b[k].q||[]).push(arguments)};b[k].l=1*new Date;l=c.createElement(g);m=c.getElementsByTagName(g)[0];l.async=1;l.src=h;m.parentNode.insertBefore(l,m)})(window,document,"script","//www.google-analytics.com/analytics.js","ga");eval("ga('create', '"+bookConfig.googleAnalyticsID+"', 'auto')");eval("ga('send', 'pageview')")}});
var ButtonType={last:1,next:2,prev:3,first:4,home:5,zoom:6,autoPlay:7,help:8,thumbnails:9,sharethis:10,search:11,download:12,fullscreen:13,bookmark:14,sound:15,language:16,print:17,about:18,more:19,note:20,tableOfContent:21,video:22,slideShow:23};
loadToolBar.extend({addButton:function(b,c){for(var d=this,f=0;f<c.length;f++)switch(c[f]){case ButtonType.last:this.btnLast=$("<div title='Last page' id='btnLast' class='button'></div>");this.btnLast.append(getImage(toolBarIconsURL[1])).asButton().attr("title",getLanguage("btnLastPage","Last"));b.append(this.btnLast);this.btnLast.bind(_event._end,function(){d.lastPage();isMoreShow&&(moreBar.hideMoreBar(),isMoreShow=!1)});break;case ButtonType.next:this.btnNext=$("<div title='Next page' id='btnRight' class='button'></div>");
this.btnNext.append(getImage(toolBarIconsURL[2])).asButton().attr("title",getLanguage("btnNextPage","Next"));b.append(this.btnNext);this.btnNext.bind(_event._end,function(){d.nextPage();isMoreShow&&(moreBar.hideMoreBar(),isMoreShow=!1)});break;case ButtonType.prev:this.btnPrevious=$("<div title='Previous page'  id='btnLeft' class='button'></div>");this.btnPrevious.append(getImage(toolBarIconsURL[3])).asButton().attr("title",getLanguage("btnPrePage","Previous"));b.append(this.btnPrevious);this.btnPrevious.bind(_event._end,
function(){d.prePage();isMoreShow&&(moreBar.hideMoreBar(),isMoreShow=!1)});break;case ButtonType.first:this.btnFirst=$("<div title='First page' id='btnFirst' class='button' ></div>");this.btnFirst.append(getImage(toolBarIconsURL[4])).asButton().attr("title",getLanguage("btnFirstPage","First"));b.append(this.btnFirst);this.btnFirst.bind(_event._end,function(){d.firstPage();isMoreShow&&(moreBar.hideMoreBar(),isMoreShow=!1)});break;case ButtonType.home:this.btnHome=$("<div title='Home' id='btnHome' class='button'></div>");
this.btnHome.append(getImage(toolBarIconsURL[13])).asButton().attr("title",getLanguage("btnGoToHome","Home"));userConfig.homeButtonVisible||this.btnHome.css({display:"none"});b.append(this.btnHome);this.btnHome.bind(_event._end,function(){homeButtonEvent();isMoreShow&&(moreBar.hideMoreBar(),isMoreShow=!1)});break;case ButtonType.zoom:this.btnZoom=$("<div title='Zoom in' id='btnZoom' class='button'></div>");this.btnZoom.append(getImage(toolBarIconsURL[5])).asButton().attr("title",getLanguage("btnZoomIn",
"Zoom in"));zoomButtonEnable&&isFlipModel||this.btnZoom.css("display","none");b.append(this.btnZoom);this.btnZoom.bind(_event._end,function(){2==bookType?windowWidth<windowHeight?(bookType=1,changeShowBook(1),setCurrentIndexTextField(singlePageBook.currentPageIndex),gotoPageFun(zoomBook.currentIndex),thumbButtonEnable&&thumbnail.clearHighLight(),thumbButtonEnable&&thumbnail.setHighLight(zoomBook.currentIndex),d.changeZoomIcon(!0)):zoomBook.showPage.animateFit():(zoomBook.currentIndex=BookInfo.getBook().currentPageIndex,
zoomBook.showPage.fillContent(zoomBook.currentIndex),bookType=2,changeShowBook(2),setCurrentIndexTextField(zoomBook.currentIndex,!1),thumbButtonEnable&&thumbnail.clearHighLight(),thumbButtonEnable&&thumbnail.setHighLight(zoomBook.currentIndex),auto_player.isPlaying()&&(auto_player.stop(),d.changeAutoPlayIcon()),d.changeZoomIcon(!1));isMoreShow&&(moreBar.hideMoreBar(),isMoreShow=!1)});break;case ButtonType.autoPlay:this.btnAutoPlay=$("<div title='Auto play' id='btnAutoPlay' class='button' ></div>");
this.btnAutoPlay.append(getImage(toolBarIconsURL[7])).asButton().attr("title",getLanguage("btnAutoFlip","Auto flip"));userConfig.autoPlayButtonVisible||this.btnAutoPlay.css("display","none");b.append(this.btnAutoPlay);this.btnAutoPlay.bind(_event._end,function(){auto_player.isPlaying()?auto_player.stop():auto_player.start();d.changeAutoPlayIcon();isMoreShow&&(moreBar.hideMoreBar(),isMoreShow=!1)});break;case ButtonType.help:this.btnHelp=$("<div title='Help' id='btnHelp' class='button'></div>");this.btnHelp.append(getImage(toolBarIconsURL[22])).asButton().attr("title",
getLanguage("btnHelp","Help"));userConfig.helpButtonVisible||this.btnHelp.css({display:"none"});b.append(this.btnHelp);this.btnHelp.bind(_event._end,function(){helpBody.getShowStatu()?helpBody.hideBox():helpBody.showshow();isMoreShow&&(moreBar.hideMoreBar(),isMoreShow=!1)});break;case ButtonType.thumbnails:this.btnThumb=$("<div title='Thumbnails'  id='btnThumb' class='button'></div>");this.btnThumb.append(getImage(toolBarIconsURL[9])).asButton().attr("title",getLanguage("btnThumb","Thumbnails"));
thumbButtonEnable||this.btnThumb.css("display","none");b.append(this.btnThumb);this.btnThumb.bind(_event._end,function(){thumbnail.getShowStatu()?thumbnail.hideBox():thumbnail.showshow();isMoreShow&&(moreBar.hideMoreBar(),isMoreShow=!1)});break;case ButtonType.sharethis:this.btnShare=$("<div title='Share'  id='btnShare' class='button'></div>");this.btnShare.append(getImage(toolBarIconsURL[10])).asButton().attr("title",getLanguage("btnSocialShare","Share"));shareButtonEnable||this.btnShare.css("display",
"none");b.append(this.btnShare);this.btnShare.bind(_event._end,function(){sharePanel.getShowStatu()?sharePanel.hideBox():sharePanel.showshow();isMoreShow&&(moreBar.hideMoreBar(),isMoreShow=!1)});this.btnShare.bind(_event._down,function(){isMoreShow&&(moreBar.hideMoreBar(),isMoreShow=!1);return!1});break;case ButtonType.search:this.btnSearch=$("<div title='Search' id='btnSearch' class='button'></div>");this.btnSearch.append(getImage(toolBarIconsURL[11])).asButton().attr("title",getLanguage("btnSearch",
"Search"));searchButtonEnable||this.btnSearch.css("display","none");b.append(this.btnSearch);this.btnSearch.bind(_event._end,function(){frmSearch.isSearchShow?frmSearch.closeForm():frmSearch.showForm();isMoreShow&&(moreBar.hideMoreBar(),isMoreShow=!1)});break;case ButtonType.download:this.btnDownload=$("<div title='Download' id='btnDownload' class='button'></div>");this.btnDownload.append(getImage(toolBarIconsURL[12])).asButton().attr("title",getLanguage("btnDownload","Download"));userConfig.downloadButtonVisible||
this.btnDownload.css({display:"none"});b.append(this.btnDownload);this.btnDownload.bind(_event._end,function(){""!=userConfig.downloadURL&&(window.location=userConfig.downloadURL);isMoreShow&&(moreBar.hideMoreBar(),isMoreShow=!1)});break;case ButtonType.fullscreen:this.btnFullscreen=$("<div title='Fullscreen' id='btnfullscreen' class='button'></div>");this.btnFullscreen.append(getImage(toolBarIconsURL[27])).asButton().attr("title",getLanguage("btnFullscreen","Fullscreen"));userConfig.fullscreenButtonVisible||
this.btnFullscreen.css({display:"none"});b.append(this.btnFullscreen);this.btnFullscreen.bind(_event._end,function(){fullscreenFun();return!1});$(document).bind(fullScreenApi.fullScreenEventName,function(){d.changeFullscreenIcon(fullScreenApi.isFullScreen())});break;case ButtonType.bookmark:this.btnBookMark=$("<div title='Bookmark' id='btnBookmark' class='button'></div>");this.btnBookMark.append(getImage(toolBarIconsURL[14])).asButton().attr("title",getLanguage("btnBookMark","Bookmark"));bookmarkButtonEnable||
this.btnBookMark.css("display","none");b.append(this.btnBookMark);this.btnBookMark.bind(_event._end,function(){bookmark.showHide();isMoreShow&&(moreBar.hideMoreBar(),isMoreShow=!1)});break;case ButtonType.tableOfContent:this.btnTableOfContent=$("<div title='TableOfContent' id='btnTableOfContent' class='button'></div>");this.btnTableOfContent.append(getImage(toolBarIconsURL[32])).asButton().attr("title",getLanguage("btnTableOfContent","TableOfContent"));tableofcontentButtonEnable||this.btnTableOfContent.css("display",
"none");b.append(this.btnTableOfContent);this.btnTableOfContent.bind(_event._end,function(){frmBookmark.getShowStatu()?frmBookmark.closeForm():frmBookmark.showForm();isMoreShow&&(moreBar.hideMoreBar(),isMoreShow=!1)});break;case ButtonType.sound:this.btnSound=$("<div title='Sound on' id='btnSound' class='button'></div>");this.btnSound.append(getImage(toolBarIconsURL[15])).asButton().attr("title",getLanguage("btnSoundOn","Sound on"));userConfig.bgSoundButtonVisible||this.btnSound.css({display:"none"});
b.append(this.btnSound);this.btnSound.bind(_event._end,function(){d.changeSoundIcon();isMoreShow&&(moreBar.hideMoreBar(),isMoreShow=!1)});break;case ButtonType.language:this.btnLanguage=$("<div title='Language' id='btnLanguage' class='button'></div>");this.btnLanguage.append(getImage(toolBarIconsURL[25])).asButton().attr("title",getLanguage("btnLanguage","Language change"));1>=language.length&&this.btnLanguage.css({display:"none"});b.append(this.btnLanguage);this.btnLanguage.bind(_event._end,function(){languagePanel.getShowStatu()?
languagePanel.hideBox():languagePanel.showshow();isMoreShow&&(moreBar.hideMoreBar(),isMoreShow=!1)});break;case ButtonType.print:this.btnPrint=$("<div title='Print' id='btnPrint' class='button'></div>");this.btnPrint.append(getImage(toolBarIconsURL[21])).asButton().attr("title",getLanguage("btnPrint","Print"));userConfig.printButtonVisible||this.btnPrint.css({display:"none"});b.append(this.btnPrint);this.btnPrint.bind(_event._end,function(){printBody.getShowStatu()?printBody.hideBox():printBody.showshow();
isMoreShow&&(moreBar.hideMoreBar(),isMoreShow=!1)});break;case ButtonType.about:this.btnAbout=$("<div title='About' id='btnAbout' class='button'></div>");this.btnAbout.append(getImage(toolBarIconsURL[23])).asButton().attr("title",getLanguage("btnAbout","About"));userConfig.aboutButtonVisible||this.btnAbout.css({display:"none"});b.append(this.btnAbout);this.btnAbout.bind(_event._end,function(){aboutBody.getShowStatu()?aboutBody.hideBox():aboutBody.showshow();isMoreShow&&(moreBar.hideMoreBar(),isMoreShow=
!1)});break;case ButtonType.more:this.btnMore=$("<div title='More' id='btnMore' class='button'></div>");this.btnMore.append(getImage(toolBarIconsURL[24])).asButton().attr("title",getLanguage("btnMore","More"));b.append(this.btnMore);this.btnMore.bind(_event._end,function(){isMoreShow?moreBar.hideMoreBar():moreBar.showMoreBar();isMoreShow=!isMoreShow;return!1});break;case ButtonType.note:this.btnNote=$("<div title='Note' id='btnNote' class='button'></div>");this.btnNote.append(getImage(toolBarIconsURL[31])).asButton().attr("title",
getLanguage("btnNote","Annotation"));userConfig.AnnotationButtonVisible||this.btnNote.css({display:"none"});b.append(this.btnNote);this.btnNote.bind(_event._end,function(){annotationPannel.getShowStatu()?annotationPannel.hideBox():annotationPannel.showshow();isMoreShow&&(moreBar.hideMoreBar(),isMoreShow=!1)});break;case ButtonType.video:this.btnVideo=$("<div title='VideoGallery' id='btnVideo' class='button'></div>");this.btnVideo.append(getImage(toolBarIconsURL[33])).asButton().attr("title",getLanguage("btnVideo",
"VideoGallery"));userConfig.VideoButtonVisible||this.btnVideo.css({display:"none"});b.append(this.btnVideo);this.btnVideo.bind(_event._end,function(){videoGallery.showHide();isMoreShow&&(moreBar.hideMoreBar(),isMoreShow=!1)});break;case ButtonType.slideShow:this.btnSlideShow=$("<div title='SlideShow' id='btnSlideShow' class='button'></div>"),this.btnSlideShow.append(getImage(toolBarIconsURL[34])).asButton().attr("title",getLanguage("btnSlideShow","SlideShow")),userConfig.SlideshowButtonVisible||this.btnSlideShow.css({display:"none"}),
b.append(this.btnSlideShow),this.btnSlideShow.bind(_event._end,function(){photoGallery.showHide();isMoreShow&&(moreBar.hideMoreBar(),isMoreShow=!1)})}},lastPage:function(){rightToLeft?firstPageFun():lastPageFun()},nextPage:function(){rightToLeft?previousPageFun():nextPageFun()},prePage:function(){rightToLeft?nextPageFun():previousPageFun()},firstPage:function(){rightToLeft?lastPageFun():firstPageFun()},OnMouseOver:function(){userConfig.homeButtonVisible&&this.btnHome.mouseOverCursor();userConfig.printButtonVisible&&
this.btnPrint.mouseOverCursor();userConfig.downloadButtonVisible&&this.btnDownload.mouseOverCursor();zoomButtonEnable&&isFlipModel&&this.btnZoom.mouseOverCursor();bookmarkButtonEnable&&this.btnBookMark.mouseOverCursor();tableofcontentButtonEnable&&this.btnTableOfContent.mouseOverCursor();shareButtonEnable&&this.btnShare.mouseOverCursor();userConfig.autoPlayButtonVisible&&this.btnAutoPlay.mouseOverCursor();userConfig.bgSoundButtonVisible&&this.btnSound.mouseOverCursor();userConfig.helpButtonVisible&&
this.btnHelp.mouseOverCursor();userConfig.aboutButtonVisible&&this.btnAbout.mouseOverCursor();thumbButtonEnable&&this.btnThumb&&this.btnThumb.mouseOverCursor();userConfig.fullscreenButtonVisible&&this.btnFullscreen.mouseOverCursor();1<language.length&&this.btnLanguage.mouseOverCursor();userConfig.AnnotationButtonVisible&&this.btnNote.mouseOverCursor();userConfig.VideoButtonVisible&&this.btnVideo.mouseOverCursor();userConfig.SlideshowButtonVisible&&this.btnSlideShow.mouseOverCursor();this.btnLast.mouseOverCursor();
this.btnNext.mouseOverCursor();this.btnPrevious.mouseOverCursor();this.btnFirst.mouseOverCursor();searchButtonEnable&&this.btnSearch.mouseOverCursor();this.btnMore.mouseOverCursor()},changeLanguage:function(){this.btnLast.attr("title",getLanguage("btnLastPage","Last"));this.btnNext.attr("title",getLanguage("btnNextPage","Next"));this.btnPrevious.attr("title",getLanguage("btnPrePage","Previous"));this.btnFirst.attr("title",getLanguage("btnFirstPage","First"));this.btnZoom.attr("title",2==bookType?
getLanguage("btnZoomOut","Zoom out"):getLanguage("btnZoomIn","Zoom in"));this.btnAutoPlay.attr("title",auto_player.isPlaying()?getLanguage("btnStopAutoFlip","Stop auto flip"):getLanguage("btnAutoFlip","Auto flip"));this.btnThumb.attr("title",getLanguage("btnThumb","Thumbnails"));this.btnShare.attr("title",getLanguage("btnSocialShare","Share"));this.btnSearch.attr("title",getLanguage("btnSearch","Search"));this.btnBookMark.attr("title",getLanguage("btnBookMark","Bookmark"));this.btnTableOfContent.attr("title",
getLanguage("btnTableOfContent","table of content"));this.btnDownload.attr("title",getLanguage("btnDownload","Download"));this.btnHome.attr("title",getLanguage("btnGoToHome","Home"));this.btnPrint.attr("title",getLanguage("btnPrint","Print"));this.btnNote.attr("title",getLanguage("btnNote","Annotation"));this.btnVideo.attr("title",getLanguage("btnVideo","videoGallery"));this.btnSlideShow.attr("title",getLanguage("btnSlideShow","photoGallery"));this.btnFullscreen.attr("title",getLanguage("btnFullscreen",
"Fullscreen"));this.btnHelp.attr("title",getLanguage("btnHelp","Help"));this.btnAbout.attr("title",getLanguage("btnAbout","About"));this.btnLanguage.attr("title",getLanguage("btnLanguage","Language"));this.btnMore.attr("title",getLanguage("btnMore","More"));this.btnSound.attr("title",isPlaying?getLanguage("btnSoundOn","Sound on"):getLanguage("btnSoundOff","Sound off"));rightToLeft&&(this.btnFirst.attr({title:getLanguage("btnLastPage","Last")}),this.btnLast.attr({title:getLanguage("btnFirstPage","First")}),
this.btnNext.attr({title:getLanguage("btnPrePage","Previous")}),this.btnPrevious.attr({title:getLanguage("btnNextPage","Next")}))}});
