function QR8bitByte(a){this.mode=QRMode.MODE_8BIT_BYTE;this.data=a}QR8bitByte.prototype={getLength:function(a){return this.data.length},write:function(a){for(var b=0;b<this.data.length;b++)a.put(this.data.charCodeAt(b),8)}};function QRCode(a,b){this.typeNumber=a;this.errorCorrectLevel=b;this.modules=null;this.moduleCount=0;this.dataCache=null;this.dataList=[]}
QRCode.prototype={addData:function(a){a=new QR8bitByte(a);this.dataList.push(a);this.dataCache=null},isDark:function(a,b){if(0>a||this.moduleCount<=a||0>b||this.moduleCount<=b)throw Error(a+","+b);return this.modules[a][b]},getModuleCount:function(){return this.moduleCount},make:function(){if(1>this.typeNumber){for(var a=1,a=1;40>a;a++){for(var b=QRRSBlock.getRSBlocks(a,this.errorCorrectLevel),c=new QRBitBuffer,d=0,e=0;e<b.length;e++)d+=b[e].dataCount;for(e=0;e<this.dataList.length;e++)b=this.dataList[e],
c.put(b.mode,4),c.put(b.getLength(),QRUtil.getLengthInBits(b.mode,a)),b.write(c);if(c.getLengthInBits()<=8*d)break}this.typeNumber=a}this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,b){this.moduleCount=4*this.typeNumber+17;this.modules=Array(this.moduleCount);for(var c=0;c<this.moduleCount;c++){this.modules[c]=Array(this.moduleCount);for(var d=0;d<this.moduleCount;d++)this.modules[c][d]=null}this.setupPositionProbePattern(0,0);this.setupPositionProbePattern(this.moduleCount-7,0);this.setupPositionProbePattern(0,
this.moduleCount-7);this.setupPositionAdjustPattern();this.setupTimingPattern();this.setupTypeInfo(a,b);7<=this.typeNumber&&this.setupTypeNumber(a);null==this.dataCache&&(this.dataCache=QRCode.createData(this.typeNumber,this.errorCorrectLevel,this.dataList));this.mapData(this.dataCache,b)},setupPositionProbePattern:function(a,b){for(var c=-1;7>=c;c++)if(!(-1>=a+c||this.moduleCount<=a+c))for(var d=-1;7>=d;d++)-1>=b+d||this.moduleCount<=b+d||(this.modules[a+c][b+d]=0<=c&&6>=c&&(0==d||6==d)||0<=d&&6>=
d&&(0==c||6==c)||2<=c&&4>=c&&2<=d&&4>=d?!0:!1)},getBestMaskPattern:function(){for(var a=0,b=0,c=0;8>c;c++){this.makeImpl(!0,c);var d=QRUtil.getLostPoint(this);if(0==c||a>d)a=d,b=c}return b},createMovieClip:function(a,b,c){a=a.createEmptyMovieClip(b,c);this.make();for(b=0;b<this.modules.length;b++){c=1*b;for(var d=0;d<this.modules[b].length;d++){var e=1*d;this.modules[b][d]&&(a.beginFill(0,100),a.moveTo(e,c),a.lineTo(e+1,c),a.lineTo(e+1,c+1),a.lineTo(e,c+1),a.endFill())}}return a},setupTimingPattern:function(){for(var a=
8;a<this.moduleCount-8;a++)null==this.modules[a][6]&&(this.modules[a][6]=0==a%2);for(a=8;a<this.moduleCount-8;a++)null==this.modules[6][a]&&(this.modules[6][a]=0==a%2)},setupPositionAdjustPattern:function(){for(var a=QRUtil.getPatternPosition(this.typeNumber),b=0;b<a.length;b++)for(var c=0;c<a.length;c++){var d=a[b],e=a[c];if(null==this.modules[d][e])for(var f=-2;2>=f;f++)for(var h=-2;2>=h;h++)this.modules[d+f][e+h]=-2==f||2==f||-2==h||2==h||0==f&&0==h?!0:!1}},setupTypeNumber:function(a){for(var b=
QRUtil.getBCHTypeNumber(this.typeNumber),c=0;18>c;c++){var d=!a&&1==(b>>c&1);this.modules[Math.floor(c/3)][c%3+this.moduleCount-8-3]=d}for(c=0;18>c;c++)d=!a&&1==(b>>c&1),this.modules[c%3+this.moduleCount-8-3][Math.floor(c/3)]=d},setupTypeInfo:function(a,b){for(var c=QRUtil.getBCHTypeInfo(this.errorCorrectLevel<<3|b),d=0;15>d;d++){var e=!a&&1==(c>>d&1);6>d?this.modules[d][8]=e:8>d?this.modules[d+1][8]=e:this.modules[this.moduleCount-15+d][8]=e}for(d=0;15>d;d++)e=!a&&1==(c>>d&1),8>d?this.modules[8][this.moduleCount-
d-1]=e:9>d?this.modules[8][15-d-1+1]=e:this.modules[8][15-d-1]=e;this.modules[this.moduleCount-8][8]=!a},mapData:function(a,b){for(var c=-1,d=this.moduleCount-1,e=7,f=0,h=this.moduleCount-1;0<h;h-=2)for(6==h&&h--;;){for(var g=0;2>g;g++)if(null==this.modules[d][h-g]){var k=!1;f<a.length&&(k=1==(a[f]>>>e&1));QRUtil.getMask(b,d,h-g)&&(k=!k);this.modules[d][h-g]=k;e--; -1==e&&(f++,e=7)}d+=c;if(0>d||this.moduleCount<=d){d-=c;c=-c;break}}}};QRCode.PAD0=236;QRCode.PAD1=17;
QRCode.createData=function(a,b,c){b=QRRSBlock.getRSBlocks(a,b);for(var d=new QRBitBuffer,e=0;e<c.length;e++){var f=c[e];d.put(f.mode,4);d.put(f.getLength(),QRUtil.getLengthInBits(f.mode,a));f.write(d)}for(e=a=0;e<b.length;e++)a+=b[e].dataCount;if(d.getLengthInBits()>8*a)throw Error("code length overflow. ("+d.getLengthInBits()+">"+8*a+")");for(d.getLengthInBits()+4<=8*a&&d.put(0,4);0!=d.getLengthInBits()%8;)d.putBit(!1);for(;!(d.getLengthInBits()>=8*a);){d.put(QRCode.PAD0,8);if(d.getLengthInBits()>=
8*a)break;d.put(QRCode.PAD1,8)}return QRCode.createBytes(d,b)};
QRCode.createBytes=function(a,b){for(var c=0,d=0,e=0,f=Array(b.length),h=Array(b.length),g=0;g<b.length;g++){var k=b[g].dataCount,m=b[g].totalCount-k,d=Math.max(d,k),e=Math.max(e,m);f[g]=Array(k);for(var l=0;l<f[g].length;l++)f[g][l]=255&a.buffer[l+c];c+=k;l=QRUtil.getErrorCorrectPolynomial(m);k=(new QRPolynomial(f[g],l.getLength()-1)).mod(l);h[g]=Array(l.getLength()-1);for(l=0;l<h[g].length;l++)m=l+k.getLength()-h[g].length,h[g][l]=0<=m?k.get(m):0}for(l=g=0;l<b.length;l++)g+=b[l].totalCount;c=Array(g);
for(l=k=0;l<d;l++)for(g=0;g<b.length;g++)l<f[g].length&&(c[k++]=f[g][l]);for(l=0;l<e;l++)for(g=0;g<b.length;g++)l<h[g].length&&(c[k++]=h[g][l]);return c};
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(a){for(var b=a<<10;0<=QRUtil.getBCHDigit(b)-QRUtil.getBCHDigit(QRUtil.G15);)b^=
QRUtil.G15<<QRUtil.getBCHDigit(b)-QRUtil.getBCHDigit(QRUtil.G15);return(a<<10|b)^QRUtil.G15_MASK},getBCHTypeNumber:function(a){for(var b=a<<12;0<=QRUtil.getBCHDigit(b)-QRUtil.getBCHDigit(QRUtil.G18);)b^=QRUtil.G18<<QRUtil.getBCHDigit(b)-QRUtil.getBCHDigit(QRUtil.G18);return a<<12|b},getBCHDigit:function(a){for(var b=0;0!=a;)b++,a>>>=1;return b},getPatternPosition:function(a){return QRUtil.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,b,c){switch(a){case QRMaskPattern.PATTERN000:return 0==(b+c)%
2;case QRMaskPattern.PATTERN001:return 0==b%2;case QRMaskPattern.PATTERN010:return 0==c%3;case QRMaskPattern.PATTERN011:return 0==(b+c)%3;case QRMaskPattern.PATTERN100:return 0==(Math.floor(b/2)+Math.floor(c/3))%2;case QRMaskPattern.PATTERN101:return 0==b*c%2+b*c%3;case QRMaskPattern.PATTERN110:return 0==(b*c%2+b*c%3)%2;case QRMaskPattern.PATTERN111:return 0==(b*c%3+(b+c)%2)%2;default:throw Error("bad maskPattern:"+a);}},getErrorCorrectPolynomial:function(a){for(var b=new QRPolynomial([1],0),c=0;c<
a;c++)b=b.multiply(new QRPolynomial([1,QRMath.gexp(c)],0));return b},getLengthInBits:function(a,b){if(1<=b&&10>b)switch(a){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:"+a);}else if(27>b)switch(a){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:"+a);}else if(41>b)switch(a){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:"+a);}else throw Error("type:"+b);},getLostPoint:function(a){for(var b=a.getModuleCount(),c=0,d=0;d<b;d++)for(var e=0;e<b;e++){for(var f=0,h=a.isDark(d,e),g=-1;1>=g;g++)if(!(0>d+g||b<=d+g))for(var k=-1;1>=k;k++)0>e+k||b<=e+k||0==g&&0==k||h!=a.isDark(d+g,e+k)||f++;5<f&&(c+=3+f-5)}for(d=0;d<b-1;d++)for(e=0;e<b-1;e++)if(f=0,a.isDark(d,e)&&f++,a.isDark(d+1,e)&&f++,a.isDark(d,
e+1)&&f++,a.isDark(d+1,e+1)&&f++,0==f||4==f)c+=3;for(d=0;d<b;d++)for(e=0;e<b-6;e++)a.isDark(d,e)&&!a.isDark(d,e+1)&&a.isDark(d,e+2)&&a.isDark(d,e+3)&&a.isDark(d,e+4)&&!a.isDark(d,e+5)&&a.isDark(d,e+6)&&(c+=40);for(e=0;e<b;e++)for(d=0;d<b-6;d++)a.isDark(d,e)&&!a.isDark(d+1,e)&&a.isDark(d+2,e)&&a.isDark(d+3,e)&&a.isDark(d+4,e)&&!a.isDark(d+5,e)&&a.isDark(d+6,e)&&(c+=40);for(e=f=0;e<b;e++)for(d=0;d<b;d++)a.isDark(d,e)&&f++;a=Math.abs(100*f/b/b-50)/5;return c+10*a}},QRMath={glog:function(a){if(1>a)throw Error("glog("+
a+")");return QRMath.LOG_TABLE[a]},gexp:function(a){for(;0>a;)a+=255;for(;256<=a;)a-=255;return QRMath.EXP_TABLE[a]},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(a,b){if(void 0==a.length)throw Error(a.length+"/"+b);for(var c=0;c<a.length&&0==a[c];)c++;this.num=Array(a.length-c+b);for(var d=0;d<a.length-c;d++)this.num[d]=a[d+c]}
QRPolynomial.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var b=Array(this.getLength()+a.getLength()-1),c=0;c<this.getLength();c++)for(var d=0;d<a.getLength();d++)b[c+d]^=QRMath.gexp(QRMath.glog(this.get(c))+QRMath.glog(a.get(d)));return new QRPolynomial(b,0)},mod:function(a){if(0>this.getLength()-a.getLength())return this;for(var b=QRMath.glog(this.get(0))-QRMath.glog(a.get(0)),c=Array(this.getLength()),d=0;d<this.getLength();d++)c[d]=
this.get(d);for(d=0;d<a.getLength();d++)c[d]^=QRMath.gexp(QRMath.glog(a.get(d))+b);return(new QRPolynomial(c,0)).mod(a)}};function QRRSBlock(a,b){this.totalCount=a;this.dataCount=b}
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(a,b){var c=QRRSBlock.getRsBlockTable(a,b);if(void 0==c)throw Error("bad rs block @ typeNumber:"+a+"/errorCorrectLevel:"+b);for(var d=c.length/3,e=[],f=0;f<d;f++)for(var h=c[3*f+0],g=c[3*f+1],k=c[3*f+2],m=0;m<h;m++)e.push(new QRRSBlock(g,k));return e};
QRRSBlock.getRsBlockTable=function(a,b){switch(b){case QRErrorCorrectLevel.L:return QRRSBlock.RS_BLOCK_TABLE[4*(a-1)+0];case QRErrorCorrectLevel.M:return QRRSBlock.RS_BLOCK_TABLE[4*(a-1)+1];case QRErrorCorrectLevel.Q:return QRRSBlock.RS_BLOCK_TABLE[4*(a-1)+2];case QRErrorCorrectLevel.H:return QRRSBlock.RS_BLOCK_TABLE[4*(a-1)+3]}};function QRBitBuffer(){this.buffer=[];this.length=0}
QRBitBuffer.prototype={get:function(a){return 1==(this.buffer[Math.floor(a/8)]>>>7-a%8&1)},put:function(a,b){for(var c=0;c<b;c++)this.putBit(1==(a>>>b-c-1&1))},getLengthInBits:function(){return this.length},putBit:function(a){var b=Math.floor(this.length/8);this.buffer.length<=b&&this.buffer.push(0);a&&(this.buffer[b]|=128>>>this.length%8);this.length++}};(function(a){a.fn.qrcode=function(b){"string"===typeof b&&(b={text:b});b=a.extend({},{render:"canvas",width:256,height:256,typeNumber:-1,correctLevel:QRErrorCorrectLevel.H,background:"#ffffff",foreground:"#000000"},b);return this.each(function(){var c;if("canvas"==b.render){c=new QRCode(b.typeNumber,b.correctLevel);c.addData(b.text);c.make();var d=document.createElement("canvas");d.width=b.width;d.height=b.height;for(var e=d.getContext("2d"),f=b.width/c.getModuleCount(),h=b.height/c.getModuleCount(),
g=0;g<c.getModuleCount();g++)for(var k=0;k<c.getModuleCount();k++){e.fillStyle=c.isDark(g,k)?b.foreground:b.background;var m=Math.ceil((k+1)*f)-Math.floor(k*f),l=Math.ceil((g+1)*f)-Math.floor(g*f);e.fillRect(Math.round(k*f),Math.round(g*h),m,l)}}else for(c=new QRCode(b.typeNumber,b.correctLevel),c.addData(b.text),c.make(),d=a("<table></table>").css("width",b.width+"px").css("height",b.height+"px").css("border","0px").css("border-collapse","collapse").css("background-color",b.background),e=b.width/
c.getModuleCount(),f=b.height/c.getModuleCount(),h=0;h<c.getModuleCount();h++)for(g=a("<tr></tr>").css("height",f+"px").appendTo(d),k=0;k<c.getModuleCount();k++)a("<td></td>").css("width",e+"px").css("background-color",c.isDark(h,k)?b.foreground:b.background).appendTo(g);c=d;jQuery(c).appendTo(this)})}})(jQuery);var iconInfo={width:512,height:650,iconInfo:[{id:"sound_open",position:{x:14,y:19},width:80,height:80},{id:"sound_close",position:{x:112,y:19},width:80,height:80},{id:"more_open",position:{x:210,y:19},width:80,height:80},{id:"more_close",position:{x:302,y:19},width:92,height:92},{id:"search",position:{x:14,y:123},width:130,height:130},{id:"thumbnail",position:{x:162,y:123},width:130,height:130},{id:"tableOfContent",position:{x:312,y:123},width:130,height:130},{id:"about",position:{x:14,y:271},width:130,
height:130},{id:"share",position:{x:162,y:271},width:130,height:130},{id:"decoration",position:{x:9,y:425},width:126,height:91},{id:"close",position:{x:155,y:424},width:22,height:22},{id:"arrow",position:{x:414,y:33},width:92,height:55},{id:"facebook",position:{x:14,y:542},width:84,height:84},{id:"twitter",position:{x:113,y:542},width:84,height:84},{id:"igoogle",position:{x:213,y:542},width:84,height:84},{id:"more",position:{x:412,y:542},width:84,height:84},{id:"searchBtn",position:{x:153,y:463},
width:23,height:23},{id:"expand",position:{x:198,y:424},width:18,height:13},{id:"collapse",position:{x:200,y:465},width:13,height:18}]};function TaskList(){this.create()}TaskList.prototype={create:function(){this.taskList=[];this.largeLength=0},unShiftList:function(a,b){this.taskList.unshift(a);this.popList();for(var c=this.taskList.length,d=0;d<c&&!this.stop;d++)b&&b(this.taskList[d])},popList:function(a){var b=this.taskList.length;if(!(b<=this.largeLength)){this.stop=!0;for(var c=0;c<b-this.largeLength;c++){var d=this.taskList.pop();a&&a(d)}this.stop=!1}},setLargeLength:function(a){this.largeLength=a}};(function(a){function b(a){a=c.match(a);if(null==a||0==a.length)return 0;a=a[0].match(/\d+\.?\d?/);if(null==a||0==a.length)return 0;a=a[0];return""==a?0:parseFloat(a)}var c=navigator.userAgent.toLowerCase();if(void 0==a.browser){a.browser={};a.browser.webkit=/webkit/.test(c);a.browser.mozilla=/firefox/.test(c);a.browser.firefox=a.browser.mozilla;a.browser.msie=/msie/.test(c)||/trident/.test(c);a.browser.opera=/opera/.test(c)||/opr/.test(c);a.browser.chrome=/chrome/.test(c)&&!a.browser.opera;a.browser.uc=
/ucbrowser/.test(c);a.browser.safari=/safari/.test(c)&&!a.browser.chrome&&!a.browser.uc;a.browser.version=0;var d=function(a){a=c.match(a);if(null==a||0==a.length)return 0;a=a[0];var b=a.indexOf("/");a=a.substring(b+1,a.length);return""==a?0:parseInt(a)};a.browser.firefox&&(a.browser.version=d(/firefox\/\d+/));if(a.browser.msie){var e=c.match(/msie\s?\d+\.0/);null==e?(e=c.match(/trident\/\d+\.0/),null!=e&&0<e.length&&(e=parseInt(e[0].replace("trident/","")),a.browser.version=e+4)):(e=parseInt(e[0].replace("msie",
"")),a.browser.version=e)}a.browser.opera&&(a.browser.version=d(/opera\/\d+/)||d(/opr\/\d+/));a.browser.chrome&&(a.browser.version=d(/chrome\/\d+/));a.browser.uc&&(a.browser.version=d(/ucbrowser\/\d+/));a.browser.safari&&(a.browser.version=d(/safari\/\d+/))}if(void 0==a.browser.device){a.browser.DEVICE_PC=0;a.browser.DEVICE_PAD=1;a.browser.DEVICE_PHONE=2;var d=/pad/.test(c)||/ipod/.test(c),e=/iphone/.test(c),f=/wpdesktop/.test(c),h=/blackberry/.test(c),g=/mobile/.test(c)||/phone/.test(c);a.browser.device=
a.browser.DEVICE_PC;if(d)a.browser.device=a.browser.DEVICE_PAD;else if(e||f||h||g)a.browser.device=a.browser.DEVICE_PHONE}void 0==a.browser.prefix&&(a.browser.prefix="",!0==a.browser.webkit&&(a.browser.prefix="-webkit-"),!0==a.browser.mozilla&&(a.browser.prefix="-moz-"),!0==a.browser.opera&&(a.browser.prefix="-webkit-"),!0==a.browser.uc&&(a.browser.prefix="-webkit-"),!0==a.browser.msie&&(a.browser.prefix="-ms-"));if(void 0==a.system){a.system={name:"",version:0};a.system.WINDOWS="Windows";a.system.MAC=
"Mac OS";a.system.IOS="iPhone OS";a.system.LINUX="Linux";a.system.ANDROID="Android";a.system.BLACKBERRY="BlackBerry";/windows/.test(c)&&(a.system.name=a.system.WINDOWS,a.system.version=b(/windows nt\s?\d+\.?\d?/));if(/iphone/.test(c)||/ipad/.test(c))a.system.name=a.system.IOS,a.system.version=b(/os\s?\d+/);/mac/.test(c)&&a.browser.system!=a.browser.IOS&&(a.system.name=a.system.SYSTEM_MAC,a.system.version=b(/os x\s?\d+\.?\d?/));/linux/.test(c)&&!/android/.test(c)&&(a.system.name=a.system.LINUX);/android/.test(c)&&
(a.system.name=a.system.ANDROID,a.system.version=b(/android\s?\d+\.?\d?/));/blackberry/.test(c)&&(a.system.name=a.system.BLACKBERRY,a.system.version=b(/blackberry\s?\d+/))}})(jQuery);function loadJavascript(a,b,c){var d=this,e=document.createElement("script");e.type="text/javascript";e.async=!0;e.onload=e.onreadystatechange=function(){d.readyState&&"loaded"!=d.readyState&&"complete"!=d.readyState||(e.onload=e.onreadystatechange=null,void 0!=b&&b(e))};e.onerror=function(){void 0!=c&&c(e)};$("body")[0].appendChild(e);e.src=a;return e}
function copyToClipboard(a){if(window.clipboardData)window.clipboardData.clearData(),window.clipboardData.setData("Text",a);else if(-1!=navigator.userAgent.indexOf("Opera"))window.location=a;else if(window.netscape){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(b){return alert("Your browser does not support clipboard.Please do it yourself."),!1}var c=Components.classes["@mozilla.org/widget/clipboard;1"].createInstance(Components.interfaces.nsIClipboard);if(c){var d=
Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);if(d){d.addDataFlavor("text/unicode");var e={},e=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);e.data=a;d.setTransferData("text/unicode",e,2*a.length);if(!c)return!1;c.setData(d,null,Components.interfaces.nsIClipboard.kGlobalClipboard)}}}else alert("Your browser does not support clipboard.Please do it yourself.")}
var selectLanguage=function(a){if(a)if(a=a.toLowerCase(),0==language.length)selectedLanguage=[];else{for(var b=[],c=0;c<language.length;c++)if(language[c].language.toLowerCase()==a){b=language[c];break}selectedLanguage=b}else selectedLanguage=[]},selectedLanguage;selectLanguage(bookConfig.language);
var getLanguage=function(a,b){return selectedLanguage[a]?selectedLanguage[a]:getLanguageValue(a,b)},getLanguageValue=function(a,b){try{if(!aliasLanguage)return b;var c=aliasLanguage[a];if(!c)return b;for(var d=0;d<c.length;d++){var e=c[d];if(selectedLanguage[e])return selectedLanguage[e]}return b}catch(f){return b}};
function setAnimation(a,b,c,d){if(a&&void 0!=b){100>b&&(b*=1E3);if(void 0==c||""==c)c="all";void 0==d&&(d="ease-in-out");c=c+" "+b+"ms "+d;0<b?a.css({"-moz-transition":"-moz-"+c,"-webkit-transition":"-webkit-"+c,"-o-transition":"-o-"+c,"-ms-transition":"-ms-"+c,transition:c}):a.css({"-moz-transition":"","-webkit-transition":"","-o-transition":"","-ms-transition":"",transition:""})}}
function animateOnce(a,b,c,d,e,f){if(a&&b&&void 0!=c&&0!==c){var h=!1;setAnimation(a,c,e,f);a.one("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){!0!=h&&(h=!0,setAnimation(a,0),d&&d instanceof Function&&d())});a.css(b)}}function multiAnimateOnce(a,b){if(a||a instanceof Array)for(var c=0,d=function(){c++;c==a.length&&b&&b instanceof Function&&b()},e=0;e<a.length;e++){var f=a[e];animateOnce(f.obj,f.style,f.time,d,f.filter,f.easing)}}
var isTouchDevice=function(){return $.browser.device==$.browser.DEVICE_PAD||$.browser.device==$.browser.DEVICE_PHONE},_event;_event=isTouchDevice()?{_down:"touchstart",_move:"touchmove",_end:"touchend",_click:"touchend",_leave:"touchleave",_enter:"touchmove",_mousewheel:"mousewheel",_over:"touchover"}:{_down:"mousedown",_move:"mousemove",_end:"mouseup",_click:"click",_leave:"mouseleave",_enter:"mouseenter",_mousewheel:"mousewheel",_over:"mouseover"};
var getPageWidthHeight=function(a,b,c,d){var e=Point(0,0);a/b>c/d?(e.x=c*b/d,e.y=b):(e.x=a,e.y=a*d/c);return e},getWidthHeightByStretch=function(a,b,c,d){return Point(a,b)},getWidthHeightByFill=function(a,b,c,d){var e=Point(0,0);a/b>c/d?(e.x=a,e.y=a*d/c):(e.x=c*b/d,e.y=b);return e},getWidthHeightByFit=function(a,b,c,d){var e=Point(0,0);a/b>c/d?(e.x=c*b/d,e.y=b):(e.x=a,e.y=a*d/c);return e},getAliasValue=function(a){a=bookConfig[a];if(a instanceof Array)for(;0<a.length;)return(a=a[0])?bookConfig[a]:
void 0;else return a},getString=function(a,b){return getAliasValue(a)||b},getPageDir=function(a,b,c){if(0>=a||void 0!=c&&a>c)return"";if(bookConfig.getPageURL){var d=0;"normal"==b&&(d=1);"thumb"==b&&(d=2);return bookConfig.getPageURL(a,d)}c=global.fliphtml5_pages;if(void 0!=c&&0<c.length){c=c[a-1];if(void 0!=c&&null!=c)switch(b){case "normal":d=void 0==c.n?c.l:c.n;break;case "large":d=c.l;break;case "thumb":d=c.t}if(void 0==d)switch(b){case "normal":return d=getString("normalPath","files/page/")+
a+".jpg";case "large":return d=getString("largePath","files/large/")+a+".jpg";case "thumb":return d=getString("thumbPath","files/thumbnail/")+a+".jpg"}return void 0==d?"":d}switch(b){case "normal":return d=getString("normalPath","files/page/")+a+".jpg",void 0==d?"":d;case "large":return d=getString("largePath","files/large/")+a+".jpg",void 0==d?"":d;case "thumb":return d=getString("thumbPath","files/thumbnail/")+a+".jpg",void 0==d?"":d}},Point=function(a,b){return{x:a,y:b,isNearTo:function(a,b){void 0==
b&&(b=5);return Math.abs(this.x-a.x)<b&&Math.abs(this.y-a.y)<b},equals:function(a){return this.x==a.x&&this.y==a.y},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)};var totalPageCount=bookConfig.totalPageCount;
jQuery(document).ready(function(){initWindow();if(isTouchDevice())$(window).on("orientationchange",function(){window.setTimeout(onStageResize,200)});$(window).resize(onStageResize);$.system.name==$.system.IOS&&8.2<=$.system.version&&window.setInterval(function(){windowHeight!=window.innerHeight&&(windowHeight=window.innerHeight,onStageResize())},1E3);bookConfig.googleAnalyticsID&&(function(a,b,c,d,e,f,h){a.GoogleAnalyticsObject=e;a[e]=a[e]||function(){(a[e].q=a[e].q||[]).push(arguments)};a[e].l=1*
new Date;f=b.createElement(c);h=b.getElementsByTagName(c)[0];f.async=1;f.src=d;h.parentNode.insertBefore(f,h)}(window,document,"script","//www.google-analytics.com/analytics.js","ga"),eval("ga('create', '"+bookConfig.googleAnalyticsID+"', 'auto')"),eval("ga('send', 'pageview')"))});function equals(a,b){return"number"==typeof a&&"number"==typeof b?1E-6>Math.abs(a-b):a+""==b+""}
(function(a){a.fn.addCssSprite=function(b,c,d,e,f){var h=a("<div></div>");h.css({width:d+"px",height:e+"px"});h.cssSprite(b,c,d,e,f);this.append(h)};a.fn.changeCssSprite=function(a,c,d,e,f){this.children().cssSprite(a,c,d,e,f)};a.fn.cssSprite=function(a,c,d,e,f){if(f.iconInfo){for(var h=0,g=0;g<f.iconInfo.length;g++)if(f.iconInfo[g].id==c){h=g;break}c=f.iconInfo[h].position;var g="",g=f.width,k=f.height,m=0,l=0,m=d*g/f.iconInfo[h].width,l=e*k/f.iconInfo[h].height;c=-c.x*m/g+"px "+-c.y*l/k+"px";g=
m+"px "+l+"px";this.css({"background-image":"url("+a+")","background-repeat":"no-repeat","background-position":c,"-webkit-background-size":g,"-o-background-size":g,"background-size":g})}}})(jQuery);var __extends=this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype;a.prototype=new c},__expands=this.__expands||function(a,b){for(var c in b)a.prototype[c]||(a.prototype[c]=b[c])};
Function.prototype.interval=function(a,b,c){"object"!==typeof a&&(c=b,b=a,a={});b=b||1;c=c||[];var d=this;return{intervalId:setInterval(function(){this.apply(a,c)}.bind(this),b),stop:function(){clearInterval(this.intervalId);this.intervalId=void 0},isRunning:function(){return void 0!=this.intervalId},start:function(){this.intervalId=setInterval(function(){d.apply(a,c)},b)}}};
__expands(String,{trim:function(){return this.replace(/(^\s*)|(\s*$)/g,"")},replaceAll:function(a,b,c){void 0==c&&(c=!1);if(RegExp&&!c)return this.replace(RegExp(a,"g"),b);var d=this.indexOf(a);c=[];for(var e=this;-1!=d;){var d=d+a.length,f=e.substring(0,d),e=e.substring(d),f=f.replace(a,b);c.push(f);d=e.indexOf(a)}""!==e&&c.push(e);return c.join("")},subBetween:function(a,b){if(void 0==a||void 0==b)return"";var c=this.length,d=this.indexOf(a);if(-1==d)return"";d+=a.length;c=this.substring(d,c).indexOf(b);
return-1==c?"":this.substring(d,c+d)},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(a){a||(a="");return this.split(a)},reverse:function(){var a=
this.split("");a.reverse();return a.join("")},equals:function(a){return this.trim()==a.trim()},equalsIgnoreCase:function(a){return this.toLowerCase().trim()==a.toLowerCase().trim()},startWith:function(a){return""===a?!1:this.substr(0,a.length)===a},endWith:function(a){return""===a?!1:this.substr(-a.length,a.length)===a},isEnglish:function(){return/[\x00-\xff]/.test(this)},overflow:function(a){if(void 0==a)return this.toString();var b=2;/[^\x00-\xff]/.test(this)&&(a=Math.floor(a/2),b=Math.floor(b/
2));return this.length-a>b?this.substr(0,a)+"...":this.toString()},extract:function(){if(0==this.length||0==arguments.length)return[];for(var a=[],b=this.toString(),c=0;c<b.length;){for(var d=!1,e=0;e<arguments.length;e++){var f=arguments[e];if(b.substr(c,f.length)==f){a.push(f);c+=f.length;d=!0;break}}d||c++}return a},remove:function(a){if("string"==typeof a){var b=this.indexOf(a);if(!(0>b))return a=a.length,this.substring(0,b)+this.substring(b+a,this.length)}},cycle:function(a){if(!isNaN(a)){for(var b=
parseInt(a/this.length),c=this;0<b;)c+=this,b--;return c.substring(0,a)}},statics:{format:function(){if(0==arguments.length)return"";if(1==arguments.length)return arguments[0];for(var a=arguments[0],b=a.extract("%s","%d","%f"),c=1;c<arguments.length;c++){var d=arguments[c],e=b[c-1];"%s"==e&&("string"==typeof d?a=a.replace("%s",d):a=a.replace("%s",""));if("%d"==e){isNaN(d)&&(d=0);var f;f="number"==typeof d?-1==Number(d).toString().indexOf("."):!1;f?a=a.replace("%d",d+""):a=a.replace("%d","")}"%f"==
e&&(isNaN(d)&&(d=0),"number"==typeof d?a=a.replace("%f",d+""):a=a.replace("%f",""))}return a}}});
var getConfigValue=function(a,b){try{if(!aliasConfig)return b;var c=aliasConfig[a];if(!c)return b;for(var d=0;d<c.length;d++){var e=c[d];if(bookConfig[e])return bookConfig[e]}return b}catch(f){return b}},checkBookConfig=function(){void 0==bookConfig.loadingBackground&&(bookConfig.loadingBackground=getConfigValue("loadingBackground","#1F2232"));void 0==bookConfig.loadingCaption&&(bookConfig.loadingCaption=getConfigValue("loadingCaption","Loading"));void 0==bookConfig.loadingCaptionColor&&(bookConfig.loadingCaptionColor=
getConfigValue("loadingCaptionColor","#DDDDDD"));void 0==bookConfig.SearchButtonVisible&&(bookConfig.SearchButtonVisible=getConfigValue("SearchButtonVisible","hide"));void 0==bookConfig.TableOfContentButtonVisible&&(bookConfig.TableOfContentButtonVisible=getConfigValue("TableOfContentButtonVisible","hide"));void 0==bookConfig.AboutButtonVisible&&(bookConfig.AboutButtonVisible=getConfigValue("AboutButtonVisible","hide"));void 0==bookConfig.ThumbnailsButtonVisible&&(bookConfig.ThumbnailsButtonVisible=
getConfigValue("ThumbnailsButtonVisible","hide"));void 0==bookConfig.ShareButtonVisible&&(bookConfig.ShareButtonVisible=getConfigValue("ShareButtonVisible","hide"));void 0==bookConfig.AboutAddress&&(bookConfig.AboutAddress=getConfigValue("AboutAddress",""));void 0==bookConfig.AboutEmail&&(bookConfig.AboutEmail=getConfigValue("AboutEmail",""));void 0==bookConfig.AboutMobile&&(bookConfig.AboutMobile=getConfigValue("AboutMobile",""));void 0==bookConfig.AboutWebsite&&(bookConfig.AboutWebsite=getConfigValue("AboutWebsite",
""));void 0==bookConfig.AboutDescription&&(bookConfig.AboutDescription=getConfigValue("AboutDescription",""));if(void 0==bookConfig.AboutAuthor||""==bookConfig.AboutAuthor)bookConfig.AboutAuthor=getConfigValue("AboutAuthor","");if(void 0==bookConfig.CompanyLogoFile||""==bookConfig.CompanyLogoFile)bookConfig.CompanyLogoFile=getConfigValue("CompanyLogoFile","");if(void 0==bookConfig.bookDescription||""==bookConfig.bookDescription)bookConfig.bookDescription=getConfigValue("bookDescription","bookDescription");
if(void 0==bookConfig.leastSearchChar||""==bookConfig.leastSearchChar)bookConfig.leastSearchChar=getConfigValue("leastSearchChar",3);if(void 0==bookConfig.searchTextJS||""==bookConfig.searchTextJS)bookConfig.searchTextJS=getConfigValue("searchTextJS","files/search/book_config.js")};var KMP=function(a,b){this.__string=a;this.__pattern=b;this.__next=[];this.__times=0;this.__index=-1;for(var c=0,c=0;c<b.length;c++)this.__next[c]=1>=c?c-1:this.next(b.substring(0,c));this.__times=0;this.__index=-1};KMP.prototype.next=function(a){for(var b=Math.ceil(a.length/2);0<b&&0!=a.substring(0,b).compareTo(a.substring(a.length-b,a.length));)b--;return b};
KMP.prototype.match=function(){for(var a=0,b=0,c=-1;a<this.__string.length&&b<this.__pattern.length;){if(this.__string.charAt(a)==this.__pattern.charAt(b))0===b&&(c=a),a++,b++;else{for(var d=this.__next[b];-1!=d&&this.__pattern.charAt(d)==this.__pattern.charAt(b);)d=this.__next[d];b=d;-1==b?(a++,b=0):c=a-b}this.__times++}return b==this.__pattern.length?(this.__index=c,!0):!1};KMP.prototype.getTimes=function(){return this.__times};KMP.prototype.getIndex=function(){return this.__index};
String.prototype.compareTo=function(a){var b=this.length,c=a.length,d=Math.min(b,c),e=this.split("");a=a.split("");var f=0,h=0;if(f==h)for(h=f,d+=f;h<d;){var g=e[h],k=a[h];if(g!=k)return g-k;h++}else for(;0!=d--;)if(g=e[f++],k=a[h++],g!=k)return g-k;return b-c};function searchFromPages(a,b){var c=[];b=b.trim().toLowerCase();for(var d=null,d=-1==b.indexOf(" ")?[b]:b.split(" "),e=0,e=0;e<a.length;e++){var f=a[e].trim().toLowerCase(),h=f,g=-1,k=-1,m=-1,l=0,n=!0,p;for(p=0;p<d.length;p++){var h=new KMP(h,d[p]),r=d[p].length;if(h.match()){var q=l+h.getIndex();if(q>m)m=q,l=q+d[p].length,h=f.substring(l),0==p&&(g=q),p==d.length-1&&(k=q+r);else{n=!1;break}}else{n=!1;break}}n&&(m=[],m.search_page=e+1,m.search_title="page "+(e+1),g=f.substring(0,g).lastIndexOf("."),
-1==g?g=0:g++,l=f.substring(k),n=l.indexOf(".")+1,n=-1==n?l.length():k+n,f=f.substring(g,n),m.search_text=f,c.push(m))}return c};function Table(a,b){this.create(a,b)}
Table.prototype={create:function(a,b,c){this.table=$("<div class='table' id='"+a+"'></div>");this.title=$("<div class='tableTitle' id='tableTitle'></div>");a=$("<div class='decoration icon_decoration css_sprite1' id='decoration'></div>");var d=$("<span class='tmpTitle'>"+c+"</span>");c=$("<div class='title'></div>");var e=$("<div class='close'><div class='icon_close css_sprite1'></div></div>");e.bind(_event._end,function(){this.hide()}.bind(this));this.container=$("<div class='container scrollbar'></div>");
c.append(d);c.append(e);this.title.append(a);this.title.append(c);this.table.append(this.container);this.table.append(this.title);b.append(this.table);this.table.bind(_event._move,function(a){a.stopPropagation()})},show:function(){this.ifShow||(this.table.removeClass("hideTable"),this.table.addClass("showTable"),this.showFunc&&this.showFunc(),this.ifShow=!0)},hide:function(){this.ifShow&&(this.table.removeClass("showTable"),this.table.addClass("hideTable"),this.hideFunc&&this.hideFunc(),this.ifShow=
!1)},initContainer:function(a){a&&this.container.append(a)},getContainer:function(){return this.container},setContainerStyle:function(a){this.container.css(a)},getContainerWidth:function(){return parseInt(this.container.width())},getContainerHeight:function(){return parseInt(this.container.height())}};__extends(TableOfContent,Table);function TableOfContent(a,b){this.create(a,b,getLanguage("frmToc","Table Of Content"));this.initContainer(this.initTableOfContent())}
__expands(TableOfContent,{initTableOfContent:function(){this.itemBox=$("<div class='tableOfContent'></div>");this.tableArray=[];this.scrollBottomTest();this.addItems(ols);return this.itemBox},addItems:function(a){this.contanierHeight=this.getContainerHeight();this.itemHeight=50;this.visualCount=parseInt(this.contanierHeight/this.itemHeight)+1;this.itemCount=a.length;var b=this.tableArray.length,c=Math.min(b+this.visualCount,this.itemCount);b>=this.itemCount||(this.timeout=window.setTimeout(function(){this.addContent(ols,
!1,null,b,c)}.bind(this),100))},scrollBottomTest:function(){var a=this;this.getContainer().on("scroll",function(){$(this);var b=$(this).height(),c=$(this).get(0).scrollHeight;0.95<=$(this).scrollTop()/(c-b)&&a.addItems(ols)})},addContent:function(a,b,c,d,e){for(;d<e;d++){var f=new TreeNode(a[d],this.itemBox);b||(this.tableArray.push(f),f.appendToParent());b&&(c.addChildren(f),f.setVisible(!1),f.setBacGray(!0));1<=a[d].children.length?(f.setButtonVisible(!0),f.setHasChildren(!0),this.addContent(a[d].children,
!0,f,0,a[d].children.length)):(f.setButtonVisible(!1),f.bookMarkEnter())}}});
function TreeNode(a,b){var c=this;this.children=[];this.opened=this.hasChild=!1;this.parent=b;this.background=$("<div class='item closed'></div>");var d=$("<p class='title'>P:"+parseInt(a.page)+"</p>"),e=$("<p class='description'>"+a.caption.HTMLLabel2Text()+"</p>");this.background.append(d);this.background.append(e);this.background.css({"padding-left":20*Math.max(a.level,0)+"px"});this.expandButton=$("<div class='expandButton'></div>");d=$("<div class='expand icon_expand css_sprite1'></div>");e=
$("<div class='collapse icon_collapse css_sprite1'></div>");this.expandButton.append(d);this.expandButton.append(e);this.expandButton.bind("click",this.onExpand.bind(this));this.background.bind("click",function(){$(".clicked").removeClass("clicked");$(this).addClass("clicked");gotoPageFun(a.page);c.hide();return!1})}
TreeNode.prototype={appendToParent:function(){this.appendToDom=!0;this.parent.append(this.background)},setBacGray:function(a){a&&$(this.background).addClass("notLevel0")},setButtonVisible:function(a){a&&this.background.append(this.expandButton)},setHasChildren:function(a){this.hasChild=a},setVisible:function(a){$(this.background).css({display:a?"block":"none"})},getIsExpand:function(){return this.opened},setIsExpand:function(a){this.opened=a},expand:function(){if(this.hasChild){this.background.removeClass("closed");
this.background.addClass("open");for(var a=this.children.length-1;0<=a;a--)this.children[a].setVisible(!0),this.children[a].getIsExpand()?this.children[a].expand():this.children[a].bookMarkEnter(),this.children[a].appendToDom||(this.children[a].background.insertAfter(this.background),this.appendToDom=!0)}},bookMarkEnter:function(){},collapse:function(){if(this.hasChild){this.background.removeClass("open");this.background.addClass("closed");for(var a=0;a<this.children.length;a++)this.children[a].setVisible(!1),
this.children[a].collapse()}},onExpand:function(){this.opened?this.collapse():this.expand();this.opened=!this.opened;return!1},addChildren:function(a){this.children.push(a)},getPageIndex:function(){return this.config.page}};__extends(About,Table);function About(a,b){this.create(a,b,getLanguage("btnAbout","About"));this.initContainer(this.initAbout());this.setContainerStyle({background:"#EFEFF4"})}
__expands(About,{initAbout:function(){this.itemBox=$("<div class='about'></div>");this.initTitle();this.initAboutUs();this.initTel();this.initEmail();this.initAdress();return this.itemBox},initTitle:function(){this.title=$("<div class='item clearfix'></div>");var a=$("<img/>"),b=$("<div class='font20 fontBlack'></div>"),c=$("<a target='_blank' href='"+bookConfig.AboutWebsite+"'></a>");a.attr("src",bookConfig.CompanyLogoFile);b.html(bookConfig.AboutAuthor);c.html(bookConfig.AboutWebsite);this.title.append(a);
this.title.append(b);this.title.append(c);this.itemBox.append(this.title)},initAboutUs:function(){this.title=$("<div class='item clearfix'></div>");var a=$("<span class='fontBlack title'></span>"),b=$("<div></div>");a.html(getLanguage("frmaboutDESCRIPTION","About us"));b.html(bookConfig.AboutDescription);this.title.append(a);this.title.append(b);this.itemBox.append(this.title)},initTel:function(){this.title=$("<div class='item clearfix'></div>");var a=$("<span class='fontBlack  title'></span>"),b=
$("<a href='tel:"+bookConfig.AboutMobile+"'></a>");a.html(getLanguage("frmaboutMOBILE","Tel"));b.html(bookConfig.AboutMobile);this.title.append(a);this.title.append(b);this.itemBox.append(this.title)},initEmail:function(){this.title=$("<div class='item clearfix'></div>");var a=$("<span class='fontBlack  title'></span>"),b=$("<a href='mailto:"+bookConfig.AboutEmail+"'></a>");a.html(getLanguage("frmaboutEMAIL","Email"));b.html(bookConfig.AboutEmail);this.title.append(a);this.title.append(b);this.itemBox.append(this.title)},
initAdress:function(){this.title=$("<div class='item clearfix'></div>");var a=$("<span class='fontBlack  title'></span>"),b=$("<div> 90 Cannon Street, London EC4N 6HA</div>");a.html(getLanguage("frmaboutADDRESS","Address"));b.html(bookConfig.AboutAddress);this.title.append(a);this.title.append(b);this.itemBox.append(this.title)}});__extends(Share,Table);function Share(a,b){this.create(a,b,getLanguage("btnSocialShare","Share"));this.initContainer(this.initShare())}
__expands(Share,{initShare:function(){this.itemBox=$("<div class='share' id='share'></div>");this.initQrcode();this.initShareCopy();this.shareObj();this.initShareButton();return this.itemBox},initQrcode:function(){var a=$("<div class='qrcode'></div>");jQuery(a).qrcode({width:150,height:150,correctLevel:0,text:"http://www.baidu.com"});this.itemBox.append(a)},initShareCopy:function(){var a=$("<input type='text' value='"+window.location.href+"'/>"),b=$("<span class='copy'>Copy</span>");b.bind(_event._end,
function(){copyToClipboard(a.val())});this.itemBox.append(a);this.itemBox.append(b)},initShareButton:function(){for(var a=$("<p class='itemBox'></p>"),b=0;b<this.shareLink.length;b++){var c=this.shareLink[b].url,d=$("<div class='item icon_"+this.shareLink[b].name+" css_sprite1'></div>");a.append($("<a href='"+c+"' target='_blank'></a>").append(d))}this.itemBox.append(a)},shareObj:function(){var a=window.location.href,b=window.document.title,c=a.substring(0,a.lastIndexOf("/"))+"/"+bookConfig.thumbPath+
"1.jpg",d=bookConfig.bookDescription,e="?&url="+a+"&title="+b+"&description="+d+"&screenshot="+c;this.shareLink=[{name:"facebook",url:"https://www.facebook.com/dialog/share?app_id=759223277462081"+("?&href="+a+"&title="+b+"&description="+d+"&picture="+c)},{name:"twitter",url:"http://api.addthis.com/oexchange/0.8/forward/twitter/offer"+e},{name:"igoogle",url:"http://api.addthis.com/oexchange/0.8/forward/igoogle/offer"+e},{name:"more",url:"http://api.addthis.com/oexchange/0.8/offer"+e}]}});__extends(Thumbnail,Table);function Thumbnail(a,b){this.create(a,b,getLanguage("btnThumb","Thumbnail"));this.initContainer(this.initThumbnail())}
__expands(Thumbnail,{initThumbnail:function(){this.totalPageCount=parseInt(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.itemBox=$("<div style='background-color:#ffffff;text-align:left;display:inline-block;padding:0px 0px "+this.marginLeft+"px 0px;'></div>");this.addItem();this.setHighLight(1);this.onResize();
return this.itemBox},onResize:function(){this.width=this.getContainerWidth();this.height=this.getContainerHeight();this.countHorizatal=parseInt((this.width-this.marginLeft)/(this.itemWidth+this.marginLeft));this.countVertical=parseInt((this.height-this.toolBarHeight-this.marginTop)/(this.itemHeightArray.itemHeight+this.marginTop))+1;this.itemBox.css({width:this.countHorizatal*(this.itemWidth+this.marginLeft)+this.marginLeft});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 a=-this.itemBox.offset().top+50,a=parseInt(a/(this.itemHeightArray.itemHeight+this.marginTop)),b=this.countHorizatal*a,a=b+this.countHorizatal*this.countVertical,a=Math.min(a,this.totalPageCount),b=Math.max(0,b);b<a&&!(1<=this.LoadCount);b++)this.taskList.unShiftList({index:b},function(a){this.fillImage(a.index)}.bind(this))}.interval(this,60)},hideFunc:function(){this.interval&&this.interval.stop()},
showFunc:function(){this.fillContent()},setHighLight:function(a){this.itemArray&&this.itemArray[a-1]&&this.itemArray[a-1].imgContainer&&this.itemArray[a-1].imgContainer.css({"border-color":this.itemBorderColor})},clearHighLight:function(){if(this.itemArray)for(var a=this.itemArray.length,b=0;b<a;b++)this.itemArray[b].imgContainer&&this.itemArray[b].imgContainer.css({"border-color":"transparent"})},fissionAll:function(){},mergeAll:function(){},showOrHide:function(){this.show?this.hideBox():this.showshow()},
addItem:function(){for(var a=0;a<this.totalPageCount;a++){var b=this.initItem(a);this.itemBox.append(b.item);this.itemArray.push(b)}},getHeightArray:function(){var a=(this.itemWidth-2*this.itemBorderWidth)*bookConfig.largePageHeight/bookConfig.largePageWidth;return{imageHeight:a,titleHeight:10,itemHeight:a+10+4*this.itemBorderWidth}},initItem:function(a){var b=$("<div style='display:inline-block;'></div>"),c=$("<p><span>P:"+(a+1)+"</span></p>"),d=$("<div></div>"),e=$("<img/>");b.css({cursor:"pointer",
width:this.itemWidth,height:this.itemHeightArray.itemHeight,margin:this.marginTop+"px 0px 0px "+this.marginLeft+"px","text-align":"center"});d.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"});e.css({width:"100%",height:"100%","background-color":"#ffffff","background-image":"url("+uiBaseURL+"style/icon/loading.gif)","background-repeat":"no-repeat",
"background-position":"center"});c.css({width:this.itemWidth-2*this.itemBorderWidth,height:this.itemHeightArray.titleHeight+"px","line-height":this.itemHeightArray.titleHeight+"px","vertical-align":"middle",color:"#000000","font-family":"Arial","font-size":this.itemHeightArray.titleHeight+"px",padding:"0px",margin:"0px","font-weight":"bold","border-style":"solid","border-width":this.itemBorderWidth+"px","border-color":"transparent"});b.append(d);b.append(c);d.append(e);b.attr("id",a);b.bind(_event._end,
function(a){a.stopPropagation()}.bind(this));b.bind("click",function(b){gotoPageFun(a+1);this.hide();b.stopPropagation()}.bind(this));return{item:b,imgContainer:d,img:e,title:c,fill:!1}},fillImageOrNot:function(a,b){return a&&"string"==typeof a?!0:!1},fillImage:function(a){if(this.itemArray&&this.itemArray[a]&&!this.itemArray[a].fill&&this.itemArray[a].img){var b=getPageDir(a+1,"thumb",parseInt(bookConfig.totalPageCount));b&&"string"==typeof b&&this.fillImageOrNot(b,a+1)&&(this.LoadCount++,this.itemArray[a].img.attr("src",
b),this.itemArray[a].fill=!0)}}});__extends(Search,Table);function Search(a,b){this.create(a,b,getLanguage("frmSearch","Search"));this.initContainer(this.initSearch());this.scrollBottomTest()}
__expands(Search,{initSearch:function(){this.itemBox=$("<div class='search'></div>");this.initSearchBtn();this.initScrollBox();return this.itemBox},initSearchBtn:function(){var a=$("<div class='input'></div>"),b=$("<span class='searchButton'>"+getLanguage("btnSearch","Search")+"</span>");this.textField=$("<input></input>");var c=$("<div class='tmpBtn icon_searchBtn css_sprite1'></div>");a.append(this.textField);a.append(c);b.bind(_event._end,this.searchStart.bind(this));this.textField.bind("keydown",
function(a){13==a.keyCode&&this.searchStart()}.bind(this));this.resultContent=$("<p class='result'></p>");this.itemBox.append(a);this.itemBox.append(b);this.itemBox.append(this.resultContent)},initScrollBox:function(){this.itemContainer=$("<div class='itemContainer scrollbar'></div>");this.scrollBox=$("<div class='scrollBox'></div>");this.itemContainer.append(this.scrollBox);this.itemBox.append(this.itemContainer)},searchStart:function(){var a=this.textField.val();0<bookConfig.leastSearchChar&&a.length<
bookConfig.leastSearchChar?this.resultContent.html(getLanguage("pnlSearchInputInvalid","The search text is too short.")):a!=this.searchWord&&this.search(a)},doSearch:function(a){this.scrollBox.empty();this.searchWord=a;this.resultContent.html("");this.searchResults=searchFromPages(textForPages,a);this.resultContent.html(getLanguage("lblPages","Search")+" : <span class='fontBlue'>"+this.searchResults.length+"</span>");this.addItems(this.searchResults)},addItems:function(a){this.contanierHeight=this.getContainerHeight()-
78;this.itemHeight=75;this.visualCount=parseInt(this.contanierHeight/this.itemHeight)+1;this.itemCount=a.length;var b=this.searchPageArr.length,c=Math.min(b+this.visualCount,this.itemCount);b>=this.itemCount||(this.timeout=window.setTimeout(function(){for(var d=b;d<c;d++){var e=this.searchItem(a[d]);this.searchPageArr.push(e)}}.bind(this),100))},searchItem:function(a){var b=this;if(a&&a.search_page&&a.search_text){var c=$("<div class='item'></div>"),d=$("<p class='title'>P:"+a.search_page+"</p>"),
e=$("<p class='info'></p>"),f=this.cutText(a.search_text,this.searchWord);e.html(this.riseAWord(f,this.searchWord));c.append(d);c.append(e);c.bind("click",function(){$(".clicked").removeClass("clicked");$(this).addClass("clicked");gotoPageFun(parseInt(a.search_page));b.hide()});this.scrollBox.append(c);return c}},clearItems:function(){this.timeout&&window.clearTimeout(this.timeout);this.resultContent.html("");this.searchWord="";this.textField.val("");this.searchPageArr=[]},search:function(a){this.searchPageArr=
[];this.loadSearchFlag?this.doSearch(a):loadJavascript(bookConfig.searchTextJS,function(){this.loadSearchFlag=!0;this.doSearch(a)}.bind(this),function(){this.loadSearchFlag=!0;textForPages=[]}.bind(this))},closeForm:function(){if(this.isSearchShow){var a=windowWidth/4,a=Math.max(300,a);this.isSearchShow=!1;this.formBackground.animate({left:-a-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 a=$("#preSearch").val();""!=a&&void 0!=a&&(this.textField.val(a),this.search(a))}},scrollBottomTest:function(){var a=this;this.itemContainer.on("scroll",function(){$(this);var b=$(this).height(),c=$(this).get(0).scrollHeight;0.95<=$(this).scrollTop()/(c-b)&&a.addItems(a.searchResults)})},cutText:function(a,b){if(120>a.length||""==b)return a;var c=a.length,d=a.toLowerCase().indexOf(b.toLowerCase()),
e;60<=d?(e=Math.max(60<=c-d?d-60:c-120,0),e=".."+a.substring(e,d)):e=a.substring(0,d);c=60<c-d?a.substring(d,60<=d?d+60:120)+"..":a.substring(d,c);return e+c},riseAWord:function(a,b){-1==a.indexOf(b)&&(b=b.toLowerCase());if(-1!=a.indexOf(b))return a.replaceAll(b,"<font color=#576B95><strong>"+b+"</strong></font>")}});var global=function(){return this||(0,eval)("(this)")}(),Slider=function(){this.create()};
Slider.prototype={create:function(){this.currentIndex=1;this.initPage();this.initArrow();this.initSound();this.initMoreButton();this.initPageNum();this.onResize();this.fillContent();setBackgroundCollor();this.initEvent();this.initFlippingTime();this.autoFlip()},initFlippingTime:function(){this.flippingTime=0.3;bookConfig.flippingTime&&(this.flippingTime=bookConfig.flippingTime)},initPage:function(){this.pageContainer=$("<div id='pageContainer' class='pageContainer'></div>");this.prevPage=$("<div id='page1' class='page prevPage fc-hide'></div>");
this.currentPage=$("<div id='page2' class='page currentPage action'></div>");this.nextPage=$("<div id='page3' class='page nextPage fc-hide'></div>");this.prevPageContent=$("<div id='prevPageContent' class='pageContent'></div>");this.currentPageContent=$("<div id='currentPageContent' class='pageContent'></div>");this.nextPageContent=$("<div id='nextPageContent' class='pageContent'></div>");this.currentPageContent.css({"background-image":"url("+getPageDir(this.currentIndex,"normal",bookConfig.totalPageCount)+
")"});this.prevPageSlider=$("<div id='prevPageSlider' class='pageSlider'></div>");this.currentPageSlider=$("<div id='currentPageSlider' class='pageSlider'></div>");this.nextPageSlider=$("<div id='nextPageSlider' class='pageSlider'></div>");$("body").append(this.pageContainer);this.pageContainer.append(this.prevPage);this.pageContainer.append(this.currentPage);this.pageContainer.append(this.nextPage);this.prevPage.append(this.prevPageContent);this.currentPage.append(this.currentPageContent);this.nextPage.append(this.nextPageContent);
this.prevPage.append(this.prevPageSlider);this.currentPage.append(this.currentPageSlider);this.nextPage.append(this.nextPageSlider)},initPageNum:function(){bookConfig.showPageNumber&&"no"!=bookConfig.showPageNumber.toLowerCase()&&(this.pageNum=$("<p id='pageNum' class='pageNum'><span id='num'></span></p>"),this.pageContainer.append(this.pageNum),this.fillPageNum())},resizePageNumButton:function(){},fillPageNum:function(){this.pageNum&&($("#num").html(this.currentIndex+"/"+totalPageCount),-1<this.pageNumberInterval&&
window.clearInterval(this.pageNumberInterval),this.pageNumberInterval=-1,this.pageNumberAlpaStep=0.1,void 0==this.pageNumberAlpha&&(this.pageNumberAlpha=0),this.pageNumberInterval=window.setInterval(function(){this.pageNumberAlpha+=this.pageNumberAlpaStep;1E-6>this.pageNumberAlpha&&(this.pageNumberAlpha=0);this.pageNum.css({opacity:Math.min(this.pageNumberAlpha,1),"-moz-opacity":Math.min(this.pageNumberAlpha,1),filter:"alpha(opacity="+100*Math.min(this.pageNumberAlpha,1)+")"});1.1<=this.pageNumberAlpha&&
(this.pageNumberAlpaStep=-0.1);equals(this.pageNumberAlpha,0)&&(window.clearInterval(this.pageNumberInterval),this.pageNumberInterval=-1,this.pageNumberAlpaStep=0.1)}.bind(this),100))},initArrow:function(){this.arrow=$("<p class='arrowBac icon_arrow css_sprite1'></p>");this.pageContainer.append(this.arrow)},resizeArrowButton:function(){this.arrow&&(this.height>this.sliderHeight?this.arrow.css({bottom:(this.height-this.sliderHeight)/2+30+"px"}):this.arrow.css({bottom:"30px"}))},initSoundButton:function(){this.soundButton=
$("<div id='soundButton' class='buttonBack open'></div>");var a=$("<div id='tmpSound' class='button'></div>"),b=$("<div id='closeSound' class='button_c icon_sound_close css_sprite1'></div>"),c=$("<div id='openSound' class='button_c icon_sound_open css_sprite1'></div>");this.soundButton.append(a);a.append(c);a.append(b);this.pageContainer.append(this.soundButton)},resizeSoundButton:function(){},initMoreButton:function(){if(parseBool(bookConfig.SearchButtonVisible)||parseBool(bookConfig.TableOfContentButtonVisible)||
parseBool(bookConfig.ShareButtonVisible)||parseBool(bookConfig.AboutButtonVisible)||parseBool(bookConfig.ThumbnailsButtonVisible)){this.moreButton=$("<div id='moreButton' class='buttonBack moreButton open'></div>");var a=$("<div id='tmpMore' class='button'></div>"),b=$("<div id='closeMore' class='button_c icon_more_close css_sprite1'></div>"),c=$("<div id='openMore' class='button_c icon_more_open css_sprite1'></div>");this.moreButton.append(a);a.append(c);a.append(b);this.pageContainer.append(this.moreButton);
this.playingMore=!1;this.createMorePannel()}},resizeMoreButton:function(){this.moreButton&&(this.soundOn()||(this.moreButton.css({top:"12px"}),this.morePannelContainer.css({"margin-top":"72px"})),this.resizeMenuItem())},resizeMenuItem:function(){if(this.itemArray){var a=Math.min(this.width,424),b=parseInt((a-24-40-216)/2);320>a&&(b=parseInt(a-24-40-144));228>a&&(b=0);for(var c=0;c<this.itemArray.length;c++){var d=this.itemArray[c];320<=a&&(2!=c%3?d.css({"margin-right":b+"px"}):d.css({"margin-right":"0px"}));
320>a&&228<=a&&(1!=c%2?d.css({"margin-right":b+"px"}):d.css({"margin-right":"0px"}))}}},createMorePannel:function(){this.morePannel=$("<div class='morePannel' id='morePannel'></div>");this.morePannelContainer=$("<div class='morePannelContainer' id='morePannelContainer'></div>");var a=[];this.itemArray=[];parseBool(bookConfig.SearchButtonVisible)&&a.push(["Search","search","search"]);parseBool(bookConfig.ShareButtonVisible)&&a.push(["Share","share","share"]);parseBool(bookConfig.TableOfContentButtonVisible)&&
a.push(["TableOfContent","tableOfContent","tableOfContent"]);parseBool(bookConfig.AboutButtonVisible)&&a.push(["About","about","about"]);parseBool(bookConfig.ThumbnailsButtonVisible)&&a.push(["Thumbnail","thumbnail","thumbnail"]);for(var b=0;b<a.length;b++){var c=$("<div class='moreItemButton icon_"+a[b][2]+" css_sprite1'></div>");c.attr("event_class",a[b][0]);c.attr("event_obj",a[b][1]);window[a[b][1]]||(window[a[b][1]]=new window[a[b][0]](a[b][1],this.pageContainer));if(!window[a[b][0]])return;
c.bind("click",function(){if(window[$(this).attr("event_obj")]){var a=window[$(this).attr("event_obj")];window.setTimeout(function(){a.show()},30)}});this.morePannelContainer.append(c);this.itemArray.push(c)}this.resizeMenuItem();this.morePannelContainer.append($("<span></span>"));this.morePannel.append(this.morePannelContainer);this.pageContainer.append(this.morePannel)},initSound:function(){if(this.soundOn()){var a=this.getSoundURL();a&&(this.soundAudio=$("<audio id='BGSound' autoplay loop preload><source src='"+
a[0]+"' type='audio/mp3'><source src='"+a[1]+"' type='audio/ogg'></audio>"),$("body").append(this.soundAudio),this.soundAudio[0].play(),this.playingSound=!0,this.initSoundButton())}},getSoundURL:function(){if(this.soundOn()){var a=bookConfig.BackgroundSoundURL,b=a.length,c=a.substring(0,b-3)+"mp3",a=a.substring(0,b-3)+"ogg";return[c,a]}},soundOn:function(){return bookConfig.BackgroundSoundButtonVisible&&bookConfig.BackgroundSoundURL?"show"==bookConfig.BackgroundSoundButtonVisible.toLowerCase()&&""!=
bookConfig.BackgroundSoundURL?!0:!1:!1},openOrClose:function(a){if(this["playing"+a])this["close"+a]();else this["play"+a]()},closeMore:function(){this.playingMore&&(this.moreButton.removeClass("close"),this.moreButton.addClass("open"),this.morePannel.removeClass("openMorePannel"),this.morePannel.addClass("closeMorePannel"),window.setTimeout(function(){this.morePannel.hide();this.playingMore=!1}.bind(this),800))},playMore:function(){this.playingMore||(this.morePannel.show(),this.moreButton.removeClass("open"),
this.moreButton.addClass("close"),this.morePannel.addClass("openMorePannel"),this.morePannel.removeClass("closeMorePannel"),this.playingMore=!0)},closeSound:function(){this.soundButton.removeClass("open");this.soundButton.addClass("close");this.soundAudio[0].pause();this.playingSound=!1},playSound:function(){this.soundButton.removeClass("close");this.soundButton.addClass("open");this.soundAudio[0].play();this.playingSound=!0},initEvent:function(){this.soundButton&&this.soundButton.bind(_event._end,
function(){this.openOrClose("Sound")}.bind(this));this.moreButton&&this.moreButton.bind(_event._end,function(){this.openOrClose("More")}.bind(this));this.document=$(document);this.document.bind(_event._down,function(a){if(!this.permitFingleFun()||this.flipping||this.mouseDown)return!0;a=isTouchDevice()?a.originalEvent.touches:[a];this.flip="";this.mouseDown=!0;this.downPoint=new Point(a[0].pageX,a[0].pageY)}.bind(this));this.document.bind(_event._move,function(a){if(!this.permitFingleFun()||!this.mouseDown||
!this.downPoint||this.flipping)return!1;a=isTouchDevice()?a.originalEvent.touches:[a];this.moveToPage(this.downPoint.y-a[0].pageY);return!1}.bind(this));this.document.bind(_event._end,function(a){if(!this.permitFingleFun()||!this.mouseDown)return!0;this.mouseDown=!1;if(!this.downPoint||this.flipping||"next"!=this.flip&&"prev"!=this.flip)return!0;this.fingleFlip=!0;"next"==this.flip&&this.flippingTo(this.currentIndex%totalPageCount+1);"prev"==this.flip&&this.flippingTo((this.currentIndex-2+totalPageCount)%
totalPageCount+1);this.resetPage()}.bind(this))},onResize:function(){windowWidth=$("body").width();windowHeight=$("body").height();var a=this.getPageWidthHeight();this.width=Math.min(a.x,windowWidth);this.height=windowHeight;var b=getWidthHeightByFit(Math.min(a.x,windowWidth),Math.min(a.y,windowHeight),bookConfig.largePageWidth,bookConfig.largePageHeight);this.sliderWidth=Math.min(b.x,windowWidth);this.sliderHeight=Math.min(b.y,windowHeight);this.resizeSlider(this.width,this.height);this.pageContainer.css({width:this.width+
"px",height:this.height,left:(windowWidth-this.width)/2+"px",top:(windowHeight-this.height)/2+"px"});$(".pageSlider").css({width:this.sliderWidth+"px",height:this.sliderHeight,left:(this.width-this.sliderWidth)/2+"px",top:(this.height-this.sliderHeight)/2+"px"});$(".pageContent").css({width:a.x+"px",height:a.y+"px",left:(this.width-a.x)/2+"px",top:(this.height-a.y)/2+"px"});this.resetPosition();this.resizePageNumButton();this.resizeMoreButton();this.resizeSoundButton();this.resizeSlider(this.sliderWidth,
this.sliderHeight);windowWidth>windowHeight&&(!bookConfig.supportHorizontal||"no"==bookConfig.supportHorizontal.toLowerCase())&&alert("Vertical screen viewing works best.")},getPageWidthHeight:function(){bookConfig.fillScreenMode&&""!=bookConfig.fillScreenMode||(bookConfig.fillScreenMode="fill");var a=bookConfig.fillScreenMode.toLowerCase();windowWidth>windowHeight&&bookConfig.supportHorizontal&&"yes"==bookConfig.supportHorizontal.toLowerCase()&&(a="fit");switch(a){case "stretch":a=getWidthHeightByStretch(windowWidth,
windowHeight,bookConfig.largePageWidth,bookConfig.largePageHeight);break;case "fill":a=getWidthHeightByFill(windowWidth,windowHeight,bookConfig.largePageWidth,bookConfig.largePageHeight);break;case "fit":a=getWidthHeightByFit(windowWidth,windowHeight,bookConfig.largePageWidth,bookConfig.largePageHeight);break;default:a=getWidthHeightByFill(windowWidth,windowHeight,bookConfig.largePageWidth,bookConfig.largePageHeight)}return a},fillContent:function(){this.prevIndex=0>=this.currentIndex-1?totalPageCount:
this.currentIndex-1;this.nextIndex=this.currentIndex+1>totalPageCount?1:this.currentIndex+1;this.prevPage.children("div:first").css({"background-image":"url("+getPageDir(this.prevIndex,"normal",bookConfig.totalPageCount)+")"});this.nextPage.children("div:first").css({"background-image":"url("+getPageDir(this.nextIndex,"normal",bookConfig.totalPageCount)+")"});null!=this.slider&&(this.slider.destroy(),this.slider=null);this.initSlider()},slider:null,playSliderAfterLoad:!1,preventMMBackEvent:function(){document.body.ondragstart=
function(){return!1};$(this.currentPage.children(".pageSlider")).on(_event._down,".hi-action",function(a){a.stopPropagation()});$(this.currentPage.children(".pageSlider")).on(_event._end,".hi-action",function(a){a.stopPropagation()});$(this.currentPage.children(".pageSlider")).on(_event._down,".slider-action",function(a){a.stopPropagation()});$(this.currentPage.children(".pageSlider")).on(_event._end,".slider-action",function(a){a.stopPropagation()})},initSlider:function(){if(window.hiSliderFactory){var a=
(global.sliderJS||[])[this.currentIndex-1];a&&0<a.elements.length&&(this.slider=window.hiSliderFactory({container:this.currentPage.children(".pageSlider"),slide:a,initialWidth:this.sliderWidth,initialHeight:this.sliderHeight}),this.slider.resize(this.sliderWidth,this.sliderHeight),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(a){if(void 0!=a&&null!=a){for(var b=!1,c=0;c<a.length;c++)if(a[c]==this.currentIndex){b=!0;break}!0==b?this.playSlider():this.resetSlider()}},resizeSlider:function(a,b){this.slider&&this.slider.resize(a,b)},resetPosition:function(){this.tranNull(this.currentPage);this.tranNull(this.prevPage);this.tranNull(this.nextPage)},afterGotoPage:function(){this.changePage();this.action(this.currentPage);this.hidePage(this.prevPage);this.hidePage(this.nextPage);
this.currentPageContent.empty();this.nextPageContent.empty();this.prevPageContent.empty();this.resetPosition();this.mouseDown=this.flipping=!1;this.fillContent();this.fingleFlip&&bookConfig.stopAutoFlipAfterTouch&&"yes"==bookConfig.stopAutoFlipAfterTouch.toLowerCase()&&this.stopAutoFlip();resizeBookAfterFlip&&!this.flipping&&window.setTimeout(function(){onStageResize()},30)},changePage:function(){this.gotoPage===this.nextPage?(this.nextPage=this.prevPage,this.prevPage=this.currentPage,this.currentPage=
this.gotoPage):this.gotoPage===this.prevPage&&(this.prevPage=this.nextPage,this.nextPage=this.currentPage,this.currentPage=this.gotoPage);this.gotoPage=this.currentPage},tranNull:function(a){a.css({"-webkit-transform":"","-moz-transform":"","-ms-transform":"","-o-transform":""})},translate:function(a,b){var c="translate3d(0px,"+b+"px,0px)";a.css({"-webkit-transform-origin":"50% 0%","-moz-transform-origin":"50% 0%","-ms-transform-origin":"50% 0%","-o-transform-origin":"50% 0%","-webkit-transform":c,
"-moz-transform":c,"-ms-transform":c,"-o-transform":c})},scale:function(a,b,c){b="scale3d("+b+","+b+",1)";a.css({"-webkit-transform-origin":c,"-moz-transform-origin":c,"-ms-transform-origin":c,"-o-transform-origin":c,"-webkit-transform":b,"-moz-transform":b,"-ms-transform":b,"-o-transform":b})},action:function(a){a.removeClass("fc-hide");a.removeClass("fc-scale");a.addClass("action")},hidePage:function(a){a.removeClass("action");a.removeClass("fc-scale");a.addClass("fc-hide")},scalePage:function(a){a.removeClass("action");
a.removeClass("fc-hide");a.addClass("fc-scale")},gotoPageFun:function(a){this.flipping||1>a||a>totalPageCount||a==this.currentIndex||(this.beforeFlipTo(a),this.flippingTo(a),this.moveToPage(15),window.setTimeout(function(){this.flipping||this.resetPage()}.bind(this),50))},beforeFlipTo:function(a){1>a||a>totalPageCount||a==this.currentIndex||(this.currentIndex<a?(this.nextIndex=a,this.nextPage.children("div:first").css({"background-image":"url("+getPageDir(this.nextIndex,"normal",bookConfig.totalPageCount)+
")"})):(this.prevIndex=a,this.prevPage.children("div:first").css({"background-image":"url("+getPageDir(this.prevIndex,"normal",bookConfig.totalPageCount)+")"})))},flippingTo:function(a){1>a||a>totalPageCount||a==this.currentIndex||(this.currentIndex=a,this.fillPageNum())},permitFingleFun:function(){return bookConfig.autoPlayAutoStart&&"no"!=bookConfig.autoPlayAutoStart.toLowerCase()&&bookConfig.allowFlipByTouch&&"yes"!=bookConfig.allowFlipByTouch.toLowerCase()?!1:!0},autoFlip:function(){if(bookConfig.autoPlayAutoStart&&
"no"!=bookConfig.autoPlayAutoStart.toLowerCase()&&bookConfig.autoPlayLoopCount&&0!=parseInt(bookConfig.autoPlayLoopCount)){bookConfig.autoPlayDuration||(bookConfig.autoPlayDuration=5);var a=0,b=parseInt(bookConfig.autoPlayLoopCount);this.autoFlipInterval=window.setInterval(function(){this.gotoPageFun(this.currentIndex%totalPageCount+1);window.setTimeout(function(){-1!=b&&(this.currentIndex==totalPageCount&&a++,b==a&&this.stopAutoFlip())}.bind(this),50)}.bind(this),1E3*bookConfig.autoPlayDuration)}},
stopAutoFlip:function(){this.autoFlipInterval&&(window.clearInterval(this.autoFlipInterval),this.autoFlipInterval=void 0,bookConfig.autoPlayAutoStart="no")}};
var gotoPageFun=function(a){global.phoneSlider.gotoPageFun(a);global.thumbnail&&(thumbnail.clearHighLight(),thumbnail.setHighLight(a))},initWindow=function(){checkBookConfig();$.browser.device==$.browser.DEVICE_PAD?$("html").css({height:window.innerHeight+"px"}):$("html").css({height:"100%"});bookConfig.UIBaseURL||(bookConfig.UIBaseURL="");global.uiBaseURL=bookConfig.UIBaseURL.toString();"string"==typeof uiBaseURL&&"/"!=uiBaseURL.substr(uiBaseURL.length-1,1)&&""!=uiBaseURL&&(uiBaseURL+="/");global.windowWidth=
$("body").width();global.windowHeight=$("body").height();global.phoneSlider=new Slider},setBackgroundCollor=function(){var a=-(parseInt(bookConfig.bgMRotation)%360),b=bookConfig.bgBeginColor,c=bookConfig.bgEndColor;$("body").css({"background-image":"-webkit-linear-gradient("+a+"deg, "+b+", "+c+")","background-image":"-moz-linear-gradient("+a+"deg, "+b+", "+c+")","background-image":"-o-linear-gradient("+a+"deg, "+b+", "+c+")","background-image":"-ms-linear-gradient("+a+"deg, "+b+", "+c+")","background-image":"linear-gradient("+
a+"deg, "+b+", "+c+")"})},resizeBookAfterFlip=!1,onStageResize=function(){resizeBookAfterFlip=!1;if(global.phoneSlider.flipping)resizeBookAfterFlip=!0;else if(global.phoneSlider.onResize(),global.thumbnail)thumbnail.onResize()},Point=function(a,b){return{x:a,y:b}},parseBool=function(a,b){if(!0===a||!1===a)return a;if(void 0==a)return!1;void 0==b&&(b=!1);a=","+a.toLowerCase()+",";return 0>",true,yes,show,enable,".indexOf(a)&&0>",false,no,hide,disable,".indexOf(a)?b:0<=",true,yes,show,enable,".indexOf(a)};Slider.prototype.moveToPage=function(a){0!=a&&(10<a&&!this.flipping?this.flip="next":-10>a&&!this.flipping&&(this.flip="prev"),Math.max(Math.abs(a),0),"next"==this.flip?(this.action(this.nextPage),this.scalePage(this.currentPage),this.scale(this.nextPage,0,"50% 100%"),this.scale(this.currentPage,1,"50% 0%"),this.gotoPage=this.nextPage):"prev"==this.flip&&(this.action(this.prevPage),this.scalePage(this.currentPage),this.scale(this.prevPage,0,"50% 0%"),this.scale(this.currentPage,1,"50% 100%"),this.gotoPage=
this.prevPage))};
Slider.prototype.resetPage=function(){this.flipping=!0;multiAnimateOnce([{obj:this.gotoPage,style:{"-webkit-transform":"scale3d(1,1,1)","-moz-transform":"scale3d(1,1,1)","-ms-transform":"scale3d(1,1,1)","-o-transform":"scale3d(1,1,1)"},time:this.flippingTime,filter:"transform"},{obj:this.currentPage,style:{"-webkit-transform":"scale3d(0,0,1)","-moz-transform":"scale3d(0,0,1)","-ms-transform":"scale3d(0,0,1)","-o-transform":"scale3d(0,0,1)"},time:this.flippingTime,filter:"transform"}],this.afterGotoPage.bind(this))};
