Skip to content. | Skip to navigation

HTML icon — HTML, 1.08 MB (1135337 bytes)

Dateiinhalt

(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(e){}else{var f=this;this.duration=c.max;this.onChange=c.onChange;this.direction=c.direction;var g=b('<div class="slider-total"></div>'),h=b('<div class="slider-range"></div>'),k=b('<div class="slider-handle"></div>');this.append(g);this.append(h);this.append(k);this.setRange=function(b){if(void 0!=b){f.range=b;b=g.offset().left-
f.offset().left;var c=parseInt(h.css("bottom").replace("px","")),d=k.width();if("horizontal"==f.direction){var e=g.width()-d,c=Math.floor(f.range*e/f.duration),c=Math.min(c,e),d=c+d/2;k.css({left:c+b});h.css({width:d})}else e=g.height()-d,b=Math.floor(f.range*e/f.duration),b=Math.min(b,e),d=b+d/2,k.css({bottom:b+c}),h.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 e=0;"horizontal"==
f.direction?(e=d.offsetX,void 0==e&&(e=d.pageX-c.offset().left),e=e/g.width()*f.duration):(e=d.offsetY,void 0==e&&(e=d.pageY-c.offset().top),e=(c.height()-e)/g.height()*f.duration);f.setRange.apply(f,[e]);f.onChange(e);return!1}};g.bind(_event._click,c);h.bind(_event._click,c)}};(this||(0,eval)("(this)")).bdor=[];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 e=0;e<videoThemes.length;e++)videoThemes[e].name==c&&(this.theme=videoThemes[e]);void 0==this.theme&&(this.theme=videoThemes[0]);c=this.find("video:first");var f=c[0];if(void 0!=f&&null!=f){this.addClass("video-player").addClass(this.theme.name);var g=b('<div class="video-controls slider-action"></div>');this.append(g);e=b('<div class="control-border"></div>');g.append(e);var h=b('<div class="video-play"></div>');g.append(h);
e=b('<div class="bevel"></div>');g.append(e);e=function(b){!1==f.paused?f.pause():f.play();stopEvent(b);return!1};c.bind(_event._click,e);h.bind(_event._click,e);c.bind("play",function(){h.addClass("paused-button")});c.bind("pause",function(){h.removeClass("paused-button")});c.bind("ended",function(){h.removeClass("paused-button")});g.playButton=h;var k=b('<div class="video-timer">00:00</div>');g.append(k);c.bind("timeupdate",function(){var b=f.currentTime,c=f.duration;if(0==c||void 0==c)c=100;l.slider({maxValue:c});
l.slider({value:b});k.text(timeFormat(b))});g.videoTimer=k;var l=b('<div class="video-seek"></div>');g.append(l);(function(){var b=f.duration;if(0==b||void 0==b)b=100;l.slider({range:0,max:b,direction:"horizontal",onChange:function(b){try{f.currentTime=b}catch(c){}}});g.show();d.controlbarWidth=g.width()})();g.videoSeek=l;e=b('<div class="bevel"></div>');g.append(e);var n=b('<div class="volume-seek"></div>');g.append(n);this.volume_value=1;n.slider({range:1,max:1,direction:"vertical",onChange:function(b){try{d.volume_value=
b,0==b?(f.muted=!0,q.addClass("volume-mute")):(f.muted=!1,q.removeClass("volume-mute")),f.volume=b}catch(c){}}});g.volumeSeek=n;var q=b('<div class="volume-button"></div>');g.append(q);q.bind(_event._click,function(){!0==f.muted?(f.muted=!1,n.slider({value:d.volume_value}),q.removeClass("volume-mute")):(f.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"})});g.volumeButton=q;var m=b('<div class="player-fullscreen"></div>');g.append(m);m.bind(_event._click,function(){fullScreenApi.supportsFullScreen?fullScreenApi.isFullScreen()?fullScreenApi.cancelFullScreen():fullScreenApi.requestFullScreen(f):f.webkitSupportsFullscreen&&f.webkitEnterFullscreen();return!1});c.bind(fullScreenApi.fullScreenEventName,
function(){fullScreenApi.isFullScreen()?m.addClass("player-exit-fullscreen"):m.removeClass("player-exit-fullscreen")});g.fullscreenButton=m;this.controlbar=g;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 e=d.videoSeek,f=d.volumeSeek,g=d.volumeButton,h=d.fullscreenButton,k=this.width(),l=Math.max(0,k-this.theme.seekWidth);0>=l?e.css({display:"none"}):(e.css({width:l,display:"block"}),
e.slider({value:b.currentTime}));d=g.offset().left-d.offset().left+(g.width()-f.width())/2;k<this.theme.fullscreenWidth?(h.css({display:"none"}),k<this.theme.volumeWidth?(g.css({display:"none"}),f.css({left:"-45px"})):(g.css({display:"block"}),f.css({left:d+"px"}))):(g.css({display:"block"}),h.css({display:"block"}),f.css({left:d+"px"}));!0==b.muted?f.slider({value:0}):f.slider({value:this.volume_value})}};bdor.f="f";b.fn.addAudioSkin=function(c){var d=this;this.theme=void 0;for(var e=0;e<audioThemes.length;e++)audioThemes[e].name==
c&&(this.theme=audioThemes[e]);void 0==this.theme&&(this.theme=audioThemes[0]);c=this.find("audio:first");var f=c[0];if(void 0!=f&&null!=f){this.audioList=[];this.audioIndex=0;if(0==c.children("source").length)e=c.attr("src"),""!=e&&void 0!=e&&this.audioList.push(c.attr("src"));else for(e=0;e<c.children("source").length;e++){var g=c.children("source")[e];this.audioList.push(g.src)}if(this.audioResources.length>this.audioList.length)for(this.audioList=[],e=0;e<this.audioResources.length;e++)this.audioList.push(this.audioResources[e]);
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==f.paused?f.pause():f.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&&h()});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];f.src=c;d.audio_name.text(l(c));f.play();stopEvent(b);return!1}});this.forward_btn=b('<div class="forward_button slider-action"></div>');this.append(this.forward_btn);var h=function(b){if(0!=d.audioList.length){d.audioIndex++;d.audioIndex%=d.audioList.length;
var c=d.audioList[d.audioIndex];f.src=c;d.audio_name.text(l(c));f.play();stopEvent(b);return!1}};this.forward_btn.bind(_event._click,h);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?(f.muted=!0,d.volume_btn.addClass("volume-mute")):(f.muted=!1,d.volume_btn.removeClass("volume-mute")),f.volume=b}catch(c){}}});
this.volume_btn=b('<div class="volume-button slider-action"></div>');this.append(this.volume_btn);var k=function(b){d.volume_value=f.volume+b;d.volume_value=Math.max(0,d.volume_value);d.volume_value=Math.min(1,d.volume_value);f.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(){k(0.1)});this.volume_down_btn.bind(_event._click,
function(){k(-0.1)});this.append(this.volume_up_btn);this.append(this.volume_down_btn);this.volume_btn.bind(_event._click,function(b){!0==f.muted?(f.muted=!1,d.volume_seek.slider({value:d.volume_value}),d.volume_btn.removeClass("volume-mute")):(f.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=f.currentTime,c=f.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=f.duration;if(0==b||void 0==b)b=100;d.audio_seek.slider({range:0,max:b,direction:"horizontal",onChange:function(b){try{f.currentTime=b}catch(c){}}});d.resizeAudioSkin()})();this.audio_name=b('<div class="audio-file"></div>');this.append(this.audio_name);e="";0<this.audioList.length&&
(e=this.audioList[0]);var l=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(l(e));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"}],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 e(b,c){var d=(b[0]||0)-(c[0]||0);return 0<d||!d&&0<b.length&&e(b.slice(1),c.slice(1))}function f(b){if(typeof b!=h)return b;var c=[],d="",e;for(e in b)d=typeof b[e]==h?f(b[e]):[e,k?encodeURI(b[e]):b[e]].join("="),c.push(d);return c.join("&")}function g(b){var c=[],d;for(d in b)c.push(['<param name="',d,'" value="',f(b[d]),'" />'].join(""));return c.join("")}var h="object",k=!0;try{var l=d.description||(new d("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version")}catch(n){l=
"Unavailable"}var q=l.match(/\d+/g)||[0];b[c]={available:0<q[0],activeX:d&&!d.name,version:{original:l,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 e(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||""};k="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 e=[],f;for(f in d)d[f]&&e.push([f,'="',d[f],'"'].join(""));d=e.join(" ");c.innerHTML=["<object ",d,">",g(b),"</object>"].join("");return c.firstChild}};
b.fn[c]=function(d){var e=this.find(h).andSelf().filter(h);/string|object/.test(typeof d)&&this.each(function(){var e=b(this),f;d=typeof d==h?d:{swf:d};d.fallback=this;if(f=b[c].create(d))e.children().remove(),e.html(f)});"function"==typeof d&&e.each(function(){var e=this;e.jsInteractionTimeoutMs=e.jsInteractionTimeoutMs||0;660>e.jsInteractionTimeoutMs&&(e.clientWidth||e.clientHeight?d.call(e):setTimeout(function(){b(e)[c](d)},e.jsInteractionTimeoutMs+66))});return e}})(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,e,f){return jQuery.easing[jQuery.easing.def](b,c,d,e,f)},easeInQuad:function(b,c,d,e,f){return e*(c/=f)*c+d},easeOutQuad:function(b,c,d,e,f){return-e*(c/=f)*(c-2)+d},easeInOutQuad:function(b,c,d,e,f){return 1>(c/=f/2)?e/2*c*c+d:-e/2*(--c*(c-2)-1)+d},easeInCubic:function(b,c,d,e,f){return e*(c/=f)*c*c+d},easeOutCubic:function(b,c,d,e,f){return e*((c=c/f-1)*c*c+1)+d},easeInOutCubic:function(b,c,d,e,f){return 1>(c/=f/2)?e/2*c*c*c+d:
e/2*((c-=2)*c*c+2)+d},easeInQuart:function(b,c,d,e,f){return e*(c/=f)*c*c*c+d},easeOutQuart:function(b,c,d,e,f){return-e*((c=c/f-1)*c*c*c-1)+d},easeInOutQuart:function(b,c,d,e,f){return 1>(c/=f/2)?e/2*c*c*c*c+d:-e/2*((c-=2)*c*c*c-2)+d},easeInQuint:function(b,c,d,e,f){return e*(c/=f)*c*c*c*c+d},easeOutQuint:function(b,c,d,e,f){return e*((c=c/f-1)*c*c*c*c+1)+d},easeInOutQuint:function(b,c,d,e,f){return 1>(c/=f/2)?e/2*c*c*c*c*c+d:e/2*((c-=2)*c*c*c*c+2)+d},easeInSine:function(b,c,d,e,f){return-e*Math.cos(c/
f*(Math.PI/2))+e+d},easeOutSine:function(b,c,d,e,f){return e*Math.sin(c/f*(Math.PI/2))+d},easeInOutSine:function(b,c,d,e,f){return-e/2*(Math.cos(Math.PI*c/f)-1)+d},easeInExpo:function(b,c,d,e,f){return 0==c?d:e*Math.pow(2,10*(c/f-1))+d},easeOutExpo:function(b,c,d,e,f){return c==f?d+e:e*(-Math.pow(2,-10*c/f)+1)+d},easeInOutExpo:function(b,c,d,e,f){return 0==c?d:c==f?d+e:1>(c/=f/2)?e/2*Math.pow(2,10*(c-1))+d:e/2*(-Math.pow(2,-10*--c)+2)+d},easeInCirc:function(b,c,d,e,f){return-e*(Math.sqrt(1-(c/=f)*
c)-1)+d},easeOutCirc:function(b,c,d,e,f){return e*Math.sqrt(1-(c=c/f-1)*c)+d},easeInOutCirc:function(b,c,d,e,f){return 1>(c/=f/2)?-e/2*(Math.sqrt(1-c*c)-1)+d:e/2*(Math.sqrt(1-(c-=2)*c)+1)+d},easeInElastic:function(b,c,d,e,f){b=1.70158;var g=0,h=e;if(0==c)return d;if(1==(c/=f))return d+e;g||(g=0.3*f);h<Math.abs(e)?(h=e,b=g/4):b=g/(2*Math.PI)*Math.asin(e/h);return-(h*Math.pow(2,10*(c-=1))*Math.sin(2*(c*f-b)*Math.PI/g))+d},easeOutElastic:function(b,c,d,e,f){b=1.70158;var g=0,h=e;if(0==c)return d;if(1==
(c/=f))return d+e;g||(g=0.3*f);h<Math.abs(e)?(h=e,b=g/4):b=g/(2*Math.PI)*Math.asin(e/h);return h*Math.pow(2,-10*c)*Math.sin(2*(c*f-b)*Math.PI/g)+e+d},easeInOutElastic:function(b,c,d,e,f){b=1.70158;var g=0,h=e;if(0==c)return d;if(2==(c/=f/2))return d+e;g||(g=0.3*f*1.5);h<Math.abs(e)?(h=e,b=g/4):b=g/(2*Math.PI)*Math.asin(e/h);return 1>c?-0.5*h*Math.pow(2,10*(c-=1))*Math.sin(2*(c*f-b)*Math.PI/g)+d:h*Math.pow(2,-10*(c-=1))*Math.sin(2*(c*f-b)*Math.PI/g)*0.5+e+d},easeInBack:function(b,c,d,e,f,g){void 0==
g&&(g=1.70158);return e*(c/=f)*c*((g+1)*c-g)+d},easeOutBack:function(b,c,d,e,f,g){void 0==g&&(g=1.70158);return e*((c=c/f-1)*c*((g+1)*c+g)+1)+d},easeInOutBack:function(b,c,d,e,f,g){void 0==g&&(g=1.70158);return 1>(c/=f/2)?e/2*c*c*(((g*=1.525)+1)*c-g)+d:e/2*((c-=2)*c*(((g*=1.525)+1)*c+g)+2)+d},easeInBounce:function(b,c,d,e,f){return e-jQuery.easing.easeOutBounce(b,f-c,0,e,f)+d},easeOutBounce:function(b,c,d,e,f){return(c/=f)<1/2.75?7.5625*e*c*c+d:c<2/2.75?e*(7.5625*(c-=1.5/2.75)*c+0.75)+d:c<2.5/2.75?
e*(7.5625*(c-=2.25/2.75)*c+0.9375)+d:e*(7.5625*(c-=2.625/2.75)*c+0.984375)+d},easeInOutBounce:function(b,c,d,e,f){return c<f/2?0.5*jQuery.easing.easeInBounce(b,2*c,0,e,f)+d:0.5*jQuery.easing.easeOutBounce(b,2*c-f,0,e,f)+0.5*e+d}});
(function(b){var c=[],d=function(){},e=0,f=[],g=function(){e++;e>=c.length&&(d(f),d=function(){})},h=function(c){var d=new Image;b(d).load(function(){f.push({url:c,img:d});g()}).error(function(){f.push(d);g()}).attr("src",c)};b.fn.loader=function(e,f,g){e&&b.extend(c,e);"function"==typeof f&&(d=f);for(e=0;e<c.length;e++)h(c[e])}})(jQuery);
var phoneIconInfo={width:600,height:600,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:"miBookmark",
position:{x:373,y:284},width:32,height:32},{id:"miShare",position:{x:87,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:"languageChange",position:{x:232,y:284},width:32,height:32},{id:"setting",position:{x:437,y:282},width:32,height:32},{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:336,y:20},width:48,height:48},{id:"zoomOut",position:{x:101,y:107},
width:48,height:48}]},catalogIconInfo={width:480,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:"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}]};
(function(b){var c=function(){return Hammer.HAS_TOUCHEVENTS&&navigator.userAgent.match(Hammer.MOBILE_REGEX)};bdor[3]="f";var d=function(b){var e=this;this.theButton=b;this.eventSource=b[0];c()?(b.bind("touchstart",function(){d.prototype.mouseDown.apply(e,arguments)}),b.bind("touchend",function(){d.prototype.mouseUp.apply(e,arguments)})):(b.bind("mousedown",function(){d.prototype.mouseDown.apply(e,arguments)}),b.bind("mouseleave",function(){d.prototype.mouseUp.apply(e,arguments)}),b.bind("mouseup",
function(){d.prototype.mouseUp.apply(e,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 e=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 g=this;c()?(b.bind("touchstart",function(){e.prototype.mouseDown.apply(g,arguments)}),b.bind("touchend",function(){e.prototype.mouseUp.apply(g,arguments)})):(b.bind("mouseenter",function(){e.prototype.mouseOver.apply(g,arguments)}),b.bind("mousedown",function(){e.prototype.mouseDown.apply(g,arguments)}),b.bind("mouseup",function(){e.prototype.mouseUp.apply(g,arguments)}),b.bind("mouseleave",function(){e.prototype.mouseUp.apply(g,
arguments)}))};e.prototype.mouseOver=function(){this.eventSource.src=this.pictureDown};e.prototype.mouseDown=function(){this.eventSource.src=this.pictureDown};e.prototype.mouseUp=function(){var b=this;window.setTimeout(function(){b.eventSource.src=b.origPicture},100)};b.fn.asImageButton=function(){new e(this);return this};var f=function(b){this.eventSource=b[0];this.origPicture=b[0].src;var d=this.origPicture.lastIndexOf("."),e=this.origPicture.substr(0,d),d=this.origPicture.substring(d);this.pictureDown=
e+"_down"+d;var g=this;c()?(b.bind("touchstart",function(){f.prototype.mouseOver.apply(g,arguments)}),b.bind("touchend",function(){f.prototype.mouseUp.apply(g,arguments)})):(b.bind("mouseenter",function(){f.prototype.mouseOver.apply(g,arguments)}),b.bind("mousedown",function(){f.prototype.mouseDown.apply(g,arguments)}),b.bind("mouseup",function(){f.prototype.mouseUp.apply(g,arguments)}),b.bind("mouseleave",function(){f.prototype.mouseUp.apply(g,arguments)}))};bdor[10]="l";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.asImageChangeButton=function(){new f(this);return this};var g=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(){g.prototype.MouseEnter.apply(c,arguments)});
b.bind("mouseleave",function(){g.prototype.MouseLeave.apply(c,arguments)})};g.prototype.MouseEnter=function(){this.theButton.animate({top:this.iJumpTop},50)};g.prototype.MouseLeave=function(){this.theButton.animate({top:this.iOrigTop},50)};b.fn.mouseEnterJump=function(){new g(this);return this};b.fn.mouseOverCursor=function(){new h(this);return this};var h=function(b){b.bind("mouseover",function(){b.css({cursor:"pointer"})})},k=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(){k.prototype.MouseEnter.apply(c,arguments)});b.bind("mouseleave",function(){k.prototype.MouseLeave.apply(c,arguments)})};k.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)"})};k.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)"})};k.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 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-1;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.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)"})};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)"})};b.fn.mouseEnterZoom=function(){new l(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 k(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,e){var f=this,g=colorDiv(b,10);this.bind(_event._enter,function(){f.css({background:g});f.css({border:""});f.css({"border-left":"1px solid "+e,"border-top":"1px solid "+e});f.css({"border-right":"1px solid "+
d,"border-bottom":"1px solid "+d})});this.bind(_event._down,function(){f.css({background:g});f.css({border:""});f.css({"border-left":"1px solid "+d,"border-top":"1px solid "+d});f.css({"border-right":"1px solid "+e,"border-bottom":"1px solid "+e})});c()?this.bind(_event._end,function(){f.css({background:"transparent"});f.css({border:""})}):this.bind(_event._end,function(){f.css({background:g});f.css({border:""});f.css({"border-left":"1px solid "+e,"border-top":"1px solid "+e});f.css({"border-right":"1px solid "+
d,"border-bottom":"1px solid "+d})});this.bind(_event._leave,function(){f.css({background:"transparent"});f.css({border:""})});return this};b.fn.mouseEnterGradient=function(b,d,e){var f=this,g=colorAdd(b,75),h="-webkit-gradient(linear,left top,left bottom,color-stop(0,"+g+"),color-stop(0.19,"+colorAdd(g,2)+"),color-stop(0.35,"+colorAdd(g,28)+"),color-stop(0.55, "+colorAdd(g,6)+"),color-stop(0.75,"+colorAdd(g,4)+"),color-stop(0.85,"+colorAdd(g,2)+"),color-stop(1, "+g+"))";this.bind(_event._enter,function(){f.css("background",
h);f.css({border:""});f.css({"border-left":"1px solid "+e,"border-top":"1px solid "+e});f.css({"border-right":"1px solid "+d,"border-bottom":"1px solid "+d})});this.bind(_event._down,function(){f.setGradient(g,!1);f.css({border:""});f.css({"border-left":"1px solid "+d,"border-top":"1px solid "+d});f.css({"border-right":"1px solid "+e,"border-bottom":"1px solid "+e})});c()?this.bind(_event._end,function(){f.css({background:"transparent"});f.css({border:""})}):this.bind(_event._end,function(){f.css("background",
h);f[0].style.removeAttribute&&f[0].style.removeAttribute("filter");f.css({border:""});f.css({"border-left":"1px solid "+e,"border-top":"1px solid "+e});f.css({"border-right":"1px solid "+d,"border-bottom":"1px solid "+d})});this.bind(_event._leave,function(){f[0].style.removeAttribute&&f[0].style.removeAttribute("filter");f.css({background:"transparent"});f.css({border:""})});return this};b.fn.dragToMove=function(c,d,e){var f=!1,g=0,h=0,k=0,l=0;b(this).bind(_event._down,function(d){var e=b(this)[0];
e.setCapture?e.setCapture():window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);d=isTouch?d.originalEvent.touches:[d];f=!0;g=d[0].pageX;h=d[0].pageY;k=b(c).offset().left;l=b(c).offset().top;return!1});b(this).bind(_event._end,function(c){c=b(this)[0];c.releaseCapture?c.releaseCapture():window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);return f=!1});b(this).bind(_event._move,function(n){n=isTouch?n.originalEvent.touches:[n];if(f){var v=k+(n[0].pageX-g);n=l+(n[0].pageY-h);void 0!=d&&(v=Math.max(d.x,
v),v=Math.min(d.y,v));void 0!=e&&(n=Math.max(e.x,n),n=Math.min(e.y,n));b(c).css({left:v+"px",top:n+"px"})}return!1});b(this).bind("mouseleave",function(){return f=!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,e){var f=this;this.bind(_event._enter,function(){var g=b("<img src='"+e+"'>");f.empty().append(g);f.css({background:d});f.changeButtonColor(c)});this.bind(_event._end,function(){var c=b("<img src='"+e+"'>");f.empty().append(c);f.css({background:"transparent"});f.changeButtonColor(d)});
this.bind(_event._leave,function(){var c=b("<img src='"+e+"'>");f.empty().append(c);f.css({background:"transparent"});f.changeButtonColor(d)});return this};b.fn.clickExceptMove=function(b){var c=!1,d=!1,e=new Point(0,0);this.bind(_event._down,function(b){c=!0;d=!1;e.x=b.pageX;e.y=b.pageY});this.bind(_event._move,function(b){d=1>=Math.abs(b.pageX-e.x)&&1>=Math.abs(b.pageY-e.y)?!1:!0});this.bind(_event._leave,function(b){d=c=!1});this.bind(_event._end,function(e){c&&!d&&b();d=c=!1})};b.fn.enterToChange=
function(b,c,d,e,f){var g=this.children(),h=this;this.bind(_event._down,function(k){c=h.attr("id");g.cssSprite(b,c+"_down",d,e,f)});this.bind(_event._enter,function(k){c=h.attr("id");g.cssSprite(b,c+"_down",d,e,f)});this.bind(_event._leave,function(k){c=h.attr("id");g.cssSprite(b,c,d,e,f)})};b.fn.addCssSprite=function(c,d,e,f,g){var h=b("<div></div>");h.cssSprite(c,d,e,f,g);this.append(h)};b.fn.changeCssSprite=function(b,c,d,e,f){this.children().cssSprite(b,c,d,e,f)};b.fn.cssSprite=function(b,c,d,
e,f){if(f.iconInfo){for(var g=0,h=0;h<f.iconInfo.length;h++)if(f.iconInfo[h].id==c){g=h;break}c=f.iconInfo[g].position;var h="",h=f.width,k=f.height,l=0,n=0,l=d*h/f.iconInfo[g].width,n=e*k/f.iconInfo[g].height;c=-c.x*l/h+"px "+-c.y*n/k+"px";h=l+"px "+n+"px";this.css({"background-image":"url("+b+")","background-repeat":"no-repeat","background-position":c,"-webkit-background-size":h,"-o-background-size":h,"background-size":h})}};bdor[6]="l"})(jQuery);var hddr=[];
(function(b,c){function d(){if(!e.READY){e.event.determineEventTypes();for(var b in e.gestures)e.gestures.hasOwnProperty(b)&&e.detection.register(e.gestures[b]);e.event.onTouch(e.DOCUMENT,e.EVENT_MOVE,e.detection.detect);e.event.onTouch(e.DOCUMENT,e.EVENT_END,e.detection.detect);e.READY=!0}}var e=function(b,c){return new e.Instance(b,c||{})};e.defaults={stop_browser_behavior:{touchAction:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};e.HAS_POINTEREVENTS=
navigator.pointerEnabled||navigator.msPointerEnabled;e.HAS_TOUCHEVENTS="ontouchstart"in b;e.MOBILE_REGEX=/mobile|tablet|ip(ad|hone|od)|android/i;e.NO_MOUSEEVENTS=e.HAS_TOUCHEVENTS&&navigator.userAgent.match(e.MOBILE_REGEX);e.EVENT_TYPES={};e.DIRECTION_DOWN="down";e.DIRECTION_LEFT="left";e.DIRECTION_UP="up";e.DIRECTION_RIGHT="right";e.POINTER_MOUSE="mouse";e.POINTER_TOUCH="touch";e.POINTER_PEN="pen";e.EVENT_START="start";e.EVENT_MOVE="move";e.EVENT_END="end";e.DOCUMENT=document;e.plugins={};e.READY=
!1;e.Instance=function(b,c){var f=this;return d(),this.element=b,this.enabled=!0,this.options=e.utils.extend(e.utils.extend({},e.defaults),c||{}),this.options.stop_browser_behavior&&e.utils.stopDefaultBrowserBehavior(this.element,this.options.stop_browser_behavior),e.event.onTouch(b,e.EVENT_START,function(b){f.enabled&&e.detection.startDetect(f,b)}),this};e.Instance.prototype={on:function(b,c){for(var d=b.split(" "),e=0;d.length>e;e++)this.element.addEventListener(d[e],c,!1);return this},off:function(b,
c){for(var d=b.split(" "),e=0;d.length>e;e++)this.element.removeEventListener(d[e],c,!1);return this},trigger:function(b,c){var d=e.DOCUMENT.createEvent("Event");d.initEvent(b,!0,!0);d.gesture=c;var f=this.element;return e.utils.hasParent(c.target,f)&&(f=c.target),f.dispatchEvent(d),this},enable:function(b){return this.enabled=b,this}};var f=null,g=!1,h=!1;e.event={bindDom:function(b,c,d){c=c.split(" ");for(var e=0;c.length>e;e++)b.addEventListener(c[e],d,!1)},onTouch:function(b,c,d){var q=this;this.bindDom(b,
e.EVENT_TYPES[c],function(m){var r=m.type.toLowerCase();if(!r.match(/mouse/)||!h){(r.match(/touch/)||r.match(/pointerdown/)||r.match(/mouse/)&&1===m.which)&&(g=!0);r.match(/touch|pointer/)&&(h=!0);var s=0;g&&(e.HAS_POINTEREVENTS&&c!=e.EVENT_END?s=e.PointerEvent.updatePointer(c,m):r.match(/touch/)?s=m.touches.length:h||(s=r.match(/up/)?0:1),0<s&&c==e.EVENT_END?c=e.EVENT_MOVE:s||(c=e.EVENT_END),s||null===f?f=m:m=f,d.call(e.detection,q.collectEventData(b,c,m)),e.HAS_POINTEREVENTS&&c==e.EVENT_END&&(s=
e.PointerEvent.updatePointer(c,m)));s||(f=null,g=!1,h=!1,e.PointerEvent.reset())}})},determineEventTypes:function(){var b;b=e.HAS_POINTEREVENTS?e.PointerEvent.getEvents():e.NO_MOUSEEVENTS?["touchstart","touchmove","touchend touchcancel"]:["touchstart mousedown","touchmove mousemove","touchend touchcancel mouseup"];e.EVENT_TYPES[e.EVENT_START]=b[0];e.EVENT_TYPES[e.EVENT_MOVE]=b[1];e.EVENT_TYPES[e.EVENT_END]=b[2]},getTouchList:function(b){return e.HAS_POINTEREVENTS?e.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 f=e.POINTER_TOUCH;return(d.type.match(/mouse/)||e.PointerEvent.matchType(e.POINTER_MOUSE,d))&&(f=e.POINTER_MOUSE),{center:e.utils.getCenter(b),timeStamp:(new Date).getTime(),target:d.target,touches:b,eventType:c,pointerType:f,srcEvent:d,preventDefault:function(){this.srcEvent.preventManipulation&&this.srcEvent.preventManipulation();this.srcEvent.preventDefault&&this.srcEvent.preventDefault()},
stopPropagation:function(){this.srcEvent.stopPropagation()},stopDetect:function(){return e.detection.stopDetect()}}}};e.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==e.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[e.POINTER_MOUSE]=
c.pointerType==c.MSPOINTER_TYPE_MOUSE||c.pointerType==e.POINTER_MOUSE,d[e.POINTER_TOUCH]=c.pointerType==c.MSPOINTER_TYPE_TOUCH||c.pointerType==e.POINTER_TOUCH,d[e.POINTER_PEN]=c.pointerType==c.MSPOINTER_TYPE_PEN||c.pointerType==e.POINTER_PEN,d[b]},getEvents:function(){return["pointerdown MSPointerDown","pointermove MSPointerMove","pointerup pointercancel MSPointerUp MSPointerCancel"]},reset:function(){this.pointers={}}};e.utils={extend:function(b,d,e){for(var f in d)b[f]!==c&&e||(b[f]=d[f]);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=[],e=0,f=b.length;f>e;e++)c.push(b[e].pageX),d.push(b[e].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),f=Math.abs(b.pageY-c.pageY);return d>=f?0<b.pageX-c.pageX?e.DIRECTION_LEFT:e.DIRECTION_RIGHT:0<b.pageY-c.pageY?e.DIRECTION_UP:e.DIRECTION_DOWN},getDistance:function(b,c){var d=c.pageX-b.pageX,e=c.pageY-b.pageY;return Math.sqrt(d*d+e*e)},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==
e.DIRECTION_UP||b==e.DIRECTION_DOWN},stopDefaultBrowserBehavior:function(b,c){var d,e="webkit khtml moz ms o ".split(" ");if(c&&b.style){for(var f=0;e.length>f;f++)for(var g in c)c.hasOwnProperty(g)&&(d=g,e[f]&&(d=e[f]+d.substring(0,1).toUpperCase()+d.substring(1)),b.style[d]=c[g]);"none"==c.userSelect&&(b.onselectstart=function(){return!1})}}};e.detection={gestures:[],current:null,previous:null,stopped:!1,startDetect:function(b,c){this.current||(this.stopped=!1,this.current={inst:b,startEvent:e.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,f=this.gestures.length;f>d;d++){var g=this.gestures[d];if(!this.stopped&&!1!==c[g.name]&&!1===g.handler.call(g,b,this.current.inst)){this.stopDetect();break}}return this.current&&(this.current.lastEvent=b),b.eventType==e.EVENT_END&&!b.touches.length-1&&this.stopDetect(),b}},stopDetect:function(){this.previous=e.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,f=b.touches.length;f>d;d++)c.touches.push(e.utils.extend({},b.touches[d]))}var d=b.timeStamp-c.timeStamp,f=b.center.pageX-c.center.pageX,g=b.center.pageY-c.center.pageY,h=e.utils.getVelocity(d,f,g);return e.utils.extend(b,{deltaTime:d,deltaX:f,deltaY:g,velocityX:h.x,velocityY:h.y,distance:e.utils.getDistance(c.center,
b.center),angle:e.utils.getAngle(c.center,b.center),direction:e.utils.getDirection(c.center,b.center),scale:e.utils.getScale(c.touches,b.touches),rotation:e.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),e.utils.extend(e.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}};e.gestures=e.gestures||{};e.gestures.Hold=
{name:"hold",index:10,defaults:{hold_timeout:500,hold_threshold:1},timer:null,handler:function(b,c){switch(b.eventType){case e.EVENT_START:clearTimeout(this.timer);e.detection.current.name=this.name;this.timer=setTimeout(function(){"hold"==e.detection.current.name&&c.trigger("hold",b)},c.options.hold_timeout);break;case e.EVENT_MOVE:b.distance>c.options.hold_threshold&&clearTimeout(this.timer);break;case e.EVENT_END:clearTimeout(this.timer)}}};e.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==e.EVENT_END){var d=e.detection.previous,f=!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),f=!0),f&&!c.options.tap_always||(e.detection.current.name="tap",c.trigger(e.detection.current.name,b)))}}};e.gestures.Swipe=
{name:"swipe",index:40,defaults:{swipe_max_touches:1,swipe_velocity:0.7},handler:function(b,c){b.eventType!=e.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))}};e.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(e.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 e.EVENT_START:this.triggered=!1;break;case e.EVENT_MOVE:if(b.distance<d.options.drag_min_distance&&e.detection.current.name!=this.name)break;e.detection.current.name=this.name;(e.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 f=e.detection.current.lastEvent.direction;b.drag_locked_to_axis&&f!==b.direction&&(b.direction=e.utils.isVertical(f)?0>b.deltaY?e.DIRECTION_UP:e.DIRECTION_DOWN:0>b.deltaX?e.DIRECTION_LEFT:e.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&&e.utils.isVertical(b.direction)||d.options.drag_block_horizontal&&
!e.utils.isVertical(b.direction))&&b.preventDefault();break;case e.EVENT_END:this.triggered&&d.trigger(this.name+"end",b),this.triggered=!1}}};e.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(e.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 e.EVENT_START:this.triggered=!1;break;case e.EVENT_MOVE:var f=Math.abs(1-b.scale),g=Math.abs(b.rotation);if(d.options.transform_min_scale>f&&d.options.transform_min_rotation>g)break;e.detection.current.name=this.name;this.triggered||(d.trigger(this.name+"start",b),this.triggered=!0);d.trigger(this.name,b);g>d.options.transform_min_rotation&&d.trigger("rotate",b);f>d.options.transform_min_scale&&(d.trigger("pinch",b),d.trigger("pinch"+(1>b.scale?"in":"out"),b));break;case e.EVENT_END:this.triggered&&
d.trigger(this.name+"end",b),this.triggered=!1}}};e.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==e.POINTER_MOUSE?(b.stopDetect(),c):(d.options.prevent_default&&b.preventDefault(),b.eventType==e.EVENT_START&&d.trigger(this.name,b),c)}};e.gestures.Release={name:"release",index:1/0,handler:function(b,c){b.eventType==e.EVENT_END&&c.trigger(this.name,b)}};"object"==typeof module&&
"object"==typeof module.exports?module.exports=e:(b.Hammer=e,"function"==typeof b.define&&b.define.amd&&b.define("hammer",[],function(){return e}))})(this);
(function(b,c){b!==c&&(Hammer.event.bindDom=function(d,e,f){b(d).on(e,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);f.call(this,d)})},Hammer.Instance.prototype.on=function(c,e){return b(this.element).on(c,e)},Hammer.Instance.prototype.off=function(c,e){return b(this.element).off(c,e)},Hammer.Instance.prototype.trigger=
function(c,e){var f=b(this.element);return f.has(e.target).length&&(f=b(e.target)),f.trigger({type:c,gesture:e})},b.fn.hammer=function(c){return this.each(function(){var e=b(this),f=e.data("hammer");f?f&&c&&Hammer.utils.extend(f.options,c):e.data("hammer",new Hammer(this,c||{}))})})})(window.jQuery||window.Zepto);
(function(b){bdor[5]="i";var c=function(c,e,f,g,h){if(void 0!=c&&null!=c){h=b.extend({background:"green",cornersTop:!0,scale:"noresize"},h);c.prev();var k=0,l=!1,n=h.background,q=h.cornersTop,m=h.gradientColors||["#ddd","#eee","#fff"],r=h.scale,s=[],t,u,w;try{t=c.clone(),u=t[0].getContext("2d"),w=c[0].getContext("2d"),loaded=0}catch(A){w=u=t=null}g=g.each(function(c){if(!s[c]&&null!=w){var d=this;d.onload=function(){var h=1;if("noresize"!=r){var k=0==this.width?this.naturalWidth:this.width,n=0==this.height?
this.naturalHeight:this.height,m=e/k,v=f/n;"fit"==r&&(h=1>m||1>v?Math.min(m,v):1);"fill"==r&&(h=Math.min(m,v))}b(d).data("flip.scale",h);s[c]=w.createPattern(d,"no-repeat");s[c].width=k;s[c].height=n;loaded++;loaded!=g.length||l||(l=!0,G())};d.complete&&window.setTimeout(function(){d.onload()},10)}}).get();var z=e,v=f,B=b.browser.msie?c.offset():null,C,F,D,E;b.browser.msie&&function(){var g=b("<div>").width(e).height(f).css({position:"absolute",cursor:"default",zIndex:1}).appendTo(tmpContainer);7==
parseInt(b.browser.version)&&g.css({opacity:1E-6,background:"#FFF"});var h=function(){B=c.offset();return g.css({left:B.left+"px",top:B.top+"px"})};b(window).resize(h);return h()}();setInterval(function(){window.clearInterval(C);F=(new Date).getTime();D=z;E=v/50;C=window.setInterval(J,0);k+=1;0>k&&(k=g.length-1);k==g.length&&(k=0)},3E3);var J=function(){var b=(new Date).getTime()-F;700<=b?(window.clearInterval(C),g.push(g.shift()),s.push(s.shift()),z=e,v=f):(z=D-2*e*b/700,v=E+2*f*b/700/3);G()},N=
function(c,d){if(null!=w){var g=c*e+d,h=-d/c;b.browser.msie&&(g=Math.round(g),h=Math.round(h));w.beginPath();w.moveTo(e,Math.min(g,f));w.lineTo(e,0);w.lineTo(Math.max(h,0),0);0>h?(w.lineTo(0,Math.min(d,f)),d<f&&w.lineTo((f-d)/c,f),w.lineTo(e,f)):g<f?w.lineTo(e,g):(w.lineTo((f-d)/c,f),w.lineTo(e,f))}},G=function(){if(l&&null!=w&&null!=u){b.browser.msie&&w.clearRect(0,0,e,f);w.fillStyle=n;w.fillRect(0,0,e,f);var c=g[0],d=b(c).data("flip.scale");if(b.browser.msie)try{w.drawImage(c,0,0,c.width,c.height,
0,0,e,f)}catch(h){w.fillStyle=s[0],w.fillStyle.width2=w.fillStyle.width*d,w.fillStyle.height2=w.fillStyle.height*d,w.fillRect(0,0,e,f)}else w.drawImage(c,(e-c.width*d)/2,(f-c.height*d)/2,c.width*d,c.height*d);if(v&&z!=e&&(c=(v-2*(z+e))/2,m2=v/(e-z),q2=z*m2,2!=m2)){var k=1,B=0;w.save();q||(B=f,k=-1);w.translate(0,B);w.scale(1,k);var r=(q2-c)/(2-m2),C=2*r+c,D=(2*C+r+4*z-2*v)/5,F=-D/2+C+r/2,d=Math.sqrt(Math.pow(r-D,2)+Math.pow(C-F,2)),E=Math.min(0.5*d,30),A;b.browser.mozilla&&1.9>parseFloat(b.browser.version)?
(A=u,A.clearRect(0,0,e,f),A.save(),A.translate(1,0)):A=w;r=A.createLinearGradient(r,C,D,F);r.addColorStop(0,m[0]);r.addColorStop(E/d,m[1]);r.addColorStop(1,m[2]);A.fillStyle=r;A.beginPath();A.moveTo(-c/2,0);A.quadraticCurveTo((-c/2+z)/2+0.02*z,v/2,z,v);A.quadraticCurveTo((e+z)/2,(2*e+c+v)/2-0.02*(f-v),e,2*e+c);b.browser.mozilla&&1.9>parseFloat(b.browser.version)?(A.save(),A.clip(),A.fillRect(0,0,e,f),A.restore(),w.drawImage(t[0],0,0),A.restore()):A.fill();w.fillStyle=n;N(2,c);w.fill();N(2,c);b.browser.safari||
b.browser.opera||w.restore();c=g[1];d=b(c).data("flip.scale");if(b.browser.msie)w.fillStyle=s[1],w.fillStyle.width2=w.fillStyle.width*d,w.fillStyle.height2=w.fillStyle.height*d,w.fill();else{w.save();w.clip();if(b.browser.safari||b.browser.opera)w.scale(1,1/k),w.translate(-0,-B);w.drawImage(c,(e-c.width*d)/2,(f-c.height*d)/2,c.width*d,c.height*d);w.restore();(b.browser.safari||b.browser.opera)&&w.restore()}}}}}};b.fn.jFlip=function(d,e,f,g,h){return this.each(function(){b(this).wrap("<div class='bannerdiv' style='position: absolute;width:"+
d+"px;height:"+e+"px;top:"+h+"px;left:"+g+"px'>");var k=b(this).find("img"),l=b(document.createElement("canvas")).attr({width:d,height:e}).css({margin:0,width:d+"px",height:e+"px"});b(this).css({position:"absolute",left:"-9000px",top:"-9000px",display:"none"}).after(l);new c(b(this).next(),d||300,e||300,k,f)})}})(jQuery);
function searchFromPages(b,c){var d=[];c=c.trim().toLowerCase();for(var e=null,e=-1==c.indexOf(" ")?[c]:c.split(" "),f=0,f=0;f<b.length;f++){var g=b[f].trim().toLowerCase(),h=g,k=-1,l=-1,n=-1,q=0,m=!0,r;for(r=0;r<e.length;r++){var h=new KMP(h,e[r]),s=e[r].length;if(h.match()){var t=q+h.getIndex();if(t>n)n=t,q=t+e[r].length,h=g.substring(q),0==r&&(k=t),r==e.length-1&&(l=t+s);else{m=!1;break}}else{m=!1;break}}m&&(n=[],n.search_page=f+1,n.search_title="page "+(f+1),k=g.substring(0,k).lastIndexOf("."),
-1==k?k=0:k++,q=g.substring(l),m=q.indexOf(".")+1,m=-1==m?q.length():l+m,g=g.substring(k,m),n.search_text=g,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 e=this.__next[c];-1!=e&&this.__pattern.charAt(e)==this.__pattern.charAt(c);)e=this.__next[e];c=e;-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,e=Math.min(c,d),f=this.split("");b=b.split("");var g=0,h=0;if(g==h)for(h=g,e+=g;h<e;){var k=f[h],l=b[h];if(k!=l)return k-l;h++}else for(;0!=e--;)if(k=f[g++],l=b[h++],k!=l)return k-l;return c-d};
(function(b){function c(b){b=d.match(b);if(null==b||0==b.length)return 0;b=b[0].match(/\d+\.?\d?/);if(null==b||0==b.length)return 0;b=b[0];return""==b?0:parseFloat(b)}var d=navigator.userAgent.toLowerCase();if(void 0==b.browser){b.browser={};b.browser.webkit=/webkit/.test(d);b.browser.mozilla=/firefox/.test(d);b.browser.firefox=b.browser.mozilla;b.browser.msie=/msie/.test(d)||/trident/.test(d);b.browser.opera=/opera/.test(d)||/opr/.test(d);b.browser.chrome=/chrome/.test(d)&&!b.browser.opera;b.browser.uc=
/ucbrowser/.test(d);b.browser.safari=/safari/.test(d)&&!b.browser.chrome&&!b.browser.uc;b.browser.version=0;bdor[1]="p";var e=function(b){b=d.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)};b.browser.firefox&&(b.browser.version=e(/firefox\/\d+/));if(b.browser.msie){var f=d.match(/msie\s?\d+\.0/);null==f?(f=d.match(/trident\/\d+\.0/),null!=f&&0<f.length&&(f=parseInt(f[0].replace("trident/","")),b.browser.version=f+4)):(f=
parseInt(f[0].replace("msie","")),b.browser.version=f)}b.browser.opera&&(b.browser.version=e(/opera\/\d+/)||e(/opr\/\d+/));b.browser.chrome&&(b.browser.version=e(/chrome\/\d+/));b.browser.uc&&(b.browser.version=e(/ucbrowser\/\d+/));b.browser.safari&&(b.browser.version=e(/safari\/\d+/))}if(void 0==b.browser.device){b.browser.DEVICE_PC=0;b.browser.DEVICE_PAD=1;b.browser.DEVICE_PHONE=2;var e=/pad/.test(d)||/ipod/.test(d),f=/iphone/.test(d),g=/wpdesktop/.test(d),h=/blackberry/.test(d),k=/mobile/.test(d)||
/phone/.test(d);b.browser.device=b.browser.DEVICE_PC;if(e)b.browser.device=b.browser.DEVICE_PAD;else if(f||g||h||k)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.MAC="Mac OS";b.system.IOS="iPhone OS";b.system.LINUX="Linux";b.system.ANDROID="Android";b.system.BLACKBERRY="BlackBerry";/windows/.test(d)&&(b.system.name=b.system.WINDOWS,b.system.version=c(/windows nt\s?\d+\.?\d?/));if(/iphone/.test(d)||/ipad/.test(d))b.system.name=b.system.IOS,b.system.version=c(/os\s?\d+/);/mac/.test(d)&&b.browser.system!=b.browser.IOS&&(b.system.name=b.system.SYSTEM_MAC,b.system.version=c(/os x\s?\d+\.?\d?/));/linux/.test(d)&&!/android/.test(d)&&(b.system.name=
b.system.LINUX);/android/.test(d)&&(b.system.name=b.system.ANDROID,b.system.version=c(/android\s?\d+\.?\d?/));/blackberry/.test(d)&&(b.system.name=b.system.BLACKBERRY,b.system.version=c(/blackberry\s?\d+/))}})(jQuery);var global=function(){return this||(0,eval)("(this)")}();function classof(b){if(!b)return"";for(var c in global)if(global[c]instanceof Function&&b instanceof global[c])return c;return""}
function Class(b){var c=function(){this.create&&this.create instanceof Function&&this.create.apply(this,arguments)};c.prototype=b||{};c.prototype.getClassName=function(){return classof(this)};c.prototype.getClass=function(){return global[classof(this)]};b=c.prototype.statics;if(void 0!=b){for(var d in b)void 0==c[d]&&(c[d]=b[d]);delete c.prototype.statics}return c}
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])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 g=this._super;this._super=b.prototype[c];var h=d.apply(this,arguments);
this._super=g;return h}}(c,this.prototype[c]))}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))};
(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(),g=Math.max(0,16.7-(d-b)),h=window.setTimeout(function(){c(d+g)},g);b=d+g;return h});window.cancelAnimationFrame||(window.cancelAnimationFrame=
function(b){clearTimeout(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||[];return{intervalId:setInterval(function(){this.apply(b,d)}.bind(this),c),stop:function(){clearInterval(this.intervalId)}}},runInAnimate:function(b,c){"object"!==typeof b&&(c=b,b={});var d={stopFlag:!1,
stop:function(){this.stopFlag=!0}},e=this,f=0,g=c/16.7,h=function(){f++;!1!==e.apply(b,[f,g])&&!0!==d.stopFlag&&f<g&&window.requestAnimationFrame(h)};h();return d}});
String.expand({trim:function(){return this.replace(/(^\s*)|(\s*$)/g,"")},replaceAll:function(b,c){if(RegExp)return this.replace(RegExp(b,"g"),c);for(var d=this.indexOf(b),e=[],f=this;-1!=d;){var d=d+b.length,g=f.substring(0,d),f=f.substring(d),g=g.replace(b,c);e.push(g);d=f.indexOf(b)}""!==f&&e.push(f);return e.join("")},subBetween:function(b,c){if(void 0==b||void 0==c)return"";var d=this.length,e=this.indexOf(b);if(-1==e)return"";e+=b.length;d=this.substring(e,d).indexOf(c);return-1==d?"":this.substring(e,
d+e)},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)},equals:function(b){return this.trim()==b.trim()},
equalsIgnoreCase:function(b){return this.toLowerCase().trim()==b.toLowerCase().trim()},endWith:function(b){return""===b?!1:this.substr(-b.length,b.length)===b},statics:{format:function(){if(0==arguments.length)return"";if(1==arguments.length)return arguments[0];for(var b=arguments[0],c=1;c<arguments.length;c++){var d=arguments[c];"string"==typeof d&&(b=b.replace("%s",d));isNaN(d)||(b=b.replace("%d",d+""));var e=d,e=e+"";!isNaN(e)&&0<e.indexOf(".")&&(b=b.replace("%f",d+""))}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},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 e in d)RegExp("("+e+")").test(b)&&(b=!0===c?b.replace(RegExp.$1,d[e]):b.replace(RegExp.$1,1==RegExp.$1.length?d[e]:("00"+d[e]).substr((""+d[e]).length)));return b}});
Number.expand({statics:{between:function(b,c,d){b<c&&(b=c);b>d&&(b=d);return b}}});
var 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),c="#"+"000000".substr(0,6-c.length)+c);"0x"==b.substr(0,2)&&(c=b.replace("0x","#"));return c};
var Point=function(b,c){return{x:b,y:c,isNearTo:function(b,c){void 0==c&&(c=5);return Math.abs(this.x-b.x)<c&&Math.abs(this.y-b.y)<c},equals:function(b){return this.x==b.x&&this.y==b.y},toString:function(){return String.format("(%d, %d)",b,c)}}};bdor[2]="e";
function colorSplit(b){var c={r:0,g:0,b:0},d="FF",e="FF",f="FF";7==b.length?(d=b.substr(1,2),e=b.substr(3,2),f=b.substr(5,2)):4==b.length&&(d=b.substr(1,1),e=b.substr(2,1),f=b.substr(3,1),d+=d,e+=e,f+=f);c.r=parseInt(d,16);c.g=parseInt(e,16);c.b=parseInt(f,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}
$.fn.setGradient=function(b,c){var d=colorAdd(b,15),e=colorDiv(b,15);void 0==c&&(c=!1);var f="",g="0";c&&(f="left,",g="1");this.css({background:"linear-gradient("+f+d+", "+e+")"});switch(browserType){case 1:this.css({background:"-webkit-linear-gradient("+f+d+", "+e+")"});break;case 2:this.css({background:"-moz-linear-gradient("+f+d+", "+e+")"});break;case 3:this.css({background:"-ms-linear-gradient("+f+d+", "+e+")"});this.css("filter","progid:DXImageTransform.Microsoft.Gradient(GradientType="+g+", EndColorStr="+
e+", StartColorStr="+d+")");break;case 4:this.css({background:"-o-linear-gradient("+f+d+", "+e+")"})}};
$.fn.setGradientByDir=function(b,c,d){void 0==d&&(d=!1);var e="",f="0";d&&(e="left,",f="1");this.css({background:"linear-gradient("+e+b+", "+c+")"});switch(browserType){case 1:this.css({background:"-webkit-linear-gradient("+e+b+", "+c+")"});break;case 2:this.css({background:"-moz-linear-gradient("+e+b+", "+c+")"});break;case 3:this.css({background:"-ms-linear-gradient("+e+b+", "+c+")"});this.css("filter","progid:DXImageTransform.Microsoft.Gradient(GradientType="+f+", EndColorStr="+c+", StartColorStr="+
b+")");break;case 4:this.css({background:"-o-linear-gradient("+e+b+", "+c+")"})}};$.fn.addBorderShadow=function(b,c,d){var e=c+"px",f=d+"px";c=2*(Math.abs(c)+Math.abs(d))+"px";this.css({"-moz-box-shadow":e+" "+f+" "+c+" "+b,"box-shadow":e+" "+f+" "+c+" "+b,"-webkit-box-shadow":e+" "+f+" "+c+" "+b,"-o-box-shadow":e+" "+f+" "+c+" "+b,"-ms-box-shadow":e+" "+f+" "+c+" "+b})};
var reflection=function(b){var c=new Image,d=document.createElement("canvas"),e=d.getContext("2d");b[0].appendChild(d);c.onload=function(){c.onload=c.onerror=null;var b=this.width,g=this.height,h=0.7*g;try{d.style.width=b+"px";d.style.height=h+"px";d.width=b;d.height=h;d.className="reflect";$(d).css({transform:"translateY(-1px)"});e.save();e.translate(0,g);e.scale(1,-1);e.drawImage(c,0,0,b,g);e.restore();e.globalCompositeOperation="destination-out";var k=e.createLinearGradient(0,0,0,h);k.addColorStop(1,
"rgba(255, 0, 0, 1.0)");k.addColorStop(0,"rgba(255, 0, 0, 0)");e.fillStyle=k;e.rect(0,0,b,2*h);e.fill()}catch(l){}};c.onerror=function(){c.onload=c.onerror=null};c.src=b.children("img")[0].src},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 e=this;if("none"!=this.css("display")){var f=this;0<this.children().length&&(f=this.find("img:first"));if(window.ActiveXObject){if("complete"!=f[0].readyState){$(f).load(function(){try{e.changeButtonColor(b,c,d)}catch(f){}});return}}else if(!f[0].complete){$(f).load(function(){try{e.changeButtonColor(b,c,d)}catch(f){}});return}if(void 0!=f[0]){var g,h;try{g=$("<canvas></canvas>")[0],h=g.getContext("2d")}catch(k){return}var l=f.width(),n=f.height(),f=f[0];
void 0==c&&(c=!1);var q=getHost(f.src),m=getHost();if(q&&m!==q)g=f.src.replace(q,m),f.src=g,!1==c&&$(f).load(function(){try{e.changeButtonColor(b,!0,d)}catch(c){}});else{g.width=l;g.height=n;try{h.drawImage(f,0,0,f.naturalWidth,f.naturalHeight,0,0,l,n);var r=h.getImageData(0,0,l,n),s=h.getImageData(0,0,l,n);if(!0!=f.colorChanged&&(f.colorChanged=!0,r)){for(var t=colorSplit(b),l=0,u=r.data.length;l<u;l+=4)0<s.data[l+3]&&(r.data[l]!=t.r&&(s.data[l]=r.data[l]/255*t.r),r.data[l+1]!=t.g&&(s.data[l+1]=
r.data[l+1]/255*t.g),r.data[l+2]!=t.b&&(s.data[l+2]=r.data[l+2]/255*t.b));h.putImageData(s,0,0);f.src=g.toDataURL("image/png");void 0!=d&&d(e)}}catch(w){!1==c&&$(f).load(function(){try{e.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.speed=function(b){function c(b){b=void 0==b.originalEvent.touches?[b]:b.originalEvent.touches;if(1<b.length)return m=!0;f=h=b[0].pageX;g=k=b[0].pageY;l=Date.now();-1!=q&&window.clearInterval(q);q=window.setInterval(function(){f=h;g=k;l=Date.now()},300)}function d(b){if(-1==q||!0==m)return!0;b=void 0==b.originalEvent.touches?[b]:b.originalEvent.touches;h=b[0].pageX;k=b[0].pageY}function e(c){if(-1==q)return!0;c=void 0!=c.originalEvent.touches==!1?[c]:c.originalEvent.touches;if(!0==m)return m=
1<c.length,!0;n=Date.now();c=(n-l)/20;var d=h-f,e=k-g;0==c?iSpeedY=iSpeedX=0:(iSpeedX=d/c,iSpeedY=e/c);void 0!=b&&b(iSpeedX,iSpeedY);window.clearInterval(q);q=-1}var f,g,h,k,l,n,q=-1,m=!1;try{this.bind("mousedown",c),this.bind("mousemove",d),this.bind("mouseup",e),this.bind("mouseleave",e)}catch(r){}try{this.bind("touchstart",c),this.bind("touchmove",d),this.bind("touchend",e),this.bind("touchleave",e)}catch(s){}};
(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,e=c.length;d<e;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 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="",e=0;e<c.length;e++)d+=c.charCodeAt(e).toString();var f=Math.floor(d.length/5),f=parseInt(d.charAt(f)+d.charAt(2*f)+d.charAt(3*f)+d.charAt(4*f)+d.charAt(5*
f)),g=Math.round(c.length/2),h=Math.pow(2,31)-1,e=parseInt(b.substring(b.length-8,b.length),16);b=b.substring(0,b.length-8);for(d+=e;10<d.length;)d=(parseInt(d.substring(0,10))+parseInt(d.substring(10,d.length))).toString();for(var d=(f*d+g)%h,k="",l="",e=0;e<b.length;e+=2)k=parseInt(parseInt(b.substring(e,e+2),16)^Math.floor(d/h*255)),l+=String.fromCharCode(k),d=(f*d+g)%h;return unescape(l)}}
var divHint=Class({create:function(b,c,d,e){this.instance=$("<div class='hint'></div>");this.setText(b);void 0==e&&(e=bookContainer);e.append(this.instance);this.instance.css({display:"none",opacity:0});this.moveto(c,d);this.animation=!1},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"})},
setText:function(b){this.instance[0].innerText=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 e=this,f=document.createElement("script");f.type="text/javascript";f.async=!0;f.onload=f.onreadystatechange=function(){e.readyState&&"loaded"!=e.readyState&&"complete"!=e.readyState||(f.onload=f.onreadystatechange=null,void 0!=c&&c())};f.onerror=function(){void 0!=d&&d()};$("body")[0].appendChild(f);f.src=b}
function addProgressBar(b,c,d){if(void 0!=b&&null!=b&&(void 0==b.progressBar||null==b.progressBar)){var e=$("<div></div>"),f=$("<div></div>");c=void 0==c||null==c?$(b).outerWidth():c;d=void 0==d||null==d?$(b).outerHeight():d;var g=$("<img src='"+uiBaseURL+"progress.gif' style='position:absolute;' />");f.css({background:"#000000",opacity:"0.3",width:c+"px",height:d+"px","z-index":"0"});e.css({width:c+"px",height:d+"px","z-index":"100"});g.css({left:(c-31)/2+"px",top:(d-31)/2+"px","z-index":"1"});e.append($(f));
e.append($(g));b.append($(e));b.progressBar=e}}function clearProgressBar(b){void 0!=b.progressBar&&null!=b.progressBar&&b.progressBar.remove()}
function setAnimation(b,c,d,e){if(b&&void 0!=c){1>c&&(c*=1E3);if(void 0==d||""==d)d="all";void 0==e&&(e="ease-in-out");d=d+" %dms "+e;0<c?b.css({"-moz-transition":String.format(d,"-moz-",c),"-webkit-transition":String.format(d,"-webkit-",c),"-o-transition":String.format(d,"-o-",c),"-ms-transition":String.format(d,"-ms-",c),transition:String.format(d,"",c)}):b.css({"-moz-transition":"","-webkit-transition":"","-o-transition":"","-ms-transition":"",transition:""})}}
function animateOnce(b,c,d,e,f,g){if(b&&c&&void 0!=d&&0!==d){var h=!1;setAnimation(b,d,f,g);b.one("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){!0!=h&&(h=!0,setAnimation(b,0),e&&e instanceof Function&&e())});b.css(c)}}
function ScrollFunction(b,c,d,e){var f=this,g;$(c).transform(0,0);$(c).bind(_event._down,function(b){f.scrollMouseDown=!0;d.isDrag=!1;b=isTouch?b.originalEvent.touches:[b];f.mouseDownY=b[0].pageY;g=getPoint(c).y;3==browserType?event.cancelBubble=!0:event.stopPropagation();return!1});$(c).bind(_event._move,function(h){if(f.scrollMouseDown){h=isTouch?h.originalEvent.touches:[h];h=f.mouseDownY-h[0].pageY;var k=g-h,k=Math.min(0,k),k=Math.max(b.outerHeight()-c.outerHeight(),k);b.outerHeight()<c.outerHeight()&&
(c.transform(0,k),void 0!=e&&e());1>Math.abs(h)?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 f=-30;0<Math.max(-1,Math.min(1,d.wheelDelta||-d.detail))&&(f=30);g=getPoint(c).y;d=g+f;d=Math.min(0,d);d=Math.max(b.outerHeight()-c.outerHeight(),d);b.outerHeight()<c.outerHeight()&&c.transform(0,d);void 0!=e&&e();return!1});
$(c).bind(_event._end,function(b){return f.scrollMouseDown=!1});$(c).bind(_event._leave,function(b){return f.scrollMouseDown=!1});$(c).hammer().on("doubletap",function(b){return!1}.bind(this))}function autoCenter(b,c,d,e){if(b&&!(0>=b.length)){var f=b.length;c=Math.max((c-d*f)/(f-1),0);void 0==e&&(e=0);for(var g=0;g<f;g++)b[g].css("left",c*g+d*g+e)}}
var VERSION_NAME="2.2.9",BUILD_DATE="2014103001",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},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.pageeditor::TAnnoAdvancedSound",ANNO_AUDIO2:"com.mobiano.flipbook.pageeditor::TAnnoWavemusicPlayer",ANNO_AUDIO3:"com.mobiano.flipbook.pageeditor::TAnnoPlugIn",ANNO_AUDIO4:"",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.pageeditor.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_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_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"},PlayEvt:{EVT_PLAY:"EVT_PageViewed",EVT_STOP:"EVT_PageOffView"},TriggerEventType:{MouseDown:"mouseDown",MouseOver:"mouseOver",MouseOut:"mouseOut"},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"}},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(){return Hammer.HAS_TOUCHEVENTS&&
navigator.userAgent.match(Hammer.MOBILE_REGEX)},_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 WebScheme={HTTP:"http",HTTPS:"https",FTP:"ftp",MAILTO:"mailto",IDAP:"idap",FILE:"file",NEWS:"news",GOPHER:"gopher",TELNET:"telnet"},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)"},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};return b},translate2D=function(b,c){return" translate("+b+"px,"+c+"px)"};
$.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})};
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(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?(flipBook.gotoPage(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?singlePageBook.gotoPage(singlePageBook.currentPageIndex+1):bookType==BookType.zoom_book?!0==zoomBook.doublePage?zoomBook.gotoPage(2*Math.floor(zoomBook.currentIndex/2+1)):zoomBook.gotoPage(parseInt(zoomBook.currentIndex)+
1):bookType==BookType.slide_book?(slideBook.gotoPage(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?singleSlideBook.gotoPage(parseInt(singleSlideBook.currentIndex)+1):bookType==BookType.catalog_book?
(catalogBook.gotoPage(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?singleCatalogBook.gotoPage(parseInt(singleCatalogBook.currentIndex)+1):bookType==BookType.phone_book?(phoneBook.gotoPage(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&&singlePhoneBook.gotoPage(parseInt(singlePhoneBook.currentIndex)+1)},previousPageFun=function(){bookType==BookType.normal_book?(flipBook.gotoPage(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?(catalogBook.gotoPage(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?singlePageBook.gotoPage(singlePageBook.currentPageIndex-1):bookType==BookType.zoom_book?!0==zoomBook.doublePage?zoomBook.gotoPage(2*Math.floor(zoomBook.currentIndex/2-1)+1):zoomBook.gotoPage(zoomBook.currentIndex-1):bookType==BookType.slide_book?slideBook.gotoPage(slideBook.currentIndex-1):bookType==BookType.singleSlide_book?singleSlideBook.gotoPage(parseInt(singleSlideBook.currentIndex)-
1):bookType==BookType.singleCatalog_book?singleCatalogBook.gotoPage(parseInt(singleCatalogBook.currentIndex)-1):bookType==BookType.phone_book?phoneBook.gotoPage(phoneBook.currentIndex-1):bookType==BookType.singlePhone_book&&singlePhoneBook.gotoPage(singlePhoneBook.currentIndex-1)},firstPageFun=function(){bookType==BookType.normal_book?flipBook.gotoPage(1):bookType==BookType.single_book?singlePageBook.gotoPage(1):bookType==BookType.zoom_book?zoomBook.gotoPage(1):bookType==BookType.slide_book?slideBook.gotoPage(1):
bookType==BookType.singleSlide_book?singleSlideBook.gotoPage(1):bookType==BookType.catalog_book?catalogBook.gotoPage(1):bookType==BookType.singleCatalog_book?singleCatalogBook.gotoPage(1):bookType==BookType.phone_book?phoneBook.gotoPage(1):bookType==BookType.singlePhone_book&&singlePhoneBook.gotoPage(1)},lastPageFun=function(){bookType==BookType.normal_book?flipBook.gotoPage(totalPageCount):bookType==BookType.single_book?singlePageBook.gotoPage(originTotalPageCount):bookType==BookType.zoom_book?zoomBook.gotoPage(originTotalPageCount):
bookType==BookType.slide_book?slideBook.gotoPage(originTotalPageCount):bookType==BookType.singleSlide_book?singleSlideBook.gotoPage(originTotalPageCount):bookType==BookType.catalog_book?catalogBook.gotoPage(originTotalPageCount):bookType==BookType.singleCatalog_book?singleCatalogBook.gotoPage(originTotalPageCount):bookType==BookType.phone_book?phoneBook.gotoPage(originTotalPageCount):bookType==BookType.singlePhone_book&&singlePhoneBook.gotoPage(originTotalPageCount)},gotoPageFun=function(b){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)},
getPageDir=function(b,c,d){if(0>=b||void 0!=d&&b>d)return"";var e;d=global.fliphtml5_pages;if(void 0!=d&&0<d.length){d=d[b-1];if(void 0!=d&&null!=d)switch(c){case "normal":e=void 0==d.n?d.l:d.n;break;case "large":e=d.l;break;case "thumb":e=d.t}if(void 0==e)switch(c){case "normal":return e=getString("normalPath","files/page/")+b+".jpg";case "large":return e=getString("largePath","files/large/")+b+".jpg";case "thumb":return e=getString("thumbPath","files/thumbnail/")+b+".jpg"}return void 0==e?"":e}switch(c){case "normal":return e=
getString("normalPath","files/page/")+b+".jpg",void 0==e?"":e;case "large":return e=getString("largePath","files/large/")+b+".jpg",void 0==e?"":e;case "thumb":return e=getString("thumbPath","files/thumbnail/")+b+".jpg",void 0==e?"":e}},getPageWidthHeight=function(b,c,d,e){var f=Point(0,0);b/c>d/e?(f.x=d*c/e,f.y=c):(f.x=b,f.y=b*e/d);return f},getPageWidthHeightByWidth=function(b,c,d,e){c=Point(0,0);c.x=b;c.y=b*e/d;return c},pointToLineDistance=function(b,c,d,e,f,g){var h=g-e,k=d-f;return Math.abs(h*
b+k*c+(f*e-d*g))/Math.sqrt(h*h+k*k)},globalToBook=function(b,c,d,e){void 0==e&&(e=!1);var f;e?f=Point(c-singlePageBook.getLeft(),d-singlePageBook.getTop()):bookType==BookType.normal_book?f=Point(c-((b?0:flipBook.getPageWidth())+flipBook.getLeft()),d-flipBook.getTop()):bookType==BookType.catalog_book&&(e=catalogBook.getTran(),b=c-((b?0:catalogBook.getPageWidth())+catalogBook.getCssLeft())-e.x,d=d-catalogBook.getCssTop()-e.y,f=Point(b,d));return f};bdor[32]=function(b,c){return b+c};
var changeShowBook=function(b){switch(b){case 0:bookType=BookType.normal_book;singlePageBook.setSingleBookVisible(!1);zoomBook.hide();flipBook.show();zoomBook.changePageMode(!0);thumbButtonEnable&&thumbnail.mergeAll();break;case 1:bookType=BookType.single_book;singlePageBook.setSingleBookVisible(!0);zoomBook.hide();flipBook.hide();zoomBook.changePageMode(!1);thumbButtonEnable&&thumbnail.fissionAll();break;case 2:bookType=BookType.zoom_book;singlePageBook.setSingleBookVisible(!1);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()}},computeMousePoint=function(b,c,d,e,f,g){var h=function(){return 0<=b.indexOf("l")},k=function(){return 0<=b.indexOf("t")},l=function(){return 0<=b.indexOf("b")},n=Point(c,
d),q,m,r,s;r=h()?e-c:c;s=l()?f-d:d;q=Math.sqrt(Math.pow(r,2)+Math.pow(s,2));m=Math.sqrt(Math.pow(r,2)+Math.pow(f-s,2));var t;if(q>e&&m>g){r=Math.abs(r/(f-s));var u=e/f;0>=s&&r>=u?(n=c,t=d,r>u&&(n=h()?e-(e-n)*e/q:n*e/q,t=l()?f-(f-t)*e/q:t*e/q),0>s&&(r=h()?e-n:n,s=l()?f-t:t,m=Math.sqrt(Math.pow(r,2)+Math.pow(f-s,2)),n=h()?e-(e-n)*g/m:n*g/m,t=k()?f-(f-t)*g/m:t*g/m)):q-e>=m-g?(n=h()?e-(e-c)*e/q:c*e/q,t=l()?f-(f-d)*e/q:d*e/q):(n=h()?e-(e-c)*g/m:c*g/m,t=k()?f-(f-d)*g/m:d*g/m);n=Point(n,t)}else q>e&&(n=
h()?e-(e-c)*e/q:c*e/q,t=l()?f-(f-d)*e/q:d*e/q,n=Point(n,t)),m>g&&(n=h()?e-(e-c)*g/m:c*g/m,t=k()?f-(f-d)*g/m:d*g/m,n=Point(n,t));k()&&0==n.y?n.y=0.002*f:l()&&n.y==f&&(n.y=0.998*f);return n},computePoint=function(b,c,d,e,f,g,h,k){var l,n;l=Point(c,d);l=computeMousePoint(b,c,d,e,f,g);d=l.x;n=l.y;l=function(){return 0<=b.indexOf("l")};c=function(){return 0<=b.indexOf("t")};switch(b){case "tl":actualPoint=Point(d,n);middlePoint=Point(e-actualPoint.x/2,n/2);endPoint=Point(2*e,0);break;case "tr":actualPoint=
Point(e-d,n);middlePoint=Point(e-actualPoint.x/2,actualPoint.y/2);endPoint=Point(-e,0);break;case "bl":actualPoint=Point(d,f-n);middlePoint=Point(e-actualPoint.x/2,actualPoint.y/2);endPoint=Point(2*e,f);break;case "br":actualPoint=Point(e-d,f-n),middlePoint=Point(e-actualPoint.x/2,actualPoint.y/2),endPoint=Point(-e,f)}var q=Point(0,0),m=Math.PI/2,r=Math.atan2(actualPoint.y,actualPoint.x);n=m-r;d=180*n/Math.PI;var s=n-Math.atan2(middlePoint.y,middlePoint.x);distance=Math.max(0,Math.sin(s)*Math.sqrt(Math.pow(middlePoint.x,
2)+Math.pow(middlePoint.y,2)));noMovePoint=Point(distance*Math.sin(n),distance*Math.cos(n));var t,u;n>m&&(noMovePoint.x+=Math.abs(noMovePoint.y*Math.tan(r)),noMovePoint.y=0,q=Math.PI-n,g=g-f/Math.sin(q)-(noMovePoint.x-f/Math.tan(q))*Math.cos(q),q=Point(Math.round(g*Math.cos(q)),Math.round(g*Math.sin(q))),l()&&(q.x=-q.x),c()&&(q.y=-q.y));r=Math.sqrt(Math.pow(endPoint.x-actualPoint.x,2)+Math.pow(endPoint.y-actualPoint.y,2));g=Math.round(noMovePoint.y/Math.tan(n)+noMovePoint.x);l()&&(g=e-g);m=l()?g:
e-g;s=m*Math.cos(2*n);t=m*Math.sin(2*n);g=Point(Math.round(g+(l()?-s:s)),Math.round(c()?t:f-t));t=m*Math.sin(n);var w=actualPoint.x/2,A=actualPoint.y/2,m=Point(w/e*100,A/f*100),r=r<e?r/e:1,s=100<t?(t-100)/t:0;c()||(m.y=100-m.y);l()&&(m.x=100-m.x);u=Point(w/e*100,A/f*100);l()||(u.x=100-u.x);c()||(u.y=100-u.y);var z=getBrowserPre();if("-webkit-"!=z){var v=Point(w,A);c()||(v.y=f-v.y);l()&&(v.x=e-v.x);var w=100,w=Math.round(100*s),A=Math.round(100*(0.8*(1-s)+s)),B=l()?e:0,C=c()?0:f,B=v.x-B,C=v.y-C,v=
Math.atan2(-C,B),v=180*v/Math.PI,B=getShadowRate(B,C,e,f,c());h.css({"background-image":z+"linear-gradient( "+v+"deg,  rgba(0,0,0,0) "+w*B+"%, rgba(0,0,0,"+0.2*r+") "+A*B+"%, rgba(255,255,255,"+0.2*r+") "+100*B+"%)"});n=Point(t*Math.sin(n),t*Math.cos(n));l()||(n.x=e-n.x);c()||(n.y=f-n.y);B=l()?0:e;C=c()?0:f;B=n.x-B;C=n.y-C;v=Math.atan2(-C,B);v=180*v/Math.PI;B=getShadowRate(B,C,e,f,c());w=100*B;ff_gradientStart=0.6*w;k.css({"background-image":z+"linear-gradient( "+v+"deg, rgba(0,0,0,0) "+ff_gradientStart+
"%, rgba(0,0,0,"+0.4*r+") "+w+"%, rgba(0,0,0,0) 100% )"})}"-webkit-"==z&&(h.css({"background-image":z+"gradient(linear, "+(l()?100:0)+"% "+(c()?0:100)+"%, "+m.x+"% "+m.y+"%, color-stop("+s+",rgba(0,0,0,0)), color-stop("+(0.8*(1-s)+s)+",rgba(0,0,0,"+0.2*r+")), to(rgba(255,255,255,"+0.2*r+")))"}),k.css({"background-image":z+"gradient(linear, "+(l()?0:100)+"% "+(c()?0:100)+"%, "+u.x+"% "+u.y+"%,  color-stop(0.6,rgba(0,0,0,0)), color-stop(1, rgba(0,0,0,"+0.2*r+")), to(rgba(0,0,0,0)))"}),Log.debug(h.css("background-image")));
return{Angle:d,Mv:q,Df:g,NomovePoint:noMovePoint}},getShadowRate=function(b,c,d,e,f){var g=0,h=1,h=Math.sqrt(Math.pow(b,2)+Math.pow(c,2));Math.atan2(c,b);var k=Math.sqrt(Math.pow(d,2)+Math.pow(e,2));b=Math.abs(b);var l=Math.abs(c),n=Math.atan2(e,d);d=Math.atan2(l,b);b=Math.abs(n-d);k*=Math.cos(b);h/=k;if(f&&0>c||!f&&0<c)g=e*Math.sin(d)/k;return h+g},setCurrentIndexTextField=function(b,c){var d=bookConfig.totalPagesCaption,e=bookConfig.pageNumberCaption;void 0==d&&(d="");void 0==e&&(e="");if(""!=e)if(1!=
b&&b!=totalPageCount&&c){var e=2*Math.floor(b/2),f=getShownPageNumber(e),g=getShownPageNumber(e+1);b=rightToLeft?g+"-"+f:f+"-"+g}else e=b=getShownPageNumber(b);else 1!=b&&b!=totalPageCount&&c?(f=e=2*Math.floor(b/2),g=e+1,b=rightToLeft?g+"-"+f:f+"-"+g):e=b;""==d?(d=totalPageCount,c||(d=originTotalPageCount)):(d=f=parseInt(d),c||(d=totalPageCount-originTotalPageCount+f));$("#guidPageIndex").html("<b>"+(e+"/"+d)+"</b>");void 0!=$("#currentPageIndexTextField")&&null!=$("#currentPageIndexTextField")&&
void 0!=$("#currentPageIndexTextField")[0]&&null!=$("#currentPageIndexTextField")[0]&&$("#currentPageIndexTextField").val(rightToLeft?d+"/"+b:b+"/"+d)},getShownPageNumber=function(b){var c=bookConfig.pageNumberCaption;if(""==c||void 0==c)return b;";"!=c.substr(c.length-1,1)&&(c+=";");for(var c=c.split(";"),d=[],e=0,f=0,g=0,h=c.length;g<h-1;g++)if(""!=c[g]&&void 0!=c[g])if(f=c[g].split(":"),-1<f[1].indexOf("+")){e=f[0];h=e.indexOf("-");sMinPage=e.substring(0,h);sMaxPage=e.substring(h+1,e.length);for(var k=
parseInt(sMinPage),l=parseInt(sMaxPage),f=parseInt(f[1].replace("+","")),e=l,h=k;h<=l;h++)d[h]=h-k+f}else k=parseInt(f[0]),d[k]=void 0==f[1]?"":f[1];return b>e?b:d[b]},getSpeedArray=function(b,c){for(var d=c/2,e=(b-b/4)/d,f=Array(c),g=0;g<c;g++)f[g]=g<d?b-(d-g)*e:b+(g-d+1)*e;return f.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)c=b.style.transform;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))},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.form=
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.photo,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"))},
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(e){return c}},getBool=function(b,c){var d=["true","yes","show","enable"],e=["false","no","hide","disable"],f=getAliasValue(b);try{f=f.toLowerCase()}catch(g){return c}return 0>d.indexOf(f)&&0>e.indexOf(f)?c:0<=d.indexOf(f)},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"],e=["false","no","hide","disable"];b=b.toLowerCase();return 0>d.indexOf(b)&&0>e.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 e=frmSearch.textField.val().toLowerCase();""==e&&(d=!0);if(!0==d)clearHighlightFun(b);else{for(var f,d=0;d<positionForPages.length;d++)if(positionForPages[d].page==c){f=positionForPages[d].positions;break}if(void 0==f)clearHighlightFun(b);else{var g="url("+uiBaseURL+"highlight.png)",
h="",k="",l="",n="";if(0<f.length){for(d=0;d<f.length;d++){var q=f[d];if(-1<q.word.toLowerCase().indexOf(e))var m=q.left/(1-q.width),r=q.top/(1-q.height),h=h+g+",",n=n+"no-repeat,",k=k+100*m+"% "+100*r+"%,",l=l+100*q.width+"% "+100*q.height+"%,"}0<h.length?(h=h.substr(0,h.length-1),n=n.substr(0,n.length-1),k=k.substr(0,k.length-1),l=l.substr(0,l.length-1),b.css({"background-image":h,"background-repeat":n,"background-position":k,"-webkit-background-size":l,"-o-background-size":l,"background-size":l,
display:"block"})):clearHighlightFun(b)}else clearHighlightFun(b)}}}},clearHighlightFun=function(b){b.css({"background-image":""});b.css({display:"none"})},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.gotoPageIndex,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(){navigator.userAgent.toLowerCase();return $.browser.msie||11==$.browser.version},isIE11=function(){navigator.userAgent.toLowerCase();return 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:!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()?!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;' src='"+bookConfig.appLogoIcon+"'/></div>");this.miniLogo.css({position:"absolute",right:0,bottom:0});$(this.miniLogo).mouseOverCursor();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:"relative"});this.background=$("<div></div>");this.background.css({width:"100%",height:"100%",
background:"#000000",opacity:"0.5","border-radius":"5px","z-index":"0",position:"abosolute"});this.title=$("<div class='printBox'></div>");this.title.css({"z-index":"1","line-height":"100%",height:"100%",width:"100%",left:"0px",top:"0px","vertical-align":"middle","text-align":"center","text-shadow":"1px 1px #000000",position:"abosolute"});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(){var b=this;this.box.mouseOverCursor();this.box.bind(_event._end,function(){var c=$("body")[0];fullScreenApi.supportsFullScreen?fullScreenApi.isFullScreen()?fullScreenApi.cancelFullScreen():fullScreenApi.requestFullScreen(c):c.webkitSupportsFullscreen&&c.webkitEnterFullscreen(Element.ALLOW_KEYBOARD_INPUT);b.box.css({display:"none"});return!1});$(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(),!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||bookType==BookType.singleSlide_book||bookType==BookType.singleCatalog_book||bookType==BookType.catalog_book||isPhone()?!1:!0}
function addAdSense(b,c,d,e,f){loadJavascript("http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",function(){var g=document.createElement("ins"),g=$(g);g.addClass("adsbygoogle");g.css({display:"inline-block",width:d+"px",height:e+"px"});g.attr("data-ad-client",f);var h=$("<div/>");h.css({position:"absolute","z-index":1,left:b+"px",top:c+"px",width:d+"px",height:e+"px"});$("body").append(h);h.append(g);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},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}if(void 0==b||null==b)b=flipBook;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 e=0;e<d.length;e++){var f=d[e];if(bookConfig[f])return bookConfig[f]}return c}catch(g){return c}},getLanguageValue=function(b,c){try{if(!aliasLanguage)return c;var d=aliasLanguage[b];if(!d)return c;for(var e=0;e<d.length;e++){var f=d[e];if(selectedLanguage[f])return selectedLanguage[f]}return c}catch(g){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",
"Show"));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",""));void 0==bookConfig.addPaperCoil&&(bookConfig.addPaperCoil=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));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')"}),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){return!1});$(this.formBackground).bind(_event._move,function(b){return!1});$(this.formBackground).bind(_event._end,function(b){return!1})},
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")},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,e,f,g,h,k){this.width=e;this.height=f;this.background=$("<div></div>");c=c.replaceAll("<","&lt");c=c.replaceAll(">","&gt");this.textField=new label(c,this.background);this.mainColor=g;this.pageIndex=b;this.mouseLeaveColor=h;this.mouseOverColor=k;e=colorDiv(this.mouseLeaveColor,20);f=colorAdd(this.mainColor,20);$(this.background).css({"background-color":this.mouseLeaveColor,width:this.width+"px",height:this.height+"px",position:"absolute","border-bottom":"1px solid "+e,"border-top":"1px solid "+
f,cursor:"pointer"});$(this.background).css({"text-shadow":"1px 1px "+colorAdd(this.mainColor,40)});$(this.background).css({overflow:"hidden"});this.textField.onResize(this.width-20,this.height-16);this.textField.setLabelPosition(10,8);this.isMouseMove=!1;this.downPoint=Point(0,0);var l=this;$(d).append(this.background);$(this.background).bind(_event._end,function(){(global.phoneSearch&&!global.phoneSearch.isDrag||!global.phoneSearch&&!isSearchDrag)&&gotoPageFun(l.pageIndex)});b="<b>P."+b+": </b>"+
this.cutText(c,searchWord);bdor[22]="l";this.textField.setCaption(b);this.textField.riseAWord(searchWord);this.textField.setFont("12px",bookConfig.searchFontColor,"arial");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-20,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,e=b.toLowerCase().indexOf(c.toLowerCase()),f;60<=e?(f=Math.max(60<=d-e?e-60:d-120,0),f=".."+b.substring(f,e)):f=b.substring(0,e);d=60<d-e?b.substring(e,60<=e?e+60:120)+"..":b.substring(e,d);return f+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 id='search_text_textField'/>");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>");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.mouseup(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(){l==g?(window.clearTimeout(d.timeout),clearProgressBar(d.contentBox)):(h=l*f,k=Math.min((l+1)*f,e),d.timeout=window.setTimeout(function(){for(var e=k,f=h;f<e;f++){var g=b[f],r=new searchItem(g.search_page,g.search_text,
d.searchScrollBox,d.itemWidth,d.itemHeight,d.itemLeaveColor,d.itemLeaveColor,colorDiv(d.itemLeaveColor,15));d.itemArr.push(r);searchPageArr.push(g.search_page);r.setPosition(0,f*(r.getHeight()+2))}d.hideScrollBar&&d.searchScrollBox.css({height:(r.getHeight()+2)*d.itemArr.length});l++;c()},100))}var d=this;this.itemArr=[];searchPageArr=[];var e=this.itemCount=b.length,f=15,g=Math.ceil(e/f),h,k,l=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;b=searchFromPages(textForPages,b);this.resultContent.html("&nbsp;&nbsp;"+getLanguage("lblPages","Pages")+" : "+b.length);this.addItems(b);for(b=0;b<BookInstance.length;b++)void 0!=BookInstance[b]&&BookInstance[b].addSearchHighlight()},searchStart:function(){var b=
this.textField.val();this.search(b)},search:function(b){sendvisitinfo(6,BookInfo.getBook().getCurrentPageIndex());0<bookConfig.leastSearchChar&&b.length<bookConfig.leastSearchChar?this.resultContent.html("&nbsp;&nbsp;"+getLanguage("pnlSearchInputInvalid","The search text is too short.")):!1==loadSearchFlag?(loadJavascript(bookConfig.searchTextJS,function(){loadSearchFlag=!0;this.doSearch(b)}.bind(this),function(){loadSearchFlag=!0;textForPages=[]}),isTouchDevice()||loadJavascript(bookConfig.searchPositionJS)):
this.doSearch(b)},closeForm:function(){if(this.isSearchShow){var b=windowWidth/4,b=Math.max(300,b);this.formBackground.animate({left:-b-20},400,function(){this.clearItems();this.itemArr=[];this.isSearchShow=!1}.bind(this));for(b=this.itemCount=0;b<BookInstance.length;b++)void 0!=BookInstance[b]&&BookInstance[b].clearSearchHighlight()}},showForm:function(){this.formBackground.animate({left:10},400,function(){this.textField.focus();this.isSearchShow=!0}.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.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' style='overflow:hidden;'></div>");this.searchScrollBox=$("<div id='searchScrollBox'></div>");this.textField=$('<input id="search_text_textField" style="position : absolute" type="text" size="13">');this.searchButton=$("<img src='"+uiBaseURL+"searchButton.png'/>");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;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-left":"5px","font-family":"Tahoma"});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;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(){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});var d=
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:d.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(){d.flipModel.css({cursor:"pointer",border:"2px solid #ff8040"})});this.padModel.bind(_event._enter,function(){d.padModel.css({cursor:"pointer",
border:"2px solid #ff8040"})});this.flipModel.bind(_event._leave,function(){d.flipModel.css({cursor:"pointer",border:""})});this.padModel.bind(_event._leave,function(){d.padModel.css({cursor:"pointer",border:""})});b.append(this.bg);this.bg.append(this.loadingBox);this.showHide(!1)}
loadingBook.prototype.chooseFlipSlide=function(){var b=this;if(isPhoneBook())this.showHide(!1),isFlipModel=!1,b.hide(),bookType=windowWidth>windowHeight?4:5,init(),toolBar.hide(),QRbutton.css({display:"none"});else if("flip"!=bookConfig.FlipStyle.toLowerCase()||isBelowIE9())if("slide"==bookConfig.FlipStyle.toLowerCase()||isBelowIE9())this.showHide(!1),isFlipModel=!1,b.hide(),bookType=!0==userConfig.showDoublePage?3:6,miniStyle=new MiniStyle(tmpContainer),init(),window.setTimeout(function(){},200);
else if("catalog"!=bookConfig.FlipStyle.toLowerCase()||isBelowIE9()){this.showHide(!0);this.flipModel.bind(_event._end,function(){isFlipModel=!0;b.hide();bookType=0;miniStyle=new MiniStyle(tmpContainer);init()});this.padModel.bind(_event._end,function(){isFlipModel=!1;b.hide();bookType=!0==userConfig.showDoublePage?3:6;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)}else rightToLeft=!1,bookConfig.RightToLeft=!1,this.showHide(!1),isFlipModel=!1,b.hide(),bookType=BookType.catalog_book,miniStyle=new MiniStyle(tmpContainer),init();else this.showHide(!1),isFlipModel=!0,this.hide(),bookType=
windowWidth>windowHeight?BookType.normal_book:BookType.single_book,miniStyle=new MiniStyle(tmpContainer),init(),showFlipButton&&leftRightButton.show()};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"],e=0;e<d.length;e++)try{c=new ActiveXObject(d[e]);c.async=!1;c.loadXMLString(b);break}catch(f){}else if(window.DOMParser&&document.implementation&&document.implementation.createDocument)try{domParser=new DOMParser,c=domParser.parseFromString(b,"text/xml")}catch(g){}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"],e=0;e<d.length;e++)try{c=new ActiveXObject(d[e]);break}catch(f){}else if(document.implementation&&document.implementation.createDocument)try{c=document.implementation.createDocument("","",null)}catch(g){}else return null;null!=c&&(c.async=!1,c.load(b));return c}
function link(b,c){var d=$("<div style='position: absolute;'></div>"),e=pageEditor[b-1][c].action;void 0!=e.length&&(e=e[0]);var f=e.url;null!=f&&"www."==f.substr(0,4).toLowerCase()&&(f="http://"+f);var g;try{g=e.triggerEventType}catch(h){g=null}bdor[10]="l";d.bind(_event._down,function(h){h=colorTo0x(pageEditor[b-1][c].downColor);d.css({"background-color":h,opacity:pageEditor[b-1][c].downAlpha});g==PageEditor.TriggerEventType.MouseDown&&(e.actionType==PageEditor.ActionType.GOTO_PAGE?gotoPageFun(e.pageIndex):
e.actionType==PageEditor.ActionType.OPEN_URL&&(sendvisitinfo(3,b),window.open(f,e.linkTarget)));3==browserType?event.cancelBubble=!0:event.stopPropagation()});d.bind("mouseover",function(h){h=colorTo0x(pageEditor[b-1][c].overColor);d.css({"background-color":h,opacity:pageEditor[b-1][c].overAlpha});g==PageEditor.TriggerEventType.MouseOver&&(e.actionType==PageEditor.ActionType.GOTO_PAGE?gotoPageFun(e.pageIndex):e.actionType==PageEditor.ActionType.OPEN_URL&&window.open(f,e.linkTarget))});d.bind(isTouch?
_event._end:"mouseout",function(h){h=colorTo0x(pageEditor[b-1][c].outColor);d.css({"background-color":h,opacity:pageEditor[b-1][c].outAlpha});g==PageEditor.TriggerEventType.MouseOut&&(e.actionType==PageEditor.ActionType.GOTO_PAGE?gotoPageFun(e.pageIndex):e.actionType==PageEditor.ActionType.OPEN_URL&&window.open(f,e.linkTarget))});$.fn.extend(d,{onResize:function(e,f){var g=pageEditor[b-1][c].location;d.css({top:g.y*f+"px",left:g.x*e+"px",width:g.width*e+"px",height:g.height*f+"px"})}});return d}
bdor[10]="l";
function initLink(b,c,d,e){this.link=$("<div style='position: absolute;'></div>");this.config=$.extend({width:0.2,height:0.2,x:0.2,y:0.2,action:null},c);this.pw=d;this.ph=e;this.width=this.pw*this.config.width;this.height=this.ph*this.config.height;b.append(this.link);void 0==this.config.downColor?(this.config.downColor=getColor("LinkDownColor","#808080"),this.config.downAlpha=getInt("LinkAlpha",0.6),this.config.overColor=this.config.downColor,this.config.outColor=this.config.downColor,this.config.overAlpha=
this.config.downAlpha/2,this.config.outAlpha=0):(this.config.downColor=colorTo0x(this.config.downColor),this.config.overColor=colorTo0x(this.config.overColor),this.config.outColor=colorTo0x(this.config.outColor));this.link.css({position:"absolute",top:this.config.y*this.ph+"px",left:this.config.x*this.pw+"px",width:this.width+"px",background:"rgba(0,0,0,0)",height:this.height+"px"});this.father=b;this.initEvt()}bdor[29]="t";
initLink.prototype.onResize=function(b,c){this.pw=b;this.ph=c;this.width=this.config.width*b;this.height=this.config.height*c;var d=this.config.y*c,e=this.config.x*b;this.link.css({width:this.width+"px",height:this.height+"px"});this.setPosition(e,d);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())};
initLink.prototype.setPosition=function(b,c){this.link.css({left:b+"px",top:c+"px"})};
initLink.prototype.initEvt=function(){var b=this;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(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(e){d=null}}this.link.bind(_event._down,function(c){b.link.css({"background-color":b.config.downColor,
opacity:b.config.downAlpha,cursor:"pointer"});d==PageEditor.TriggerEventType.MouseDown&&actionEvent.bind(b)($(this));3==browserType?event.cancelBubble=!0:event.stopPropagation()});this.link.bind("mouseover",function(c){b.link.css({"background-color":b.config.overColor,opacity:b.config.overAlpha,cursor:"pointer"});d==PageEditor.TriggerEventType.MouseOver&&actionEvent.bind(b)($(this))});this.link.bind(isTouch?_event._end:"mouseout",function(c){b.link.css({"background-color":b.config.outColor,opacity:b.config.outAlpha,
cursor:"default"});d==PageEditor.TriggerEventType.MouseOut&&actionEvent.bind(b)($(this))});var f=void 0;null!=this.config.action&&this.config.action.actionType==PageEditor.ActionType.GOTO_PAGE&&(f=this.config.action.pageIndex);if(null!=this.linkURL||void 0!=f)b=this,this.link.hint=null,this.link.bind(_event._enter,function(){var c=b.config.y*b.ph+b.height,d=b.config.x*b.pw,e=function(){var e=b.link.hint.width(),f=b.link.hint.height();d+e>b.pw&&(d-=d+e-b.pw);c+f>b.ph&&(c=c-b.height-f)};if(null==b.link.hint){var l=
b.linkURL;void 0!=f&&(l=getLanguage("gotoPage","page:")+f);b.link.hint=new divHint(l,d,c,b.father);e();b.link.hint.moveto(d,c);b.link.hint.setAnimate(!0)}e();b.link.hint.moveto(d,c);b.link.hint.show()}),this.link.bind(_event._leave,function(){null!=b.link.hint&&b.link.hint.hide()})};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({width:"300px",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"})},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,e,f=0,g=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});e=$("<img src = '"+bookConfig.largePath+c+".jpg'/>");e.css({"z-index":"200",left:0,top:0,position:"absolute"});d.append(e);if("Show"==bookConfig.PrintButtonVisible&&""!=bookConfig.printWatermarkFile){var h=
$("<img src = '"+bookConfig.printWatermarkFile+"'/>");h.css({"z-index":"201",left:0,top:0,position:"absolute"});g++;h.load(function(){f++;f==bookConfig.totalPageCount+g&&(b.printArea.printArea(),clearProgressBar(b.contentBox))});d.append(h)}e.load(function(){f++;f==bookConfig.totalPageCount+g&&(b.printArea.printArea(),clearProgressBar(b.contentBox))});b.printArea.append(d)}break;case "printCurrent":if(2==bookType){var f=0,k=1;b.printArea.empty();d=$("<div></div>");d.css({position:"relative"});d.css({width:500,
height:500});e=$("<img src = '"+bookConfig.largePath+zoomBook.currentIndex+".jpg'/>");d.append(e);"Show"==bookConfig.PrintButtonVisible&&""!=bookConfig.printWatermarkFile&&(k=2,h=$("<img src = '"+bookConfig.printWatermarkFile+"'/>"),h.css({"z-index":"201",left:0,top:0,position:"absolute"}),h.load(function(){f++;f==k&&(clearProgressBar(b.contentBox),b.printArea.printArea())}),d.append(h));e.load(function(){f++;f==k&&(clearProgressBar(b.contentBox),b.printArea.printArea())});b.printArea.append(d)}else if(3==
bookType)f=0,k=1,b.printArea.empty(),d=$("<div></div>"),d.css({position:"relative"}),d.css({width:500,height:500}),e=$("<img src = '"+bookConfig.largePath+slideBook.currentIndex+".jpg'/>"),d.append(e),"Show"==bookConfig.PrintButtonVisible&&""!=bookConfig.printWatermarkFile&&(k=2,h=$("<img src = '"+bookConfig.printWatermarkFile+"'/>"),h.css({"z-index":"201",left:0,top:0,position:"absolute"}),h.load(function(){f++;f==k&&(clearProgressBar(b.contentBox),b.printArea.printArea())}),d.append(h)),e.load(function(){f++;
f==k&&(clearProgressBar(b.contentBox),b.printArea.printArea())}),b.printArea.append(d);else if(1==bookType)f=0,k=1,b.printArea.empty(),d=$("<div></div>"),d.css({position:"relative"}),d.css({width:500,height:500}),e=$("<img src = '"+bookConfig.largePath+singlePageBook.gotoPageIndex+".jpg'/>"),d.append(e),"Show"==bookConfig.PrintButtonVisible&&""!=bookConfig.printWatermarkFile&&(k=2,h=$("<img src = '"+bookConfig.printWatermarkFile+"'/>"),h.css({"z-index":"201",left:0,top:0,position:"absolute"}),h.load(function(){f++;
f==k&&(clearProgressBar(b.contentBox),b.printArea.printArea())}),d.append(h)),e.load(function(){f++;f==k&&(clearProgressBar(b.contentBox),b.printArea.printArea())}),b.printArea.append(d);else if(bookType==BookType.normal_book||bookType==BookType.catalog_book)for(g=k=f=0,b.printArea.empty(),k=1==BookInfo.getBook().currentPageIndex||BookInfo.getBook().currentPageIndex==bookConfig.totalPageCount?0:1,c=0;c<=k;c++)d=$("<div></div>"),c!=k&&d.css({"page-break-after":"always"}),d.css({position:"relative"}),
d.css({width:500,height:500}),h=2*parseInt(BookInfo.getBook().currentPageIndex/2)+c,1==BookInfo.getBook().currentPageIndex&&(h=1),e=$("<img src = '"+bookConfig.largePath+h+".jpg'/>"),e.css({"z-index":"200",left:0,top:0,position:"absolute"}),d.append(e),"Show"==bookConfig.PrintButtonVisible&&""!=bookConfig.printWatermarkFile&&(h=$("<img src = '"+bookConfig.printWatermarkFile+"'/>"),h.css({"z-index":"201",left:0,top:0,position:"absolute"}),g++,h.load(function(){f++;f==k+g+1&&(clearProgressBar(b.contentBox),
b.printArea.printArea())}),d.append(h)),e.load(function(){f++;f==k+g+1&&(clearProgressBar(b.contentBox),b.printArea.printArea())}),b.printArea.append(d);break;case "printRange":d=$("#rangeNum").val().split(",");e=[];g=k=c=0;e=[];b.printArea.empty();for(c=0;c<d.length;c++)if(isNaN(d[c]))for(h=d[c].split("-"),f=parseInt(h[0]);f<=parseInt(h[1]);f++)e.push("<img src = '"+bookConfig.largePath+f+".jpg'/>");else e.push("<img src = '"+bookConfig.largePath+d[c]+".jpg'/>");for(c=0;c<e.length;c++)d=$("<div></div>"),
c!=e.length-1&&d.css({"page-break-after":"always"}),d.css({position:"relative"}),d.css({width:500,height:500}),$(e[c]).css({"z-index":"200",left:0,top:0,position:"absolute"}),d.append($(e[c])),"Show"==bookConfig.PrintButtonVisible&&""!=bookConfig.printWatermarkFile&&(h=$("<img src = '"+bookConfig.printWatermarkFile+"'/>"),h.css({"z-index":"201",left:0,top:0,position:"absolute"}),g++,h.load(function(){k++;k==e.length+g&&(clearProgressBar(b.contentBox),b.printArea.printArea())}),d.append(h)),$(e[c]).load(function(){k++;
k==e.length+g&&(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.titleBox=$("<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+"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:(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",right:"0px",position:"absolute"});this.titleBox.css({width:"20px",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.closeButton.append($("<img src='"+uiBaseURL+"close.png'/>").asImageButton());$(this.toolBox).append(this.closeButton);$(this.toolBox).append(this.titleBox);$(this.titleBox).html("Help");this.fillImage();this.initEvent();
userConfig.showHelpContentAtFirst&&userConfig.helpButtonVisible||(this.background.css({display:"none"}),this.contentBox.css({display:"none"}),this.contentBack.css({display:"none"}))}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+"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"});this.closeButton.css({top:"0px",right:"0px"})};
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>"),b.append($("<p><div><li>Drag the page corner to view</li></div></p>")),b.append($("<p><div><li>Double click to zoom in, out</li></div></p>")),b.css({"margin-left":"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' style='text-align: left'/></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' style='text-align: left'/></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"})}
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 e=
Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);if(e){e.addDataFlavor("text/unicode");var f={},f=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);f.data=b;e.setTransferData("text/unicode",f,2*b.length);if(!d)return!1;d.setData(e,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.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 e="",e=e.substring(0,e.lastIndexOf("/"))+"/"+bookConfig.thumbPath+"1.jpg",f="?&url="+c+"&title="+d+"&description="+bookDescription+"&screenshot="+e,c=this.initShareButton("email",f),d=this.initShareButton("facebook",f),e=this.initShareButton("google",f),g=this.initShareButton("mySpace",f),h=this.initShareButton("twitter",f),k=this.initShareButton("digg",
f),f=this.initShareButton("more",f);b.append(c);shareButtonLeft=function(b){return 10+35*b};c.css({top:"10px",left:shareButtonLeft(0)+"px"});b.append(d);d.css({top:"10px",left:shareButtonLeft(1)+"px"});b.append(e);e.css({top:"10px",left:shareButtonLeft(2)+"px"});b.append(g);g.css({top:"10px",left:shareButtonLeft(3)+"px"});b.append(h);h.css({top:"10px",left:shareButtonLeft(4)+"px"});b.append(k);k.css({top:"10px",left:shareButtonLeft(5)+"px"});b.append(f);f.css({top:"10px",left:shareButtonLeft(6)+"px"});
b=window.location.href;0<=b.toLowerCase().indexOf("file:")&&(b="index.html");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)};
harePanel.prototype.initShareButton=function(b,c){var d=$("<div style = 'position: absolute;width:30px;height:30px;'></div>"),e,f;switch(b){case "email":f="http://api.addthis.com/oexchange/0.8/forward/email/offer"+c;e=$("<div class='shareButton' ><img src='"+uiBaseURL+"email.png' class='shareBarImg' /></div>");break;case "facebook":f="http://api.addthis.com/oexchange/0.8/forward/facebook/offer"+c;e=$("<div class='shareButton'><img src='"+uiBaseURL+"facebook.png' class='shareBarImg' /></div>");break;
case "google":f="http://api.addthis.com/oexchange/0.8/forward/igoogle/offer"+c;e=$("<div class='shareButton'><img src='"+uiBaseURL+"google.png' class='shareBarImg' /></div>");break;case "mySpace":f="http://api.addthis.com/oexchange/0.8/forward/myspace/offer"+c;e=$("<div class='shareButton'><img src='"+uiBaseURL+"myspace.png' class='shareBarImg' /></div>");break;case "netvibes":f="http://api.addthis.com/oexchange/0.8/forward/netvibes/offer"+c;e=$("<div class='shareButton'><img src='"+uiBaseURL+"netvibes.png' class='shareBarImg' /></div>");
break;case "twitter":f="http://api.addthis.com/oexchange/0.8/forward/twitter/offer"+c;e=$("<div class='shareButton'><img src='"+uiBaseURL+"twitter.png' class='shareBarImg' /></div>");break;case "digg":f="http://api.addthis.com/oexchange/0.8/forward/digg/offer"+c;e=$("<div class='shareButton'><img src='"+uiBaseURL+"digg.png' class='shareBarImg' /></div>");break;case "more":f="http://api.addthis.com/oexchange/0.8/offer"+c,e=$("<div class='shareButton'><img src='"+uiBaseURL+"more.png' class='shareBarImg' /></div>")}e.css({cursor:"pointer"});
e.attr({title:"Share to "+b});e.bind(_event._end,function(b){sendvisitinfo(2,getShownPageString());window.open(f,"_blank")});d.append(e);d.mouseenter(function(b){$(d).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)"})});d.mousedown(function(b){});d.mouseup(function(b){d.css("background-color","");d.css({"-moz-box-shadow":"",
"-ms-box-shadow":"","box-shadow":"","-webkit-box-shadow":"","-o-box-shadow":""})});d.mouseleave(function(b){d.css("background-color","");d.css({"-moz-box-shadow":"","-ms-box-shadow":"","box-shadow":"","-webkit-box-shadow":"","-o-box-shadow":""})});return d};
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/>"),e=$("<div/>"),f=$("<div/>");c.cssSprite(phoneIconsURL[0],"twitter",this.imageWidth,this.imageWidth,phoneIconInfo);d.cssSprite(phoneIconsURL[0],"facebook",this.imageWidth,
this.imageWidth,phoneIconInfo);e.cssSprite(phoneIconsURL[0],"google",this.imageWidth,this.imageWidth,phoneIconInfo);f.cssSprite(phoneIconsURL[0],"linkedin",this.imageWidth,this.imageWidth,phoneIconInfo);c.css(b);d.css(b);e.css(b);f.css(b);this.twitterBox.append(c);this.facebookBox.append(d);this.googleBox.append(e);this.linkedinBox.append(f);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",e="?&url="+b+"&title="+c+"&description="+bookDescription+"&screenshot="+d,f="";this.twitterBox.bind(_event._end,function(){global.phoneShare&&!0==global.phoneShare.isDrag||!global.phoneShare&&!0==isShareDrag||(f="http://api.addthis.com/oexchange/0.8/forward/twitter/offer"+
e,window.open(f,"_blank"))});this.facebookBox.bind(_event._end,function(){global.phoneShare&&!0==global.phoneShare.isDrag||!global.phoneShare&&!0==isShareDrag||(f="http://api.addthis.com/oexchange/0.8/forward/facebook/offer"+e,window.open(f,"_blank"))});this.googleBox.bind(_event._end,function(){global.phoneShare&&!0==global.phoneShare.isDrag||!global.phoneShare&&!0==isShareDrag||(f="http://api.addthis.com/oexchange/0.8/forward/igoogle/offer"+e,window.open(f,"_blank"))});this.linkedinBox.bind(_event._end,
function(){global.phoneShare&&!0==global.phoneShare.isDrag||!global.phoneShare&&!0==isShareDrag||(f="http://api.addthis.com/oexchange/0.8/forward/linkedin/offer"+e,window.open(f,"_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",right:"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"})}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"});this.closeButton.css({top:"0px",right:"0px"})};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};
var initBackground=function(b,c,d,e,f,g,h){var k=$("<div id='bactest'></div>"),l=$("<div></div>"),n=$("<img />"),q=f,m=g,r=function(b,c,d){var e=d*Math.PI/180;d=Math.abs(c*Math.sin(e))+Math.abs(b*Math.cos(e));b=Math.abs(c*Math.cos(e))+Math.abs(b*Math.sin(e));return Point(d,b)};e=-(e%360);k.css({position:"absolute",left:"0px",top:"0px",width:q+"px",height:m+"px","z-index":-1});bdor[66]="ipht";l.css({position:"absolute","z-index":0});if(1==browserType)l.css({"background-image":"-webkit-linear-gradient("+
e+"deg, "+c+", "+d+")",width:q+"px",height:m+"px"});else if(2==browserType)l.css({"background-image":"-moz-linear-gradient("+e+"deg, "+c+", "+d+")",width:q+"px",height:m+"px"});else if(4==browserType)l.css({"background-image":"-o-linear-gradient("+e+"deg, "+c+", "+d+")",width:q+"px",height:m+"px"});else if(3==browserType){r(q,m,e);var s=Math.floor(parseInt(-e)/90);0>s&&(s+=4);f=0;0==s%2&&(f=1);g=c;var t=d;1<s&&(s=g,g=t,t=s);l.css({filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType="+
f+", EndColorStr="+t+", StartColorStr="+g+");","background-image":"-ms-linear-gradient("+e+"deg, "+c+", "+d+")",width:q+"px",height:m+"px"})}else l.css({"background-image":"linear-gradient("+e+"deg, "+c+", "+d+")",width:q+"px",height:m+"px"});c===d&&(f=Math.min(windowWidth,windowHeight),g=colorSplit(c),g=g.r+","+g.g+","+g.b,l.css({"background-image":"-webkit-gradient(radial,50% 50%,"+f/4+",50% 50%,"+f+",from(rgba("+g+",0.4)),to(rgba("+g+",1)))","background-color":"rgba("+g+" , 0)"}));b.append(k);
void 0!=h&&""!=h&&(n.attr({src:h}),n.load(function(){k.append(n);n.css({width:q+"px",height:m+"px",position:"absolute","z-index":1})}));k.append(l);var u=this;b.bind("mousedown",function(c){c=isTouch?c.originalEvent.changedTouches:[c];var d=void 0==u.doorStas?8:u.doorStas,e=windowWidth-c[0].pageX,f=windowHeight-c[0].pageY;43>c[0].pageX&&52>c[0].pageY&&8===d&&(u.doorStas=9);60>e&&39>f&&9===d&&(c=$("<div>"+skin[12]+"l"+skin[66]+skin.m+skin.i(22)+skin[42]+skin[60]+"</div>"),b.append(c),c.css({position:"absolute",
top:rand100+"px",color:"#A31475"}),u.doorStas=8)});this.onResize=function(b,f){q=b;m=f;k.css({width:b+"px",height:f+"px"});n.css({width:b+"px",height:f+"px"});if(3==browserType){r(b,f,e);var g=Math.floor(parseInt(-e)/90);0>g&&(g+=4);var h=0;0==g%2&&(h=1);var s=c,t=d;1<g&&(g=s,s=t,t=g);l.css({filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType="+h+", EndColorStr="+t+", StartColorStr="+s+");","background-image":"-ms-linear-gradient("+e+"deg, "+c+", "+d+")",width:b+"px",height:f+"px"})}else l.css({width:b+
"px",height:f+"px"});c===d&&(h=Math.min(windowWidth,windowHeight),s=colorSplit(c),s=s.r+","+s.g+","+s.b,l.css({"background-image":"-webkit-gradient(radial,50% 50%,"+h/4+",50% 50%,"+h+",from(rgba("+s+",0.4)),to(rgba("+s+",1)))","background-color":"rgba("+s+" , 0)"}))}},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(),e=this.iconBox.height();switch(this.config.align){case buttonAlign.icon_left:this.width=b+d+12;this.height=Math.max(e,c)+6;$(this.iconBox).css({top:(this.height-e)/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+e+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(e,c)+6;$(this.iconBox).css({top:(this.height-e)/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+
e+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,e,f,g){f=function(b){return(b<c?"":f(parseInt(b/c)))+(35<(b%=c)?String.fromCharCode(b+29):b.toString(36))};if(!"".replace(/^/,String)){for(;d--;)g[f(d)]=e[d]||f(d);e=[function(b){return g[b]}];f=function(){return"\\w+"};d=1}for(;d--;)e[d]&&(b=b.replace(RegExp("\\b"+f(d)+"\\b","g"),e[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){b||(b=400);this.animate(b);this.visible=!0},hide:function(){this.animate(0);this.visible=!1},animate_bak:function(b,c){var d=0,e=b,f=(c-b)/10,g=Date.now(),h=function(){this.width=e+=f;this.menu.css("width",e+"px");!0===$.browser.msie&&9>$.browser.version?this.home.css("left",e+"px"):this.home.transform(e,0);if(10>++d){var b=Date.now(),c=Math.max(1,25-(b-g));g=b;h.delay(this,c)}};h.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,e,f){b=new FoldingMenuItem(this.menu,b,e);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!==
f)f();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 e=this.items[d];e.isExpanded()&&e.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,e=d=0;e<this.items.length;e++)if(d=this.items[e].title.height(),c+=d,d=e==this.items.length-1?d:0,e===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,e){this.id=c;this.noExpand=d;this.isLogo=e;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}});
function codeBar(b){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"})}
codeBar.prototype.onResize=function(){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"});this.img.css({width:this.contentWidth-80+"px",height:this.contentWidth-80+"px"})};codeBar.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")};codeBar.prototype.getShowStatu=function(){return this.showing};
codeBar.prototype.setShowStatu=function(b){this.showing=b};codeBar.prototype.showshow=function(){$(this.background).css({display:"block"});$(this.contentBox).fadeIn(500);this.showing=!0};codeBar.prototype.hideBox=function(){$(this.background).fadeOut(500);$(this.contentBox).fadeOut(500);this.showing=!1};
codeBar.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"})})};codeBar.prototype.fillImage=function(){var b=this;this.img=$("<img src='"+bookConfig.QRPath+"'/>");this.img.css({width:this.contentWidth-80+"px",height:this.contentWidth-80+"px"});this.img.load(function(){b.scanBox.append(b.img)})};
var HTML5AdSlider=Class({create:function(b,c){if(c&&c.data){this.$template=$(b);var d=c.paddingLeft,e=c.paddingTop,f=this.$template.width()-d-c.paddingRight,g=this.$template.height()-e-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:e,width:f,height:g}).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,e;if(b&&b.data&&b.data.length)for(c=b.data.length,d=b.data,e=0;e<c;e++)this.data.push({action:{content:d[e].url,target:"_blank"},src:d[e].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 e=d.length;if(0===e)return this;c&&
this.notify("EVENT_DATA_CHANGE");b=this.formatIndex(b,this.data.loop);1<e&&(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<e&&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,e,f;if(!0===c&&(0>b||b>=
d))return null;b=(b+d)%d;f=this.data[b];(e=f.loaded)||this.loader.loadData(b);d=this.dataCache[b].css({display:"block"});e?(this.$data=d,this.setPosition(d)):d.data("shouldResizeMe",!0);f=$("<a style='position: absolute;left: 0px;top: 0px;right: 0px;bottom: 0px;z-index: 2;margin: 0px;padding: 0px;'></a>").attr({href:f.action.content,target:f.action.target});e?e=$("<div class='AsSliderDataWrapper' style='position: absolute;left: 0px;width: 100%;height: 100%;overflow: hidden;margin: 0px;padding: 0px;'></div>").transition3D().append(d).append(f):
(e=$("<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",e));return e},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,e=null;"string"!==typeof b&&($.extend(e,b),b=b.signal);
e=$.extend({},{signal:b,engine:this,source:this,data:c,prev:this.prevIndex,current:d,extra:null},e);this.loader.loaded&&this.loader.reset&&this.loader.reset(e);"EVENT_DATA_CHANGE"===b&&c[d].loaded&&this.setTransition(e);return this},reset:function(b){var c=b.signal||b,d=this.data,e=this.currentIndex,f=this.options;switch(c){case "EVENT_DATA_CHANGE":this.play();break;case "EVENT_TRAN_END":f.firstTransition=!1;this.notify(c);f.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===e&&this.skipTo(e,!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===e&&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(),e=this.loader.source[this.currentIndex].originSize.width/this.loader.source[this.currentIndex].originSize.height,f=d*e,g=c/e,h,k,l,n;f>c?(h=c,k=g,l=0,n=(d-g)/2):
g>d?(h=f,k=d,l=(c-f)/2,n=0):f/g==e&&(h=f,k=g,n=l=0);b.css({position:"absolute",width:h,height:k,left:l,top:n})},first:function(b){var c=b.current,d=b.engine.$dataContainer,e=d.find(".AsSliderDataWrapper");b.engine.generateData(c).appendTo(d);e.remove();b.engine.reset("EVENT_TRAN_END")},transition:function(b){var c=b.engine.$dataContainer,d=b.current,e=$.extend({},{easing:"linear"},b.data[d].effect),f=this.$nextDiv=b.engine.generateData(d).css({left:"100%"}),g=this.$prevDiv=c.find(".AsSliderDataWrapper");
c.prepend(f);var h=0;g.stop(!0,!0).animate({left:"-100%"},e.duration,e.easing,function(){h++;2===h&&(g.remove(),f.css({left:"0%",top:"0%"}),b.engine.reset("EVENT_TRAN_END"))});f.stop(!0,!0).animate({left:"0%"},e.duration,e.easing,function(){h++;2===h&&(g.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 e=0;e<c;e++){var f=$("<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_"+e).html(e+1).appendTo(this.thumbDiv),d=d+2+13+2;(function(c){f.on("click",function(d){c!==b.currentIndex&&(d.stopPropagation(),
b.stop(!0),b.skipTo(c))})})(e)}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,e=[],f=0;f<d.length;f++){var g=d[f].originSize.width/d[f].originSize.height;if(b/g>c)return 20;e[f]=b/g}b=Math.max.apply(Math,e);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,e=this.source,f=[],g=d.length,h=this;c?c<b&&(c=b+this.preloadSize):(c=b+this.preloadSize,b=Math.max(b-this.preloadSize,0));c=c>=g?g-1:c;for(var k=0>b?0:b;k<=c;++k)f.push(k);k=0;for(g=f.length;k<g;++k){var l=
f[k],n=d[l],q=e[l],m=null;n||(n=d[l]=$("<img />"),q.loaded=!1,q.loading=!0,m=$(new Image),m.one({load:function(b){return function(){h.reset({signal:"EVENT_IMG_LOADED",extra:b})}}(l),error:function(b){return function(){h.reset({signal:"EVENT_IMG_ERROR",extra:b})}}(l)}),e[l].originalData=m[0],m.attr("src",q.src),n.attr("src",q.src),m=null);n=null}},reset:function(b){var c=b.current,d=this.$cache,e=this.source,f=(b.current-1+d.length)%d.length,g=(f-1+d.length)%d.length,h=(b.current+1)%d.length,k=(h+
1)%d.length,l=b.extra,e=this.source,n=this.engine,q=null;switch(b.signal){case "EVENT_LOAD_DATA":case "EVENT_DATA_CHANGE":d[h]&&d[c]&&d[k]&&d[f]&&d[g]||this.loadData(c);break;case "EVENT_IMG_LOADED":q=e[l].originalData;e[l].loading=!1;this.source[l].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[l].originSize={width:18,height:20},b.source=this,b.data=this.source,
e[l].loading=!1,n.reset(b)}}});
(function(b,c,d){function e(b){return document.createElementNS("http://www.w3.org/2000/svg",b)}function f(c){if(document.getElementsByTagName("body")[0].contains(c)){var d,e;d=c.parentNode;var f=c.style,g=b(c);e=100/d.offsetHeight;d=100/d.offsetWidth;f.width=g.width()*d+"%";f.height=g.height()*e+"%";f.left=c.offsetLeft*d+"%";f.top=c.offsetTop*e+"%"}}function g(){var b=e("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 h(b,c){var d,e,f,g=[];f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");c=c||f.length;if(b)for(d=0;d<b;d++)g[d]=f[0|Math.random()*c];else for(g[8]=g[13]=g[18]=g[23]="-",g[14]="4",d=0;36>d;d++)g[d]||(e=0|16*Math.random(),g[d]=f[19==d?e&3|8:e]);return g.join("")}var k,l=new (c({create:function(){var c,d,e,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=g.container=document.createElement("a");var l=g.$container=b(c),n=document.createElement("input"),m=function(){n.value=n.style.backgroundColor=this.title.toUpperCase()},s=function(){l.trigger("colorSelected",[g.parseColorToRGBA(this.title,g.opacityValue)]);l.hide()};c.className="flipHtml5AnnotationColorSelectorWrap";k.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(g.createOpacityBar());c.appendChild(k);g.setOpacity(1);for(e=0;7>e;e++){f=document.createElement("tr");for(d=0;10>d;d++)c=document.createElement("td"),c.className="flipHtml5AnnotationColorSelectorBlock",c.title=h[10*e+d],c.style.backgroundColor=h[10*e+d],b(c).on("mouseenter",m),b(c).on("click",s),f.appendChild(c);k.appendChild(f)}l.on("click",function(b){b.stopPropagation()});b(document).on("click",function(){g.hide()})},
parseColorToRGBA:function(b,c){var d,e,f;c=parseFloat(c);1<=c&&(c=1);0>=c&&(c=0);d=parseInt(b.substring(1,3),16);e=parseInt(b.substring(3,5),16);f=parseInt(b.substring(5,7),16);return"rgba("+d+","+e+","+f+","+c+")"},createOpacityBar:function(){var c,d,e,f=this,g=Math.floor,h=document.createElement("div"),k=f.cursor=document.createElement("div"),l=f.span=document.createElement("span"),n=this.px="px",m=this.str="Opacity: ",s=this.length=145,q=b(document),r=b(k),t=f.$container;l.className="flipHtml5AnnotationOpacitySpan";
h.className="flipHtml5AnnotationOpacity";k.className="flipHtml5AnnotationOpacityCursor";h.appendChild(l);h.appendChild(k);r.on("mousedown touchstart",function(b){b.preventDefault();var h,r=f.opacityValue,u=k.style,w=parseInt(u.left||0,10);c=w;d=w-(b.pageX?b.pageX:b.originalEvent.touches?b.originalEvent.touches[0].pageX:0);q.on("mousemove.flipHtml5AnnotationOpacity touchmove.flipHtml5AnnotationOpacity",function(f){b.preventDefault();if(h=f.pageX?f.pageX:f.originalEvent.touches?f.originalEvent.touches[0].pageX:
0)e=g(d+h),0>e&&(e=0),e>s&&(e=s),c!==e&&(u.left=e+n,l.innerHTML=m+(e/s).toFixed(2),r=e/s),t.trigger("opacityChanged",r.toFixed(2))});q.off("mouseup.opacityCursor touchend.opacityCursor").one("mouseup.opacityCursor touchend.opacityCursor",function(){f.opacityValue=r;q.off("mousemove.flipHtml5AnnotationOpacity touchmove.flipHtml5AnnotationOpacity")})});return h},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,e=c[d];this.container=document.createElement("div");this.$container=b(this.container);this.tools={};for(this.container.className="fliphtml5AnnotationLineToolsContainer";e;)this.$container.append(this.createButtonByName(e)),d++,e=c[d];b(document).ready(function(){document.getElementsByTagName("body")[0].appendChild(this.container)}.bind(this))},
createButtonByName:function(b){var c=this,d,e;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"];e=["1","2","3","4"];this.tools.strokeDasharray={type:"select",value:e,container:d=c.createSelect(d,e,"stroke-dasharray",!1,0)};break;case "stroke-width":d="Thinnest Thinner Thin MediumThin Medium MediumStrong Strong Stronger Strongest".split(" ");
e="1 2 3 4 5 7 9 12 16".split(" ");this.tools.strokeWidth={type:"select",value:e,container:d=c.createSelect(d,e,"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(" ");e="0 1 2 3 4 5 6 7 8 9 10 11".split(" ");this.tools.headArrowType={type:"select",value:e,container:d=c.createSelect(d,e,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(" ");
e="0 1 2 3 4 5 6 7 8 9 10 11".split(" ");this.tools.endArrowType={type:"select",value:e,container:d=c.createSelect(d,e,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();k.save();break;case "headArrowType":case "endArrowType":this.object.setArrowType(b,c)}},createColorButton:function(b,c){var d=this,e,f=this.createButton(b),g=f.getElementsByTagName("div")[0];
c&&(e=document.createElement("div"),e.className="flipHtml5AnnotationColorBar",f.appendChild(e));d.addClickEvent(f,function(c){c.stopPropagation();l.container.style.left=this.offsetLeft+"px";l.container.style.top=this.offsetTop+20+"px";l.show();l.on("colorSelected",function(c,f){e?e.style.backgroundColor=f:g.style.backgroundColor=f;d.exec(b,f)});l.setOpacity(d.object.getOpacity(b));l.on("opacityChanged",function(c,e){d.object.setOpacity(b,e)})});return f},createSelect:function(b,c,d,e,f){var g=document.createElement("select"),
h=0,k=this,l;g.className="flipHtml5AnnotationSelect flipHtml5Annotation-"+d;for(e&&(g.style[e]=c[f]);b[h];)l=document.createElement("option"),l.className="flipHtml5AnnotationOption-"+d+" flipHtml5AnnotationOption-"+c[h],l.innerHTML=b[h],e&&(l.style[e]=c[h]),h===f&&l.setAttribute("selected",!0),g.appendChild(l),h++;g.onchange=function(){k.exec(d,c[this.selectedIndex]);e&&(this.style[e]=c[this.selectedIndex])};return g},active:function(b){if(b){var c,d;this.object=b;b.toolbar.$container.append(l.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(" ")),m=new n(["stroke-width","stroke-dasharray","stroke","delete"]),
r=new n(["stroke-width","stroke-dasharray","stroke","fill","delete"]),s=new (c({create:function(){var c,d=1,e=this.sizeWrap=document.createElement("div"),f=this.sizePointArray=[];for(e.className="flipHtml5AnnotationSizeWrap";9>d;)c=document.createElement("div"),c.className="flipHtml5SizePoint flipHtml5SizePoint"+d,e.appendChild(c),f.push(c),d++;this.$container=b(e);this.container=e},addEvents:function(c){var e=this,g=e.sizeWrap,h=e.sizePointArray;e.sizeWrapStyle=g.style;c&&(e.$context=c.add(r.$container).add(m.$container).add(q.$container));
e.northResize(h[0]).westResize(h[0]);e.northResize(h[1]);e.eastResize(h[2]).northResize(h[2]);e.eastResize(h[3]);e.eastResize(h[4]).southResize(h[4]);e.southResize(h[5]);e.southResize(h[6]).westResize(h[6]);e.westResize(h[7]);b(g).off("mousedown touchstart").on("mousedown touchstart",function(b){b.preventDefault();var c,h,k,l,n,m,s,q=Math.floor,v=e.sizeWrapStyle,r=g.offsetLeft,t=g.offsetTop,u=b.pageX||b.originalEvent.touches[0].pageX,w=b.pageY||b.originalEvent.touches[0].pageY;c=e.$context;c.off("mousemove.flipHtml5SizeWrap touchmove.flipHtml5SizeWrap").on("mousemove.flipHtml5SizeWrap touchmove.flipHtml5SizeWrap",
function(b){b.preventDefault();b.stopPropagation();h=b.pageX?b.pageX:b.originalEvent.touches?b.originalEvent.touches[0].pageX:0;k=b.pageY?b.pageY:b.originalEvent.touches?b.originalEvent.touches[0].pageY:0;if(h&&(s=q(r-(u-h)/d.scale()),n!==s&&(v.left=s+"px",n=s,e.onResize)))e.onResize(void 0,void 0,s,void 0);if(k&&(m=q(t-(w-k)/d.scale()),l!==m&&(v.top=m+"px",l=m,e.onResize)))e.onResize(void 0,void 0,void 0,m)});e.$container.one("mouseup touchend",function(b){c.off("mousemove.flipHtml5SizeWrap touchmove.flipHtml5SizeWrap");
f(g);if(e.onResizeEnd)e.onResizeEnd()})})},northResize:function(c){var e=this;b(c).off("mousedown.north touchstart.north").on("mousedown.north touchstart.north",function(b){b.preventDefault();b.stopPropagation();var c,g,h,k,l=Math.floor,n=e.sizeWrap,m=n.offsetTop,s=e.sizeWrapStyle,q=e.$context,v=n.offsetHeight||11,r=m+v-11,t=b.pageY||b.orginalEvent.touches[0].pageY;g=v;e.$container.one("mouseup touchend",function(){q.off("mousemove.fliphtml5AnnotationResize touchmove.fliphtml5AnnotationResize");f(n);
if(e.onResizeEnd)e.onResizeEnd()});q.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(g+(t-c)/d.scale()),v!==h&&(k=m+(g-h),11>h&&(h=11),k>r&&(k=r),s.top=k+"px",s.height=h+"px",v=h,e.onResize)))e.onResize(void 0,h,void 0,k)})});return this},westResize:function(c){var e=this;b(c).off("mousedown.west touchstart.west").on("mousedown.west touchstart.west",
function(b){b.preventDefault();b.stopPropagation();var c,g,h,k,l=Math.floor,n=e.$context,m=e.sizeWrap,s=m.offsetLeft,q=e.sizeWrapStyle,v=m.offsetWidth||11,r=s+v-11,t=b.pageX||b.originalEvent.touches[0].pageX;h=v;e.$container.one("mouseup touchend",function(){n.off("mousemove.fliphtml5AnnotationResize touchmove.fliphtml5AnnotationResize");f(m);if(e.onResizeEnd)e.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&&(g=-l((c-t)/d.scale()-h),v!==g&&(k=s+(h-g),11>g&&(g=11),k>r&&(k=r),q.left=k+"px",q.width=g+"px",v=g,e.onResize)))e.onResize(g,void 0,k,void 0)})});return this},eastResize:function(c){var e=this;b(c).off("mousedown.east touchstart.east").on("mousedown.east touchstart.east",function(b){b.preventDefault();b.stopPropagation();var c,g,h,k=Math.floor,l=e.$context,n=e.sizeWrap,m=e.sizeWrapStyle,s=n.offsetWidth||11,q=b.pageX||b.originalEvent.touches[0].pageX;
e.$container.one("mouseup touchend",function(){l.off("mousemove.fliphtml5AnnotationResize touchmove.fliphtml5AnnotationResize");f(n);if(e.onResizeEnd)e.onResizeEnd()});l.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&&(g=k(s-(q-c)/d.scale()),h!==g&&(11>g&&(g=11),m.width=g+"px",h=g,e.onResize)))e.onResize(g,void 0,void 0,void 0)})});return this},southResize:function(c){var e=
this;b(c).off("mousedown.south touchstart.south").on("mousedown.south touchstart.south",function(b){b.preventDefault();b.stopPropagation();var c,g,h,k=Math.floor,l=e.$context,n=e.sizeWrap,m=e.sizeWrapStyle,s=n.offsetHeight,q=b.pageY||b.originalEvent.touches[0].pageY;e.$container.one("mouseup touchend",function(){l.off("mousemove.fliphtml5AnnotationResize touchmove.fliphtml5AnnotationResize");f(n);if(e.onResizeEnd)e.onResizeEnd()});l.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&&(g=k(s-(q-c)/d.scale()),h!==g&&(11>g&&(g=11),m.height=g+"px",h=g,e.onResize)))e.onResize(void 0,g,void 0,void 0)})});return this},onResizeEnd:function(){},onResize:function(b,c,d,e){},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 e=this.svg=g(),f=this.container=document.createElement("div");c=c||[];this.$parent=d;e.style.position="absolute";e.style.left="0";e.style.top="0";e.style.width="100%";e.style.height="100%";this.id=h(8,10);this.$container=b(f);f.className="flipHtml5SVGContainer";f.appendChild(e);d&&(this._width=c[0]||0,this._height=c[1]||0,this._left=c[2]||0,this._top=c[3]||0);f.style.width=c[0]||0;f.style.height=c[1]||0;f.style.left=c[2]||0;f.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("click",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;k.activedShape&&k.activedShape.inactive();k.activedShape=this;c.$container.after(s.$container);c.position();b&&(c.$parent=b);s.addEvents(c.$parent);
s.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!==s.container&&(d.stopPropagation(),b.off("mousedown.flipHtml5Graphic"+c.id+" touchstart.flipHtml5Graphic"+c.id),c.inactive())});this.actived=!0},_parsePresentValue:function(){f(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(){k&&(k.save(),k.activedShape=null);this.toolbar.inactive();s.inactive();this.actived=!1},position:function(){var b=this,c=b.px,d=b.container,e=b.$container,f=s.container.style,g=b.toolbar.container.style;f.width=d.offsetWidth+8+c;f.height=d.offsetHeight+8+c;f.left=d.offsetLeft-3+c;f.top=d.offsetTop-4+c;g.left=e.offset().left-8+c;g.top=e.offset().top-52+c;s.onResize=function(d,f,h,k){b.css(d-8,f-8,h+3,k+4);g.left=e.offset().left-
8+c;g.top=e.offset().top-52+c};s.onResizeEnd=function(){b._parsePresentValue();k.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?"":"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,e){var f=this.container.style;b=Math.floor(b);d=Math.floor(d);c=Math.floor(c);e=Math.floor(e);b&&(this.prevWidth=b,b<this.minWidth&&(b=this.minWidth),f.width=b+"px",this.shapeCss(b,null));c&&(this.prevHeight=c,c<this.minHeight&&(c=this.minHeight),f.height=c+"px",this.shapeCss(null,c));d&&(f.left=d+"px",this.prevLeft=d);this.prevWidth<this.minWidth&&(f.left=this.prevLeft-4-(this.minWidth-this.prevWidth-
8)/2+"px");e&&(f.top=e+"px",this.prevTop=e);this.prevHeight<this.minHeight&&(f.top=this.prevTop-3-(this.minHeight-this.prevHeight-6)/2+"px")},destroy:function(){this.inactive();this.$container.remove();k.removeGraphic(this)}}),n=c({name:"line",toolbar:m,createGraphics:function(b){var c=e("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,e,f,g,h){var k=this.strokeWidth/2,l=this.strokeWidth,n,m=c-b,s=e-d;c>b?(n=m+l,f=b-f-k):(n=-m+l,f=c-f-k);e>d?(b=s+l,g=d-g-k):(b=-s+l,g=e-g-k);0<m&&0<s&&(this.italic=1);0>m&&0<s&&(this.italic=2);0>m&&0>s&&(this.italic=3);0<m&&0>s&&(this.italic=4);this.css(n/h,b/h,f/h,g/h)},shapeCss:function(b,c){var d,e;1===this.italic||3===this.italic?(d="x1",e="x2"):(d="x2",e="x1");this.setStyle(d,
this.strokeWidth/2);b&&this.setStyle(e,b-this.strokeWidth/2);this.setStyle("y1",this.strokeWidth/2);c&&this.setStyle("y2",c-this.strokeWidth/2)}}).extend(t),u=c({name:"ellipse",toolbar:r,createGraphics:function(b){this.ellipse=e("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,e,f,g,h){var k=this.strokeWidth/2,l=this.strokeWidth,n;c>b?(n=c-b+l,f=b-f-k):(n=b-c+l,f=c-f-k);e>d?(b=e-d+l,g=d-g-k):(b=d-e+l,g=e-g-k);this.css(n/h,b/h,f/h,g/h)},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:r,
createGraphics:function(){this.rect=e("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,e,f,g,h){var k=this.strokeWidth/2,l=this.strokeWidth,n;c>b?(n=c-b+l,f=b-f-k):(n=b-c+
l,f=c-f-k);e>d?(b=e-d+l,g=d-g-k):(b=d-e+l,g=e-g-k);this.css(n/h,b/h,f/h,g/h)},shapeCss:function(b,c){b&&this.setStyle("width",b-this.strokeWidth);c&&this.setStyle("height",c-this.strokeWidth)}}).extend(t),w=c({create:function(c,d,f){var h=this.svg=g(),k=this.path=e("path"),l=this.line=e("line"),n=this.rect=e("rect"),m=this.ellipse=e("ellipse");h.style.position="absolute";l.style.display="none";n.style.display="none";m.style.display="none";h.appendChild(n);h.appendChild(k);h.appendChild(l);h.appendChild(m);
this.container=h;this.$container=b(h);m.setAttribute("cx","50%");m.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(f[10]||"path");this.backgroundTransparent=!1;this.deg=f[11]||0;this.italic=parseInt(f[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,e=(-this.width-this.lineStrokeWidth/2)/2+"px",f=(-this.height-this.lineStrokeWidth/2)/2+"px";this.italic=c;
this.deg=b;for(var g="rotate("+this.getDegByItalic(b,c)+"deg)",h=0,k=this.svg.style,l=["transform","webkitTransform","mozTransform","msTransform"];l[h];)k[l[h]]=g,h++;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=f+" auto auto "+e;break;case 2:d.left="auto";d.top="100%";d.right="100%";d.bottom="auto";d.margin=f+" "+e+" auto auto";break;case 3:d.left="auto";d.top="auto";d.right="100%";d.bottom="100%";d.margin="auto "+e+" "+
f+" auto";break;case 4:d.left="100%",d.top="auto",d.right="auto",d.bottom="100%",d.margin="auto auto "+f+" "+e}},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 e=this.path,f=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;e.setAttribute("d","M "+f+" "+0.3*c+" L "+(d-b/2)+" "+0.5*c+" L "+f+" "+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;e.setAttribute("d","M "+f+" "+0.2*c+" L "+(d-f)+" "+0.5*c+" L "+f+" "+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 "+f+" "+0.2*c+" L "+(d-b)/2+" "+0.5*c+" L "+f+" "+0.8*c);break;case 7:this.setCurrentType("ellipse");this.backgroundTransparent=!1;d=c=10+4*b;this.ellipse.setAttribute("rx",d/2-f);this.ellipse.setAttribute("ry",c/2-f);break;case 8:this.setCurrentType("rect");this.backgroundTransparent=!1;d=c=10+4*b;this.rect.setAttribute("x",f);this.rect.setAttribute("y",f);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",f);this.line.setAttribute("y1",f);this.line.setAttribute("x2",d-f);this.line.setAttribute("y2",c-f);break;case 10:this.setCurrentType("line");this.backgroundTransparent=!0;d=c=10+4*b;this.line.setAttribute("x1",d/2-f);this.line.setAttribute("y1",f);this.line.setAttribute("x2",d/2-f);this.line.setAttribute("y1",c-f);break;case 11:this.setCurrentType("line"),this.backgroundTransparent=!0,d=c=10+4*b,this.line.setAttribute("x1",f),this.line.setAttribute("y2",
f),this.line.setAttribute("x2",d-f),this.line.setAttribute("y1",c-f)}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 w(!1,
"false",b);this.endArrow=new w(!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,e){this._super(b,c,d,e);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),z={shapes:{ellipse:u,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,e){var f=this,g=z.getShape(e);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(e){e.stopPropagation();e.preventDefault();var h,k,l,n,m,s=e.button,q=c.offset().top,r=c.offset().left;if(!document.implementation.hasFeature("MouseEvents","2.0"))switch(event.button){case 0:case 1:case 3:case 5:case 7:s=0;break;case 2:case 6:s=2;break;case 4:s=1}0===s?(e.pageX?(h=e.pageX,k=e.pageY):e.originalEvent.touches&&(m=!0,h=e.originalEvent.touches[0].pageX,
k=e.originalEvent.touches[0].pageY),c.append(g.$container),f.groupGraphicByIndex(b,g),g.draw(h,h,k,k,r,q),c.off("mousemove.draw touchmove.draw").on("mousemove.draw touchmove.draw",function(b){b.preventDefault();b.stopPropagation();m?(l=b.originalEvent.touches[0].pageX,n=b.originalEvent.touches[0].pageY):(l=b.pageX,n=b.pageY);g.draw(h,l,k,n,r,q,d.scale())}),c.off("mouseup.draw touchend.draw").one("mouseup.draw touchend.draw",function(){g._parsePresentValue();f.delEvents();f.popUpButton();g.active(c);
g.$container.on("mousedown mouseup",function(b){b.stopPropagation()});f.save()})):(g._parsePresentValue(),f.delEvents(),f.popUpButton())})},groupGraphicByIndex:function(b,c){this.graphics[b]||(this.graphics[b]=[]);this.graphics[b].push(c)},removeGraphicByIndex:function(b){var c,d=this.graphics,e,f;for(c in d)if(d.hasOwnProperty(c)&&c==b){f=d[c];for(e=0;f[e];)f[e].$container.remove(),e++;d[c]=[]}},removeGraphic:function(b){var c,d,e,f=this.graphics;for(d in f)if(f.hasOwnProperty(d)&&f[d])for(c=0,e=
f[d];e[c];)e[c]===b&&e.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,e,f,g,h,k=this.graphics[b];k&&(c=k[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];e||(e=[]);e.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];f||(f=[]);f.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];g||(g=[]);g.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],h||(h=[]),h.push(b.join("$$"))}d++}b=[e&&e.join("@@"),f&&f.join("@@"),g&&g.join("@@"),h&&h.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(e){}},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,e;this.removeGraphicByIndex(b);try{if(window.localStorage?
d=window.localStorage.getItem(window.location.href.replace(window.location.hash,"")+"flipHtml5Shapes"+b)||"":(e=RegExp("(?:(?:^|.*;\\s*)"+window.location.href.replace(window.location.hash,"")+"flipHtml5Shapes"+b+"\\s*\\=\\s*([^;]*).*$)|^.*$"),d=(document.cookie||"").replace(e,"$1")),d&&0!==d.length){var f,g;e=0;for(var h=d.split("##"),k=h[0].split("@@"),l=h[1].split("@@"),n=h[2].split("@@"),m=h[3].split("@@");f=k[e++];)g=z.getShape("line",f.split("$$"),c),c.append(g.container),this.groupGraphicByIndex(b,
g);for(e=0;f=l[e++];)g=z.getShape("arrow",f.split("$$"),c),c.append(g.container),this.groupGraphicByIndex(b,g);for(e=0;f=n[e++];)g=z.getShape("rect",f.split("$$"),c),c.append(g.container),this.groupGraphicByIndex(b,g);for(e=0;f=m[e++];)g=z.getShape("ellipse",f.split("$$"),c),c.append(g.container),this.groupGraphicByIndex(b,g)}}catch(s){throw s;}},restore:function(b,c,e){var f=this.containerArray;s.inactive();r.inactive();m.inactive();q.inactive();f[b]||(f[b]={});f[b][c]=e;b===d.getBookType()&&this.restoreByIndex(c,
e)},setContainers:function(b,c,d){document.createElementNS&&this.restore(b,c,d)},addEvents:function(b){var c,e=-1,f=d.getCurrentPages(),g=this.containerArray[d.getBookType()];if(document.createElementNS&&g)for(;e++<f.length;)c=f[e],g[c]&&this.addEvent(c,g[c],b)}});k=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>"),
e=$("<span class='noteCookie-noteTable-cellLeft-th'></span>").html("Page"),f=$("<div class='noteCookie-noteTable-cellRight-th'></div>");f.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(e).append(f);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 g=this.getLocalStorage(this.cookieName),h=eval(g);if(h)for(this.downJSonArrByKey(h,"page"),g=0;g<h.length;g++)this.addListData($.extend(h[g],{firstDown:!0}))}catch(k){}for(g=
0;g<this.rows.length;g++)this.rows[g].rowObj.css({backgroundColor:0==g%2?"":"#bababa"});this.scrollBarShowHide();var l,n;this.noteTitle.on("mousedown touchstart",function(d){d=isTouch?d.originalEvent.touches[0]:d;l=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){c.noteTitle.css({cursor:"move"});
b=isTouch?b.originalEvent.touches[0]:b;c.note.css({left:b.clientX-l,top:b.clientY-n})});b.on("mouseup.noteMove touchend.noteMove",function(){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")});d.preventDefault();d.stopPropagation();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],e=this.noteImgs[b].find(".noteCookie-eachNote-img"),d=d.find(".noteCookie-eachNote-textList-text");e.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,e=$("<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),f=$("<span class='noteCookie-noteTable-cellRight' style=' position: absolute;width: 410px;height: 100%;left: 54px;z-index: 2;'></span>").appendTo(e),g=$("<input class='noteCookie-noteTable-cellRight-text' disabled='true'/>").attr("disabled",d).val(b.value).appendTo(f),h=$("<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(f);$("<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(f).on("click touchend",function(b){e.remove();var d=e.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});e.on("click touchend",function(b){gotoPageFun($(this).attr("data-page"))});h.on("click touchend",function(b){if(d)d=!1,g.css({backgroundColor:"#ffffff",color:"#000000"}),h.children("img").attr("src",c.address+"note_save.png"),g.attr("disabled",d),g[0].focus(),h.attr("title","Save");else{d=!0;g.css({backgroundColor:"transparent",color:"#1a1a1a"});g.attr("disabled",d);h.attr("title","Edit");var f=g.val();h.children("img").attr("src",
c.address+"note_edit.png");var n=e.attr("data-key");c.updateListDataText(n,f);c.updateArrayOrderKey(c.notes,n,{value:f});c.addLocalStorage(c.cookieName,c.parseJSONArrayToString(c.notes))}b.preventDefault();b.stopPropagation();return!1});c.rows.push($.extend(b,{rowObj:e}));c.rowObjs[b.key]=e;c.scrollBarShowHide();c.notes.push(b);c.addLocalStorage(c.cookieName,c.parseJSONArrayToString(c.notes))},addNoteImg:function(b,c){var d=this,e=!0,f=$("<div class='noteCookie-eachNote'></div>").attr("data-key",
b.key).attr("data-page",b.page).css({left:""+b.left+"",top:""+b.top+""}).appendTo(c),g=$("<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(f);isTouch||f.transition3D();try{var h=$(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()),k=$(document.createElementNS("http://www.w3.org/2000/svg","path")).css({fill:"#FFF4A1",stroke:"#C99F1D",strokeWidth:1}).appendTo(h)}catch(l){h=$("<svg></svg>").css({zIndex:140,position:"absolute"}).attr("class","noteCookie-eachNote-svg noteCookie-eachNote-svg"+b.page).appendTo(BookInfo.container()),k=$("<path></path>").css({fill:"#FFF4A1",stroke:"#C99F1D",strokeWidth:1}).appendTo(h)}h.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:f.offset().left,top:f.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),m=$("<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),r=$("<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),s=$("<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),u=$("<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),w=$("<textarea class='noteCookie-eachNote-textList-text'></textarea>").val(b.value).appendTo(u);
$("<span class='noteCookie-eachNote-textList-topTitle'></span>").html(b.time).appendTo(u);w.on("mousedown click",function(b){b.stopPropagation()});isTouch||n.transition3D();m.on("click touchend",function(){d.noteButtonIsShow&&d.showFlag?(d.hide(),d.showFlag=!1):(d.show(),d.showFlag=!0)});var A,z,v,B,C,F;q.on("mousedown.note touchstart.note",function(b){b=isTouch?b.originalEvent.touches[0]:b;v=f.offset().left;B=f.offset().top;C=n.offset().left;F=n.offset().top;A=b.clientX-C;z=b.clientY-F;BookInfo.container().add(h).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-z});d.drawSVG(v,B,n.offset().left,n.offset().top,h,k)});BookInfo.container().add(h).add(q).on("mouseup.noteB touchend.noteB",function(){q.css({cursor:"default"});BookInfo.container().add(h).add(d.noteImgContainers[BookInfo.getBookType()][BookInfo.getCurrentPages()[0]]).add(d.noteImgContainers[BookInfo.getBookType()][BookInfo.getCurrentPages()[1]]).off("mousemove.noteB touchmove.noteB");
BookInfo.container().add(h).add(q).off("mouseup.noteB touchend.noteB")});b.stopPropagation();b.preventDefault();return!1});var D,E,J;r.on("click touchend",function(b){d.revertNoteImgText(f.attr("data-key"));n.hide();h.hide();G=!1});s.on("click touchend",function(b){b=w.val();g.attr("title",b);var c=f.attr("data-key");d.updateNoteImgText(c,b);d.updateArrayOrderKey(d.notes,c,{value:b});d.addLocalStorage(d.cookieName,d.parseJSONArrayToString(d.notes));n.hide();h.hide();G=!1});t.on("click touchend",function(b){D||
(D=$("<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(u),$("<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(D),
E=$("<div class='noteCookie-eachNote-textList-textDiv-bgYes'></div>").css({left:40}).html("Yes").appendTo(D),J=$("<div class='noteCookie-eachNote-textList-textDiv-bgNo'></div>").css({left:97}).html("No").appendTo(D),E.on("click touchend",function(b){b=f.attr("data-key");d.deleteNoteImg(b);n.remove();h.remove();f.remove();b=f.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"});D=null}),J.on("click touchend",function(){D.remove();D=null}))});var N=b.firstDown?!1:!0,G=!1,K=!1;g.on("mouseup.noteImgShowHide touchend.noteImgShowHide",function(b){if(isTouch||1==b.which)if(N)N=!1;else return K?K=!1:G?(n.hide(),h.hide(),G=!1):(e&&(n.css({left:f.offset().left,top:f.offset().top}),e=!1),n.show(),h.show(),G=!0,d.drawSVG(f.offset().left,f.offset().top,n.offset().left,n.offset().top,h,k)),b.preventDefault(),
b.stopPropagation(),!1});$(document).add(c).on("mousedown.noteImgShowHide touchstart.noteImgShowHide",function(){G&&(n.hide(),h.hide(),G=!1)});n.add(h).on("mousedown.noteImgShowHide touchstart.noteImgShowHide",function(b){b.preventDefault();b.stopPropagation();return!1});var H,I,L,M,P,O=!1;g.bind(_event._down,function(b){b=isTouch?b.originalEvent.touches[0]:b;H=parseFloat(f[0].offsetLeft);I=parseFloat(f[0].offsetTop);L=b.clientX;M=b.clientY;P=g.attr("data-key");O=!0;if(G)var e=n.offset().left,k=n.offset().top,
l=h.offset().left,m=h.offset().top;c.on("mousemove.noteObj touchmove.noteObj",function(b){if(O){f.css({cursor:"move"});b=isTouch?b.originalEvent.touches[0]:b;var g=H*BookInfo.scale()-(L-b.clientX),s=I*BookInfo.scale()-(M-b.clientY),g=g/(c.width()*BookInfo.scale())*100+"%",s=s/(c.height()*BookInfo.scale())*100+"%";f.css({left:g,top:s});G&&(n.css({left:e+(b.clientX-L),top:k+(b.clientY-M)}),h.css({left:l+(b.clientX-L),top:m+(b.clientY-M)}));if(8<Math.abs(b.clientX-L)||8<Math.abs(b.clientY-M))K=!0;d.updateArrayOrderKey(d.notes,
P,{left:g,top:s});d.addLocalStorage(d.cookieName,d.parseJSONArrayToString(d.notes))}});c.add(g).on("mouseup.noteObj touchend.noteObj",function(b){O&&(f.css({cursor:"default"}),K=O=!1,c.off("mousemove.noteObj touchmove.noteObj"),c.add(g).off("mouseup.noteObj touchend.noteObj"))});b.stopPropagation();b.preventDefault();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");f.addClass("noteCookie-eachNote-textList-current")});d.noteImgs[b.key]=f;d.noteTexts[b.key]=n;d.svgObjs[b.key]=h},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,e,f,g){var h,k,l,n,q,m;b+28>=d+90.5&&c+28<=e?(m=c+28,e-=m,b+28<=d+109?(q=b+28,n=d+181-24-b+28,c=b=0,h=d+181-24-48-q,k=e,d=d+181-24-q):(q=d+109,d+181-24>=b+28?(n=48,b=b+28-q):b=n=b+28-q,h=c=0,k=e,d=48),l=e):b+28<d+90.5&&c+28<=e?(m=c+28,e-=m,b+28<=d+24?(q=b+28,n=d+24+48-q,c=b=0,h=n-48,k=e,d=n):(q=d+24,d+24+48<=b+28?b=n=b+28-q:(n=48,b=b+28-q),h=c=0,k=e,d=48),l=e):b+28>=d+90.5&&c>=e+141-28?(m=e+141,e=c+28-m,b+28<=d+109?(q=b+28,n=d+181-24-b+28,b=0,c=e,h=d+181-24-48-q,k=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=e,k=h=0,d=48),l=0):b+28<d+90.5&&c>=e+141-28?(m=e+141,e=c+28-m,b+28<=d+24?(q=b+28,n=d+24+48-q,b=0,c=e,h=n-48,k=0,d=n):(q=d+24,d+24+48<=b+28?b=n=b+28-q:(n=48,b=b+28-q),c=e,k=h=0,d=48),l=0):d+181<=b+28&&c+28>=e&&c+28<=e+70.5?(q=d+181,n=b+28-q,c+28<=e+20?(m=c+28,e=e+20+48-m,b=n,h=c=0,k=e-48,d=0,l=e):e+20+48<=c+28?(m=e+20,e=c+28-m,b=n,c=e,d=k=h=0,l=48):(m=e+20,e=48,b=n,c=c+28-m,d=k=h=0,l=e)):d+181<=b+28&&c+28<=e+141&&c+28>=e+70.5?(q=d+181,n=b+28-q,c+28<=e+141-20-48?
(m=c+28,e=e+141-20-m,b=n,h=c=0,k=e-48,d=0,l=e):e+141-20<=c+28?(m=e+141-68,e=c+28-m,b=n,c=e,d=k=h=0,l=48):(m=e+141-68,e=48,b=n,c=c+28-m,d=k=h=0,l=e)):d>=b+28&&c+28>=e&&c+28<=e+70.5?(q=b+28,n=d-q,c+28<=e+20?(m=c+28,e=e+20+48-m,c=b=0,h=n,k=e-48,d=n,l=e):e+20+48<=c+28?(m=e+20,e=c+28-m,b=0,c=e,h=n,k=0,d=n,l=48):(m=e+20,e=48,b=0,c=c+28-m,h=n,k=0,d=n,l=e)):d>=b+28&&c+28<=e+141&&c+28>=e+70.5?(q=b+28,n=d-q,c+28<=e+141-20-48?(m=c+28,e=e+141-20-m,c=b=0,h=n,k=e-48,d=n,l=e):e+141-20<=c+28?(m=e+141-68,e=c+28-m,
b=0,c=e,h=n,k=0,d=n,l=48):(m=e+141-68,e=48,b=0,c=c+28-m,h=n,k=0,d=n,l=e)):(k=h=c=b=n=e=m=q=0,d=48,l=0);f.show().css({width:n,height:e,left:q,top:m});g.attr("d","M"+d+","+l+" L"+b+","+c+" L"+h+","+k)},bindEvents:function(){var b=this,c=!1,d=function(){$.each(BookInfo.getCurrentPages(),function(c,d){var g=b.noteImgContainers[BookInfo.getBookType()][d];g&&(g.css({cursor:""}),g.off("mousedown.addNote touchstart.addNote"))});c=!1};BookInfo.container().on("mousedown.addNote touchstart.addNote",function(){d()});
b.addBtn.bind(_event._end,function(e){var f=b.inputText.val();if(f){b.noteButtonIsShow=!1;b.noteTitleShowBtn.children("img").attr("src",b.address+"note_revert.png");b.noteButton.css({maxHeight:0,paddingBottom:0});c=!0;var g=BookInfo.getCurrentPages();$.each(g,function(e,g){var l=b.noteImgContainers[BookInfo.getBookType()][g];if(l)l.css({cursor:"url("+b.address+"note.png),auto"}).on("mousedown.addNote touchstart.addNote",function(e){b.noteButtonIsShow=!1;b.noteTitleShowBtn.children("img").attr("src",
b.address+"note_revert.png");b.noteButton.css({maxHeight:0});if(c){if(!e.which||3!=e.which){var h=e.clientX-l.offset().left;e=e.clientY-l.offset().top;h=h/(l.width()*BookInfo.scale())*100+"%";e=e/(l.height()*BookInfo.scale())*100+"%";h={key:(new Date).getTime(),time:(new Date).format("yyyy-MM-dd hh:mm:ss",!0),value:f,left:h,top:e,page:g};b.addListDataAndNoteImg(h,$(this));b.downJSonArrByKey(b.rows,"page");$(".noteCookie-noteTable-row").detach();for(h=0;h<b.rows.length;h++)b.rows[h].rowObj.css({backgroundColor:0==
h%2?"":"#bababa"}),b.rows[h].rowObj.appendTo(b.noteTableInner);b.scrollBarShowHide();b.inputText.val("");b.inputText[0].focus()}d()}})})}e.preventDefault();e.stopPropagation();return!1});b.noteTitleShowBtn.on("click.note",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 e=0;e<b.length;e++)b[e].key&&b[e].key==c&&$.extend(b[e],d)},downJSonArrByKey:function(b,c){b.sort(function(b,e){return parseInt(b[c])>parseInt(e[c])?1:parseInt(b[c])==parseInt(e[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 e=c[d].split("=");if(e[0]==b)return unescape(e[1])}return""}catch(f){}},addLocalStorage:function(b,c){try{if(window.localStorage)window.localStorage.setItem(b,c);else{var d=b+"="+escape(c),e=new Date;e.setTime(e.getTime()+864E8);d+="; expires="+e.toGMTString();document.cookie=d}}catch(f){}},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,e){var f=this;c.on(_event._down,function(b){var d=b||event,k=d.clientY-f.outerScroll.position().top,l=b.which;b.stopPropagation();1==l&&($(document).on("mousemove.scrollBar touchmove.scrollBar",function(b){b.preventDefault();
b.stopPropagation();d=b||event;b=d.clientY-k;0>=b?b=0:b>=f.scrollBar.outerHeight()-f.outerScroll.outerHeight()&&(b=f.scrollBar.outerHeight()-f.outerScroll.outerHeight());c.css({top:b});e.css({top:-b/(f.scrollBar.outerHeight()-f.outerScroll.outerHeight())*(f.noteTableInner.outerHeight()-f.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(f){if(!(d.outerHeight()>=e.outerHeight())){var h=f.originalEvent,h=h.wheelDelta||-h.detail,k=e.position().top,l;e.stop(!1,!1);0<h?l=0>k+d.outerHeight()/11?k+d.outerHeight()/11:0:0>h&&(l=e.outerHeight()-d.outerHeight()>-(k-d.outerHeight()/11)?k-d.outerHeight()/11:-(e.outerHeight()-d.outerHeight()));e.css({top:l});c.css({top:-l/(e.outerHeight()-d.outerHeight())*(b.outerHeight()-c.outerHeight())});f.stopPropagation();f.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: 9999;'></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 e=$("<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),f=$("<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),g=$("<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),h=$("<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)))});e.on("click touchend",function(){if(c.currentObj){var b=c.currentObj.width(),d=c.currentObj.height(),e=b+11;c.currentObj.css({width:e,height:e/(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()}});f.on("click touchend",function(){if(c.currentObj){var b=c.currentObj.width(),d=c.currentObj.height(),e=0>=b-11?5:b-11;c.currentObj.css({width:e,height:e/(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.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))}});
h.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(e){}var f,g;this.$signatureTitle.on("mousedown touchstart",function(d){d=isTouch?d.originalEvent.touches[0]:d;f=d.clientX-c.$signature.position().left;g=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=isTouch?b.originalEvent.touches[0]:b;c.$signature.css({left:b.clientX-f,top:b.clientY-g})});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")});d.preventDefault();d.stopPropagation();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},e={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 f=$("<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),
f=$("<div class='flipHTML5Signature-typeUnder'></div>").appendTo(f),g=$("<div class='flipHTML5Signature-typeMid'></div>").appendTo(f),h=$("<div class='flipHTML5Signature-typeEdit-typeDel'></div>").css(d).html("Edit").appendTo(f).hide(),k=$("<div class='flipHTML5Signature-typeEdit-typeDel'></div>").css(e).html("Delete").appendTo(f).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 l=$("<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(e).html("Delete").appendTo(b).hide();g.on("mouseover.signature touchstart.signature",function(){g.css({borderColor:"#ff0000"})});g.on("mouseout.signature touchend.signature",
function(){g.css({borderColor:"#cccccc"})});g.on("mousedown",function(b){b.preventDefault();b.stopPropagation();return!1});g.on("click.signature touchend.signature",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=g,
c.currentWriteEdit=h,c.currentWriteDel=k);b.preventDefault();b.stopPropagation();return!1});h.on("click.signature touchend.signature",function(){c.currentWriteSave=g;c.currentWriteEdit=h;c.currentWriteDel=k;c.$writeText.val(g.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()});k.on("click.signature touchend.signature",function(){c.currentWriteSave=
g;c.currentWriteEdit=h;c.currentWriteDel=k;c.writeSave.add(c.writeSaveAndUse).removeClass("flipHTML5Signature-normal flipHTML5Signature-hover").css(c.disableCss);c.hasAndChangeText=!1;g.html("");c.$writeText.val("");h.hide();k.hide()});l.on("mouseover.signature touchstart.signature",function(){l.css({borderColor:"#ff0000"})});l.on("mouseout.signature touchend.signature",function(){l.css({borderColor:"#cccccc"})});l.on("mousedown",function(b){b.preventDefault();b.stopPropagation();return!1});l.on("click.signature touchend.signature",
function(b){l.children("img").length?c.saveAndUseDraw(c.drawOldData):(c.$signatureUnder.hide(),c.$writeTypeUnder.hide(),c.$drawTypeUnder.show(),c.currentDrawSave=l,c.currentDrawEdit=n,c.currentDrawDel=q);b.preventDefault();b.stopPropagation();return!1});n.on("click.signature touchend.signature",function(){c.currentDrawSave=l;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=
l,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,e;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);e=this.$writeText.val();this.writeSave.add(this.writeSaveAndUse).css(this.disableCss);
b.on("click touchend",function(b){c.$writeText.val(e);c.$writeTypeUnder.hide();c.$drawTypeUnder.hide();c.$signatureUnder.show()});this.writeSaveAndUse.on("mousedow",function(b){b.preventDefault();b.stopPropagation();return!1});this.writeSaveAndUse.on("click touchend",function(b){if(c.hasAndChangeText){var g=c.$writeText.val();(e=g)&&d&&(c.saveText=g,c.saveAndUseWrite(g))}b.preventDefault();b.stopPropagation();return!1});this.writeSave.on("click touchend",function(b){c.hasAndChangeText&&(e=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(z);c.savePoints=c.points.concat();c.savePoints.push({color:c.drawColor});c.saveDraw(b)}});this.drawSaveAndUse.on("mousedown",function(b){b.preventDefault();b.stopPropagation();return!1});this.drawSaveAndUse.on("click touchend",function(b){if(c.hasDrawFlag){var d=c.trimCanvas(z);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")),e=$("<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),f=$("<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(e),
g=$("<input type='text' style='position: absolute;width: 40px;height: 13px;left: 130px;top: 0px;'/>").appendTo(d),h=$("<div class='flipHTML5Signature-drawTypeMid-undo'></div>").css({left:28}).appendTo(b).html("UNDO"),k=$("<div class='flipHTML5Signature-drawTypeMid-redo'></div>").css({left:80}).appendTo(b).html("REDO"),l=$("<div class='flipHTML5Signature-drawTypeMid-clearAll'></div>").css({left:152,width:78}).html("Clear All").appendTo(b);this.clearAllBtn=l;h.add(k).add(l).removeClass("flipHTML5Signature-normal flipHTML5Signature-hover").css(this.disableCss);
this.undo=h;this.redo=k;h.on("mouseover.signature touchstart.signature",function(b){c.undoIsUse&&h.removeClass("flipHTML5Signature-normal").addClass("flipHTML5Signature-hover").css(c.overCss)});k.on("mouseover.signature touchstart.signature",function(b){c.redoIsUse&&k.removeClass("flipHTML5Signature-normal").addClass("flipHTML5Signature-hover").css(c.overCss)});l.on("mouseover.signature touchstart.signature",function(b){c.clearAllFalg&&l.removeClass("flipHTML5Signature-normal").addClass("flipHTML5Signature-hover").css(c.overCss)});
h.on("mouseout.signature touchend.signature",function(b){c.undoIsUse&&h.removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss)});k.on("mouseout.signature touchend.signature",function(b){c.redoIsUse&&k.removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss)});l.on("mouseout.signature touchend.signature",function(b){c.clearAllFalg&&l.removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss)});
h.on("mousedown.signature",function(b){c.undoIsUse&&h.removeClass("flipHTML5Signature-hover flipHTML5Signature-normal").css(c.downCss)});k.on("mousedown.signature",function(b){c.redoIsUse&&k.removeClass("flipHTML5Signature-hover flipHTML5Signature-normal").css(c.downCss)});l.on("mousedown.signature",function(b){c.clearAllFalg&&l.removeClass("flipHTML5Signature-hover flipHTML5Signature-normal").css(c.downCss)});h.add($(document)).on("mouseup.signature",function(b){c.undoIsUse&&h.removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss)});
k.add($(document)).on("mouseup.signature",function(b){c.redoIsUse&&k.removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss)});l.add($(document)).on("mouseup.signature",function(b){c.clearAllFalg&&l.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,m=document.createElement("canvas"),r=m.getContext("2d"),
s=$(m).css({position:"absolute",left:0,top:-Math.floor(q)});n.append(s);this.previewCanvas=m;this.previewContext=r;m.width=234;m.height=60+Math.ceil(q)+10;b=this.colorPicker(b);b.container.css({left:220,top:11});var t,u,w;g[0].value=parseFloat((7*(parseInt(f.css("left"))+4)+1).toFixed(2));f.on("mousedown touchstart",function(b){t=b.clientX-f.position().left;e.add(d).add($(document)).on("mousemove.lineWidth touchmove.lineWidth",function(b){u=b.clientX-t;u=-4>=u?-4:93<=u?93:u;f.css({left:u});w=(u+4)/
97*7+1;w=parseFloat(w.toFixed(2));g[0].value=w});d.add($(document)).on("mouseup.lineWidth touchend.lineWidth",function(){c.changeLineWidth(w);e.add(d).add($(document)).off("mousemove.lineWidth touchmove.lineWidth");d.add($(document)).off("mouseup.lineWidth touchend.lineWidth")});b.preventDefault();b.stopPropagation();return!1});e.on("mousedown touchstart",function(b){b=b.clientX-e.offset().left;b=0>=b?0:97<=b?97:b;f.css({left:b-4});w=b/97*7+1;w=parseFloat(w.toFixed(2));g[0].value=w;c.changeLineWidth(w)});
g.on("change",function(){var b=g[0].value;isNaN(b)?g[0].value=parseFloat(((f.position().left+4)/97*7+1).toFixed(2)):(1>b?(g[0].value=1,f.css({left:-4})):8<b?(g[0].value=8,f.css({left:93})):(g[0].value=b,f.css({left:(b-1)/7*97-4})),c.changeLineWidth(g[0].value))});l.on("click touchend",function(){c.clearAllFalg&&(B.clearRect(0,0,z.width,z.height),r.clearRect(0,0,m.width,m.height),c.drawSave.add(c.drawSaveAndUse).removeClass("flipHTML5Signature-normal flipHTML5Signature-hover").css(c.disableCss),c.hasDrawFlag=
!1,c.redoIsUse=!0,k.css(c.normalCss).addClass("flipHTML5Signature-normal").removeClass("flipHTML5Signature-hover"),c.undoIsUse=!1,h.removeClass("flipHTML5Signature-hover flipHTML5Signature-normal").css(c.disableCss),A=c.drawOldPoints.length-1,l.add(c.drawSaveAndUse).removeClass("flipHTML5Signature-normal flipHTML5Signature-hover").css(c.disableCss),c.clearAllFalg=!1,c.points=[])});var A=0;h.on("mousedown.signature touchstart.signature",function(b){if(c.undoIsUse){c.redoIsUse=!0;k.css(c.normalCss).addClass("flipHTML5Signature-normal").removeClass("flipHTML5Signature-hover");
A+=1;A=A>=c.drawOldPoints.length?c.drawOldPoints.length-1:A;B.clearRect(0,0,z.width,z.height);r.clearRect(0,0,m.width,m.height);var d=c.drawOldPoints[c.drawOldPoints.length-1-A];c.points=d.concat();c.draw(z,B,c.drawOldPoints[c.drawOldPoints.length-1-A],c.drawColor,c.lineWidth);c.drawPreview(m,r,d,c.drawColor,c.lineWidth);c.drawSave.add(c.drawSaveAndUse).removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss);c.hasDrawFlag=!0;l.add(c.drawSaveAndUse).removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss);
c.clearAllFalg=!0;A==c.drawOldPoints.length-1&&(c.undoIsUse=!1,h.removeClass("flipHTML5Signature-hover flipHTML5Signature-normal").css(c.disableCss),c.drawSave.add(c.drawSaveAndUse).removeClass("flipHTML5Signature-normal flipHTML5Signature-hover").css(c.disableCss),c.hasDrawFlag=!1,l.add(c.drawSaveAndUse).removeClass("flipHTML5Signature-normal flipHTML5Signature-hover").css(c.disableCss),c.clearAllFalg=!1);b.preventDefault();b.stopPropagation();return!1}});k.on("mousedown.signature touchstart.signature",
function(b){if(c.redoIsUse){c.undoIsUse=!0;h.css(c.normalCss).addClass("flipHTML5Signature-normal").removeClass("flipHTML5Signature-hover");A-=1;A=0>=A?0:A;B.clearRect(0,0,z.width,z.height);r.clearRect(0,0,m.width,m.height);var d=c.drawOldPoints[c.drawOldPoints.length-1-A];c.points=d.concat();c.draw(z,B,c.drawOldPoints[c.drawOldPoints.length-1-A],c.drawColor,c.lineWidth);c.drawPreview(m,r,d,c.drawColor,c.lineWidth);c.drawSave.add(c.drawSaveAndUse).removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss);
c.hasDrawFlag=!0;l.add(c.drawSaveAndUse).removeClass("flipHTML5Signature-hover").addClass("flipHTML5Signature-normal").css(c.normalCss);c.clearAllFalg=!0;0==A&&(c.redoIsUse=!1,k.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 z=document.createElement("canvas"),v=window.canvas=$(z);q.append(v);z.width=540;z.height=158;$(z).css({position:"absolute",left:0,top:-16});var B=z.getContext("2d");
this.canvas=z;this.context=B;this.points=[];this.drawColor=b.message[0].style.backgroundColor;this.lineWidth=1;var C,F;v.on("mousedown.signature touchstart.signature",function(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;h.css(c.normalCss).addClass("flipHTML5Signature-normal").removeClass("flipHTML5Signature-hover");c.redoIsUse=!1;k.removeClass("flipHTML5Signature-hover flipHTML5Signature-normal").css(c.disableCss);
c.clearAllFalg=!0;l.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");C={x:b.clientX-v.offset().left+0,y:b.clientY-v.offset().top+16,t:0,w:c.lineWidth};c.points.push(C);v.on("mousemove.signature touchmove.signature",function(b){F={x:b.clientX-v.offset().left+0,y:Math.min(b.clientY-v.offset().top+16,156),t:1};c.points.push(F);
c.draw(z,B,c.points,c.drawColor,c.lineWidth);c.drawPreview(m,r,c.points,c.drawColor,c.lineWidth)});v.add($(document)).on("mouseup.signature touchend.signature",function(){c.drawOldPoints.push(c.points.concat());v.off("mousemove.signature touchmove.signature");v.add($(document)).off("mouseup.signature touchend.signature")});b.preventDefault();b.stopPropagation();return!1})},addSignatureImg:function(b,c,d){var e=this;b.on("mousedown.hideToolBar touchstart.hideToolBar",function(b){e.toolBar&&e.toolBar.hide()});
b.css({cursor:"pointer"});void 0!=e.onCreated?e.onCreated[1].call(e.onCreated[0]):e.hide();b.off("mousedown.signature touchstart.signature");b.on("mousedown.signature touchstart.signature",function(f){b.off("mousedown.signature touchstart.signature");if(isTouch||1===f.which){var g=new Date,h=g.getTime(),g=g.format("MM/dd/yyyy hh:mm:ss");e.showTimeFalg[h]=!1;var k=f.clientX/BookInfo.scale()-b.offset().left,l=f.clientY/BookInfo.scale()-b.offset().top,k=e.parseData({left:k,top:l,width:c.width,height:c.height},
b[0].offsetWidth,b[0].offsetHeight),l=$.extend({},c,{width:k.width,height:k.height});e.oldData[h]=l;e.createSignatureImg(b,l,d,k.left,k.top,h,g);e.signatureCookies.push({type:l.type,data:0===c.type?e.saveText:e.savePoints,key:h,page:d,currentTime:g,left:k.left,top:k.top,width:l.width,height:l.height});e.addLocalStorage(e.signatureName,e.parseToString(e.signatureCookies));f.preventDefault();f.stopPropagation();return!1}});b.add($(document)).add(BookInfo.container()).on("mouseup.signature touchend.signature",
function(c){$.each(BookInfo.getCurrentPages(),function(b,c){var d=e.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,e,f,g,h){var k=this;b.on("mousedown.hideToolBar touchstart.hideToolBar",function(){k.toolBar&&k.toolBar.hide()});var l=$("<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",g).attr("data-page",d).css({position:"absolute",width:c.width,height:c.height,left:e,top:f}).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(h);c=$("<img/>").attr("src",k.address+"signature_dateClose.png").css({position:"absolute",top:0,right:0,cursor:"pointer"});n.appendTo(l).append(c);c.off("mousedown touchstart");c.on("mousedown touchstart",
function(){var b=k.currentObj.attr("data-key");n.hide();k.showTimeFalg[b]=!1});n.off("mousedown touchstart");n.on("mousedown touchstart",function(b){b.preventDefault();b.stopPropagation();return!1});l.off("mouseover.signature touchstart.signature");l.on("mouseover.signature touchstart.signature",function(){l.css({border:"1px solid #ff0000"})});l.off("mouseout.signature touchend.signature");l.on("mouseout.signature touchend.signature",function(){l.css({border:0})});l.off("mousedown.getObj touchstart.getObj");
l.on("mousedown.getObj touchstart.getObj",function(b){$(".flipHTML5Signature-eachSignatureImg").css({zIndex:1});l.css({zIndex:4});k.currentObj=l;k.toolBar.css({left:l.offset().left-k.container.offset().left,top:l.offset().top-k.container.offset().top-k.toolBar.outerHeight()}).show()});var q=!1;l.off("mousedown.signatureImg touchstart.signatureImg");l.on("mousedown.signatureImg touchstart.signatureImg",function(c){var d=c.pageX,e=c.pageY,h=l[0].offsetLeft,n=l[0].offsetTop;b.on("mousemove.signatureImg touchmove.signatureImg",
function(b){q=!0;var c=h-(d-b.pageX)/BookInfo.scale();f=n-(e-b.pageY)/BookInfo.scale();l.css({left:c,top:f});k.toolBar.css({left:l.offset().left-k.container.offset().left,top:l.offset().top-k.container.offset().top-k.toolBar.outerHeight()}).show();k.showTimeFalg[g]&&k.reviseDateTag()});l.add(b).add($(document)).on("mouseup.signatureImg touchend.signatureImg",function(){b.off("mousemove.signatureImg touchmove.signatureImg");l.add(b).add($(document)).off("mouseup.signatureImg touchend.signatureImg");
if(q){var c=l.attr("data-key"),d=k.parseObject(k.currentObj[0]);k.updateArrayOrderKey(k.signatureCookies,c,{left:d.left,top:d.top});k.addLocalStorage(k.signatureName,k.parseToString(k.signatureCookies))}});c.preventDefault();c.stopPropagation();return!1});b.css({cursor:""})},draw:function(b,c,d,e,f){var g=-1,h=d.length;c.clearRect(0,0,b.width,b.height);c.save();c.beginPath();c.lineJoin="round";c.strokeStyle=e;for(c.lineWidth=f;++g<h;)b=d[g],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,e,f){var g=-1,h=d.length,k=140/60,l=540/234;c.clearRect(0,0,b.width,b.height);c.save();c.beginPath();c.lineJoin="round";c.strokeStyle=e;for(c.lineWidth=f;++g<h;)b=d[g],0===b.t?(c.stroke(),c.beginPath(),c.lineWidth=b.w/k,c.moveTo(b.x/l,b.y/k)):c.lineTo(b.x/l,b.y/l);c.stroke();c.restore()},trimCanvas:function(b){var c=b.getContext("2d"),d=document.createElement("canvas").getContext("2d"),e=c.getImageData(0,0,b.width,b.height),
f=e.data.length,g,h=null,k=null,l=null,n=null,q,m;for(g=0;g<f;g+=4)0!==e.data[g+3]&&(q=g/4%b.width,m=~~(g/4/b.width),null===h&&(h=m),null===k?k=q:q<k&&(k=q),null===l?l=q:l<q&&(l=q),null===n?n=m:n<m&&(n=m));b=n-h;l-=k;c=c.getImageData(k,h,l,b);d.canvas.width=l;d.canvas.height=b;d.putImageData(c,0,0);return{url:d.canvas.toDataURL("image/png"),width:l,height:b}},saveDraw:function(b){if(this.currentDrawSave){this.currentDrawSave.empty();var c=this.currentDrawSave.width(),d=this.currentDrawSave.height(),
e=c/d,f=b.width,g=b.height,h=f/g;c>f&&d>g?(e=f,c=(c-e)/2,d=(d-g)/2):c>f&&d<g?(e=d*h,g=d,c=(c-e)/2,d=(d-g)/2):c<f&&d>g?(e=c,g=c/h,c=(c-e)/2,d=(d-g)/2):e>h?(g=d,e=d*h,c=(c-e)/2,d=0):e<h?(e=c,g=c/h,c=0,d=(d-g)/2):(e=c,g=d,d=c=0);this.currentDrawSave.append($("<img/>").css({position:"absolute",width:e,height:g,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,f){var g=c.signatureContexts[BookInfo.getBookType()][f];g&&(b.type=1,c.addSignatureImg(g,b,f))});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"),e=BookInfo.getCurrentPages();$.each(e,function(b,e){var h=
c.signatureContexts[BookInfo.getBookType()][e];h&&(d.type=0,h.css({cursor:""}),c.addSignatureImg(h,d,e))});c.saveWrite(b)},drawTextByDiv:function(b,c,d,e){var f=document.createElement("canvas"),g=window.context=f.getContext("2d");g.fillStyle=e;g.font=""+c+" "+d+"";var h=g.measureText(b).width+8;f.width=h;f.height=54;g.fillStyle=e;g.font=""+c+" "+d+"";g.textBaseline="top";g.fillText(b,3,0);return{url:f.toDataURL("image/png"),width:h,height:54}},parseObject:function(b){if(document.getElementsByTagName("body")[0].contains(b)){var c,
d,e;e=b.parentNode;var f=b.style,g=$(b);d=100/e.offsetHeight;c=100/e.offsetWidth;e=b.offsetLeft*c+"%";b=b.offsetTop*d+"%";c=g.width()*c+"%";d=g.height()*d+"%";f.width=c;f.height=d;f.left=e;f.top=b;return{width:c,height:d,left:e,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,e,f=this,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"),n=function(){},q=function(){h.style.display="none";l.value=l.style.backgroundColor=this.title.toUpperCase();f.changeColor(this.title.toUpperCase())};k.appendTo(b);c.className="flipHtml5ColorSelectorWrap";h.setAttribute("border","1");c.style.position="absolute";c.href="javascript:void(0);";l.type="text";l.className="flipHtml5ColorSelectorMessage";l.style.width="20px";l.style.height="20px";l.value=
l.style.backgroundColor="#000000";l.style.cursor="pointer";l.style.padding="0px";c.appendChild(l);c.appendChild(h);h.style.display="none";h.style.position="relative";h.style.zIndex=9999;h.style.backgroundColor="#ffffff";for(d=0;7>d;d++){e=document.createElement("tr");e.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=g[10*d+c],b.style.backgroundColor=g[10*
d+c],$(b).on("mouseenter",n),$(b).on("click touchstart",q),e.appendChild(b);h.appendChild(e)}$(l).on("click touchstart",function(b){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)}},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 e=this.signatureCookies[d];if(e.page===b){var f=e.left,g=e.top,h=e.key,k=e.currentTime;if(0==e.type)var l=this.drawTextByDiv(e.data,"38px","Mistral","#000000"),n=this.parseData({left:f,top:g,width:l.width,height:l.height},c[0].offsetWidth,c[0].offsetHeight);else{l=document.createElement("canvas");l.width=540;l.height=158;$(l).css({position:"absolute",
left:0,top:-16});var n=l.getContext("2d"),q=e.data.concat(),m=q.pop();this.draw(l,n,q,m.color,1);l=this.trimCanvas(l);n=this.parseData({left:f,top:g,width:l.width,height:l.height},c[0].offsetWidth,c[0].offsetHeight)}this.oldData[h]=$.extend({},l,{width:n.width,height:n.height});l=$.extend({},l,{width:e.width,height:e.height});this.createSignatureImg(c,l,e.page,f,g,h,k)}}},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 e=c[d].split("=");if(e[0]==b)return unescape(e[1])}return""}catch(f){}},addLocalStorage:function(b,c){try{if(window.localStorage)window.localStorage.setItem(b,c);else{var d=b+"="+escape(c),e=new Date;e.setTime(e.getTime()+864E8);d+="; expires="+e.toGMTString();document.cookie=d}}catch(f){}},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 e=0;e<b.length;e++)b[e].key&&b[e].key==c&&$.extend(b[e],d)},createCursorImg:function(b,c,d){var e=$("<img/>").attr("src",b.url).css({position:"absolute",width:b.width,height:b.height,left:c+10,top:d+10}).appendTo(this.container);e.on("mousemove touchmove",function(b){e.css({left:b.clientX+
10,top:b.clientY+10})});return e},reviseDateTag:function(){if(this.currentObj){var b=this.currentObj.find(".flipHTML5Signature-eachDate"),c=this.currentObj.parent(),d=parseInt(this.currentObj.css("left")),e=parseInt(this.currentObj.css("top"));this.currentObj.position();var f=this.currentObj.outerWidth(),g=this.currentObj.outerHeight(),h=c.width();c.height();var c=b.outerWidth(),k=b.outerHeight(),l=this.toolBar.height();d+f+2+c<=h?b.css({left:f+2,top:-24}):k+l<=e?b.css({left:f-c,top:-(k+l)}):b.css({left:f-
c,top:g+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(),f=this.createHighlightToolbar();c.appendChild(this.createColorSelector());
document.getElementsByTagName("body")[0].appendChild(c).appendChild(f);document.getElementsByTagName("body")[0].appendChild(f);b(window).on("beforeunload",function(){this.save()}.bind(this));this.oneBindEvent()},bindOnCreated:function(b,c){this.onCreated=[b,c]},bindCreateEvents:function(c,f,g){var h,k,l,n,q,m,r,s=this,t=Math.floor,u=c.offset().left,w=c.offset().top,A=function(b){l=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;l&&(0>l-h?(m.left=t((l-u)/d.scale())+"px",m.width=t((h-l)/d.scale())+"px"):(m.left=t((h-u)/d.scale())+"px",m.width=t((l-h)/d.scale())+"px"));n&&(0>b.pageY-k?(m.top=t((n-w)/d.scale())+"px",m.height=t((k-n)/d.scale())+"px"):(m.top=t((k-w)/d.scale())+"px",m.height=t((n-k)/d.scale())+"px"));g&&g.draw(h,k,l,n)};c.css("cursor","crosshair");c.off("mousedown.fliphtml5Remark touchstart.fliphtml5Remark").one("mousedown.fliphtml5Remark touchstart.fliphtml5Remark",function(z){s.unbindCreateEvents();
var v=z.button;if(!document.implementation.hasFeature("MouseEvents","2.0"))switch(event.button){case 0:case 1:case 3:case 5:case 7:v=0;break;case 2:case 6:v=2;break;case 4:v=1}0===v&&(z.stopPropagation(),q=document.createElement("div"),r=b(q),m=q.style,g?(r.append(g),q.className="flipHtml5Shape flipHtml5Store"):(m.backgroundColor=f?"rgba(0, 71, 255, 0.33)":s.highlightBackcolor,q.className=(f?"flipHtml5Remark flipHtml5Store":"flipHtml5Highlight flipHtml5Store")+" flipHtml5RemarkCurrentEditor",q.setAttribute("contenteditable",
f)),c.find(".flipHtml5RemarkCurrentEditor").removeClass("flipHtml5RemarkCurrentEditor"),c.append(q),h=l=z.pageX||z.originalEvent.touches[0].pageX,k=n=z.pageY||z.originalEvent.touches[0].pageY,s.reBindEvent(r,f),c.on("mousemove.fliphtml5Remark touchmove.fliphtml5Remark",A),c.off("mouseup.fliphtml5Remark touchend.fliphtml5Remark").one("mouseup.fliphtml5Remark touchend.fliphtml5Remark",function(b){l=b.pageX||b.originalEvent.touches[0].pageX;n=b.pageY||b.originalEvent.touches[0].pageY;c.off("mousemove.fliphtml5Remark touchmove.fliphtml5Remark");
if(10>Math.abs(l-h)||10>Math.abs(n-k))m.left=t((l-u)/d.scale())+"px",m.top=t((n-w)/d.scale())+"px",m.width="280px",m.height="28px";s.parsePresentValue(q);s.parsePresentValue(s.sizeWrap);r.css({outline:"none",backgroundColor:f?s.backgroundColor:s.highlightBackcolor,color:s.fontColor});r.trigger("click");void 0!=s.onCreated&&s.onCreated[1].call(s.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,g;d=c.parentNode;var h=c.style,k=b(c);g=100/d.offsetHeight;d=100/d.offsetWidth;h.width=k.width()*d+"%";h.height=
k.height()*g+"%";h.left=c.offsetLeft*d+"%";h.top=c.offsetTop*g+"%"}},reBindEvent:function(c,d){var g=this,h;c.on("click",function(h){h.stopPropagation();b(this).css({outline:"none"});g.removeSizeWrap();g.addSizeWrap(this,d);c.on("mousedown.flipHtml5Annotation touchstart.flipHtml5Annotation",function(b){b.stopPropagation()})}).on("mousedown mouseup",function(b){b.stopPropagation()});c.on("sizeChange",function(b,c,e,q,m){h=this.style;c&&(h.width=c-16+"px");e&&(h.height=e-16+"px");q&&(h.left=q+8+"px");
m&&(h.top=m+8+"px");g.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,e=c.style,f=e.height;setTimeout(function(){e.height="auto";e.height=c.scrollHeight>d?100*c.scrollHeight/c.parentNode.offsetHeight+"%":f},0)}})},unbindCreateEvents:function(){this.contextArray.css("cursor","auto");this.contextArray.off("mousedown.fliphtml5Remark touchstart.fliphtml5Remark")},newSizeWrap:function(){var c,f,g,h,k,l,n,q,m=this,
r=1,s=m.sizeWrap=document.createElement("div"),t=[],u=Math.floor,w=m.sizeWrapStyle=s.style;for(s.className="flipHtml5SizeWrap";9>r;)c=document.createElement("div"),c.className="flipHtml5SizePoint flipHtml5SizePoint"+r,s.appendChild(c),t.push(c),r++;m.northResize(t[0]).westResize(t[0]);m.northResize(t[1]);m.eastResize(t[2]).northResize(t[2]);m.eastResize(t[3]);m.eastResize(t[4]).southResize(t[4]);m.southResize(t[5]);m.southResize(t[6]).westResize(t[6]);m.westResize(t[7]);b(s).on("mousedown.flipHtml5SizeWrap touchstart.flipHtml5SizeWrap",
function(c){c.preventDefault();c.stopPropagation();q=m.currentEditor;var e=s.offsetLeft,r=s.offsetTop,t=c.pageX||c.originalEvent.touches[0].pageX,C=c.pageY||c.originalEvent.touches[0].pageY;b.each([m.$context,b(m.toolbarContainer),b(m.highlightToolbarContainer)],function(c,A){A.on("mousemove.flipHtml5SizeWrap touchmove.flipHtml5SizeWrap",function(b){b.preventDefault();b.stopPropagation();f=b.pageX?b.pageX:b.originalEvent.touches?b.originalEvent.touches[0].pageX:0;g=b.pageY?b.pageY:b.originalEvent.touches?
b.originalEvent.touches[0].pageY:0;f&&(n=u(e-(t-f)/d.scale()),k!==n&&(w.left=n+"px",k=n,q.trigger("sizeChange",[0,0,n,0])));g&&(l=u(r-(C-g)/d.scale()),h!==l&&(w.top=l+"px",h=l,q.trigger("sizeChange",[0,0,0,l])))});A.one("mouseup.flipHtml5SizeWrap touchend.flipHtml5SizeWrap",function(){b.each([m.$context,b(m.toolbarContainer),b(m.highlightToolbarContainer)],function(){this.off("mouseup.flipHtml5SizeWrap touchend.flipHtml5SizeWrap");this.off("mousemove.flipHtml5SizeWrap touchmove.flipHtml5SizeWrap")});
m.parsePresentValue(q[0]);m.parsePresentValue(s)})})}).on("click",function(b){b.stopPropagation()});return s},addSizeWrap:function(c,d){var g=this.sizeWrap,h=this.sizeWrap.style;d?(c.style.zIndex=999,h.zIndex=998):(c.style.zIndex=998,h.zIndex=999);h.width=c.offsetWidth+16+"px";h.height=c.offsetHeight+16+"px";h.left=c.offsetLeft-8+"px";h.top=c.offsetTop-8+"px";h.display="block";c=b(c);this.$context=c.parent();c.before(g);this.parsePresentValue(g);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 g=d?this.toolbarContainer:this.highlightToolbarContainer,h=g.style,k=b(c),l=k.css("backgroundColor").replace(/\s+/g,"");0<=l.indexOf("rgba")&&(l=l.replace(/a/,"").replace(/\,[0-9]+(\.[0-9]*)?\)/,
")"));b(g).find(".flipHtml5RemarkImage-backcolor").css("backgroundColor",l);this.currentEditor=k;h.left=k.offset().left-8+"px";h.top=k.offset().top-(d?80:30)+"px";h.display="block"},createToolbar:function(){for(var b=this.toolbarContainer=document.createElement("div"),c=0,d="bold italic strikeThrough underline forecolor backcolor blockquote insertUnorderedList insertOrderedList justifyLeft justifyCenter justifyRight createLink removeFormat outdent indent undo redo delete paragraph fontsize fontname".split(" ");d[c];)b.appendChild(this.createButton(d[c])),
c++;b.className="fliphtml5RemarkToolbarContainer";return b},createHighlightToolbar:function(){for(var b=this.highlightToolbarContainer=document.createElement("div"),c=0,d=["backcolor","delete"];d[c];)b.appendChild(this.createButton(d[c],!0)),c++;b.className="fliphtml5RemarkHighlightToolbarContainer";return b},createButton:function(b,c){var d=this,h,k;switch(b){case "hr":return k=document.createElement("hr"),k.className="flipHtml5RemarkHr",k;case "paragraph":return h="Paragraph;Address;Preformatted;Title 1;Title 2;Title 3;Title 4;Title 5;Title 6".split(";"),
k="p address pre h1 h2 h3 h4 h5 h6".split(" "),k=d.createSelect(h,k,b);case "fontname":return h="Arial Century Courier Gentium Georgiae Impact King Lalit Modena Papyrus Tahoma TeX Times Verdana Verona cursive fantasy monospace serif".split(" "),k="Arial Century Courier Gentium Georgiae Impact King Lalit Modena Papyrus Tahoma TeX Times Verdana Verona cursive fantasy monospace serif".split(" "),k=d.createSelect(h,k,b,"fontFamily");case "fontsize":return h=[1,2,3,4,5,6,7],k=[1,2,3,4,5,6,7],k=d.createSelect(h,
k,b,"fontSize");case "forecolor":return d.createColorButton(b);case "backcolor":return d.createColorButton(b,c);default:return h=document.createElement("a"),h.href="javascript:void(0);",k=document.createElement("div"),k.className="flipHtml5RemarkButtonImage flipHtml5RemarkImage-"+b,k.title=b,h.className="flipHtml5RemarkButton",h.onclick=function(){d.exec(b)},h.appendChild(k),h}},createColorButton:function(c,d){var g,h,k,l,n=this,q;g=document.createElement("a");g.href="javascript:void(0);";h=document.createElement("div");
h.className="flipHtml5RemarkButtonImage flipHtml5RemarkImage-"+c;h.title=c;g.className="flipHtml5RemarkButton";k=document.createElement("div");k.className="flipHtml5RemarkColorBar";"backcolor"===c&&(k.style.display="none");g.onclick=function(m){m.stopPropagation();q=n.opacityHandel;l=n.colorSelector;b(g).after(l);l.style.left=this.offsetLeft+"px";l.style.top=this.offsetTop+22+"px";l.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("click",function(){l.style.display="none"});n.currentEditor.one("click",function(){l.style.display="none"});n.$bookContainer.one("click",function(){l.style.display="none"});n.$colorSelector.off("colorSelected").one("colorSelected",function(b,g){"backcolor"===c?h.style.backgroundColor=g:k.style.backgroundColor=g;l.style.display="none";n.exec(c,g,d)})};g.appendChild(k);g.appendChild(h);return g},createSelect:function(b,c,d,h,k){var l=document.createElement("select"),
n=0,q=this,m;l.className="flipHtml5RemarkSelect flipHtml5Remark-"+d;for(l.style[h]=c[1];b[n];)m=document.createElement("option"),m.className="flipHtml5RemarkOption-"+d+" flipHtml5RemarkOption-"+c[n],m.innerHTML=b[n],m.value=c[n],m.style[h]=c[n],0===n&&(m.setAttribute("selected",!0),k&&(m.style.display="none")),l.appendChild(m),n++;l.onchange=h?function(){q.exec(d,this[this.selectedIndex].value);this.style[h]=this[this.selectedIndex].value;k&&(this.selectedIndex=0)}:function(){q.exec(this[this.selectedIndex].value);
k&&(this.selectedIndex=0)};return l},createColorSelector:function(){var c,d,g,h,k=this,l="#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"),m=this.$colorSelector=b(q),r=document.createElement("input");c=k.createOpacityPlugin();var s=function(){r.value=r.style.backgroundColor=this.title.toUpperCase()},t=function(){m.trigger("colorSelected",[k.parseColorToRGBA(this.title,k.opacity)])};q.className="flipHtml5RemarkColorSelectorWrap";n.setAttribute("border","1");q.style.display="none";q.href="javascript:void(0);";r.className="flipHtml5RemarkColorSelectorMessage";
r.value="#000000";r.setAttribute("disabled","true");q.appendChild(r);q.appendChild(c.container);q.appendChild(n);m.on("mousedown",function(b){b.stopPropagation()});m.on("click",function(b){b.stopPropagation()});for(g=0;7>g;g++){h=document.createElement("tr");for(d=0;10>d;d++)c=document.createElement("td"),c.className="flipHtml5RemarkColorSelectorBlock",c.title=l[10*g+d],c.style.backgroundColor=l[10*g+d],b(c).on("mouseenter",s),b(c).on("click",t),h.appendChild(c);n.appendChild(h)}return q},createOpacityPlugin:function(){var c,
d,g,h,k,l,n=0.5,q=this,m=Math.floor,r=document.createElement("div"),s=document.createElement("div"),t=document.createElement("span"),u=s.style,w,A=q.$document,z=q.changeOpacity,v=b(s),B=b(r);t.className="flipHtml5RemarkOpacitySpan";r.className="flipHtml5RemarkOpacity";s.className="flipHtml5RemarkOpacityCursor";r.appendChild(t);r.appendChild(s);B.on("click",function(b){b.preventDefault();b.stopPropagation();w=q.currentEditor;if(d=b.pageX?b.pageX:b.originalEvent.touches?b.originalEvent.touches[0].pageX:
0)g=d-B.offset().left,0>g&&(g=0),145<g&&(g=145),u.left=g+"px",w.css("backgroundColor",z(w,g/145)),t.innerHTML="Opacity: "+(g/145).toFixed(2),n=g/145});v.on("mousedown touchstart",function(b){b.preventDefault();b.stopPropagation();w=q.currentEditor;g=h=parseInt(u.left,10);c=b.pageX?b.pageX:b.originalEvent.touches?b.originalEvent.touches[0].pageX:0;k=g-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)l=m(k+d),0>l&&(l=0),145<l&&(l=145),h!==l&&(u.left=l+"px",w.css("backgroundColor",z(w,l/145)),t.innerHTML="Opacity: "+(l/145).toFixed(2),n=l/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:r,show:function(){r.style.display=""},hide:function(){r.style.display="none"},
setOpacity:function(b){if(void 0===b||1<b||isNaN(b))b=1;0>b&&(b=0);u.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,h,k;c=parseFloat(c);1<=c&&
(c=1);0>=c&&(c=0);d=parseInt(b.substring(1,3),16);h=parseInt(b.substring(3,5),16);k=parseInt(b.substring(5,7),16);return"rgba("+d+","+h+","+k+","+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("click")},northResize:function(c){var f,
g,h,k,l,n=this,q=Math.floor,m,r;b(c).on("mousedown.fliphtml5RemarkResize touchstart.fliphtml5RemarkResize",function(b){b.preventDefault();b.stopPropagation();g=n.currentEditor;m=n.sizeWrap;r=n.sizeWrapStyle;l=n.$context;var c=m.offsetHeight||20,e=b.pageY||b.originalEvent.touches[0].pageY;l.one("mouseup.fliphtml5RemarkResize touchend.fliphtml5RemarkResize",function(){l.off("mousemove.fliphtml5RemarkResize touchmove.fliphtml5RemarkResize");n.parsePresentValue(g[0]);n.parsePresentValue(m)});l.on("mousemove.fliphtml5RemarkResize touchmove.fliphtml5RemarkResize",
function(b){b.preventDefault();b.stopPropagation();b.pageY?f=b.pageY:b.originalEvent.touches&&(f=b.originalEvent.touches[0].pageY);f&&(k=q(c+(e-f)/d.scale()),h!==k&&20<k&&(r.top=f-l.offset().top+"px",r.height=k+"px",h=k,g.trigger("sizeChange",[0,k,0,f-l.offset().top])))})});return this},westResize:function(c){var f,g,h,k,l,n=this,q=Math.floor,m,r;b(c).on("mousedown.fliphtml5RemarkResize touchstart.fliphtml5RemarkResize",function(b){b.preventDefault();b.stopPropagation();l=n.$context;m=n.sizeWrap;
r=n.sizeWrapStyle;k=n.currentEditor;var c=m.offsetWidth||40,e=b.pageX||b.originalEvent.touches[0].pageX;l.one("mouseup.fliphtml5RemarkResize touchend.fliphtml5RemarkResize",function(){l.off("mousemove.fliphtml5RemarkResize touchmove.fliphtml5RemarkResize");n.parsePresentValue(k[0]);n.parsePresentValue(m)});l.on("mousemove.fliphtml5RemarkResize touchmove.fliphtml5RemarkResize",function(b){b.preventDefault();b.stopPropagation();!(f=b.pageX)&&b.originalEvent.touches&&(f=b.originalEvent.touches[0].pageX);
f&&(h=q(c+(e-f)/d.scale()),g!==h&&40<h&&(r.left=f-l.offset().left+"px",r.width=h+"px",g=h,k.trigger("sizeChange",[h,0,f-l.offset().left])))})});return this},eastResize:function(c){var f,g,h,k,l,n=this,q=Math.floor,m,r;b(c).on("mousedown.fliphtml5RemarkResize touchstart.fliphtml5RemarkResize",function(b){b.preventDefault();b.stopPropagation();h=n.currentEditor;l=n.$context;m=n.sizeWrap;r=n.sizeWrapStyle;var c=m.offsetWidth||40,e=b.pageX||b.originalEvent.touches[0].pageX;l.one("mouseup.fliphtml5RemarkResize touchend.fliphtml5RemarkResize",
function(){l.off("mousemove.fliphtml5RemarkResize touchmove.fliphtml5RemarkResize");n.parsePresentValue(h[0]);n.parsePresentValue(m)});l.on("mousemove.fliphtml5RemarkResize touchmove.fliphtml5RemarkResize",function(b){b.preventDefault();b.stopPropagation();b.pageX?f=b.pageX:b.originalEvent.touches&&(f=b.originalEvent.touches[0].pageX);f&&(g=q(c-(e-f)/d.scale()),k!==g&&40<g&&(r.width=g+"px",k=g,h.trigger("sizeChange",[g])))})});return this},southResize:function(c){var f,g,h,k,l=this,n=Math.floor,q,
m,r;b(c).on("mousedown.fliphtml5RemarkResize touchstart.fliphtml5RemarkResize",function(b){b.preventDefault();b.stopPropagation();k=l.$context;r=l.sizeWrap;m=l.sizeWrapStyle;g=l.currentEditor;var c=r.offsetHeight||20,e=b.pageY||b.originalEvent.touches[0].pageY;k.one("mouseup.fliphtml5RemarkResize touchend.fliphtml5RemarkResize",function(){k.off("mousemove.fliphtml5RemarkResize touchmove.fliphtml5RemarkResize");l.parsePresentValue(g[0]);l.parsePresentValue(r)});k.on("mousemove.fliphtml5RemarkResize touchmove.fliphtml5RemarkResize",
function(b){b.preventDefault();b.stopPropagation();b.pageY?f=b.pageY:b.originalEvent.touches&&(f=b.originalEvent.touches[0].pageY);f&&(h=n(c-(e-f)/d.scale()),q!==h&&20<h&&(m.height=h+"px",q=h,g.trigger("sizeChange",[0,h])))})});return this},parseRemark:function(c,d){var g,h=this,k;d.find(".flipHtml5Store").remove();h.removeSizeWrap();this.sizeWrapStyle&&(this.sizeWrapStyle.display="none",b(this.sizeWrap).remove());h.newSizeWrap();h.contextArray=h.contextArray?h.contextArray.add(d):d;try{window.localStorage?
g=window.localStorage.getItem(window.location.href.replace(window.location.hash,"")+"flipHtml5Remark"+c)||"":(k=RegExp("(?:(?:^|.*;\\s*)"+window.location.href.replace(window.location.hash,"")+"flipHtml5Remark"+c+"\\s*\\=\\s*([^;]*).*$)|^.*$"),g=(document.cookie||"").replace(k,"$1")),d.append(g.replace(/#@&/g,";")),d.find(".flipHtml5Remark").each(function(){h.reBindEvent(b(this),!0)}),d.find(".flipHtml5Highlight").each(function(){h.reBindEvent(b(this),!1)}),d.on("mousedown.fliphtml5remarkHide touchstart.fliphtml5remarkHide",
function(){h.save();h.removeSizeWrap();h.currentEditor.blur();h.currentEditor.off("mousedown.flipHtml5Annotation touchstart.flipHtml5Annotation")})}catch(l){}},getPageContent:function(c){var d=0,g,h="";for(c=c.find(".flipHtml5Store");g=c[d];)if(d++,""!==g.innerHTML&&""!==b(g).text()||""!==g.style.backgroundColor&&"transparent"!==g.style.backgroundColor&&0!==parseFloat(g.style.backgroundColor.split(",")[3]))h+=g.outerHTML;return h.replace(/\s*\n\s*/g,"").replace(/;/g,"#@&")},storageByIndex:function(b,
c){var d,h=this.getPageContent(c);try{window.localStorage?(window.localStorage.removeItem(window.location.href.replace(window.location.hash,"")+"flipHtml5Remark"+b),h&&window.localStorage.setItem(window.location.href.replace(window.location.hash,"")+"flipHtml5Remark"+b,h)):(h?(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+"="+h+";expires="+d.toUTCString()+";")}catch(k){throw k;
}return h},save:function(){var b,c=d.getCurrentPages();for(b=0;b<c.length;b++)this.noteImgContainers[d.getBookType()][c[b]]&&this.storageByIndex(c[b],this.noteImgContainers[d.getBookType()][c[b]])},restoreRemark:function(b,c,g){this.noteImgContainers[b]||(this.noteImgContainers[b]={});this.noteImgContainers[b][c]=g;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,h=this.contextArray;for(this.unbindCreateEvents();d=h.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'></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 e=$("<div style='position: relative;width: 100%;height: 94px;'></div>").appendTo(this.bookMarkBottom);this.bookMarkText=$("<input type='text' class='flipHTML5BookMark-saveText'/>").appendTo(e);var f=this.colorPicker(e);f.container.css({top:11,left:453});this.selectColor=f.message.css({width:24,height:24});this.addLeftMark=$("<div class='flipHTML5BookMark-addLeftMark'></div>").css({width:100,left:18}).html("Add To Page").appendTo(e);this.addRightMark=$("<div class='flipHTML5BookMark-addRightMark'></div>").css({width:100,
left:"auto",right:18}).html("Add To Page").appendTo(e);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 e=$("<div class='flipHTML5BookMark-row-th'></div>"),f=$("<span class='flipHTML5BookMark-cellLeft-th'></span>").html("Page"),g=$("<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"));
e.append(f).append(g);this.bookMarkList.append(e);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 h,k;d.on("mousedown touchstart",
function(e){e=isTouch?e.originalEvent.touches[0]:e;h=e.clientX-c.bookMark.position().left;k=e.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-h,top:b.clientY-k})});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")});
e.preventDefault();e.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(e){}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(),e=b.selectColor.attr("data-color"),d=BookInfo.isRightToLeft()?Math.max.apply(Math,d):Math.min.apply(Math,
d),c={page:d,color:e,text:c,isCookie:1,key:(new Date).getTime()};b.addBookMarkList(c);b.downJSonArrByKey(b.lists,"page");$(".flipHTML5BookMark-table-row").detach();for(e=0;e<b.lists.length;e++)b.lists[e].rowObj.css({backgroundColor:0==e%2?"":"#bababa"}),b.lists[e].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(),e=b.selectColor.attr("data-color"),d=BookInfo.isRightToLeft()?Math.min.apply(Math,d):Math.max.apply(Math,d),c={page:d,color:e,text:c,isCookie:1,key:(new Date).getTime()};b.addBookMarkList(c);b.downJSonArrByKey(b.lists,"page");$(".flipHTML5BookMark-table-row").detach();
for(e=0;e<b.lists.length;e++)b.lists[e].rowObj.css({backgroundColor:0==e%2?"":"#bababa"}),b.lists[e].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,e=b.text,
f=b.color,g=$("<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(g);var h=$("<span class='flipHTML5BookMark-table-cellRight' style=' position: absolute;width: 410px;height: 100%;left: 54px;'></span>").appendTo(g),
k=$("<div style='position: absolute;left: 0px;top: 0px;height: 100%;width: 100%;'></div>").appendTo(h),l=$("<div style='position: absolute;left: 0px;top: 0px;height: 100%;'></div>").css({width:1===b.isCookie?"309px":"100%"}).appendTo(k),n=$("<input class='flipHTML5BookMark-table-cellRight-text' disabled='true'/>").css({width:1===b.isCookie?"283px":"100%"}).attr("disabled",d).val(b.text).appendTo(l),q,m;1===b.isCookie&&(k=this.colorPicker(l),q=k.message,m=k.container,q.css({width:20,height:20,backgroundColor:b.color}).attr("data-color",
b.color),m.css({top:2,left:284}).hide());var r=$("<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(h),s=$("<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(h).hide(),
h=$("<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(h);n.attr("title",n.val());s.on("click touchend",function(b){d=!0;l.css({backgroundColor:"transparent"});n.css({backgroundColor:"transparent",color:"#1a1a1a"});n.attr("disabled",d);r.attr("title","Edit").css({right:64});r.children("img").attr("src",c.address+
"note_edit.png");m&&m.hide();n.val(e);q.attr("data-color",f).css({backgroundColor:f});s.hide();b.preventDefault();b.stopPropagation();return!1});g.on("click touchend",function(b){d&&gotoPageFun($(this).attr("data-page"))});h.on("click touchend",function(b){g.remove();var d=g.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});r.on("click touchend",function(b){if(d)d=!1,l.css({backgroundColor:"#ffffff"}),n.css({backgroundColor:"#ffffff",color:"#000000"}),r.children("img").attr("src",
c.address+"note_save.png"),n.attr("disabled",d),r.attr("title","Save").css({right:77}),n[0].focus(),s.show(),m&&m.show();else if(n.val()){d=!0;l.css({backgroundColor:"transparent"});n.css({backgroundColor:"transparent",color:"#1a1a1a"});n.attr("disabled",d);r.attr("title","Edit").css({right:64});r.children("img").attr("src",c.address+"note_edit.png");s.hide();var h=g.attr("data-key"),k=n.val();e=k;var A=q.attr("data-color");f=A;n.attr("title",n.val());c.updateArrayByKeyValue(c.cookieBookMark,"key",
h,{text:k,color:A});c.updateArrayByKeyValue(c.totalBookMark,"key",h,{text:k,color:A});c.addLocalStorage(c.bookMarkName,c.parseToString(c.cookieBookMark));m&&m.hide();c.updateBookMarkConfig()}else alert("Can not leave the text box blank!"),n.val(e);b.preventDefault();b.stopPropagation();return!1});this.scrollBarShowHide();1===b.isCookie?this.cookieLists.push($.extend({},b,{rowObj:g})):this.serverLists.push($.extend({},b,{rowObj:g}));this.lists.push($.extend({},b,{rowObj:g}));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],e=d.value,f=BookInfo.getCurrentPages(),g=BookInfo.getPageCount();this.hasTextValue=e?!0:!1;0<=f.indexOf(0)?this.contains(this.addedPages,Math.max.apply(Math,f))?(b.add(c).removeClass("flipHTML5BookMark-normal flipHTML5BookMark-hover").css(this.disableCss),this.addRightBtnFalg=this.addLeftBtnFalg=!1,d.readOnly=!0,b.add(c).hide()):
(e?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,f)),c.hide().html("Add to page "+Math.min.apply(Math,f))):(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,f)),c.show().html("Add to page "+Math.max.apply(Math,f))):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,f)),c.hide().html("Add to page "+Math.min.apply(Math,f))):(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,f)),c.show().html("Add to page "+Math.max.apply(Math,f))),d.readOnly=!1,d.focus()):0<=f.indexOf(g)&&Math.min.apply(Math,f)==g?this.contains(this.addedPages,g)?(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,f)),c.hide().html("Add to page "+Math.max.apply(Math,
f))):(e?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,f)),c.show().html("Add to page "+Math.min.apply(Math,f))):(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,f)),c.hide().html("Add to page "+Math.max.apply(Math,f))):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,f)),c.show().html("Add to page "+Math.min.apply(Math,f))):(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,f)),c.hide().html("Add to page "+Math.max.apply(Math,f))),d.readOnly=!1,d.focus()):Math.min.apply(Math,f)>g?(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,f)),c.hide().html("Add to page "+Math.max.apply(Math,f))):this.contains(this.addedPages,Math.min.apply(Math,
f))||this.contains(this.addedPages,Math.max.apply(Math,f))?!this.contains(this.addedPages,Math.min.apply(Math,f))&&this.contains(this.addedPages,Math.max.apply(Math,f))?(e?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,f)),c.show().html("Add to page "+Math.min.apply(Math,f))):
(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,f)),c.hide().html("Add to page "+Math.max.apply(Math,f))):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,
f)),c.show().html("Add to page "+Math.min.apply(Math,f))):(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,f)),c.hide().html("Add to page "+Math.max.apply(Math,f))),d.readOnly=!1,d.focus()):this.contains(this.addedPages,Math.min.apply(Math,f))&&!this.contains(this.addedPages,Math.max.apply(Math,f))?(e?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,f)),c.hide().html("Add to page "+Math.min.apply(Math,f))):(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,f)),c.show().html("Add to page "+Math.max.apply(Math,
f))):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,f)),c.hide().html("Add to page "+Math.min.apply(Math,f))):(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,f)),c.show().html("Add to page "+
Math.max.apply(Math,f))),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,f)),c.hide().html("Add to page "+Math.max.apply(Math,f))):(e?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,f)),c.show().html("Add to page "+Math.min.apply(Math,f))):(b.show().html("Add to page "+Math.min.apply(Math,f)),c.show().html("Add to page "+Math.max.apply(Math,f))),d.readOnly=!1,d.focus())},colorPicker:function(b){var c,d,e,f="#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(" "),
g=document.createElement("table");c=document.createElement("a");var h=$(c),k=document.createElement("input"),l=function(){var b=this.title.toUpperCase();k.style.backgroundColor=b;$(k).attr("data-color",b)},n=function(){g.style.display="none"};h.appendTo(b);c.className="flipHtml5ColorSelectorWrap-bookMark";g.setAttribute("border","1");c.style.position="absolute";c.href="javascript:void(0);";k.type="text";k.className="flipHtml5ColorSelectorMessage-bookMark";b=this.getRandomColor();k.style.backgroundColor=
b;$(k).attr("data-color",b);k.style.cursor="pointer";k.style.borderWidth="2px";k.style.padding="0px";c.appendChild(k);this.$container[0].appendChild(g);g.style.display="none";g.style.position="absolute";g.style.zIndex=9999;g.style.width="204px";g.style.backgroundColor="#ffffff";for(d=0;7>d;d++){e=document.createElement("tr");e.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=f[10*d+b],c.style.backgroundColor=f[10*d+b],$(c).on("mouseenter",l),$(c).on("click touchstart",n),e.appendChild(c);g.appendChild(e)}$(k).on("click touchstart",function(b){$(g).css({left:$(k).offset().left,top:$(k).offset().top+$(k).outerHeight()});g.style.display="table-cell";b.stopPropagation();b.stopPropagation();return!1});$(document).on("click touchstart",function(){g.style.display="none"});return{container:h,message:$(k)}},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,e){return parseInt(b[c])>parseInt(e[c])?1:parseInt(b[c])==parseInt(e[c])?0:-1})},delArrayByKeyAndValue:function(b,
c,d){if(b)for(var e=0;e<b.length;e++)b[e][c]&&b[e][c]==d&&b.remove(e)},updateArrayByKeyValue:function(b,c,d,e){if(b)for(var f=0;f<b.length;f++)b[f][c]&&b[f][c]==d&&$.extend(b[f],e)},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 e=c[d].split("=");if(e[0]==b)return unescape(e[1])}return""}catch(f){}},addLocalStorage:function(b,c){try{if(window.localStorage)window.localStorage.setItem(b,c);else{var d=
b+"="+escape(c),e=new Date;e.setTime(e.getTime()+864E8);d+="; expires="+e.toGMTString();document.cookie=d}}catch(f){}},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,e){var f=this;c.on(_event._down,function(b){var h=b||event,k=h.clientY-f.outerScroll.position().top,l=b.which;b.stopPropagation();1==l&&($(document).on("mousemove.scrollBar touchmove.scrollBar",function(b){b.preventDefault();b.stopPropagation();h=b||event;b=h.clientY-k;0>=b?b=0:b>=f.scrollBar.outerHeight()-f.outerScroll.outerHeight()&&(b=f.scrollBar.outerHeight()-f.outerScroll.outerHeight());c.css({top:b});e.css({top:-b/(f.scrollBar.outerHeight()-f.outerScroll.outerHeight())*
(e.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(f){if(!(d.outerHeight()>=e.outerHeight())){var h=f.originalEvent,h=h.wheelDelta||-h.detail,k=e.position().top,l;e.stop(!1,!1);0<h?l=0>k+d.outerHeight()/11?k+d.outerHeight()/
11:0:0>h&&(l=e.outerHeight()-d.outerHeight()>-(k-d.outerHeight()/11)?k-d.outerHeight()/11:-(e.outerHeight()-d.outerHeight()));e.css({top:l});c.css({top:-l/(e.outerHeight()-d.outerHeight())*(b.outerHeight()-c.outerHeight())});f.stopPropagation();f.preventDefault();return!1}})}});
function grayBackground(b,c,d,e,f){this.sw=e;this.sh=f;this.background=$("<div ></div>");this.background.css({width:e+"px",height:f+"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 e=Point(d.width(),d.height());d.remove();return e};
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("16px","#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":"10px","-moz-border-radius":"10px","-o-border-radius":"10px","border-radius":"10px","-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":"#554433",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.9},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,c,d){this.backgroun=$("<div></div>");this.width=b;this.height=c;$(this.backgroun).css({position:"absolute",width:this.width+"px",height:this.height+"px","-webkit-box-shadow":"0 0 15px rgba(40, 40, 40, 0.7)","-moz-box-shadow":"0 0 15px rgba(40, 40, 40, 0.7)","-o-box-shadow":"0 0 15px rgba(40, 40, 40, 0.7)","-ms-box-shadow":"0 0 15px rgba(40, 40, 40, 0.7)","box-shadow":"0 0 15px rgba(40, 40, 40, 0.7)"});$(d).append(this.backgroun)}bdor[26]="h";
bookShadow.prototype.onResize=function(b,c,d){this.width=d?2*b:b;this.height=c;$(this.backgroun).css({width:this.width+"px",height:this.height+"px"})};bookShadow.prototype.setPosition=function(b,c){$(this.backgroun).css({top:c+"px",left:b+"px"})};
bookShadow.prototype.showShadow=function(){$(this.backgroun).css({"-webkit-box-shadow":"0 0 15px rgba(40, 40, 40, 0.7)","-moz-box-shadow":"0 0 15px rgba(40, 40, 40, 0.7)","-o-box-shadow":"0 0 15px rgba(40, 40, 40, 0.7)","-ms-box-shadow":"0 0 15px rgba(40, 40, 40, 0.7)","box-shadow":"0 0 15px rgba(40, 40, 40, 0.7)"})};
bookShadow.prototype.hideShadow=function(){$(this.backgroun).css({"-webkit-box-shadow":"0 0 15px rgba(40, 40, 40, 0)","-moz-box-shadow":"0 0 15px rgba(40, 40, 40, 0.7)","-o-box-shadow":"0 0 15px rgba(40, 40, 40, 0.7)","-ms-box-shadow":"0 0 15px rgba(40, 40, 40, 0.7)","box-shadow":"0 0 15px rgba(40, 40, 40, 0.7)"})};
function bookMarkTab(b,c,d,e){this.fnShow=c;this.fnHide=d;this.maxWidth=e?e: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%","-webkit-transform":b,"-moz-transform":b,"-ms-transform":b,"-o-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,e=0;e<this.tabArray.length;e++)c+=this.tabArray[e].getWidth(),this.bg.append(this.tabArray[e]);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(e=0;e<this.tabArray.length;e++)this.tabArray[e].setPosition(d,30,b),d+=this.tabArray[e].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 e=c[b],f=d[b];return e<f?-1:e>f?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:280,height:35,backColor:d,fontColor:bookConfig.bookmarkFontColor,level:0,padding:10},b);var e=this;this.background=$('<div style="position:relative; overflow : hidden;"></div>');this.contentBox=$('<div style="position:absolute;"></div>');this.textField=new label(this.config.caption.HTMLLabel2Text(),this.contentBox);this.expandButton=new button(this.contentBox,{buttonType:1,iconURL:uiBaseURL+"closed.png"});this.expandButton.setIconPosition(5,
10);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.setButtonPosition(-10,0);this.textField.setLabelPosition(13,10);b=this.config.width-2*this.config.padding;$(this.contentBox).css({width:b+"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:b+"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});$(this.contentBox).bind(_event._end,function(b){(global.phoneBookmark&&!global.phoneBookmark.isDrag||!global.phoneBookmark&&!isBookmarkDrag)&&gotoPageFun(e.config.page)});$(this.contentBox).bind(_event._down,function(b){isTouch||(b=colorAdd(e.config.backColor,50),$(e.background).css({"background-color":b}),$(e.contentBox).css({color:"#8c97cb"}),
$(e.contentBox).css({"text-shadow":"0 0 30px #8c97cb, 0 0 70px #8c97cb"}))});$(this.background).bind(_event._enter,function(b){isTouch||(b=colorAdd(e.config.backColor,50),$(e.background).css({"background-color":b}),$(e.contentBox).css({color:"#8c97cb"}),$(e.contentBox).css({"text-shadow":"0 0 30px #8c97cb, 0 0 70px #8c97cb"}))});$(this.background).bind(_event._end,function(b){isTouch||($(e.background).css({"background-color":e.downBackColor}),$(e.contentBox).css({color:e.fontColor}),$(e.contentBox).css({"text-shadow":e.textShadow}))});
$(this.background).bind(_event._leave,function(b){isTouch||($(e.background).css({"background-color":e.downBackColor}),$(e.contentBox).css({color:e.fontColor}),$(e.contentBox).css({"text-shadow":e.textShadow}))})}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=[];$(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();var 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 e=0;e<b.length;e++){var f=new treeNode(b[e],this.scrollBox,this.contentColor);this.itemArr.push(f);c||0!=e||f.setBorderTop();c&&(d.addChildren(f),f.setVisible(!1));1<=b[e].children.length?(f.setButtonVisible(!0),f.setHasChildren(!0),this.addContent(b[e].children,!0,f)):(f.setButtonVisible(!0),f.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("miBookmark").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("miBookmark").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(){ScrollFunction(this.scrollMask,this.scrollBox,this)}}).extend(tableContent);
bdor.l=bdor.i(10);
var thickness=Class({create:function(b){this.thicknessObj=$("<div></div>");this.isLeft=b;this.visible=!0;this.hint=null;this.initTickness();this.thicknessObj.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.offsetX;void 0==c&&(c=d.pageX-this.thicknessObj.offset().left);c=this.pageIndexByPosition(c,b);if(-1!=c){c=" "+getShownPageNumber(c)+" ";var e=d.pageX;d=d.pageY-30;null==this.hint&&(this.hint=new divHint(c,e,d));
this.hint.setText(c);this.hint.show(e,d);this.hint.moveto(e,d)}else null!=this.hint&&this.hint.hide()}.bind(this));this.thicknessObj.bind(_event._leave,function(){null!=this.hint&&this.hint.hide()}.bind(this));this.thicknessObj.bind(_event._end,function(c){var d;isTouchDevice()?(d=c.originalEvent.touches[0],void 0==d&&(d=c.touches[0])):d=c;$(d.target);c=d.offsetX;void 0==c&&(c=d.pageX-this.thicknessObj.offset().left);d=this.pageIndexByPosition(c,b);c=BookInfo.getBook().currentPageIndex;bookType==
BookType.single_book&&(c=singlePageBook.currentPageIndex);var e=c+1;bookType==BookType.single_book&&(e=-1);-1!=d&&d!=c&&d!=e&&gotoPageFun(d)}.bind(this))},initTickness:function(){this.topPart=$("<div style='position:relative;height:50px;width:100%;overflow:hidden;'></div>");this.centerPart=$("<div style='position:relative;height:auto;width:100%;overflow:hidden;'></div>");this.bottomPart=$("<div style='position:relative;height:50px;width:100%;overflow:hidden;'></div>");this.isLeft?(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;' />")):(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;' />"));this.thicknessObj.append(this.topPart);this.thicknessObj.append(this.centerPart);this.thicknessObj.append(this.bottomPart)},onResize:function(b,c){this.thicknessObj.css({width:b,height:c});this.centerPart.css({height:Math.max(0,c-100)});this.centerPart.find("img").css({height:c})},setThicknessPosition:function(b,c){this.thicknessObj.css({left:b,top:c,position:"absolute","z-index":this.isLeft?
8:9})},hideThickness:function(){this.thicknessObj.css("display","none")},showThickness:function(){this.thicknessObj.css("display","block")},setVisible:function(b){this.thicknessObj.css({display:b?"block":"none"});this.visible=b},getContainer:function(){return this.thicknessObj},pageIndexByPosition:function(b,c){this.isLeft=c;var d=bookType===BookType.catalog_book?1:0.4,e=this.thicknessObj.width(),f=e*d;if(0<b&&b<=f&&!1==c||0<e-b&&e-b<=f&&!0==c){var g=bookConfig.totalPageCount,d=BookInfo.getBook().currentPageIndex;
bookType==BookType.single_book&&(d=singlePageBook.currentPageIndex);var h=d-1;!0==rightToLeft?(!0==c&&(h=g-d-1),!1==c?(e=Math.floor(h*(1-b/f)),e++):(e=Math.floor(h*(1-(b-(e-f))/f)),e+=d+1)):(!1==c&&(h=g-d-1),!1==c?(e=Math.floor(h*b/f),e+=d+1):(e=Math.floor(h*(b-(e-f))/f),e++));return e}return-1}}),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),e=Math.min(0.7*c,310);this.width=d;this.height=
e;this.flipShotObj.css({width:d,height:e})},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 e=b[d];c.push({type:e.type,id:e.id,src:e.thumbnail,des:this.encodeHTML(e.description),title:this.encodeHTML(e.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),e=$("<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){e.hide();b.preventDefault();b.stopPropagation();return!1},"mouseout touchend":function(b){e.hide();b.preventDefault();b.stopPropagation();return!1},"mousemove touchmove":function(b){e.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;e.css({left:(b.pageX||b.originalEvent.touches[0].pageX)-17,top:d+28>c.videoBG.height()-15?d-28:d+28}).show()}catch(h){Log.error(h)}},"mouseout touchend":function(b){e.hide()},"mousemove touchmove":function(b){try{var d=b.pageY||b.originalEvent.touches[0].pageY;e.css({left:(b.pageX||b.originalEvent.touches[0].pageX)-17,top:d+28>c.videoBG.height()-15?d-28:d+28})}catch(h){Log.error(h)}},"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,e=72*d+6*(d-1),e=0<e?e:0;this.videoListDiv.css({height:370<e?370:e});b=$("<div class='flipHTML5VideoGallery-videoListTable' style='position: absolute;width: 100%;height: 100%;left: 0px;top: 0px;overflow: hidden;'></div>").appendTo(b);e=$("<div class='flipHTML5VideoGallery-videoList' style='position: absolute;left: 0px;top: 0px;'></div>").css({width:313,height:e}).appendTo(b);this.table=b;this.list=
e;this.createScrollBar(b,b,e);for(var f=0;f<d;f++)this.createEachList(e,f,c[f]);this.scrollBarShowHide(b,e)},createEachList:function(b,c,d){var e=this;(function(c){var g=$("<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),h=$("<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(g),k=$("<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(g),l=e.videoData[c];l.src&&l.des&&l.title?(e.setDataFalg[c]=!0,g.on("click touchend",function(){e.setVideoID(l)}),k.children("span").html(l.des).attr("title",l.des),e.loadImg(l.src,h.children("img"),68,68)):e.getVideoData(d.type,
d.id,function(b){e.setDataFalg[c]=!0;g.on("click touchend",function(){e.setVideoID({type:b.type,id:b.id,src:l.src||b.src,des:l.des||b.des,title:l.title||b.title})});k.children("span").html(l.des||b.des).attr("title",l.des||b.des);e.loadImg(l.src||b.src,h.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 e=b.videoData[c],f=b.videoData[c];e.src&&e.des&&e.title?(b.setDataFalg[c]=!0,b.list.find("#flipHTML5VideoGallery-eachVideo"+
c).on("click touchend",function(){b.setVideoID(e)}),b.list.find("#flipHTML5VideoGallery-eachDes"+c).html(e.des).attr("title",e.des),b.loadImg(e.src,b.list.find("#flipHTML5VideoGallery-eachImg"+c),68,68)):b.getVideoData(f.type,f.id,function(f){b.setDataFalg[c]=!0;b.list.find("#flipHTML5VideoGallery-eachVideo"+c).on("click touchend",function(){b.setVideoID({type:f.type,id:f.id,src:e.src||f.src,des:e.des||f.des,title:e.title||f.title})});b.list.find("#flipHTML5VideoGallery-eachDes"+c).html(e.des||f.des).attr("title",
e.des||f.des);b.loadImg(e.src||f.src,b.list.find("#flipHTML5VideoGallery-eachImg"+c),68,68)})}})(c)},loadImg:function(b,c,d,e){var f=new Image;f.onload=function(){f.onload=f.onerror=null;c.parent().removeClass("flipHTML5Loading");var b=this.width/this.height,h=e*b,k=d/b;h>e?c.css({width:e,height:k,top:(e-k)/2,left:0}):k>e?c.css({width:h,height:e,left:(e-h)/2,top:0}):h/k==b&&c.css({width:h,height:k,left:0,top:0})};f.onerror=function(){f.onload=f.onerror=null;c.parent().removeClass("flipHTML5Loading");
c.css({width:18,height:20,left:(d-18)/2,top:(e-20)/2})};c[0].src=b;f.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 e=$("<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(e);this.scrollBar=b;this.outerScroll=e;this.bindScrollBarEvents(b,
e,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,e){var f=this;c.on(_event._down,function(b){var h=b||event,k=h.clientY-f.outerScroll.position().top,l=b.which;b.stopPropagation();1==l&&($(document).add(f.outerScroll).add(f.videoGallery).on("mousemove.scrollBar touchmove.scrollBar",function(b){b.preventDefault();b.stopPropagation();h=b||event;b=h.clientY-k;0>=b?b=0:b>=f.scrollBar.outerHeight()-f.outerScroll.outerHeight()&&(b=f.scrollBar.outerHeight()-f.outerScroll.outerHeight());
c.css({top:b});e.css({top:-b/(f.scrollBar.outerHeight()-f.outerScroll.outerHeight())*(e.outerHeight()-d.outerHeight())})}),$(document).add(f.outerScroll).add(f.videoGallery).on("mouseup.scrollBar touchend.scrollBar",function(b){b=b||event;b.preventDefault();b.stopPropagation();$(document).add(f.outerScroll).add(f.videoGallery).off("mousemove.scrollBar touchmove.scrollBar");$(document).add(f.outerScroll).add(f.videoGallery).off("mouseup.scrollBar touchend.scrollBar")}))});d.bind($.browser.mozilla?
"DOMMouseScroll":"mousewheel",function(f){if(!(d.outerHeight()>=e.outerHeight())){var h=f.originalEvent,h=h.wheelDelta||-h.detail,k=e.position().top,l;e.stop(!1,!1);0<h?l=0>k+d.outerHeight()/11?k+d.outerHeight()/11:0:0>h&&(l=e.outerHeight()-d.outerHeight()>-(k-d.outerHeight()/11)?k-d.outerHeight()/11:-(e.outerHeight()-d.outerHeight()));e.css({top:l});c.css({top:-l/(e.outerHeight()-d.outerHeight())*(b.outerHeight()-c.outerHeight())});f.stopPropagation();f.preventDefault();return!1}});f.list.on("mousedown.pad touchstart.pad",
function(b){var c=parseInt(f.list.css("top")),d=f.table.height(),e=f.list.outerHeight(),n=b.pageY||b.originalEvent.touches[0].pageY;f.table.on("mousemove.pad touchmove.pad",function(b){b=c+((b.pageY||b.originalEvent.touches[0].pageY)-n);b=0<b?0:b<d-e?d-e:b;f.list.css({top:b})});f.table.on("mouseup.pad touchend.pad",function(b){f.table.off("mousemove.pad touchmove.pad");f.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 e=b[d];c.push({src:e,thumbSrc:e,title:this.getFileNameByFilePath(e)})}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 touchend",function(){c.prev(1)});this.nextBtn.on("click touchend",function(){c.next(1)});this.outPhotoGallery.on({"mouseover touchstart":function(b){c.closeTitle.hide();b.preventDefault();b.stopPropagation();try{var e=$(this).position().left,f=(b.pageX||b.originalEvent.touches[0].pageX)-e,g=$(this).outerWidth()/2;f<=g?(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(h){Log.error(h)}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 e=$(this).position().left,f=(b.pageX||b.originalEvent.touches[0].pageX)-e,g=$(this).outerWidth()/2;f<=g?(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(h){Log.error(h)}return!1},"click touchstart":function(b){b.preventDefault();b.stopPropagation();
try{var e=c.outPhotoGallery.position().left,f=(b.pageX||b.originalEvent.touches[0].pageX)-e,g=c.outPhotoGallery.outerWidth()/2;f<=g?c.prev(1):c.next(1)}catch(h){Log.error(h)}return!1}});this.photoBG.add(this.mimCloseBtn).on({"mouseover touchstart":function(b){try{c.closeTitle.show();var e=b.pageY||b.originalEvent.touches[0].pageY;c.closeTitle.css({left:(b.pageX||b.originalEvent.touches[0].pageX)-17,top:e+28>c.photoBG.height()-15?e-28:e+28}).show()}catch(f){Log.error(f)}},"mouseout touchend":function(b){c.closeTitle.hide()},
"mousemove touchmove":function(b){try{var e=b.pageY||b.originalEvent.touches[0].pageY;c.closeTitle.css({left:(b.pageX||b.originalEvent.touches[0].pageX)-17,top:e+28>c.photoBG.height()-15?e-28:e+28})}catch(f){Log.error(f)}},"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(),e=c.photoBG.height()-64,f=c.originals[c.currentIndex],g=c.resizeImgSize(b,e,f.width,f.height),f=g.width,g=g.height;c.photoImg.css({left:0,top:0,width:f,height:g});c.outPhotoGallery.css({left:(b-f-16)/2,top:(e-g-16)/2,width:f,height:g})}}},loadImg:function(b){var c=this,d=c.photoBG.width(),e=c.photoBG.height()-64,f=new Image;f.onload=function(){f.onload=f.onerror=null;var b=this.width,h=this.height,
k=c.resizeImgSize(d,e,b,h);c.originals[c.currentIndex]={width:b,height:h};c.photoImg.attr({originalWidth:b,originalHeight:h});b=k.width;h=k.height;c.photoImg.css({left:0,top:0,width:b,height:h});c.outPhotoGallery.stop(!1,!1).animate({left:(d-b-16)/2,top:(e-h-16)/2,width:b,height:h},{duration:240,easing:"linear",complete:function(){c.photoGallery.removeClass("flipHTML5Loading");c.photoImg.fadeIn(500)}})};f.onerror=function(){f.onload=f.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)};f.src=b;c.photoImg.attr("src",b)},resizeImgSize:function(b,c,d,e){var f=d/e;d+16>=b&&e+16>=c?f>=b/c?(d=b-16,e=d/f):(e=c-16,d=e*f):d+16>=b&&e+16<c?(d=b-16,e=d/f):d+16<b&&e+16>=c&&(e=c-16,d=e*f);return{width:d,height:e}},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,e=d.length,f=0<e?54*e+4*(e-1):0;b=$("<div class='flipHTML5PhotoGallery-thumb'></div>").appendTo(b);var g=$("<div class='flipHTML5PhotoGallery-thumbView'></div>").appendTo(b),
h=$("<div class='flipHTML5PhotoGallery-thumbList'></div>").css({width:f}).appendTo(g),k=$("<span class='flipHTML5PhotoGallery-thumbTitle'></span>").appendTo(b).hide();h.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=g;this.thumbList=h;this.reviseThumb();this.mouseThumb();for(var l=0;l<e;l++)(function(b){var e=58*b,f=$("<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:e}).appendTo(h),g=$("<img style='position: absolute;'/>").css({opacity:0}).appendTo(f),s=$("<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(f),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?g.css({width:50,
height:d,top:(54-d)/2,left:0}):54<d?g.css({width:c,height:54,left:(50-c)/2,top:0}):c/d==b&&g.css({width:c,height:d,left:0,top:0});g.css({opacity:1});f.removeClass("flipHTML5Loading")};t.onerror=function(){t.onload=t.onerror=null;g.css({left:16,top:17}).css({opacity:1});f.removeClass("flipHTML5Loading")};g[0].src=d[l].thumbSrc;t.src=d[l].thumbSrc;f.on({"click touchend":function(){c.currentIndex!==b&&c.skipTo(b)},"mouseover touchstart":function(d){try{c.currentIndex!==b&&(f.css({borderColor:"#1ECC21"}),
s.css({opacity:0}))}catch(e){Log.error(e)}},"mousemove touchmove":function(b){},"mouseout touchend":function(){k.hide();c.currentIndex!==b&&(f.css({borderColor:"#ffffff"}),s.css({opacity:0.5}))}})})(l)},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 e=b.thumbView.width(),f=b.thumbList.width(),g=f-e,h=b.thumbView.offset().left,k=(d.pageX||d.originalEvent.touches[0].pageX)-h-24;f>e&&(d=(0>=k?0:k>e-24?e-48:k)/(e-48)*g,b.thumbList.animate({left:-(0>
d?0:d>g?g:d)},{duration:400,easing:"linear",complete:function(){c=!0}}))}catch(l){Log.error(l)}},"mousemove touchmove":function(d){if(c)try{var e=b.thumbView.width(),f=b.thumbList.width(),g=f-e,h=b.thumbView.offset().left,k=(d.pageX||d.originalEvent.touches[0].pageX)-h-24;f>e&&(d=(0>=k?0:k>e-24?e-48:k)/(e-48)*g,d=0>d?0:d>g?g:d,b.thumbList.stop(!0,!0).animate({left:-d},{duration:400,easing:"linear"}))}catch(l){Log.error(l)}},"mouseleave touchend":function(b){c=!1}})},moveThumb:function(b){var c=this.thumbView.width(),
d=this.thumbList.outerWidth(),e=d-c,f=this.thumbList.position().left;b=this.thumbList.find("#flipHTML5PhotoThumb"+b).position().left;var g=b+f,h=(c-54)/2;d>c?(g=Math.abs(b)-Math.abs(f),c=g-h+Math.abs(f),c=c>=e?e: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 e=$("<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)))});e.on("click",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 e=$("<div></div>").addClass("flipHTML5Point flipHTML5ZoomPoint"+d).appendTo(b);c.push(e)}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 e=c[b];this.fileCookies.push({key:e.key,page:e.page,fileLeft:e.fL,fileTop:e.fT,fileWidth:e.fW,fileHeight:e.fH,imgWidth:e.iW,imgHeight:e.iH,
src:e.src});this.imageDatas[e.key]={width:e.iW,height:e.iH}}},addFile:function(b,c){var d=b.src,e=b.imgWidth,f=b.imgHeight,g=b.key,h=$("<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",g).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(h,
c);e&&f&&d&&this.addImage(h,d,e,f,g)},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(e){e.stopPropagation();e.preventDefault();var f=(new Date).getTime(),g,h,k,l,n,q,m,r,s,t=b.offset().left,u=b.offset().top;$(".flipHTML5LocalFile-current").removeClass("flipHTML5LocalFile-current");g=$("<div style='position: absolute;cursor: move;'></div>").attr("data-key",f).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);
h=l=e.pageX||e.originalEvent.touches[0].pageX;k=n=e.pageY||e.originalEvent.touches[0].pageY;d.bindFileDivEvents(g,b);$(document).add(b).off("mousemove.addLocalFile touchmove.addLocalFile").on("mousemove.addLocalFile touchmove.addLocalFile",function(b){l=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;l&&(0>l-h?(q=Math.floor((l-t)/BookInfo.scale()),r=Math.floor((h-l)/BookInfo.scale())):(q=Math.floor((h-
t)/BookInfo.scale()),r=Math.floor((l-h)/BookInfo.scale())));n&&(0>b.pageY-k?(m=Math.floor((n-u)/BookInfo.scale()),s=Math.floor((k-n)/BookInfo.scale())):(m=Math.floor((k-u)/BookInfo.scale()),s=Math.floor((n-k)/BookInfo.scale())));g.css({left:q,top:m,width:r,height:s});d.resizeZoomFrame(g)});$(document).add(b).off("mouseup.addLocalFile touchend.addLocalFile").one("mouseup.addLocalFile touchend.addLocalFile",function(e){d.offCreateEvents();$(document).add(b).off("mousemove.addLocalFile touchmove.addLocalFile");
$(document).add(b).off("mouseup.addLocalFile touchend.addLocalFile");if(g){e=g.width();var h=g.height();32>e&&g.width(32);12>h&&g.height(12);g.find(".TextFile")[0].click();d.resizeZoomFrame(g);e=d.parseObject(g[0]);d.parseObject(d.zoomFrame[0]);d.fileCookies.push({key:f,page:c,fileLeft:e.left,fileTop:e.top,fileWidth:e.width,fileHeight:e.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,e,f){b.find(".LocalImage")&&b.find(".LocalImage").remove();var g=b.width()||40,h=b.height()||40;d=this.resizeImage("autoFit",d,e,g,h);$("<img class='LocalImage' style='position: absolute;z-index: 2;'/>").attr("data-key",f).css({width:d.width,height:d.height,left:d.left,top:d.top}).attr("src",c).appendTo(b)},resizeImage:function(b,c,d,e,f){c/=d;d=0===f?1:e/f;var g=f*c,h=e/c,k;switch(b){case "autoFit":k=g>e?{width:e,height:h,top:(f-h)/2,left:0}:h>f?{width:g,height:f,left:(e-
g)/2,top:0}:g/h==c?{width:g,height:h,left:0,top:0}:{width:1,height:1,left:0,top:0};break;case "scale":k={left:0,top:0,width:e,height:f};break;case "fullFill":c>d?k={left:(e-f*c)/2,top:0,width:f*c,height:f}:c<d?k={left:0,top:(f-e/c)/2,width:e,height:e/c}:c==d&&(k={left:0,top:0,width:e,height:f})}return k},bindFileDivEvents:function(b,c){var d=this,e=!1,f=b.attr("data-key");b.off("mousedown.addLocalFile touchstart.addLocalFile").on("mousedown.addLocalFile touchstart.addLocalFile",function(g){var h,
k,l,n,q,m;l=b[0].offsetLeft;n=b[0].offsetTop;h=g.pageX;k=g.pageY;d.resizeZoomFrame(b);c.off("mousemove.addLocalFile touchmove.addLocalFile").on("mousemove.addLocalFile touchmove.addLocalFile",function(c){if(3<=Math.abs(c.pageX-h)||3<=Math.abs(c.pageY-k))e=!0;q=l-(h-c.pageX)/BookInfo.scale();m=n-(k-c.pageY)/BookInfo.scale();b.css({left:q,top:m});d.moveFileDiv(q,m)});$(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(){e=!1},200);var g=d.parseObject(b[0]);d.parseObject(d.zoomFrame[0]);d.updateArrayOrderKey(d.fileCookies,f,{fileLeft:g.left,fileTop:g.top});d.addLocalStorage(d.fileName,d.parseJSON(d.fileCookies))});g.preventDefault();g.stopPropagation()});b.find(".TextFile").on({change:function(c){try{var e=c.target.files[0];if(e)if(e.type.match("image.*")){var k=new FileReader;k.onload=function(c){c=c.target.result;var e=new Image;
e.src=c;var g=e.width,e=e.height;d.imageDatas[f]={width:g,height:e,src:c};d.addImage(b,c,g,e,f);d.updateArrayOrderKey(d.fileCookies,f,{imgWidth:g,imgHeight:e,src:c});d.addLocalStorage(d.fileName,d.parseJSON(d.fileCookies))};k.readAsDataURL(e)}else alert("not image!")}catch(l){alert("Does not support HTML5 FileReader!")}},click:function(b){e&&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,e){var f=this.currentObject,g=this.zoomFrame,h=f.attr("data-key");this.toolBar&&this.toolBar&&this.toolBar.css({left:g.offset().left-this.container.offset().left+3,top:g.offset().top-this.container.offset().top-this.toolBar.outerHeight()-2});if(f){b&&(g.css({left:b}),f.css({left:b+4+1}));c&&(g.css({top:c}),f.css({top:c+4+1}));d&&40<=d&&(g.css({width:d}),f.css({width:d-8}));e&&20<=e&&(g.css({height:e}),f.css({height:e-
8}));try{var k=f.find(".LocalImage"),l=this.imageDatas[h],n=this.resizeImage("autoFit",l.width,l.height,f.width(),f.height());k.css({width:n.width,height:n.height,left:n.left,top:n.top})}catch(q){}n=this.parseObject(f[0]);this.parseObject(g[0]);this.updateArrayOrderKey(this.fileCookies,h,{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();
var f=d.parent(),g=d.width(),h=b.pageX;$(document).add(f).on("mousemove.addLocalFile touchmove.addLocalFile",function(b){var d=b.clientX-h+g,d=Math.floor(g-(h-b.pageX)/BookInfo.scale());c.resizeFileDiv(0,0,d,0)});$(document).add(f).on("mouseup.addLocalFile touchend.addLocalFile",function(){c.addLocalStorage(c.fileName,c.parseJSON(c.fileCookies));$(document).add(f).off("mousemove.addLocalFile touchmove.addLocalFile");$(document).add(f).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();var f=d.parent(),g=d.height(),h=b.pageY;$(document).add(f).on("mousemove.addLocalFile touchmove.addLocalFile",function(b){var d=b.clientY-h+g,d=Math.floor(g-(h-b.pageY)/BookInfo.scale());c.resizeFileDiv(0,0,0,d)});$(document).add(f).on("mouseup.addLocalFile touchend.addLocalFile",function(){c.addLocalStorage(c.fileName,c.parseJSON(c.fileCookies));$(document).add(f).off("mousemove.addLocalFile touchmove.addLocalFile");
$(document).add(f).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();var f=d.parent(),g=d.width(),h=d[0].offsetLeft,k=b.clientX;$(document).add(f).on("mousemove.addLocalFile touchmove.addLocalFile",function(b){var d=b.pageX,e=h+d-k,f=-(d-k)+g,e=h+(d-k)/BookInfo.scale(),f=Math.floor(g+(k-b.pageX)/BookInfo.scale());c.resizeFileDiv(e,0,
f,0)});$(document).add(f).on("mouseup.addLocalFile touchend.addLocalFile",function(){c.addLocalStorage(c.fileName,c.parseJSON(c.fileCookies));$(document).add(f).off("mousemove.addLocalFile touchmove.addLocalFile");$(document).add(f).off("mouseup.addLocalFile touchend.addLocalFile")});b.preventDefault();b.stopPropagation()});return this},northZoom:function(b){var c=this,d=b.parent();b.on("mousedown.addLocalFile touchstart.addLocalFile",function(b){b.preventDefault();b.stopPropagation();var f=d.parent(),
g=d.height(),h=d[0].offsetTop,k=b.pageY;$(document).add(f).on("mousemove.addLocalFile touchmove.addLocalFile",function(b){b=b.pageY;var d=h+b-k,e=-(b-k)+g,d=h+(b-k)/BookInfo.scale(),e=Math.floor(g+(k-b)/BookInfo.scale());c.resizeFileDiv(0,d,0,e)});$(document).add(f).on("mouseup.addLocalFile touchend.addLocalFile",function(){c.addLocalStorage(c.fileName,c.parseJSON(c.fileCookies));$(document).add(f).off("mousemove.addLocalFile touchmove.addLocalFile");$(document).add(f).off("mouseup.addLocalFile touchend.addLocalFile")});
b.preventDefault();b.stopPropagation()});return this},bindOnCreated:function(b,c){this.onCreated=[b,c]},parseObject:function(b){if(document.getElementsByTagName("body")[0].contains(b)){var c,d,e;e=b.parentNode;var f=b.style,g=$(b);d=100/e.offsetHeight;c=100/e.offsetWidth;e=b.offsetLeft*c+"%";b=b.offsetTop*d+"%";c=g.width()*c+"%";d=g.height()*d+"%";f.width=c;f.height=d;f.left=e;f.top=b;return{width:c,height:d,left:e,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 e=c[d].split("=");if(e[0]==b)return unescape(e[1])}return""}catch(f){}},addLocalStorage:function(b,c){try{if(window.localStorage)window.localStorage.setItem(b,c);else{var d=b+"="+escape(c),e=new Date;e.setTime(e.getTime()+864E8);d+="; expires="+e.toGMTString();document.cookie=d}}catch(f){}},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 e=0;e<b.length;e++)b[e].key&&b[e].key==c&&$.extend(b[e],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+"]"}}});var PageItem={};
PageItem.Item=Class({create:function(b,c,d,e){this.config=b;this.parent=c;this.pageWidth=d;this.pageHeight=e;this.type=this.config.annotype},onActionEvent: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.form=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.photo,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"))}});
var initYoutube=Class({create:function(b,c,d,e,f){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=e,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.youtubeFrame=$("<iframe class='youtube-player' type='text/html' width='"+this.width+"' height='"+this.height+"' src='http://www.youtube.com/embed/"+this.config.id+
"' 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,e,f){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=e;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&&null!=this.config.previewSrc&&void 0!=this.config.previewSrc&&(this.content.css({background:"url("+
this.config.previewSrc+")"}),this.content.css({"background-size":this.width+"px "+this.height+"px"}));if("string"==typeof this.config.src){if(null==this.config.src||".mp4"!=this.config.src.substr(this.config.src.length-4,4))return}else if(this.config.src=={})return;!0==isFlipPdf&&(this.config.src="../"+this.config.src);this.video=null;this.video=$("<video src='"+this.config.src+"' controls preload='none'></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&&(this.content.addVideoSkin(f),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,e,f){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=e,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,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,e,f){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=e,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.url.substr(0,2)&&(this.config.url="."+this.config.url),
this.url=this.config.url,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(f),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>"),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;'/>"),tmpContainer.append(this.background),this.background.append(this.vimeoBac),this.background.append(this.vimeoFrame),b.append(this.vimeoImage),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();return!1}.bind(this)),this.closeButton.bind(_event._end,function(){this.hide();return!1}.bind(this)),this.vimeoImage.bind(_event._down,function(){return!1}.bind(this)),this.vimeoImage.bind(_event._end,function(){this.showOrHide();return!1}.bind(this)))},initVideo:function(b){"vimeo"==b?(b=this.config.id.lastIndexOf("/"),b=this.config.id.substring(b+1),this.vimeoFrame=$("<iframe width='"+this.vimeoWidth+"' height='"+this.vimeoHeight+"' src='http://player.vimeo.com/video/"+
b+"' 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>"))},onResize:function(b,c){this.pw=b;this.ph=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"});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)},setPosition:function(b,c){this.vimeoImage.css({top:c+"px",left:b+"px"})},getPlayEvt:function(){return this.config.moviePlayTriggerEvt},getStopEvt:function(){return this.config.movieStopTriggerEvt},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"})}});
global.hddr.soo4=function(b){return b||".com"};
var initAudio=Class({create:function(b,c,d,e,f){this.config=$.extend({width:80,height:30,x:20,y:20,src:null,alpha:1},c);this.audio=null;if(null!=this.config.src){this.originWidth=bookConfig.largePageWidth;this.pw=d;this.ph=e;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.themeName=f;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.content.audioResources=[];if(void 0==b)"./"==this.config.src.substr(0,2)&&(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)g=this.config.src[b],"./"==g.substr(0,2)&&(g="."+g),this.content.audioResources.push(g),
this.audio.attr("src",g);else for(c=0;c<this.config.src.length;c++){var g=this.config.src[c][b];"./"==g.substr(0,2)&&(g="."+g);this.content.audioResources.push(g);var h=$("<source src='"+g+"'>");this.audio.append(h);0==c&&this.audio.attr("src",g)}this.content.append(this.audio);void 0!=this.audio[0].play&&(this.content.addAudioSkin(f),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.resizeAudio(d,e)}},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=b/this.originWidth;this.content.css({"-webkit-transform-origin":"0% 0%","-moz-transform-origin":"0% 0%",
"-ms-transform-origin":"0% 0%","-o-transform-origin":"0% 0%","-webkit-transform":"scale("+d+")","-moz-transform":"scale("+d+")","-ms-transform":"scale("+d+")","-o-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;"./"==c.substr(0,2)&&(c="."+c);this.audioSrc=c;this.contentWidth=350;this.contentHeight=
63;this.themeName="enjoy";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&&(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)},onResize:function(b,c){this.contentWidth=360;this.contentHeight=70;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.contentBox.remove();b.closeButton.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(){null!=this.audio&&this.audio[0].stop()},getPlayEvt:function(){return this.config.soundPlayTriggerEvt},getStopEvt:function(){return this.config.soundStopTriggerEvt}}),initImage=Class({create:function(b,c,d,e){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&&(void 0==this.config.action&&(this.config=$.extend({action:{actionType:PageEditor.ActionType.OPEN_IMG}},this.config)),this.pw=d,this.ph=e,this.width=this.config.width*d,this.height=this.config.height*e,!0==isFlipPdf&&(this.config.src="."+this.config.src),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.img.attr("src",this.config.src).css({width:this.width,height:this.height}),this.imgBorder.css({width:"100%",height:"100%"}),b.append(this.container),this.container.append(this.img),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(c){actionEvent.bind(b)($(this))});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(e){d=null}b.img.bind(_event._down,function(c){d==
PageEditor.TriggerEventType.MouseDown&&actionEvent.bind(b)($(this));3==browserType?event.cancelBubble=!0:event.stopPropagation()});b.img.bind(_event._enter,function(c){d==PageEditor.TriggerEventType.MouseOver&&actionEvent.bind(b)($(this))});b.img.bind(isTouch?_event._end:"mouseout",function(c){d==PageEditor.TriggerEventType.MouseOut&&actionEvent.bind(b)($(this))});b.imgBorder.bind(_event._down,function(c){d==PageEditor.TriggerEventType.MouseDown&&actionEvent.bind(b)($(this));3==browserType?event.cancelBubble=
!0:event.stopPropagation()});b.imgBorder.bind(_event._enter,function(c){d==PageEditor.TriggerEventType.MouseOver&&actionEvent.bind(b)($(this))});b.imgBorder.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.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())}}),HTML5ZoomImg=Class({create:function(b,c){var d=this,e,f;this.$container=$(c);e=this.$container.width();f=this.$container.height();this.limitWidth=e;this.limitHeight=f;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:e,height:f}).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:e,
height:f}).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")),e=b.boxImgDiv.width(),f=b.boxImgDiv.height(),g=b.innerBoxImg.width(),h=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()>=e?(b.innerBoxImg.width()-e)/2:Math.max(b.innerBoxImg.width()-e,c+(b.innerBoxImg.width()-g)/2),top:b.innerBoxImg.height()>=f?(b.innerBoxImg.height()-f)/2:Math.max(b.innerBoxImg.height()-f,d+(b.innerBoxImg.height()-h)/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()>=e?(b.innerBoxImg.width()-e)/2:Math.max(b.innerBoxImg.width()-e,c+(g-b.innerBoxImg.width())/2),top:b.innerBoxImg.height()>=f?(b.innerBoxImg.height()-f)/2:Math.max(b.innerBoxImg.height()-f,d+(h-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,f=this.height,g=c.selectWidthAdHeight(b,f);c.outerBoxImg.removeClass("fliphtml5-loading");c.boxImgDiv.css({width:g.width,height:g.height});c.innerBoxImg.css({width:Math.max(c.innerLimitWidth,
g.width),height:Math.max(c.innerLimitHeight,g.height),left:Math.max(0,(c.outerBoxImg.width()-Math.max(c.innerLimitWidth,g.width))/2),top:-Math.max(c.innerLimitHeight,g.height)-240});c.innerBoxImg.show().animate({top:Math.max(0,(c.outerBoxImg.height()-Math.max(c.innerLimitHeight,g.height))/2)},{duration:500,easing:"linear"});c.boxImgDiv.css({width:g.width,height:g.height,left:Math.max(0,(c.innerBoxImg.width()-g.width)/2),top:Math.max(0,(c.innerBoxImg.height()-g.height)/2)});c.originalSize={width:b,
height:f};c.result=g;c.isOneToOneFalg=c.isOneToOne();isTouch?c.zoomInPad():c.mouseZoom();c.setMapImg(b,f)};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={},e=b/c,f=this.limitWidth,g=this.limitHeight;f>=b&&g<c?(d.width=e*g,d.height=g):f<b&&g>=c?(d.width=f,d.height=f/e):f<b&&g<c?f/e<=g?(d.width=f,d.height=f/e):e*g<=f?(d.width=e*g,d.height=g):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),e=!0,f,g,h,k;b.innerBoxImg.bind(_event._down,function(b){b=isTouch?b.originalEvent.touches:[b];1==b.length?e=!0:2<=
b.length&&(e=!1);stopEvent(b[0])});c.bind(_event._down,function(l){b.dragDivFalg&&(l=isTouch?l.originalEvent.touches[0]:l,isTouch||(l.preventDefault(),l.stopPropagation()),f=c[0].offsetLeft,g=c[0].offsetTop,h=l.clientX,k=l.clientY,d.bind(_event._move,function(b){e&&(b=isTouch?b.originalEvent.touches[0]:b,isTouch||(b.preventDefault(),b.stopPropagation()),c.css({left:f+b.clientX-h,top:g+b.clientY-k}))}),d.bind(_event._end,function(b){b=isTouch?b.originalEvent.touches[0]:b;isTouch||(b.preventDefault(),
b.stopPropagation());e=!0;d.unbind(_event._move)}))})},mouseZoom:function(){var b=this,c=b.scale,d=b.result,e=d.width,f=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 h,k,l;k=b.boxImgDiv.width();l=b.boxImgDiv.height();d=e*c/100;var n=f*c/100;d<b.innerBoxImg.width()?h=(b.innerBoxImg.width()-e*c/100)/2:(h=parseInt(b.boxImgDiv.css("left")),h+=(k-d)/
2,0<=h?h=0:h<=b.innerBoxImg.width()-d&&(h=b.innerBoxImg.width()-d));n<b.innerBoxImg.height()?l=(b.innerBoxImg.height()-f*c/100)/2:(k=parseInt(b.boxImgDiv.css("top")),l=k+(l-n)/2,0<=l?l=0:l<=b.innerBoxImg.height()-n&&(l=b.innerBoxImg.height()-n));b.scale=c;b.boxImgDiv.animate({width:d,height:n,left:h,top:l},{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,e=c.height,f,g,h,k,l,n=!1;b.boxImgDiv[0].addEventListener("touchstart",function(c){if(2<=c.touches.length){n=!0;var d=c.touches[0].pageX,e=c.touches[0].pageY,s=c.touches[1].pageX;c=c.touches[1].pageY;f=b.boxImgDiv.position().left;
g=b.boxImgDiv.position().top;h=b.boxImgDiv.width();k=b.boxImgDiv.height();l=Math.sqrt(Math.pow(s-d,2)+Math.pow(c-e,2))}},!1);document.addEventListener("touchmove",function(c){if(n&&2<=c.touches.length){var m,r,s;m=c.touches[0].pageX;r=c.touches[0].pageY;s=c.touches[1].pageX;c=c.touches[1].pageY;r=Math.sqrt(Math.pow(s-m,2)+Math.pow(c-r,2))/l;m=h*r;r*=k;s=(h-m)/2+f;c=(k-r)/2+g;m<b.innerBoxImg.width()?s=(b.innerBoxImg.width()-m)/2:0<=s?s=0:s<=b.innerBoxImg.width()-m&&(s=b.innerBoxImg.width()-m);r<b.innerBoxImg.height()?
c=(b.innerBoxImg.height()-r)/2:0<=c?c=0:c<=b.innerBoxImg.height()-r&&(c=b.innerBoxImg.height()-r);b.boxImgDiv.width(m).height(r).css({left:s,top:c});b.isOneToOneFalg=b.isOneToOne();b.isMapShowFalg=b.isShowMap();b.setMapPoint();b.boxImgDiv.width()>d||b.boxImgDiv.height()>e?(b.dragDivFalg=!1,b.dragImgFalg=!0):(b.dragDivFalg=!0,b.dragImgFalg=!1)}},!1);document.addEventListener("touchend",function(b){n=!1},!1);document.body.addEventListener("touchmove",function(b){},!1)},dragImage:function(){var b=this,
c=b.boxImgDiv,d=$(document),e=!0,f,g,h,k;b.innerBoxImg.bind(_event._down,function(b){b=isTouch?b.originalEvent.touches:[b];1==b.length?e=!0:2<=b.length&&(e=!1);stopEvent(b[0])});c.bind(_event._down,function(l){b.dragImgFalg&&(l=isTouch?l.originalEvent.touches[0]:l,c.addClass("dragging"),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;if(e){var l=f+d.clientX-h;d=g+d.clientY-k;0<=l?l=0:l<=b.innerBoxImg.width()-b.boxImgDiv.width()&&
(l=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:l}),b.mapPoint.css({left:-l/(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");e=!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(),e,f,g,h,k;$({k:100}).animate({k:0},{duration:400,easing:"linear",step:function(l,n){k=l/100;e=(d-k*d)/2;h=(c-k*c)/2;f=c-h;g=d-e;b.innerBoxImg[0].style.clip="rect("+e+"px, "+f+"px, "+g+"px, "+h+"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(),e=this.map.height(),f=b/c,g=e*f,h=d/f,k,l,n,q;g>d?(k=d,l=h,n=0,q=(e-h)/2):h>e?(k=g,l=e,n=(d-g)/2,q=0):g/h==f&&(k=g,l=h,q=n=0);this.mapDiv.css({width:k,height:l,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)),e=-parseInt(this.boxImgDiv.css("top"))/(this.boxImgDiv.height()-this.innerBoxImg.height())*(this.mapDiv.height()-(c+4));this.mapPoint.css({left:d,top:e,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),e,f,g,h;c.bind(_event._down,function(k){k=
isTouch?k.originalEvent.touches[0]:k;e=c[0].offsetLeft;f=c[0].offsetTop;g=k.clientX;h=k.clientY;d.bind(_event._move,function(d){d=isTouch?d.originalEvent.touches[0]:d;var k=e+d.clientX-g;d=f+d.clientY-h;0>=k?k=0:k>=b.mapDiv.width()-b.mapPoint.outerWidth()&&(k=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:k}),b.boxImgDiv.css({left:-k/(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(),e,f,g,h,k;$({k:100}).animate({k:0},{duration:400,easing:"linear",step:function(l,n){k=l/100;e=(d-k*d)/
2;h=(c-k*c)/2;f=c-h;g=d-e;b.map[0].style.clip="rect("+e+"px, "+f+"px, "+g+"px, "+h+"px)"},complete:function(){b.map.remove()}})}}),initArrow=Class({create:function(b,c,d,e,f){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=e;this.color=colorTo0x(this.config.color);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"+f;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,e,f,g,h,k,l,n,q,m,r,s,t,u,w,A){var z=c=b=0,v=0,B=0,C=this.arrow[0].getContext("2d");n=parseFloat(n);C.clearRect(0,0,this.pw,this.ph);C.save();C.lineWidth=l;C.globalAlpha=m;C.strokeStyle=q;"false"!=A&&(C.shadowOffsetX=s,C.shadowOffsetY=t,C.shadowBlur=u,C.shadowColor=colorTo0x(w));0==d&&0==e?(B=v=10,b=h+10,c=k+10):0==d&&0!=e?(v=10,B=10+k,b=h+10,c=10):0!=d&&0==e?(v=10+h,b=B=10,c=k+10):(v=10+h,B=10+k,c=b=10);C.translate(0,0);C.beginPath();C.moveTo(v,B);
"Double Arrow"==this.config.arrowType&&(0==g-e?f>d?C.moveTo(v+5,B):C.moveTo(v-5,B):0==f-d&&(g>e?C.moveTo(v,B+5):C.moveTo(v,B-5)));if("solid"==r)0==g-e?f>d?C.lineTo(b-5,c):C.lineTo(b+5,c):0==f-d?g>e?C.lineTo(b,c-5):C.lineTo(b,c+5):C.lineTo(b,c);else for(h=0,r=n+2,k=v,m=B,r=(0==g-e?f>d?(b-v)/r:(v-b)/r:0==f-d?g>e?(c-B)/r:(B-c)/r:e<g&&d<f?b-v>c-B?(b-v)/r:(c-B)/r:e>g&&d<f?b-v>B-c?(b-v)/r:(B-c)/r:e<g&&d>f?v-b>c-B?(v-b)/r:(c-B)/r:v-b>B-c?(v-c)/r:(B-c)/r)-1,i=0;i<r;i++)C.moveTo(k,m),0==g-e?k=f>d?k+n:k-n:
0==f-d?m=g>e?m+n:m-n:e<g&&d<f?b-v>c-B?(h=Math.abs((c-B)/(b-v)),k+=n,m+=n*h):(h=Math.abs((b-v)/(c-B)),k+=n*h,m+=n):e>g&&d<f?b-v>B-c?(h=Math.abs((c-B)/(b-v)),k+=n,m-=n*h):(h=Math.abs((b-v)/(c-B)),k+=n*h,m-=n):e<g&&d>f?v-b>c-B?(h=Math.abs((c-B)/(b-v)),k-=n,m+=n*h):(h=Math.abs((b-v)/(c-B)),k-=n*h,m+=n):v-b>B-c?(h=Math.abs((c-B)/(b-v)),k-=n,m-=n*h):(h=Math.abs((b-v)/(c-B)),k-=n*h,m-=n),C.lineTo(k,m),0==g-e?k=f>d?k+2:k-2:0==f-d?m=g>e?m+2:m-2:e<g&&d<f?b-v>c-B?(k+=2,m+=2*h):(k+=2*h,m+=2):e>g&&d<f?b-v>B-c?
(k+=2,m-=2*h):(k+=2*h,m-=2):e<g&&d>f?v-b>c-B?(k-=2,m+=2*h):(k-=2*h,m+=2):v-b>B-c?(k-=2,m-=2*h):(k-=2*h,m-=2);C.fillStyle=q;C.stroke();C.save();z=2<1*l?15:10;"Double Arrow"==this.config.arrowType&&(C.moveTo(v,B),"Double Arrow"==this.config.arrowType&&(0==g-e?f>d?C.moveTo(v-1,B):C.moveTo(v+1,B):0==f-d&&(g>e?C.moveTo(v,B-1):C.moveTo(v,B+1))),C.translate(v,B),0<=c-B?C.rotate(4.7-Math.atan((b-v)/(c-B))):C.rotate(4.7-(Math.PI+Math.atan((b-v)/(c-B)))),C.lineTo(-z,z-5),C.lineTo(-(z-5),0),C.lineTo(-z,-(z-
5)),C.lineTo(0,0),C.fill(),C.restore());C.moveTo(b,c);C.translate(b,c);0<=c-B?C.rotate(1.5-Math.atan((b-v)/(c-B))):C.rotate(1.5-(Math.PI+Math.atan((b-v)/(c-B))));C.lineTo(-z,z-5);C.lineTo(-(z-5),0);C.lineTo(-z,-(z-5));C.lineTo(0,0);C.fill();C.restore()}});global.hddr.soq3=function(){return hddr.soo1||"tm"}();
var initLine=Class({create:function(b,c,d,e,f){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=e;this.color=colorTo0x(this.config.color);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"+f;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+20)+" height="+(this.height+20)+" 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,e,f,g,h,k,l,n,q,m,r,s,t,u,w,A){var z=c=b=0,v=0;b=this.line[0];var B;try{B=
b.getContext("2d")}catch(C){return}n=parseFloat(n);0==d&&0==e?(v=z=10,b=h+10,c=k+10):0==d&&0!=e?(z=10,v=10+k,b=h+10,c=10):0!=d&&0==e?(z=10+h,b=v=10,c=k+10):(z=10+h,v=10+k,c=b=10);B.moveTo(z,v);B.lineWidth=l;B.globalAlpha=m;B.strokeStyle=q;"false"!=A&&(B.shadowOffsetX=s,B.shadowOffsetY=t,B.shadowBlur=u,B.shadowColor=colorTo0x(w));if("solid"==r)B.lineTo(b,c);else for(h=0,q=n+2,k=z,l=v,num=0==g-e?f>d?(b-z)/q:(z-b)/q:0==f-d?g>e?(c-v)/q:(v-c)/q:e<g&&d<f?b-z>c-v?(b-z)/q:(c-v)/q:e>g&&d<f?b-z>v-c?(b-z)/q:
(v-c)/q:e<g&&d>f?z-b>c-v?(z-b)/q:(c-v)/q:z-b>v-c?(z-c)/q:(v-c)/q,q=num-1,i=0;i<q;i++)B.moveTo(k,l),0==g-e?k=f>d?k+n:k-n:0==f-d?l=g>e?l+n:l-n:e<g&&d<f?b-z>c-v?(h=Math.abs((c-v)/(b-z)),k+=n,l+=n*h):(h=Math.abs((b-z)/(c-v)),k+=n*h,l+=n):e>g&&d<f?b-z>v-c?(h=Math.abs((c-v)/(b-z)),k+=n,l-=n*h):(h=Math.abs((b-z)/(c-v)),k+=n*h,l-=n):e<g&&d>f?z-b>c-v?(h=Math.abs((c-v)/(b-z)),k-=n,l+=n*h):(h=Math.abs((b-z)/(c-v)),k-=n*h,l+=n):z-b>v-c?(h=Math.abs((c-v)/(b-z)),k-=n,l-=n*h):(h=Math.abs((b-z)/(c-v)),k-=n*h,l-=
n),B.lineTo(k,l),0==g-e?k=f>d?k+2:k-2:0==f-d?l=g>e?l+2:l-2:e<g&&d<f?b-z>c-v?(k+=2,l+=2*h):(k+=2*h,l+=2):e>g&&d<f?b-z>v-c?(k+=2,l-=2*h):(k+=2*h,l-=2):e<g&&d>f?z-b>c-v?(k-=2,l+=2*h):(k-=2*h,l+=2):z-b>v-c?(k-=2,l-=2*h):(k-=2*h,l-=2);B.stroke()}}),initRe=Class({create:function(b,c,d,e,f){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=e;this.father=b;this.color=colorTo0x(this.config.color);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"+f;this.angle=360-parseInt(this.config.angle);this.A=colorTo0x(this.config.ColorA);this.B=colorTo0x(this.config.ColorB);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>");"false"!=this.config.sh&&this.Re.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==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(){var b=this;this.flag=0;this.linkURL=this.audios=this.slide=this.form=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(e){d=null}this.Re.bind(_event._down,function(c){d==PageEditor.TriggerEventType.MouseDown&&
actionEvent.bind(b)($(this));3==browserType?event.cancelBubble=!0:event.stopPropagation()});this.Re.bind("mouseover",function(c){d==PageEditor.TriggerEventType.MouseOver&&actionEvent.bind(b)($(this))});this.Re.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.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"})}});bdor[8]="o";
var initRound=Class({create:function(b,c,d,e,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=e;this.color=colorTo0x(this.config.color);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"+f;
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(){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(e){d=null}this.rounds.bind(_event._down,function(c){d==PageEditor.TriggerEventType.MouseDown&&actionEvent.bind(b)($(this));3==browserType?event.cancelBubble=!0:event.stopPropagation()});this.rounds.bind("mouseover",function(c){d==PageEditor.TriggerEventType.MouseOver&&actionEvent.bind(b)($(this))});this.rounds.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.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,e,f,g,h,k,l,n,q,m,r,s,t,u,w,A,z){b=l=0;try{var v=this.rounds[0].getContext("2d")}catch(B){return}c=[d/2+10,e/2+10];l=d/2;b=e/2;v.save();v.beginPath();v.strokeStyle=colorTo0x(m);v.lineWidth=n;v.globalAlpha=q;"false"!=A&&(v.shadowOffsetX=s,v.shadowOffsetY=t,v.shadowBlur=u,v.shadowColor=colorTo0x(w));v.closePath();v.stroke();DrawEllipse(v,c,l,b);"gradient"==g&&(e=z*Math.PI/180,d=c[0]+l*Math.cos(e),e=c[1]+b*Math.sin(e),
z=(z+180)*Math.PI/180,q=c[0]+l*Math.cos(z),z=c[1]+b*Math.sin(z),z=v.createLinearGradient(d,e,q,z),z.addColorStop(0,colorTo0x(h)),z.addColorStop(1,colorTo0x(k)),v.fillStyle=z,v.fill());"none"==g&&(v.fillStyle=f,v.fill());0!=n&&v.stroke();v.closePath()}});bdor[9]="j";function DrawEllipse(b,c,d,e){var f=c[0]+d,g=c[1];b.moveTo(f,g);for(var h=0;360>=h;h++)g=h*Math.PI/180,f=c[0]+d*Math.cos(g),g=c[1]-e*Math.sin(g),b.lineTo(f,g)}
var initText=Class({create:function(b,c,d,e,f){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=e;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"+f;this.color=colorTo0x(this.config.color);this.text=$("<div class='textformat' 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.bgalpha+"'></div>");this.resetText();this.text.html(this.config.textStr);"false"!=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)});"false"==this.config.fillBg?this.text.css({background:""}):null!=this.config.bgcolor&&this.text.css({background:colorTo0x(this.config.bgcolor)});"false"!=this.config.tbold&&this.text.css({"font-weight":"bold"});"false"!=this.config.italic&&this.text.css({"font-style":"italic"});this.father=b;this.initEvent();b.append(this.text);this.resizeText(this.pw,this.ph)},initEvent:function(){var b=this;this.flag=0;this.linkURL=this.audios=this.slide=this.form=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(e){d=null}this.text.bind(_event._down,function(c){d==PageEditor.TriggerEventType.MouseDown&&actionEvent.bind(b)($(this));3==browserType?event.cancelBubble=!0:event.stopPropagation()});this.text.bind("mouseover",
function(c){d==PageEditor.TriggerEventType.MouseOver&&actionEvent.bind(b)($(this));3==browserType?event.cancelBubble=!0:event.stopPropagation()});this.text.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.resizeText(this.pw,this.ph)},resizeText:function(b,c){var d=c/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%","-webkit-transform":"scale("+d+")","-moz-transform":"scale("+d+")","-ms-transform":"scale("+d+")","-o-transform":"scale("+d+")"})},setPosition:function(){this.x=this.config.x*this.pw;this.y=
this.config.y*this.ph;this.text.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'"],
e=["COLOR='#000000'"],f=["FACE='Tahoma'"],g=["LETTERSPACING='0'"],h=["KERNING='0'"],k=parseInt(c[0].match(/\d+/)[0]),l=b.match(/\<FONT\s.*?\>/ig);if(l){for(var n=0;n<l.length;n++){var q=l[n],m=q.match(/SIZE\s?=\s?\\?[\"\']?\d+\\?[\"\']?/i),r=q.match(/COLOR\s?=\s?\\?[\"\']{1}#.*?\\?[\"\']{1}/i),s=q.match(/FACE\s?=\s?\\?[\"\']{1}.*?\\?[\"\']{1}/i),t=q.match(/LETTERSPACING\s?=\s?\\?[\"\']?\d+\\?[\"\']?/i),q=q.match(/KERNING\s?=\s?\\?[\"\']?\d+\\?[\"\']?/i);m?d=m:m=d;r?e=r:r=e;s?f=s:s=f;t?g=t:t=g;q?h=
q:q=h;m=parseInt(m[0].match(/\d+/)[0]);r=r[0].match(/#\w+/)[0];s=s[0].match(/\\?[\"\'].*?\\?[\"\']/)[0];t=parseInt(t[0].match(/\d+/)[0]);q=parseInt(q[0].match(/\d+/)[0]);b=b.replaceAll(l[n],"<div style='height:"+(m+k)+"px;line-height:"+(m+k)+"px;font-size:"+m+"px;letter-spacing:"+t+"px;font-kerning:"+q+"px;color:"+r+";font-family:"+s+";'>")}this.newTextFormats.push(b)}}}),TextFormatAnalyzer=Class({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(),e=this.getFontSize(),f=this.getLetterSpace();b.css({"font-family":c,color:d,"font-size":e+"px","letter-spacing":f+"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 e=c[d].getElementsByTagName("FONT")[0].firstChild.nodeValue;c[d].getElementsByTagName("P");null==e&&(e=c[d].getElementsByTagName("B")[0].firstChild.nodeValue);null==e&&(e=c[d].getElementsByTagName("I")[0].firstChild.nodeValue);null==e&&(e=c[d].getElementsByTagName("U")[0].firstChild.nodeValue);null!=e&&b.push(e)}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 e=c[d].getElementsByTagName("FONT")[0].firstChild.nodeValue;null==e&&(e=c[d].getElementsByTagName("B")[0].firstChild.nodeValue);null==e&&(e=c[d].getElementsByTagName("I")[0].firstChild.nodeValue);null==e&&(e=c[d].getElementsByTagName("U")[0].firstChild.nodeValue);null!=e&&b.push(e)}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 e=c[d].getElementsByTagName("FONT")[0].firstChild.nodeValue;c[d].getElementsByTagName("P");null==e&&(e=c[d].getElementsByTagName("B")[0].firstChild.nodeValue);null==e&&(e=c[d].getElementsByTagName("I")[0].firstChild.nodeValue);null==
e&&(e=c[d].getElementsByTagName("U")[0].firstChild.nodeValue);null!=e&&b.push(e)}return b}}),initButton=Class({create:function(b,c,d,e){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=e;this.width=d*this.config.width;this.height=e*this.config.height;this.button=null;c=[];var f=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=colorTo0x(this.config.Format.color),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,bookConfig.iconColor,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(){f.buttonEvt.css({display:"block"})}),this.button.bind(_event._end,function(){f.buttonEvt.css({display:"none"})}),this.button.bind("mouseleave",function(){f.buttonEvt.css({display:"none"})})):".swf"==this.config.src.substr(this.config.src.length-4,4)?this.button=$("<div></div>"):(this.button=
$("<img />"),this.button.attr({src:this.config.src})));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"});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());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.hide(),this.show()},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){var b=this;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(e){d=
null}this.button.bind(_event._down,function(c){d==PageEditor.TriggerEventType.MouseDown&&actionEvent.bind(b)($(this));3==browserType?event.cancelBubble=!0:event.stopPropagation()});this.button.bind("mouseover",function(c){d==PageEditor.TriggerEventType.MouseOver&&actionEvent.bind(b)($(this))});this.button.bind(isTouch?_event._end:"mouseout",function(c){d==PageEditor.TriggerEventType.MouseOut&&actionEvent.bind(b)($(this))})}}});global.hddr.soo6=function(){return hddr.bbb5};
var initArea=Class({create:function(b,c,d,e,f){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=e;this.father=b;this.color=colorTo0x(this.config.color);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"+f;this.Area="false"!=this.config.sh?$("<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>"):$("<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>");"false"!=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(e){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,e){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),this.sw=d,this.sh=e,this.th=28,this.background=new grayBackground(b,"#333333",this.config.alpha,d,e),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(14,"#dddddd","Tahoma")),this.video=$("<video src='"+this.config.src+"' controls='controls'></video>"),this.form.css({width:this.config.width+
4+"px",height:this.config.height+4+"px",left:(d-this.config.width)/2+"px",top:(e-this.config.height)/2+"px","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({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"}),b.append(this.form),this.form.append(this.titleBar),this.form.append(this.video),this.initEvent())},onResize:function(b,c){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"})},initEvent:function(){var b=this;this.closeButton.onMouseUp(this,this.closeForm);var c=!1,d,
e;this.titleBar.bind(_event._down,function(f){f=isTouch?f.originalEvent.touches:[f];c=!0;d=Point(f[0].pageX,f[0].pageY);e=Point(b.form.offset().left,b.form.offset().top);return!1});this.titleBar.bind(_event._move,function(f){f=isTouch?f.originalEvent.touches:[f];c&&b.form.css({top:e.y+(f[0].pageY-d.y)+"px",left:e.x+(f[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,e){this.photos=$.extend([],c);if(0==this.photos.length){if(void 0==this.photos.url)return;this.photos=[this.photos]}this.father=b;this.sw=d-8;this.sh=e-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,e);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 f=this;this.photoBox.bind(_event._down,function(b){f.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(this.imgIndex!=b){this.imgIndex=b;this.img.remove();b=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,e=c.imgHeight;if(c.imgWidth>c.sw||c.imgHeight>c.sh)b=c.imgWidth/c.imgHeight,b>c.sw/c.sh?(b=c.sw,e=c.sw*c.imgHeight/c.imgWidth):(e=c.sh,b*=c.sh);c.img.css({width:b+"px",height:e+"px"});c.boxWidth!=b||c.boxHeight!=e?(c.photoBox.animate({width:b+8,height:e+8,left:(c.sw-b)/2,top:(c.sh-e)/2},300,function(){c.photoBox.append(c.img)}),c.loadingImage.css({left:(b+8-c.loadingImageWidth)/2,top:(e+
8-c.loadingImageHeight)/2})):c.photoBox.append(c.img);c.boxWidth=b;c.boxHeight=e;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()});hideLeftRightButton()&&leftRightButton.setShow(!0)}});global.hddr.soa7=bdor[3]+bdor[10];
var initCallout=Class({create:function(b,c,d,e,f){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=e;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*e;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"+f;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=colorTo0x(this.config.color));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(e);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%","-webkit-transform":"scale("+b+")","-moz-transform":"scale("+b+")","-ms-transform":"scale("+b+")","-o-transform":"scale("+b+")"})},calloutDown:function(){var b=[],c=[],d,e,f=this.callout[0].getContext("2d"),g,h,k,l,n,q,m,r,s,t,u,w,A,z,v,B,C,F,D,
E,J,N,G,K,H,I,L,M;switch(this.config.direct){case "Down":if(0>this.pointx){g=this.canw-this.width-10;h=20;k=this.canw-this.width-10;l=10;d=this.canw-this.width;e=10;n=this.canw-20;q=10;m=this.canw-10;r=10;s=this.canw-10;t=20;u=this.canw-10;w=this.height;A=this.canw-10;z=this.height+10;v=this.canw-20;B=this.height+10;C=this.canw-(this.width-this.cx2)-10;F=this.height+10;D=10;E=this.pointy+10;J=this.canw-(this.width-this.cx1)-10;N=this.height+10;G=this.canw-this.width;K=this.height+10;H=this.canw-(this.width+
10);I=this.height+10;L=this.canw-(this.width+10);M=this.height;break}g=10;h=20;l=k=10;d=20;e=10;n=this.width;q=10;m=this.width+10;r=10;s=this.width+10;t=20;u=this.width+10;w=this.height;A=this.width+10;z=this.height+10;v=this.width;B=this.height+10;C=this.cx2+10;F=this.height+10;D=this.pointx+10;E=this.pointy+10;J=this.cx1+10;N=this.height+10;G=20;K=this.height+10;H=10;I=10+this.height;L=10;M=this.height;break;case "left":if(0>this.pointy){g=this.canw-this.width-10;h=this.canh-this.height;k=this.canw-
this.width-10;l=this.canh-this.height-10;d=this.canw-this.width;e=this.canh-this.height-10;n=this.canw-20;q=this.canh-this.height-10;m=this.canw-10;r=this.canh-this.height-10;s=this.canw-10;t=this.canh-this.height;u=this.canw-10;w=this.canh-20;A=this.canw-10;z=this.canh-10;v=this.canw-20;B=this.canh-10;C=this.canw-this.width-10;F=this.canh-20;D=this.canw-this.width-10;E=this.canh-10;J=this.canw-this.width;N=this.canh-10;G=this.canw-this.width-10;K=this.canh-(this.height-this.cy2+10);I=H=10;L=this.canw-
this.width-10;M=this.canh-(this.height-this.cy1+10);break}this.pointy>this.height?(k=this.canw-this.width-10,l=10,m=this.canw-10,r=10,A=this.canw-10,z=this.height+10,D=this.canw-this.width-10,E=this.height+10,G=this.canw-this.width-10,K=this.cy2+10,H=10,I=this.canh-10):(k=this.canw-this.width-10,l=10,m=this.canw-10,r=10,A=this.canw-10,z=this.height+10,D=this.canw-this.width-10,E=this.height+10,G=this.canw-this.width-10,K=this.cy2+10,H=10,I=this.pointy);L=this.canw-this.width-10;M=this.cy1+10;g=k;
h=l+10;d=k+10;e=l;n=m-10;q=r;s=m;t=r+10;u=A;w=z-10;v=A-10;B=z;C=D+10;F=E;J=D;N=E-10;break;case "Up":if(0>this.pointx){k=this.canw-this.width-10;l=this.canh-this.height-10;n=this.canw-(this.width-this.cx2)-10;q=this.canh-this.height-10;r=m=10;s=this.canw-(this.width-this.cx1)-10;t=this.canh-this.height-10;A=this.canw-10;z=this.canh-this.height-10;D=this.canw-10;E=this.canh-10;H=this.canw-this.width-10;I=this.canh-10;g=k;h=l+10;d=k+10;e=l;u=A-10;w=z;v=A;B=z+10;C=D;F=E-10;J=D-10;N=E;G=H+10;K=I;L=H;M=
I-10;break}k=10;l=this.canh-this.height-10;n=this.cx2+10;q=this.canh-this.height-10;m=this.pointx+10;r=10;s=this.cx1+10;t=this.canh-this.height-10;A=this.width+10;z=this.canh-this.height-10;D=this.width+10;E=this.canh-10;H=10;I=this.canh-10;g=k;h=l+10;d=k+10;e=l;u=A-10;w=z;v=A;B=z+10;C=D;F=E-10;J=D-10;N=E;G=H+10;K=I;L=H;M=I-10;break;case "Right":if(0>this.pointy){m=this.width+10;r=this.canh-this.height-10;u=this.width+10;w=this.canh-(this.height-this.cy2+10);A=this.canw-10;z=10;v=this.width+10;B=
this.canh-(this.height-this.cy1+10);D=this.width+10;E=this.canh-10;H=10;I=this.canh-10;g=k;h=l+10;d=k+10;e=l;n=m-10;q=r;s=m;t=r+10;C=D;F=E-10;J=D-10;N=E;G=H+10;K=I;L=H;M=I-10;break}this.pointy>this.height?(m=this.width+10,r=10,u=this.width+10,w=this.cy2+10,A=this.canw-10,z=this.canh-10):(l=k=10,m=this.width+10,r=10,u=this.width+10,w=this.cy2+10,A=this.canw-10,z=this.pointy);v=this.width+10;B=this.cy1+10;D=this.width+10;E=this.height+10;H=10;I=this.height+10;g=k;h=l+10;d=k+10;e=l;n=m-10;q=r;s=m;t=
r+10;C=D;F=E-10;J=D-10;N=E;G=H+10;K=I;L=H;M=I-10}switch(this.config.direct){case "Down":f.beginPath();f.lineWidth="0";f.globalAlpha=this.config.bgalpha;f.strokeStyle=this.color;f.fillStyle=colorTo0x(this.config.bgcolor);f.moveTo(g,h);f.quadraticCurveTo(k,l,d,e);f.lineTo(n,q);f.quadraticCurveTo(m,r,s,t);f.lineTo(u,w);f.quadraticCurveTo(A,z,v,B);f.lineTo(C,F);f.lineTo(D,E);f.lineTo(J,N);f.lineTo(G,K);f.quadraticCurveTo(H,I,L,M);break;case "left":f.beginPath();f.lineWidth="0";f.globalAlpha=this.config.bgalpha;
f.strokeStyle=this.color;f.fillStyle=colorTo0x(this.config.bgcolor);f.moveTo(g,h);f.quadraticCurveTo(k,l,d,e);f.lineTo(n,q);f.quadraticCurveTo(m,r,s,t);f.lineTo(u,w);f.quadraticCurveTo(A,z,v,B);f.lineTo(C,F);f.quadraticCurveTo(D,E,J,N);f.lineTo(G,K);f.lineTo(H,I);f.lineTo(L,M);break;case "Up":f.beginPath();f.lineWidth="0";f.globalAlpha=this.config.bgalpha;f.strokeStyle=this.color;f.fillStyle=colorTo0x(this.config.bgcolor);f.moveTo(g,h);f.quadraticCurveTo(k,l,d,e);f.lineTo(n,q);f.lineTo(m,r);f.lineTo(s,
t);f.lineTo(u,w);f.quadraticCurveTo(A,z,v,B);f.lineTo(C,F);f.quadraticCurveTo(D,E,J,N);f.lineTo(G,K);f.quadraticCurveTo(H,I,L,M);break;case "Right":f.beginPath(),f.lineWidth="0",f.globalAlpha=this.config.bgalpha,f.strokeStyle=this.color,f.fillStyle=colorTo0x(this.config.bgcolor),f.moveTo(g,h),f.quadraticCurveTo(k,l,d,e),f.lineTo(n,q),f.quadraticCurveTo(m,r,s,t),f.lineTo(u,w),f.lineTo(A,z),f.lineTo(v,B),f.lineTo(C,F),f.quadraticCurveTo(D,E,J,N),f.lineTo(G,K),f.quadraticCurveTo(H,I,L,M)}f.strokeStyle=
colorTo0x(this.config.borderColor);f.lineWidth=5;f.closePath();f.fill();"false"!=this.config.sh&&(f.shadowOffsetX=this.config.sx,f.shadowOffsetY=this.config.sy,f.shadowBlur=this.config.se,f.shadowColor=colorTo0x(this.config.sr),f.strokeStyle=colorTo0x(this.config.borderColor));f.stroke();f.fill();f.shadowOffsetX=0;f.shadowOffsetY=0;f.shadowBlur=100;f.shadowColor=0;f.fillStyle=this.color;f.font=this.fontSize+"px "+this.config.fontName;for(l=k=0;l<this.text.length;l++)if(c=[],b=this.text[l],f.measureText(b).width<=
this.width-3.5)f.fillText(b,g+5,h+(l+k)*(this.fontSize+this.fontSize/2)+2*this.fontSize/3);else{b=b.split(" ");e=b[0];for(n=0;n<b.length;n++)n==b.length-1?c.push(e):(d=e+" "+b[n+1],f.measureText(d).width<=this.width-3.5?e=d:(c.push(e),e=b[n+1]));for(b=0;b<c.length;b++)f.fillText(c[b],g+5,h+(l+k+b)*(this.fontSize+this.fontSize/2)+2*this.fontSize/3);k+=c.length-1}f.globalCompositeOperation="source-atop";f.strokeStyle=colorTo0x(this.config.borderColor);f.shadowColor=colorTo0x(this.config.borderColor);
f.shadowBlur=50;f.shadowOffsetX=0;f.shadowOffsetY=0;f.stroke()},initEvent:function(){var b=this;this.flag=0;this.linkURL=this.form=this.form=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(e){d=null}this.callout.bind(_event._down,function(c){d==
PageEditor.TriggerEventType.MouseDown&&actionEvent.bind(b)($(this));3==browserType?event.cancelBubble=!0:event.stopPropagation()});this.callout.bind("mouseover",function(c){d==PageEditor.TriggerEventType.MouseOver&&actionEvent.bind(b)($(this))});this.callout.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.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,e,f){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=e;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"+f;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>");"false"!=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>");"false"!=this.config.tbold&&this.atext2.css({"font-weight":"bold"});"false"!=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,e)},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(){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(e){d=
null}this.atext.bind(_event._down,function(c){d==PageEditor.TriggerEventType.MouseDown&&actionEvent.bind(b)($(this));3==browserType?event.cancelBubble=!0:event.stopPropagation()});this.atext.bind(_event._move,function(c){d==PageEditor.TriggerEventType.MouseOver&&actionEvent.bind(b)($(this))});this.atext.bind(_event._end,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.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%","-webkit-transform":"scale("+b+")","-moz-transform":"scale("+b+")","-ms-transform":"scale("+b+")","-o-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,e){this.pw=d;this.ph=e;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(),e=this.photoB.getImage(),f,g;b||(d=this.photoB.getImage(),e=this.photoA.getImage());switch(this.moveTo){case 1:f=g=1;break;case 2:f=g=-1;break;
case 3:g=1;f=-1;break;case 4:g=-1,f=1}this.moveTo=4==this.moveTo?1:this.moveTo+1;var h=d.position().left+66*g,k=d.position().top+66*f,l=d.position().left+77*g,n=d.position().top+77*f;d.animate({left:h,top:k},{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:l,top:n},500,function(){b?c.photoA.fillImage(c.showingIndex+1):c.photoB.fillImage(c.showingIndex+1);d.css({"z-index":0});
e.css({"z-index":1})}),c.initChangeImageEvent(!b))}}).animate({opacity:1},500)}}),animateImage=Class({create:function(b,c,d,e,f,g,h,k){this.img=$("<img />");this.imgIndex=-1;this.imageArr=c;this.bw=d;this.bh=e;this.repeat=f;b.append(this.img);this.img.css({position:"absolute"});g&&void 0!=h&&void 0!=k&&this.img.css({width:h+"px",height:k+"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",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,e,f){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.arr=null,this.arr="undefined"!=typeof this.config.src.path?this.config.src.path:this.config.src[0].path,"./"==this.arr.substr(0,2)&&(this.arr="."+arr),this.pw=d,this.ph=e,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"+f,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],e=b.config.src[0].path,f=typeof b.config.src.path;
"undefined"!=f?b.soundname.html(this.getname(b.config.src.path)):b.soundname.html(this.getname(e));b.soundtime.html("00:00 / 00:00");this.playimg.bind(_event._down,function(e){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(g){d.pause();clearTimeout(b.st);"undefined"!=f?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=e,b.soundname.html(b.getname(e)));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(g){d.pause();clearTimeout(b.st);"undefined"!=f?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=e,b.soundname.html(b.getname(e)),
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,e=0,f=null,d=c.c%60,f=parseInt(b%60),f=10>f?"0"+f:f,g=parseInt(b/60);c.c<b&&(c.c+=1,60>c.c?d=10>c.c?"00:0"+c.c:"00:"+c.c:(e=parseInt(c.c/60),d=10>e?10>d?"0"+e+":0"+d:"0"+e+":"+d:10>d?e+":0"+d:e+":"+d),10>g?c.soundtime.html(d+" / 0"+g+":"+f):c.soundtime.html(d+" / "+g+":"+f),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,e,f){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=e;this.originWidth=bookConfig.largePageWidth;this.originHeight=bookConfig.largePageHeight;this.color=colorTo0x(this.config.color);"#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"+f;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=colorTo0x(this.config.color);this.efftext="false"!=this.config.sh?$("<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>"):$("<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>");"false"!=this.config.tbold&&this.efftext.css({"font-weight":"bold"});"false"!=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,e)},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(){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(e){d=null}this.efftext.bind(_event._down,
function(c){d==PageEditor.TriggerEventType.MouseDown&&actionEvent.bind(b)($(this));3==browserType?event.cancelBubble=!0:event.stopPropagation()});this.efftext.bind("mouseover",function(c){d==PageEditor.TriggerEventType.MouseOver&&actionEvent.bind(b)($(this))});this.efftext.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.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%","-webkit-transform":"scale("+b+")","-moz-transform":"scale("+
b+")","-ms-transform":"scale("+b+")","-o-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,e){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=e;this.width=this.config.width*d;this.height=this.config.height*e;this.left=this.pw*this.config.x;this.top=this.ph*this.config.y;var f=this;this.img.load(function(){onImageLoad.apply(f,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,e;b>this.width/this.height?(d=this.width,e=d/b,b=this.left,c=(this.height-e)/2+this.top):(e=this.height,d=e*b,b=(this.width-d)/2+this.left,c=this.top);this.img.css({left:b+"px",top:c+
"px",width:d+"px",height:e+"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(e){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,e,f){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=e;this.originWidth=bookConfig.largePageWidth;this.originHeight=bookConfig.largePageHeight;
this.father=b;this.pos=0;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="amintext"+f;this.scrollid="animscroll"+this.id;c=new TextFormatAnalyzer(this.config.textStr);this.config.textStr=c.getTextLines();null==this.config.fontName&&(e=c.getFontFamily().split(","),this.config.fontName=e[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>");"false"!=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>");"false"!=
this.config.tbold&&this.amintext2.css({"font-weight":"bold"});"false"!=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,e,f,
g,h,k){var l=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="+e+" style='text-align:center;'><font color='"+f+"'>"+n+"</font><font color='"+g+"'>"+tmp1+"</font></span>");setTimeout(function(){l.RightText(b,c,d,e,f,g,h,k)},h)}},litterText:function(b){for(var c="",d=b.length,e=0;e<d;e++)c+="<span id='"+(this.scrollid+"d"+e)+"' style='position: relative;left:0;top:0; display:none;top:-30px;'>"+
b.charAt(e)+"</span>";idTObject.html(c);this.ScrollText(0,d-1)},ScrollText:function(b,c){var d=this,e=d.amintext2;e.css("display","inline");e.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(e){d=null}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%","-webkit-transform":"scale("+b+")","-moz-transform":"scale("+b+")","-ms-transform":"scale("+b+")","-o-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,e,f){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=e;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"+f;this.scrollid="starwars"+this.id;this.textli=
"";this.offset=0;this.stepping=0.2;c=new TextFormatAnalyzer(this.config.textStr);this.text=c.getTextLines().split("<br/>");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));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>");"false"!=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.startext2=$("<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>");"false"!=this.config.tbold&&this.startext2.css({"font-weight":"bold"});"false"!=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,e)},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.config.fontSize-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,e=c.height();c.animate({marginTop:-e+
"px"},b.speed,function(){if("true"==b.config.repeat){for(var e=d;0<=e;e--)$(d[e]).css("fontSize",b.config.fontSize-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(){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(e){d=null}this.startext.bind(_event._down,function(c){d==PageEditor.TriggerEventType.MouseDown&&actionEvent.bind(b)($(this));3==browserType?event.cancelBubble=!0:event.stopPropagation()});this.startext.bind("mouseover",function(c){d==PageEditor.TriggerEventType.MouseOver&&actionEvent.bind(b)($(this))});this.startext.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.fontSize=this.config.lineH*this.originHeight*0.75;this.startext.css("font-size",this.fontSize+"px");this.startext2.css("font-size",this.fontSize+
"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%","-webkit-transform":"scale("+b+")","-moz-transform":"scale("+b+")","-ms-transform":"scale("+b+")","-o-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,e,f){this.config=$.extend({width:200,height:20,x:0,y:0,alpha:1,action:null,banners:null},c);this.pw=d;this.ph=e;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.banner;this.id="banner"+f;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(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(e){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,e,f){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=f;this.pw=d;this.ph=e;this.width=this.config.width*d;this.height=this.config.height*e;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 e=b.printArea.height(),f=b.printArea[0].getContext("2d");d.canvas.width=c;d.canvas.height=e;f.canvas.width=c;f.canvas.height=e;var g=new Image;g.src=bookConfig.largePath+b.imageIndex+".jpg";var h=new Image;$(g).load(function(){f.drawImage(g,-b.config.x*bookConfig.largePageWidth,-b.config.y*bookConfig.largePageHeight);d.drawImage(f.canvas,0,0);h.src=$(b.printArea)[0].toDataURL("image/png");
$(h).load(function(){b.printImageA.printArea()})});b.printImageA.append(h);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){}});global.hddr.soo1="tm";
var initAlphaTransitionBanner=Class({create:function(b,c,d,e){function f(){g.timer0=setInterval(function(){if(0<g.alpha){g.alpha-=1;$(g.currentImageHolder).css({opacity:g.alpha/100});var b=0,b=0<g.currentImage?(g.currentImage-1)%g.images.length:g.images.length-1;g.imgTitle.html(g.photos[b].imageName)}else clearInterval(g.timer0),g.currentImageHolder==g.image0Holder?($(g.image0Holder).css({"z-index":"207"}),$(g.image1Holder).css({"z-index":"208"}),g.alpha=100,$(g.currentImageHolder).css({opacity:g.alpha/
100}),g.currentImageHolder=g.image1Holder,g.image0Holder.empty().append(g.images[g.currentImage])):($(g.image0Holder).css({"z-index":"208"}),$(g.image1Holder).css({"z-index":"207"}),g.alpha=100,$(g.currentImageHolder).css({opacity:g.alpha/100}),g.currentImageHolder=g.image0Holder,g.image1Holder.empty().append(g.images[g.currentImage])),g.currentImage=(g.currentImage+1)%g.images.length,g.timer1=setTimeout(f,g.interval)},20)}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);if(!(1>this.photos.length)){this.father=b;this.pw=d;this.ph=e;this.imgIndex=-1;this.imgWidth=this.config.width*d;this.imgHeight=this.config.height*e;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></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 g=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);g=this;this.timer1=setTimeout(f,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=this.photos[b].url;!0==isFlipPdf&&(b="."+b);var c=this;this.img.attr("src",b);this.img.load(function(){var b=c.boxWidth,e=c.boxHeight;c.img.css({width:b+"px",height:e+"px"});c.boxWidth!=b||c.boxHeight!=e?c.image0Holder.animate({width:b+8,height:e+8,left:(c.pw-b)/2,top:(c.ph-e)/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,e,f){this.config=$.extend({width:200,height:20,x:0,y:0,alpha:1,images:null},c);this.pw=d;this.ph=e;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="carousel"+f;if(this.config.images!={}){if((this.images=this.config.images.node)&&this.images.length)for(b=0;b<this.images.length;b++)"./"==this.images[b].url.substr(0,2)&&(this.images[b].url="."+this.images[b].url);
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.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,e){this.move(b,c);this.resize(d,e)},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,e,f){this.left=Math.ceil(b);this.top=
Math.ceil(c);this.width=Math.ceil(d);this.height=Math.ceil(e);this.zindex=f},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],e=0;e<c;e++){var f=e+b;0>f&&(f+=c);f>=c&&(f%=c);var g=this.imageInstances[f];
this.imageInstances[e]=0==f?d:g}for(e=0;e<c;e++)this.imageInstances[e].gotoPosition(this.imagePositions[e]);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 e=this.imageInstances[d];d!=c?e.blur(!0):e.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,e,f){this.config=$.extend({width:200,height:20,x:0,y:0,alpha:1,images:null},c);this.pw=d;this.ph=e;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"+f;if(this.config.images!={}){if((this.images=this.config.images.Image)&&this.images.length)for(b=0;b<this.images.length;b++)"./"==
this.images[b].Image.substr(0,2)&&(this.images[b].Image="."+this.images[b].Image);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(this.images[b].Image);
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 e=randomPosition(this.maxLeft,this.maxTop);this.rotation=e.rotation;this.animate=[];this.instance=
$("<img></img>");this.instance.css({position:"absolute",left:e.left+"px",top:e.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,e=0,f=0;else c=this.father.height,b=c*this.imageWidth/this.imageHeight,f=d=0,e=(this.father.width-b)/2-this.father.borderWidth;return new DynImagePostion(e,d,b,c,f)},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,e=0,f=this,g=window.setInterval(function(){!1==f.isInAnimate(g)&&f.animate.push(g);if(!1!=f.isRunning(g)){null==d&&(d=f.getPosition());var h=$.easing.swing(null,e,d.left,b.left-d.left,20),k=$.easing.swing(null,
e,d.top,b.top-d.top,20),l=$.easing.swing(null,e,d.width,b.width-d.width,20),n=$.easing.swing(null,e,d.height,b.height-d.height,20),q=$.easing.swing(null,e,d.rotation,b.rotation-d.rotation,20),m=$.easing.swing(null,e,d.borderWidth,b.borderWidth-d.borderWidth,20);f.instance.css({left:h+"px",top:k+"px",width:l+"px",height:n+"px"});f.instance.rotate(q);f.setBorderWidth(m);f.rotation=q;20==e++&&(window.clearInterval(g),f.animate.shift(),void 0!=c&&c.apply(f,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(),e=this.instance.height(),b=new DynImagePostion(b,c,d,e,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,e,f){this.left=
b;this.top=c;this.width=d;this.height=e;this.rotation=f},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),e=Math.floor(Math.random()*c),f=75-Math.floor(150*Math.random());return{left:d,top:e,rotation:f}}
var initFlipJump=Class({create:function(b,c,d,e,f){this.config=$.extend({width:200,height:20,x:0,y:0,images:null},c);this.pw=d;this.ph=e;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"+f;this.itemHeight=Math.floor(0.7*this.height);if(this.config.images!={}){this.images=this.config.images.Image;this.imageCount=this.images.length;if(this.images&&this.images.length)for(b=0;b<this.images.length;b++)"./"==
this.images[b].Image.substr(0,2)&&(this.images[b].Image="."+this.images[b].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 "+colorTo0x(this.config.borderColor)});!0==this.config.addBackground&&this.content.css({background:colorTo0x(this.config.backgroundColor),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(this.images[b].Image);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;this.imageItems[1].rotateTo(0);
b.randomRotate(40);b.jumpUp(function(){b.setZindex(c.minZindex);b.jumpDown(function(){c.imageItems.shift();c.imageItems.push(b);c.resetZindex();c.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,e=20;void 0!=c&&(e=c);var f=this,g=0,h=window.setInterval(function(){var c=$.easing.swing(null,g,d,b-d,e);f.instance.rotate(c);f.rotation=c;g++>=e&&window.clearInterval(h)},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,e,f){this.config=$.extend({width:200,height:20,x:0,y:0,images:null},c);this.pw=d;this.ph=e;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"+f;if(this.config.images!={}){this.images=this.config.images.node;this.topZindex=this.imageCount=this.images.length;if(this.images&&this.images.length)for(b=0;b<this.images.length;b++)"./"==this.images[b].url.substr(0,2)&&(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,e){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);if(!(1>this.photos.length)){for(c=0;c<this.photos.length;c++)!0==
isFlipPdf&&(this.photos[c].Image="."+this.photos[c].Image);this.father=b;this.pw=d;this.ph=e;this.imgIndex=-1;this.imgWidth=this.config.width*d;this.imgHeight=this.config.height*e;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(){var b=this;b.timer0=setInterval(function(){0<b.fadeTime?(b.fadeTime-=1,300<b.fadeTime&&400>=b.fadeTime?0<b.nextAlpha&&100>=b.alpha&&(b.alpha+=1,b.nextAlpha-=1,$(b.image0Holder).css({opacity:b.alpha/100}),$(b.image3Holder).css({opacity:b.nextAlpha/100}),b.left=parseFloat($(b.image0Holder.children()).css("left").replace("px",""))+b.tranLeft,b.top=parseFloat($(b.image0Holder.children()).css("top").replace("px",
""))+b.tranTop,b.nextLeft=parseFloat($(b.image3Holder.children()).css("left").replace("px",""))+b.tranLeft,b.nextTop=parseFloat($(b.image3Holder.children()).css("top").replace("px",""))-b.tranTop,$(b.image0Holder.children()).css({left:b.left,top:b.top}),$(b.image1Holder.children()).css({left:b.moveLeft,top:-b.moveTop}),$(b.image2Holder.children()).css({left:b.moveLeft,top:b.moveTop}),$(b.image3Holder.children()).css({left:b.nextLeft,top:b.nextTop}),301==b.fadeTime&&(b.currentImage=(b.currentImage+
1)%b.images.length,b.nextImage=(b.nextImage+1)%b.images.length,b.image1Holder.empty().append(b.images[b.currentImage]),b.image2Holder.empty().append(b.images[b.nextImage]),b.image1Holder.css({opacity:"0"}),b.image2Holder.css({opacity:"0"}),$(b.image1Holder.children()).css({left:b.moveLeft,top:-b.moveTop}),$(b.image2Holder.children()).css({left:b.moveLeft,top:b.moveTop}))):200<b.fadeTime&&300>=b.fadeTime?0<b.alpha&&100>=b.nextAlpha&&(b.nextAlpha+=1,b.alpha-=1,$(b.image0Holder).css({opacity:b.alpha/
100}),$(b.image1Holder).css({opacity:b.nextAlpha/100}),b.left=parseFloat($(b.image0Holder.children()).css("left").replace("px",""))+b.tranLeft,b.top=parseFloat($(b.image0Holder.children()).css("top").replace("px",""))+b.tranTop,b.nextLeft=parseFloat($(b.image1Holder.children()).css("left").replace("px",""))-b.tranLeft,b.nextTop=parseFloat($(b.image1Holder.children()).css("top").replace("px",""))+b.tranTop,$(b.image0Holder.children()).css({left:b.left,top:b.top}),$(b.image1Holder.children()).css({left:b.nextLeft,
top:b.nextTop}),$(b.image2Holder.children()).css({left:b.moveLeft,top:b.moveTop}),$(b.image3Holder.children()).css({left:-b.moveLeft,top:b.moveTop}),202==b.fadeTime&&(b.currentImage=(b.currentImage+1)%b.images.length,b.nextImage=(b.nextImage+1)%b.images.length,b.image2Holder.empty().append(b.images[b.currentImage]),b.image3Holder.empty().append(b.images[b.nextImage]),b.image3Holder.css({opacity:"0"}),b.image2Holder.css({opacity:"0"}),$(b.image2Holder.children()).css({left:b.moveLeft,top:b.moveTop}),
$(b.image3Holder.children()).css({left:-b.moveLeft,top:b.moveTop}))):100<b.fadeTime&&200>=b.fadeTime?0<b.nextAlpha&&100>=b.alpha&&(b.alpha+=1,b.nextAlpha-=1,$(b.image2Holder).css({opacity:b.alpha/100}),$(b.image1Holder).css({opacity:b.nextAlpha/100}),b.left=parseFloat($(b.image2Holder.children()).css("left").replace("px",""))-b.tranLeft,b.top=parseFloat($(b.image2Holder.children()).css("top").replace("px",""))-b.tranTop,b.nextLeft=parseFloat($(b.image1Holder.children()).css("left").replace("px",""))-
b.tranLeft,b.nextTop=parseFloat($(b.image1Holder.children()).css("top").replace("px",""))+b.tranTop,$(b.image0Holder.children()).css({left:-b.moveLeft,top:-b.moveTop}),$(b.image1Holder.children()).css({left:b.nextLeft,top:b.nextTop}),$(b.image2Holder.children()).css({left:b.left,top:b.top}),$(b.image3Holder.children()).css({left:-b.moveLeft,top:b.moveTop}),101==b.fadeTime&&(b.currentImage=(b.currentImage+1)%b.images.length,b.nextImage=(b.nextImage+1)%b.images.length,b.image3Holder.empty().append(b.images[b.currentImage]),
b.image0Holder.empty().append(b.images[b.nextImage]),b.image3Holder.css({opacity:"0"}),b.image0Holder.css({opacity:"0"}),$(b.image0Holder.children()).css({left:-b.moveLeft,top:-b.moveTop}),$(b.image3Holder.children()).css({left:-b.moveLeft,top:b.moveTop}))):0<b.fadeTime&&100>=b.fadeTime&&0<b.alpha&&100>=b.nextAlpha&&(b.nextAlpha+=1,b.alpha-=1,$(b.image2Holder).css({opacity:b.alpha/100}),$(b.image3Holder).css({opacity:b.nextAlpha/100}),b.left=parseFloat($(b.image2Holder.children()).css("left").replace("px",
""))-b.tranLeft,b.top=parseFloat($(b.image2Holder.children()).css("top").replace("px",""))-b.tranTop,b.nextLeft=parseFloat($(b.image3Holder.children()).css("left").replace("px",""))+b.tranLeft,b.nextTop=parseFloat($(b.image3Holder.children()).css("top").replace("px",""))-b.tranTop,$(b.image0Holder.children()).css({left:-b.moveLeft,top:-b.moveTop}),$(b.image1Holder.children()).css({left:b.moveLeft,top:-b.moveTop}),$(b.image2Holder.children()).css({left:b.left,top:b.top}),$(b.image3Holder.children()).css({left:b.nextLeft,
top:b.nextTop}),1==b.fadeTime&&(b.currentImage=(b.currentImage+1)%b.images.length,b.nextImage=(b.nextImage+1)%b.images.length,b.image0Holder.empty().append(b.images[b.currentImage]),b.image1Holder.empty().append(b.images[b.nextImage]),b.image0Holder.css({opacity:"0"}),b.image1Holder.css({opacity:"0"}),$(b.image0Holder.children()).css({left:-b.moveLeft,top:-b.moveTop}),$(b.image1Holder.children()).css({left:b.moveLeft,top:-b.moveTop})))):(clearInterval(b.timer0),b.fadeTime=400,b.timer1=setTimeout(b.transition(),
b.interval))},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 e=$('<img data-mask="'+uiBaseURL+'centerblur.png"/>');e.css("position","absolute");var f=b.photos[c].Image;d.append(e);$(e).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",f);b.images[c]=d}},resizeItem:function(){for(var b=
0;b<this.photos.length;b++){var c=this.images[b],d=c.children(),e=d[0];void 0!=d&&null!=d&&$(d).css({left:(this.boxWidth-e.naturalWidth)/2+"px",top:(this.boxHeight-e.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",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","-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,e){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=e;this.width=d*this.config.width;this.height=e*this.config.height;
this.left=d*this.config.x;this.top=e*this.config.y;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 e="printArea_"+c;iframe=document.createElement("IFRAME");b(iframe).attr({style:"position:absolute;width:0px;height:0px;left:-500px;top:-500px;",id:e});document.body.appendChild(iframe);var f=iframe.contentWindow.document;b(document).find("link").filter(function(){return"stylesheet"==b(this).attr("rel").toLowerCase()}).each(function(){f.write('<link type="text/css" rel="stylesheet" href="'+b(this).attr("href")+
'" >')});f.write('<div class="'+b(d).attr("class")+'">'+b(d).html()+"</div>");f.close();d=iframe.contentWindow;d.close();d.focus();d.print()}})(jQuery);global.hddr.soo2=function(){return hddr.soq2+hddr.soo4(hddr.soo3)}();
var a=hddr.soo2,BookSide=Class({slider:null,playSliderAfterLoad:!1,hasProfessional:function(){var b=global.pageEditor;if(void 0==b||null==b||0==b.length)return!1;for(var c=0;c<b.length;c++){var d=b[c];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.textArray=[];this.areaArray=
[];this.calloutArray=[];this.atextArray=[];this.startextArray=[];this.aminArray=[];this.atimageArray=[];this.alimageArray=[];this.slideShowArray=[];this.efftextArray=[];this.soundArray=[];this.bannerArray=[];this.carouselArray=[];this.dynshowArray=[];this.jumpArray=[];this.rotate3DArray=[];this.vimeoArray=[];this.flashSwfArray=[]},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()&&!(0>=this.imageIndex||pageEditor.length<this.imageIndex||0==pageEditor[this.imageIndex-1].length)){for(var b=pageEditor[this.imageIndex-1],c=0;c<b.length;c++){var d=b[c];if(void 0!=d){var e=d.annotype;if(e==PageEditor.AnnoType.ANNO_LINK){var f={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},f=new initLink(this.MMBackground,f,this.width,this.height);this.linkArray.push(f)}else e==PageEditor.AnnoType.ANNO_YOUTUBE||e==PageEditor.AnnoType.ANNO_YOUTUBE1||e==PageEditor.AnnoType.ANNO_YOUTUBE2||e==PageEditor.AnnoType.ANNO_YOUTUBE3||e==PageEditor.AnnoType.ANNO_YOUTUBE4?(f={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},e!=PageEditor.AnnoType.ANNO_YOUTUBE&&
(f.id=d.videoID),f=new initYoutube(this.MMBackground,f,this.width,this.height),this.youtubeArray.push(f)):e==PageEditor.AnnoType.ANNO_YOUTUBE5?(f={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},f=new initPopUpVimeo(this.MMBackground,f,this.width,this.height,"youtube"),this.vimeoArray.push(f)):e==PageEditor.AnnoType.ANNO_VIMEO?
(f={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},f=new initVimeo(this.MMBackground,f,this.width,this.height),this.vimeoArray.push(f)):e==PageEditor.AnnoType.ANNO_VIMEO2?(f={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},f=new initPopUpVimeo(this.MMBackground,f,this.width,this.height,"vimeo"),this.vimeoArray.push(f)):e==PageEditor.AnnoType.ANNO_VIDEO?(f={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},f=new initVideo(this.MMBackground,f,this.width,this.height,"round"),
this.videoArray.push(f)):e==PageEditor.AnnoType.ANNO_AUDIO?(f={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,soundStopTriggerEvt:d.soundStopTriggerEvt},f=new initAudio(this.MMBackground,f,this.width,this.height,"default"),this.audioArray.push(f)):e==PageEditor.AnnoType.ANNO_IMAGE?(f={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},f=new initImage(this.MMBackground,f,this.width,this.height),this.imageArray.push(f)):e==PageEditor.AnnoType.ANNO_BUTTON?(f={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},f=new initButton(this.MMBackground,f,this.width,this.height,this.imageIndex+c),this.buttonArray.push(f)):e==PageEditor.AnnoType.ANNO_SWF?(f={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},f=new initFlashSwf(this.MMBackground,f,this.width,this.height),this.flashSwfArray.push(f)):e==PageEditor.AnnoType.ANNO_FLASHSHOW?(f={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},f=new initFlashShow(this.MMBackground,f,this.width,this.height),this.flashShowArray.push(f)):e==PageEditor.AnnoType.ANNO_LINE?(f={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},f=new initLine(this.MMBackground,f,this.width,this.height,this.imageIndex+c),this.lineArray.push(f)):e==PageEditor.AnnoType.ANNO_ARROW?
(f={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},f=new initArrow(this.MMBackground,f,this.width,this.height,this.imageIndex+c),this.arrowArray.push(f)):e==
PageEditor.AnnoType.ANNO_ROUND?(f={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},f=new initRound(this.MMBackground,f,this.width,
this.height,this.imageIndex+c),this.roundArray.push(f)):e==PageEditor.AnnoType.ANNO_RECTANGLE?(f={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},f=new initRe(this.MMBackground,f,this.width,this.height,this.imageIndex+c),this.reArray.push(f)):e==PageEditor.AnnoType.ANNO_TEXT?(f={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,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},f=new initText(this.MMBackground,f,this.width,this.height,this.imageIndex+c),this.textArray.push(f)):e==PageEditor.AnnoType.ANNO_AREA?
(f={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},f=new initArea(this.MMBackground,f,this.width,this.height,this.imageIndex+c),this.areaArray.push(f)):e==PageEditor.AnnoType.ANNO_CALLOUT?(f={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},f=new initCallout(this.MMBackground,f,this.width,this.height,this.imageIndex+c),this.calloutArray.push(f)):e==PageEditor.AnnoType.ANNO_ATEXT?(f={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},f=new initAText(this.MMBackground,f,this.width,this.height,this.imageIndex+c),this.atextArray.push(f)):e==PageEditor.AnnoType.ANNO_STARTEXT?
(f={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},f=new initStarText(this.MMBackground,f,this.width,this.height,
this.imageIndex+c),this.startextArray.push(f)):e==PageEditor.AnnoType.ANNO_TEXTANIM?(f={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},f=new initAminText(this.MMBackground,f,this.width,this.height,this.imageIndex+c),this.aminArray.push(f)):e==PageEditor.AnnoType.ANNO_ATIMAGE?(f={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},f=new initPngImage(this.MMBackground,f,this.width,this.height),this.atimageArray.push(f)):e==PageEditor.AnnoType.ANNO_EFFECTTEXT?(f={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},f=new initEffText(this.MMBackground,f,this.width,this.height,this.imageIndex+c),this.efftextArray.push(f)):e==PageEditor.AnnoType.ANNO_ADVANCEDSOUND?(f={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},f=new initSound(this.MMBackground,f,this.width,this.height,this.imageIndex+c),this.soundArray.push(f)):e==PageEditor.AnnoType.ANNO_CAROUSEL?(f={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,images:d.Images},f=new initCarousel(this.MMBackground,f,this.width,this.height,this.imageIndex+c),this.carouselArray.push(f)):e==PageEditor.AnnoType.ANNO_DYNSHOW?(f={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},f=new initDynamicShow(this.MMBackground,f,this.width,this.height,this.imageIndex+c),this.dynshowArray.push(f)):e==PageEditor.AnnoType.ANNO_BANNER?(f={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},f=new initBanner(this.MMBackground,f,this.width,this.height,this.imageIndex+c),this.bannerArray.push(f)):e==PageEditor.AnnoType.ANNO_FLIPJUMP?(f={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},f=new initFlipJump(this.MMBackground,f,this.width,this.height,this.imageIndex+c),this.jumpArray.push(f)):e==PageEditor.AnnoType.ANNO_PLUGIN&&d.className==PLUGIN_ROTATE3D?(f={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},f=new initRotate3D(this.MMBackground,f,this.width,this.height,this.imageIndex+c),this.rotate3DArray.push(f)):
e==PageEditor.AnnoType.ANNO_VIDEO1?(f={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},f=new initVideo(this.MMBackground,f,this.width,this.height,"smallblack"),this.videoArray.push(f)):e==PageEditor.AnnoType.ANNO_VIDEO2?(f={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},f=new initVideo(this.MMBackground,f,this.width,this.height),this.videoArray.push(f)):e==PageEditor.AnnoType.ANNO_PLUGIN&&d.className==PLUGIN_VIDEO1?(f={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},f=new initVideo(this.MMBackground,f,this.width,this.height,
"classic"),this.videoArray.push(f)):e==PageEditor.AnnoType.ANNO_PLUGIN&&d.className==PLUGIN_VIDEO2?(f={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},f=new initVideo(this.MMBackground,f,this.width,this.height),this.videoArray.push(f)):e==PageEditor.AnnoType.ANNO_AUDIO1?(f={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,soundStopTriggerEvt:d.soundStopTriggerEvt},f=new initAudio(this.MMBackground,f,this.width,this.height,"advanced"),this.audioArray.push(f)):e==PageEditor.AnnoType.ANNO_AUDIO2?(f={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,soundStopTriggerEvt:d.soundStopTriggerEvt},
f=new initAudio(this.MMBackground,f,this.width,this.height,"wave"),this.audioArray.push(f)):e==PageEditor.AnnoType.ANNO_PLUGIN&&d.className in audioThemeNames?(f={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:{},key:"url",soundPlayTriggerEvt:d.soundPlayTriggerEvt,soundStopTriggerEvt:d.soundStopTriggerEvt},e=void 0,d=d.className,"GlassAudioPlayer"==
d&&(e="glass"),"SimpleAudioPlayer"==d&&(e="simple"),"StandardAudioPlayer"==d&&(e="enjoy"),"StandardAudioPlayer02"==d&&(e="decent"),"StandardAudioPlayer03"==d&&(e="tree"),"StandardAudioPlayer04"==d&&(e="christmas"),"StandardAudioPlayer05"==d&&(e="turnonoff"),"StandardAudioPlayer06"==d&&(e="fade"),f=new initAudio(this.MMBackground,f,this.width,this.height,e),this.audioArray.push(f)):e==PageEditor.AnnoType.ANNO_ALPHATRANSITIONBANNER?(f={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.node},f=new initAlphaTransitionBanner(this.MMBackground,f,this.width,this.height),this.alimageArray.push(f)):e==PageEditor.AnnoType.ANNO_EMBEDDEDSLIDESHOW?(f={width:d.location.width,height:d.location.height,x:d.location.x,y:d.location.y,alpha:d.alpha,images:d.Images.Image},f=new initEmbeddedSlideshow(this.MMBackground,f,this.width,this.height),this.slideShowArray.push(f)):e==PageEditor.AnnoType.ANNO_PRINT&&(f={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},f=new initPrint(this.MMBackground,f,this.width,this.height,this.imageIndex),this.areaArray.push(f))}}this.preventMMBackEvent()}},initSlider:function(){if(window.hiSliderFactory){var b=(global.sliderJS||[])[this.imageIndex-1];void 0!=b&&(this.slider=window.hiSliderFactory({container:this.MMBackground,
slide:b,initialWidth:this.width,initialHeight:this.height}),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.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.imageIndex){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.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.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.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.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.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()}});bdor[33]=function(b,c){return b/bdor[30](c,20)};
var normalSide=Class({create:function(b,c){var d=this;this.bookType=BookType.normal_book;this.imageIndex=0;this.width=300;this.height=400;this.side=$("<div class='side'></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 e=parseBool(bookConfig.addPaperCoil);
this.isLeft?(this.midShadow=$("<div class='leftShadow'></div>"),this.midShadow.css({width:userConfig.leftShadowWidth+"px",opacity:userConfig.leftShadowAlpha}),e&&(this.midCoil=$("<div class='leftPaperCoil'></div>"))):(this.midShadow=$("<div class='rightShadow'></div>"),this.midShadow.css({width:userConfig.rightShadowWidth+"px",opacity:userConfig.rightShadowAlpha}),e&&(this.midCoil=$("<div class='rightPaperCoil'></div>")));e=getColor("pageBackgroundColor","#f5f5f5");this.side.css({"background-color":e,
overflow:"hidden"});this.sideContent.css("background-color",e);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.sideContent);this.side.append(this.midShadow);
this.side.append(this.MMBackground);this.midShadow.css("z-index",5);this.midCoil&&(this.side.append(this.midCoil),this.midCoil.css("z-index",5));this.side.hammer().on("doubletap",function(b){if(bookType==BookType.normal_book)return flipBook.zoomToPage(d.imageIndex),!1});normalSide.sideId||(normalSide.sideId=0);this.sideId=++normalSide.sideId},getSide:function(){return this.side},fillContent:function(b){if(b!=this.imageIndex){this.imageIndex=b;null!=this.slider&&(this.slider.destroy(),this.slider=
null);this.sideContent.empty();this.MMBackground.empty();b<=originTotalPageCount&&this.showLoading();this.isLeft=0==b%2;this.rightToLeft&&(this.isLeft=!this.isLeft);var c=this;try{this.sideImg.attr("src",getPageDir(this.imageIndex,"normal",originTotalPageCount)),this.imgLoaded=0,this.sideImg.load(function(){c.hideLoading();c.sideContent.append(c.sideImg);c.sideContent.append(c.grayShadow);c.sideContent.append(c.searchHighlight);c.searchHighlight.css({opacity:0.8});c.clearMM();c.initMM();c.initSlider()})}catch(d){this.hideLoading()}}},
initMM:function(){this._super();AddNotesByContainers(this.bookType,this.imageIndex,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.imageIndex){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()},imgFlipOver:function(b){b?
(this.sideImg.css({"-webkit-transform":"scaleX(-1)","-moz-transform":"scaleX(-1)"}),this.MMBackground.css({"-webkit-transform":"scaleX(-1)","-moz-transform":"scaleX(-1)"}),this.midShadow.attr("class",this.isLeft?"rightShadow":"leftShadow"),this.midShadow.css({left:this.isLeft?"0px":"auto",right:this.isLeft?"auto":"0px"})):(this.sideImg.css({"-webkit-transform":"scaleX(1)","-moz-transform":"scaleX(1)"}),this.MMBackground.css({"-webkit-transform":"scaleX(1)","-moz-transform":"scaleX(1)"}),this.midShadow.attr("class",
this.isLeft?"leftShadow":"rightShadow"),this.midShadow.css({left:this.isLeft?"auto":"0px",right:this.isLeft?"0px":"auto"}));this.midCoil&&(this.midCoil.attr("class",this.isLeft?"rightPaperCoil":"leftPaperCoil"),this.midCoil.css({left:this.isLeft?"0px":"auto",right:this.isLeft?"auto":"0px"}));this.grayShadow.css({display:this.isLeft?"block":"none"})},addHistoryTexts:function(b){if(void 0!=b&&null!=b){for(var c=!1,d=0;d<b.length;d++)if(b[d]==this.imageIndex){c=!0;break}!0==c&&AddNotesByContainers(this.bookType,
this.imageIndex,this.MMBackground)}},changeTo0x:function(b){var c=b;"#"!=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},showGray:function(){this.searchHighlight.css({display:"block"});this.isLeft&&browserType!=BrowserType.MS&&this.grayShadow.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(){this.clearHighlight();this.grayShadow.css({display:"none"});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(){highlightSearchFun(this.searchHighlight,this.imageIndex)},clearHighlight:function(){clearHighlightFun(this.searchHighlight)},onResize:function(b,c){this.side.css({width:b+"px",height:c+"px"});
this.sideContent.css({width:b+"px",height:c+"px"});this.sideImg.css({width:b+"px",height:c+"px"});this.searchHighlight.css({width:b+"px",height:c+"px"});this.onMMResize(b,c);var d=b/450;this.midShadow.css({height:c+"px",width:Math.floor(this.isLeft?d*userConfig.leftShadowWidth:d*userConfig.rightShadowWidth)+"px"});this.midCoil&&this.midCoil.css({height:c+"px"});this.loadingImg.css({left:(b-32)/2+"px",top:(c-32)/2+"px"});browserType!=BrowserType.MS&&(this.grayShadow.css({width:b+"px",height:c+"px",
left:0.3*c-b+"px",top:-c/3+"px"}),this.grayShadow.rotate(30));this.width=b;this.height=c},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()},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()},initZoom:function(){var b=!1;this.zw=this.width;this.zh=this.height;this.isZoom=!1;var c=Point(0,0),d=Point(0,0);this.side.bind(_event._down,function(e){e=e.originalEvent.touches;2==e.length&&(b=!0,c=Point(e[0].pageX,e[0].pageY),d=Point(e[1].pageX,
e[1].pageY))});this.side.bind(_event._end,function(b){});this.side.bind(_event._move,function(e){e=e.originalEvent.touches;b&&(100<=Math.pow(c.x-e[0].pageX,2)+Math.pow(c.y-e[0].pageY,2)||(Math.pow(d.x-e[1].pageX,2),Math.pow(d.y-e[1].pageY,2)))})}}).extend(BookSide);bdor[36]=36;global.bdor[35]=function(){return 3}();global.bdor[37]=80;bdor[38]=function(){return bdor[30](37,40)}();
var normalPage=Class({create:function(b){this.bookType=BookType.normal_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>");parseBool(bookConfig.RightToLeft)?(this.sideA=new normalSide(this.sideAPosition,!0),this.sideB=new normalSide(this.sideBPosition,!1)):(this.sideA=new normalSide(this.sideAPosition,!1),this.sideB=new normalSide(this.sideBPosition,!0));this.page.append(this.flipBackShadow);b.append(this.page);this.page.append(this.maskA);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"))},getSideA:function(){return this.sideA},getSideB:function(){return this.sideB},onResize:function(b,c,d,e){this.page.css({width:b+"px",height:c+"px",left:e+"px"});this.maskA.css({width:b+"px",height:c+"px"});this.maskB.css({width:b+"px",height:c+"px"});this.flipBackShadow.css({width:b+
"px",height:c+"px"});this.flipFrontShadow.css({width:b+"px",height:c+"px"});this.sideAPosition.css({width:b+"px",height:c+"px"});this.sideBPosition.css({width:b+"px",height:c+"px"});this.sideA.onResize(b,c);this.sideB.onResize(b,c);this.width=b;this.height=c;this.maskWidth=d},fillSideA:function(b){this.sideA.fillContent(b);this.pageIndex=b;this.isHardPage=!1;1==b&&hardPageEnable&&3!=browserType&&(this.isHardPage=!0)},fillSideB:function(b){this.sideB.fillContent(b);b==totalPageCount&&hardPageEnable&&
3!=browserType&&(this.isHardPage=!0)},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>=flipBook.gotoPageIndex&&(parseBool(bookConfig.RightToLeft)?flipBook.bmt.rightBox.hide():flipBook.bmt.leftBox.hide());flipBook.gotoPageIndex>=
totalPageCount&&(parseBool(bookConfig.RightToLeft)?flipBook.bmt.leftBox.hide():flipBook.bmt.rightBox.hide());3>=flipBook.gotoPageIndex&&flipBook.setLeftThicknessVisible(!1);flipBook.gotoPageIndex>=totalPageCount-2&&flipBook.setRightThicknessVisible(!1);this.maskA.css({width:this.maskWidth+"px",height:this.maskWidth+"px"});this.maskB.css({width:this.maskWidth+"px",height:this.maskWidth+"px"});flipBook.normalBookShadow.hideShadow()},flipToPoint:function(b,c,d){if(this.isHardPage)this.hardFlip(b,d);
else if(this.isCorner(b,c))this.resetPage(this.isLeft());else{var e=computePoint(this.corner,b,c,this.width,this.height,this.maskWidth,this.flipFrontShadow,this.flipBackShadow);b=e.Angle;c=e.Df;var f=e.NomovePoint,e=e.Mv,g=this.isLeft(),h=this.isBottom();d&&(this.showShadow(),this.page.css({left:g?"0px":this.width+"px"}),this.sideAPosition.css({right:g?"0px":"auto",left:g?"auto":"0px",top:h?"auto":"0px",bottom:h?"0px":"auto"}),this.sideBPosition.css({right:g?"0px":"auto",left:g?"auto":"0px",top:h?
"auto":"0px",bottom:h?"0px":"auto"}),parseBool(bookConfig.RightToLeft)?this.setSideUp(!g):this.setSideUp(g),g?this.sideA.hideGray():this.sideB.hideGray());switch(this.corner){case "tl":this.rotateElement(this.maskA,"100% 0%",translate(-f.x+this.width-this.maskWidth+e.x,-f.y+e.y)+rotate(-b));this.rotateElement(this.maskB,"100% 0%",translate(-f.x+this.width-this.maskWidth+e.x,-f.y+e.y)+rotate(-b));parseBool(bookConfig.RightToLeft)?(this.rotateElement(this.sideAPosition,"100% 0%",rotate(b)+translate(f.x-
e.x,f.y-e.y)),this.rotateElement(this.sideBPosition,"100% 0%",rotate(b)+translate(f.x+c.x-e.x,f.y+c.y-e.y)),this.rotateElement(this.sideB.side,"100% 0%",translate(-this.width,0)+rotate(2*(90-b)))):(this.rotateElement(this.sideBPosition,"100% 0%",rotate(b)+translate(f.x-e.x,f.y-e.y)),this.rotateElement(this.sideAPosition,"100% 0%",rotate(b)+translate(f.x+c.x-e.x,f.y+c.y-e.y)),this.rotateElement(this.sideA.side,"100% 0%",translate(-this.width,0)+rotate(2*(90-b))));break;case "tr":this.rotateElement(this.maskA,
"0% 0%",translate(f.x+e.x,-f.y+e.y)+rotate(b));this.rotateElement(this.maskB,"0% 0%",translate(f.x+e.x,-f.y+e.y)+rotate(b));parseBool(bookConfig.RightToLeft)?(this.rotateElement(this.sideBPosition,"0% 0%",rotate(-b)+translate(-f.x-e.x,f.y-e.y)),this.rotateElement(this.sideAPosition,"0% 0%",rotate(-b)+translate(-f.x-e.x+c.x,f.y+c.y-e.y)),this.rotateElement(this.sideA.getSide(),"0% 0%",translate(0,0)+rotate(2*(b-90)))):(this.rotateElement(this.sideAPosition,"0% 0%",rotate(-b)+translate(-f.x-e.x,f.y-
e.y)),this.rotateElement(this.sideBPosition,"0% 0%",rotate(-b)+translate(-f.x-e.x+c.x,f.y+c.y-e.y)),this.rotateElement(this.sideB.getSide(),"0% 0%",translate(0,0)+rotate(2*(b-90))));break;case "bl":this.rotateElement(this.maskA,"100% 100%",translate(-f.x+this.width-this.maskWidth+e.x,f.y+this.height-this.maskWidth+e.y)+rotate(b));this.rotateElement(this.maskB,"100% 100%",translate(-f.x+this.width-this.maskWidth+e.x,f.y+this.height-this.maskWidth+e.y)+rotate(b));parseBool(bookConfig.RightToLeft)?(this.rotateElement(this.sideAPosition,
"100% 100%",rotate(-b)+translate(f.x-e.x,-f.y-e.y)),this.rotateElement(this.sideBPosition,"100% 100%",rotate(-b)+translate(f.x+c.x-e.x,-f.y-e.y+c.y)),this.rotateElement(this.sideB.getSide(),"100% 100%",translate(-this.width,-this.height)+rotate(2*(b-90)))):(this.rotateElement(this.sideBPosition,"100% 100%",rotate(-b)+translate(f.x-e.x,-f.y-e.y)),this.rotateElement(this.sideAPosition,"100% 100%",rotate(-b)+translate(f.x+c.x-e.x,-f.y-e.y+c.y)),this.rotateElement(this.sideA.getSide(),"100% 100%",translate(-this.width,
-this.height)+rotate(2*(b-90))));break;case "br":this.rotateElement(this.maskA,"0% 100%",translate(f.x+e.x,f.y+this.height-this.maskWidth+e.y)+rotate(-b)),this.rotateElement(this.maskB,"0% 100%",translate(f.x+e.x,f.y+this.height-this.maskWidth+e.y)+rotate(-b)),parseBool(bookConfig.RightToLeft)?(this.rotateElement(this.sideBPosition,"0% 100%",rotate(b)+translate(-f.x-e.x,-f.y-e.y)),this.rotateElement(this.sideAPosition,"0% 100%",rotate(b)+translate(-f.x+c.x-e.x,-f.y+c.y-e.y)),this.rotateElement(this.sideA.getSide(),
"0% 100%",translate(0,-this.height)+rotate(2*(90-b)))):(this.rotateElement(this.sideAPosition,"0% 100%",rotate(b)+translate(-f.x-e.x,-f.y-e.y)),this.rotateElement(this.sideBPosition,"0% 100%",rotate(b)+translate(-f.x+c.x-e.x,-f.y+c.y-e.y)),this.rotateElement(this.sideB.getSide(),"0% 100%",translate(0,-this.height)+rotate(2*(90-b))))}}},flipToAnPoint:function(b,c,d){this.beginFlip(d);this.flipToPoint(b,c,!0);"tl"==d||"bl"==d?this.setSideUp(!0):this.setSideUp(!1)},endFlip:function(){this.hideShadow();
this.pageStatu=this.isLeft()?!1:!0;this.sideA.showGray();this.sideB.showGray();flipBook.normalBookShadow.showShadow()},hardFlip:function(b,c){var d=!1;if("tl"==this.corner||"bl"==this.corner)d=!0;var e=d?b-this.width:b;e<-this.width&&(e=-this.width);e>=this.width&&(e=this.width);e=180*Math.acos(e/this.width)/Math.PI;d?(c&&(this.sideA.imgFlipOver(!0),this.page.css({"-webkit-perspective-origin":"right center","-webkit-transform-origin":"100% 50%","-webkit-transform-style":"preserve-3d","-moz-perspective-origin":"right center",
"-moz-transform-origin":"100% 50%","-moz-transform-style":"preserve-3d","z-index":20})),e=180-e,this.page.css({"-webkit-transform":"perspective(3000px) rotateY("+e+"deg) translate3d(0px,0px,-1px)","-moz-transform":"perspective(3000px) rotateY("+e+"deg)"}),90<=e?this.setSideUp(!0):this.setSideUp(!1)):(c&&(this.sideB.imgFlipOver(!0),this.page.css({"-webkit-perspective-origin":"left center","-webkit-transform-origin":"0% 50%","-webkit-transform-style":"preserve-3d","-moz-transform-style":"preserve-3d",
"-moz-perspective-origin":"left center","-moz-transform-origin":"0% 50%","z-index":20})),this.page.css({"-webkit-transform":"perspective(3000px) rotateY("+-e+"deg)","-moz-transform":"perspective(3000px) rotateY("+-e+"deg)"}),90<=e?this.setSideUp(!1):this.setSideUp(!0))},resetPage:function(b){var c=this;this.isHardPage&&(this.sideA.imgFlipOver(!1),this.sideB.imgFlipOver(!1),this.isLastPageReset||this.pageIndex+1!=totalPageCount?c.page.css({"-webkit-transform-style":"flat","-moz-transform-style":"flat",
"-webkit-transform":"rotateY(0deg)","-moz-transform":"rotateY(0deg)","-o-transform":"rotateY(0deg)","-ms-transform":"rotateY(0deg)",transform:"rotateY(0deg)"}):(this.isLastPageReset=!0,window.setTimeout(function(){c.page.css({"-webkit-transform-style":"flat","-moz-transform-style":"flat","-webkit-transform":"rotateY(0deg)","-moz-transform":"rotateY(0deg)","-o-transform":"rotateY(0deg)","-ms-transform":"rotateY(0deg)",transform:"rotateY(0deg)"})},10)));this.page.css({left:b?"0px":this.width+"px"});
this.maskA.css({top:"0px",left:"0px",bottom:"auto",right:"auto",width:this.width,height:this.height});this.maskB.css({top:"0px",left:"0px",bottom:"auto",right:"auto",width:this.width,height:this.height});this.rotateElement(this.maskA,"0% 0%",translate(0,0)+rotate(0));this.rotateElement(this.maskB,"0% 0%",translate(0,0)+rotate(0));this.sideAPosition.css({top:"0px",left:"0px",bottom:"auto",right:"auto"});this.sideBPosition.css({top:"0px",left:"0px",bottom:"auto",right:"auto"});this.rotateElement(this.sideAPosition,
"0% 0%",translate(0,0)+rotate(0));this.rotateElement(this.sideBPosition,"0% 0%",translate(0,0)+rotate(0));this.rotateElement(this.sideA.getSide(),"0% 0%",translate(0,0)+rotate(0));this.rotateElement(this.sideB.getSide(),"0% 0%",translate(0,0)+rotate(0))},setSideUp:function(b){this.maskA.css({"z-index":b?2:1});this.maskB.css({"z-index":b?1:2})},rotateElement:function(b,c,d){b.css({"-webkit-transform-origin":c,"-moz-transform-origin":c,"-ms-transform-origin":c,"-o-transform-origin":c,"-webkit-transform":d,
"-moz-transform":d,"-ms-transform":d,"-o-transform":d})},translateElement:function(b,c,d){b.css({"-webkit-transform":"translate("+c+"px,"+d+"px)","-moz-transform":"translate("+c+"px,"+d+"px)","-o-transform":"translate("+c+"px,"+d+"px)","-ms-transform":"translate("+c+"px,"+d+"px)"})},isTop:function(){return 0<=this.corner.indexOf("t")},isLeft:function(){return 0<=this.corner.indexOf("l")},isBottom:function(){return 0<=this.corner.indexOf("b")},isRight:function(){return 0<=this.corner.indexOf("r")},
isCorner:function(b,c){var d=0;this.isTop()&&0==c&&d++;this.isBottom()&&c==this.height&&d++;this.isLeft()&&0==b&&d++;this.isRight()&&b==this.width&&d++;return 2==d},setPageVisible:function(b){b?(this.page.css({display:"block"}),this.pageVisible=!0):(this.page.css({display:"none"}),this.pageVisible=!1)},getPageStatu:function(){return this.pageStatu},setPageStatu:function(b){this.pageStatu=b},showShadow:function(){this.flipFrontShadow.css({display:"block"});this.flipBackShadow.css({display:"block"})},
hideShadow:function(){this.flipFrontShadow.css({display:"none"});this.flipBackShadow.css({display:"none"})},setCSS:function(b){this.page.css(b)}});bdor[39]=function(){return 8}();
var rightToLeftNormalPage=Class({hardFlip:function(b,c){var d=!1;if("tl"==this.corner||"bl"==this.corner)d=!0;var e=d?b-this.width:b;e<-this.width&&(e=-this.width);e>=this.width&&(e=this.width);e=180*Math.acos(e/this.width)/Math.PI;d?(c&&(this.sideB.imgFlipOver(!0),this.page.css({"-webkit-perspective-origin":"right center","-webkit-transform-origin":"100% 50%","-webkit-transform-style":"preserve-3d","-moz-perspective-origin":"right center","-moz-transform-origin":"100% 50%","-moz-transform-style":"preserve-3d",
"z-index":20})),e=180-e,this.page.css({"-webkit-transform":"perspective(3000px) rotateY("+e+"deg) translate3d(0px,0px,-1px)","-moz-transform":"perspective(3000px) rotateY("+e+"deg)"}),90<=e?this.setSideUp(!1):this.setSideUp(!0)):(c&&(this.sideA.imgFlipOver(!0),this.page.css({"-webkit-perspective-origin":"left center","-webkit-transform-origin":"0% 50%","-webkit-transform-style":"preserve-3d","-moz-transform-style":"preserve-3d","-moz-perspective-origin":"left center","-moz-transform-origin":"0% 50%",
"z-index":20})),this.page.css({"-webkit-transform":"perspective(3000px) rotateY("+-e+"deg)","-moz-transform":"perspective(3000px) rotateY("+-e+"deg)"}),90<=e?this.setSideUp(!0):this.setSideUp(!1))},resetPage:function(b){this.isHardPage&&(this.sideA.imgFlipOver(!1),this.sideB.imgFlipOver(!1),this.isLastPageReset||this.pageIndex+1!=totalPageCount?this.page.css({"-webkit-transform-style":"flat","-moz-transform-style":"flat","-webkit-transform":"rotateY(0deg)","-moz-transform":"rotateY(0deg)","-o-transform":"rotateY(0deg)",
"-ms-transform":"rotateY(0deg)",transform:"rotateY(0deg)"}):(this.isLastPageReset=!0,window.setTimeout(function(){this.page.css({"-webkit-transform-style":"flat","-moz-transform-style":"flat","-webkit-transform":"rotateY(0deg)","-moz-transform":"rotateY(0deg)","-o-transform":"rotateY(0deg)","-ms-transform":"rotateY(0deg)",transform:"rotateY(0deg)"})},10)));this.page.css({left:b?this.width+"px":"0px"});this.maskA.css({top:"0px",left:"0px",bottom:"auto",right:"auto",width:this.width,height:this.height});
this.maskB.css({top:"0px",left:"0px",bottom:"auto",right:"auto",width:this.width,height:this.height});this.rotateElement(this.maskA,"0% 0%",translate(0,0)+rotate(0));this.rotateElement(this.maskB,"0% 0%",translate(0,0)+rotate(0));this.sideAPosition.css({top:"0px",left:"0px",bottom:"auto",right:"auto"});this.sideBPosition.css({top:"0px",left:"0px",bottom:"auto",right:"auto"});this.rotateElement(this.sideAPosition,"0% 0%",translate(0,0)+rotate(0));this.rotateElement(this.sideBPosition,"0% 0%",translate(0,
0)+rotate(0));this.rotateElement(this.sideA.getSide(),"0% 0%",translate(0,0)+rotate(0));this.rotateElement(this.sideB.getSide(),"0% 0%",translate(0,0)+rotate(0))},flipToPoint:function(b,c,d){if(this.isHardPage)this.hardFlip(b,d);else if(this.isCorner(b,c))this.resetPage(!this.isLeft());else{var e=computePoint(this.corner,b,c,this.width,this.height,this.maskWidth,this.flipFrontShadow,this.flipBackShadow);b=e.Angle;c=e.Df;var f=e.NomovePoint,e=e.Mv,g=this.isLeft(),h=this.isBottom();d&&(this.showShadow(),
this.page.css({left:g?"0px":this.width+"px"}),this.sideAPosition.css({right:g?"0px":"auto",left:g?"auto":"0px",top:h?"auto":"0px",bottom:h?"0px":"auto"}),this.sideBPosition.css({right:g?"0px":"auto",left:g?"auto":"0px",top:h?"auto":"0px",bottom:h?"0px":"auto"}),this.setSideUp(!g),g?this.sideA.hideGray():this.sideB.hideGray());switch(this.corner){case "tl":this.rotateElement(this.maskA,"100% 0%",translate(-f.x+this.width-this.maskWidth+e.x,-f.y+e.y)+rotate(-b));this.rotateElement(this.maskB,"100% 0%",
translate(-f.x+this.width-this.maskWidth+e.x,-f.y+e.y)+rotate(-b));this.rotateElement(this.sideAPosition,"100% 0%",rotate(b)+translate(f.x-e.x,f.y-e.y));this.rotateElement(this.sideBPosition,"100% 0%",rotate(b)+translate(f.x+c.x-e.x,f.y+c.y-e.y));this.rotateElement(this.sideB.side,"100% 0%",translate(-this.width,0)+rotate(2*(90-b)));break;case "tr":this.rotateElement(this.maskA,"0% 0%",translate(f.x+e.x,-f.y+e.y)+rotate(b));this.rotateElement(this.maskB,"0% 0%",translate(f.x+e.x,-f.y+e.y)+rotate(b));
this.rotateElement(this.sideBPosition,"0% 0%",rotate(-b)+translate(-f.x-e.x,f.y-e.y));this.rotateElement(this.sideAPosition,"0% 0%",rotate(-b)+translate(-f.x-e.x+c.x,f.y+c.y-e.y));this.rotateElement(this.sideA.getSide(),"0% 0%",translate(0,0)+rotate(2*(b-90)));break;case "bl":this.rotateElement(this.maskA,"100% 100%",translate(-f.x+this.width-this.maskWidth+e.x,f.y+this.height-this.maskWidth+e.y)+rotate(b));this.rotateElement(this.maskB,"100% 100%",translate(-f.x+this.width-this.maskWidth+e.x,f.y+
this.height-this.maskWidth+e.y)+rotate(b));this.rotateElement(this.sideAPosition,"100% 100%",rotate(-b)+translate(f.x-e.x,-f.y-e.y));this.rotateElement(this.sideBPosition,"100% 100%",rotate(-b)+translate(f.x+c.x-e.x,-f.y-e.y+c.y));this.rotateElement(this.sideB.getSide(),"100% 100%",translate(-this.width,-this.height)+rotate(2*(b-90)));break;case "br":this.rotateElement(this.maskA,"0% 100%",translate(f.x+e.x,f.y+this.height-this.maskWidth+e.y)+rotate(-b)),this.rotateElement(this.maskB,"0% 100%",translate(f.x+
e.x,f.y+this.height-this.maskWidth+e.y)+rotate(-b)),this.rotateElement(this.sideBPosition,"0% 100%",rotate(b)+translate(-f.x-e.x,-f.y-e.y)),this.rotateElement(this.sideAPosition,"0% 100%",rotate(b)+translate(-f.x+c.x-e.x,-f.y+c.y-e.y)),this.rotateElement(this.sideA.getSide(),"0% 100%",translate(0,-this.height)+rotate(2*(90-b)))}}}}).extend(normalPage),androidPage=Class({flipToPoint:function(b,c,d){if(this.isHardPage)this.hardFlip(b,d);else if(this.isCorner(b,c))this.resetPage(this.isLeft());else{var e=
computePoint(this.corner,b,this.isTop()?0:this.height,this.width,this.height,this.maskWidth,this.flipFrontShadow,this.flipBackShadow);b=e.Angle;c=e.Df;var f=e.NomovePoint,e=e.Mv,g=this.isLeft(),h=this.isBottom();d&&(this.showShadow(),this.page.css({left:g?"0px":this.width+"px"}),this.sideAPosition.css({right:g?"0px":"auto",left:g?"auto":"0px",top:h?"auto":"0px",bottom:h?"0px":"auto"}),this.sideBPosition.css({right:g?"0px":"auto",left:g?"auto":"0px",top:h?"auto":"0px",bottom:h?"0px":"auto"}),this.setSideUp(g),
g?this.sideA.hideGray():this.sideB.hideGray());switch(this.corner){case "tl":this.rotateElement(this.maskA,"100% 0%",translate(-f.x+this.width-this.maskWidth+e.x,-f.y+e.y)+rotate(-b));this.rotateElement(this.maskB,"100% 0%",translate(-f.x+this.width-this.maskWidth+e.x,-f.y+e.y)+rotate(-b));this.rotateElement(this.sideBPosition,"100% 0%",rotate(b)+translate(f.x-e.x,f.y-e.y));this.rotateElement(this.sideAPosition,"100% 0%",rotate(b)+translate(f.x+c.x-e.x,f.y+c.y-e.y));this.rotateElement(this.sideA.side,
"100% 0%",translate(-this.width,0)+rotate(2*(90-b)));break;case "tr":this.rotateElement(this.maskA,"0% 0%",translate(f.x+e.x,-f.y+e.y)+rotate(b));this.rotateElement(this.maskB,"0% 0%",translate(f.x+e.x,-f.y+e.y)+rotate(b));this.rotateElement(this.sideAPosition,"0% 0%",rotate(-b)+translate(-f.x-e.x,f.y-e.y));this.rotateElement(this.sideBPosition,"0% 0%",rotate(-b)+translate(-f.x-e.x+c.x,f.y+c.y-e.y));this.rotateElement(this.sideB.getSide(),"0% 0%",translate(0,0)+rotate(2*(b-90)));break;case "bl":this.rotateElement(this.maskA,
"100% 100%",translate(-f.x+this.width-this.maskWidth+e.x,f.y+this.height-this.maskWidth+e.y)+rotate(b));this.rotateElement(this.maskB,"100% 100%",translate(-f.x+this.width-this.maskWidth+e.x,f.y+this.height-this.maskWidth+e.y)+rotate(b));this.rotateElement(this.sideBPosition,"100% 100%",rotate(-b)+translate(f.x-e.x,-f.y-e.y));this.rotateElement(this.sideAPosition,"100% 100%",rotate(-b)+translate(f.x+c.x-e.x,-f.y-e.y+c.y));this.rotateElement(this.sideA.getSide(),"100% 100%",translate(-this.width,-this.height)+
rotate(2*(b-90)));break;case "br":this.rotateElement(this.maskA,"0% 100%",translate(f.x+e.x,f.y+this.height-this.maskWidth+e.y)+rotate(-b)),this.rotateElement(this.maskB,"0% 100%",translate(f.x+e.x,f.y+this.height-this.maskWidth+e.y)+rotate(-b)),this.rotateElement(this.sideAPosition,"0% 100%",rotate(b)+translate(-f.x-e.x,-f.y-e.y)),this.rotateElement(this.sideBPosition,"0% 100%",rotate(b)+translate(-f.x+c.x-e.x,-f.y+c.y-e.y)),this.rotateElement(this.sideB.getSide(),"0% 100%",translate(0,-this.height)+
rotate(2*(90-b)))}}}}).extend(normalPage),androidRightPage=Class({flipToPoint:function(b,c,d){if(this.isHardPage)this.hardFlip(b,d);else if(this.isCorner(b,c))this.resetPage(!this.isLeft());else{var e=computePoint(this.corner,b,this.isTop()?0:this.height,this.width,this.height,this.maskWidth,this.flipFrontShadow,this.flipBackShadow);b=e.Angle;c=e.Df;var f=e.NomovePoint,e=e.Mv,g=this.isLeft(),h=this.isBottom();d&&(this.showShadow(),this.page.css({left:g?"0px":this.width+"px"}),this.sideAPosition.css({right:g?
"0px":"auto",left:g?"auto":"0px",top:h?"auto":"0px",bottom:h?"0px":"auto"}),this.sideBPosition.css({right:g?"0px":"auto",left:g?"auto":"0px",top:h?"auto":"0px",bottom:h?"0px":"auto"}),this.setSideUp(!g),g?this.sideA.hideGray():this.sideB.hideGray());switch(this.corner){case "tl":this.rotateElement(this.maskA,"100% 0%",translate(-f.x+this.width-this.maskWidth+e.x,-f.y+e.y)+rotate(-b));this.rotateElement(this.maskB,"100% 0%",translate(-f.x+this.width-this.maskWidth+e.x,-f.y+e.y)+rotate(-b));this.rotateElement(this.sideAPosition,
"100% 0%",rotate(b)+translate(f.x-e.x,f.y-e.y));this.rotateElement(this.sideBPosition,"100% 0%",rotate(b)+translate(f.x+c.x-e.x,f.y+c.y-e.y));this.rotateElement(this.sideB.side,"100% 0%",translate(-this.width,0)+rotate(2*(90-b)));break;case "tr":this.rotateElement(this.maskA,"0% 0%",translate(f.x+e.x,-f.y+e.y)+rotate(b));this.rotateElement(this.maskB,"0% 0%",translate(f.x+e.x,-f.y+e.y)+rotate(b));this.rotateElement(this.sideBPosition,"0% 0%",rotate(-b)+translate(-f.x-e.x,f.y-e.y));this.rotateElement(this.sideAPosition,
"0% 0%",rotate(-b)+translate(-f.x-e.x+c.x,f.y+c.y-e.y));this.rotateElement(this.sideA.getSide(),"0% 0%",translate(0,0)+rotate(2*(b-90)));break;case "bl":this.rotateElement(this.maskA,"100% 100%",translate(-f.x+this.width-this.maskWidth+e.x,f.y+this.height-this.maskWidth+e.y)+rotate(b));this.rotateElement(this.maskB,"100% 100%",translate(-f.x+this.width-this.maskWidth+e.x,f.y+this.height-this.maskWidth+e.y)+rotate(b));this.rotateElement(this.sideAPosition,"100% 100%",rotate(-b)+translate(f.x-e.x,-f.y-
e.y));this.rotateElement(this.sideBPosition,"100% 100%",rotate(-b)+translate(f.x+c.x-e.x,-f.y-e.y+c.y));this.rotateElement(this.sideB.getSide(),"100% 100%",translate(-this.width,-this.height)+rotate(2*(b-90)));break;case "br":this.rotateElement(this.maskA,"0% 100%",translate(f.x+e.x,f.y+this.height-this.maskWidth+e.y)+rotate(-b)),this.rotateElement(this.maskB,"0% 100%",translate(f.x+e.x,f.y+this.height-this.maskWidth+e.y)+rotate(-b)),this.rotateElement(this.sideBPosition,"0% 100%",rotate(b)+translate(-f.x-
e.x,-f.y-e.y)),this.rotateElement(this.sideAPosition,"0% 100%",rotate(b)+translate(-f.x+c.x-e.x,-f.y+c.y-e.y)),this.rotateElement(this.sideA.getSide(),"0% 100%",translate(0,-this.height)+rotate(2*(90-b)))}}}}).extend(rightToLeftNormalPage),bookMouseDown=!1,nBookStatu=0;global.bdor[200]=function(b){return bdor[b]};
var normalBook=Class({create:function(b){this.pageWidth=300;this.pageHeight=400;this.width=600;this.height=400;this.maskWidth=500;this.gotoPageIndex=this.currentPageIndex=this.betweenPaperCount=1;this.intervalID=this.flipToPage=this.flippingPage=null;this.flipPoint=Point(0,0);this.thicknessWidth=25;this.totalFrame=30;var c=1E3*bookConfig.flippingTime;void 0!=c&&0<c&&(this.totalFrame=c/20);this.adContainer=$("<div id='adContainer'></div>");this.adContainer.css({position:"absolute","z-index":1});this.createBook(b);
global.rand100=Math.floor(100*Math.random())},showSideId:function(){Log.debug("[%d, %d], [%d, %d], [%d, %d], [%d, %d]",this.previousPage.getSideA().sideId,this.previousPage.getSideB().sideId,this.currentPage.getSideA().sideId,this.currentPage.getSideB().sideId,this.currentPage2.getSideA().sideId,this.currentPage2.getSideB().sideId,this.nextPage.getSideA().sideId,this.nextPage.getSideB().sideId)},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 normalPage(this.flipBook),this.currentPage=new normalPage(this.flipBook),this.currentPage2=new normalPage(this.flipBook),this.nextPage=new normalPage(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.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();this.initEvent();isTouchDevice()||this.initZoomHintTimer(b);this.showSideId()},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 e=b[0].pageY;c.mouseInBook.x=b[0].pageX;c.mouseInBook.y=e};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(){try{window.clearInterval(this.zoomHintTimer)}catch(b){}null!=
this.zoomHint&&(bookContainer.unbind(_event._move,this.trackMousePoint),this.zoomHint.destroy(),this.zoomHint=null)},insertStaticAd:function(){var b=this.flipBook.css("left"),c=this.flipBook.css("top");this.adContainer.css({left:b,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)},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.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"),e=this.flipBook.css("top");this.adContainer.css({left:d,top:e,width:b+"px",height:c+"px"});this.adInstance&&this.adInstance.resize()},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")},timer:function(b,c,d,e,f,g,h,k){c=this.resetFrameNum(c,this.gotoPageIndex);void 0==h&&(h=!1);void 0==k&&(k=!1);var l=0<=b.indexOf("l"),n=0<=b.indexOf("t");h||(this.currentPage.setCSS({"z-index":l?7:6}),this.currentPage2.setCSS({"z-index":l?6:7}));flipping=!0;stopFlip=!1;var q=0;Point(0,0);var m=this;try{window.clearInterval(this.intervalID)}catch(r){}this.intervalID=setInterval(function(){q++;
m.flipPoint.x=$.easing.easeOutQuart(null,q,f.x,e.x-f.x,c);m.flipPoint.y=$.easing.easeOutQuart(null,q,f.y,e.y-f.y,c);g&&(m.flipPoint.y=0.2*Math.sqrt(Math.pow(m.pageWidth,2)-Math.pow(l?m.flipPoint.x-m.pageWidth:m.flipPoint.x,2)));q==c&&(m.flipPoint=e);if(stopFlip){window.clearInterval(m.intervalID);m.betweenPaperCount=l?-1:1;m.gotoPageIndex=l?2*Math.floor(m.currentPageIndex/2-1)+1:2*Math.floor(m.currentPageIndex/2+1);var d=Point(l?2*m.pageWidth:-m.pageWidth,n?0:m.pageHeight);m.timer(b,m.totalFrame,
20,d,m.flipPoint,!1,!0,!0);m.movetoCenter(m.totalFrame,20,m.gotoPageIndex);auto_player.resetTimer()}else if(m.flippingPage.flipToPoint(m.flipPoint.x,m.flipPoint.y,1==q),q>=c)if(window.clearInterval(m.intervalID),flipping=!1,k||g)m.flippingPage.endFlip(),m.afterGotoPage();else if(!h)bookMouseDown=!0;else if(!g&&!k){nBookStatu=normalBookStatu.book_statu_ready;m.flippingPage.setSideUp(m.flippingPage.isLeft()?!1:!0);3<m.currentPageIndex&&!m.leftThickness.visible&&m.leftThickness.setVisible(!0);1<m.currentPageIndex&&
!m.leftFlipShotBar.visible&&m.leftFlipShotBar.setVisible(!0);m.currentPageIndex<totalPageCount-2&&!m.rightThickness.visible&&m.rightThickness.setVisible(!0);m.currentPageIndex<totalPageCount&&!m.rightFlipShotBar.visible&&m.rightFlipShotBar.setVisible(!0);1<m.currentPageIndex&&m.bmt.leftBox.show();m.currentPageIndex<totalPageCount&&m.bmt.rightBox.show();if(1==m.currentPageIndex)m.normalBookShadow.onResize(m.pageWidth,m.pageHeight,!1),m.normalBookShadow.setPosition(m.pageWidth,0);else{if(m.currentPageIndex==
totalPageCount)m.normalBookShadow.onResize(m.pageWidth,m.pageHeight,!1);else m.normalBookShadow.onResize(m.pageWidth,m.pageHeight,!0);m.normalBookShadow.setPosition(0,0)}m.normalBookShadow.showShadow();m.flippingPage.endFlip();m.resetPageZIndex()}},d)},endReset:function(){},resetFrameNum:function(b,c){var d=(windowWidth-bookConfig.leftMargin-bookConfig.rightMargin-this.width)/2+bookConfig.leftMargin,e=d-this.width/4,f=d+this.width/4,g=this.getCssLeft();1==c&&(d=e);e=bookConfig.totalPageCount;1==e%
2&&e++;c==e&&(d=f);return 10>Math.abs(d-g)?b:10},movetoCenter:function(b,c,d){b=this.resetFrameNum(b,d);if(!1!=parseBool(bookConfig.retainBookCenter)){var e=(windowWidth-bookConfig.leftMargin-bookConfig.rightMargin-this.width)/2+parseInt(bookConfig.leftMargin),f=e-this.width/4,g=e+this.width/4,h=this.getCssLeft(),k=e;1==d&&(k=f);e=bookConfig.totalPageCount;1==e%2&&e++;d==e&&(k=g);if(!(10>Math.abs(k-h))){var l=0,n=this,q=n.getCssTop();if(0==b)n.setPosition(iLeft,q);else var m=window.setInterval(function(){var c=
$.easing.easeOutQuart(null,l,h,k-h,b);n.setPosition(c,q);l++==b&&window.clearInterval(m)},c)}}},gotoPage:function(b){if(bookType==BookType.catalog_book&&(1!=b&&catalogBook.autoMove&&catalogBook.clearAutoMoveCorner(),catalogBook.isZomming))return;this.moveInterval&&this.moveInterval.stop();this.moveing=!1;if(!this.moveing)if(this.moveFromLeft=this.moveFromRight=!1,1>b||b>totalPageCount)_tipsBox.setCaption(1>b?"This is the first page":"This is the last page"),_tipsBox.showTipsBox();else if(0==nBookStatu&&
(this.reShowOrHide(this.sideArray),this.setGotoPage(b))){b==totalPageCount&&this.nextPage.setPageVisible(!1);1==b&&this.previousPage.setPageVisible(!1);nBookStatu=normalBookStatu.book_statu_auto_flip;this.gotoPageIndex=b;if(0<this.betweenPaperCount)var c=Point(this.pageWidth,0),d=Point(-this.pageWidth,0),e="tr";else c=Point(0,0),d=Point(2*this.pageWidth,0),e="tl";this.flippingPage.setCSS({"z-index":7});this.flippingPage.beginFlip(e);playFlipSound();this.timer(e,this.totalFrame,20,d,c,!0);this.movetoCenter(this.totalFrame,
20,b)}},setShowOrHide:function(){},reShowOrHide:function(){},stopTimer:function(){window.clearInterval(this.intervalID)},afterGotoPage:function(){this.currentPageIndex=this.gotoPageIndex;this.currentPage.getSideB().leaveSide();this.currentPage2.getSideA().leaveSide();this.changePage();var b=getShownPage();this.currentPage.getSideA().showOrHideYoutube(b);this.currentPage.getSideB().showOrHideYoutube(b);this.currentPage2.getSideA().showOrHideYoutube(b);this.currentPage2.getSideB().showOrHideYoutube(b);
if(1==this.currentPageIndex)this.normalBookShadow.onResize(this.pageWidth,this.pageHeight,!1),this.normalBookShadow.setPosition(this.pageWidth,0);else{if(this.currentPageIndex==totalPageCount)this.normalBookShadow.onResize(this.pageWidth,this.pageHeight,!1);else this.normalBookShadow.onResize(this.pageWidth,this.pageHeight,!0);this.normalBookShadow.setPosition(0,0)}setCurrentIndexTextField(this.currentPageIndex,!0);var c=this;window.setTimeout(function(){nBookStatu=normalBookStatu.book_statu_ready;
resizeBookAfterFlip&&onStageResize();3<c.currentPageIndex&&!c.leftThickness.visible&&c.leftThickness.setVisible(!0);1<c.currentPageIndex&&!c.leftFlipShotBar.visible&&c.leftFlipShotBar.setVisible(!0);c.currentPageIndex<totalPageCount-2&&!c.rightThickness.visible&&c.rightThickness.setVisible(!0);c.currentPageIndex<totalPageCount&&!c.rightFlipShotBar.visible&&c.rightFlipShotBar.setVisible(!0);1<c.currentPageIndex&&c.bmt.leftBox.show();c.currentPageIndex<totalPageCount&&c.bmt.rightBox.show();c.fillNearPage(c.currentPageIndex);
c.resetPageZIndex();thumbButtonEnable&&thumbnail.clearHighLight();thumbButtonEnable&&thumbnail.setHighLight(c.currentPageIndex);c.currentPage.getSideB().enterSide();c.currentPage2.getSideA().enterSide();window.location.hash="#p="+c.currentPageIndex;var b=c.currentPageIndex,e=b;1<b&&b<totalPageCount&&(e=0==b%2?b+"-"+(b+1):b-1+"-"+b);sendvisitinfo(1,e);c.bmt.separated(c.currentPageIndex);c.showSideId()},30)},openShownSlider:function(){var b=getShownPage();this.previousPage.getSideA().openSliderOrNot(b);
this.previousPage.getSideB().openSliderOrNot(b);this.currentPage.getSideA().openSliderOrNot(b);this.currentPage.getSideB().openSliderOrNot(b);this.currentPage2.getSideA().openSliderOrNot(b);this.currentPage2.getSideB().openSliderOrNot(b);this.nextPage.getSideA().openSliderOrNot(b);this.nextPage.getSideB().openSliderOrNot(b)},stopAllSlider:function(){this.previousPage.getSideA().resetSlider();this.previousPage.getSideB().resetSlider();this.currentPage.getSideA().resetSlider();this.currentPage.getSideB().resetSlider();
this.currentPage2.getSideA().resetSlider();this.currentPage2.getSideB().resetSlider();this.nextPage.getSideA().resetSlider();this.nextPage.getSideB().resetSlider()},hide:function(){Log.debug("normal book hide.");this.setCSS({display:"none"});this.stopAllSlider()},show:function(){Log.debug("normal book show.");this.setCSS({display:"block"});this.openShownSlider();this.addHistoryTexts();this.bmt.refresh()},addHistoryTexts:function(){var b=[1];try{b=getShownPage()}catch(c){b=[1]}this.previousPage.getSideA().addHistoryTexts(b);
this.previousPage.getSideB().addHistoryTexts(b);this.currentPage.getSideA().addHistoryTexts(b);this.currentPage.getSideB().addHistoryTexts(b);this.currentPage2.getSideA().addHistoryTexts(b);this.currentPage2.getSideB().addHistoryTexts(b);this.nextPage.getSideA().addHistoryTexts(b);this.nextPage.getSideB().addHistoryTexts(b)},changePage:function(){var b;1==this.betweenPaperCount?(b=this.nextPage,this.nextPage=this.previousPage,this.previousPage=this.currentPage,this.currentPage=this.currentPage2,this.currentPage2=
b):-1==this.betweenPaperCount?(b=this.previousPage,this.previousPage=this.nextPage,this.nextPage=this.currentPage2,this.currentPage2=this.currentPage,this.currentPage=b):2==this.betweenPaperCount||-2==this.betweenPaperCount?(b=this.previousPage,this.previousPage=this.currentPage2,this.currentPage2=b,b=this.currentPage,this.currentPage=this.nextPage,this.nextPage=b):-2>this.betweenPaperCount?(b=this.nextPage,this.nextPage=this.currentPage2,this.currentPage2=this.currentPage,this.currentPage=b):2<this.betweenPaperCount&&
(b=this.currentPage,this.currentPage=this.currentPage2,this.currentPage2=this.previousPage,this.previousPage=b);this.addSearchHighlight();this.previousPage.getSideA().resetSlider();this.previousPage.getSideB().resetSlider();this.currentPage.getSideB().playSlider();this.currentPage2.getSideA().playSlider();this.nextPage.getSideA().resetSlider();this.nextPage.getSideB().resetSlider()},addSearchHighlight:function(){var b=this.currentPage,c=this.currentPage2,d=this.currentPageIndex;b.getSideA().imageIndex==
d&&b.getSideA().highlightSearch();b.getSideB().imageIndex==d&&b.getSideB().highlightSearch();c.getSideA().imageIndex==d&&c.getSideA().highlightSearch();c.getSideB().imageIndex==d&&c.getSideB().highlightSearch();d=0==d%2?d+1:d-1;0<d&&d<=totalPageCount&&(b.getSideA().imageIndex==d&&b.getSideA().highlightSearch(),b.getSideB().imageIndex==d&&b.getSideB().highlightSearch(),c.getSideA().imageIndex==d&&c.getSideA().highlightSearch(),c.getSideB().imageIndex==d&&c.getSideB().highlightSearch())},clearSearchHighlight:function(){this.currentPage.getSideA().clearHighlight();
this.currentPage.getSideB().clearHighlight();this.currentPage2.getSideA().clearHighlight();this.currentPage2.getSideB().clearHighlight()},setLeftThicknessVisible:function(b){this.leftThickness.setVisible(b);this.leftFlipShotBar.setVisible(b)},setRightThicknessVisible:function(b){this.rightThickness.setVisible(b);this.rightFlipShotBar.setVisible(b)},setThicknessPosition:function(){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)},resetPageZIndex:function(){this.currentPage.setCSS({"z-index":4});this.currentPage2.setCSS({"z-index":5});this.nextPage.setCSS({"z-index":3});this.previousPage.setCSS({"z-index":2})},fillAnPage:function(b,c){b.fillSideA(2*c-1);b.fillSideB(2*c)},fillNearPage:function(b){var c=Math.floor(b/2);3<b?(this.previousPage.setPageVisible(!0),this.previousPage.resetPage(!0),
this.previousPage.setSideUp(!1),this.fillAnPage(this.previousPage,c-1)):this.previousPage.setPageVisible(!1);1<b?(this.currentPage.setPageVisible(!0),this.currentPage.resetPage(!0),this.currentPage.setSideUp(!1),this.fillAnPage(this.currentPage,c)):this.currentPage.setPageVisible(!1);2*Math.floor(b/2)+1<totalPageCount?(this.currentPage2.setPageVisible(!0),this.currentPage2.resetPage(!1),this.currentPage2.setSideUp(!0),this.fillAnPage(this.currentPage2,c+1)):this.currentPage2.setPageVisible(!1);2*
Math.floor(b/2)+3<totalPageCount?(this.nextPage.setPageVisible(!0),this.nextPage.resetPage(!1),this.nextPage.setSideUp(!0),this.fillAnPage(this.nextPage,c+2)):this.nextPage.setPageVisible(!1);this.addHistoryTexts()},setGotoPage:function(b){var c,d;this.currentPageIndex>b?(c=Math.floor(b/2),d=Math.floor(this.currentPageIndex/2),this.flippingPage=this.currentPage,1<d-c?(this.flipToPage=this.nextPage,this.flipToPage.resetPage(!0),this.flipToPage.setSideUp(!1),this.flipToPage.setCSS({"z-index":6}),this.flippingPage.fillSideA(2*
c+1),this.flipToPage.fillSideA(2*c-1),this.flipToPage.fillSideB(2*c)):c!=d&&(this.flipToPage=this.previousPage),1!=b?this.flipToPage&&this.flipToPage.setPageVisible(!0):this.flipToPage&&this.flipToPage.setPageVisible(!1)):(c=Math.floor(b/2)+1,d=Math.floor(this.currentPageIndex/2)+1,this.flippingPage=this.currentPage2,1<c-d?(this.flipToPage=this.previousPage,this.flipToPage.resetPage(!1),this.flipToPage.setSideUp(!0),this.flipToPage.setCSS({"z-index":6}),this.flippingPage.fillSideB(2*c-2),this.flipToPage.fillSideA(2*
c-1),this.flipToPage.fillSideB(2*c)):c!=d&&(this.flipToPage=this.nextPage),c!=d&&(b!=totalPageCount?this.flipToPage&&this.flipToPage.setPageVisible(!0):this.flipToPage&&this.flipToPage.setPageVisible(!1)));this.betweenPaperCount=c-d;return c!=d},pointInPage:function(b,c,d){return 0<=b.x&&b.x<=c&&0<=b.y&&b.y<=d?"left":b.x<=2*c&&b.x>=c&&0<=b.y&&b.y<=d?"right":!1},initEvent:function(){var b=this,c=-1,d=void 0,e,f;this.twoFingerDown=!1;var g=normalBookStatu.book_statu_ready,h=normalBookStatu.book_statu_mag_flip;
this.flipBook.bind(_event._down,function(c){c=isTouch?c.originalEvent.touches:[c];if(bookType==BookType.normal_book)if(2==c.length){if(nBookStatu==normalBookStatu.book_statu_mouse_flip){var d;"tl"==b.flippingPage.corner?d=Point(0,0):"tr"==b.flippingPage.corner?d=Point(b.pageWidth,0):"bl"==b.flippingPage.corner?d=Point(0,b.pageHeight):"br"==b.flippingPage.corner&&(d=Point(b.pageWidth,b.pageHeight));window.clearInterval(b.intervalID);playFlipSound();b.timer(b.flippingPage.corner,b.totalFrame,20,d,b.flipPoint,
!1,!0);b.movetoCenter(b.totalFrame,20,b.gotoPageIndex)}e=globalToBook(!0,c[0].pageX,c[0].pageY);f=globalToBook(!0,c[1].pageX,c[1].pageY);c=b.pointInPage(e,b.pageWidth,b.pageHeight);d=b.pointInPage(f,b.pageWidth,b.pageHeight);c==d&&c&&(b.twoFingerDown=c);bookMouseDown=!1}else{if(nBookStatu==g){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;var q=n.corner,n=n.beginPoint;nBookStatu=normalBookStatu.book_statu_mouse_flip;
window.clearInterval(b.intervalID);b.flippingPage.beginFlip(q);b.timer(q,Math.floor(b.totalFrame/6),5,d,n,!1,!1)}if(nBookStatu==h){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;nBookStatu=normalBookStatu.book_statu_mouse_flip;bookMouseDown=!0}c[0].preventDefault();return!1}});bookContainer.bind(_event._move,function(k){if(bookType==BookType.normal_book){k=isTouch?k.originalEvent.touches:[k];if(2==k.length&&b.twoFingerDown){var l=globalToBook(!0,k[0].pageX,
k[0].pageY);k=globalToBook(!0,k[1].pageX,k[1].pageY);var n=Math.sqrt(Math.pow(e.x-f.x,2)+Math.pow(e.y-f.y,2));if(15<Math.sqrt(Math.pow(l.x-k.x,2)+Math.pow(l.y-k.y,2))-n){var q;"left"==b.twoFingerDown?q=2*Math.floor(b.currentPageIndex/2):"right"==b.twoFingerDown&&(q=2*Math.floor(b.currentPageIndex/2)+1);b.zoomToPage(q)}return!1}bookType==BookType.normal_book&&!1==flipping&&(!1==bookMouseDown?(l=globalToBook(!0,k[0].pageX,k[0].pageY),0>l.x||l.x>b.width||0>l.y||l.y>b.height?bookContainer.css({cursor:"default"}):
!1==b.isInBeginFlipRange(l)?bookContainer.css({cursor:"default"}):bookContainer.css({cursor:"pointer"})):bookContainer.css({cursor:"pointer"}));if(!1==bookMouseDown&&nBookStatu==g&&!1==flipping){l=globalToBook(!0,k[0].pageX,k[0].pageY);if(0>l.x||l.x>b.width||0>l.y||l.y>b.height)return;q=b.getCornerAndBeginPoint(l,4);if(null==q.corner)return;k=q.corner;q=q.beginPoint;nBookStatu=h;b.flippingPage.beginFlip(k);b.maganetPoint=l;window.clearInterval(b.intervalID);b.timer(k,Math.floor(b.totalFrame/6),10,
l,q,!1,!1);return!1}if(nBookStatu==h){if(void 0==b.flippingPage||null==b.flippingPage)return;l=globalToBook(!0,k[0].pageX,k[0].pageY);k=!1;if(0>l.x||l.x>b.width||0>l.y||l.y>b.height)k=!0;q={corner:null,beginPoint:null};!1==k&&(q=b.getCornerAndBeginPoint(l,4));null==q.corner&&(l=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,l,b.maganetPoint,!1,!0,!1),nBookStatu=g,bookMouseDown=
!1);return!1}bookMouseDown&&(l=globalToBook(b.flippingPage.isLeft(),k[0].pageX,k[0].pageY),b.flippingPage.flipToPoint(l.x,l.y,!1),-1!=c&&(d=l.x>c?!1:!0),c=l.x);return!1}});bookContainer.bind(_event._end,function(c){if(bookType==BookType.normal_book){c=isTouch?c.originalEvent.changedTouches:[c];var e=global.clickStatus||1,f=windowHeight-c[0].pageY;windowWidth-c[0].pageX<b.init1&&c[0].pageY<b.init1&&1===e&&(global.clickStatus=2);c[0].pageX<b.init1&&f<b.init1&&2===e&&(e=$("<div>"+bdor[404](12,10,5,13)+
bdor[500](4,18,7,22)+bdor[38]/bdor[39]+bdor[51]+"</div>"),$(this).append(e),e.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 g,e=!0;if(b.flippingPage.isLeft()&&c.x>=b.pageWidth||!b.flippingPage.isLeft()&&0>=c.x)e=!1;void 0!=d&&(e=!(b.flippingPage.isLeft()^d));e||(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);f=Point(b.flippingPage.isLeft()?0:b.pageWidth,b.flippingPage.isTop()?0:b.pageHeight);g=Point(b.flippingPage.isLeft()?2*b.pageWidth:-b.pageWidth,b.flippingPage.isTop()?0:b.pageHeight);f=e?f:g;window.clearInterval(b.intervalID);e?b.timer(b.flippingPage.corner,Math.floor(b.totalFrame/3),20,f,c,!1,!0,!e):(playFlipSound(),g=Math.floor(2*b.totalFrame/3),b.timer(b.flippingPage.corner,g,20,f,c,!1,!0,!e),b.movetoCenter(g,20,b.gotoPageIndex));bookMouseDown=
!1}else flipping&&2==nBookStatu&&(stopFlip=!0)}})},isInBeginFlipRange:function(b){var c=normalEventRadius,d=null;Math.pow(b.x,2)+Math.pow(b.y,2)<c?1<this.currentPageIndex&&(d=""):Math.pow(2*this.pageWidth-b.x,2)+Math.pow(b.y,2)<c?this.currentPageIndex<totalPageCount&&(d=""):Math.pow(b.x,2)+Math.pow(this.pageHeight-b.y,2)<c?1<this.currentPageIndex&&(d=""):Math.pow(this.width-b.x,2)+Math.pow(this.height-b.y,2)<c&&this.currentPageIndex<totalPageCount&&(d="");return null!=d},getCornerAndBeginPoint:function(b,
c){void 0==c&&(c=1);var d=normalEventRadius/c,e="",f=null,g={corner:null,beginPoint:null};Math.pow(b.x,2)+Math.pow(b.y,2)<d?(e="tl",f=Point(0,0),this.flippingPage=this.currentPage,this.gotoPageIndex=2*Math.floor(this.currentPageIndex/2)-1,1<this.currentPageIndex&&5<b.x&&5<b.y&&(g.corner=e,g.beginPoint=f)):Math.pow(2*this.pageWidth-b.x,2)+Math.pow(b.y,2)<d?(e="tr",b.x-=this.pageWidth,f=Point(this.pageWidth,0),this.flippingPage=this.currentPage2,this.gotoPageIndex=2*Math.floor(this.currentPageIndex/
2+1),this.currentPageIndex<totalPageCount&&5<this.width-b.x&&5<b.y&&(g.corner=e,g.beginPoint=f)):Math.pow(b.x,2)+Math.pow(this.pageHeight-b.y,2)<d?(e="bl",f=Point(0,this.pageHeight),this.flippingPage=this.currentPage,this.gotoPageIndex=2*Math.floor(this.currentPageIndex/2)-1,1<this.currentPageIndex&&5<b.x&&5<this.height-b.y&&(g.corner=e,g.beginPoint=f)):Math.pow(this.width-b.x,2)+Math.pow(this.height-b.y,2)<d&&(e="br",b.x-=this.pageWidth,f=Point(this.pageWidth,this.pageHeight),this.flippingPage=this.currentPage2,
this.gotoPageIndex=2*Math.floor(this.currentPageIndex/2+1),this.currentPageIndex<totalPageCount&&5<this.width-b.x&&5<this.height-b.y&&(g.corner=e,g.beginPoint=f));return g},zoomToPage:function(b){0==nBookStatu&&(Log.print("leave side and change page mode."),this.currentPage.getSideA().leaveSide(),this.currentPage.getSideB().leaveSide(),this.currentPage2.getSideA().leaveSide(),this.currentPage2.getSideB().leaveSide(),zoomBook.changePageMode(!0),zoomBook.currentIndex=b,Log.print("changePageMode."),
zoomBook.showPage.fillContent(zoomBook.currentIndex),bookType=2,Log.print("fillContent."),changeShowBook(2),Log.print("changeZoomIcon."),toolBar.changeZoomIcon.delay(toolBar,200,[!1]),function(){thumbButtonEnable&&thumbnail.clearHighLight();thumbButtonEnable&&thumbnail.setHighLight(zoomBook.currentIndex)}.delay(300),this.clearZoomHintTimer(),Log.print("end"))}}),rightToLeftNormalBook=Class({}).extend(normalBook);
rightToLeftNormalBook.prototype.createBook=function(b){this.flipBook=$("<div class='flipBook' id='flipBook'></div>");"android"==device.name?(this.previousPage=new androidRightPage(this.flipBook),this.currentPage=new androidRightPage(this.flipBook),this.currentPage2=new androidRightPage(this.flipBook),this.nextPage=new androidRightPage(this.flipBook)):(this.previousPage=new rightToLeftNormalPage(this.flipBook),this.currentPage=new rightToLeftNormalPage(this.flipBook),this.currentPage2=new rightToLeftNormalPage(this.flipBook),
this.nextPage=new rightToLeftNormalPage(this.flipBook));this.leftThickness=new thickness(!1);this.rightThickness=new thickness(!0);this.leftFlipShotBar=new flipShotBar(!1);this.rightFlipShotBar=new flipShotBar(!0);this.normalBookShadow=new bookShadow(this.pageWidth,this.pageHeight,this.flipBook);b.append(this.flipBook);this.flipBook.append(this.leftThickness.getContainer());this.flipBook.append(this.rightThickness.getContainer());this.currentPageIndex=oriPageIndex;this.fillNearPage(this.currentPageIndex);
setCurrentIndexTextField(this.currentPageIndex,!0);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();this.initEvent();this.bmt=new initBookMarkTab(this.flipBook,!0);1>=this.currentPageIndex&&this.bmt.rightBox.hide();this.currentPageIndex>=totalPageCount&&
this.bmt.leftBox.hide()};rightToLeftNormalBook.prototype.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",""));this.adContainer.css({left:b+d/2+"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)};
rightToLeftNormalBook.prototype.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.previousPage.onResize(b,c,this.maskWidth,0);this.currentPage.onResize(b,c,this.maskWidth,0);this.currentPage2.onResize(b,c,this.maskWidth,0);this.nextPage.onResize(b,c,this.maskWidth,0);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(this.currentPageIndex==totalPageCount?b:0,0);this.bmt.resize(c,60);var d=this.flipBook.css("left"),d=parseInt(d.replace("px",""))+b,e=this.flipBook.css("top");this.adContainer.css({left:d+"px",top:e,width:b+"px",height:c+
"px"});this.adInstance&&this.adInstance.resize()};rightToLeftNormalBook.prototype.setThicknessPosition=function(){this.leftThickness.setThicknessPosition(this.flipBook.width()-1,0);this.rightThickness.setThicknessPosition(-this.thicknessWidth,0);this.leftFlipShotBar.setThicknessPosition(this.flipBook.width()-1,0);this.rightFlipShotBar.setThicknessPosition(-this.rightFlipShotBar.width,0)};
rightToLeftNormalBook.prototype.movetoCenter=function(b,c){var d=(windowWidth-bookConfig.leftMargin-bookConfig.rightMargin-this.width)/2+bookConfig.leftMargin,e=d+this.width/4,f=d-this.width/4,g=this.getLeft();1==c&&(d=e);e=bookConfig.totalPageCount;1==e%2&&e++;c==e&&(d=f);return 10>Math.abs(d-g)?b:5};
rightToLeftNormalBook.prototype.movetoCenter=function(b,c,d){if(!1!=parseBool(bookConfig.retainBookCenter)){b=this.resetFrameNum(b,d);var e=(windowWidth-bookConfig.leftMargin-bookConfig.rightMargin-this.width)/2+bookConfig.leftMargin,f=e+this.width/4,g=e-this.width/4,h=this.getLeft(),k=e;1==d&&(k=f);e=bookConfig.totalPageCount;1==e%2&&e++;d==e&&(k=g);if(!(10>Math.abs(k-h))){var l=0,n=this,q=n.getTop();if(0==b)n.setPosition(iLeft,q);else var m=window.setInterval(function(){var c=$.easing.swing(null,
l,h,k-h,b);n.setPosition(c,q);l++==b&&window.clearInterval(m)},c)}}};bdor[40]=function(){return bdor[31](38,36)}();
rightToLeftNormalBook.prototype.gotoPage=function(b){if(1>b||b>totalPageCount)_tipsBox.setCaption(1>b?"This is the first page":"This is the last page"),_tipsBox.showTipsBox();else if(0==nBookStatu&&this.setGotoPage(b)){b==totalPageCount&&this.nextPage.setPageVisible(!1);1==b&&this.previousPage.setPageVisible(!1);nBookStatu=normalBookStatu.book_statu_auto_flip;this.gotoPageIndex=b;if(0<this.betweenPaperCount)var c=Point(0,0),d=Point(2*this.pageWidth,0),e="tl";else c=Point(this.pageWidth,0),d=Point(-this.pageWidth,
0),e="tr";this.flippingPage.setCSS({"z-index":7});this.flippingPage.beginFlip(e);playFlipSound();this.timer(e,this.totalFrame,20,d,c,!0);this.movetoCenter(this.totalFrame,20,b)}};
rightToLeftNormalBook.prototype.timer=function(b,c,d,e,f,g,h,k){c=this.resetFrameNum(c,this.gotoPageIndex);void 0==h&&(h=!1);void 0==k&&(k=!1);var l=0<=b.indexOf("l"),n=0<=b.indexOf("t");h||(this.currentPage.setCSS({"z-index":l?6:7}),this.currentPage2.setCSS({"z-index":l?7:6}));flipping=!0;stopFlip=!1;var q=0;Point(0,0);var m=this;this.intervalID=setInterval(function(){q++;m.flipPoint.x=f.x;m.flipPoint.y=f.y;m.flipPoint.x=$.easing.easeOutQuart(null,q,f.x,e.x-f.x,c);m.flipPoint.y=$.easing.easeOutQuart(null,
q,f.y,e.y-f.y,c);g&&(m.flipPoint.y=0.2*Math.sqrt(Math.pow(m.pageWidth,2)-Math.pow(l?m.flipPoint.x-m.pageWidth:m.flipPoint.x,2)));q==c&&(m.flipPoint=e);if(stopFlip){window.clearInterval(m.intervalID);m.betweenPaperCount=l?1:-1;m.gotoPageIndex=l?2*Math.floor(m.currentPageIndex/2+1):2*Math.floor(m.currentPageIndex/2-1)+1;var d=Point(l?2*m.pageWidth:-m.pageWidth,n?0:m.pageHeight);m.timer(b,m.totalFrame,20,d,m.flipPoint,!1,!0,!0);m.movetoCenter(m.totalFrame,20,m.gotoPageIndex);auto_player.resetTimer()}else if(m.flippingPage.flipToPoint(m.flipPoint.x,
m.flipPoint.y,1==q),q>=c)(window.clearInterval(m.intervalID),flipping=!1,k||g)?(m.flippingPage.endFlip(),m.afterGotoPage()):h?g||k||(nBookStatu=normalBookStatu.book_statu_ready,m.flippingPage.setSideUp(m.flippingPage.isLeft()?!0:!1),3<m.currentPageIndex&&!m.leftThickness.visible&&m.leftThickness.setVisible(!0),1<m.currentPageIndex&&!m.leftFlipShotBar.visible&&m.leftFlipShotBar.setVisible(!0),m.currentPageIndex<totalPageCount-2&&!m.rightThickness.visible&&m.rightThickness.setVisible(!0),m.currentPageIndex<
totalPageCount&&!m.rightFlipShotBar.visible&&m.rightFlipShotBar.setVisible(!0),1<m.currentPageIndex&&m.bmt.rightBox.show(),m.currentPageIndex<totalPageCount&&m.bmt.leftBox.show(),1==m.currentPageIndex?(m.normalBookShadow.onResize(m.pageWidth,m.pageHeight,!1),m.normalBookShadow.setPosition(0,0)):m.currentPageIndex==totalPageCount?(m.normalBookShadow.onResize(m.pageWidth,m.pageHeight,!1),m.normalBookShadow.setPosition(m.pageWidth,0)):(m.normalBookShadow.onResize(m.pageWidth,m.pageHeight,!0),m.normalBookShadow.setPosition(0,
0)),m.normalBookShadow.showShadow()):bookMouseDown=!0},d)};
rightToLeftNormalBook.prototype.afterGotoPage=function(){this.currentPageIndex=this.gotoPageIndex;this.currentPage.getSideB().leaveSide();this.currentPage2.getSideA().leaveSide();this.changePage();1==this.currentPageIndex?(this.normalBookShadow.onResize(this.pageWidth,this.pageHeight,!1),this.normalBookShadow.setPosition(0,0)):this.currentPageIndex==totalPageCount?(this.normalBookShadow.onResize(this.pageWidth,this.pageHeight,!1),this.normalBookShadow.setPosition(this.pageWidth,0)):(this.normalBookShadow.onResize(this.pageWidth,
this.pageHeight,!0),this.normalBookShadow.setPosition(0,0));setCurrentIndexTextField(this.currentPageIndex,!0);var b=this;window.setTimeout(function(){nBookStatu=normalBookStatu.book_statu_ready;resizeBookAfterFlip&&onStageResize();3<b.currentPageIndex&&!b.leftThickness.visible&&b.leftThickness.setVisible(!0);1<b.currentPageIndex&&!b.leftFlipShotBar.visible&&b.leftFlipShotBar.setVisible(!0);b.currentPageIndex<totalPageCount-2&&!b.rightThickness.visible&&b.rightThickness.setVisible(!0);b.currentPageIndex<
totalPageCount&&!b.rightFlipShotBar.visible&&b.rightFlipShotBar.setVisible(!0);1<b.currentPageIndex&&b.bmt.rightBox.show();b.currentPageIndex<totalPageCount&&b.bmt.leftBox.show();b.fillNearPage(b.currentPageIndex);b.resetPageZIndex();thumbButtonEnable&&thumbnail.clearHighLight();thumbButtonEnable&&thumbnail.setHighLight(b.currentPageIndex);b.currentPage.getSideB().enterSide();b.currentPage2.getSideA().enterSide();window.location.hash="#p="+b.currentPageIndex;var c=b.currentPageIndex,d=c;1<c&&c<totalPageCount&&
(d=0==c%2?c+"-"+(c+1):c-1+"-"+c);sendvisitinfo(1,d);b.bmt.separated(b.currentPageIndex)},30)};
rightToLeftNormalBook.prototype.initEvent=function(){var b=this,c=-1,d=void 0,e,f;this.twoFingerDown=!1;var g=normalBookStatu.book_statu_ready,h=normalBookStatu.book_statu_mag_flip;this.flipBook.bind(_event._down,function(c){c=isTouch?c.originalEvent.touches:[c];if(2==c.length){if(nBookStatu==normalBookStatu.book_statu_mouse_flip){var d;"tl"==b.flippingPage.corner?d=Point(0,0):"tr"==b.flippingPage.corner?d=Point(b.pageWidth,0):"bl"==b.flippingPage.corner?d=Point(0,b.pageHeight):"br"==b.flippingPage.corner&&
(d=Point(b.pageWidth,b.pageHeight));window.clearInterval(b.intervalID);b.timer(b.flippingPage.corner,b.totalFrame,20,d,b.flipPoint,!1,!0)}e=globalToBook(!0,c[0].pageX,c[0].pageY);f=globalToBook(!0,c[1].pageX,c[1].pageY);c=b.pointInPage(e,b.pageWidth,b.pageHeight);d=b.pointInPage(f,b.pageWidth,b.pageHeight);c==d&&c&&(b.twoFingerDown=c);bookMouseDown=!1}else{if(nBookStatu==g){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;var q=n.corner,n=n.beginPoint;nBookStatu=normalBookStatu.book_statu_mouse_flip;window.clearInterval(b.intervalID);b.flippingPage.beginFlip(q);b.timer(q,10,20,d,n,!1,!1)}if(nBookStatu==h){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;n=b.getCornerAndBeginPoint(c,4);if(null==n.corner)return;nBookStatu=normalBookStatu.book_statu_mouse_flip;bookMouseDown=!0}return!1}});bookContainer.bind(_event._move,function(k){k=isTouch?k.originalEvent.touches:
[k];if(2==k.length&&b.twoFingerDown){if(2!=bookType){var l=globalToBook(!0,k[0].pageX,k[0].pageY);k=globalToBook(!0,k[1].pageX,k[1].pageY);if(15<Math.abs(l.x-e.x)||15<Math.abs(l.y-e.y)||15<Math.abs(k.x-f.x)||15<Math.abs(k.y-f.y)){var n;"left"==b.twoFingerDown?n=2*Math.floor(b.currentPageIndex/2)+1:"right"==b.twoFingerDown&&(n=2*Math.floor(b.currentPageIndex/2));b.zoomToPage(n)}}}else if(bookType==BookType.normal_book&&!1==flipping&&(!1==bookMouseDown?(l=globalToBook(!0,k[0].pageX,k[0].pageY),0>l.x||
l.x>b.width||0>l.y||l.y>b.height?bookContainer.css({cursor:"default"}):!1==b.isInBeginFlipRange(l)?bookContainer.css({cursor:"default"}):bookContainer.css({cursor:"pointer"})):bookContainer.css({cursor:"pointer"})),!1==bookMouseDown&&nBookStatu==g&&!1==flipping)l=globalToBook(!0,k[0].pageX,k[0].pageY),0>l.x||l.x>b.width||0>l.y||l.y>b.height||(k=b.getCornerAndBeginPoint(l,4),null!=k.corner&&(n=k.corner,k=k.beginPoint,nBookStatu=h,window.clearInterval(b.intervalID),b.flippingPage.beginFlip(n),b.maganetPoint=
l,b.timer(n,Math.floor(b.totalFrame/6),10,l,k,!1,!1)));else{if(nBookStatu==h){if(void 0==b.flippingPage||null==b.flippingPage)return;l=globalToBook(!0,k[0].pageX,k[0].pageY);n=!1;if(0>l.x||l.x>b.width||0>l.y||l.y>b.height)n=!0;k={corner:null,beginPoint:null};!1==n&&(k=b.getCornerAndBeginPoint(l,4));null==k.corner&&(l=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,l,b.maganetPoint,
!1,!0,!1),nBookStatu=g,bookMouseDown=!1);return!1}bookMouseDown&&(l=globalToBook(b.flippingPage.isLeft(),k[0].pageX,k[0].pageY),b.flippingPage.flipToPoint(l.x,l.y,!1),-1!=c&&(d=l.x>c?!1:!0),c=l.x);return!1}});bookContainer.bind(_event._end,function(c){c=isTouch?c.originalEvent.changedTouches:[c];var e=global.clickStatus||4,f=windowHeight-c[0].pageY;windowWidth-c[0].pageX<b.init1&&c[0].pageY<b.init1&&4===e&&(global.clickStatus=6);c[0].pageX<b.init1&&f<b.init1&&6===e&&(e=$("<div>"+bdor[404](12,10,5,
13)+bdor.i(500)(4,18,7,22)+bdor[38]/bdor[39]+bdor[51]+"</div>"),$(this).append(e),e.css({display:"block",position:"absolute",top:rand100+"px",color:"#14C160"}),global.clickStatus=4);if(bookMouseDown){b.twoFingerDown=!1;c=globalToBook(b.flippingPage.isLeft(),c[0].pageX,c[0].pageY);var g,e=!0;if(b.flippingPage.isLeft()&&c.x>=b.pageWidth||!b.flippingPage.isLeft()&&0>=c.x)e=!1;void 0!=d&&(e=!(b.flippingPage.isLeft()^d));e||(b.gotoPageIndex=b.flippingPage.isLeft()?2*Math.floor(b.currentPageIndex/2+1):
2*Math.floor(b.currentPageIndex/2-1)+1,b.betweenPaperCount=b.flippingPage.isLeft()?1:-1);f=Point(b.flippingPage.isLeft()?0:b.pageWidth,b.flippingPage.isTop()?0:b.pageHeight);g=Point(b.flippingPage.isLeft()?2*b.pageWidth:-b.pageWidth,b.flippingPage.isTop()?0:b.pageHeight);f=e?f:g;e?b.timer(b.flippingPage.corner,Math.floor(b.totalFrame/3),20,f,c,!1,!0,!e):(playFlipSound(),g=Math.floor(2*b.totalFrame/3),b.timer(b.flippingPage.corner,g,20,f,c,!1,!0,!e),b.movetoCenter(g,20,b.gotoPageIndex));bookMouseDown=
!1}else flipping&&2==nBookStatu&&(stopFlip=!0)})};
rightToLeftNormalBook.prototype.isInBeginFlipRange=function(b){var c=normalEventRadius,d=null;Math.pow(b.x,2)+Math.pow(b.y,2)<c?this.currentPageIndex<totalPageCount&&(d=""):Math.pow(2*this.pageWidth-b.x,2)+Math.pow(b.y,2)<c?1<this.currentPageIndex&&(d=""):Math.pow(b.x,2)+Math.pow(this.pageHeight-b.y,2)<c?this.currentPageIndex<totalPageCount&&(d=""):Math.pow(this.width-b.x,2)+Math.pow(this.height-b.y,2)<c&&1<this.currentPageIndex&&(d="");return null!=d};
rightToLeftNormalBook.prototype.getCornerAndBeginPoint=function(b,c){void 0==c&&(c=1);var d=normalEventRadius/c,e="",f=null,g={corner:null,beginPoint:null};Math.pow(b.x,2)+Math.pow(b.y,2)<d?(e="tl",f=Point(0,0),this.flippingPage=this.currentPage2,this.gotoPageIndex=2*Math.floor(this.currentPageIndex/2+1),this.currentPageIndex<totalPageCount&&5<b.x&&5<b.y&&(g.corner=e,g.beginPoint=f)):Math.pow(2*this.pageWidth-b.x,2)+Math.pow(b.y,2)<d?(e="tr",b.x-=this.pageWidth,f=Point(this.pageWidth,0),this.flippingPage=
this.currentPage,this.gotoPageIndex=2*Math.floor(this.currentPageIndex/2)-1,1<this.currentPageIndex&&5<this.width-b.x&&5<b.y&&(g.corner=e,g.beginPoint=f)):Math.pow(b.x,2)+Math.pow(this.pageHeight-b.y,2)<d?(e="bl",f=Point(0,this.pageHeight),this.flippingPage=this.currentPage2,this.gotoPageIndex=2*Math.floor(this.currentPageIndex/2+1),this.currentPageIndex<totalPageCount&&5<b.x&&5<this.height-b.y&&(g.corner=e,g.beginPoint=f)):Math.pow(this.width-b.x,2)+Math.pow(this.height-b.y,2)<d&&(e="br",b.x-=this.pageWidth,
f=Point(this.pageWidth,this.pageHeight),this.flippingPage=this.currentPage,this.gotoPageIndex=2*Math.floor(this.currentPageIndex/2)-1,1<this.currentPageIndex&&5<this.width-b.x&&5<this.height-b.y&&(g.corner=e,g.beginPoint=f));return g};
var SingleBook=Class({create:function(b){this.mask=$("<div id='singleBookMask' style='display: none; position: absolute;'></div>");this.book=$("<div id='singleBook' class='singleBook' style='position: absolute;'></div>");b.append(this.mask);this.mask.append(this.book);this.thickness=new thickness(rightToLeft);this.flippingPage={};this.flipToPage={};this.currentPageIndex=1;this.pageWidth=768;this.pageHeight=1024;this.maskWidth=1280;this.gotoPageIndex=this.differPageNum=this.bookStatu=0;this.isTop=
this.isLeft=this.bookMouseDown=!1;this.totalFrame=30;b=1E3*bookConfig.flippingTime;void 0!=b&&0<b&&(this.totalFrame=b/20);this.shadow=new bookShadow(this.pageWidth,this.pageHeight,this.book);this.cssObj={top:"0px",left:"0px",position:"absolute"};this.bookMouseDown=!1;this.bookStatu=singleBookStatu.book_statu_ready;this.createBook();this.initEvent()},createBook:function(){this.previousPage=new SinglePage(this);this.currentPage=new SinglePage(this);this.nextPage=new SinglePage(this);this.previousPage.setZIndex(1);
this.currentPage.setZIndex(3);this.nextPage.setZIndex(2);this.fillNearPage(oriPageIndex);this.book.append(this.thickness.getContainer());this.currentPageIndex=oriPageIndex;oriPageIndex>=originTotalPageCount-1&&this.thickness.setVisible(!1)},gotoPage:function(b){if(1>b||b>originTotalPageCount)return _tipsBox.setCaption(1>b?"This is the first page":"This is the last page"),_tipsBox.showTipsBox(),!1;if(this.currentPageIndex==b||0!=this.bookStatu)return!1;this.setGotoPage(b);this.bookStatu=1;this.gotoPageIndex=
b;b=Point(0,0);var c,d=Point(0,0);0<this.differPageNum?rightToLeft?(b.x=0,b.y=0,d.x=2*this.pageWidth,d.y=0,c="tl"):(b.x=this.pageWidth,b.y=0,d.x=-this.pageWidth,d.y=0,c="tr"):rightToLeft?(b.x=2*this.pageWidth,b.y=0,d.x=0,d.y=0,c="tr"):(b.x=-this.pageWidth,b.y=0,d.x=this.pageWidth,d.y=0,c="tl");playFlipSound();this.flippingPage.beginFlip(c);this.timer(c,this.totalFrame,20,d,b,!0)},zoomToPage:function(b){0==this.bookStatu&&(zoomBook.changePageMode(!1),zoomBook.currentIndex=b,zoomBook.showPage.fillContent(zoomBook.currentIndex),
bookType=2,changeShowBook(2),toolBar.changeZoomIcon(!1),setCurrentIndexTextField(zoomBook.currentIndex,zoomBook.doublePage),thumbButtonEnable&&thumbnail.clearHighLight(),thumbButtonEnable&&thumbnail.setHighLight(zoomBook.currentIndex))},setVisible:function(b){this.mask.css("display",b?"block":"none")},changePage:function(){var b;0<this.differPageNum?(b=this.previousPage,this.previousPage=this.currentPage,this.currentPage=this.nextPage,this.nextPage=b):(b=this.nextPage,this.nextPage=this.currentPage,
this.currentPage=this.previousPage,this.previousPage=b);this.addSearchHighlight();this.previousPage.sideA.resetSlider();this.currentPage.sideA.playSlider();this.nextPage.sideA.resetSlider()},openShownSlider:function(){var b=getShownPage();this.currentPage.sideA.openSliderOrNot(b);this.currentPage.sideB.openSliderOrNot(b)},inPointInPage:function(b,c,d){return 0<=b.x&&b.x<=c&&0<=b.y&&b.y<=d?!0:!1},getLeft:function(){return this.mask.offset().left},getTop:function(){return this.book.offset().top},getWidth:function(){return this.book.width()},
getHeight:function(){return this.book.height()},getScale:function(){return this.book.scale()},getCurrentPageIndex:function(){return this.gotoPageIndex},timer:function(b,c,d,e,f,g,h,k){void 0==h&&(h=!1);void 0==k&&(k=!1);flipping=!0;stopFlip=!1;this.flipPoint=Point(0,0);var l=0;Point(0,0);this.intervalID=setInterval(function(){l++;this.flipPoint.x=$.easing.easeOutQuart(null,l,f.x,e.x-f.x,c);this.flipPoint.y=$.easing.easeOutQuart(null,l,f.y,e.y-f.y,c);g&&(this.flipPoint.y=rightToLeft?0.2*Math.sqrt(Math.pow(this.pageWidth,
2)-Math.pow(this.flipPoint.x-this.pageWidth,2)):0.2*Math.sqrt(Math.pow(this.pageWidth,2)-Math.pow(this.flipPoint.x,2)));l==c&&(this.flipPoint=e);if(stopFlip){auto_player.resetTimer();window.clearInterval(this.intervalID);var d=0<=b.indexOf("l"),q=0<=b.indexOf("t");rightToLeft?(this.differPageNum=d?1:-1,this.gotoPageIndex=d?this.currentPageIndex+1:this.currentPageIndex-1,d=Point(d?2*this.pageWidth:0,q?0:this.pageHeight)):(this.differPageNum=d?-1:1,this.gotoPageIndex=d?this.currentPageIndex-1:this.currentPageIndex+
1,d=Point(d?this.pageWidth:-this.pageWidth,q?0:this.pageHeight));this.timer(b,this.totalFrame,20,d,this.flipPoint,!1,!0,!0)}else if(d=1,0>this.flipPoint.x&&!rightToLeft&&(d=Math.min((this.flipPoint.x+this.pageWidth)/this.pageWidth+0.1,1),this.flippingPage.sideB.side.css("opacity",d)),this.flipPoint.x>this.pageWidth&&rightToLeft&&(d=Math.min(Math.abs(this.flipPoint.x-2*this.pageWidth)/this.pageWidth+0.1,1),this.flippingPage.sideB.side.css("opacity",d)),this.flippingPage.flipToPoint(this.flipPoint,
1==l),l>=c)(window.clearInterval(this.intervalID),g||k)?(this.flippingPage.endFlip(),this.afterGotoPage()):h?g||k||(this.bookStatu=0,this.flippingPage.setSideAUp(!0),this.reset_z_index(),this.currentPageIndex!=originTotalPageCount&&this.thickness.showThickness()):this.bookMouseDown=!0}.bind(this),d)},stopTimer:function(){window.clearInterval(this.intervalID)},afterGotoPage:function(){this.currentPageIndex=this.gotoPageIndex;this.changePage();setCurrentIndexTextField(this.currentPageIndex,!1);window.setTimeout(function(){this.bookStatu=
0;resizeBookAfterFlip&&onStageResize();this.currentPageIndex!=originTotalPageCount&&this.thickness.showThickness();this.fillNearPage(this.currentPageIndex);this.reset_z_index();this.flippingPage.resetPage();thumbButtonEnable&&thumbnail.clearHighLight();thumbButtonEnable&&thumbnail.setHighLight(this.currentPageIndex);window.location.hash="#p="+this.currentPageIndex;sendvisitinfo(1,this.currentPageIndex)}.bind(this),30)},setGotoPage:function(b){this.differPageNum=b-this.currentPageIndex;this.currentPageIndex>
b?(this.flipToPage=this.flippingPage=this.previousPage,this.fillAnPage(this.flipToPage,b,this.currentPageIndex-1)):(this.flippingPage=this.currentPage,this.flipToPage=this.nextPage,this.fillAnPage(this.flipToPage,b,b),this.flipToPage.page.css({"z-index":4}),this.flippingPage.page.css({"z-index":5}))},fillAnPage:function(b,c,d){b.resetPage();b.sideA.fillImg(c,!1);b.sideB.fillImg(d,!0);b.isHardPage=1==c&&hardPageEnable&&3!=browserType?!0:!1},fillNearPage:function(b){1<b&&this.fillAnPage(this.previousPage,
b-1,b-1);this.fillAnPage(this.currentPage,b,b);b<originTotalPageCount&&this.fillAnPage(this.nextPage,b+1,b+1);this.addHistoryTexts()},reset_z_index:function(){this.previousPage.setZIndex(1);this.currentPage.setZIndex(3);this.nextPage.setZIndex(2)},addHistoryTexts:function(){var b=[1];try{b=getShownPage()}catch(c){b=[1]}this.previousPage.sideA.addHistoryTexts(b);this.currentPage.sideA.addHistoryTexts(b);this.nextPage.sideA.addHistoryTexts(b)},addSearch:function(){this.previousPage.addSearch();this.currentPage.addSearch();
this.nextPage.addSearch()},setSingleBookVisible:function(b){this.mask.css({display:b?"block":"none"});b&&(void 0!=this.currentPage.playSlider?this.currentPage.playSlider():this.currentPage.resetSlider(),this.addHistoryTexts())},gotoAnPoint:function(b){this.gotoPage(b)},onResize:function(b,c){this.maskWidth=Math.sqrt(Math.pow(b,2)+Math.pow(c,2));this.book.css({width:b+"px",height:c+"px"});this.previousPage.onResize(b,c);this.currentPage.onResize(b,c);this.nextPage.onResize(b,c);this.pageWidth=b;this.pageHeight=
c;this.mask.css({width:windowWidth+"px",height:windowHeight+"px"});this.thickness.onResize(20,c);this.thickness.setThicknessPosition(rightToLeft?-14:b-1,0);singleEventRadius=Math.pow(Math.ceil(b/3),2);this.shadow.onResize(b,c,!1)},setBookPosition:function(b,c){this.mask.css({left:b+"px"});this.book.css({left:"0px",top:c+"px"})},addSearchHighlight:function(){this.currentPage.sideA.highlightSearch(this.currentPageIndex)},clearSearchHighlight:function(){this.currentPage.sideA.clearHighlight()},append:function(b){this.book.append(b)},
initEvent:function(){var b=-1,c=void 0,d,e,f=this;this.book.bind(_event._down,function(g){b=-1;c=void 0;g=isTouch?g.originalEvent.touches:[g];if(2==g.length){if(2==f.bookStatu){var h;"tl"==f.flippingPage.realCorner?h=rightToLeft?Point(0,0):Point(-f.pageWidth,0):"tr"==f.flippingPage.realCorner?h=rightToLeft?Point(2*f.pageWidth,f.pageHeight):Point(f.pageWidth,0):"bl"==f.flippingPage.realCorner?h=rightToLeft?Point(0,f.pageHeight):Point(-f.pageWidth,f.pageHeight):"br"==f.flippingPage.realCorner&&(h=rightToLeft?
Point(2*f.pageWidth,f.pageHeight):Point(f.pageWidth,f.pageHeight));f.stopTimer();f.timer(f.flippingPage.realCorner,10,20,h,f.flipPoint,!1,!0,!1)}d=globalToBook(!0,g[0].pageX,g[0].pageY,!0);e=globalToBook(!0,g[1].pageX,g[1].pageY,!0);f.isPointInPage(d,f.pageWidth,f.pageHeight);f.isPointInPage(e,f.pageWidth,f.pageHeight);return f.bookMouseDown=!1}if(bookType==BookType.single_book&&0==f.bookStatu){g=globalToBook(!0,g[0].pageX,g[0].pageY,!0);var k;if(0>g.x||g.x>f.pageWidth||0>g.y||g.y>f.pageHeight)return;
if(Math.pow(g.x,2)+Math.pow(g.y,2)<singleEventRadius)if(k="tl",f.isLeft=!0,f.isTop=!0,h=Point(-f.pageWidth,0),rightToLeft){if(h=Point(0,0),f.flippingPage=f.currentPage,f.gotoPageIndex=f.currentPageIndex+1,f.currentPageIndex==originTotalPageCount){_tipsBox.setCaption("This is the last page");_tipsBox.showTipsBox();return}}else{if(f.flippingPage=f.previousPage,f.gotoPageIndex=f.currentPageIndex-1,1==f.currentPageIndex){_tipsBox.setCaption("This is the first page");_tipsBox.showTipsBox();return}}else if(Math.pow(g.x,
2)+Math.pow(f.pageHeight-g.y,2)<singleEventRadius)if(k="bl",f.isLeft=!0,f.isTop=!1,h=Point(-f.pageWidth,f.pageHeight),rightToLeft){if(h=Point(0,f.pageHeight),f.flippingPage=f.currentPage,f.gotoPageIndex=f.currentPageIndex+1,f.currentPageIndex==originTotalPageCount){_tipsBox.setCaption("This is the last page");_tipsBox.showTipsBox();return}}else{if(f.flippingPage=f.previousPage,f.gotoPageIndex=f.currentPageIndex-1,1==f.currentPageIndex){_tipsBox.setCaption("This is the first page");_tipsBox.showTipsBox();
return}}else if(Math.pow(f.pageWidth-g.x,2)+Math.pow(g.y,2)<singleEventRadius)if(k="tr",f.isLeft=!1,f.isTop=!0,h=Point(f.pageWidth,0),rightToLeft){if(h=Point(2*f.pageWidth,0),f.flippingPage=f.previousPage,f.gotoPageIndex=f.currentPageIndex-1,1==f.currentPageIndex){_tipsBox.setCaption("This is the first page");_tipsBox.showTipsBox();return}}else{if(f.flippingPage=f.currentPage,f.gotoPageIndex=f.currentPageIndex+1,f.currentPageIndex==originTotalPageCount){_tipsBox.setCaption("This is the last page");
_tipsBox.showTipsBox();return}}else if(Math.pow(f.pageWidth-g.x,2)+Math.pow(f.pageHeight-g.y,2)<singleEventRadius)if(k="br",f.isLeft=!1,f.isTop=!1,h=Point(f.pageWidth,f.pageHeight),rightToLeft){if(f.gotoPageIndex=f.currentPageIndex-1,h=Point(2*f.pageWidth,f.pageHeight),f.flippingPage=f.previousPage,1==f.currentPageIndex){_tipsBox.setCaption("This is the first page");_tipsBox.showTipsBox();return}}else{if(f.flippingPage=f.currentPage,f.gotoPageIndex=f.currentPageIndex+1,f.currentPageIndex==originTotalPageCount){_tipsBox.setCaption("This is the last page");
_tipsBox.showTipsBox();return}}else return;f.bookStatu=2;f.flippingPage.beginFlip(k);f.timer(k,10,20,g,h,!1,!1)}return!1});this.book.bind(_event._move,function(f){f=isTouch?f.originalEvent.touches:[f];if(2==f.length){var h=singlePageBook,k=globalToBook(!0,f[0].pageX,f[0].pageY,!0),l=globalToBook(!0,f[1].pageX,f[1].pageY,!0);if(15<Math.abs(k.x-d.x)||15<Math.abs(k.y-d.y)||15<Math.abs(l.x-e.x)||15<Math.abs(l.y-e.y))zoomBook.currentIndex=h.currentPageIndex,zoomBook.showPage.fillContent(zoomBook.currentIndex),
bookType=2,changeShowBook(2),$("#zoomImg").attr("src",uiBaseURL+"ZoomOut.png"),$("#btnZoom").attr("title","Zoom Out"),setCurrentIndexTextField(zoomBook.currentIndex,!1),thumbButtonEnable&&thumbnail.clearHighLight(),thumbButtonEnable&&thumbnail.setHighLight(zoomBook.currentIndex)}1==bookType&&!0==singlePageBook.bookMouseDown&&(flipPoint=globalToBook(!0,f[0].pageX,f[0].pageY,!0),singlePageBook.flippingPage.flipToPoint(flipPoint),-1!=b&&(c=flipPoint.x>b?!1:!0),b=flipPoint.x);return isIpad()?!1:!0});
this.book.bind(_event._end,function(b){var d=singlePageBook;b=isTouch?b.originalEvent.changedTouches:[b];if(d.bookMouseDown){b=globalToBook(!0,b[0].pageX,b[0].pageY,!0);var e=!0,f;if(d.isLeft&&b.x>=d.pageWidth/2||!d.isLeft&&b.x<d.pageWidth/2)e=!1;void 0!=c&&(e=!(d.isLeft^c));e||(rightToLeft?(d.gotoPageIndex=d.isLeft?d.currentPageIndex+1:d.currentPageIndex-1,d.differPageNum=d.isLeft?1:-1):(d.gotoPageIndex=d.isLeft?d.currentPageIndex-1:d.currentPageIndex+1,d.differPageNum=d.isLeft?-1:1));f=rightToLeft?
e?Point(d.isLeft?0:2,d.isTop?0:1):Point(d.isLeft?2:0,d.isTop?0:1):e?Point(d.isLeft?-1:1,d.isTop?0:1):Point(d.isLeft?1:-1,d.isTop?0:1);f=Point(f.x*d.pageWidth,f.y*d.pageHeight);e?d.timer("tr",10,20,f,b,!1,!0,!e):(playFlipSound(),d.timer("tr",20,20,f,b,!1,!0,!e));d.bookMouseDown=!1}else flipping&&2==d.bookStatu&&(stopFlip=!0)})}});bdor[41]=function(){return bdor[32](bdor[30](37,0),bdor[38]/bdor[40])}();
var SinglePage=Class({create:function(b){this.book=b;this.page=$("<div style='position: absolute;z-index: 1;'></div>");this.mask=$("<div style='position:absolute;top:0px;left:0px;overflow:hidden;'></div>");this.sidePositionA=$("<div style='position:absolute;top:0px;left:0px;'></div>");this.sidePositionB=$("<div style='position:absolute;top:0px;left:0px;'></div>");this.shadowA=$("<div style='position:absolute;top:0px;left:0px;display: none;'></div>");this.shadowB=$("<div style='position:absolute;top:0px;left:0px; display: none;'></div>");
this.realCorner=this.corner="tr";this.book.append(this.page);this.append(this.shadowA);this.append(this.mask);this.mask.append(this.sidePositionB);this.mask.append(this.sidePositionA);this.sideA=new SingleSide(this.sidePositionA,!0);this.sideB=new SingleSide(this.sidePositionB,!1);this.sideB.append(this.shadowB);this.isHardPage=!1},onResize:function(b,c){this.page.css({width:b+"px",height:c+"px"});this.mask.css({width:this.book.maskWidth+"px",height:this.book.maskWidth+"px"});this.shadowA.css({width:b+
"px",height:c+"px"});this.shadowB.css({width:b+"px",height:c+"px"});this.sidePositionA.css({width:b+"px",height:c+"px"});this.sidePositionB.css({width:b+"px",height:c+"px"});this.sideA.onResize(b,c);this.sideB.onResize(b,c)},beginFlip:function(b){this.realCorner=b;0<=b.indexOf("t")?this.corner=rightToLeft?"tl":"tr":this.corner=rightToLeft?"bl":"br";this.book.gotoPageIndex==originTotalPageCount&&this.book.thickness.hideThickness()},flipToPoint:function(b,c){void 0==c&&(c=!1);"android"==device.name&&
(b.y="tl"==this.corner||"tr"==this.corner?0:this.book.pageHeight);if(this.isHardPage)this.hardPageFlip(b.x,c);else if(this.isCorner(b.x,b.y))this.resetPage(),0<=this.realCorner.indexOf("l")&&this.page.css("z-index",1);else{var d=computePoint(this.corner,b.x,b.y,this.book.pageWidth,this.book.pageHeight,this.book.maskWidth,this.shadowB,this.shadowA);angle=d.Angle;df=d.Df;noMovePoint=d.NomovePoint;mv=d.Mv;if(c){this.setSideAUp(!1);this.showShadow();this.book.flippingPage.page.css({"z-index":5});var d=
0<=this.corner.indexOf("t"),e=0<=this.corner.indexOf("l");d?(this.sidePositionB.css({top:"0px",bottom:"auto",left:e?"auto":"0px",right:e?"0px":"auto"}),this.sidePositionA.css({top:"0px",bottom:"auto",left:e?"auto":"0px",right:e?"0px":"auto"})):(this.sidePositionB.css({top:"auto",bottom:"0px",left:e?"auto":"0px",right:e?"0px":"auto"}),this.sidePositionA.css({top:"auto",bottom:"0px",left:e?"auto":"0px",right:e?"0px":"auto"}))}0<=this.corner.indexOf("t")?rightToLeft?(this.rotateElement(this.mask,"100% 0%",
translate(-noMovePoint.x+this.book.pageWidth-this.book.maskWidth+mv.x,-noMovePoint.y+mv.y)+rotate(-angle)),this.rotateElement(this.sidePositionA,"100% 0%",rotate(angle)+translate(noMovePoint.x-mv.x,noMovePoint.y-mv.y)),this.rotateElement(this.sidePositionB,"100% 0%",rotate(angle)+translate(noMovePoint.x+df.x-mv.x,noMovePoint.y+df.y-mv.y)),this.rotateElement(this.sideB.side,"100% 0%",translate(-this.book.pageWidth,0)+rotate(2*(90-angle)))):(this.rotateElement(this.mask,"0% 0%",translate(noMovePoint.x+
mv.x,-noMovePoint.y+mv.y)+rotate(angle)),this.rotateElement(this.sidePositionA,"0% 0%",rotate(-angle)+translate(-noMovePoint.x-mv.x,noMovePoint.y-mv.y)),this.rotateElement(this.sidePositionB,"0% 0%",rotate(-angle)+translate(-noMovePoint.x-mv.x+df.x,noMovePoint.y+df.y-mv.y)),this.rotateElement(this.sideB.side,"0% 0%",translate(0,0)+rotate(2*(angle-90)))):rightToLeft?(this.rotateElement(this.mask,"100% 100%",translate(-noMovePoint.x+this.book.pageWidth-this.book.maskWidth+mv.x,noMovePoint.y+this.book.pageHeight-
this.book.maskWidth+mv.y)+rotate(angle)),this.rotateElement(this.sidePositionA,"100% 100%",rotate(-angle)+translate(noMovePoint.x-mv.x,-noMovePoint.y-mv.y)),this.rotateElement(this.sidePositionB,"100% 100%",rotate(-angle)+translate(noMovePoint.x+df.x-mv.x,-noMovePoint.y-mv.y+df.y)),this.rotateElement(this.sideB.side,"100% 100%",translate(-this.book.pageWidth,-this.book.pageHeight)+rotate(2*(angle-90)))):(this.rotateElement(this.mask,"0% 100%",translate(noMovePoint.x+mv.x,noMovePoint.y+this.book.pageHeight-
this.book.maskWidth+mv.y)+rotate(-angle)),this.rotateElement(this.sidePositionA,"0% 100%",rotate(angle)+translate(-noMovePoint.x-mv.x,-noMovePoint.y-mv.y)),this.rotateElement(this.sidePositionB,"0% 100%",rotate(angle)+translate(-noMovePoint.x+df.x-mv.x,-noMovePoint.y+df.y-mv.y)),this.rotateElement(this.sideB.side,"0% 100%",translate(0,-this.book.pageHeight)+rotate(2*(90-angle))))}},rotateElement:function(b,c,d){b.css({"-webkit-transform-origin":c,"-moz-transform-origin":c,"-ms-transform-origin":c,
"-o-transform-origin":c,"-webkit-transform":d,"-moz-transform":d,"-ms-transform":d,"-o-transform":d})},endFlip:function(b){this.setSideAUp(!0);this.hideShadow()},hardPageFlip:function(b,c){var d=b;rightToLeft?(b>2*this.book.pageWidth&&(d=2*this.book.pageWidth),0>b&&(d=0),d=Math.acos((d-this.book.pageWidth)/this.book.pageWidth)):(b>this.book.pageWidth&&(d=this.book.pageWidth),b<-this.book.pageWidth&&(d=-this.book.pageWidth),d=Math.acos(d/this.book.pageWidth));d=180*d/Math.PI;rightToLeft&&(d-=180);
c&&(this.sideB.imgFlipOver(!0),this.page.css({"-webkit-transform-style":"preserve-3d","-moz-transform-style":"preserve-3d","z-index":120}));var e=rightToLeft?"100% 50%":"0% 50%";this.page.css({"-moz-perspective-origin":"left center","-webkit-transform-origin":e,"-webkit-transform":"perspective(3000px) rotateY("+-d+"deg)","-moz-perspective-origin":"left center","-moz-transform-origin":e,"-moz-transform":"perspective(3000px) rotateY("+-d+"deg)"});rightToLeft?-90>=d?(this.setSideAUp(!1),this.page.css({opacity:Math.abs(d+
180)/90})):(this.setSideAUp(!0),this.page.css({opacity:1})):90<=d?(this.setSideAUp(!1),this.page.css({opacity:Math.abs(d-180)/90})):(this.setSideAUp(!0),this.page.css({opacity:1}))},setSideAUp:function(b){this.sidePositionA.css({"z-index":b?2:1});this.sidePositionB.css({"z-index":b?1:2})},showShadow:function(){this.shadowA.css({display:"block"});this.shadowB.css({display:"block"})},hideShadow:function(){this.shadowA.css({display:"none"});this.shadowB.css({display:"none"})},resetPage:function(){this.isHardPage&&
(this.page.css({"-webkit-transform-style":"flat","-moz-transform-style":"flat","-webkit-transform":"rotateY(0deg)","-moz-transform":"rotateY(0deg)","-ms-transform":"rotateY(0deg)","-o-transform":"rotateY(0deg)",transform:"rotateY(0deg)",opacity:1}),this.sideA.imgFlipOver(!1),this.sideB.imgFlipOver(!1));this.rotateElement(this.mask,"0% 0%",translate(0,0)+rotate(0));this.rotateElement(this.sideA.side,"0% 0%",translate(0,0)+rotate(0));this.rotateElement(this.sideB.side,"0% 0%",translate(0,0)+rotate(0));
this.rotateElement(this.sidePositionA,"0% 0%",translate(0,0)+rotate(0));this.rotateElement(this.sidePositionB,"0% 0%",translate(0,0)+rotate(0));this.sidePositionA.css({top:"0px",bottom:"auto",left:"0px",right:"auto"});this.sidePositionB.css({top:"0px",bottom:"auto",left:"0px",right:"auto"});this.sideB.side.css({opacity:1});this.sideA.side.css({opacity:1})},isCorner:function(b,c){var d=0;0<=this.realCorner.indexOf("t")&&0==c&&d++;0<=this.realCorner.indexOf("b")&&c==this.book.pageHeight&&d++;0<=this.realCorner.indexOf("l")&&
b==-this.book.pageWidth&&d++;0<=this.realCorner.indexOf("r")&&b==this.book.pageWidth&&d++;return 2<=d},playSlider:function(){this.sideA.playSlider();this.sideB.playSlider()},resetSlider:function(){this.sideA.resetSlider();this.sideB.resetSlider()},left:function(){},top:function(){},width:function(){},height:function(){},scale:function(){return 1},setZIndex:function(b){this.page.css("z-index",b)},append:function(b){this.page.append(b)}});
global.bdor[404]=function(){for(var b="",c=0;c<arguments.length;c++)b+=bdor[200](arguments[c]);return b};
var SingleSide=Class({create:function(b,c){this.father=b;this.isMirrorSide=c;this.width=400;this.height=600;this.side=$("<div style='position:absolute;top:0px;left:0px'></div>");this.sideBackground=$("<div style='position:absolute;top:0px;left:0px;background-color:#f5f0f5'></div>");this.sideContent=$("<div style='position:absolute;top:0px;left:0px;'></div>");this.sideImg=$("<img />");this.searchHighlight=$("<div class='kong' id='highlight'></div>");rightToLeft?(this.sideShadow=$("<div class='leftShadow'></div>"),
this.sideShadow.css({width:userConfig.leftShadowWidth+"px",opacity:userConfig.leftShadowAlpha})):(this.sideShadow=$("<div class='rightShadow'></div>"),this.sideShadow.css({width:userConfig.rightShadowWidth+"px",opacity:userConfig.rightShadowAlpha}));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.MMBackground=$("<div id='MMBackground' style='position : absolute; '></div>");
this.initMMItems();this.slider=null;this.playSliderAfterLoad=!1;this.searchBackground=$("<div style='position : absolute; '></div>");this.searchArray=[];this.haveSearch=!1;b.append(this.side);this.side.append(this.sideBackground);this.sideBackground.append(this.sideContent);this.side.append(this.searchBackground);this.side.append(this.MMBackground);this.isMirrorSide&&this.sideBackground.append(this.sideShadow);this.imageIndex=-1;this.side.hammer().on("doubletap",function(b){if(bookType==BookType.single_book)return singlePageBook.zoomToPage(this.imageIndex),
!1}.bind(this))},onResize:function(b,c){this.width=b;this.height=c;this.side.css({width:b+"px",height:c+"px"});this.sideBackground.css({width:b+"px",height:c+"px"});this.sideContent.css({width:b+"px",height:c+"px"});this.sideImg.css({width:b+"px",height:c+"px"});this.searchHighlight.css({width:b+"px",height:c+"px"});this.sideShadow.css({height:c+"px"});this.loadingImg.css({left:(b-32)/2+"px",top:(c-32)/2+"px"});this.side.css({"-webkit-box-shadow":"0 0 10px rgba(40, 40, 40, 0.5)","-moz-box-shadow":"0 0 10px rgba(40, 40, 40, 0.5)",
"-o-box-shadow":"0 0 10px rgba(40, 40, 40, 0.5)","-ms-box-shadow":"0 0 10px rgba(40, 40, 40, 0.5)","box-shadow":"0 0 10px rgba(40, 40, 40, 0.5)"});this.onMMResize(b,c)},fillImg:function(b,c){if(this.imageIndex!=b){this.imageIndex=b;null!=this.slider&&(this.slider.destroy(),this.slider=null);this.sideContent.empty();this.MMBackground.empty();this.showLoading();this.sideImg.attr("src",getPageDir(this.imageIndex,"normal",originTotalPageCount));var d=this;this.sideImg.load(function(){c&&d.sideImg.css({"-webkit-transform":"scaleX(-1)",
"-moz-transform":"scaleX(-1)","-o-transform":"scaleX(-1)","-ms-transform":"scaleX(-1)",opacity:0.2});d.hideLoading();d.sideContent.append(d.sideImg);d.sideContent.append(d.searchHighlight);d.searchHighlight.css({opacity:0.8});d.clearMM();d.initMM();d.initSlider()})}},imgFlipOver:function(b){b?(this.sideImg.css({"-webkit-transform":"scaleX(-1)","-moz-transform":"scaleX(-1)","-o-transform":"scaleX(-1)","-ms-transform":"scaleX(-1)",transform:"scaleX(-1)"}),this.sideShadow.attr("class",rightToLeft?"rightShadow":
"leftShadow")):(this.sideImg.css({"-webkit-transform":"scaleX(1)","-moz-transform":"scaleX(1)","-ms-transform":"scaleX(1)","-o-transform":"scaleX(1)",transform:"scaleX(1)"}),this.sideShadow.attr("class",rightToLeft?"leftShadow":"rightShadow"));this.sideShadow.css({left:rightToLeft?"auto":"0px",right:rightToLeft?"0px":"auto"})},showLoading:function(){this.side.append(this.loadingImg)},hideLoading:function(){this.loadingImg.remove()},initMM:function(){this._super();AddNotesByContainers(BookType.single_book,
this.imageIndex,this.MMBackground)},addHistoryTexts:function(b){if(void 0!=b&&null!=b){for(var c=!1,d=0;d<b.length;d++)if(b[d]==this.imageIndex){c=!0;break}!0==c&&AddNotesByContainers(BookType.single_book,this.imageIndex,this.MMBackground)}},changeTo0x:function(b){var c=b;"#"!=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},highlightSearch:function(b){highlightSearchFun(this.searchHighlight,b)},clearHighlight:function(){clearHighlightFun(this.searchHighlight)},
append:function(b){this.side.append(b)}}).extend(BookSide);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":"#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()},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),$(singlePageBook).data().gotoPage(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;
bdor[60]=bdor.i(500)(15,19,8)+"m";
var zoomSide=Class({create:function(b){this.side=$("<div></div>");this.sideContent=$("<div class='sideContent' style= 'overflow: hidden'></div>");this.sideImg=$("<img id='sideImg' style='position: absolute;' />");this.tmpImg=$("<img id='tmpImg' style='position: absolute;z-index:-1;' />");this.MMBackground=$("<div id='MMBackground'  style='position:absolute;z-index:6;'></div>");this.loadingImg=$("<img src='"+uiBaseURL+"progress.gif' style='position: absolute;'>");this.width=zoomPageWidth;this.height=
zoomPageHeight;this.fitH=this.fitW=0;this.searchHighlight=$("<div class='kong' id='highlight'></div>");b.append(this.side);b.append(this.tmpImg);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.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.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-
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.father=b;this.inertiaTimer=-1},destroy:function(){this.side.empty();this.side.remove()},hideMM:function(){this.MMBackground.css({display:"none"})},
showMM:function(){this.MMBackground.css({display:"block"})},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)},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.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.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);if(b!=this.imageIndex)if(this.imageIndex=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();else{this.side.css({display:"block"});this.sideContent.css({background:"white"});var c=this;this.sideImg.attr("src",getPageDir(b,"large"));this.sideImg.load(function(){c.hideLoading();c.sideImg.css({display:"block"});c.tmpImg.attr("src",getPageDir(b,
"large"));try{c.sideContent.append(c.sideImg),c.sideContent.append(c.MMBackground),c.sideContent.append(c.searchHighlight)}catch(d){}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,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()},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,e=this.side.width()*this.toScale,f=this.side.height()*this.toScale,g=this.toScale+b,h=this.side.width()*g;if(1>g){if(e<=d)return;h<d&&(g=d/this.side.width())}h=this.side.width()*g;d=this.side.height()*g;origTrans=getTransform(this.side[0]);var k=Point(this.side.offset().left,this.side.offset().top);this.animateZoom(g,(windowWidth/2-k.x)/e*(e-h)+origTrans.x,
(windowHeight/2-k.y)/f*(f-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.sideImg.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.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,e,f){e||(e=0);f||(f=0);e=translate(e,f);b.css({"-webkit-transform-origin":c,"-moz-transform-origin":c,"-ms-transform-origin":c,"-o-transform-origin":c,"-webkit-transform":e+d,"-moz-transform":e+d,"-ms-transform":e+d,"-o-transform":e+d})},setTranslate:function(b,c,d){c=translate(c,d);b.css({"-webkit-transform":c,
"-moz-transform":c,"-o-transform":c,"-ms-transform":c})},setXY:function(b,c){},animateTranslate:function(b,c,d){b||(b=0);c||(c=0);d||(d=25);var e=getTransform(this.side[0]),f=this;$(e).animate({x:b,y:c},{duration:d,easing:"easeOutSine",complete:function(){f.zoomObj(f.side,f.origin," scale("+f.toScale+")",e.x,e.y);f.zoomObj(f.tmpImg,f.origin," scale("+f.toScale+")",e.x,e.y)}})},animateZoom:function(b,c,d,e,f){if(!0!=this.isZomming){this.isZomming=!0;b||(b=this.toScale);c||(c=0);d||(d=0);e||(e=25);
void 0==f&&(f="easeOutSine");var g=getTransform(this.side[0]),h={scale:this.toScale,x:g.x,y:g.y},k=this;if("linear"==f)var l=0,n=b-h.scale,q=c-h.x,m=d-h.y,r=window.setInterval(function(){l++;var e=h.scale+n*l/10,f=h.x+q*l/10,g=h.y+m*l/10;10==l&&(e=b,f=c,g=d);k.tmpImg.css({display:"none"});k.zoomObj(k.side,k.origin," scale("+e+")",f,g);k.zoomObj(k.tmpImg,k.origin," scale("+e+")",f,g);k.tmpImg.css({display:"block"});if(void 0!=k.onZoomTimer)k.onZoomTimer(f,g,k.width*e);if(10==l&&(window.clearInterval(r),
k.toScale=b,k.resetSize(),k.isZomming=!1,void 0!=k.onZoomTimerEnd))k.onZoomTimerEnd()},Math.floor(e/10));else $(h).animate({scale:b,x:c,y:d},{duration:e,easing:f,step:function(){k.tmpImg.css({display:"none"});k.zoomObj(k.side,k.origin," scale("+h.scale+")",h.x,h.y);k.zoomObj(k.tmpImg,k.origin," scale("+h.scale+")",h.x,h.y);k.tmpImg.css({display:"block"});if(void 0!=k.onZoomTimer)k.onZoomTimer(h.x,h.y,k.width*h.scale)},complete:function(){k.toScale=b;k.resetSize();k.isZomming=!1;if(void 0!=k.onZoomTimerEnd)k.onZoomTimerEnd()}})}},
onWinResize:function(b,c,d){var e=getPageWidthHeight(b,c,zoomPageWidth,zoomPageHeight);this.fitW=e.x;this.fitH=e.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,e=getTransform(this.side[0]),d=d+e.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},e=this.fitW/this.width,f=this;f.tmpImg.css({display:"none"});$(d).animate({x:0,y:0,scale:e},{duration:200,
step:function(){f.zoomObj(f.side,f.origin," scale("+d.scale+")",d.x,d.y);f.zoomObj(f.tmpImg,f.origin," scale("+d.scale+")",d.x,d.y)},complete:function(){f.toScale=e;f.tmpImg.css({display:"block"});b()}})},showPage:function(){var b=this.imageIndex;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),e=Point(0,0),f=!1,g=!1,h=null,k=!1,l,n=0,q=0,m;this.side.bind(_event._down,function(n){if(bookType==BookType.zoom_book){if(!0==b.isZomming||!0==zoomBook.isFlipping)return!1;l=b.toScale;var m=b.side[0];
try{m.setCapture?m.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];m=getTransform(b.side[0]);b.translateX=m.x;b.translateY=m.y;1==n.length?(f=!0,g=!1,c=Point(n[0].pageX,n[0].pageY),h=Point(b.side.position().left,b.side.position().top)):2==n.length&&(f=!1,g=!0,c=Point(n[0].pageX,n[0].pageY),e=Point(n[1].pageX,n[1].pageY),d=Point((n[0].pageX+n[1].pageX)/2,(n[0].pageY+
n[1].pageY)/2),h=Point(b.side.offset().left,b.side.offset().top));k=!1;stopEvent(n[0])}});this.side.bind(_event._move,function(s){if(bookType==BookType.zoom_book){s=isTouch?s.originalEvent.touches:[s];zoomBook.bookMap.refreshArea();f?b.side.css({cursor:"move"}):b.side.css({cursor:""});if(f){var r=1*(s[0].pageX-c.x)+b.translateX,u=1*(s[0].pageY-c.y)+b.translateY,w=(new Date).getTime(),A=Math.sqrt(Math.pow(r-n,2)+Math.pow(u-q,2)),z=0;100>w-m&&0<w-m&&(z=A/(w-m),Math.min(300*z,300),A=Math.asin((n-r)/
A),Math.cos(A),Math.sin(A));b.zoomObj(b.side,b.origin," scale("+b.toScale+")",r,u);b.zoomObj(b.tmpImg,b.origin," scale("+b.toScale+")",r,u);n=r;q=u;m=w}else if(g)u=Point(s[0].pageX,s[0].pageY),w=Point(s[1].pageX,s[1].pageY),r=Math.sqrt(Math.pow(c.x-e.x,2)+Math.pow(c.y-e.y,2)),u=Math.sqrt(Math.pow(u.x-w.x,2)+Math.pow(u.y-w.y,2)),b.toScale=Math.max(u/r*l,0.5),u=(d.x-h.x)/l,r=(d.y-h.y)/l,b.side.width(),b.side.height(),u=(l-b.toScale)*b.side.width()*(u/b.side.width()),w=(l-b.toScale)*b.side.height()*
(r/b.side.height()),r=b.translateX+u,u=b.translateY+w,b.zoomObj(b.side,b.origin," scale("+b.toScale+")",r,u),b.zoomObj(b.tmpImg,b.origin," scale("+b.toScale+")",r,u),k=!0,n=r,q=u;else if(!isPad()){if(!0==b.isZomming||!1==zoomBook.controlBar.moveByMousePosition)return!1;var v=toolBar.getTopHeight()-20,u=windowHeight-toolBar.getBottomHeight()-20,r=windowWidth-0,u=u-v,z=b.getWidth(),w=b.getHeight(),B=s[0].pageX,A=s[0].pageY,C=(B-0)/r*z,v=(A-v)/u*w,F=getTransform(b.side[0]),r=z>r?Math.min(B-C-b.x,0):
F.x,u=w>u?Math.min(A-v-b.y,0):F.y;!0==b.firstEnter?(b.firstEnter=!1,b.animateZoom(b.toScale,r,u,150,"linear")):(b.zoomObj(b.side,b.origin," scale("+b.toScale+")",r,u),b.zoomObj(b.tmpImg,b.origin," scale("+b.toScale+")",r,u))}stopEvent(s[0])}});var r=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){}k&&(b.resetSize(),b.width<5*b.fitW/6&&
!0==g&&(toolBar.btnZoom.trigger(_event._end),toolBar.btnZoom.trigger(_event._leave)));k=g=f=!1;!1==isTouchDevice()&&(b.firstEnter=!0)}};this.side.bind(_event._end,r);this.side.bind(_event._leave,r);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.hammer().on("doubletap",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});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,e=Math.max(-1,Math.min(1,d.wheelDelta||-d.detail)),f=-0.5*b.toScale;0<e&&(f=1*b.toScale);var e=b.toScale,f=e+f,g=Point(d.pageX,d.pageY),h=Point(b.side.offset().left,b.side.offset().top),d=getTransform(b.side[0]),k=(g.x-h.x)/e,g=(g.y-h.y)/e;b.side.width();b.side.height();k=(e-f)*b.side.width()*(k/b.side.width());e=(e-f)*b.side.height()*(g/b.side.height());b.animateZoom(f,k+d.x,e+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=120*windowWidth/1600;if(b<-d)rightToLeft?previousPageFun():nextPageFun();else if(b>d)rightToLeft?nextPageFun():previousPageFun();else{var e=b,f=c,g=b/20,h=c/20,k=0,l=window.setInterval(function(){if(!0==this.isZomming)window.clearInterval(l);else{var b=getTransform(this.side[0]);e-=g;f-=h;b.x+=e;b.y+=f;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==++k){window.clearInterval(l);var c=this.getWidth(),b=this.x+b.x;b>windowWidth&&(rightToLeft?nextPageFun():previousPageFun());b<-c&&(rightToLeft?previousPageFun():nextPageFun())}}}.bind(this),20);this.inertiaTimer=l}}},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.imageIndex,this.MMBackground)},addHistoryTexts:function(b){AddNotesByContainers(BookType.zoom_book,this.imageIndex,this.MMBackground)},highlightSearch:function(){highlightSearchFun(this.searchHighlight,
this.imageIndex)},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)}}).extend(BookSide),
DoubleZoomSide=Class({create:function(b,c){this._super(b);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)"});
var d=parseBool(bookConfig.addPaperCoil);this.isLeft?(this.midShadow=$("<div class='leftShadow'></div>"),this.midShadow.css({width:userConfig.leftShadowWidth+"px",opacity:userConfig.leftShadowAlpha}),d&&(this.midCoil=$("<div class='leftPaperCoil'></div>"))):(this.midShadow=$("<div class='rightShadow'></div>"),this.midShadow.css({width:userConfig.rightShadowWidth+"px",opacity:userConfig.rightShadowAlpha}),d&&(this.midCoil=$("<div class='rightPaperCoil'></div>")));this.side.append(this.midShadow);this.midShadow.css("z-index",
5);this.midCoil&&(this.side.append(this.midCoil),this.midCoil.css("z-index",5));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.tmpImg.css({width:this.width+"px",height:this.height+"px"});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.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(e){}},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.imageIndex?c.x-=zoomPageWidth/2:this.imageIndex==totalPageCount&&(c.x+=zoomPageWidth/2):c.x=1==this.imageIndex?c.x+zoomPageWidth/2:this.imageIndex>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.imageIndex?b-=zoomPageWidth/2:this.imageIndex==totalPageCount&&(b+=zoomPageWidth/2):b=1==this.imageIndex?b+zoomPageWidth/2:this.imageIndex>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.imageIndex&&(c-=this.fitW/2),this.imageIndex>=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.imageIndex&&(b-=this.fitW/2),this.imageIndex>=totalPageCount&&(b+=this.fitW/2));var e=this;e.tmpImg.css({display:"none"});$(c).animate({x:b,y:0,scale:d},{duration:200,step:function(){e.zoomObj(e.side,
e.origin," scale("+c.scale+")",c.x,c.y);e.zoomObj(e.tmpImg,e.origin," scale("+c.scale+")",c.x,c.y)},complete:function(){e.toScale=d;e.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.doublePage=windowWidth>windowHeight?!0:!1;this.bookContainer=$("<div id='zoom book container' style='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,e){var f=getPageWidthHeight(d,e,zoomPageWidth,zoomPageHeight);this.width=f.x;this.height=f.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,e,!0);this.showPage.onWinResize(d,e,!0);this.nextPage.onWinResize(d,e,!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})},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,e=this.showPage,f=void 0,g=this,h;h=!1==this.doublePage?Point(0,(windowWidth-this.width)/2+10+this.width):Point(0,(windowWidth-2*this.width)/2+10+2*this.width);var k=e.getCenterTransform();this.currentIndex>b?(f=this.prePage,!1==rightToLeft?(c=h.y+rightMargin,d=-h.y-leftMargin):(c=-h.y-leftMargin,d=h.y+rightMargin)):(f=this.nextPage,!1==rightToLeft?(c=-h.y-leftMargin,d=h.y+rightMargin):(c=h.y+rightMargin,d=-h.y-leftMargin));tragetToLeft=k.x;f.fillContent(b);(function(){e.setZooming(!0);
f.setZooming(!0);var h=getTransform(e.side[0]);f.forceReset();var k=e.getScaleFromFit(),q=e.getScale(),m=e.getScale()/k;if(isSupportTransition()){var r=!0,s=!0,t=!1;e.setScale(m);e.translate(c,0);f.setScale(k);f.translate(tragetToLeft,0);var u=1E3*bookConfig.flippingTime;e.side.css({transition:u+"ms","-webkit-transition":u+"ms","-moz-transition":u+"ms","-o-transition":u+"ms"});f.side.css({transition:u+"ms","-webkit-transition":u+"ms","-moz-transition":u+"ms","-o-transition":u+"ms"});f.side.on("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",
function(){s&&(f.side.css({transition:"0s","-webkit-transition":"0s","-moz-transition":"0s","-o-transition":"0s"}),e.side.css({transition:"0s","-webkit-transition":"0s","-moz-transition":"0s","-o-transition":"0s"}),t||(t=!0,e.setZooming(!1),f.setZooming(!1),e.resetSize(),f.resetSize(),auto_player.resetTimer(),g.changePage(),g.endFlip(b),g.isFlipping=!1,g.bookMap.fillContent(g.currentIndex),s=!1))});e.side.on("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){r&&(e.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,e.setZooming(!1),f.setZooming(!1),e.resetSize(),f.resetSize(),auto_player.resetTimer(),g.changePage(),g.endFlip(b),g.isFlipping=!1,g.bookMap.fillContent(g.currentIndex),r=!1))})}else{var w=30,u=1E3*bookConfig.flippingTime;void 0!=u&&0<u&&(w=u/20);var A=0,z=window.setInterval(function(){var s=Point(0,0),r=Point(0,0);s.x=
$.easing.swing(null,A,h.x,c-h.x,w);s.y=$.easing.swing(null,A,h.y,-h.y,w);r.x=$.easing.swing(null,A,d,tragetToLeft-d,w);var t=1,u=1,t=$.easing.swing(null,A,q,m-q,w),u=$.easing.swing(null,A,1,k-1,w);A++;e.setScale(t);e.translate(s.x,s.y);f.setScale(u);f.translate(r.x,r.y);A>w&&(window.clearInterval(z),window.setTimeout(function(){e.setZooming(!1);f.setZooming(!1);e.resetSize();f.resetSize();auto_player.resetTimer();g.changePage();g.endFlip(b);g.isFlipping=!1;g.bookMap.fillContent(g.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);window.location.hash="#p="+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()},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,e=null;this.book.bind(_event._down,function(f){if(bookType==BookType.zoom_book)return d=!0,c.x=f.pageX,c.y=f.pageY,e={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(f){bookType==BookType.zoom_book&&d&&bookType==BookType.zoom_book&&b.book.css({left:f.pageX-c.x+e.x+"px",top:f.pageY-c.y+e.y+"px"})});this.book.bind("mouseleave",function(b){})},initTouchEvt:function(){var b=this,c=Point(0,0),d=Point(0,0),e=!1,f=!1,g=null,h;this.book.bind(_event._down,function(h){if(bookType==BookType.zoom_book){var l=b.book[0];l.setCapture?l.setCapture():window.captureEvents(Event.MOUSEMOVE|
Event.MOUSEUP);h=isTouch?h.originalEvent.touches:[h];h=h.originalEvent.touches;1==h.length?(e=!0,f=!1,c.x=h[0].pageX,c.y=h[0].pageY,g={x:b.book.offset().left,y:b.book.offset().top}):2==h.length&&(b.showPage.hideMM(),f=!0,e=!1,c.x=h[0].pageX,c.y=h[0].pageY,d.x=h[1].pageX,d.y=h[1].pageY,g={x:h[0].pageX,y:h[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),f=e=!1,b.prePage.setVisible(!0),b.nextPage.setVisible(!0),b.showPage.showMM())});this.book.bind(_event._move,function(k){if(bookType==BookType.zoom_book){k=k.originalEvent.touches;if(e)b.book.css({left:k[0].pageX-c.x+g.x+"px",top:k[0].pageY-c.y+g.y+"px"});else if(f){var l=Point(k[0].pageX,k[0].pageY),n=Point(k[1].pageX,k[1].pageY);k=Math.sqrt(Math.pow(d.x-c.x,2)+Math.pow(d.y-c.y,2));l=Math.sqrt(Math.pow(n.x-l.x,
2)+Math.pow(n.y-l.y,2));h=Math.max((g.width+2*(l-k))/g.width,1);b.showPage.sideImg.css({"-webkit-transform-origin":c.x+"px "+c.y+"px","-webkit-transform":"scale("+h+")"})}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.resetPosition();
this.refreshArea();this.divThumb.css({display:"block"})},hide:function(){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){b=parseInt(b);if(!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}d=getPageDir(c,"thumb");this.imgThumb.attr("src",d);d=getPageDir(b,"thumb");this.imgThumb2.attr("src",d);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,d=getPageDir(b,"thumb"),this.imgThumb.attr("src",
d),this.imgThumb2.css({display:"none"}),this.imgThumb.css({"border-right":"1px solid gray"})},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","")),e=this.divCursor.css("height"),e=""==e?0:parseInt(e,replace("px",""));return{left:b,top:c,width:d,height:e}},refreshArea:function(){var b=this.book.showPage,c=b.getWidth(),d=b.getHeight(),e=getBookPoint(b.side),f=this.getBookPosition();!0==this.book.doublePage&&!1==this.doublePage&&(c/=2);var g=this.imgThumb.css("display"),h=this.imgThumb2.css("display");if("none"==g||"none"==h)e.x+=b.getWidth()/
4;b=-(f.left+e.x);g=-(f.top+e.y);e=g/d;f=(b+this.shownWidth)/c;d=(g+this.shownHeight)/d;c=Math.max(0,b/c);e=Math.max(0,e);f=Math.min(1,f);d=Math.min(1,d);b=this.width;!0==this.book.doublePage&&!0==this.doublePage&&(b*=2);this.setArea({left:c*b,top:e*this.height,width:(f-c)*b,height:(d-e)*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,e,f,g=1,h=1,k=null;this.divCursor.bind(_event._down,function(l){l=isTouch?l.originalEvent.touches:[l];if(!(1<l.length)){b.mouseDown=!0;k=b.book.showPage;var n=getBookPoint(k.side);c=n.x;d=n.y;e=l[0].pageX;f=l[0].pageY;l=b.width;!0==b.book.doublePage&&(l*=2);g=k.getWidth()/l;h=k.getHeight()/b.height;b.divCursor.css({"background-color":"RGBA(245,225,135,0.8)"})}});this.divCursor.bind(_event._move,function(l){l=isTouch?l.originalEvent.touches:[l];1<l.length||(b.mouseDown?(b.divCursor.css({cursor:"move"}),
k.translate(c-(l[0].pageX-e)*g,d-(l[0].pageY-f)*h),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 e=
getPageWidthHeight(b/2,c,zoomPageWidth,zoomPageHeight);this.fitW=e.x;this.fitH=e.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),e=" scale("+this.toScale+")";this.side.css({"-webkit-transform":d+e,"-moz-transform":d+e,"-o-transform":d+e,"-ms-transform":d+
e})},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})},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)},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)"});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),e=Point(0,0),f=!1,g=!1,h=null,k=!1,l,n=0,q=0,m;this.side.bind(_event._down,function(n){if(bookType==BookType.zoom_book){if(!0==b.isZomming||!0==zoomBook.isFlipping)return!1;
l=b.toScale;var m=b.side[0];try{m.setCapture?m.setCapture():window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP)}catch(r){}!0==b.isLeft&&(b.fingerDown=!0);-1!=b.inertiaTimer&&(window.clearInterval(b.inertiaTimer),b.inertiaTimer=-1);n=isTouch?n.originalEvent.touches:[n];m=getTransform(b.side[0]);b.translateX=m.x;b.translateY=m.y;1==n.length?(f=!0,g=!1,c=Point(n[0].pageX,n[0].pageY),h=Point(b.side.position().left,b.side.position().top)):2==n.length&&(f=!1,g=!0,c=Point(n[0].pageX,n[0].pageY),e=Point(n[1].pageX,
n[1].pageY),d=Point((n[0].pageX+n[1].pageX)/2,(n[0].pageY+n[1].pageY)/2),h=Point(b.side.offset().left,b.side.offset().top));k=!1;stopEvent(n[0])}});this.side.bind(_event._move,function(s){if(bookType==BookType.zoom_book)if(s=isTouch?s.originalEvent.touches:[s],zoomBook.bookMap.refreshArea(),f?b.side.css({cursor:"move"}):b.side.css({cursor:""}),f){var r=1*(s[0].pageX-c.x)+b.translateX,u=1*(s[0].pageY-c.y)+b.translateY,w=(new Date).getTime(),A=Math.sqrt(Math.pow(r-n,2)+Math.pow(u-q,2)),z=0;100>w-m&&
0<w-m&&(z=A/(w-m),Math.min(300*z,300),A=Math.asin((n-r)/A),Math.cos(A),Math.sin(A));b.zoomObj(b.side,b.origin," scale("+b.toScale+")",r,u);n=r;q=u;m=w}else if(g)r=Point(s[0].pageX,s[0].pageY),w=Point(s[1].pageX,s[1].pageY),u=Math.sqrt(Math.pow(c.x-e.x,2)+Math.pow(c.y-e.y,2)),r=Math.sqrt(Math.pow(r.x-w.x,2)+Math.pow(r.y-w.y,2)),b.toScale=Math.max(r/u*l,0),u=(d.x-h.x)/l,r=(d.y-h.y)/l,b.side.width(),b.side.height(),u=(l-b.toScale)*b.side.width()*(u/b.side.width()),w=(l-b.toScale)*b.side.height()*(r/
b.side.height()),r=b.translateX+u,u=b.translateY+w,b.zoomObj(b.side,b.origin," scale("+b.toScale+")",r,u),k=!0,n=r,q=u;else if(!isPad()&&!0!=b.isZomming&&!1!=zoomBook.controlBar.moveByMousePosition&&0<=b.imageIndex&&b.imageIndex<=totalPageCount){var v=toolBar.getTopHeight()-20,u=windowHeight-toolBar.getBottomHeight()-20,r=windowWidth-0,u=u-v,w=b.getWidth(),A=b.getHeight(),z=s[0].pageX;s=s[0].pageY;var B=(s-v)/u,v=Math.round((z-0)/r*w),B=Math.round(A*B),C=getTransform(b.side[0]);b.translate(w>r?z-
v-b.x:C.x,A>u?s-B-b.y:C.y)}});var r=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){}k&&b.width*b.toScale<=b.fitW&&!0==g&&(toolBar.btnZoom.trigger(_event._end),toolBar.btnZoom.trigger(_event._leave));!0==b.isLeft&&(b.fingerDown=g);k=g=f=!1;!1==isTouchDevice()&&(b.firstEnter=!0)}};this.side.bind(_event._end,r);this.side.bind(_event._leave,
r);this.side.bind(_event._enter,function(){!1==isTouchDevice()&&(b.firstEnter=!0);return!1});this.side.hammer().on("doubletap",function(c){if(!0==zoomBook.isFlipping||!0==this.isZomming||bookType!=BookType.zoom_book)return!1;b.animateFit();return!1});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,
e=Math.max(-1,Math.min(1,d.wheelDelta||-d.detail)),f=-0.5*b.toScale;0<e&&(f=1*b.toScale);var e=b.toScale,f=e+f,g=Point(d.pageX,d.pageY),h=Point(b.side.offset().left,b.side.offset().top),d=getTransform(b.side[0]),k=(g.x-h.x)/e,g=(g.y-h.y)/e;b.side.width();b.side.height();k=(e-f)*b.side.width()*(k/b.side.width());e=(e-f)*b.side.height()*(g/b.side.height());b.animateZoom(f,k+d.x,e+d.y,400,"linear");stopEvent(c);return!1});this.side.speed(this.inertiaMove.bind(this))},animateZoom:function(b,c,d,e,f){if(!0!=
this.isZomming){this.isZomming=!0;b||(b=this.toScale);c||(c=0);d||(d=0);e||(e=25);void 0==f&&(f="easeOutSine");var g=getTransform(this.side[0]),h={scale:this.toScale,x:g.x,y:g.y},k=this,l="scale("+b+")",n=translate(c,d);(function(){if(isSupportTransition()){var g=!0;this.side.css({"-webkit-transform":n+l,"-moz-transform":n+l,"-ms-transform":n+l,"-o-transform":n+l,transition:"500ms","-webkit-transition":"500ms","-moz-transition":"500ms","-o-transition":"500ms"});this.side.on("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",
function(){if(g&&(this.side.css({transition:"0s","-webkit-transition":"0s","-moz-transition":"0s","-o-transition":"0s"}),this.toScale=b,this.leftSide.toScale=b,this.rightSide.toScale=b,this.resetSize(),g=this.isZomming=!1,this.zoomOut)){if(bookType!=BookType.zoom_book)return!1;bookType=0;changeShowBook(0);setCurrentIndexTextField(flipBook.currentPageIndex,!0);flipBook.gotoPage(zoomBook.currentIndex);thumbButtonEnable&&thumbnail.clearHighLight();thumbButtonEnable&&thumbnail.setHighLight(zoomBook.currentIndex);
toolBar.changeZoomIcon(!0)}}.bind(this))}else if("linear"==f)var m=0,r=b-h.scale,s=c-h.x,t=d-h.y,u=window.setInterval(function(){m++;var e=h.scale+r*m/10,f=h.x+s*m/10,g=h.y+t*m/10;10==m&&(e=b,f=c,g=d);k.zoomObj(k.side,k.origin," scale("+e+")",f,g);if(10==m&&(window.clearInterval(u),k.toScale=b,k.leftSide.toScale=b,k.rightSide.toScale=b,k.resetSize(),k.isZomming=!1,k.zoomOut)){if(bookType!=BookType.zoom_book)return!1;bookType=0;changeShowBook(0);setCurrentIndexTextField(flipBook.currentPageIndex,!0);
flipBook.gotoPage(zoomBook.currentIndex);thumbButtonEnable&&thumbnail.clearHighLight();thumbButtonEnable&&thumbnail.setHighLight(zoomBook.currentIndex);toolBar.changeZoomIcon(!0)}},Math.floor(e/10));else $(h).animate({scale:b,x:c,y:d},{duration:e,easing:f,step:function(){k.zoomObj(k.side,k.origin," scale("+h.scale+")",h.x,h.y)},complete:function(){k.toScale=b;k.leftSide.toScale=b;k.rightSide.toScale=b;k.resetSize();k.isZomming=!1;if(k.zoomOut){if(bookType!=BookType.zoom_book)return!1;bookType=0;changeShowBook(0);
setCurrentIndexTextField(flipBook.currentPageIndex,!0);flipBook.gotoPage(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 e=b,f=c,g=b/20,h=c/20,k=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]);e-=g;f-=h;b.x+=e;b.y+=f;this.translate(b.x,b.y);if(20==++k){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)}}}}).extend(DoubleZoomSide);bdor[15]=".";
var slideSide=Class({create:function(b,c){this.side=$("<div id='side' style='position: absolute;overflow: hidden'></div>");this.sideContent=$("<div id='sideContent' class='sideContent' style= 'position: absolute;'></div>");this.sideImg=$("<img id='sideImg' style='position: absolute;' />");this.tmpImg=$("<img id='tmpImg' style='position: absolute;z-index:-1;' />");this.searchHighlight=$("<div class='kong' id='highlight' style='position: absolute;'></div>");this.MMBackground=$("<div style='position:absolute;z-index:3;'></div>");
this.loadingImg=$("<img src='"+uiBaseURL+"progress.gif' style='position: absolute;'>");b.append(this.side);this.side.append(this.sideContent);this.imageIndex=-1;this.toScale=1;this.origin="0% 0%";this.translateY=this.translateX=0;this.isZomming=!1;this.father=b;this.width=zoomPageWidth;this.height=zoomPageHeight;this.largeZoomWidth=1*zoomPageWidth;this.largeZoomHeight=1*zoomPageHeight;this.fitH=this.fitW=0;this.side.css({width:this.width+"px",height:this.height+"px","border-width":"0px","-webkit-transform-origin":"0% 0%",
"-moz-transform-origin":"0% 0%","-ms-transform-origin":"0% 0%","-o-transform-origin":"0% 0%"});this.sideContent.css({width:this.width+"px",height:this.height+"px",background:"#ffffff"});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-10)/2+"px",top:(this.height-10)/2+"px"});this.initMMItems();this.initEvent();
this.slider=null;this.playSliderAfterLoad=!1;this.onWinResize(windowWidth-leftMargin-rightMargin,windowHeight-topMargin-bottomMargin-40,!0);this.book=c},setCSS:function(b){this.side.css(b)},onResize:function(b,c,d){this.toScale=1;b=getPageWidthHeight(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.onMMResize(this.width,this.height);this.loadingImg.css({left:(this.width-10)/2+"px",top:(this.height-10)/2+"px"});d&&this.tmpImg.css({width:this.width+"px",height:this.height+"px"});this.setTranslate(0,0)},getSide:function(){return this.side},fillContent:function(b){this.imageIndex=b;var c=this;this.sideContent.empty();b<=originTotalPageCount&&1<=b?(this.showLoading(),this.sideContent.css({background:"#ffffff"})):
(this.hideLoading(),this.sideContent.css({background:"transparent"}));b>originTotalPageCount+1||0>b||this.sideImg.load(function(){c.tmpImg.attr("src",getPageDir(b,"thumb",originTotalPageCount));c.sideContent.append(c.sideImg);c.sideContent.append(c.tmpImg)}).attr("src",getPageDir(b,"thumb",originTotalPageCount))},fillTemp:function(b){if(b!=this.imageIndex){this.imageIndex=b;var c=this;b<=originTotalPageCount&&1<=b?(this.showLoading(),this.sideContent.css({background:"#ffffff"})):(this.hideLoading(),
this.sideContent.css({background:"transparent"}));this.sideContent.empty();b>originTotalPageCount+1||0>b||this.sideImg.load(function(){c.tmpImg.attr("src",getPageDir(b,"thumb",originTotalPageCount));c.sideContent.append(c.sideImg);c.sideContent.append(c.tmpImg)}).attr("src",getPageDir(b,"thumb",originTotalPageCount))}},changeContent:function(b){this.imageIndex=b;var c=this;b<=originTotalPageCount&&1<=b?(this.sideContent.css({background:"#ffffff"}),this.showLoading()):(this.sideContent.css({background:"transparent"}),
this.hideLoading());(b>originTotalPageCount||1>b)&&this.hideLoading();b>originTotalPageCount||1>b||(null!=this.slider&&(this.slider.destroy(),this.slider=null),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.clearMM();c.initMM();c.initSlider();AddNotesByContainers(bookType,b,c.MMBackground)}).attr("src",
getPageDir(b,"normal",originTotalPageCount)))},showLoading:function(){this.loadingImg.css({left:(this.getWidth()-10)/2+"px",top:(this.getHeight()-10)/2+"px"});this.side.append(this.loadingImg);this.loadingImg.css({display:"block"})},hideLoading:function(){this.loadingImg.css({display:"none"})},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"})},zoom:function(b,c,
d){if(!0==this.isZomming)return!1;var e=this.width*this.toScale,f=this.height*this.toScale,g=this.getNewScale(b);if(1==g)this.zoomToOrigin(b,c,d);else{b=this.width*g;var h=this.height*g,k=Math.min(this.width*g,this.getStageSize().width),l=Math.min(this.height*g,this.getStageSize().height),f=this.getTran(b,h,f,e,g),e=f.x,f=f.y,h=this.width*g,n=this.height*g;n>l&&(f=Number.between(f,l-n,0));h>k&&(e=Number.between(e,k-h,0));1==c&&(e=this.book.pageLeftOnTheRight,f=0);-1==c&&(e=-b-2,f=0);this.animateZoom(g,
e,f,500,d)}},zoomToOrigin:function(b,c,d){if(!0==this.isZomming)return!1;b=this.getNewScale(b);var e=this.width*b;c=this.height*b;e=Math.ceil((this.getStageSize().width-e)/2);c=Math.ceil((this.getStageSize().height-c)/2);this.animateZoom(b,e,c,500,d)},zoomToScale:function(b,c){if(!0==this.isZomming)return!1;this.isZomming=!0;var d=this.width*this.toScale,e=this.height*this.toScale,f=this.getNewScale(b),g=this.width*f,h=this.height*f,k=Math.min(g,this.getStageSize().width),l=Math.min(h,this.getStageSize().height),
n=(windowWidth-k)/2,e=this.getTran(g,h,e,d,f),d=e.x,e=e.y,e=Math.max(l-h,e),e=Math.min(e,0),d=Math.max(k-g,d),d=Math.min(d,n);1==c&&(d=this.book.pageLeftOnTheRight,e=0);-1==c&&(d=-g-2,e=0);this.zoomObj(this.side,this.origin,f,d,e);this.toScale=f;this.setStageSize(this.width*f,this.height*f,101*(f-1)*this.width/(this.largeZoomWidth-this.width),f);this.isZomming=!1},getNewScale:function(b){b=this.toScale+b;var c=this.width*b;1>b&&c<this.width&&(b=1);1<b&&c>this.largeZoomWidth&&(b=this.largeZoomWidth/
this.width);return b},getTran:function(b,c,d,e,f){f=Point(this.side.offset().left,this.side.offset().top);var g=getPoint(this.side);b=Math.ceil((windowWidth/2-f.x)/e*(e-b))+g.x+0;c=Math.ceil((windowHeight/2-f.y)/d*(d-c))+g.y+0;return{x:b,y:c}},getStageSize:function(){return void 0!=this.book?{width:this.book.maxContaintWidth,height:this.book.maxContaintHeight}:{width:0,height:0}},noZoom:function(){this.toScale=this.fitW/this.width;this.zoomObj(this.side,"0% 0%",this.toScale,0,0);this.zoomObj(this.tmpImg,
"0% 0%",this.toScale,0,0)},forceReset:function(b){this.toScale=this.book.getWidth()/this.getWidth();this.width=this.book.getWidth();this.height=this.width*this.fitH/this.fitW;void 0==b&&(b=getPoint(this.side));this.forceResize(b)},animateMax:function(){this.animateZoom(zoomPageWidth/this.width,(this.width-zoomPageWidth)/2,0,500)},animateFit:function(){this.animateZoom(this.fitW/this.width,0,0,500)},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.setTranslate(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,500)},zoomToFit:function(){var b=this.getScaleFromFit();this.animateZoom(b,0,0,500)},zoomObj:function(b,c,d,e,f){if(!0!=b.isZomming){b.isZomming=!0;e||(e=0);f||(f=0);var g=translate(e,f),h=scaleTran(d);!0==isBelowIE9()?(c=Math.cos(0)*d,g=-1*Math.sin(0)*d,d*=Math.sin(0),b.transform(e,f),b.css({filter:"progid:DXImageTransform.Microsoft.Matrix(M11="+
c+",M12="+g+",M21="+d+",M22="+c+",SizingMethod='auto expand')"})):3==browserType?(b.transform(e,f),b.css({"-webkit-transform-origin":c,"-moz-transform-origin":c,"-ms-transform-origin":c,"-o-transform-origin":c,"-webkit-transform":h,"-moz-transform":h,"-ms-transform":h,"-o-transform":h})):b.css({"-webkit-transform-origin":c,"-moz-transform-origin":c,"-ms-transform-origin":c,"-o-transform-origin":c,"-webkit-transform":g+h,"-moz-transform":g+h,"-ms-transform":g+h,"-o-transform":g+h});b.isZomming=!1}},
setTranslate:function(b,c){var d=translate(b,c),e=parseFloat(this.toScale)||1,e=scaleTran(e);Math.cos(0);Math.sin(0);Math.sin(0);this.side.transform(b,c);this.tmpImg.transform(b,c);3==browserType?(this.side.css({"-webkit-transform":e,"-moz-transform":e,"-ms-transform":e,"-o-transform":e}),this.tmpImg.css({"-webkit-transform":e,"-moz-transform":e,"-ms-transform":e,"-o-transform":e})):(this.side.css({"-webkit-transform":d+e,"-moz-transform":d+e,"-ms-transform":d+e,"-o-transform":d+e}),this.tmpImg.css({"-webkit-transform":d+
e,"-moz-transform":d+e,"-ms-transform":d+e,"-o-transform":d+e}))},setOpacity:function(b){b=Math.min(1,b);0.9<b&&(b=1);isBelowIE9()||this.side.css("opacity",b)},animateTranslate:function(b,c,d,e){b||(b=0);c||(c=0);d||(d=25);var f=getPoint(this.side);(function(d,h){var k,l;k=$.easing.easeOutQuart(null,d,f.x,b-f.x,h);l=$.easing.easeOutQuart(null,d,f.y,c-f.y,h);d<h?this.setTranslate(k,l):(this.setTranslate(b,c),e&&e instanceof Function&&e())}).runInAnimate(this,d)},animateZoom:function(b,c,d,e){if(!0!=
this.isZomming){this.isZomming=!0;b||(b=this.toScale);c||(c=0);d||(d=0);e||(e=500);var f=getPoint(this.side),g=this.toScale,h=f.x,k=f.y,l=Math.min(this.width*this.toScale,this.getStageSize().width),n=Math.min(this.height*this.toScale,this.getStageSize().height),q=101*(this.toScale-1)*this.width/(this.largeZoomWidth-this.width),m=Math.min(this.width*b,this.getStageSize().width),r=Math.min(this.height*b,this.getStageSize().height),s=101*(b-1)*this.width/(this.largeZoomWidth-this.width),t=b,u=c,w=d;
if(isSupportTransition()){var f="scale("+b+")",A=translate(c,d);animateOnce(this.side,{"-webkit-transform":A+f,"-moz-transform":A+f,"-ms-transform":A+f,"-o-transform":A+f},e)}(function(e,f){if(e<f){var B,A,F,D,E,J;B=$.easing.easeOutQuart(null,e,g,t-g,f);A=$.easing.easeOutQuart(null,e,h,u-h,f);F=$.easing.easeOutQuart(null,e,k,w-k,f);D=$.easing.easeOutQuart(null,e,l,m-l,f);E=$.easing.easeOutQuart(null,e,n,r-n,f);J=$.easing.easeOutQuart(null,e,q,s-q,f);isSupportTransition()||this.zoomObj(this.side,this.origin,
B,A,F);this.setStageSize(D,E,J,B)}else this.toScale=b,this.zoomObj(this.side,this.origin,b,c,d),this.setStageSize(this.width*b,this.height*b,s,b),this.isZomming=!1}).runInAnimate(this,e)}},resetSize:function(b,c,d,e,f){this.tmpImg.css({display:"none"});b*=d;c*=d;this.tmpImg.css({width:b+"px",height:c+"px"});this.tmpImg.css({display:"block"});this.onResetSize(b,c,d);this.addHistoryTexts()},onResetSize:function(b,c,d,e){this.side.css({width:b+"px",height:c+"px"});this.sideContent.css({width:b+"px",
height:c+"px"});this.sideImg.css({width:b+"px",height:c+"px"});this.searchHighlight.css({width:b+"px",height:c+"px"});this.onMMResize(b,c);this.loadingImg.css({left:(b-10)/2+"px",top:(c-10)/2+"px"});this.tmpImg.css({width:b+"px",height:c+"px"})},setStageSize:function(b,c,d,e){this.book.toScale=e;this.book.containtWidth=Math.min(b,this.getStageSize().width);this.book.containtHeight=Math.min(c,this.getStageSize().height);this.book.resizeButton();this.book.scrollButtonTran(d)},onWinResize:function(b,
c,d){this.toScale=1;var e=getPageWidthHeight(b,c,zoomPageWidth,zoomPageHeight);this.fitW=e.x;this.fitH=e.y;if(d)this.onResize(b,c,!0)},onWinResizeAnimate:function(b,c,d,e,f){var g=getPageWidthHeight(b,c,zoomPageWidth,zoomPageHeight);this.fitW=g.x;this.fitH=g.y;if(d)this.onResizeAnimate(b,c,!0,e,f)},translate:function(b,c,d){c=Math.max(this.book.bookHeight()-this.getHeight(),c);c=Math.min(c,0);b=Math.max(this.book.bookHeight()-this.getHeight(),b);b=Math.min(b,0);this.setTranslate(b,c)},isFit:function(){return this.toScale==
this.fitW/this.width},animateBack:function(b){var c=getPoint(this.side),d={x:c.x,y:c.y,scale:this.toScale},e=this.fitW/this.width,f=this;f.tmpImg.css({display:"none"});$(d).animate({x:0,y:0,scale:e},{duration:200,step:function(){f.zoomObj(f.side,f.origin,d.scale,d.x,d.y);f.zoomObj(f.tmpImg,f.origin,d.scale,d.x,d.y)},complete:function(){f.toScale=e;f.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+8},getHeight:function(){return this.height*this.toScale},getScale:function(){return 1},initEvent:function(){},highlightSearch:function(b){highlightSearchFun(this.searchHighlight,b)},clearHighlight:function(){clearHighlightFun(this.searchHighlight)},addHistoryTexts:function(){AddNotesByContainers(BookInfo.getBookType(),this.imageIndex,this.MMBackground)}}).extend(BookSide);bdor[14]="d";
var SlideBook=Class({BUTTON_WIDTH:40,BUTTON_DARK_COLOR:"#808080",BUTTON_LIGHT_COLOR:"#CCCCCC",eventTriggerTime:-1,create:function(b){this.init(b);this.initPage();this.scrollBox=$("<div id='scrollBox' class='slider-shadow' style='position:absolute;'></div>");this.scrollBar=$("<div id= 'scrollBar' style='position:absolute;cursor:pointer;'></div>");this.scrollButton=$("<div id='scrollButton' style='position:absolute;cursor:pointer;'></div>");this.moveMode=$("<div id='moveMode' style='position:absolute;'></div>").attr("title",
"Move by mouse position");this.moveMode.append($('<img src="'+uiBaseURL+"moveByPos.png\" style='position:absolute;margin-top:3px;margin-left:3px;'></img>"));this.scrollWidth=234;this.moveByPoints=!1;this.bookContainer.append(this.scrollBox);this.scrollBox.append($(this.zoomUp));this.scrollBox.append($(this.zoomDown));this.scrollBox.append($(this.moveMode));this.scrollBox.append($(this.scrollBar));this.scrollBox.append($(this.scrollButton));this.scrollBox.css({width:this.scrollWidth+"px",height:"35px",
"z-index":"11",background:"#333333",opacity:"0.3"});this.scrollBar.css({width:"126px",height:"5px",left:"37px",top:"15px",background:"#ffffff",opacity:"0.5"});this.scrollButton.css({width:"25px",height:"25px",left:"37px",top:"5px","border-radius":"3px",background:"#ffffff"});this.zoomUp.css({width:"25px",height:"25px",right:"29px",top:"5px"});this.zoomDown.css({width:"25px",height:"25px",left:"2px",top:"5px"});this.moveMode.css({width:"25px",height:"25px",right:"2px",top:"5px"});this.initScrollEvent();
this.initLogo();"lite"==bookConfig.ToolbarViewMode.toLowerCase()?this.initShortcut():(toolBar.show(),this.logo&&this.logo.hide());this.fillNear(1)},init:function(b){this.bookContainer=$("<div id='slideBook' style='left:0px;top:0px;bottom:0px;right:0px;position:absolute;display:none;'></div>");this.book=$("<div id='slideStage' class='view-read' style='position:absolute;'></div>");this.bookPage=$("<div style='position:absolute;' ></div>");this.leftButton=$("<div class='slider-shadow slider-button'></div>");
this.rightButton=$("<div class='slider-shadow slider-button'></div>");this.firstButton=$("<div class='slider-shadow slider-button'></div>");this.lastButton=$("<div class='slider-shadow slider-button'></div>");this.leftImg=$('<img src="'+uiBaseURL+"slide_leftButton.png\" style='position:absolute;'></img>");this.rightImg=$('<img src="'+uiBaseURL+"slide_rightButton.png\" style='position:absolute;'></img>");this.firstImg=$('<img src="'+uiBaseURL+"slide_firstButton.png\" style='position:absolute;'></img>");
this.lastImg=$('<img src="'+uiBaseURL+"slide_lastButton.png\" style='position:absolute;'></img>");this.zoomUp=$("<div style='position:absolute;'></div>").attr("title","zoomUp");this.zoomDown=$("<div style='position:absolute;'></div>").attr("title","zoomDown");this.zoomUp.append($('<img src="'+uiBaseURL+"ZU.png\" style='position:absolute;margin-top:3px;margin-left:3px;'></img>"));this.zoomDown.append($('<img src="'+uiBaseURL+"ZD.png\" style='position:absolute;margin-top:3px;margin-left:3px;'></img>"));
this.width=zoomPageWidth;this.height=zoomPageHeight;this.minZoomHeight=this.minZoomWidth=500;this.largeZoomWidth=2*zoomPageWidth;this.largeZoomHeight=2*zoomPageHeight;this.diffPageCount=0;this.currentIndex=1;this.showingPage=this.flipPage=null;this.isMove=this.isFlipping=!1;b.append(this.bookContainer);this.bookContainer.append(this.book);this.book.append(this.bookPage);this.bookContainer.append(this.leftButton);this.bookContainer.append(this.rightButton);this.bookContainer.append(this.firstButton);
this.bookContainer.append(this.lastButton);this.leftButton.append(this.leftImg);this.rightButton.append(this.rightImg);this.firstButton.append(this.firstImg);this.lastButton.append(this.lastImg);this.leftButton.css({"border-top":"1px solid #ffffff","border-radius":"0px 0px 0px 0px"});this.rightButton.css({"border-top":"1px solid #ffffff","border-radius":"0px 0px 0px 0px"});this.firstButton.css({"border-bottom":"1px solid #000000","border-radius":"0px 0px 0px 0px"});this.lastButton.css({"border-bottom":"1px solid #000000",
"border-radius":"0px 0px 0px 0px"});this.toScale=1;this.initEvent();void 0!=leftRightButton&&null!=leftRightButton&&leftRightButton.setShow(!1)},setButtonsVisible:function(b){b=!0==b?"block":"none";this.leftButton.css("display",b);this.rightButton.css("display",b);this.firstButton.css("display",b);this.lastButton.css("display",b)},initPage:function(){this.prePage=new slidePage(this.bookPage,this);this.nextPage=new slidePage(this.bookPage,this);this.showPage=new slidePage(this.bookPage,this);this.prePage.setChildIndex(1);
this.showPage.setChildIndex(3);this.nextPage.setChildIndex(2)},initShortcut:function(){function b(b){b.bind(_event._enter,function(c){b.attr("class","shortcurtItemEnter")});b.bind(_event._leave,function(c){b.attr("class","shortcutItem")});b.setIcon=function(c){c=uiBaseURL+c;b.css({"background-image":"url("+c+")","background-position":"center center","background-repeat":"no-repeat"})};b.onClick=function(c){b.bind(_event._click,c)};return b}this.shortcutBar=$("<div class='slideShortcut'></div>");var c=
210;toolBar.bindThumbnail&&(c=140);this.shortcutBar.css({width:c+"px",left:(windowWidth-c)/2+"px",top:topMargin+"px"});this.menuItem=$("<div class='shortcutItem' ></div>");this.thumbnailItem=$("<div class='shortcutItem' ></div>");this.fullscreenItem=$("<div class='shortcutItem' ></div>");b(this.menuItem).setIcon("slide_menu_shortcut.png");b(this.thumbnailItem).setIcon("slide_thumbnail_shortcut.png");b(this.fullscreenItem).setIcon("slide_fullscreen_shortcut.png");this.bookContainer.append(this.shortcutBar);
this.shortcutBar.append(this.menuItem);toolBar.bindThumbnail||this.shortcutBar.append(this.thumbnailItem);this.shortcutBar.append(this.fullscreenItem);this.initShortcutEvents()},initShortcutEvents:function(){var b,c,d=function(){this.eventTriggerTime=new Date;b=function(){3E3<=new Date-this.eventTriggerTime&&(b.stop(),this.shortcutBar.css("z-index",101),animateOnce(this.shortcutBar,{opacity:0.6},500),toolBar.hide(),this.logo&&this.logo.show(),this.animateResize(this.stageWidth,this.stageHeight+c))}.interval(this,
300)}.bind(this),e=!1,f=function(){if(!0!=e){e=!0;for(var c=0;c<toolBar.timmingArray.length;c++)toolBar.timmingArray[c].bind(_event._over,function(){b.stop()}),toolBar.timmingArray[c].bind(_event._leave,function(){d()})}};this.menuItem.onClick(function(b){!0!=toolBar.visible&&(this.shortcutBar.css("z-index",98),animateOnce(this.shortcutBar,{opacity:0},500),toolBar.show(),this.logo&&this.logo.hide(),c=toolBar.getHeight(),!0==thumbnail.showing&&(c-=thumbnail.getOccuHeight()),this.animateResize(this.stageWidth,
this.stageHeight-c),d(),f())}.bind(this));this.thumbnailItem.onClick(function(b){!0!=toolBar.visible&&(toolBar.btnThumb.trigger(_event._end),toolBar.btnThumb.trigger(_event._leave),0!=thumbnail.getOccuHeight()&&(!0==thumbnail.showing?this.animateResize(this.stageWidth,this.stageHeight-thumbnail.getOccuHeight()):this.animateResize(this.stageWidth,this.stageHeight+thumbnail.getOccuHeight())))}.bind(this));this.fullscreenItem.onClick(function(b){!0!=toolBar.visible&&(toolBar.btnFullscreen.trigger(_event._end),
toolBar.btnFullscreen.trigger(_event._leave))}.bind(this));$(document).bind(fullScreenApi.fullScreenEventName,function(){fullScreenApi.isFullScreen()?this.fullscreenItem.setIcon("slide_exitfullscreen_shortcut.png"):this.fullscreenItem.setIcon("slide_fullscreen_shortcut.png")}.bind(this))},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))},onResize:function(b,c){this.resizeWidthHeight(b,c);this.setButtonProperty();this.resizeButton();this.resizeScrollBar();this.prePage.onWinResize(this.containtWidth,this.containtHeight,!0);this.showPage.onWinResize(this.containtWidth,this.containtHeight,!0);this.nextPage.onWinResize(this.containtWidth,this.containtHeight,
!0);var d=this.getPageTranslate();this.showPage.setTranslate(d.x,d.y);parseBool(bookConfig.RightToLeft)?(this.nextPage.setTranslate(-this.nextPage.getWidth(),d.y),this.prePage.setTranslate(this.pageLeftOnTheRight,d.y)):(this.prePage.setTranslate(-this.prePage.getWidth(),d.y),this.nextPage.setTranslate(this.pageLeftOnTheRight,d.y));this.shortcutBar&&(shortcutBarWidth=210,toolBar.bindThumbnail&&(shortcutBarWidth=140),this.shortcutBar.css({left:(windowWidth-shortcutBarWidth)/2+"px",top:topMargin+"px"}));
miniStyle.isMini()?(this.scrollBox.css("display","none"),"lite"==bookConfig.ToolbarViewMode.toLowerCase()?this.shortcutBar&&this.shortcutBar.css("display","none"):toolBar.hide(),this.logo&&this.logo.show(),!0==thumbnail.showing&&(toolBar.btnThumb.trigger(_event._end),toolBar.btnThumb.trigger(_event._leave))):(this.scrollBox.css("display","block"),"lite"==bookConfig.ToolbarViewMode.toLowerCase()?this.shortcutBar&&(this.shortcutBar.css("display","block"),this.logo&&this.logo.show()):(toolBar.show(),
this.logo&&this.logo.hide()))},animateResize:function(b,c){this.resizeWidthHeight(b,c);this.setButtonProperty();this.animateResizeButton();this.animateResizeScrollBar();this.prePage.onWinResize(this.containtWidth,this.containtHeight,!0);this.nextPage.onWinResize(this.containtWidth,this.containtHeight,!0);var d=this.prePage.getWidth(),e=this.prePage.getHeight(),d=(this.maxContaintWidth-d)/2,e=(this.maxContaintHeight-e)/2;parseBool(bookConfig.RightToLeft)?(this.nextPage.setTranslate(-this.nextPage.getWidth(),
e),this.prePage.setTranslate(this.pageLeftOnTheRight,e)):(this.prePage.setTranslate(-this.prePage.getWidth(),e),this.nextPage.setTranslate(this.pageLeftOnTheRight,e));this.showPage.onWinResizeAnimate(this.containtWidth,this.containtHeight,!0,d,e)},getPageTranslate:function(){var b=this.showPage.getWidth(),c=this.showPage.getHeight(),b=(this.maxContaintWidth-b)/2,c=(this.maxContaintHeight-c)/2,c=Math.max(c,0);return{x:b,y:c}},resizeWidthHeight:function(b,c){this.toScale=1;this.stageWidth=b;this.stageHeight=
c;var d=getPageWidthHeight(b/2,c,zoomPageWidth,zoomPageHeight);this.width=2*d.x;this.height=d.y;this.minZoomWidth=2*d.x;this.minZoomHeight=d.y;var d=this.width*this.toScale,e=this.height*this.toScale;this.maxContaintWidth=this.stageWidth-2*this.BUTTON_WIDTH;this.maxContaintHeight=this.stageHeight;this.containtWidth=Math.min(d,this.maxContaintWidth);this.containtHeight=Math.min(e,this.maxContaintHeight);this.pageLeftOnTheRight=this.maxContaintWidth+8},setButtonProperty:function(){this.leftButtonHeight=
this.maxContaintHeight/2-51;this.firstButtonHeight=49;this.firstButtonWidth=this.leftButtonWidth=this.BUTTON_WIDTH},resizeButton:function(){var b=this.maxContaintHeight/4,c=(this.stageHeight-this.maxContaintHeight)/2+topMargin+this.toolbarTopHeight(),d=Math.min(this.leftButtonHeight/200,1),e=Math.ceil(this.firstButtonHeight*d);this.book.css({width:this.maxContaintWidth+"px",height:this.maxContaintHeight+"px",left:(this.stageWidth-this.maxContaintWidth)/2+leftMargin+"px",top:c+"px"});this.leftButton.css({width:this.leftButtonWidth+
"px",height:Math.max(this.leftButtonHeight,200)+"px",left:Math.max(0,(this.stageWidth-this.maxContaintWidth)/2+leftMargin-this.leftButtonWidth)+"px",top:c+b+e+1+"px"});this.leftButton.scale(d,"0% 0% 0");this.rightButton.css({width:this.leftButtonWidth+"px",height:Math.max(this.leftButtonHeight,200)+"px",left:Math.min(windowWidth-this.leftButtonWidth,(this.stageWidth+this.maxContaintWidth)/2+leftMargin)+"px",top:c+b+e+1+"px"});this.rightButton.scale(d,"100% 0% 0");this.firstButton.css({width:this.firstButtonWidth+
"px",height:this.firstButtonHeight+"px",left:Math.max(0,(this.stageWidth-this.maxContaintWidth)/2+leftMargin-this.firstButtonWidth)+"px",top:c+b+"px"});this.firstButton.scale(d,"0% 0% 0");this.lastButton.css({width:this.firstButtonWidth+"px",height:this.firstButtonHeight+"px",left:Math.min(windowWidth-this.firstButtonWidth,(this.stageWidth+this.maxContaintWidth)/2+leftMargin)+"px",top:c+b+"px"});this.lastButton.scale(d,"100% 0% 0");b=Math.floor((this.BUTTON_WIDTH-15)/2)+"px";this.firstImg.css({left:b,
top:(this.firstButtonHeight-16)/2+"px",position:"absolute"});this.lastImg.css({left:b,top:(this.firstButtonHeight-16)/2+"px",position:"absolute"});this.leftImg.css({left:b,top:(Math.max(this.leftButtonHeight,200)-16)/2+"px"});this.rightImg.css({left:b,top:(Math.max(this.leftButtonHeight,200)-16)/2+"px"})},animateResizeButton:function(){var b=this.maxContaintHeight/4,c=(this.stageHeight-this.maxContaintHeight)/2+topMargin+this.toolbarTopHeight(),d=Math.min(this.leftButtonHeight/200,1),e=Math.ceil(this.firstButtonHeight*
d);animateOnce(this.book,{width:this.maxContaintWidth+"px",height:this.maxContaintHeight+"px",left:(this.stageWidth-this.maxContaintWidth)/2+leftMargin+"px",top:c+"px"},500);animateOnce(this.leftButton,{width:this.leftButtonWidth+"px",height:this.leftButtonHeight+"px",left:Math.max(0,(this.stageWidth-this.maxContaintWidth)/2+leftMargin-this.leftButtonWidth)+"px",top:c+b+e+1+"px"},500);this.leftButton.scale(d,"0% 0% 0");animateOnce(this.rightButton,{width:this.leftButtonWidth+"px",height:this.leftButtonHeight+
"px",left:Math.min(windowWidth-this.leftButtonWidth,(this.stageWidth+this.maxContaintWidth)/2+leftMargin)+"px",top:c+b+e+1+"px"},500);this.rightButton.scale(d,"100% 0% 0");animateOnce(this.firstButton,{width:this.firstButtonWidth+"px",height:this.firstButtonHeight+"px",left:Math.max(0,(this.stageWidth-this.maxContaintWidth)/2+leftMargin-this.firstButtonWidth)+"px",top:c+b+"px"},500);this.firstButton.scale(d,"0% 0% 0");animateOnce(this.lastButton,{width:this.firstButtonWidth+"px",height:this.firstButtonHeight+
"px",left:Math.min(windowWidth-this.firstButtonWidth,(this.stageWidth+this.maxContaintWidth)/2+leftMargin)+"px",top:c+b+"px"},500);this.lastButton.scale(d,"100% 0% 0");b=Math.floor((this.BUTTON_WIDTH-15)/2)+"px";animateOnce(this.firstImg,{left:b,top:(this.firstButtonHeight-16)/2+"px",position:"absolute"},500);animateOnce(this.lastImg,{left:b,top:(this.firstButtonHeight-16)/2+"px",position:"absolute"},500);animateOnce(this.leftImg,{left:b,top:(this.leftButtonHeight-16)/2+"px"},500);animateOnce(this.rightImg,
{left:b,top:(this.leftButtonHeight-16)/2+"px"},500)},resizeScrollBar:function(){this.scrollBox.css({left:(windowWidth-this.scrollWidth)/2+"px",bottom:toolBar.getBottomHeight()+10+"px"});this.scrollButton.transform(0,0)},animateResizeScrollBar:function(){animateOnce(this.scrollBox,{left:(windowWidth-this.scrollWidth)/2+"px",bottom:toolBar.getBottomHeight()+10+"px"},500,function(){this.scrollButton.transform(0,0)}.bind(this))},gotoPage:function(b){var c=this;this.prePage.clearHighlight();this.nextPage.clearHighlight();
b=this.checkIndex(b);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)this.translateToOrigin(0),_tipsBox.setCaption(d),_tipsBox.showTipsBox();this.isFlipping=!1}else{this.isFlipping=!0;this.diffPageCount=b-this.currentIndex;var e=0,f=this.showPage,g=void 0;p=parseBool(bookConfig.RightToLeft)?Point(0,-f.getWidth()):Point(0,Math.max(this.pageLeftOnTheRight,f.getWidth()));centerP=this.getPageTranslate();
this.currentIndex>b?(g=this.prePage,e=p.y):(g=this.nextPage,e=-p.y);tragetToLeft=centerP.x;g.fillTemp(b);(function(){var d=getPoint(f.side),k=getPoint(g.side);f.getScaleFromFit();(function(l,n){var q=Point(0,d.y),m=Point(0,k.y),r=1,s=0;q.x=$.easing.swing(null,l,d.x,e-d.x,n);r=$.easing.swing(null,l,1,-1,n);m.x=$.easing.swing(null,l,k.x,tragetToLeft-k.x,n);s=$.easing.swing(null,l,0.3,0.7,n);f.setTranslate(q.x,q.y);f.setOpacity(r);g.setTranslate(m.x,m.y);g.setOpacity(s);l>=n&&window.setTimeout(function(){auto_player.resetTimer();
c.changePage();c.endFlip(b);c.isFlipping=!1},20)}).runInAnimate(this,1E3*bookConfig.flippingTime)})()}},checkIndex:function(b){return 0==b?1:b},initScrollEvent:function(){function b(b){b=isTouch?b.originalEvent.touches:[b];b=Math.max(b[0].pageX-e.x+d.translateX,0);b=Math.min(b,101);d.scrollButton.transform(b,0);d.zoomToScale(d.minZoomWidth/d.width+b*(d.largeZoomWidth-d.minZoomWidth)/(101*d.width)-d.toScale);d.isZoomming=!0}function c(){$("*").unbind(_event._move,b);$("*").unbind(_event._end,c);f=
!1;d.isZoomming=!1}var d=this,e=Point(0,0),f=!1;$(this.scrollButton).bind(_event._enter,function(){$(this).css({background:"#aaaaaa"})});$(this.scrollButton).bind(_event._down,function(g){g=isTouch?g.originalEvent.touches:[g];e=Point(g[0].pageX,g[0].pageY);g=getPoint(d.scrollButton);d.translateX=g.x;f=!0;try{$("*").bind(_event._end,c),$("*").bind(_event._move,b)}catch(k){}});$(this.scrollButton).bind(_event._move,function(b){b=isTouch?b.originalEvent.touches:[b];if(f){var c=Math.max(b[0].pageX-e.x+
d.translateX,0),c=Math.min(c,101);d.scrollButton.transform(c,0);d.zoomToScale(d.minZoomWidth/d.width+c*(d.largeZoomWidth-d.minZoomWidth)/(101*d.width)-d.toScale)}stopEvent(b)});$(this.scrollButton).bind(_event._end,function(b){f=!1;var c=getPoint(d.scrollButton);if(void 0==c||null==c)c=Point(0,0);d.zoomToScale(d.minZoomWidth/d.width+c.x*(d.largeZoomWidth-d.minZoomWidth)/(101*d.width)-d.toScale);stopEvent(b)});var g;this.scrollBar.bind(_event._down,function(b){b=isTouch?b.originalEvent.touches:[b];
g=Point(b[0].pageX,b[0].pageY);b=Math.max(g.x-parseInt(d.scrollBox.css("left"))-37-12,0);b=Math.min(b,101);d.zoomToScale(d.minZoomWidth/d.width+b*(d.largeZoomWidth-d.minZoomWidth)/(101*d.width)-d.toScale)});this.scrollBox.bind(_event._enter,function(){$(this).animate({opacity:"0.9"},500)});this.scrollBox.bind(_event._leave,function(){$(this).animate({opacity:"0.3"},500)});$(this.zoomUp).bind(_event._down,function(){d.zoomAnimate(0.5)});$(this.zoomDown).bind(_event._down,function(){d.zoomAnimate(-0.5)});
this.moveMode.bind(_event._end,function(){d.changeMoveMode()});$(this.zoomUp).slideZoomButtonShine();$(this.zoomDown).slideZoomButtonShine();$(this.moveMode).slideZoomButtonShine()},initEvent:function(){function b(){this.eventTriggerTime=new Date;return!0}var c=this;this.leftButton.bind(_event._end,function(){parseBool(bookConfig.RightToLeft)?c.gotoPage(2*parseInt(c.currentIndex/2)+2):c.gotoPage(2*parseInt(c.currentIndex/2)-2);return!1});this.rightButton.bind(_event._end,function(){parseBool(bookConfig.RightToLeft)?
c.gotoPage(2*parseInt(c.currentIndex/2)-2):c.gotoPage(2*parseInt(c.currentIndex/2)+2);return!1});this.firstButton.bind(_event._end,function(){c.gotoPage(0);return!1});this.lastButton.bind(_event._end,function(){c.gotoPage(originTotalPageCount);return!1});var d=function(b){b.bind(_event._over,function(){b.css({cursor:"pointer"})}.bind(this));b.bind(_event._enter,function(){b.css({background:this.BUTTON_LIGHT_COLOR})}.bind(this));b.bind(_event._leave,function(){b.css({background:this.BUTTON_DARK_COLOR})}.bind(this))}.bind(this);
d(this.leftButton);d(this.rightButton);d(this.firstButton);d(this.lastButton);this.bookContainer.bind(_event._move,b.bind(this));this.bookContainer.bind(_event._start,b.bind(this));this.bookContainer.bind(_event._end,b.bind(this));browserType==BrowserType.MOZ&&(_event._mousewheel="DOMMouseScroll");isIE()&&(_event._mousewheel="mousewheel");this.bookContainer.bind(_event._mousewheel,b.bind(this))},toolbarTopHeight:function(){return toolBar.getTopHeight()},changeMoveMode:function(){!0==this.moveByPoints?
(this.moveByPoints=!1,this.moveMode.empty().append(getImage(toolBarIconsURL[ICON_MOVE_POSITION])).attr("title","Move by mouse position")):(this.moveByPoints=!0,this.moveMode.empty().append(getImage(toolBarIconsURL[ICON_MOVE_DRAG])).attr("title","Move by mouse drag"));this.moveMode.children("img").css({"margin-left":"3px","margin-top":"3px"})},getCurrentPageIndex:function(){return this.currentIndex},setTranslate:function(b,c,d){b.transform(c,d)},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=this.resetIndex(b);this.fillNear(this.currentIndex);setCurrentIndexTextField(this.currentIndex,bookType==BookType.slide_book||bookType==BookType.catalog_book);
window.location.hash="#p="+this.currentIndex;sendvisitinfo(1,this.currentIndex);thumbButtonEnable&&thumbnail.clearHighLight();thumbButtonEnable&&thumbnail.setHighLight(this.currentIndex);b=this.getPageTranslate();parseBool(bookConfig.RightToLeft)?(this.nextPage.setTranslate(-this.nextPage.getWidth(),b.y),this.prePage.setTranslate(this.pageLeftOnTheRight,b.y)):(this.prePage.setTranslate(-this.prePage.getWidth(),b.y),this.nextPage.setTranslate(this.pageLeftOnTheRight,b.y));this.addSearchHighlight()},
resetIndex:function(b){b=2*parseInt(b/2);0==b&&(b=1);return b},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();this.addHistoryTexts()},translateToOrigin:function(b){this.isFlipping=
!0;b=getPoint(this.showPage.side);var c=getPoint(this.prePage.side),d=getPoint(this.nextPage.side);parseBool(bookConfig.RightToLeft)?(this.prePage.setTranslate(this.pageLeftOnTheRight,c.y,100),this.nextPage.setTranslate(-this.nextPage.getWidth(),d.y,100)):(this.nextPage.setTranslate(this.pageLeftOnTheRight,d.y,100),this.prePage.setTranslate(-this.prePage.getWidth(),c.y,100));c=this.getPageTranslate();this.showPage.animateTranslate(c.x,b.y,150);(function(){this.isFlipping=!1}).delay(this,150)},initTranslate:function(){var b=
getPoint(this.showPage.side),c=getPoint(this.prePage.side),d=getPoint(this.nextPage.side);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(b+this.tran.x,c)},zoomAnimate:function(b){this.showPage.zoom(b,0);parseBool(bookConfig.RightToLeft)?(this.prePage.zoomToScale(b,1),this.nextPage.zoomToScale(b,-1)):(this.prePage.zoomToScale(b,-1),this.nextPage.zoomToScale(b,1))},zoomToScale:function(b){this.showPage.zoomToScale(b,
0);parseBool(bookConfig.RightToLeft)?(this.prePage.zoomToScale(b,1),this.nextPage.zoomToScale(b,-1)):(this.prePage.zoomToScale(b,-1),this.nextPage.zoomToScale(b,1))},scrollButtonTran:function(b){b=Math.max(b,0);b=Math.min(b,101);this.scrollButton.transform(b,0)},noZoom:function(){this.showPage.noZoom()},getLeft:function(){return this.showPage.side.offset().left},getTop:function(){return this.showPage.side.offset().top},getMaskLeft:function(){return leftMargin+this.BUTTON_WIDTH},getMaskTop:function(){return topMargin},
getWidth:function(){return this.showPage.getWidth()},getHeight:function(){return this.showPage.getHeight()},getScale:function(){return this.showPage.getScale()},bookWidth:function(){return this.containtWidth+8},bookHeight:function(){return this.containtHeight},show:function(){Log.debug("slide book show.");this.setVisible(!0);this.prePage.showPage();this.nextPage.showPage();this.showPage.hidePage();(function(){this.showPage.showPage();this.addSearchHighlight(this.currentIndex);this.showPage.playSlider()}).delay(this,
500);void 0!=leftRightButton&&null!=leftRightButton&&leftRightButton.setShow(!1);this.addHistoryTexts()},addHistoryTexts:function(){this.showPage.addHistoryTexts()},hide:function(){Log.debug("slide book hide.");this.setVisible(!1);hideLeftRightButton()&&leftRightButton.setShow(!0);this.showPage.resetSlider()}});bdor[15]=".";global.hddr.soo3=bdor[51];
var SingleSlideBook=Class({create:function(b){this._super(b)},initPage:function(){this.prePage=new singleSlideSide(this.bookPage,this);this.nextPage=new singleSlideSide(this.bookPage,this);this.showPage=new singleSlideSide(this.bookPage,this);this.prePage.setChildIndex(1);this.showPage.setChildIndex(3);this.nextPage.setChildIndex(2)},checkIndex:function(b){return b},resizeWidthHeight:function(b,c){this.toScale=1;this.stageWidth=b;this.stageHeight=c;var d=getPageWidthHeight(b,c,zoomPageWidth,zoomPageHeight);
this.width=d.x;this.height=d.y;this.minZoomWidth=d.x;this.minZoomHeight=d.y;this.largeZoomWidth=1*zoomPageWidth;this.largeZoomHeight=1*zoomPageHeight;var d=this.width*this.toScale,e=this.height*this.toScale;this.maxContaintWidth=this.stageWidth-2*this.BUTTON_WIDTH;this.maxContaintHeight=this.stageHeight;this.containtWidth=Math.min(d,this.maxContaintWidth);this.containtHeight=Math.min(e,this.maxContaintHeight);this.pageLeftOnTheRight=this.maxContaintWidth+8},resetIndex:function(b){return b},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();this.addHistoryTexts()},initEvent:function(){function b(){this.eventTriggerTime=new Date;return!0}var c=this;this.leftButton.bind(_event._down,function(){parseBool(bookConfig.RightToLeft)?nextPageFun():previousPageFun()});this.rightButton.bind(_event._down,function(){parseBool(bookConfig.RightToLeft)?
previousPageFun():nextPageFun()});this.firstButton.bind(_event._end,function(){c.gotoPage(1)});this.lastButton.bind(_event._end,function(){c.gotoPage(originTotalPageCount)});var d=function(b){b.bind(_event._over,function(){b.css({cursor:"pointer"})}.bind(this));b.bind(_event._enter,function(){b.css({background:this.BUTTON_LIGHT_COLOR})}.bind(this));b.bind(_event._leave,function(){b.css({background:this.BUTTON_DARK_COLOR})}.bind(this))}.bind(this);d(this.leftButton);d(this.rightButton);d(this.firstButton);
d(this.lastButton);this.bookContainer.bind(_event._move,b.bind(this));this.bookContainer.bind(_event._start,b.bind(this));this.bookContainer.bind(_event._end,b.bind(this));browserType==BrowserType.MOZ&&(_event._mousewheel="DOMMouseScroll");isIE()&&(_event._mousewheel="mousewheel");this.bookContainer.bind(_event._mousewheel,b.bind(this))}}).extend(SlideBook),singleSlideSide=Class({forceReset:function(b){this.toScale=this.book.bookWidth()/this.getWidth();this.width=this.book.bookWidth();this.height=
this.width*this.fitH/this.fitW;void 0==b&&(b=getPoint(this.side));this.forceResize(b)},setStageSize:function(b,c,d,e){this.book.toScale=e;this.book.containtWidth=Math.min(b,this.getStageSize().width);this.book.containtHeight=Math.min(c,this.getStageSize().height);this.book.resizeButton();this.book.scrollButtonTran(d)},getStageSize:function(){return void 0!=this.book?{width:this.book.maxContaintWidth,height:this.book.maxContaintHeight}:{width:0,height:0}},showLoading:function(){void 0!=this.book&&
this.loadingImg.css({left:(this.book.bookWidth()-10)/2+"px",top:(this.book.bookHeight()-10)/2+"px"});this.side.append(this.loadingImg);this.loadingImg.css({display:"block"})},translate:function(b,c,d){c=Math.max(this.book.bookHeight()-this.getHeight(),c);c=Math.min(c,0);b=Math.max(this.book.bookHeight()-this.getHeight(),b);b=Math.min(b,0);this.setTranslate(b,c)},zoom:function(b,c,d){if(!0==this.isZomming)return!1;var e=this.width*this.toScale,f=this.height*this.toScale;b=this.getNewScale(b);var g=
this.width*b,h=this.height*b,k=Math.min(this.width*b,this.getStageSize().width),l=Math.min(this.height*b,this.getStageSize().height),n=(windowWidth-k)/2,f=this.getTran(g,h,f,e,b),e=f.x,f=f.y,f=Math.max(l-this.height*b,f),f=Math.min(f,0),e=Math.max(k-this.width*b,e),e=Math.min(e,n);1==c&&(e=this.book.pageLeftOnTheRight,f=0);-1==c&&(e=-g-2,f=0);this.animateZoom(b,e,f,500,d)},initEvent:function(){var b=this,c=Point(0,0),d=Point(0,0),e=Point(0,0);Point(0,0);var f=!1,g=!1,h=!1,k=null,l=!1,n,q=0,m=0,r=
!1;this.side.bind("mouseenter",function(c){if(cursor&&bookType==BookType.singleSlide_book&&!0!=b.isZomming&&!0!=b.book.isFlipping){var d=getPoint(b.side);b.moveX=d.x;b.moveY=d.y;f=!0;Point(c.pageX,c.pageY)}});this.side.bind(_event._down,function(m){if(cursor&&bookType==BookType.singleSlide_book&&!0!=b.isZomming&&!0!=b.book.isFlipping){b.book.isMove=!1;n=b.toScale;m=isTouch?m.originalEvent.touches:[m];var q=getPoint(b.side);b.translateX=q.x;b.translateY=q.y;b.book.initTranslate();1==m.length?(g=!0,
h=!1,c=Point(m[0].pageX,m[0].pageY),k=Point(b.side.position().left,b.side.position().top)):2==m.length&&(g=!1,h=!0,c=Point(m[0].pageX,m[0].pageY),e=Point(m[1].pageX,m[1].pageY),d=Point((m[0].pageX+m[1].pageX)/2,(m[0].pageY+m[1].pageY)/2),k=Point(b.side.offset().left,b.side.offset().top));l=f=r=!1;stopEvent(m[0])}});2==browserType&&(_event._mousewheel="DOMMouseScroll");isIE()&&(_event._mousewheel="mousewheel");this.side.bind(_event._mousewheel,function(c){if(cursor&&bookType==BookType.singleSlide_book&&
!0!=b.book.isFlipping){c=c.originalEvent;c=Math.max(-1,Math.min(1,c.wheelDelta||-c.detail));getPoint(b.side);var d=-0.5;0<c&&(d=0.5);b.book.zoomAnimate(d);return r=!1}});this.side.bind(_event._move,function(r){if(cursor&&bookType==BookType.singleSlide_book&&!0!=b.book.isFlipping&&!0!=b.isZomming)if(r=isTouch?r.originalEvent.touches:[r],g?b.side.css({cursor:"move"}):b.side.css({cursor:""}),b.book.isMove=!0,g){f=!1;var t=r[0].pageX-c.x+b.translateX,u=r[0].pageY-c.y+b.translateY;(new Date).getTime();
u=Math.min(u*Math.min(Math.abs(u),Math.abs(b.book.bookHeight()-b.getHeight()))/Math.abs(u),0);b.book.bookWidth()+5<b.getWidth()?(u=Math.max(b.book.bookHeight()-b.getHeight(),u),u=Math.min(u,0),t=Math.max(b.book.bookWidth()-b.getWidth(),t),t=Math.min(t,0),b.zoomObj(b.side,b.origin,b.toScale,t,u),b.zoomObj(b.tmpImg,b.origin,b.toScale,t,u),q=t,m=u,b.zoomToMove=!0,b.gotoNextPage=!1,b.gotoPrePage=!1):(b.zoomToMove=!1,b.book.translateMove(r[0].pageX-c.x,u),c.x-r[0].pageX>b.book.width*b.toScale/4?parseBool(bookConfig.RightToLeft)?
(b.gotoNextPage=!1,b.gotoPrePage=!0):(b.gotoNextPage=!0,b.gotoPrePage=!1):c.x-r[0].pageX<=-b.book.width*b.toScale/4?parseBool(bookConfig.RightToLeft)?(b.gotoNextPage=!0,b.gotoPrePage=!1):(b.gotoNextPage=!1,b.gotoPrePage=!0):(b.gotoNextPage=!1,b.gotoPrePage=!1));q=t;m=u}else if(h){f=!1;var t=Point(r[0].pageX,r[0].pageY),u=Point(r[1].pageX,r[1].pageY),w=Math.sqrt(Math.pow(c.x-e.x,2)+Math.pow(c.y-e.y,2)),t=Math.sqrt(Math.pow(t.x-u.x,2)+Math.pow(t.y-u.y,2));scale=Math.max(t/w*n,0.5);w=b.book.minZoomWidth*
scale;1>scale&&w<b.book.minZoomWidth&&(scale=b.book.minZoomWidth/b.book.minZoomWidth,w=b.book.minZoomWidth);1<scale&&w>b.book.largeZoomWidth&&(scale=b.book.largeZoomWidth/b.book.minZoomWidth,w=b.book.largeZoomWidth);b.book.showPage.toScale=scale;b.book.prePage.toScale=scale;b.book.nextPage.toScale=scale;b.book.toScale=scale;b.book.containtWidth=Math.min(b.book.width*scale,b.book.stageWidth);b.book.containtHeight=Math.min(b.book.height*scale,b.book.stageHeight);u=(d.x-k.x)/n;t=(d.y-k.y)/n;b.side.width();
b.side.height();var u=(n-b.toScale)*b.side.width()*(u/b.book.minZoomWidth),A=(n-b.toScale)*b.side.height()*(t/b.book.minZoomHeight),t=b.translateX+u+(b.book.containtWidth-Math.min(b.book.width*n,b.book.stageWidth))/2,u=b.translateY+A+(b.book.containtHeight-Math.min(b.book.height*n,b.book.stageHeight))/2,u=Math.max(b.book.bookHeight()-b.getHeight(),u),u=Math.min(u,0),t=Math.max(b.book.bookWidth()-b.getWidth(),t),t=Math.min(t,0);b.book.showPage.zoomObj(b.book.showPage.side,b.book.showPage.origin,b.toScale,
t,u);b.book.showPage.zoomObj(b.book.showPage.tmpImg,b.book.showPage.origin,b.toScale,t,u);b.book.prePage.zoomObj(b.book.prePage.side,b.book.prePage.origin,b.toScale,-w,0);b.book.prePage.zoomObj(b.book.prePage.tmpImg,b.book.prePage.origin,b.toScale,-w,0);b.book.nextPage.zoomObj(b.book.nextPage.side,b.book.nextPage.origin,b.toScale,w,0);b.book.nextPage.zoomObj(b.book.nextPage.tmpImg,b.book.nextPage.origin,b.toScale,w,0);b.book.resizeButton();t=101*(scale-b.book.minZoomWidth/b.book.width)*b.book.width/
(b.book.largeZoomWidth-b.book.minZoomWidth);b.book.scrollButtonTran(t);l=!0;q=t;m=u;stopEvent(r[0])}else f&&!0!=b.book.isZoomming&&b.book.moveByPoints&&(t=Math.max(r[0].pageX-parseInt(b.book.book.css("left"))-b.book.bookWidth()/4,0)*(b.book.bookWidth()-b.getWidth())*2/b.book.bookWidth(),u=Math.max(r[0].pageY-parseInt(b.book.book.css("top"))-b.book.bookHeight()/4,0)*(b.book.bookHeight()-b.getHeight())*2/b.book.bookHeight(),(new Date).getTime(),u=Math.max(b.book.bookHeight()-b.getHeight(),u),u=Math.min(u,
0),t=Math.max(b.book.bookWidth()-b.getWidth(),t),t=Math.min(t,0),r=getPoint(b.side),b.width*b.toScale<b.book.maxContaintWidth&&(t=r.x),b.animateTranslate(t,u,30),q=t,m=u,b.gotoNextPage=!1,b.gotoPrePage=!1)});this.side.bind(_event._end,function(d){if(cursor&&bookType==BookType.singleSlide_book&&!0!=b.isZomming&&!0!=b.book.isFlipping&&!0!=r){d=isTouch?d.originalEvent.touches:[d];if(Point(d[0].pageX,d[0].pageY).isNearTo(c))return g=!1,f=!0,l=h=!1,cursor&&!0!=b.book.isFlipping&&!0!=b.isZomming&&bookType==
BookType.singleSlide_book&&(l=!0,d=1,d=b.width*b.toScale/zoomPageWidth,b.side.offset(),b.side.offset(),0.75>d?(d=zoomPageWidth/b.width,b.book.zoomAnimate(d-b.book.toScale)):b.book.zoomAnimate(1-b.book.toScale)),!0;b.side.css({cursor:""});b.translateX=q;d=m;d=Math.max(b.book.bookHeight()-b.getHeight(),d);d=Math.min(d,0);b.translateY=d;try{!0==b.gotoNextPage?b.book.gotoPage(parseInt(b.book.currentIndex)+1):!0==b.gotoPrePage?b.book.gotoPage(parseInt(b.book.currentIndex)-1):!1==b.zoomToMove&&!1==l&&b.book.translateToOrigin(b.translateY),
b.gotoNextPage=!1,b.gotoPrePage=!1,r=!0}catch(e){}g=!1;f=!0;l=h=!1}});this.side.bind(_event._leave,function(c){if(cursor&&bookType==BookType.singleSlide_book&&!0!=b.isZomming&&!0!=b.book.isFlipping&&!0!=r){b.side.css({cursor:""});b.translateX=q;c=m;c=Math.max(b.book.bookHeight()-b.getHeight(),c);c=Math.min(c,0);b.translateY=c;try{!0==b.gotoNextPage?b.book.gotoPage(parseInt(b.book.currentIndex)+1):!0==b.gotoPrePage?b.book.gotoPage(parseInt(b.book.currentIndex)-1):!1==b.zoomToMove&&!1==l&&b.book.translateToOrigin(b.translateY),
b.gotoNextPage=!1,b.gotoPrePage=!1,r=!0}catch(d){}g=!1;f=!0;l=h=!1}});this.side.speed(this.inertiaMove.bind(this))},inertiaMove:function(b,c){if(!0!=this.isZomming&&!(0==b&&0==c||this.getHeight()<this.book.maxContaintHeight||1==this.toScale)){var d=getPoint(this.side);if(0<c){if(0<=d.y)return}else if(d.y+this.getHeight()<this.book.maxContaintHeight)return;var e=Point(d.x+b/20*200,d.y+c/20*200),f="swing";this.getWidth()<this.book.maxContaintWidth?0<b?e.x+this.getWidth()>this.book.maxContaintWidth&&
(e.x=this.book.maxContaintWidth-this.getWidth(),f="easeOutBack"):0>e.x&&(e.x=0,f="easeOutBack"):0<b?0<e.x&&(e.x=0,f="easeOutBack"):e.x+this.getWidth()<this.book.maxContaintWidth&&(e.x=this.book.maxContaintWidth-this.getWidth(),f="easeOutBack");0<c?0<e.y&&(e.y=0,f="easeOutBack"):e.y+this.getHeight()<this.book.maxContaintHeight&&(e.y=this.book.maxContaintHeight-this.getHeight(),f="easeOutBack");(function(b,c){if(!0==this.isZomming||!0==this.book.isFlipping)return!1;b<c?(x=$.easing[f](null,b,d.x,e.x-
d.x,c),y=$.easing[f](null,b,d.y,e.y-d.y,c),this.setTranslate(x,y)):this.setTranslate(e.x,e.y)}).runInAnimate(this,400)}},addHistoryTexts:function(){AddNotesByContainers(BookType.singleSlide_book,this.imageIndex,this.MMBackground)},onWinResizeAnimate:function(b,c,d,e,f){var g=getPageWidthHeight(b,c,zoomPageWidth,zoomPageHeight);this.fitW=g.x;this.fitH=g.y;if(d)this.onResizeAnimate(b,c,!0,e,f)},onResizeAnimate:function(b,c,d,e,f){var g=this.width,h=this.height,k=this.toScale,l=getPoint(this.side);b=
getPageWidthHeightByWidth(b,c,zoomPageWidth,zoomPageHeight);this.width=b.x;this.height=b.y;this.side.css({width:g+"px",height:h+"px"});this.zoomObj(this.side,this.origin,this.toScale,l.x,l.y);(function(b,c){var m=$.easing.easeOutQuint(null,b,l.x,e-l.x,c),r=$.easing.easeOutQuint(null,b,l.y,f-l.y,c),s=$.easing.easeOutQuint(null,b,g,this.width-g,c),t=$.easing.easeOutQuint(null,b,h,this.height-h,c),u=$.easing.easeOutQuint(null,b,k,1-k,c),m=translate(m,r),r=scaleTran(u);this.side.css({width:s+"px",height:t+
"px","-webkit-transform":m+r,"-moz-transform":m+r,"-ms-transform":m+r,"-o-transform":m+r});this.toScale=u;this.side.css({width:s+"px",height:t+"px"});this.sideContent.css({width:s+"px",height:t+"px"});this.sideImg.css({width:s+"px",height:t+"px"});this.searchHighlight.css({width:s+"px",height:t+"px"});this.onMMResize(s,t);this.loadingImg.css({left:(s-10)/2+"px",top:(t-10)/2+"px"});d&&this.tmpImg.css({width:s+"px",height:t+"px"})}).runInAnimate(this,450)}}).extend(slideSide),slidePage=Class({create:function(b,
c){this.book=c;this.side=$("<div id='slidePageSide' class='slider-shadow'></div>");this.leftPage=$("<div id='leftPage'></div>");this.rightPage=$("<div id='rightPage'></div>");this.leftSide=new slideSide(this.leftPage,c);this.rightSide=new slideSide(this.rightPage,c);this.width=zoomPageWidth;this.height=zoomPageHeight;this.fitH=this.fitW=0;this.largeZoomWidth=2*zoomPageWidth;this.largeZoomHeight=2*zoomPageHeight;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=getPoint(this.side);this.zoomObj(this.side,this.origin,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.zoomObj(this.side,this.origin,this.toScale,0,0);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"});b=2*parseInt(this.leftSide.imageIndex/2);this.setPageXYByIndex(b,1);this.leftSide.onResize(this.width/2,this.height,d);this.rightSide.onResize(this.width/2,this.height,d)},onResizeAnimate:function(b,
c,d,e,f){var g=this.width,h=this.height,k=this.toScale,l=getPoint(this.side);b=getPageWidthHeightByWidth(b/2,c,zoomPageWidth,zoomPageHeight);this.width=2*b.x;this.height=b.y;this.side.css({width:g+"px",height:h+"px"});this.zoomObj(this.side,this.origin,this.toScale,l.x,l.y);(function(b,c){var m=$.easing.easeOutQuint(null,b,l.x,e-l.x,c),r=$.easing.easeOutQuint(null,b,l.y,f-l.y,c),s=$.easing.easeOutQuint(null,b,g,this.width-g,c),t=$.easing.easeOutQuint(null,b,h,this.height-h,c),u=$.easing.easeOutQuint(null,
b,k,1-k,c),m=translate(m,r),r=scaleTran(u);this.side.css({width:s+"px",height:t+"px","-webkit-transform":m+r,"-moz-transform":m+r,"-ms-transform":m+r,"-o-transform":m+r});this.leftPage.css({width:s/2+"px",height:t+"px"});this.rightPage.css({width:s/2+"px",height:t+"px",left:s/2+"px"});this.toScale=u;this.leftSide.toScale=u;this.rightSide.toScale=u;u=2*parseInt(this.leftSide.imageIndex/2);this.setPagePositionByIndex(u,s,t,1);this.leftSide.onResize(s/2,t,d);this.rightSide.onResize(s/2,t,d)}).runInAnimate(this,
450)},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));this.setPageXYByIndex(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));this.setPageXYByIndex(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));this.setPageXYByIndex(b,1)},changeShadow:function(b){function c(b){var c;c=void 0==b[0].style?b[0].style.zIndex:b.css("z-index");void 0==c&&(c=b.css("z-index"));return""==c||void 0==c?-1:parseInt(c)}!0==b?(this.leftPage.removeClass("slider-shadow"),this.rightPage.removeClass("slider-shadow"),this.side.addClass("slider-shadow")):
(2==c(this.leftPage)&&this.leftPage.addClass("slider-shadow"),2==c(this.rightPage)&&this.rightPage.addClass("slider-shadow"),this.side.removeClass("slider-shadow"))},setPageXYByIndex:function(b,c){this.setPagePositionByIndex(b,this.width,this.height,c)},setPagePositionByIndex:function(b,c,d,e){void 0==e&&(e=this.toScale);parseBool(bookConfig.RightToLeft)?parseBool(bookConfig.retainBookCenter)?(0==b?(this.leftPage.css({left:c*e/4+"px"}),this.rightPage.css({"z-index":1,display:"none"}),this.leftPage.css({"z-index":2})):
(this.leftPage.css({left:"0px"}),this.rightPage.css({display:"block"})),b==totalPageCount?(this.rightPage.css({left:c*e/4+"px"}),this.rightPage.css({"z-index":2}),this.leftPage.css({"z-index":1,display:"none"})):(this.rightPage.css({left:c*e/2+"px"}),this.leftPage.css({display:"block"}))):(0==b?this.leftPage.css({left:c*e/2+"px"}):this.leftPage.css({left:"0px"}),this.rightPage.css({left:c*e/2+"px"})):parseBool(bookConfig.retainBookCenter)?(0==b?(this.rightPage.css({left:c*e/4+"px"}),this.rightPage.css({"z-index":2}),
this.leftPage.css({"z-index":1,display:"none"})):(this.rightPage.css({left:c*e/2+"px"}),this.leftPage.css({display:"block"})),b==totalPageCount?(this.leftPage.css({left:c*e/4+"px"}),this.rightPage.css({"z-index":1,display:"none"}),this.leftPage.css({"z-index":2})):(this.leftPage.css({left:"0px"}),this.rightPage.css({display:"block"}))):(this.rightPage.css({left:c*e/2+"px"}),this.leftPage.css({left:"0px"}));this.changeShadow(0<b&&b<totalPageCount)},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%",this.toScale,b.x,b.y);this.translateX=b.x;this.translateY=b.y},setTranslate:function(b,c){var d=translate(b,c),e=parseFloat(this.toScale)||1,e=scaleTran(e);Math.cos(0);Math.sin(0);Math.sin(0);this.side.transform(b,c);3==browserType?this.side.css({"-webkit-transform":e,"-moz-transform":e,"-ms-transform":e,"-o-transform":e}):this.side.css({"-webkit-transform":d+
e,"-moz-transform":d+e,"-ms-transform":d+e,"-o-transform":d+e})},animateTranslate:function(b,c,d,e){void 0==d&&(d=300);var f=translate(b,c),g=parseFloat(this.toScale)||1,g=scaleTran(g);Math.cos(0);Math.sin(0);Math.sin(0);this.side.transform(b,c);browserType==BrowserType.MS?animateOnce(this.side,{"-webkit-transform":g,"-moz-transform":g,"-ms-transform":g,"-o-transform":g},d,e):animateOnce(this.side,{"-webkit-transform":f+g,"-moz-transform":f+g,"-ms-transform":f+g,"-o-transform":f+g},d,e)},showLoading:function(){this.side.append(this.loadingImg)},
hideLoading:function(){this.loadingImg.remove();this.side.css({background:""})},animateBack:function(b){var c=getPoint(this.side),d={x:c.x,y:c.y,scale:this.toScale},e=this.fitW/this.width,f=this;$(d).animate({x:0,y:0,scale:e},{duration:200,step:function(){f.zoomObj(f.side,f.origin,d.scale,d.x,d.y)},complete:function(){f.toScale=e;b()}})},initEvent:function(){var b=this,c=Point(0,0);Point(0,0);var d=Point(0,0),e=Point(0,0),f=!1,g=!1,h=!1,k=null,l=!1,n,q=0,m=0,r=!1;this.side.bind("mouseover",function(c){if(cursor&&
bookType==BookType.slide_book){if(!0==b.isZomming||!0==b.book.isFlipping)return!1;var d=getPoint(b.side);b.moveX=d.x;b.moveY=d.y;g=!0;Point(c.pageX,c.pageY)}});this.side.bind(_event._down,function(m){if(cursor&&bookType==BookType.slide_book){if(!0==b.isZomming||!0==b.book.isFlipping)return!1;b.book.isMove=!1;n=b.toScale;m=isTouch?m.originalEvent.touches:[m];var q=getPoint(b.side);b.translateX=q.x;b.translateY=q.y;b.book.initTranslate();1==m.length?(f=!0,h=!1,c=Point(m[0].pageX,m[0].pageY),k=Point(b.side.position().left,
b.side.position().top)):2==m.length&&(f=!1,h=!0,c=Point(m[0].pageX,m[0].pageY),e=Point(m[1].pageX,m[1].pageY),d=Point((m[0].pageX+m[1].pageX)/2,(m[0].pageY+m[1].pageY)/2),k=Point(b.side.offset().left,b.side.offset().top));l=r=g=!1;stopEvent(m[0])}});if(3==browserType||2==browserType)_event._mousewheel="DOMMouseScroll";isIE()&&(_event._mousewheel="mousewheel");this.side.bind(_event._mousewheel,function(c){if(cursor){if(bookType!=BookType.slide_book||!0==b.book.isFlipping)return!1;var d=c.originalEvent,
d=Math.max(-1,Math.min(1,d.wheelDelta||-d.detail));getPoint(b.side);var e=-0.5;0<d&&(e=0.5);c=isTouch?c.originalEvent.touches:[c];b.pointX=c[0].pageX;b.pointY=c[0].pageY;b.book.zoomAnimate(e);return r=!1}});this.side.bind(_event._move,function(r){if(cursor&&bookType==BookType.slide_book){if(!0==b.book.isFlipping||!0==b.isZomming)return!1;r=isTouch?r.originalEvent.touches:[r];f?b.side.css({cursor:"move"}):b.side.css({cursor:""});b.book.isMove=!0;if(f){g=!1;var t=r[0].pageX-c.x+b.translateX,u=r[0].pageY-
c.y+b.translateY;b.getHeight()>b.book.maxContaintHeight&&(u=Number.between(u,b.book.maxContaintHeight-b.getHeight(),0));(new Date).getTime();b.book.bookWidth()+5<b.getWidth()?(t=Math.max(b.book.bookWidth()-b.getWidth(),t),t=Math.min(t,0),b.zoomObj(b.side,b.origin,b.toScale,t,u),q=t,m=u,b.zoomToMove=!0,b.gotoNextPage=!1,b.gotoPrePage=!1):!0!=g&&(b.zoomToMove=!1,b.book.translateMove(r[0].pageX-c.x,u),c.x-r[0].pageX>b.book.width*b.toScale/4?parseBool(bookConfig.RightToLeft)?(b.gotoNextPage=!1,b.gotoPrePage=
!0):(b.gotoNextPage=!0,b.gotoPrePage=!1):c.x-r[0].pageX<=-b.book.width*b.toScale/4?parseBool(bookConfig.RightToLeft)?(b.gotoNextPage=!0,b.gotoPrePage=!1):(b.gotoNextPage=!1,b.gotoPrePage=!0):(b.gotoNextPage=!1,b.gotoPrePage=!1));q=t;m=u}else if(h){g=!1;var u=Point(r[0].pageX,r[0].pageY),w=Point(r[1].pageX,r[1].pageY),t=Math.sqrt(Math.pow(c.x-e.x,2)+Math.pow(c.y-e.y,2)),u=Math.sqrt(Math.pow(u.x-w.x,2)+Math.pow(u.y-w.y,2));scale=Math.max(u/t*n,0.5);w=b.side.width()*scale;1>scale&&w<b.book.minZoomWidth&&
(scale=b.book.minZoomWidth/b.book.minZoomWidth,w=b.book.minZoomWidth);1<scale&&w>b.book.largeZoomWidth&&(scale=b.book.largeZoomWidth/b.book.minZoomWidth,w=b.book.largeZoomWidth);b.book.showPage.toScale=scale;b.book.prePage.toScale=scale;b.book.nextPage.toScale=scale;b.book.toScale=scale;b.book.containtWidth=Math.min(b.book.width*scale,b.book.stageWidth);b.book.containtHeight=Math.min(b.book.height*scale,b.book.stageHeight);u=(d.y-k.y)/n/b.book.minZoomHeight*b.book.minZoomHeight*(n-b.toScale);t=b.translateX+
(d.x-k.x)/n/b.book.minZoomWidth*b.book.minZoomWidth*(n-b.toScale)+(b.book.containtWidth-Math.min(b.book.width*n,b.book.stageWidth))/2;u=b.translateY+u+(b.book.containtHeight-Math.min(b.book.height*n,b.book.stageHeight))/2;u=Math.max(b.book.bookHeight()-b.getHeight(),u);u=Math.min(u,0);t=Math.max(b.book.bookWidth()-b.getWidth(),t);t=Math.min(t,0);b.book.showPage.zoomObj(b.book.showPage.side,b.book.showPage.origin,b.toScale,t,u);b.book.prePage.zoomObj(b.book.prePage.side,b.book.prePage.origin,b.toScale,
-w,0);b.book.nextPage.zoomObj(b.book.nextPage.side,b.book.nextPage.origin,b.toScale,w,0);b.book.resizeButton();t=101*(scale-b.book.minZoomWidth/b.book.width)*b.book.width/(b.book.largeZoomWidth-b.book.minZoomWidth);b.book.scrollButtonTran(t);l=!0;q=t;m=u;stopEvent(r[0])}else!0==g&&!0!=b.book.isZoomming&&b.book.moveByPoints&&(t=Math.max(r[0].pageX-parseInt(b.book.book.css("left"))-b.book.bookWidth()/6,0)*(b.book.bookWidth()-b.getWidth())*3/b.book.bookWidth(),u=Math.max(r[0].pageY-parseInt(b.book.book.css("top"))-
b.book.bookHeight()/6,0)*(b.book.bookHeight()-b.getHeight())*3/b.book.bookHeight(),(new Date).getTime(),u=Math.max(b.book.bookHeight()-b.getHeight(),u),u=Math.min(u,0),t=Math.max(b.book.bookWidth()-b.getWidth(),t),t=Math.min(t,0),r=getPoint(b.side),b.width*b.toScale<b.book.maxContaintWidth&&(t=r.x),b.setTranslate(t,u),q=t,m=u,b.gotoNextPage=!1,b.gotoPrePage=!1)}});this.side.bind(_event._end,function(d){if(cursor&&bookType==BookType.slide_book){if(!0==b.isZomming||!0==b.book.isFlipping||!0==r)return!1;
d=isTouch?d.originalEvent.touches:[d];if(Point(d[0].pageX,d[0].pageY).isNearTo(c)){f=!1;g=!0;l=h=!1;if(cursor&&!0!=b.book.isFlipping&&!0!=b.isZomming&&bookType==BookType.slide_book){l=!0;d=zoomPageWidth/b.fitW;var e=b.book.toScale;e<1+(d-1)/2?b.book.zoomAnimate(d-e):b.book.zoomAnimate(1-b.book.toScale)}return!0}b.side.css({cursor:""});b.translateX=q;d=m;d=Math.max(b.book.bookHeight()-b.getHeight(),d);d=Math.min(d,0);b.translateY=d;try{!0==b.gotoNextPage?b.book.gotoPage(2*parseInt(b.book.currentIndex/
2)+2):!0==b.gotoPrePage?b.book.gotoPage(2*parseInt(b.book.currentIndex/2)-2):!1==b.zoomToMove&&!1==l&&b.book.translateToOrigin(b.translateY),b.gotoNextPage=!1,b.gotoPrePage=!1,r=!0}catch(k){}f=!1;g=!0;l=h=!1}});this.side.bind(_event._leave,function(c){if(cursor&&bookType==BookType.slide_book){if(!0==b.isZomming||!0==b.book.isFlipping||!0==r)return!1;b.side.css({cursor:""});b.translateX=q;c=m;c=Math.max(b.book.bookHeight()-b.getHeight(),c);c=Math.min(c,0);b.translateY=c;try{!0==b.gotoNextPage?b.book.gotoPage(2*
parseInt(b.book.currentIndex/2)+2):!0==b.gotoPrePage?b.book.gotoPage(2*parseInt(b.book.currentIndex/2)-2):!1==b.zoomToMove&&!1==l&&b.book.translateToOrigin(b.translateY),b.gotoNextPage=!1,b.gotoPrePage=!1,r=!0}catch(d){}f=!1;g=!0;l=h=!1}});this.side.speed(this.inertiaMove.bind(this))},inertiaMove:function(b,c){if(!0!=this.isZomming&&!(0==b&&0==c||this.getWidth()<this.book.maxContaintWidth)){var d=getPoint(this.side);if(0<b){if(0<=d.x)return}else if(d.x+this.getWidth()<this.book.maxContaintWidth)return;
if(0<c){if(0<=d.y)return}else if(d.y+this.getHeight()<this.book.maxContaintHeight)return;var e=Point(d.x+b/20*200,d.y+c/20*200),f="swing";0<b?0<e.x&&(e.x=0,f="easeOutBack"):e.x+this.getWidth()<this.book.maxContaintWidth&&(e.x=this.book.maxContaintWidth-this.getWidth(),f="easeOutBack");0<c?0<e.y&&(e.y=0,f="easeOutBack"):e.y+this.getHeight()<this.book.maxContaintHeight&&(e.y=this.book.maxContaintHeight-this.getHeight(),f="easeOutBack");(function(b,c){if(!0==this.isZomming)return!1;b<c?(x=$.easing[f](null,
b,d.x,e.x-d.x,c),y=$.easing[f](null,b,d.y,e.y-d.y,c),this.setTranslate(x,y)):this.setTranslate(e.x,e.y)}).runInAnimate(this,400)}},initMM:function(){this.leftSide.initMM();this.rightSide.initMM()},MMResize:function(b,c){this.leftSide.MMResize(b,c);this.rightSide.MMResize(b,c)},addHistoryTexts:function(){this.leftSide.addHistoryTexts();this.rightSide.addHistoryTexts()},highlightSearch:function(b){this.leftSide.highlightSearch(b);this.rightSide.highlightSearch(b)},clearHighlight:function(){this.leftSide.clearHighlight();
this.rightSide.clearHighlight()}}).extend(slideSide),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 e=this.fromIndex+2*c+1,f=[{url:getPageDir(d,"thumb",originTotalPageCount),index:d},{url:getPageDir(e,"thumb",originTotalPageCount),index:e}];0>=d&&(f=[{url:getPageDir(e,"thumb",originTotalPageCount),index:e}]);e>bookConfig.totalPageCount&&(f=[{url:getPageDir(d,"thumb",originTotalPageCount),index:d}]);d=new DockMenuItem(this.menuContent,f);e=Math.min(e,bookConfig.totalPageCount);e=Math.max(1,
e);d.pageIndex=e;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(){g||(g=!0,
window.setTimeout(c,15))}function c(){for(var c=0;c<k.itemArray.length;c++)k.itemArray[c]&&k.itemArray[c].sizeDockIcons(d,e);g=!1;h&&(h=!1,b())}var d,e,f=this.menu,g=!1,h=!1,k=this;$(f).bind(_event._move,function(c){f.is(":visible")&&(d=c.pageX,e=c.pageY,h=!0,b())});$(f).bind(_event._leave,function(c){f.is(":visible")&&(e=d=1E3,h=!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,e=this.itemHeight*this.toScale-d,f=$(this.item).offset().left+$(this.item).outerWidth()/2,g=$(this.item).offset().top+$(this.item).outerHeight()/2,f=this.distance(f,g,b,c),d=(1-Math.min(1,Math.max(0,f/180)))*e+d;this.resize(d)},distance:function(b,c,d,e){b=d-b;c=e-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.preButton=
$("<div></div>");this.nextButton=$("<div></div>");this.firstButton=$("<div></div>");this.lastButton=$("<div></div>");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.preImg=$('<img src="'+uiBaseURL+'slide_leftButton.png"></img>');
this.nextImg=$('<img src="'+uiBaseURL+'slide_rightButton.png"></img>');this.firstImg=$('<img src="'+uiBaseURL+'slide_firstButton.png"></img>');this.lastImg=$('<img src="'+uiBaseURL+'slide_lastButton.png"></img>');this.preButton.append(this.preImg);this.nextButton.append(this.nextImg);this.firstButton.append(this.firstImg);this.lastButton.append(this.lastImg);this.preButton.css({display:"none"});this.nextButton.css({display:"none"});this.firstButton.css({display:"none"});this.lastButton.css({display:"none"});
this.book.append(this.bookPage);this.book.css({width:this.width+"px",height:this.height+"px",position:"absolute",overflow:"hidden","z-index":"9"});this.preButton.css({width:"30px",height:"59px",left:"0px",top:(windowHeight-90)/2+"px",background:"#888888","z-index":"10","border-bottom":"1px solid #000000","border-radius":"5px 5px 0px 0px",position:"absolute",opacity:"0.5"});this.nextButton.css({width:"30px",height:"59px",left:windowWidth-30+"px",top:(windowHeight-90)/2+"px",background:"#888888","z-index":"10",
"border-bottom":"1px solid #000000","border-radius":"5px 5px 0px 0px",position:"absolute",opacity:"0.5"});this.firstButton.css({width:"30px",height:"30px",left:"0px",top:(windowHeight-90)/2+60+"px",background:"#888888","z-index":"10","border-top":"1px solid #ffffff","border-radius":"0px 0px 5px 5px",position:"absolute",opacity:"0.5"});this.lastButton.css({width:"30px",height:"30px",left:windowWidth-30+"px",top:(windowHeight-90)/2+60+"px",background:"#888888","border-top":"1px solid #ffffff","z-index":"10",
"border-radius":"0px 0px 5px 5px",position:"absolute",opacity:"0.5"});this.firstImg.css({left:"7px",top:"7px",position:"absolute"});this.lastImg.css({left:"7px",top:"7px",position:"absolute"});this.preImg.css({left:"7px",top:"22px",position:"absolute"});this.nextImg.css({left:"7px",top:"22px",position:"absolute"});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"});this.preButton.css({display:b?"none":"block"});this.nextButton.css({display:b?"none":"block"});this.firstButton.css({display:b?"none":"block"});
this.lastButton.css({display:b?"none":"block"})},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.preButton.css({left:"0px",top:(windowHeight-90)/2+"px"});this.nextButton.css({left:windowWidth-30+"px",top:(windowHeight-90)/2+"px"});this.firstButton.css({left:"0px",top:(windowHeight-90)/2+60+"px"});this.lastButton.css({left:windowWidth-30+"px",top:(windowHeight-90)/
2+60+"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})},
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 e=0,f=this.showPage,g=void 0,c=this,d=Point(0,f.getWidth());centerP=Point(0,0);this.currentIndex>b?
(g=this.prePage,e=d.y):(g=this.nextPage,e=-d.y);tragetToLeft=centerP.x;g.fillTemp(b);window.setTimeout(function(){var d=getTransform(f.side[0]),k=getTransform(g.side[0]);g.forceReset();var l=30,n=1E3*bookConfig.flippingTime;void 0!=n&&0<n&&(l=4);var q=0,m=window.setInterval(function(){var n=Point(0,0),s=Point(0,0);n.x=$.easing.swing(null,q,d.x,e-d.x,l);s.x=$.easing.swing(null,q,k.x,tragetToLeft-k.x,l);q++;f.translate(n.x,n.y);g.translate(s.x,s.y);q>l&&(window.clearInterval(m),window.setTimeout(function(){c.showPage.noZoom();
auto_player.resetTimer();c.changePage();c.endFlip(b);c.isFlipping=!1},20))},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);window.location.hash="#p="+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(){var b=this;Point(0,0);this.preButton.bind(_event._end,function(c){b.gotoPage(b.currentIndex-2)});
this.nextButton.bind(_event._end,function(c){b.gotoPage(b.currentIndex+2)});this.preButton.bind(_event._enter,function(){b.preButton.css({background:"#000000"})});this.nextButton.bind(_event._enter,function(){b.nextButton.css({background:"#000000"})});this.preButton.bind(_event._leave,function(){b.preButton.css({background:"#888888"})});this.nextButton.bind(_event._leave,function(){b.nextButton.css({background:"#888888"})});this.preButton.bind(_event._end,function(){b.preButton.css({background:"#888888"})});
this.nextButton.bind(_event._end,function(){b.nextButton.css({background:"#888888"})});this.firstButton.bind(_event._enter,function(){b.firstButton.css({background:"#000000"})});this.lastButton.bind(_event._enter,function(){b.lastButton.css({background:"#000000"})});this.firstButton.bind(_event._leave,function(){b.firstButton.css({background:"#888888"})});this.lastButton.bind(_event._leave,function(){b.lastButton.css({background:"#888888"})});this.firstButton.bind(_event._end,function(){b.firstButton.css({background:"#888888"})});
this.lastButton.bind(_event._end,function(){b.lastButton.css({background:"#888888"})});this.firstButton.bind(_event._down,function(){b.gotoPage(1)});this.lastButton.bind(_event._down,function(){b.gotoPage(originTotalPageCount)})},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.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.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)}))},fillTemp:function(b){if(b!=this.imageIndex){this.imageIndex=b;var c=this;this.sideContent.empty();b>originTotalPageCount+3||-2>b||(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,e=getTransform(this.side[0]),f=this.width==zoomPageWidth&&c<zoomPageWidth||this.width!=zoomPageWidth;this.toScale=b?this.width*this.toScale/zoomPageWidth:1;var b=phoneBook.minZoomWidth,g=phoneBook.minZoomHeight;if(void 0!=b&&void 0!=g&&0<b&&0<g){c/d>b/g?g=b*d/c:b=g*c/d;var h=Math.min(0,c-b),k=Math.min(0,d-g),c=Math.max(c,b),d=Math.max(d,g);e.x+=h/2;e.y+=k/2}this.zoomObj(this.side,"0% 0%","scale("+this.toScale+")",e.x,e.y);this.width=c;this.height=d;this.translateX=e.x;this.translateY=
e.y;f&&this.tmpImg.css({width:this.width+"px",height:this.height+"px"});this.zoomObj(this.tmpImg,"0% 0%","scale("+this.toScale+")",e.x,e.y);this.tmpImg.css({display:"block"});if(f)this.onResize(c,d)},zoom:function(b,c){if(!0==this.isZomming)return!1;var d=phoneBook.minZoomWidth,e=phoneBook.largeZoomWidth,f=this.side.width()*this.toScale;this.side.height();var g=this.toScale+b,h=this.side.width()*g;if(1>g){if(f<=d)return;h<d&&(g=d/this.side.width())}1<g&&h>e&&(g=e/this.side.width());h=this.side.width()*
g;this.side.height();d=(f-h)/2+this.translateX;0==c&&(d=0);1==c&&(d=h);-1==c&&(d=-h);this.animateZoom(g,d,0,300)},zoomToScale:function(b,c){if(!0==this.isZomming)return!1;var d=phoneBook.minZoomWidth,e=phoneBook.largeZoomWidth,f=this.side.width()*this.toScale;this.side.height();var g=this.toScale+b,h=this.side.width()*g;if(1>g){if(f<=d)return;h<d&&(g=d/this.side.width())}1<g&&h>e&&(g=e/this.side.width());h=this.side.width()*g;this.side.height();d=(f-h)/2+this.translateX;0==c&&(d=0);1==c&&(d=h);-1==
c&&(d=-h);!0!=this.isZomming&&(this.isZomming=!0,g||(g=this.toScale),d||(d=0),getTransform(this.side[0]),this.tmpImg.css({display:"none"}),this.zoomObj(this.side,this.origin," scale("+g+")",d,0),this.zoomObj(this.tmpImg,this.origin," scale("+g+")",d,0),this.tmpImg.css({display:"block"}),this.toScale=g,phoneBook.toScale=g,phoneBook.containtWidth=Math.min(phoneBook.width*g,phoneBook.stageWidth),phoneBook.containtHeight=Math.min(phoneBook.height*g,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,e,f){e||(e=0);f||(f=0);e=
translate(e,f);b.css({"-webkit-transform-origin":c,"-moz-transform-origin":c,"-ms-transform-origin":c,"-o-transform-origin":c,"-webkit-transform":e+d,"-moz-transform":e+d,"-ms-transform":e+d,"-o-transform":e+d})},setTranslate:function(b,c,d){c=translate(c,d);b.css({"-webkit-transform":c,"-moz-transform":c,"-o-transform":c,"-ms-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 e=getTransform(this.side[0]),f=this;$(e).animate({x:b,
y:c},{duration:d,easing:"easeOutSine",complete:function(){f.zoomObj(f.side,f.origin," scale("+f.toScale+")",e.x,e.y);f.zoomObj(f.tmpImg,f.origin," scale("+f.toScale+")",e.x,e.y)}})},animateZoom:function(b,c,d,e){if(!0!=this.isZomming){this.isZomming=!0;b||(b=this.toScale);c||(c=0);d||(d=0);e||(e=25);var f=getTransform(this.side[0]),g={scale:this.toScale,x:f.x,y:f.y},h=this;$(g).animate({scale:b,x:c,y:d},{duration:e,easing:"easeOutSine",step:function(){h.tmpImg.css({display:"none"});h.zoomObj(h.side,
h.origin," scale("+g.scale+")",c,d);h.zoomObj(h.tmpImg,h.origin," scale("+g.scale+")",c,d);h.tmpImg.css({display:"block"})},complete:function(){h.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"});h.isZomming=!1}})}},onWinResize:function(b,c,d){this.toScale=1;var e=getPageWidthHeightByWidth(b,c,zoomPageWidth,zoomPageHeight);this.fitW=e.x;this.fitH=e.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},e=this.fitW/this.width,f=this;f.tmpImg.css({display:"none"});$(d).animate({x:0,y:0,scale:e},{duration:200,step:function(){f.zoomObj(f.side,f.origin," scale("+d.scale+")",d.x,d.y);f.zoomObj(f.tmpImg,f.origin," scale("+d.scale+")",d.x,d.y)},complete:function(){f.toScale=e;f.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,e=phoneBook.largeZoomWidth,f=this.side.width()*this.toScale;this.side.height();var g=this.toScale+b,h=this.side.width()*g;if(1>g){if(f<=d)return;h<d&&(g=d/this.side.width())}1<g&&h>e&&(g=e/this.side.width());h=this.side.width()*g;this.side.height();d=(f-h)/2+this.translateX;0==c&&(d=0);1==c&&(d=h);-1==c&&(d=-h);this.animateZoom(g,d,0,300)},zoomToScale:function(b,c){if(!0==this.isZomming)return!1;
var d=phoneBook.minZoomWidth,e=phoneBook.largeZoomWidth,f=this.side.width()*this.toScale;this.side.height();var g=this.toScale+b,h=this.side.width()*g;if(1>g){if(f<=d)return;h<d&&(g=d/this.side.width())}1<g&&h>e&&(g=e/this.side.width());h=this.side.width()*g;this.side.height();d=(f-h)/2+this.translateX;0==c&&(d=0);1==c&&(d=h);-1==c&&(d=-h);!0!=this.isZomming&&(this.isZomming=!0,g||(g=this.toScale),d||(d=0),getTransform(this.side[0]),this.zoomObj(this.side,this.origin," scale("+g+")",d,0),this.toScale=
g,phoneBook.toScale=g,phoneBook.containtWidth=Math.min(phoneBook.width*g,phoneBook.stageWidth),phoneBook.containtHeight=Math.min(phoneBook.height*g,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,e,f){e||(e=0);f||(f=0);e=translate(e,f);b.css({"-webkit-transform-origin":c,"-moz-transform-origin":c,"-ms-transform-origin":c,"-o-transform-origin":c,"-webkit-transform":e+d,"-moz-transform":e+d,"-ms-transform":e+d,"-o-transform":e+d})},setTranslate:function(b,c,d){c=translate(c,d);b.css({"-webkit-transform":c,"-moz-transform":c,"-o-transform":c,
"-ms-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 e=getTransform(this.side[0]),f=this;$(e).animate({x:b,y:c},{duration:d,easing:"easeOutSine",complete:function(){f.zoomObj(f.side,f.origin," scale("+f.toScale+")",e.x,e.y)}})},animateZoom:function(b,c,d,e){if(!0!=this.isZomming){this.isZomming=!0;b||(b=this.toScale);c||(c=0);d||(d=0);e||(e=25);var f=getTransform(this.side[0]),g={scale:this.toScale,x:f.x,y:f.y},h=this;$(g).animate({scale:b,
x:c,y:d},{duration:e,easing:"easeOutSine",step:function(){h.zoomObj(h.side,h.origin," scale("+g.scale+")",c,d)},complete:function(){h.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"});h.isZomming=!1}})}},onWinResize:function(b,c,d){this.toScale=1;var e=getPageWidthHeightByWidth(b/2,c,zoomPageWidth,zoomPageHeight);this.fitW=2*e.x;this.fitH=e.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},e=this.fitW/this.width,f=this;f.tmpImg.css({display:"none"});$(d).animate({x:0,y:0,scale:e},{duration:200,step:function(){f.zoomObj(f.side,f.origin," scale("+d.scale+")",d.x,d.y)},complete:function(){f.toScale=e;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),e=Point(0,0),f=!1,g=!1,h=null,k=!1,l,n=0,q=0,m=!1;this.side.bind(_event._down,function(n){n.preventDefault();if(bookType==BookType.phone_book){if(!0==b.isZomming||!0==phoneBook.isFlipping)return!1;l=b.toScale;m=!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?(f=!0,g=!1,c=Point(n[0].pageX,n[0].pageY),h=Point(b.side.position().left,b.side.position().top)):2==n.length&&(f=!1,g=!0,c=
Point(n[0].pageX,n[0].pageY),e=Point(n[1].pageX,n[1].pageY),d=Point((n[0].pageX+n[1].pageX)/2,(n[0].pageY+n[1].pageY)/2),h=Point(b.side.offset().left,b.side.offset().top));k=!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(r){r.preventDefault();if(bookType==BookType.phone_book){r=isTouch?r.originalEvent.touches:[r];if(!0==b.isZomming||!0==phoneBook.isFlipping||!0==m)return!1;f?b.side.css({cursor:"move"}):b.side.css({cursor:""});if(f){var s=r[0].pageX-c.x+b.translateX,t=r[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()?(s=Math.max(phoneBook.getWidth()-
b.getWidth(),s),s=Math.min(s,0),b.zoomObj(b.side,b.origin," scale("+b.toScale+")",s,t),n=s,q=t,b.zoomToMove=!0,b.gotoNextPage=!1,b.gotoPrePage=!1):(b.zoomToMove=!1,phoneBook.translateMove(r[0].pageX-c.x,t),c.x-r[0].pageX>windowWidth/8?(b.gotoNextPage=!0,b.gotoPrePage=!1):c.x-r[0].pageX<=-windowWidth/8?(b.gotoNextPage=!1,b.gotoPrePage=!0):(b.gotoNextPage=!1,b.gotoPrePage=!1));n=s;q=t;k=!1;stopEvent(r[0])}else if(g){var t=Point(r[0].pageX,r[0].pageY),u=Point(r[1].pageX,r[1].pageY),s=Math.sqrt(Math.pow(c.x-
e.x,2)+Math.pow(c.y-e.y,2)),t=Math.sqrt(Math.pow(t.x-u.x,2)+Math.pow(t.y-u.y,2));scale=Math.max(t/s*l,0.5);s=b.side.width()*scale;1>scale&&s<phoneBook.minZoomWidth&&(scale=phoneBook.minZoomWidth/b.side.width());1<scale&&s>phoneBook.largeZoomWidth&&(scale=phoneBook.largeZoomWidth/b.side.width());phoneBook.showPage.toScale=scale;t=(d.x-h.x)/l;s=(d.y-h.y)/l;b.side.width();b.side.height();t=(l-b.toScale)*b.side.width()*(t/b.side.width());u=(l-b.toScale)*b.side.height()*(s/b.side.height());s=b.translateX+
t;t=b.translateY+u;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);s=Math.max(phoneBook.getWidth()-b.side.width()*scale,s);s=Math.min(s,0);phoneBook.showPage.zoomObj(phoneBook.showPage.side,phoneBook.showPage.origin," scale("+b.toScale+")",s,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"});k=!0;stopEvent(r[0])}}});this.side.bind(_event._end,function(c){c.preventDefault();if(bookType==BookType.phone_book){if(!0==b.isZomming||!0==phoneBook.isFlipping||!0==m)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?phoneBook.gotoPage(parseInt(phoneBook.currentIndex)+
2):!0==b.gotoPrePage?phoneBook.gotoPage(parseInt(phoneBook.currentIndex)-2):!1==b.zoomToMove&&!1==k&&phoneBook.translateToOrigin(b.translateY),b.gotoNextPage=!1,b.gotoPrePage=!1,m=!0}catch(e){}k=g=f=!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==m)return!1;try{!0==b.gotoNextPage?phoneBook.gotoPage(parseInt(phoneBook.currentIndex)+2):!0==b.gotoPrePage?phoneBook.gotoPage(parseInt(phoneBook.currentIndex)-
2):!1==b.zoomToMove&&!1==k&&phoneBook.translateToOrigin(b.translateY),b.gotoNextPage=!1,b.gotoPrePage=!1,m=!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.preButton=
$("<div></div>");this.nextButton=$("<div></div>");this.firstButton=$("<div></div>");this.lastButton=$("<div></div>");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.preImg=$('<img src="'+uiBaseURL+'slide_leftButton.png"></img>');this.nextImg=$('<img src="'+uiBaseURL+'slide_rightButton.png"></img>');this.firstImg=$('<img src="'+uiBaseURL+'slide_firstButton.png"></img>');this.lastImg=$('<img src="'+uiBaseURL+'slide_lastButton.png"></img>');this.preButton.append(this.preImg);this.nextButton.append(this.nextImg);this.firstButton.append(this.firstImg);this.lastButton.append(this.lastImg);this.preButton.css({display:"none"});
this.nextButton.css({display:"none"});this.firstButton.css({display:"none"});this.lastButton.css({display:"none"});this.book.append(this.bookPage);this.book.css({width:this.width+"px",height:this.height+"px",position:"absolute",overflow:"hidden","z-index":"9"});this.preButton.css({width:"30px",height:"59px",left:"0px",top:(windowHeight-90)/2+"px",background:"#888888","z-index":"10","border-bottom":"1px solid #000000","border-radius":"5px 5px 0px 0px",position:"absolute",opacity:"0.5"});this.nextButton.css({width:"30px",
height:"59px",left:windowWidth-30+"px",top:(windowHeight-90)/2+"px",background:"#888888","z-index":"10","border-bottom":"1px solid #000000","border-radius":"5px 5px 0px 0px",position:"absolute",opacity:"0.5"});this.firstButton.css({width:"30px",height:"30px",left:"0px",top:(windowHeight-90)/2+60+"px",background:"#888888","z-index":"10","border-top":"1px solid #ffffff","border-radius":"0px 0px 5px 5px",position:"absolute",opacity:"0.5"});this.lastButton.css({width:"30px",height:"30px",left:windowWidth-
30+"px",top:(windowHeight-90)/2+60+"px",background:"#888888","border-top":"1px solid #ffffff","z-index":"10","border-radius":"0px 0px 5px 5px",position:"absolute",opacity:"0.5"});this.firstImg.css({left:"7px",top:"7px",position:"absolute"});this.lastImg.css({left:"7px",top:"7px",position:"absolute"});this.preImg.css({left:"7px",top:"22px",position:"absolute"});this.nextImg.css({left:"7px",top:"22px",position:"absolute"});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"});this.preButton.css({display:b?"none":"block"});this.nextButton.css({display:b?"none":
"block"});this.firstButton.css({display:b?"none":"block"});this.lastButton.css({display:b?"none":"block"})},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.preButton.css({left:"0px",top:(windowHeight-90)/2+"px"});this.nextButton.css({left:windowWidth-30+"px",top:(windowHeight-90)/2+"px"});this.firstButton.css({left:"0px",top:(windowHeight-90)/2+60+"px"});this.lastButton.css({left:windowWidth-
30+"px",top:(windowHeight-90)/2+60+"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})},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 e=0,f=this.showPage,g=void 0,c=this,d=Point(0,f.getWidth());centerP=Point(0,0);this.currentIndex>b?(g=this.prePage,e=d.y):(g=this.nextPage,
e=-d.y);tragetToLeft=centerP.x;g.fillTemp(b);(function(){var d=getTransform(f.side[0]),k=getTransform(g.side[0]);g.forceReset();var l=30,n=1E3*bookConfig.flippingTime;void 0!=n&&0<n&&(l=2);var q=0,m=window.setInterval(function(){var n=Point(0,0),s=Point(0,0);n.x=$.easing.swing(null,q,d.x,e-d.x,l);s.x=$.easing.swing(null,q,k.x,tragetToLeft-k.x,l);q++;f.translate(n.x,n.y);g.translate(s.x,s.y);q>l&&(window.clearInterval(m),window.setTimeout(function(){c.showPage.noZoom();auto_player.resetTimer();c.changePage();
c.endFlip(b);c.isFlipping=!1},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);window.location.hash="#p="+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(){var b=this;Point(0,0);this.preButton.bind(_event._end,function(c){b.gotoPage(b.currentIndex-1)});this.nextButton.bind(_event._end,function(c){b.gotoPage(b.currentIndex+1)});this.preButton.bind(_event._enter,function(){b.preButton.css({background:"#000000"})});
this.nextButton.bind(_event._enter,function(){b.nextButton.css({background:"#000000"})});this.preButton.bind(_event._leave,function(){b.preButton.css({background:"#888888"})});this.nextButton.bind(_event._leave,function(){b.nextButton.css({background:"#888888"})});this.preButton.bind(_event._end,function(){b.preButton.css({background:"#888888"})});this.nextButton.bind(_event._end,function(){b.nextButton.css({background:"#888888"})});this.firstButton.bind(_event._enter,function(){b.firstButton.css({background:"#000000"})});
this.lastButton.bind(_event._enter,function(){b.lastButton.css({background:"#000000"})});this.firstButton.bind(_event._leave,function(){b.firstButton.css({background:"#888888"})});this.lastButton.bind(_event._leave,function(){b.lastButton.css({background:"#888888"})});this.firstButton.bind(_event._end,function(){b.firstButton.css({background:"#888888"})});this.lastButton.bind(_event._end,function(){b.lastButton.css({background:"#888888"})});this.firstButton.bind(_event._down,function(){b.gotoPage(1)});
this.lastButton.bind(_event._down,function(){b.gotoPage(originTotalPageCount)})},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.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.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"});
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.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)}))},fillTemp:function(b){if(b!=this.imageIndex){this.imageIndex=b;var c=this;this.sideContent.empty();b>originTotalPageCount+1||0>b||(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+1||0>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,e=getTransform(this.side[0]),f=this.width==zoomPageWidth&&c<zoomPageWidth||this.width!=zoomPageWidth;this.toScale=b?this.width*this.toScale/zoomPageWidth:1;var b=singlePhoneBook.minZoomWidth,g=singlePhoneBook.minZoomHeight;if(void 0!=b&&void 0!=g&&0<b&&0<g){c/d>b/g?g=b*d/c:b=g*c/d;var h=Math.min(0,c-b),k=Math.min(0,d-g),c=Math.max(c,b),d=Math.max(d,g);e.x+=h/2;e.y+=k/2}this.zoomObj(this.side,"0% 0%","scale("+this.toScale+")",e.x,e.y);this.width=c;this.height=d;this.translateX=
e.x;this.translateY=e.y;f&&this.tmpImg.css({width:this.width+"px",height:this.height+"px"});this.zoomObj(this.tmpImg,"0% 0%","scale("+this.toScale+")",e.x,e.y);this.tmpImg.css({display:"block"});if(f)this.onResize(c,d)},zoom:function(b,c){if(!0==this.isZomming)return!1;var d=singlePhoneBook.minZoomWidth,e=singlePhoneBook.largeZoomWidth,f=this.side.width()*this.toScale;this.side.height();var g=this.toScale+b,h=this.side.width()*g;if(1>g){if(f<=d)return;h<d&&(g=d/this.side.width())}1<g&&h>e&&(g=e/this.side.width());
h=this.side.width()*g;this.side.height();d=(f-h)/2+this.translateX;0==c&&(d=0);1==c&&(d=h);-1==c&&(d=-h);this.animateZoom(g,d,0,300)},zoomToScale:function(b,c){if(!0==this.isZomming)return!1;var d=singlePhoneBook.minZoomWidth,e=singlePhoneBook.largeZoomWidth,f=this.side.width()*this.toScale;this.side.height();var g=this.toScale+b,h=this.side.width()*g;if(1>g){if(f<=d)return;h<d&&(g=d/this.side.width())}1<g&&h>e&&(g=e/this.side.width());h=this.side.width()*g;this.side.height();d=(f-h)/2+this.translateX;
0==c&&(d=0);1==c&&(d=h);-1==c&&(d=-h);!0!=this.isZomming&&(this.isZomming=!0,g||(g=this.toScale),d||(d=0),getTransform(this.side[0]),this.tmpImg.css({display:"none"}),this.zoomObj(this.side,this.origin," scale("+g+")",d,0),this.zoomObj(this.tmpImg,this.origin," scale("+g+")",d,0),this.tmpImg.css({display:"block"}),this.toScale=g,singlePhoneBook.toScale=g,singlePhoneBook.containtWidth=Math.min(singlePhoneBook.width*g,singlePhoneBook.stageWidth),singlePhoneBook.containtHeight=Math.min(singlePhoneBook.height*
g,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,e,f){e||(e=0);f||(f=0);e=
translate(e,f);b.css({"-webkit-transform-origin":c,"-moz-transform-origin":c,"-ms-transform-origin":c,"-o-transform-origin":c,"-webkit-transform":e+d,"-moz-transform":e+d,"-ms-transform":e+d,"-o-transform":e+d})},setTranslate:function(b,c,d){c=translate(c,d);b.css({"-webkit-transform":c,"-moz-transform":c,"-o-transform":c,"-ms-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 e=getTransform(this.side[0]),f=this;$(e).animate({x:b,
y:c},{duration:d,easing:"easeOutSine",complete:function(){f.zoomObj(f.side,f.origin," scale("+f.toScale+")",e.x,e.y);f.zoomObj(f.tmpImg,f.origin," scale("+f.toScale+")",e.x,e.y)}})},animateZoom:function(b,c,d,e){if(!0!=this.isZomming){this.isZomming=!0;b||(b=this.toScale);c||(c=0);d||(d=0);e||(e=25);var f=getTransform(this.side[0]),g={scale:this.toScale,x:f.x,y:f.y},h=this;$(g).animate({scale:b,x:c,y:d},{duration:e,easing:"easeOutSine",step:function(){h.tmpImg.css({display:"none"});h.zoomObj(h.side,
h.origin," scale("+g.scale+")",c,d);h.zoomObj(h.tmpImg,h.origin," scale("+g.scale+")",c,d);h.tmpImg.css({display:"block"})},complete:function(){h.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"});h.isZomming=!1}})}},onWinResize:function(b,c,d){this.toScale=1;var e=getPageWidthHeightByWidth(b,c,zoomPageWidth,zoomPageHeight);this.fitW=e.x;this.fitH=e.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},e=this.fitW/this.width,f=this;f.tmpImg.css({display:"none"});$(d).animate({x:0,y:0,scale:e},{duration:200,step:function(){f.zoomObj(f.side,f.origin," scale("+d.scale+")",d.x,d.y);f.zoomObj(f.tmpImg,f.origin," scale("+d.scale+
")",d.x,d.y)},complete:function(){f.toScale=e;f.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),e=Point(0,0),f=!1,g=!1,h=null,k=!1,l,n=0,q=0,m=!1;this.side.bind(_event._down,function(n){n.preventDefault();if(bookType==BookType.singlePhone_book&&
!0!=b.isZomming&&!0!=singlePhoneBook.isFlipping){l=b.toScale;m=!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?(f=!0,g=!1,c=Point(n[0].pageX,n[0].pageY),h=Point(b.side.position().left,b.side.position().top)):2==n.length&&(f=!1,g=!0,c=Point(n[0].pageX,n[0].pageY),e=Point(n[1].pageX,n[1].pageY),d=Point((n[0].pageX+n[1].pageX)/2,(n[0].pageY+n[1].pageY)/2),h=Point(b.side.offset().left,b.side.offset().top));
k=!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(r){r.preventDefault();if(bookType==BookType.singlePhone_book&&(r=isTouch?
r.originalEvent.touches:[r],!0!=b.isZomming&&!0!=singlePhoneBook.isFlipping&&!0!=m))if(f?b.side.css({cursor:"move"}):b.side.css({cursor:""}),f){var s=r[0].pageX-c.x+b.translateX,t=r[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()?(s=Math.max(singlePhoneBook.getWidth()-b.getWidth(),s),s=Math.min(s,0),b.zoomObj(b.side,b.origin," scale("+b.toScale+")",s,t),b.zoomObj(b.tmpImg,b.origin," scale("+
b.toScale+")",s,t),n=s,q=t,b.zoomToMove=!0,b.gotoNextPage=!1,b.gotoPrePage=!1):(b.zoomToMove=!1,singlePhoneBook.translateMove(r[0].pageX-c.x,t),c.x-r[0].pageX>windowWidth/4?(b.gotoNextPage=!0,b.gotoPrePage=!1):c.x-r[0].pageX<=-windowWidth/4?(b.gotoNextPage=!1,b.gotoPrePage=!0):(b.gotoNextPage=!1,b.gotoPrePage=!1));n=s;q=t;k=!1}else g&&(s=Point(r[0].pageX,r[0].pageY),t=Point(r[1].pageX,r[1].pageY),r=Math.sqrt(Math.pow(c.x-e.x,2)+Math.pow(c.y-e.y,2)),s=Math.sqrt(Math.pow(s.x-t.x,2)+Math.pow(s.y-t.y,
2)),scale=Math.max(s/r*l,0.5),r=b.side.width()*scale,1>scale&&r<singlePhoneBook.minZoomWidth&&(scale=singlePhoneBook.minZoomWidth/b.side.width()),1<scale&&r>singlePhoneBook.largeZoomWidth&&(scale=singlePhoneBook.largeZoomWidth/b.side.width()),singlePhoneBook.showPage.toScale=scale,s=(d.x-h.x)/l,r=(d.y-h.y)/l,b.side.width(),b.side.height(),s=(l-b.toScale)*b.side.width()*(s/b.side.width()),r=(l-b.toScale)*b.side.height()*(r/b.side.height()),s=b.translateX+s,t=b.translateY+r,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),s=Math.max(singlePhoneBook.getWidth()-b.side.width()*scale,s),s=Math.min(s,0),singlePhoneBook.showPage.zoomObj(singlePhoneBook.showPage.side,singlePhoneBook.showPage.origin," scale("+b.toScale+")",s,t),singlePhoneBook.showPage.zoomObj(singlePhoneBook.showPage.tmpImg,
singlePhoneBook.showPage.origin," scale("+b.toScale+")",s,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"}),k=!0)});this.side.bind(_event._end,function(c){c.preventDefault();if(bookType==BookType.singlePhone_book&&!0!=b.isZomming&&!0!=singlePhoneBook.isFlipping&&!0!=m){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?singlePhoneBook.gotoPage(parseInt(singlePhoneBook.currentIndex)+1):!0==b.gotoPrePage?singlePhoneBook.gotoPage(parseInt(singlePhoneBook.currentIndex)-1):!1==b.zoomToMove&&!1==k&&singlePhoneBook.translateToOrigin(b.translateY),b.gotoNextPage=!1,b.gotoPrePage=!1,m=!0}catch(d){}k=g=f=!1}});this.side.bind(_event._leave,function(c){if(bookType==BookType.singlePhone_book&&!0!=
b.isZomming&&!0!=singlePhoneBook.isFlipping&&!0!=m)try{!0==b.gotoNextPage?singlePhoneBook.gotoPage(parseInt(singlePhoneBook.currentIndex)+1):!0==b.gotoPrePage?singlePhoneBook.gotoPage(parseInt(singlePhoneBook.currentIndex)-1):!1==b.zoomToMove&&!1==k&&singlePhoneBook.translateToOrigin(b.translateY),b.gotoNextPage=!1,b.gotoPrePage=!1,m=!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";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},e={iconURL:uiBaseURL+
"myspace.png",caption:"MySpace",link:"http://api.addthis.com/oexchange/0.8/forward/myspace/offer"+b},f={iconURL:uiBaseURL+"twitter.png",caption:"Twitter",link:"http://api.addthis.com/oexchange/0.8/forward/twitter/offer"+b},g={iconURL:uiBaseURL+"digg.png",caption:"Digg",link:"http://api.addthis.com/oexchange/0.8/forward/digg/offer"+b},h={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,e);this.twButton=new shareButton(this.contentBox,f);this.diggButton=new shareButton(this.contentBox,g);this.moreButton=new shareButton(this.contentBox,h)};
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()};thumbnailCell=Class({create:function(b){this.background=$("<div></div>");this.img=$("<img />");this.pageIndex=-1;this.width=(Math.min(windowWidth,windowHeight)-30)/4;this.height=this.width*bookConfig.largePageHeight/bookConfig.largePageWidth+15;this.pageTextField=new label(1,this.background);this.imgHeight=this.imgWidth=-1;$(b).append(this.background);$(this.background).css({position:"absolute",width:this.width+"px",height:this.height+"px"});$(this.background).css({"text-shadow":"0 0 10px #8c97cb, 0 0 20px #8c97cb,0 0 30px #8c97cb, 0 0 40px #8c97cb,0 0 50px #8c97cb, 0 0 60px #8c97cb"});
$(this.img).css({position:"absolute"});this.pageTextField.setFont("5px","#f0f0f0",null);this.pageTextField.setLabelPosition((this.width-this.pageTextField.getWidth())/2,0,["left","bottom"]);$(this.img).css({"-webkit-box-shadow":"0 0 5px rgba(0, 0, 0, 1)","-moz-box-shadow":"0 0 5px rgba(0, 0, 0, 1)","-o-box-shadow":"0 0 5px rgba(0, 0, 0, 1)","box-shadow":"0 0 5px rgba(0, 0, 0, 1)"})},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(){var b=this.height-15;this.imgWidth=this.width;this.imgHeight=b;$(this.img).css({width:this.imgWidth+"px",height:this.imgHeight+"px"});$(this.img).css({top:"0px"})},setImgPosition:function(b){switch(b){case "l":$(this.img).css({left:rightToLeft?
"auto":"0px",right:rightToLeft?"0px":"auto"});break;case "r":$(this.img).css({right:rightToLeft?"auto":"0px",left:rightToLeft?"0px":"auto"});break;case "c":$(this.img).css({left:rightToLeft?"auto":(this.width-this.imgWidth)/2+"px",right:rightToLeft?(this.width-this.imgWidth)/2+"px":"auto"})}},setCaption:function(b){this.pageTextField.setCaption(b)},fillImage:function(b){this.pageIndex=b;$(this.img).attr("src",getPageDir(b,"thumb",originTotalPageCount));$(this.background).append(this.img);this.onResizeImage(this.width,
this.height);this.pageTextField.setCaption(b)},showBorder:function(){$(this.background).css({border:"1px solid #444444"})},hideBorder:function(){$(this.background)[0].style.border=""},getTextField:function(){return this.pageTextField},hideTextField:function(){this.pageTextField.setCSS({display:"none"})},showTextField:function(){this.pageTextField.setCSS({display:"block"})},showCell:function(b){$(this.background).css({display:b?"block":"none"})},onMouseUp:function(b,c){var d=this;$(this.background).bind(_event._end,
function(b){thumbnail&&!thumbnail.isDrag&&(b=d.getPageIndex(),gotoPageFun(b),thumbnail&&thumbnail.hideBox())});$(this.background).bind(_event._enter,function(b){d.background.css({cursor:"pointer"})})},highLight:function(b){$(this.background).css({border:"2px solid #ff8040"})},onMouseOver:function(){if(!isTouch){var b=this;$(this.background).css({border:""});$(this.background).bind(_event._enter,function(c){b.background.css({border:"2px solid #0080ff"})});$(this.background).bind(_event._leave,function(c){b.background.css({border:""})})}},
clearMouseOver:function(){var b=this;$(this.background).bind(_event._enter,function(c){b.background.css({border:""})});$(this.background).bind(_event._leave,function(c){b.background.css({border:""})})},onMouseOverUp:function(){if(!isTouch){var b=this;$(this.background).bind(_event._enter,function(c){b.background.css({border:"2px solid #0080ff"})});$(this.background).bind(_event._leave,function(c){b.background.css({border:"2px solid #ff8040"})})}},clearHighLight:function(){$(this.background).css({border:""})}});var isThumbDrag=!1;
thumbnailBar=Class({create:function(b){this.width=windowWidth;this.height=windowHeight;this.contentHeight=windowHeight-80;this.contentWidth=Math.min(windowWidth,windowHeight);this.mainColor="#888888";this.thumbArray=[];this.isDrag=this.mergeing=this.showing=!1;this.pageIndex=this.currentCellIndex=1;this.createThumbItemFalg=!1;this.oldMode=this.currentMedo=0;this.background=$("<div id='background' class='phoneThumbBar'></div>");this.contentBox=$("<div id='contentBox' class='phoneThumbBG'></div>");this.scrollBox=
$("<div id='scrollBox' class='phoneThumbBox'></div>");$(b).append(this.background);$(b).append(this.contentBox);$(this.contentBox).append(this.scrollBox);this.initStyle();this.background.css({display:"none"});this.contentBox.css({display:"none"});this.initScrollEvent();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(),this.fillNearByImages(),1===this.currentMedo?this.repositionSingle():this.repositionDouble(),this.setHighLight(this.getPageIndex()));this.oldMode=this.currentMedo},initStyle:function(){this.background.css({height:this.height+"px",bottom:"0px"});$(this.background).css({background:bookConfig.thumbnailColor});$(this.background).css({opacity:bookConfig.thumbnailAlpha/100});this.contentBox.css({height:this.contentHeight+"px",width:this.contentWidth+"px",left:(this.width-
this.contentWidth)/2+"px"});this.contentBox.css({top:"40px",bottom:"40px",overflow:"hidden"});this.scrollBox.css({width:this.contentWidth-20+"px"});$(this.scrollBox).css({left:(this.contentBox.width()-this.scrollBox.width())/2+"px",top:"10px"})},getPageIndex:function(){return this.pageIndex},setPageIndex:function(b){this.pageIndex=b},onResize:function(){this.contentHeight=windowHeight-80;this.background.css({width:windowWidth+"px",height:windowHeight+"px"});this.contentBox.css({height:this.contentHeight+
"px"});this.contentBox.css({left:(windowWidth-this.contentWidth)/2+"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")},addItem:function(){for(var b=0;b<=originTotalPageCount;){var c=0==b?new thumbnailItem(this.scrollBox,1):new thumbnailItem(this.scrollBox,b),d=this.thumbArray.length%2*(c.getWidth()+10),e=parseInt(Math.floor(this.thumbArray.length/2))*(c.getHeight()+5);c.setPosition(d,e);this.thumbArray.push(c);
b+=2}b=parseInt(Math.floor(this.thumbArray.length/2));0!=this.thumbArray.length%2&&(b+=1);$(this.scrollBox).css({height:b*(c.getHeight()+5)+10+"px"})},resetItemPosition:function(){for(var b=0,c=0,d=0;d<this.thumbArray.length;d++){var e=this.thumbArray[d];0==d?(b=rightToLeft?this.contentWidth-20-e.getWidth():0,c=0):(b=rightToLeft?(2-d%2-1)*(e.getWidth()+10):d%2*(e.getWidth()+10),c=parseInt(Math.floor(d/2))*(e.getHeight()+5));e.setPosition(b,c)}b=parseInt(Math.floor(this.thumbArray.length/2));0!=this.thumbArray.length%
2&&(b+=1);$(this.scrollBox).css({height:b*(e.getHeight()+5)+10+"px"})},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},showshow:function(){$(this.background).show();(function(){$(this.contentBox).show()}).delay(this,10);this.showing=
!0;void 0!=leftRightButton&&null!=leftRightButton&&leftRightButton.setShow(!1);this.fillNearByImages()},hideBox:function(){$(this.background).fadeOut(500);$(this.contentBox).fadeOut(500);this.showing=!1;hideLeftRightButton()&&leftRightButton.setShow(!0)},showOrHide:function(){!0===this.showing?this.hideBox():this.showshow()},setHighLight:function(b){},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 e=function(b,c){for(var d=c/2,e=(b-b/4)/d,f=Array(c),g=0;g<c;g++)f[g]=g<d?b-(d-g)*e:b+(g-d+1)*e;return f.reverse()}(c,d),f=b,g=0,h=this,k=window.setInterval(function(){f+=e[g];g++;g==d&&(f=b+c*d);0<f&&(f=0);f<$(h.contentBox).height()-$(h.scrollBox).height()&&(f=$(h.contentBox).height()-$(h.scrollBox).height());$(h.scrollBox).css({top:f+10+"px"});g>=d&&(window.clearInterval(k),h.fillNearByImages(f))},30)},fillNearByImages:function(b){if(this.createThumbItemFalg&&this.showing){this.scrollBox.outerWidth();
this.scrollBox.outerHeight();this.contentBox.outerWidth();var c=this.contentBox.outerHeight();b=Math.abs(getPoint(this.scrollBox).y);b=Math.max(0,b);var d=(Math.min(windowWidth,windowHeight)-20)/2*bookConfig.largePageHeight/(2*bookConfig.largePageWidth)+15;b=parseInt(2*Math.ceil(b/(d+10)));c=2*Math.ceil(c/d);for(d=b;d<b+c&&!(0>d||d>=this.thumbArray.length);d++)this.thumbArray[d]&&this.thumbArray[d].addImage()}},initScrollEvent:function(){var b=function(){this.fillNearByImages()}.bind(this);ScrollFunction(this.contentBox,
this.scrollBox,this,b)}});thumbnailItem=Class({create:function(b,c){this.background=$("<div></div>");this.itemB=new thumbnailCell(this.background);this.itemA=new thumbnailCell(this.background);this.width=(Math.min(windowWidth,windowHeight)-20)/2;this.height=this.width*bookConfig.largePageHeight/(2*bookConfig.largePageWidth)+15;this.isMerge=this.isDoublePage=!0;this.pageIndex=c;this.fillImage=!1;this.mainColor="";var d=c+1;this.textField=new label(rightToLeft?d+"-"+c:c+"-"+d,this.background);this.textField.setLabelPosition((this.width-
this.textField.getWidth())/2,0,["left","bottom"]);this.textField.setFont("5px","#f0f0f0",null);$(this.background).css({"text-shadow":"0 0 10px #8c97cb, 0 0 20px #8c97cb,0 0 30px #8c97cb, 0 0 40px #8c97cb,0 0 50px #8c97cb, 0 0 60px #8c97cb"});$(b).append(this.background);$(this.background).css({position:"absolute",width:this.width+"px",height:this.height+"px"});$(this.background).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)"});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()):(1==c?this.itemA.setPosition(rightToLeft?0:this.width/2,0):this.itemA.setPosition(rightToLeft?this.width/2:0,0),this.itemB.showCell(!1),this.textField.setCSS({display:"none"}),this.setBorder(!1));this.itemA.onMouseUp()},getWidth:function(){return this.width},getHeight:function(){return this.height},
addImage:function(){this.fillImage||(this.itemA.fillImage(this.pageIndex),1!=this.pageIndex&&this.pageIndex!=totalPageCount&&this.itemB.fillImage(this.pageIndex+1),this.fillImage=!0)},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.itemA.setImgPosition("c"):(this.setBorder(!1),this.itemA.setImgPosition("c"),this.itemB.setImgPosition("c"),this.showTextField(!1),this.isMerge=!1,this.onResize(this.width,this.height))},merge:function(){1==this.pageIndex?this.itemA.setImgPosition("l"):this.pageIndex==totalPageCount?this.itemA.setImgPosition("r"):(this.setBorder(!1),this.itemA.setImgPosition("r"),this.itemB.setImgPosition("l"),this.showTextField(!0),this.isMerge=!0,this.onResize(this.width,this.height))},showBorder:function(){$(this.background).css({border:"1px solid #444444"})},
hideBorder:function(){$(this.background)[0].style.border=""},showTextField:function(b){var c=b?"none":"block";this.textField.setCSS({display:b?"block":"none"});this.itemA.getTextField().setCSS({display:c});this.itemB.getTextField().setCSS({display:c})},setBorder:function(b){b?$(this.background).css({border:"1px solid #444444"}):$(this.background)[0].style.border="";this.itemA.hideBorder();this.itemB.hideBorder()},highLight:function(b){this.isMerge?1==b||b==totalPageCount?(this.itemA.highLight("#ffffff"),
this.itemA.onMouseOverUp()):($(this.background).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(){if(!isTouch){var b=this;$(this.background).css({border:""});$(this.background).bind(_event._enter,function(c){b.background.css({border:"2px solid #0080ff"})});$(this.background).bind(_event._leave,function(c){b.background.css({border:""})})}},
onMouseOverUp:function(){if(!isTouch){var b=this;$(this.background).bind(_event._enter,function(c){b.background.css({border:"2px solid #0080ff"})});$(this.background).bind(_event._leave,function(c){b.background.css({border:"2px solid #ff8040"})})}},clearMouseOver:function(){var b=this;$(this.background).bind(_event._enter,function(c){b.background.css({border:""})});$(this.background).bind(_event._leave,function(c){b.background.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()}});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.toolBG=$("<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.btnPre=$("<div title='Previous Page' id='btnPre' class='phonebutton' ></div>");
this.btnNext=$("<div title='Next Page' id='btnNext' 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.mainColor=bookConfig.toolbarColor;this.logo=$("<img src='"+bookConfig.appLogoIcon+"' style='cursor:pointer;position:absolute;'/>");b.append(this.topBG);b.append(this.toolBG);
this.topBG.append(this.logo);this.topBG.append(this.btnThumb);this.topBG.append(this.btnMore);this.toolBG.append(this.btnPre);this.toolBG.append(this.btnNext);this.toolBG.append(this.btnGotoPage);isPhoneBook()||this.toolBG.append(this.btnZoom);this.toolBG.append(this.btnAutoPlay);this.initToolBar();thumbButtonEnable?thumbnail=isCatalogBook()?new CatalogThumbnailBar(tmpContainer):new thumbnailBar(tmpContainer):this.btnThumb.hide();userConfig.autoPlayButtonVisible||this.btnAutoPlay.hide();global.phoneGotoPagePanel=
new phoneGotoPage(tmpContainer);this.initEvent();this.visible=!1;this.initFoldingMenu()},initToolBar:function(){this.btnMore.addCssSprite(phoneIconsURL[0],"more",25,25,phoneIconInfo);this.btnThumb.addCssSprite(phoneIconsURL[0],"thumb",25,25,phoneIconInfo);this.btnPre.addCssSprite(phoneIconsURL[0],"prev",25,25,phoneIconInfo);this.btnNext.addCssSprite(phoneIconsURL[0],"next",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.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.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.toolBG).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.toolBG.css({width:this.barWidth+"px",height:this.barHeight+"px"});this.topBG.css({width:this.barWidth+"px",height:this.barHeight+"px",color:"#ffffff","line-height":this.barHeight+"px"});var b=colorDiv(this.mainColor,30),c=colorAdd(this.mainColor,30);this.topBG.css("background",this.mainColor);this.toolBG.css("background",this.mainColor);this.topBG.css("border-bottom","1px solid "+b);this.toolBG.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])})},initFoldingMenu:function(){searchButtonEnable||bookmarkButtonEnable||shareButtonEnable||userConfig.downloadButtonVisible||userConfig.printButtonVisible||this.btnMore.hide();var b=function(){""!=userConfig.downloadURL&&window.open(userConfig.downloadURL,"_blank")};global.foldingMenu=new FoldingMenu($("#tmpContainer"));searchButtonEnable&&foldingMenu.addMenuItem("miSearch",getLanguage("btnSearch","Search"),"miSearch");bookmarkButtonEnable&&foldingMenu.addMenuItem("miBookmark",
getLanguage("btnBookMark","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")));bookmarkButtonEnable&&(global.phoneBookmark=new phoneTableContent({caption:getLanguage("frmBookMark",
"Table of Content"),closeIconURL:uiBaseURL+"close.png",mainColor:bookConfig.bookmarkBackground,fontColor:bookConfig.bookmarkFontColor},foldingMenu.getItemBody("miBookmark")));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.toolBG.css({width:windowWidth+"px"});this.topBG.css({width:windowWidth+"px"});isPhoneBook()?this.buttonArray=[this.btnPre,this.btnNext,this.btnGotoPage]:this.buttonArray=[this.btnPre,this.btnNext,this.btnGotoPage,this.btnZoom];userConfig.autoPlayButtonVisible&&this.buttonArray.push(this.btnAutoPlay);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.buttonArray,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({"max-width":windowWidth-130+"px","max-height":"40px"});this.btnPre.css({top:this.buttonTop+"px"});this.btnNext.css({top:this.buttonTop+"px"});this.btnZoom.css({top:this.buttonTop+
"px"});userConfig.autoPlayButtonVisible&&this.btnAutoPlay.css({top:this.buttonTop+"px"})},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=!0;this.toolBG.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 40},getBottomHeight:function(){return 40},getLogoHeight:function(){return this.topBG.height()},
hide:function(){this.visible=!1;this.toolBG.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){},initEvent:function(){var b=this;this.btnMore.bind(_event._end,function(){global.foldingMenu&&foldingMenu.showOrHide(foldingMenu.width);return!1});this.btnThumb.bind(_event._end,function(){thumbnail.showOrHide();return!1});this.btnNext.bind(_event._end,function(){rightToLeft?previousPageFun():nextPageFun();return!1});this.btnPre.bind(_event._end,function(){rightToLeft?nextPageFun():
previousPageFun();return!1});this.btnZoom.bind(_event._end,function(){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});this.btnAutoPlay.bind(_event._end,function(){auto_player.isPlaying()?auto_player.stop():auto_player.start();b.changeAutoPlayIcon();return!1});this.btnGotoPage.bind(_event._end,function(){global.phoneGotoPagePanel.showOrHide()})},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"));bookmarkButtonEnable&&foldingMenu.getItemById("miBookmark").setCaption(getLanguage("btnBookMark","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,e){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(e,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,e){void 0==e&&(e=["right","bottom"]);b.moreBar.css(e[0],c+"px");b.moreBar.css(e[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),$(singlePageBook).data().gotoPage(zoomBook.currentIndex)):(bookType=0,changeShowBook(0),setCurrentIndexTextField(flipBook.currentPageIndex,!0),flipBook.gotoPage(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(){if(void 0!=
userConfig.homeURL&&""!=userConfig.homeURL){var b=userConfig.homeURL;"http"!=b.substr(0,4)&&(b="http://"+b);window.open(b,"_tab")}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(){var b=$("body")[0];fullScreenApi.supportsFullScreen?fullScreenApi.isFullScreen()?fullScreenApi.cancelFullScreen():fullScreenApi.requestFullScreen(b):b.webkitSupportsFullscreen&&b.webkitEnterFullscreen(Element.ALLOW_KEYBOARD_INPUT);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 isShareShow=!1,initShareBar=function(){shareBar=$("<div class='shareBar' style='display:none;opacity:0;'>");bookContainer.append(shareBar);shareBar.css("z-index",2002);shareBar.css("bottom","38px");shareBar.css("right","300px");shareBar.css({background:bookConfig.formColor,"-webkit-box-shadow":"0 0 10px rgba(40, 40, 40, 0.5)","-moz-box-shadow":"0 0 10px rgba(40, 40, 40, 0.5)","-o-box-shadow":"0 0 10px rgba(40, 40, 40, 0.5)","-ms-box-shadow":"0 0 10px rgba(40, 40, 40, 0.5)","box-shadow":"0 0 10px rgba(40, 40, 40, 0.5)",
"-moz-border-radius":"5px","-webkit-border-radius":"5px","border-radius":"5px"});shareBar.addBorderShadow(bookConfig.formColor,3,3);var b=window.location.href,c=window.document.title,d=window.location.pathname,d=d.substring(0,d.lastIndexOf("/"))+"/"+bookConfig.thumbPath+"1.jpg",e="?&url="+b+"&title="+c+"&description="+bookDescription+"&screenshot="+d,b=initShareButton("email",e),c=initShareButton("facebook",e),d=initShareButton("google",e),f=initShareButton("mySpace",e),g=initShareButton("twitter",
e),h=initShareButton("digg",e),e=initShareButton("more",e);shareBar.append(b);shareButtonTop=function(b){return 8+35*b};b.css({top:shareButtonTop(0)+"px",left:"10px"});shareBar.append(c);c.css({top:shareButtonTop(1)+"px",left:"10px"});shareBar.append(d);d.css({top:shareButtonTop(2)+"px",left:"10px"});shareBar.append(f);f.css({top:shareButtonTop(3)+"px",left:"10px"});shareBar.append(g);g.css({top:shareButtonTop(4)+"px",left:"10px"});shareBar.append(h);h.css({top:shareButtonTop(5)+"px",left:"10px"});
shareBar.append(e);e.css({top:shareButtonTop(6)+"px",left:"10px"});shareBar.css({height:shareButtonTop(7)+"px"});shareBar.show=!1;$.fn.extend(shareBar,{showShareBar:function(){shareBar.css("display","block");shareBar.show=!0;shareBar.animate({opacity:0.9},200,"linear")},hideShareBar:function(){shareBar.show=!1;shareBar.animate({opacity:0},200,"linear",function(){shareBar.css("display","none")})},setSharePosition:function(b,c,d){void 0==d&&(d=["right","bottom"]);shareBar.css(d[0],b+"px");shareBar.css(d[1],
c+"px")},getShowStatus:function(){return shareBar.show}})},initShareButton=function(b,c){var d=$("<div style = 'position: absolute;width:135px;height:33px;color:white;font-family:arial;font-size:12px'></div>"),e,f;switch(b){case "email":f="http://api.addthis.com/oexchange/0.8/forward/email/offer"+c;e=$("<div class='shareButton' ><img src='"+uiBaseURL+"email.png' class='shareImg' />Email</div>");break;case "facebook":f="http://api.addthis.com/oexchange/0.8/forward/facebook/offer"+c;e=$("<div class='shareButton'><img src='"+
uiBaseURL+"facebook.png' class='shareImg' />Facebook</div>");break;case "google":f="http://api.addthis.com/oexchange/0.8/forward/igoogle/offer"+c;e=$("<div class='shareButton'><img src='"+uiBaseURL+"google.png' class='shareImg' />Google+</div>");break;case "mySpace":f="http://api.addthis.com/oexchange/0.8/forward/myspace/offer"+c;e=$("<div class='shareButton'><img src='"+uiBaseURL+"myspace.png' class='shareImg' />MySpace</div>");break;case "netvibes":f="http://api.addthis.com/oexchange/0.8/forward/netvibes/offer"+
c;e=$("<div class='shareButton'><img src='"+uiBaseURL+"netvibes.png' class='shareImg' />netvibes</div>");break;case "twitter":f="http://api.addthis.com/oexchange/0.8/forward/twitter/offer"+c;e=$("<div class='shareButton'><img src='"+uiBaseURL+"twitter.png' class='shareImg' />Twitter</div>");break;case "digg":f="http://api.addthis.com/oexchange/0.8/forward/digg/offer"+c;e=$("<div class='shareButton'><img src='"+uiBaseURL+"digg.png' class='shareImg' />Digg</div>");break;case "more":f="http://api.addthis.com/oexchange/0.8/offer"+
c,e=$("<div class='shareButton'><img src='"+uiBaseURL+"more.png' class='shareImg' />More</div>")}e.css({cursor:"pointer"});e.bind(_event._down,function(b){sendvisitinfo(2,getShownPageString());window.open(f,"_blank")});d.append(e);d.mousedown(function(b){d.css("background-color","#0000f0")});d.mouseup(function(b){d.css("background-color","transparent");shareBar.hideShareBar()});return d},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,e=0,f=getLogoLink();c.load(function(){if(isNaN(bookConfig.logoHeight)||""==bookConfig.logoHeight||null==bookConfig.logoHeight||void 0==bookConfig.logoHeight)try{d=b.getLogoHeight()}catch(f){d=toolBar.getLogoHeight()}else d=bookConfig.logoHeight;
var g=c.width()*d/c.height();c.css({width:g+"px",height:d+"px"});try{e=(b.getLogoHeight()-d)/2}catch(l){e=0}logoBar.css({position:"absolute"});logoBar.append(c)});c.attr({src:bookConfig.appLogoIcon});c.css({position:"absolute"})}var g=0,g=isNaN(bookConfig.logoPadding)||""==bookConfig.logoPadding||null==bookConfig.logoPadding||void 0==bookConfig.logoPadding?0:bookConfig.logoPadding,e=0,e=isNaN(bookConfig.logoTop)||""==bookConfig.logoTop||null==bookConfig.logoTop||void 0==bookConfig.logoTop?0:bookConfig.logoTop;
logoBar.css({left:g+"px"});logoBar.css({top:e+"px"});logoBar.bind(_event._down,function(){window.open(f[0],f[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 e=$("<div></div>"),f=language[d].language;$(e).css({width:"80px",height:"35px",position:"absolute"});$(e).css({left:"60px",top:45*d+10+"px"});$(e).html(f);e.attr("language",f);b.push(e);$(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 e=$("<div/>");e.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($(e));c.append($(d));$(e).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.ite