Version="1.0.4";
(function(a,b){function c(a){return h.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}function d(a){if(!ka[a]){var b=v.body,c=h("<"+a+">").appendTo(b),d=c.css("display");c.remove();if("none"===d||""===d){K||(K=v.createElement("iframe"),K.frameBorder=K.width=K.height=0);b.appendChild(K);if(!aa||!K.createElement)aa=(K.contentWindow||K.contentDocument).document,aa.write((h.support.boxModel?"<!doctype html>":"")+"<html><body>"),aa.close();c=aa.createElement(a);aa.body.appendChild(c);d=h.css(c,
"display");b.removeChild(K)}ka[a]=d}return ka[a]}function e(a,b){var c={};h.each(fa.concat.apply([],fa.slice(0,b)),function(){c[this]=a});return c}function f(){ga=b}function j(){setTimeout(f,0);return ga=h.now()}function g(){try{return new a.XMLHttpRequest}catch(b){}}function k(a,b,c,d){if(h.isArray(b))h.each(b,function(b,F){c||Ya.test(a)?d(a,F):k(a+"["+("object"==typeof F?b:"")+"]",F,c,d)});else if(!c&&"object"===h.type(b))for(var e in b)k(a+"["+e+"]",b[e],c,d);else d(a,b)}function l(a,c){var d,
e,g=h.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&h.extend(!0,a,e)}function n(a,c,d,e,h,g){h=h||c.dataTypes[0];g=g||{};g[h]=!0;for(var h=a[h],f=0,j=h?h.length:0,p=a===la,k;f<j&&(p||!k);f++)k=h[f](c,d,e),"string"==typeof k&&(!p||g[k]?k=b:(c.dataTypes.unshift(k),k=n(a,c,d,e,k,g)));(p||!k)&&!g["*"]&&(k=n(a,c,d,e,"*",g));return k}function m(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");if(h.isFunction(c))for(var d=b.toLowerCase().split(ya),e=0,g=d.length,
f,j;e<g;e++)f=d[e],(j=/^\+/.test(f))&&(f=f.substr(1)||"*"),f=a[f]=a[f]||[],f[j?"unshift":"push"](c)}}function o(a,b,c){var d="width"===b?a.offsetWidth:a.offsetHeight,e="width"===b?1:0;if(0<d){if("border"!==c)for(;4>e;e+=2)c||(d-=parseFloat(h.css(a,"padding"+W[e]))||0),"margin"===c?d+=parseFloat(h.css(a,c+W[e]))||0:d-=parseFloat(h.css(a,"border"+W[e]+"Width"))||0;return d+"px"}d=ba(a,b);if(0>d||null==d)d=a.style[b];if(ma.test(d))return d;d=parseFloat(d)||0;if(c)for(;4>e;e+=2)d+=parseFloat(h.css(a,
"padding"+W[e]))||0,"padding"!==c&&(d+=parseFloat(h.css(a,"border"+W[e]+"Width"))||0),"margin"===c&&(d+=parseFloat(h.css(a,c+W[e]))||0);return d+"px"}function z(a){var b=(a.nodeName||"").toLowerCase();"input"===b?q(a):"script"!==b&&"undefined"!=typeof a.getElementsByTagName&&h.grep(a.getElementsByTagName("input"),q)}function q(a){if("checkbox"===a.type||"radio"===a.type)a.defaultChecked=a.checked}function B(a){return"undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName("*"):"undefined"!=
typeof a.querySelectorAll?a.querySelectorAll("*"):[]}function A(a,b){var c;1===b.nodeType&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),"object"===c?b.outerHTML=a.outerHTML:"input"!==c||"checkbox"!==a.type&&"radio"!==a.type?"option"===c?b.selected=a.defaultSelected:"input"===c||"textarea"===c?b.defaultValue=a.defaultValue:"script"===c&&b.text!==a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&
(b.value=a.value)),b.removeAttribute(h.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function I(a,b){if(1===b.nodeType&&h.hasData(a)){var c,d,e;d=h._data(a);var g=h._data(b,d),f=d.events;if(f)for(c in delete g.handle,g.events={},f){d=0;for(e=f[c].length;d<e;d++)h.event.add(b,c,f[c][d])}g.data&&(g.data=h.extend({},g.data))}}function w(a){var b=za.split("|"),a=a.createDocumentFragment();if(a.createElement)for(;b.length;)a.createElement(b.pop());return a}function s(a,
b,c){b=b||0;if(h.isFunction(b))return h.grep(a,function(a,d){return!!b.call(a,d,a)===c});if(b.nodeType)return h.grep(a,function(a){return a===b===c});if("string"==typeof b){var d=h.grep(a,function(a){return 1===a.nodeType});if(Za.test(b))return h.filter(b,d,!c);b=h.filter(b,d)}return h.grep(a,function(a){return 0<=h.inArray(a,b)===c})}function u(){return!0}function t(){return!1}function L(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",f=h._data(a,d);f&&("queue"===c||!h._data(a,e))&&("mark"===c||!h._data(a,
g))&&setTimeout(function(){!h._data(a,e)&&!h._data(a,g)&&(h.removeData(a,d,!0),f.fire())},0)}function N(a){for(var b in a)if(!("data"===b&&h.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function M(a,c,d){if(d===b&&1===a.nodeType)if(d="data-"+c.replace(X,"-$1").toLowerCase(),d=a.getAttribute(d),"string"==typeof d){try{d="true"===d?!0:"false"===d?!1:"null"===d?null:h.isNumeric(d)?+d:P.test(d)?h.parseJSON(d):d}catch(e){}h.data(a,c,d)}else d=b;return d}function T(a){var b=Q[a]={},c,d,a=a.split(/\s+/);
c=0;for(d=a.length;c<d;c++)b[a[c]]=!0;return b}var v=a.document,R=a.navigator,E=a.location,h=function(){function c(){if(!d.isReady){try{v.documentElement.doScroll("left")}catch(a){setTimeout(c,1);return}d.ready()}}var d=function(a,b){return new d.fn.init(a,b,g)},e=a.jQuery,h=a.$,g,f=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,p=/^\s+/,k=/\s+$/,l=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,m=/^[\],:{}\s]*$/,n=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,o=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
q=/(?:^|:|,)(?:\s*\[)+/g,C=/(webkit)[ \/]([\w.]+)/,D=/(opera)(?:.*version)?[ \/]([\w.]+)/,z=/(msie) ([\w.]+)/,s=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z]|[0-9])/ig,u=/^-ms-/,A=function(a,b){return(b+"").toUpperCase()},t=R.userAgent,ha,ca,$a=Object.prototype.toString,oa=Object.prototype.hasOwnProperty,pa=Array.prototype.push,ea=Array.prototype.slice,Aa=String.prototype.trim,Ba=Array.prototype.indexOf,B={};d.fn=d.prototype={constructor:d,init:function(a,c,r){var e,h;if(!a)return this;if(a.nodeType)return this.context=
this[0]=a,this.length=1,this;if("body"===a&&!c&&v.body)return this.context=v,this[0]=v.body,this.selector=a,this.length=1,this;if("string"==typeof a){"<"!==a.charAt(0)||">"!==a.charAt(a.length-1)||3>a.length?e=f.exec(a):e=[null,a,null];if(e&&(e[1]||!c)){if(e[1])return h=(c=c instanceof d?c[0]:c)?c.ownerDocument||c:v,(r=l.exec(a))?d.isPlainObject(c)?(a=[v.createElement(r[1])],d.fn.attr.call(a,c,!0)):a=[h.createElement(r[1])]:(r=d.buildFragment([e[1]],[h]),a=(r.cacheable?d.clone(r.fragment):r.fragment).childNodes),
d.merge(this,a);if((c=v.getElementById(e[2]))&&c.parentNode){if(c.id!==e[2])return r.find(a);this.length=1;this[0]=c}this.context=v;this.selector=a;return this}return!c||c.jquery?(c||r).find(a):this.constructor(c).find(a)}if(d.isFunction(a))return r.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return d.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return ea.call(this,0)},get:function(a){return null==a?this.toArray():
0>a?this[this.length+a]:this[a]},pushStack:function(a,b,c){var r=this.constructor();d.isArray(a)?pa.apply(r,a):d.merge(r,a);r.prevObject=this;r.context=this.context;"find"===b?r.selector=this.selector+(this.selector?" ":"")+c:b&&(r.selector=this.selector+"."+b+"("+c+")");return r},each:function(a,b){return d.each(this,a,b)},ready:function(a){d.bindReady();ha.add(a);return this},eq:function(a){a=+a;return-1===a?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},
slice:function(){return this.pushStack(ea.apply(this,arguments),"slice",ea.call(arguments).join(","))},map:function(a){return this.pushStack(d.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:pa,sort:[].sort,splice:[].splice};d.fn.init.prototype=d.fn;d.extend=d.fn.extend=function(){var a,c,r,e,h,g,f=arguments[0]||{},j=1,H=arguments.length,G=!1;"boolean"==typeof f&&(G=f,f=arguments[1]||{},j=2);"object"!=typeof f&&!d.isFunction(f)&&
(f={});for(H===j&&(f=this,--j);j<H;j++)if(null!=(a=arguments[j]))for(c in a)r=f[c],e=a[c],f!==e&&(G&&e&&(d.isPlainObject(e)||(h=d.isArray(e)))?(h?(h=!1,g=r&&d.isArray(r)?r:[]):g=r&&d.isPlainObject(r)?r:{},f[c]=d.extend(G,g,e)):e!==b&&(f[c]=e));return f};d.extend({noConflict:function(b){a.$===d&&(a.$=h);b&&a.jQuery===d&&(a.jQuery=e);return d},isReady:!1,readyWait:1,holdReady:function(a){a?d.readyWait++:d.ready(!0)},ready:function(a){if(!0===a&&!--d.readyWait||!0!==a&&!d.isReady){if(!v.body)return setTimeout(d.ready,
1);d.isReady=!0;!0!==a&&0<--d.readyWait||(ha.fireWith(v,[d]),d.fn.trigger&&d(v).trigger("ready").off("ready"))}},bindReady:function(){if(!ha){ha=d.Callbacks("once memory");if("complete"===v.readyState)return setTimeout(d.ready,1);if(v.addEventListener)v.addEventListener("DOMContentLoaded",ca,!1),a.addEventListener("load",d.ready,!1);else if(v.attachEvent){v.attachEvent("onreadystatechange",ca);a.attachEvent("onload",d.ready);var b=!1;try{b=null==a.frameElement}catch(e){}v.documentElement.doScroll&&
b&&c()}}},isFunction:function(a){return"function"===d.type(a)},isArray:Array.isArray||function(a){return"array"===d.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return null==a?""+a:B[$a.call(a)]||"object"},isPlainObject:function(a){if(!a||"object"!==d.type(a)||a.nodeType||d.isWindow(a))return!1;try{if(a.constructor&&!oa.call(a,"constructor")&&!oa.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}for(var r in a);
return r===b||oa.call(a,r)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw Error(a);},parseJSON:function(b){if("string"!=typeof b||!b)return null;b=d.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(m.test(b.replace(n,"@").replace(o,"]").replace(q,"")))return(new Function("return "+b))();d.error("Invalid JSON: "+b)},parseXML:function(c){if("string"!=typeof c||!c)return null;var r,e;try{a.DOMParser?(e=new DOMParser,r=e.parseFromString(c,"text/xml")):(r=
new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(c))}catch(h){r=b}(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&d.error("Invalid XML: "+c);return r},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(u,"ms-").replace(w,A)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,r){var e,h=0,f=a.length,g=f===b||d.isFunction(a);
if(r)if(g)for(e in a){if(!1===c.apply(a[e],r))break}else for(;h<f&&!1!==c.apply(a[h++],r););else if(g)for(e in a){if(!1===c.call(a[e],e,a[e]))break}else for(;h<f&&!1!==c.call(a[h],h,a[h++]););return a},trim:Aa?function(a){return null==a?"":Aa.call(a)}:function(a){return null==a?"":(a+"").replace(p,"").replace(k,"")},makeArray:function(a,b){var c=b||[];if(null!=a){var r=d.type(a);null==a.length||"string"===r||"function"===r||"regexp"===r||d.isWindow(a)?pa.call(c,a):d.merge(c,a)}return c},inArray:function(a,
b,c){var d;if(b){if(Ba)return Ba.call(b,a,c);d=b.length;for(c=c?0>c?Math.max(0,d+c):c:0;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,r=0;if("number"==typeof c.length)for(var e=c.length;r<e;r++)a[d++]=c[r];else for(;c[r]!==b;)a[d++]=c[r++];a.length=d;return a},grep:function(a,b,c){for(var d=[],r,c=!!c,e=0,h=a.length;e<h;e++)r=!!b(a[e],e),c!==r&&d.push(a[e]);return d},map:function(a,c,r){var e,h,f=[],g=0,j=a.length;if(a instanceof d||j!==b&&"number"==typeof j&&(0<
j&&a[0]&&a[j-1]||0===j||d.isArray(a)))for(;g<j;g++)e=c(a[g],g,r),null!=e&&(f[f.length]=e);else for(h in a)e=c(a[h],h,r),null!=e&&(f[f.length]=e);return f.concat.apply([],f)},guid:1,proxy:function(a,c){if("string"==typeof c)var r=a[c],c=a,a=r;if(!d.isFunction(a))return b;var e=ea.call(arguments,2),r=function(){return a.apply(c,e.concat(ea.call(arguments)))};r.guid=a.guid=a.guid||r.guid||d.guid++;return r},access:function(a,c,r,e,h,f,g){var j,H=null==r,G=0,p=a.length;if(r&&"object"==typeof r){for(G in r)d.access(a,
c,G,r[G],1,f,e);h=1}else if(e!==b){j=g===b&&d.isFunction(e);H&&(j?(j=c,c=function(a,b,c){return j.call(d(a),c)}):(c.call(a,e),c=null));if(c)for(;G<p;G++)c(a[G],r,j?e.call(a[G],G,c(a[G],r)):e,g);h=1}return h?a:H?c.call(a):p?c(a[0],r):f},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();a=C.exec(a)||D.exec(a)||z.exec(a)||0>a.indexOf("compatible")&&s.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}d.extend(!0,
a,this);a.superclass=this;a.fn=a.prototype=this();a.fn.constructor=a;a.sub=this.sub;a.fn.init=function(c,r){r&&r instanceof d&&!(r instanceof a)&&(r=a(r));return d.fn.init.call(this,c,r,b)};a.fn.init.prototype=a.fn;var b=a(v);return a},browser:{}});d.each("Boolean,Number,String,Function,Array,Date,RegExp,Object".split(","),function(a,b){B["[object "+b+"]"]=b.toLowerCase()});t=d.uaMatch(t);t.browser&&(d.browser[t.browser]=!0,d.browser.version=t.version);d.browser.webkit&&(d.browser.safari=!0);j.test("\u00a0")&&
(p=/^[\s\xA0]+/,k=/[\s\xA0]+$/);g=d(v);v.addEventListener?ca=function(){v.removeEventListener("DOMContentLoaded",ca,!1);d.ready()}:v.attachEvent&&(ca=function(){"complete"===v.readyState&&(v.detachEvent("onreadystatechange",ca),d.ready())});return d}(),Q={};h.Callbacks=function(a){var a=a?Q[a]||T(a):{},c=[],d=[],e,f,g,j,p,k,l=function(b){var d,e,f,g;d=0;for(e=b.length;d<e;d++)f=b[d],g=h.type(f),"array"===g?l(f):"function"===g&&(!a.unique||!n.has(f))&&c.push(f)},m=function(b,h){h=h||[];e=!a.memory||
[b,h];g=f=!0;k=j||0;j=0;for(p=c.length;c&&k<p;k++)if(!1===c[k].apply(b,h)&&a.stopOnFalse){e=!0;break}g=!1;c&&(a.once?!0===e?n.disable():c=[]:d&&d.length&&(e=d.shift(),n.fireWith(e[0],e[1])))},n={add:function(){if(c){var a=c.length;l(arguments);g?p=c.length:e&&!0!==e&&(j=a,m(e[0],e[1]))}return this},remove:function(){if(c)for(var b=arguments,d=0,e=b.length;d<e;d++)for(var h=0;h<c.length&&!(b[d]===c[h]&&(g&&h<=p&&(p--,h<=k&&k--),c.splice(h--,1),a.unique));h++);return this},has:function(a){if(c)for(var b=
0,d=c.length;b<d;b++)if(a===c[b])return!0;return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b;(!e||!0===e)&&n.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(g?a.once||d.push([b,c]):(!a.once||!e)&&m(b,c));return this},fire:function(){n.fireWith(this,arguments);return this},fired:function(){return!!f}};return n};var O=[].slice;h.extend({Deferred:function(a){var b=h.Callbacks("once memory"),
c=h.Callbacks("once memory"),d=h.Callbacks("memory"),e="pending",f={resolve:b,reject:c,notify:d},g={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){j.done(a).fail(b).progress(c);return this},always:function(){j.done.apply(j,arguments).fail.apply(j,arguments);return this},pipe:function(a,b,c){return h.Deferred(function(d){h.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],r=b[1],e;h.isFunction(c)?
j[a](function(){(e=c.apply(this,arguments))&&h.isFunction(e.promise)?e.promise().then(d.resolve,d.reject,d.notify):d[r+"With"](this===j?d:this,[e])}):j[a](d[r])})}).promise()},promise:function(a){if(null==a)a=g;else for(var b in g)a[b]=g[b];return a}},j=g.promise({}),p;for(p in f)j[p]=f[p].fire,j[p+"With"]=f[p].fireWith;j.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock);a&&a.call(j,j);return j},when:function(a){function b(a){return function(b){g[a]=1<
arguments.length?O.call(arguments,0):b;p.notifyWith(k,g)}}function c(a){return function(b){d[a]=1<arguments.length?O.call(arguments,0):b;--j||p.resolveWith(p,d)}}var d=O.call(arguments,0),e=0,f=d.length,g=Array(f),j=f,p=1>=f&&a&&h.isFunction(a.promise)?a:h.Deferred(),k=p.promise();if(1<f){for(;e<f;e++)d[e]&&d[e].promise&&h.isFunction(d[e].promise)?d[e].promise().then(c(e),p.reject,b(e)):--j;j||p.resolveWith(p,d)}else p!==a&&p.resolveWith(p,f?[a]:[]);return k}});h.support=function(){var b,c,d,e,f,
g,j,p,k=v.createElement("div");k.setAttribute("className","t");k.innerHTML="   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";c=k.getElementsByTagName("*");d=k.getElementsByTagName("a")[0];if(!c||!c.length||!d)return{};e=v.createElement("select");f=e.appendChild(v.createElement("option"));c=k.getElementsByTagName("input")[0];b={leadingWhitespace:3===k.firstChild.nodeType,tbody:!k.getElementsByTagName("tbody").length,htmlSerialize:!!k.getElementsByTagName("link").length,
style:/top/.test(d.getAttribute("style")),hrefNormalized:"/a"===d.getAttribute("href"),opacity:/^0.55/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:"on"===c.value,optSelected:f.selected,getSetAttribute:"t"!==k.className,enctype:!!v.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==v.createElement("nav").cloneNode(!0).outerHTML,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,
pixelMargin:!0};h.boxModel=b.boxModel="CSS1Compat"===v.compatMode;c.checked=!0;b.noCloneChecked=c.cloneNode(!0).checked;e.disabled=!0;b.optDisabled=!f.disabled;try{delete k.test}catch(l){b.deleteExpando=!1}!k.addEventListener&&k.attachEvent&&k.fireEvent&&(k.attachEvent("onclick",function(){b.noCloneEvent=!1}),k.cloneNode(!0).fireEvent("onclick"));c=v.createElement("input");c.value="t";c.setAttribute("type","radio");b.radioValue="t"===c.value;c.setAttribute("checked","checked");c.setAttribute("name",
"t");k.appendChild(c);d=v.createDocumentFragment();d.appendChild(k.lastChild);b.checkClone=d.cloneNode(!0).cloneNode(!0).lastChild.checked;b.appendChecked=c.checked;d.removeChild(c);d.appendChild(k);if(k.attachEvent)for(j in{submit:1,change:1,focusin:1})c="on"+j,(p=c in k)||(k.setAttribute(c,"return;"),p="function"==typeof k[c]),b[j+"Bubbles"]=p;d.removeChild(k);d=e=f=k=c=null;h(function(){var c,d,e,f,F,j,H=v.getElementsByTagName("body")[0];!H||(c=v.createElement("div"),c.style.cssText="padding:0;margin:0;border:0;visibility:hidden;width:0;height:0;position:static;top:0;margin-top:1px",
H.insertBefore(c,H.firstChild),k=v.createElement("div"),c.appendChild(k),k.innerHTML="<table><tr><td style='padding:0;margin:0;border:0;display:none'></td><td>t</td></tr></table>",g=k.getElementsByTagName("td"),p=0===g[0].offsetHeight,g[0].style.display="",g[1].style.display="none",b.reliableHiddenOffsets=p&&0===g[0].offsetHeight,a.getComputedStyle&&(k.innerHTML="",j=v.createElement("div"),j.style.width="0",j.style.marginRight="0",k.style.width="2px",k.appendChild(j),b.reliableMarginRight=0===(parseInt((a.getComputedStyle(j,
null)||{marginRight:0}).marginRight,10)||0)),"undefined"!=typeof k.style.zoom&&(k.innerHTML="",k.style.width=k.style.padding="1px",k.style.border=0,k.style.overflow="hidden",k.style.display="inline",k.style.zoom=1,b.inlineBlockNeedsLayout=3===k.offsetWidth,k.style.display="block",k.style.overflow="visible",k.innerHTML="<div style='width:5px;'></div>",b.shrinkWrapBlocks=3!==k.offsetWidth),k.style.cssText="position:absolute;top:0;left:0;width:1px;height:1px;padding:0;margin:0;border:0;visibility:hidden;",
k.innerHTML="<div style='position:absolute;top:0;left:0;width:1px;height:1px;padding:0;margin:0;border:5px solid #000;display:block;'><div style='padding:0;margin:0;border:0;display:block;overflow:hidden;'></div></div><table style='position:absolute;top:0;left:0;width:1px;height:1px;padding:0;margin:0;border:5px solid #000;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>",d=k.firstChild,e=d.firstChild,f=d.nextSibling.firstChild.firstChild,F={doesNotAddBorder:5!==e.offsetTop,doesAddBorderForTableAndCells:5===
f.offsetTop},e.style.position="fixed",e.style.top="20px",F.fixedPosition=20===e.offsetTop||15===e.offsetTop,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",F.subtractsBorderForOverflowNotVisible=-5===e.offsetTop,F.doesNotIncludeMarginInBodyOffset=1!==H.offsetTop,a.getComputedStyle&&(k.style.marginTop="1%",b.pixelMargin="1%"!==(a.getComputedStyle(k,null)||{marginTop:0}).marginTop),"undefined"!=typeof c.style.zoom&&(c.style.zoom=1),H.removeChild(c),k=null,h.extend(b,
F))});return b}();var P=/^(?:\{.*\}|\[.*\])$/,X=/([A-Z])/g;h.extend({cache:{},uuid:0,expando:"jQuery"+(h.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?h.cache[a[h.expando]]:a[h.expando];return!!a&&!N(a)},data:function(a,c,d,e){if(h.acceptData(a)){var f,g;f=h.expando;var j="string"==typeof c,p=a.nodeType,k=p?h.cache:a,l=p?a[f]:a[f]&&f,m="events"===c;if(l&&k[l]&&(m||e||k[l].data)||!(j&&d===
b)){l||(p?a[f]=l=++h.uuid:l=f);k[l]||(k[l]={},p||(k[l].toJSON=h.noop));if("object"==typeof c||"function"==typeof c)e?k[l]=h.extend(k[l],c):k[l].data=h.extend(k[l].data,c);a=f=k[l];e||(f.data||(f.data={}),f=f.data);d!==b&&(f[h.camelCase(c)]=d);if(m&&!f[c])return a.events;j?(g=f[c],null==g&&(g=f[h.camelCase(c)])):g=f;return g}}},removeData:function(a,b,c){if(h.acceptData(a)){var d,e,f,g=h.expando,j=a.nodeType,p=j?h.cache:a,k=j?a[g]:g;if(p[k]){if(b&&(d=c?p[k]:p[k].data)){h.isArray(b)||(b in d?b=[b]:
(b=h.camelCase(b),b in d?b=[b]:b=b.split(" ")));e=0;for(f=b.length;e<f;e++)delete d[b[e]];if(!(c?N:h.isEmptyObject)(d))return}if(!c&&(delete p[k].data,!N(p[k])))return;h.support.deleteExpando||!p.setInterval?delete p[k]:p[k]=null;j&&(h.support.deleteExpando?delete a[g]:a.removeAttribute?a.removeAttribute(g):a[g]=null)}}},_data:function(a,b,c){return h.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=h.noData[a.nodeName.toLowerCase()];if(b)return!0!==b&&a.getAttribute("classid")===b}return!0}});
h.fn.extend({data:function(a,c){var d,e,f,g,j,p=this[0],k=0,l=null;if(a===b){if(this.length&&(l=h.data(p),1===p.nodeType&&!h._data(p,"parsedAttrs"))){f=p.attributes;for(j=f.length;k<j;k++)g=f[k].name,0===g.indexOf("data-")&&(g=h.camelCase(g.substring(5)),M(p,g,l[g]));h._data(p,"parsedAttrs",!0)}return l}if("object"==typeof a)return this.each(function(){h.data(this,a)});d=a.split(".",2);d[1]=d[1]?"."+d[1]:"";e=d[1]+"!";return h.access(this,function(c){if(c===b)return l=this.triggerHandler("getData"+
e,[d[0]]),l===b&&p&&(l=h.data(p,a),l=M(p,a,l)),l===b&&d[1]?this.data(d[0]):l;d[1]=c;this.each(function(){var b=h(this);b.triggerHandler("setData"+e,d);h.data(this,a,c);b.triggerHandler("changeData"+e,d)})},null,c,1<arguments.length,null,!1)},removeData:function(a){return this.each(function(){h.removeData(this,a)})}});h.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",h._data(a,b,(h._data(a,b)||0)+1))},_unmark:function(a,b,c){!0!==a&&(c=b,b=a,a=!1);if(b){var c=c||"fx",d=c+"mark";(a=a?0:(h._data(b,
d)||1)-1)?h._data(b,d,a):(h.removeData(b,d,!0),L(b,c,"mark"))}},queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=h._data(a,b),c&&(!d||h.isArray(c)?d=h._data(a,b,h.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){var b=b||"fx",c=h.queue(a,b),d=c.shift(),e={};"inprogress"===d&&(d=c.shift());d&&("fx"===b&&c.unshift("inprogress"),h._data(a,b+".run",e),d.call(a,function(){h.dequeue(a,b)},e));c.length||(h.removeData(a,b+"queue "+b+".run",!0),L(a,b,"queue"))}});h.fn.extend({queue:function(a,
c){var d=2;"string"!=typeof a&&(c=a,a="fx",d--);return arguments.length<d?h.queue(this[0],a):c===b?this:this.each(function(){var b=h.queue(this,a,c);"fx"===a&&"inprogress"!==b[0]&&h.dequeue(this,a)})},dequeue:function(a){return this.each(function(){h.dequeue(this,a)})},delay:function(a,b){a=h.fx?h.fx.speeds[a]||a:a;return this.queue(b||"fx",function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function d(){--j||
e.resolveWith(f,[f])}"string"!=typeof a&&(c=a,a=b);for(var a=a||"fx",e=h.Deferred(),f=this,g=f.length,j=1,p=a+"defer",k=a+"queue",l=a+"mark",m;g--;)if(m=h.data(f[g],p,b,!0)||(h.data(f[g],k,b,!0)||h.data(f[g],l,b,!0))&&h.data(f[g],p,h.Callbacks("once memory"),!0))j++,m.add(d);d();return e.promise(c)}});var C=/[\n\t\r]/g,p=/\s+/,D=/\r/g,qa=/^(?:button|input)$/i,ab=/^(?:button|input|object|select|textarea)$/i,bb=/^a(?:rea)?$/i,Ca=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
Da=h.support.getSetAttribute,S,Ea,Fa;h.fn.extend({attr:function(a,b){return h.access(this,h.attr,a,b,1<arguments.length)},removeAttr:function(a){return this.each(function(){h.removeAttr(this,a)})},prop:function(a,b){return h.access(this,h.prop,a,b,1<arguments.length)},removeProp:function(a){a=h.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,j;if(h.isFunction(a))return this.each(function(b){h(this).addClass(a.call(this,b,this.className))});
if(a&&"string"==typeof a){b=a.split(p);c=0;for(d=this.length;c<d;c++)if(e=this[c],1===e.nodeType)if(!e.className&&1===b.length)e.className=a;else{f=" "+e.className+" ";g=0;for(j=b.length;g<j;g++)~f.indexOf(" "+b[g]+" ")||(f+=b[g]+" ");e.className=h.trim(f)}}return this},removeClass:function(a){var c,d,e,f,g,j,k;if(h.isFunction(a))return this.each(function(b){h(this).removeClass(a.call(this,b,this.className))});if(a&&"string"==typeof a||a===b){c=(a||"").split(p);d=0;for(e=this.length;d<e;d++)if(f=
this[d],1===f.nodeType&&f.className)if(a){g=(" "+f.className+" ").replace(C," ");j=0;for(k=c.length;j<k;j++)g=g.replace(" "+c[j]+" "," ");f.className=h.trim(g)}else f.className=""}return this},toggleClass:function(a,b){var c=typeof a,d="boolean"==typeof b;return h.isFunction(a)?this.each(function(c){h(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if("string"===c)for(var e,f=0,g=h(this),j=b,k=a.split(p);e=k[f++];)j=d?j:!g.hasClass(e),g[j?"addClass":"removeClass"](e);else if("undefined"===
c||"boolean"===c)this.className&&h._data(this,"__className__",this.className),this.className=this.className||!1===a?"":h._data(this,"__className__")||""})},hasClass:function(a){for(var a=" "+a+" ",b=0,c=this.length;b<c;b++)if(1===this[b].nodeType&&-1<(" "+this[b].className+" ").replace(C," ").indexOf(a))return!0;return!1},val:function(a){var c,d,e,f=this[0];if(arguments.length)return e=h.isFunction(a),this.each(function(d){var f=h(this),g;if(1===this.nodeType&&(e?g=a.call(this,d,f.val()):g=a,null==
g?g="":"number"==typeof g?g+="":h.isArray(g)&&(g=h.map(g,function(a){return a==null?"":a+""})),c=h.valHooks[this.type]||h.valHooks[this.nodeName.toLowerCase()],!c||!("set"in c)||c.set(this,g,"value")===b))this.value=g});if(f){if((c=h.valHooks[f.type]||h.valHooks[f.nodeName.toLowerCase()])&&"get"in c&&(d=c.get(f,"value"))!==b)return d;d=f.value;return"string"==typeof d?d.replace(D,""):null==d?"":d}}});h.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:
a.text}},select:{get:function(a){var b,c,d=a.selectedIndex,e=[],f=a.options,g="select-one"===a.type;if(0>d)return null;a=g?d:0;for(c=g?d+1:f.length;a<c;a++)if(b=f[a],b.selected&&(h.support.optDisabled?!b.disabled:null===b.getAttribute("disabled"))&&(!b.parentNode.disabled||!h.nodeName(b.parentNode,"optgroup"))){b=h(b).val();if(g)return b;e.push(b)}return g&&!e.length&&f.length?h(f[d]).val():e},set:function(a,b){var c=h.makeArray(b);h(a).find("option").each(function(){this.selected=0<=h.inArray(h(this).val(),
c)});c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var f,g,j=a.nodeType;if(a&&3!==j&&8!==j&&2!==j){if(e&&c in h.attrFn)return h(a)[c](d);if("undefined"==typeof a.getAttribute)return h.prop(a,c,d);(e=1!==j||!h.isXMLDoc(a))&&(c=c.toLowerCase(),g=h.attrHooks[c]||(Ca.test(c)?Ea:S));if(d!==b){if(null===d){h.removeAttr(a,c);return}if(g&&"set"in g&&e&&(f=g.set(a,d,c))!==b)return f;a.setAttribute(c,""+d);return d}if(g&&
"get"in g&&e&&null!==(f=g.get(a,c)))return f;f=a.getAttribute(c);return null===f?b:f}},removeAttr:function(a,b){var c,d,e,f,g,j=0;if(b&&1===a.nodeType){d=b.toLowerCase().split(p);for(f=d.length;j<f;j++)(e=d[j])&&(c=h.propFix[e]||e,g=Ca.test(e),g||h.attr(a,e,""),a.removeAttribute(Da?e:c),g&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(qa.test(a.nodeName)&&a.parentNode)h.error("type property can't be changed");else if(!h.support.radioValue&&"radio"===b&&h.nodeName(a,"input")){var c=a.value;
a.setAttribute("type",b);c&&(a.value=c);return b}}},value:{get:function(a,b){return S&&h.nodeName(a,"button")?S.get(a,b):b in a?a.value:null},set:function(a,b,c){if(S&&h.nodeName(a,"button"))return S.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,
c,d){var e,f,g;g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return(g=1!==g||!h.isXMLDoc(a))&&(c=h.propFix[c]||c,f=h.propHooks[c]),d!==b?f&&"set"in f&&(e=f.set(a,d,c))!==b?e:a[c]=d:f&&"get"in f&&null!==(e=f.get(a,c))?e:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):ab.test(a.nodeName)||bb.test(a.nodeName)&&a.href?0:b}}}});h.attrHooks.tabindex=h.propHooks.tabIndex;Ea={get:function(a,c){var d,e=h.prop(a,c);return!0===e||"boolean"!=
typeof e&&(d=a.getAttributeNode(c))&&!1!==d.nodeValue?c.toLowerCase():b},set:function(a,b,c){var d;!1===b?h.removeAttr(a,c):(d=h.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}};Da||(Fa={name:!0,id:!0,coords:!0},S=h.valHooks.button={get:function(a,c){var d;return(d=a.getAttributeNode(c))&&(Fa[c]?""!==d.nodeValue:d.specified)?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);d||(d=v.createAttribute(c),a.setAttributeNode(d));return d.nodeValue=b+""}},h.attrHooks.tabindex.set=
S.set,h.each(["width","height"],function(a,b){h.attrHooks[b]=h.extend(h.attrHooks[b],{set:function(a,c){if(""===c)return a.setAttribute(b,"auto"),c}})}),h.attrHooks.contenteditable={get:S.get,set:function(a,b,c){""===b&&(b="false");S.set(a,b,c)}});h.support.hrefNormalized||h.each(["href","src","width","height"],function(a,c){h.attrHooks[c]=h.extend(h.attrHooks[c],{get:function(a){a=a.getAttribute(c,2);return null===a?b:a}})});h.support.style||(h.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||
b},set:function(a,b){return a.style.cssText=""+b}});h.support.optSelected||(h.propHooks.selected=h.extend(h.propHooks.selected,{get:function(a){a=a.parentNode;a&&(a.selectedIndex,a.parentNode&&a.parentNode.selectedIndex);return null}}));h.support.enctype||(h.propFix.enctype="encoding");h.support.checkOn||h.each(["radio","checkbox"],function(){h.valHooks[this]={get:function(a){return null===a.getAttribute("value")?"on":a.value}}});h.each(["radio","checkbox"],function(){h.valHooks[this]=h.extend(h.valHooks[this],
{set:function(a,b){if(h.isArray(b))return a.checked=0<=h.inArray(h(a).val(),b)}})});var ra=/^(?:textarea|input|select)$/i,Ga=/^([^\.]*)?(?:\.(.+))?$/,cb=/(?:^|\s)hover(\.\S+)?\b/,db=/^key/,eb=/^(?:mouse|contextmenu)|click/,Ha=/^(?:focusinfocus|focusoutblur)$/,fb=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,gb=function(a){(a=fb.exec(a))&&(a[1]=(a[1]||"").toLowerCase(),a[3]=a[3]&&RegExp("(?:^|\\s)"+a[3]+"(?:\\s|$)"));return a},Ia=function(a){return h.event.special.hover?a:a.replace(cb,"mouseenter$1 mouseleave$1")};
h.event={add:function(a,c,d,e,f){var g,j,p,k,l,m,n,o,q;if(!(3===a.nodeType||8===a.nodeType||!c||!d||!(g=h._data(a)))){d.handler&&(n=d,d=n.handler,f=n.selector);d.guid||(d.guid=h.guid++);(p=g.events)||(g.events=p={});(j=g.handle)||(g.handle=j=function(a){return"undefined"!=typeof h&&(!a||h.event.triggered!==a.type)?h.event.dispatch.apply(j.elem,arguments):b},j.elem=a);c=h.trim(Ia(c)).split(" ");for(g=0;g<c.length;g++){k=Ga.exec(c[g])||[];l=k[1];m=(k[2]||"").split(".").sort();q=h.event.special[l]||
{};l=(f?q.delegateType:q.bindType)||l;q=h.event.special[l]||{};k=h.extend({type:l,origType:k[1],data:e,handler:d,guid:d.guid,selector:f,quick:f&&gb(f),namespace:m.join(".")},n);o=p[l];if(!o&&(o=p[l]=[],o.delegateCount=0,!q.setup||!1===q.setup.call(a,e,m,j)))a.addEventListener?a.addEventListener(l,j,!1):a.attachEvent&&a.attachEvent("on"+l,j);q.add&&(q.add.call(a,k),k.handler.guid||(k.handler.guid=d.guid));f?o.splice(o.delegateCount++,0,k):o.push(k);h.event.global[l]=!0}a=null}},global:{},remove:function(a,
b,c,d,e){var f=h.hasData(a)&&h._data(a),g,j,p,k,l,m,n,o,q,C,D;if(f&&(n=f.events)){b=h.trim(Ia(b||"")).split(" ");for(g=0;g<b.length;g++)if(j=Ga.exec(b[g])||[],p=k=j[1],j=j[2],p){o=h.event.special[p]||{};p=(d?o.delegateType:o.bindType)||p;C=n[p]||[];l=C.length;j=j?RegExp("(^|\\.)"+j.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(m=0;m<C.length;m++)D=C[m],(e||k===D.origType)&&(!c||c.guid===D.guid)&&(!j||j.test(D.namespace))&&(!d||d===D.selector||"**"===d&&D.selector)&&(C.splice(m--,1),
D.selector&&C.delegateCount--,o.remove&&o.remove.call(a,D));0===C.length&&l!==C.length&&((!o.teardown||!1===o.teardown.call(a,j))&&h.removeEvent(a,p,f.handle),delete n[p])}else for(p in n)h.event.remove(a,p+b[g],c,d,!0);h.isEmptyObject(n)&&(q=f.handle,q&&(q.elem=null),h.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,f){if(!e||3!==e.nodeType&&8!==e.nodeType){var g=c.type||c,j=[],p,k,l,m,n,o;if(!Ha.test(g+h.event.triggered)&&(0<=g.indexOf("!")&&
(g=g.slice(0,-1),p=!0),0<=g.indexOf(".")&&(j=g.split("."),g=j.shift(),j.sort()),e&&!h.event.customEvent[g]||h.event.global[g]))if(c="object"==typeof c?c[h.expando]?c:new h.Event(g,c):new h.Event(g),c.type=g,c.isTrigger=!0,c.exclusive=p,c.namespace=j.join("."),c.namespace_re=c.namespace?RegExp("(^|\\.)"+j.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,p=0>g.indexOf(":")?"on"+g:"",e){if(c.result=b,c.target||(c.target=e),d=null!=d?h.makeArray(d):[],d.unshift(c),m=h.event.special[g]||{},!(m.trigger&&!1===m.trigger.apply(e,
d))){o=[[e,m.bindType||g]];if(!f&&!m.noBubble&&!h.isWindow(e)){k=m.delegateType||g;j=Ha.test(k+g)?e:e.parentNode;for(l=null;j;j=j.parentNode)o.push([j,k]),l=j;l&&l===e.ownerDocument&&o.push([l.defaultView||l.parentWindow||a,k])}for(k=0;k<o.length&&!c.isPropagationStopped();k++)j=o[k][0],c.type=o[k][1],(n=(h._data(j,"events")||{})[c.type]&&h._data(j,"handle"))&&n.apply(j,d),(n=p&&j[p])&&h.acceptData(j)&&!1===n.apply(j,d)&&c.preventDefault();c.type=g;!f&&!c.isDefaultPrevented()&&(!m._default||!1===
m._default.apply(e.ownerDocument,d))&&("click"!==g||!h.nodeName(e,"a"))&&h.acceptData(e)&&p&&e[g]&&("focus"!==g&&"blur"!==g||0!==c.target.offsetWidth)&&!h.isWindow(e)&&(l=e[p],l&&(e[p]=null),h.event.triggered=g,e[g](),h.event.triggered=b,l&&(e[p]=l));return c.result}}else for(k in e=h.cache,e)e[k].events&&e[k].events[g]&&h.event.trigger(c,d,e[k].handle.elem,!0)}},dispatch:function(c){var c=h.event.fix(c||a.event),d=(h._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,
0),f=!c.exclusive&&!c.namespace,j=h.event.special[c.type]||{},p=[],k,l,m,n,o,q,C;g[0]=c;c.delegateTarget=this;if(!j.preDispatch||!1!==j.preDispatch.call(this,c)){if(e&&(!c.button||"click"!==c.type)){m=h(this);m.context=this.ownerDocument||this;for(l=c.target;l!=this;l=l.parentNode||this)if(!0!==l.disabled){o={};q=[];m[0]=l;for(k=0;k<e;k++){n=d[k];C=n.selector;if(o[C]===b){var D=o,z=C,s;if(n.quick){s=n.quick;var v=l.attributes||{};s=(!s[1]||l.nodeName.toLowerCase()===s[1])&&(!s[2]||(v.id||{}).value===
s[2])&&(!s[3]||s[3].test((v["class"]||{}).value))}else s=m.is(C);D[z]=s}o[C]&&q.push(n)}q.length&&p.push({elem:l,matches:q})}}d.length>e&&p.push({elem:this,matches:d.slice(e)});for(k=0;k<p.length&&!c.isPropagationStopped();k++){e=p[k];c.currentTarget=e.elem;for(d=0;d<e.matches.length&&!c.isImmediatePropagationStopped();d++)if(n=e.matches[d],f||!c.namespace&&!n.namespace||c.namespace_re&&c.namespace_re.test(n.namespace))c.data=n.data,c.handleObj=n,n=((h.event.special[n.origType]||{}).handle||n.handler).apply(e.elem,
g),n!==b&&(c.result=n,!1===n&&(c.preventDefault(),c.stopPropagation()))}j.postDispatch&&j.postDispatch.call(this,c);return c.result}},props:"attrChange,attrName,relatedNode,srcElement,altKey,bubbles,cancelable,ctrlKey,currentTarget,eventPhase,metaKey,relatedTarget,shiftKey,target,timeStamp,view,which".split(","),fixHooks:{},keyHooks:{props:["char","charCode","key","keyCode"],filter:function(a,b){null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button,buttons,clientX,clientY,fromElement,offsetX,offsetY,pageX,pageY,screenX,screenY,toElement".split(","),
filter:function(a,c){var d,e,g,f=c.button,h=c.fromElement;null==a.pageX&&null!=c.clientX&&(d=a.target.ownerDocument||v,e=d.documentElement,g=d.body,a.pageX=c.clientX+(e&&e.scrollLeft||g&&g.scrollLeft||0)-(e&&e.clientLeft||g&&g.clientLeft||0),a.pageY=c.clientY+(e&&e.scrollTop||g&&g.scrollTop||0)-(e&&e.clientTop||g&&g.clientTop||0));!a.relatedTarget&&h&&(a.relatedTarget=h===a.target?c.toElement:h);!a.which&&f!==b&&(a.which=f&1?1:f&2?3:f&4?2:0);return a}},fix:function(a){if(a[h.expando])return a;var c,
d,e=a,g=h.event.fixHooks[a.type]||{},f=g.props?this.props.concat(g.props):this.props,a=h.Event(e);for(c=f.length;c;)d=f[--c],a[d]=e[d];a.target||(a.target=e.srcElement||v);3===a.target.nodeType&&(a.target=a.target.parentNode);a.metaKey===b&&(a.metaKey=a.ctrlKey);return g.filter?g.filter(a,e):a},special:{ready:{setup:h.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){h.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,
b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){a=h.extend(new h.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?h.event.trigger(a,null,b):h.event.dispatch.call(b,a);a.isDefaultPrevented()&&c.preventDefault()}};h.event.handle=h.event.dispatch;h.removeEvent=v.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)};h.Event=function(a,b){if(!(this instanceof h.Event))return new h.Event(a,
b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||!1===a.returnValue||a.getPreventDefault&&a.getPreventDefault()?u:t):this.type=a;b&&h.extend(this,b);this.timeStamp=a&&a.timeStamp||h.now();this[h.expando]=!0};h.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=u;var a=this.originalEvent;!a||(a.stopPropagation&&
a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:t,isPropagationStopped:t,isImmediatePropagationStopped:t};h.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){h.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=a.relatedTarget,d=a.handleObj,e;if(!c||c!==this&&!h.contains(this,c))a.type=d.origType,e=d.handler.apply(this,arguments),a.type=b;return e}}});h.support.submitBubbles||
(h.event.special.submit={setup:function(){if(h.nodeName(this,"form"))return!1;h.event.add(this,"click._submit keypress._submit",function(a){a=a.target;(a=h.nodeName(a,"input")||h.nodeName(a,"button")?a.form:b)&&!a._submit_attached&&(h.event.add(a,"submit._submit",function(a){a._submit_bubble=!0}),a._submit_attached=!0)})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&h.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(h.nodeName(this,
"form"))return!1;h.event.remove(this,"._submit")}});h.support.changeBubbles||(h.event.special.change={setup:function(){if(ra.test(this.nodeName)){if("checkbox"===this.type||"radio"===this.type)h.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),h.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,h.event.simulate("change",this,a,!0))});return!1}h.event.add(this,"beforeactivate._change",
function(a){a=a.target;ra.test(a.nodeName)&&!a._change_attached&&(h.event.add(a,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&h.event.simulate("change",this.parentNode,a,!0)}),a._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type)return a.handleObj.handler.apply(this,arguments)},teardown:function(){h.event.remove(this,"._change");return ra.test(this.nodeName)}});h.support.focusinBubbles||
h.each({focus:"focusin",blur:"focusout"},function(a,b){var c=0,d=function(a){h.event.simulate(b,a.target,h.event.fix(a),!0)};h.event.special[b]={setup:function(){0===c++&&v.addEventListener(a,d,!0)},teardown:function(){0===--c&&v.removeEventListener(a,d,!0)}}});h.fn.extend({on:function(a,c,d,e,g){var f,j;if("object"==typeof a){"string"!=typeof c&&(d=d||c,c=b);for(j in a)this.on(j,c,d,a[j],g);return this}null==d&&null==e?(e=c,d=c=b):null==e&&("string"==typeof c?(e=d,d=b):(e=d,d=c,c=b));if(!1===e)e=
t;else if(!e)return this;1===g&&(f=e,e=function(a){h().off(a);return f.apply(this,arguments)},e.guid=f.guid||(f.guid=h.guid++));return this.each(function(){h.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;h(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler);return this}if("object"==typeof a){for(e in a)this.off(e,c,a[e]);return this}if(!1===c||"function"==
typeof c)d=c,c=b;!1===d&&(d=t);return this.each(function(){h.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){h(this.context).on(a,this.selector,b,c);return this},die:function(a,b){h(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1==arguments.length?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){h.event.trigger(a,
b,this)})},triggerHandler:function(a,b){if(this[0])return h.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||h.guid++,d=0,e=function(c){var e=(h._data(this,"lastToggle"+a.guid)||0)%d;h._data(this,"lastToggle"+a.guid,e+1);c.preventDefault();return b[e].apply(this,arguments)||!1};for(e.guid=c;d<b.length;)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});h.each("blur,focus,focusin,focusout,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error,contextmenu".split(","),
function(a,b){h.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)};h.attrFn&&(h.attrFn[b]=true);db.test(b)&&(h.event.fixHooks[b]=h.event.keyHooks);eb.test(b)&&(h.event.fixHooks[b]=h.event.mouseHooks)});(function(){function a(b,c,d,g,f,h){for(var f=0,j=g.length;f<j;f++){var r=g[f];if(r){for(var p=!1,r=r[b];r;){if(r[e]===d){p=g[r.sizset];break}if(1===r.nodeType)if(h||(r[e]=d,r.sizset=f),"string"!=typeof c){if(r===c){p=!0;break}}else if(0<n.filter(c,
[r]).length){p=r;break}r=r[b]}g[f]=p}}}function c(a,b,d,g,f,h){for(var f=0,j=g.length;f<j;f++){var r=g[f];if(r){for(var p=!1,r=r[a];r;){if(r[e]===d){p=g[r.sizset];break}1===r.nodeType&&!h&&(r[e]=d,r.sizset=f);if(r.nodeName.toLowerCase()===b){p=r;break}r=r[a]}g[f]=p}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e="sizcache"+(Math.random()+"").replace(".",""),g=0,f=Object.prototype.toString,j=!1,p=!0,k=/\\/g,
l=/\r\n/g,m=/\W/;[0,0].sort(function(){p=!1;return 0});var n=function(a,b,c,e){var c=c||[],g=b=b||v;if(1!==b.nodeType&&9!==b.nodeType)return[];if(!a||"string"!=typeof a)return c;var h,j,r,p,k,F,l=!0,G=n.isXML(b),m=[],o=a;do if(d.exec(""),h=d.exec(o))if(o=h[3],m.push(h[1]),h[2]){p=h[3];break}while(h);if(1<m.length&&C.exec(a))if(2===m.length&&q.relative[m[0]])j=A(m[0]+m[1],b,e);else for(j=q.relative[m[0]]?[b]:n(m.shift(),b);m.length;)a=m.shift(),q.relative[a]&&(a+=m.shift()),j=A(a,j,e);else if(!e&&
1<m.length&&9===b.nodeType&&!G&&q.match.ID.test(m[0])&&!q.match.ID.test(m[m.length-1])&&(k=n.find(m.shift(),b,G),b=k.expr?n.filter(k.expr,k.set)[0]:k.set[0]),b){k=e?{expr:m.pop(),set:z(e)}:n.find(m.pop(),1===m.length&&("~"===m[0]||"+"===m[0])&&b.parentNode?b.parentNode:b,G);j=k.expr?n.filter(k.expr,k.set):k.set;for(0<m.length?r=z(j):l=!1;m.length;)h=F=m.pop(),q.relative[F]?h=m.pop():F="",null==h&&(h=b),q.relative[F](r,h,G)}else r=[];r||(r=j);r||n.error(F||a);if("[object Array]"===f.call(r))if(l)if(b&&
1===b.nodeType)for(a=0;null!=r[a];a++)r[a]&&(!0===r[a]||1===r[a].nodeType&&n.contains(b,r[a]))&&c.push(j[a]);else for(a=0;null!=r[a];a++)r[a]&&1===r[a].nodeType&&c.push(j[a]);else c.push.apply(c,r);else z(r,c);p&&(n(p,g,c,e),n.uniqueSort(c));return c};n.uniqueSort=function(a){if(u&&(j=p,a.sort(u),j))for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1);return a};n.matches=function(a,b){return n(a,null,null,b)};n.matchesSelector=function(a,b){return 0<n(b,null,null,[a]).length};n.find=function(a,
b,c){var d,e,g,f,h,j;if(!a)return[];e=0;for(g=q.order.length;e<g;e++)if(h=q.order[e],f=q.leftMatch[h].exec(a))if(j=f[1],f.splice(1,1),"\\"!==j.substr(j.length-1)&&(f[1]=(f[1]||"").replace(k,""),d=q.find[h](f,b,c),null!=d)){a=a.replace(q.match[h],"");break}d||(d="undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName("*"):[]);return{set:d,expr:a}};n.filter=function(a,c,d,e){for(var g,f,h,j,r,p,k,F,l=a,G=[],H=c,m=c&&c[0]&&n.isXML(c[0]);a&&c.length;){for(h in q.filter)if(null!=(g=q.leftMatch[h].exec(a))&&
g[2])if(p=q.filter[h],r=g[1],f=!1,g.splice(1,1),"\\"!==r.substr(r.length-1)){H===G&&(G=[]);if(q.preFilter[h])if(g=q.preFilter[h](g,H,d,G,e,m)){if(!0===g)continue}else f=j=!0;if(g)for(k=0;null!=(r=H[k]);k++)r&&(j=p(r,g,k,H),F=e^j,d&&null!=j?F?f=!0:H[k]=!1:F&&(G.push(r),f=!0));if(j!==b){d||(H=G);a=a.replace(q.match[h],"");if(!f)return[];break}}if(a===l)if(null==f)n.error(a);else break;l=a}return H};n.error=function(a){throw Error("Syntax error, unrecognized expression: "+a);};var o=n.getText=function(a){var b,
c;b=a.nodeType;var d="";if(b)if(1===b||9===b||11===b){if("string"==typeof a.textContent)return a.textContent;if("string"==typeof a.innerText)return a.innerText.replace(l,"");for(a=a.firstChild;a;a=a.nextSibling)d+=o(a)}else{if(3===b||4===b)return a.nodeValue}else for(b=0;c=a[b];b++)8!==c.nodeType&&(d+=o(c));return d},q=n.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},
type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c="string"==typeof b,d=c&&!m.test(b),c=c&&!d;d&&(b=b.toLowerCase());for(var d=0,e=a.length,g;d<e;d++)if(g=a[d]){for(;(g=g.previousSibling)&&1!==g.nodeType;);a[d]=c||g&&g.nodeName.toLowerCase()===b?g||!1:g===b}c&&n.filter(b,a,!0)},">":function(a,b){var c,d="string"==typeof b,e=0,g=a.length;if(d&&!m.test(b))for(b=b.toLowerCase();e<g;e++){if(c=a[e])c=c.parentNode,a[e]=c.nodeName.toLowerCase()===b?c:!1}else{for(;e<g;e++)(c=
a[e])&&(a[e]=d?c.parentNode:c.parentNode===b);d&&n.filter(b,a,!0)}},"":function(b,d,e){var f,h=g++,j=a;"string"==typeof d&&!m.test(d)&&(d=d.toLowerCase(),f=d,j=c);j("parentNode",d,h,b,f,e)},"~":function(b,d,e){var f,h=g++,j=a;"string"==typeof d&&!m.test(d)&&(d=d.toLowerCase(),f=d,j=c);j("previousSibling",d,h,b,f,e)}},find:{ID:function(a,b,c){if("undefined"!=typeof b.getElementById&&!c)return(a=b.getElementById(a[1]))&&a.parentNode?[a]:[]},NAME:function(a,b){if("undefined"!=typeof b.getElementsByName){for(var c=
[],d=b.getElementsByName(a[1]),e=0,g=d.length;e<g;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return 0===c.length?null:c}},TAG:function(a,b){if("undefined"!=typeof b.getElementsByTagName)return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,g){a=" "+a[1].replace(k,"")+" ";if(g)return a;for(var g=0,f;null!=(f=b[g]);g++)f&&(e^(f.className&&0<=(" "+f.className+" ").replace(/[\t\n\r]/g," ").indexOf(a))?c||d.push(f):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(k,
"")},TAG:function(a){return a[1].replace(k,"").toLowerCase()},CHILD:function(a){if("nth"===a[1]){a[2]||n.error(a[0]);a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec("even"===a[2]&&"2n"||"odd"===a[2]&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0;a[3]=b[3]-0}else a[2]&&n.error(a[0]);a[0]=g++;return a},ATTR:function(a,b,c,d,e,g){b=a[1]=a[1].replace(k,"");!g&&q.attrMap[b]&&(a[1]=q.attrMap[b]);a[4]=(a[4]||a[5]||"").replace(k,"");"~="===a[2]&&(a[4]=" "+a[4]+
" ");return a},PSEUDO:function(a,b,c,e,g){if("not"===a[1])if(1<(d.exec(a[3])||"").length||/^\w/.test(a[3]))a[3]=n(a[3],null,null,b);else return a=n.filter(a[3],b,c,1^g),c||e.push.apply(e,a),!1;else if(q.match.POS.test(a[0])||q.match.CHILD.test(a[0]))return!0;return a},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return!1===a.disabled&&"hidden"!==a.type},disabled:function(a){return!0===a.disabled},checked:function(a){return!0===a.checked},selected:function(a){a.parentNode&&
a.parentNode.selectedIndex;return!0===a.selected},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!n(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return"input"===a.nodeName.toLowerCase()&&"text"===c&&(b===c||null===b)},radio:function(a){return"input"===a.nodeName.toLowerCase()&&"radio"===a.type},checkbox:function(a){return"input"===a.nodeName.toLowerCase()&&"checkbox"===
a.type},file:function(a){return"input"===a.nodeName.toLowerCase()&&"file"===a.type},password:function(a){return"input"===a.nodeName.toLowerCase()&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return("input"===b||"button"===b)&&"submit"===a.type},image:function(a){return"input"===a.nodeName.toLowerCase()&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return("input"===b||"button"===b)&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();
return"input"===b&&"button"===a.type||"button"===b},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return 0===b},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return 0===b%2},odd:function(a,b){return 1===b%2},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,
b,c,d){var e=b[1],g=q.filters[e];if(g)return g(a,c,b,d);if("contains"===e)return 0<=(a.textContent||a.innerText||o([a])||"").indexOf(b[3]);if("not"===e){b=b[3];c=0;for(d=b.length;c<d;c++)if(b[c]===a)return!1;return!0}n.error(e)},CHILD:function(a,b){var c,d,g,f,h,j;c=b[1];j=a;switch(c){case "only":case "first":for(;j=j.previousSibling;)if(1===j.nodeType)return!1;if("first"===c)return!0;j=a;case "last":for(;j=j.nextSibling;)if(1===j.nodeType)return!1;return!0;case "nth":c=b[2];d=b[3];if(1===c&&0===
d)return!0;g=b[0];if((f=a.parentNode)&&(f[e]!==g||!a.nodeIndex)){h=0;for(j=f.firstChild;j;j=j.nextSibling)1===j.nodeType&&(j.nodeIndex=++h);f[e]=g}j=a.nodeIndex-d;return 0===c?0===j:0===j%c&&0<=j/c}},ID:function(a,b){return 1===a.nodeType&&a.getAttribute("id")===b},TAG:function(a,b){return"*"===b&&1===a.nodeType||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return-1<(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)},ATTR:function(a,b){var c=b[1],c=n.attr?n.attr(a,c):q.attrHandle[c]?
q.attrHandle[c](a):null!=a[c]?a[c]:a.getAttribute(c),d=c+"",e=b[2],g=b[4];return null==c?"!="===e:!e&&n.attr?null!=c:"="===e?d===g:"*="===e?0<=d.indexOf(g):"~="===e?0<=(" "+d+" ").indexOf(g):g?"!="===e?d!==g:"^="===e?0===d.indexOf(g):"$="===e?d.substr(d.length-g.length)===g:"|="===e?d===g||d.substr(0,g.length+1)===g+"-":!1:d&&!1!==c},POS:function(a,b,c,d){var e=q.setFilters[b[2]];if(e)return e(a,c,b,d)}}},C=q.match.POS,D=function(a,b){return"\\"+(b-0+1)},s;for(s in q.match)q.match[s]=RegExp(q.match[s].source+
/(?![^\[]*\])(?![^\(]*\))/.source),q.leftMatch[s]=RegExp(/(^(?:.|\r|\n)*?)/.source+q.match[s].source.replace(/\\(\d+)/g,D));q.match.globalPOS=C;var z=function(a,b){a=Array.prototype.slice.call(a,0);return b?(b.push.apply(b,a),b):a};try{Array.prototype.slice.call(v.documentElement.childNodes,0)[0].nodeType}catch(w){z=function(a,b){var c=0,d=b||[];if("[object Array]"===f.call(a))Array.prototype.push.apply(d,a);else if("number"==typeof a.length)for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);
return d}}var u,t;v.documentElement.compareDocumentPosition?u=function(a,b){return a===b?(j=!0,0):!a.compareDocumentPosition||!b.compareDocumentPosition?a.compareDocumentPosition?-1:1:a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b)return j=!0,0;if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],g=[];c=a.parentNode;d=b.parentNode;var f=c;if(c===d)return t(a,b);if(!c)return-1;if(!d)return 1;for(;f;)e.unshift(f),f=f.parentNode;for(f=d;f;)g.unshift(f),f=f.parentNode;
c=e.length;d=g.length;for(f=0;f<c&&f<d;f++)if(e[f]!==g[f])return t(e[f],g[f]);return f===c?t(a,g[f],-1):t(e[f],b,1)},t=function(a,b,c){if(a===b)return c;for(a=a.nextSibling;a;){if(a===b)return-1;a=a.nextSibling}return 1});(function(){var a=v.createElement("div"),c="script"+(new Date).getTime(),d=v.documentElement;a.innerHTML="<a name='"+c+"'/>";d.insertBefore(a,d.firstChild);v.getElementById(c)&&(q.find.ID=function(a,c,d){if("undefined"!=typeof c.getElementById&&!d)return(c=c.getElementById(a[1]))?
c.id===a[1]||"undefined"!=typeof c.getAttributeNode&&c.getAttributeNode("id").nodeValue===a[1]?[c]:b:[]},q.filter.ID=function(a,b){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return 1===a.nodeType&&c&&c.nodeValue===b});d.removeChild(a);d=a=null})();(function(){var a=v.createElement("div");a.appendChild(v.createComment(""));0<a.getElementsByTagName("*").length&&(q.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if("*"===a[1]){for(var d=[],e=0;c[e];e++)1===c[e].nodeType&&
d.push(c[e]);c=d}return c});a.innerHTML="<a href='#'></a>";a.firstChild&&"undefined"!=typeof a.firstChild.getAttribute&&"#"!==a.firstChild.getAttribute("href")&&(q.attrHandle.href=function(a){return a.getAttribute("href",2)});a=null})();v.querySelectorAll&&function(){var a=n,b=v.createElement("div");b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||0!==b.querySelectorAll(".TEST").length){n=function(b,c,d,e){c=c||v;if(!e&&!n.isXML(c)){var g=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(g&&
(1===c.nodeType||9===c.nodeType)){if(g[1])return z(c.getElementsByTagName(b),d);if(g[2]&&q.find.CLASS&&c.getElementsByClassName)return z(c.getElementsByClassName(g[2]),d)}if(9===c.nodeType){if("body"===b&&c.body)return z([c.body],d);if(g&&g[3]){var f=c.getElementById(g[3]);if(!f||!f.parentNode)return z([],d);if(f.id===g[3])return z([f],d)}try{return z(c.querySelectorAll(b),d)}catch(h){}}else if(1===c.nodeType&&"object"!==c.nodeName.toLowerCase()){var g=c,j=(f=c.getAttribute("id"))||"__sizzle__",r=
c.parentNode,p=/^\s*[+~]/.test(b);f?j=j.replace(/'/g,"\\$&"):c.setAttribute("id",j);p&&r&&(c=c.parentNode);try{if(!p||r)return z(c.querySelectorAll("[id='"+j+"'] "+b),d)}catch(k){}finally{f||g.removeAttribute("id")}}}return a(b,c,d,e)};for(var c in a)n[c]=a[c];b=null}}();(function(){var a=v.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var c=!b.call(v.createElement("div"),"div"),d=!1;try{b.call(v.documentElement,"[test!='']:sizzle")}catch(e){d=
!0}n.matchesSelector=function(a,e){e=e.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!n.isXML(a))try{if(d||!q.match.PSEUDO.test(e)&&!/!=/.test(e)){var g=b.call(a,e);if(g||!c||a.document&&11!==a.document.nodeType)return g}}catch(f){}return 0<n(e,null,null,[a]).length}}})();(function(){var a=v.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";a.getElementsByClassName&&0!==a.getElementsByClassName("e").length&&(a.lastChild.className="e",1!==a.getElementsByClassName("e").length&&
(q.order.splice(1,0,"CLASS"),q.find.CLASS=function(a,b,c){if("undefined"!=typeof b.getElementsByClassName&&!c)return b.getElementsByClassName(a[1])},a=null))})();v.documentElement.contains?n.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:v.documentElement.compareDocumentPosition?n.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:n.contains=function(){return!1};n.isXML=function(a){return(a=(a?a.ownerDocument||a:0).documentElement)?"HTML"!==a.nodeName:!1};var A=
function(a,b,c){for(var d,e=[],g="",b=b.nodeType?[b]:b;d=q.match.PSEUDO.exec(a);)g+=d[0],a=a.replace(q.match.PSEUDO,"");a=q.relative[a]?a+"*":a;d=0;for(var f=b.length;d<f;d++)n(a,b[d],e,c);return n.filter(g,e)};n.attr=h.attr;n.selectors.attrMap={};h.find=n;h.expr=n.selectors;h.expr[":"]=h.expr.filters;h.unique=n.uniqueSort;h.text=n.getText;h.isXMLDoc=n.isXML;h.contains=n.contains})();var hb=/Until$/,ib=/^(?:parents|prevUntil|prevAll)/,jb=/,/,Za=/^.[^:#\[\.,]*$/,kb=Array.prototype.slice,Ja=h.expr.match.globalPOS,
lb={children:!0,contents:!0,next:!0,prev:!0};h.fn.extend({find:function(a){var b=this,c,d;if("string"!=typeof a)return h(a).filter(function(){c=0;for(d=b.length;c<d;c++)if(h.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,f,j;c=0;for(d=this.length;c<d;c++)if(g=e.length,h.find(a,this[c],e),0<c)for(f=g;f<e.length;f++)for(j=0;j<g;j++)if(e[j]===e[f]){e.splice(f--,1);break}return e},has:function(a){var b=h(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(h.contains(this,
b[a]))return!0})},not:function(a){return this.pushStack(s(this,a,!1),"not",a)},filter:function(a){return this.pushStack(s(this,a,!0),"filter",a)},is:function(a){return!!a&&("string"==typeof a?Ja.test(a)?0<=h(a,this.context).index(this[0]):0<h.filter(a,this).length:0<this.filter(a).length)},closest:function(a,b){var c=[],d,e,g=this[0];if(h.isArray(a)){for(e=1;g&&g.ownerDocument&&g!==b;){for(d=0;d<a.length;d++)h(g).is(a[d])&&c.push({selector:a[d],elem:g,level:e});g=g.parentNode;e++}return c}var f=Ja.test(a)||
"string"!=typeof a?h(a,b||this.context):0;d=0;for(e=this.length;d<e;d++)for(g=this[d];g;){if(f?-1<f.index(g):h.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||11===g.nodeType)break}c=1<c.length?h.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){return!a?this[0]&&this[0].parentNode?this.prevAll().length:-1:"string"==typeof a?h.inArray(this[0],h(a)):h.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c="string"==typeof a?h(a,b):h.makeArray(a&&
a.nodeType?[a]:a),d=h.merge(this.get(),c);return this.pushStack(!c[0]||!c[0].parentNode||11===c[0].parentNode.nodeType||!d[0]||!d[0].parentNode||11===d[0].parentNode.nodeType?d:h.unique(d))},andSelf:function(){return this.add(this.prevObject)}});h.each({parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},parents:function(a){return h.dir(a,"parentNode")},parentsUntil:function(a,b,c){return h.dir(a,"parentNode",c)},next:function(a){return h.nth(a,2,"nextSibling")},prev:function(a){return h.nth(a,
2,"previousSibling")},nextAll:function(a){return h.dir(a,"nextSibling")},prevAll:function(a){return h.dir(a,"previousSibling")},nextUntil:function(a,b,c){return h.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return h.dir(a,"previousSibling",c)},siblings:function(a){return h.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return h.sibling(a.firstChild)},contents:function(a){return h.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:h.makeArray(a.childNodes)}},function(a,
b){h.fn[a]=function(c,d){var e=h.map(this,b,c);hb.test(a)||(d=c);d&&"string"==typeof d&&(e=h.filter(d,e));e=1<this.length&&!lb[a]?h.unique(e):e;(1<this.length||jb.test(d))&&ib.test(a)&&(e=e.reverse());return this.pushStack(e,a,kb.call(arguments).join(","))}});h.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return 1===b.length?h.find.matchesSelector(b[0],a)?[b[0]]:[]:h.find.matches(a,b)},dir:function(a,c,d){for(var e=[],a=a[c];a&&9!==a.nodeType&&(d===b||1!==a.nodeType||!h(a).is(d));)1===a.nodeType&&
e.push(a),a=a[c];return e},nth:function(a,b,c){for(var b=b||1,d=0;a&&!(1===a.nodeType&&++d===b);a=a[c]);return a},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}});var za="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",mb=/ jQuery\d+="(?:\d+|null)"/g,sa=/^\s+/,Ka=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,La=/<([\w:]+)/,
nb=/<tbody/i,ob=/<|&#?\w+;/,pb=/<(?:script|style)/i,qb=/<(?:script|object|embed|option|style)/i,Ma=RegExp("<(?:"+za+")[\\s/>]","i"),Na=/checked\s*(?:[^=]|=\s*.checked.)/i,Oa=/\/(java|ecma)script/i,rb=/^\s*<!(?:\[CDATA\[|\-\-)/,J={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],
area:[1,"<map>","</map>"],_default:[0,"",""]},ta=w(v);J.optgroup=J.option;J.tbody=J.tfoot=J.colgroup=J.caption=J.thead;J.th=J.td;h.support.htmlSerialize||(J._default=[1,"div<div>","</div>"]);h.fn.extend({text:function(a){return h.access(this,function(a){return a===b?h.text(this):this.empty().append((this[0]&&this[0].ownerDocument||v).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(h.isFunction(a))return this.each(function(b){h(this).wrapAll(a.call(this,b))});if(this[0]){var b=
h(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var a=this;a.firstChild&&1===a.firstChild.nodeType;)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return h.isFunction(a)?this.each(function(b){h(this).wrapInner(a.call(this,b))}):this.each(function(){var b=h(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=h.isFunction(a);return this.each(function(c){h(this).wrapAll(b?a.call(this,c):
a)})},unwrap:function(){return this.parent().each(function(){h.nodeName(this,"body")||h(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=
h.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,h.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;null!=(d=this[c]);c++)if(!a||h.filter(a,[d]).length)!b&&1===d.nodeType&&(h.cleanData(d.getElementsByTagName("*")),
h.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;null!=(b=this[a]);a++)for(1===b.nodeType&&h.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);return this},clone:function(a,b){a=null==a?!1:a;b=null==b?a:b;return this.map(function(){return h.clone(this,a,b)})},html:function(a){return h.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return 1===c.nodeType?c.innerHTML.replace(mb,""):null;if("string"==
typeof a&&!pb.test(a)&&(h.support.leadingWhitespace||!sa.test(a))&&!J[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},1===c.nodeType&&(h.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(g){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(h.isFunction(a))return this.each(function(b){var c=h(this),d=c.html();c.replaceWith(a.call(this,b,d))});"string"!=typeof a&&(a=h(a).detach());
return this.each(function(){var b=this.nextSibling,c=this.parentNode;h(this).remove();b?h(b).before(a):h(c).append(a)})}return this.length?this.pushStack(h(h.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,f,j=a[0],p=[];if(!h.support.checkClone&&3===arguments.length&&"string"==typeof j&&Na.test(j))return this.each(function(){h(this).domManip(a,c,d,!0)});if(h.isFunction(j))return this.each(function(e){var g=h(this);a[0]=j.call(this,
e,c?g.html():b);g.domManip(a,c,d)});if(this[0]){f=j&&j.parentNode;h.support.parentNode&&f&&11===f.nodeType&&f.childNodes.length===this.length?e={fragment:f}:e=h.buildFragment(a,this,p);f=e.fragment;1===f.childNodes.length?g=f=f.firstChild:g=f.firstChild;if(g){c=c&&h.nodeName(g,"tr");g=0;for(var k=this.length,l=k-1;g<k;g++)d.call(c?h.nodeName(this[g],"table")?this[g].getElementsByTagName("tbody")[0]||this[g].appendChild(this[g].ownerDocument.createElement("tbody")):this[g]:this[g],e.cacheable||1<k&&
g<l?h.clone(f,!0,!0):f)}p.length&&h.each(p,function(a,b){b.src?h.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):h.globalEval((b.text||b.textContent||b.innerHTML||"").replace(rb,"/*$0*/"));b.parentNode&&b.parentNode.removeChild(b)})}return this}});h.buildFragment=function(a,b,c){var d,e,g,f,j=a[0];b&&b[0]&&(f=b[0].ownerDocument||b[0]);f.createDocumentFragment||(f=v);1===a.length&&"string"==typeof j&&512>j.length&&f===v&&"<"===j.charAt(0)&&!qb.test(j)&&(h.support.checkClone||!Na.test(j))&&
(h.support.html5Clone||!Ma.test(j))&&(e=!0,g=h.fragments[j],g&&1!==g&&(d=g));d||(d=f.createDocumentFragment(),h.clean(a,f,d,c));e&&(h.fragments[j]=g?d:1);return{fragment:d,cacheable:e}};h.fragments={};h.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){h.fn[a]=function(c){var d=[],c=h(c),e=1===this.length&&this[0].parentNode;if(e&&11===e.nodeType&&1===e.childNodes.length&&1===c.length)return c[b](this[0]),this;for(var e=0,
g=c.length;e<g;e++){var f=(0<e?this.clone(!0):this).get();h(c[e])[b](f);d=d.concat(f)}return this.pushStack(d,a,c.selector)}});h.extend({clone:function(a,b,c){var d,e,g;h.support.html5Clone||h.isXMLDoc(a)||!Ma.test("<"+a.nodeName+">")?d=a.cloneNode(!0):(d=v.createElement("div"),ta.appendChild(d),d.innerHTML=a.outerHTML,d=d.firstChild);var f=d;if((!h.support.noCloneEvent||!h.support.noCloneChecked)&&(1===a.nodeType||11===a.nodeType)&&!h.isXMLDoc(a)){A(a,f);d=B(a);e=B(f);for(g=0;d[g];++g)e[g]&&A(d[g],
e[g])}if(b&&(I(a,f),c)){d=B(a);e=B(f);for(g=0;d[g];++g)I(d[g],e[g])}return f},clean:function(a,b,c,d){var e,g=[],b=b||v;"undefined"==typeof b.createElement&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||v);for(var f=0,j;null!=(j=a[f]);f++)if("number"==typeof j&&(j+=""),j){if("string"==typeof j)if(ob.test(j)){j=j.replace(Ka,"<$1></$2>");e=(La.exec(j)||["",""])[1].toLowerCase();var p=J[e]||J._default,k=p[0],l=b.createElement("div"),n=ta.childNodes,m;b===v?ta.appendChild(l):w(b).appendChild(l);for(l.innerHTML=
p[1]+j+p[2];k--;)l=l.lastChild;if(!h.support.tbody){k=nb.test(j);p="table"===e&&!k?l.firstChild&&l.firstChild.childNodes:"<table>"===p[1]&&!k?l.childNodes:[];for(e=p.length-1;0<=e;--e)h.nodeName(p[e],"tbody")&&!p[e].childNodes.length&&p[e].parentNode.removeChild(p[e])}!h.support.leadingWhitespace&&sa.test(j)&&l.insertBefore(b.createTextNode(sa.exec(j)[0]),l.firstChild);j=l.childNodes;l&&(l.parentNode.removeChild(l),0<n.length&&(m=n[n.length-1],m&&m.parentNode&&m.parentNode.removeChild(m)))}else j=
b.createTextNode(j);var q;if(!h.support.appendChecked)if(j[0]&&"number"==typeof(q=j.length))for(e=0;e<q;e++)z(j[e]);else z(j);j.nodeType?g.push(j):g=h.merge(g,j)}if(c){a=function(a){return!a.type||Oa.test(a.type)};for(f=0;g[f];f++)b=g[f],d&&h.nodeName(b,"script")&&(!b.type||Oa.test(b.type))?d.push(b.parentNode?b.parentNode.removeChild(b):b):(1===b.nodeType&&(j=h.grep(b.getElementsByTagName("script"),a),g.splice.apply(g,[f+1,0].concat(j))),c.appendChild(b))}return g},cleanData:function(a){for(var b,
c,d=h.cache,e=h.event.special,g=h.support.deleteExpando,f=0,j;null!=(j=a[f]);f++)if(!j.nodeName||!h.noData[j.nodeName.toLowerCase()])if(c=j[h.expando]){if((b=d[c])&&b.events){for(var p in b.events)e[p]?h.event.remove(j,p):h.removeEvent(j,p,b.handle);b.handle&&(b.handle.elem=null)}g?delete j[h.expando]:j.removeAttribute&&j.removeAttribute(h.expando);delete d[c]}}});var va=/alpha\([^)]*\)/i,sb=/opacity=([^)]*)/,tb=/([A-Z]|^ms)/g,ub=/^[\-+]?(?:\d*\.)?\d+$/i,ma=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,vb=/^([\-+])=([\-+.\de]+)/,
wb=/^margin/,xb={position:"absolute",visibility:"hidden",display:"block"},W=["Top","Right","Bottom","Left"],ba,Pa,Qa;h.fn.css=function(a,c){return h.access(this,function(a,c,d){return d!==b?h.style(a,c,d):h.css(a,c)},a,c,1<arguments.length)};h.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=ba(a,"opacity");return""===c?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":h.support.cssFloat?
"cssFloat":"styleFloat"},style:function(a,c,d,e){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var g,f=h.camelCase(c),j=a.style,p=h.cssHooks[f],c=h.cssProps[f]||f;if(d===b)return p&&"get"in p&&(g=p.get(a,!1,e))!==b?g:j[c];e=typeof d;"string"===e&&(g=vb.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(h.css(a,c)),e="number");if(!(null==d||"number"===e&&isNaN(d)))if("number"===e&&!h.cssNumber[f]&&(d+="px"),!p||!("set"in p)||(d=p.set(a,d))!==b)try{j[c]=d}catch(k){}}},css:function(a,c,d){var e,g,c=h.camelCase(c);
g=h.cssHooks[c];c=h.cssProps[c]||c;"cssFloat"===c&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(ba)return ba(a,c)},swap:function(a,b,c){var d={},e;for(e in b)d[e]=a.style[e],a.style[e]=b[e];c=c.call(a);for(e in b)a.style[e]=d[e];return c}});h.curCSS=h.css;v.defaultView&&v.defaultView.getComputedStyle&&(Pa=function(a,b){var c,d,e,g,f=a.style,b=b.replace(tb,"-$1").toLowerCase();(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),""===c&&!h.contains(a.ownerDocument.documentElement,
a)&&(c=h.style(a,b)));!h.support.pixelMargin&&e&&wb.test(b)&&ma.test(c)&&(g=f.width,f.width=c,c=e.width,f.width=g);return c});v.documentElement.currentStyle&&(Qa=function(a,b){var c,d,e,g=a.currentStyle&&a.currentStyle[b],f=a.style;null==g&&f&&(e=f[b])&&(g=e);ma.test(g)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left="fontSize"===b?"1em":g,g=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d));return""===g?"auto":g});ba=Pa||Qa;h.each(["height",
"width"],function(a,b){h.cssHooks[b]={get:function(a,c,d){if(c)return 0!==a.offsetWidth?o(a,b,d):h.swap(a,xb,function(){return o(a,b,d)})},set:function(a,b){return ub.test(b)?b+"px":b}}});h.support.opacity||(h.cssHooks.opacity={get:function(a,b){return sb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=h.isNumeric(b)?"alpha(opacity="+100*b+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(1<=
b&&""===h.trim(g.replace(va,""))&&(c.removeAttribute("filter"),d&&!d.filter))return;c.filter=va.test(g)?g.replace(va,e):g+" "+e}});h(function(){h.support.reliableMarginRight||(h.cssHooks.marginRight={get:function(a,b){return h.swap(a,{display:"inline-block"},function(){return b?ba(a,"margin-right"):a.style.marginRight})}})});h.expr&&h.expr.filters&&(h.expr.filters.hidden=function(a){var b=a.offsetHeight;return 0===a.offsetWidth&&0===b||!h.support.reliableHiddenOffsets&&"none"===(a.style&&a.style.display||
h.css(a,"display"))},h.expr.filters.visible=function(a){return!h.expr.filters.hidden(a)});h.each({margin:"",padding:"",border:"Width"},function(a,b){h.cssHooks[a+b]={expand:function(c){for(var d="string"==typeof c?c.split(" "):[c],e={},c=0;4>c;c++)e[a+W[c]+b]=d[c]||d[c-2]||d[0];return e}}});var yb=/%20/g,Ya=/\[\]$/,Ra=/\r?\n/g,zb=/#.*$/,Ab=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,Bb=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,Cb=/^(?:GET|HEAD)$/,
Db=/^\/\//,Sa=/\?/,Eb=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,Fb=/^(?:select|textarea)/i,ya=/\s+/,Gb=/([?&])_=[^&]*/,Ta=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,Ua=h.fn.load,la={},Va={},Y,Z,Wa=["*/"]+["*"];try{Y=E.href}catch(Mb){Y=v.createElement("a"),Y.href="",Y=Y.href}Z=Ta.exec(Y.toLowerCase())||[];h.fn.extend({load:function(a,c,d){if("string"!=typeof a&&Ua)return Ua.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(0<=e)var g=a.slice(e,a.length),a=
a.slice(0,e);e="GET";c&&(h.isFunction(c)?(d=c,c=b):"object"==typeof c&&(c=h.param(c,h.ajaxSettings.traditional),e="POST"));var f=this;h.ajax({url:a,type:e,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText;a.isResolved()&&(a.done(function(a){c=a}),f.html(g?h("<div>").append(c.replace(Eb,"")).find(g):c));d&&f.each(d,[c,b,a])}});return this},serialize:function(){return h.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?h.makeArray(this.elements):
this}).filter(function(){return this.name&&!this.disabled&&(this.checked||Fb.test(this.nodeName)||Bb.test(this.type))}).map(function(a,b){var c=h(this).val();return null==c?null:h.isArray(c)?h.map(c,function(a){return{name:b.name,value:a.replace(Ra,"\r\n")}}):{name:b.name,value:c.replace(Ra,"\r\n")}}).get()}});h.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(a,b){h.fn[b]=function(a){return this.on(b,a)}});h.each(["get","post"],function(a,c){h[c]=function(a,
d,e,g){h.isFunction(d)&&(g=g||e,e=d,d=b);return h.ajax({type:c,url:a,data:d,success:e,dataType:g})}});h.extend({getScript:function(a,c){return h.get(a,b,c,"script")},getJSON:function(a,b,c){return h.get(a,b,c,"json")},ajaxSetup:function(a,b){b?l(a,h.ajaxSettings):(b=a,a=h.ajaxSettings);l(a,b);return a},ajaxSettings:{url:Y,isLocal:/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/.test(Z[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,
async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Wa},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":h.parseJSON,"text xml":h.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:m(la),ajaxTransport:m(Va),ajax:function(a,c){function d(a,c,r,n){if(2!==v){v=2;z&&clearTimeout(z);s=b;o=n||"";t.readyState=0<a?4:
0;var m,q,F,n=c;if(r){var C=e,D=t,H=C.contents,w=C.dataTypes,A=C.responseFields,B,E,U,na;for(E in A)E in r&&(D[A[E]]=r[E]);for(;"*"===w[0];)w.shift(),B===b&&(B=C.mimeType||D.getResponseHeader("content-type"));if(B)for(E in H)if(H[E]&&H[E].test(B)){w.unshift(E);break}if(w[0]in r)U=w[0];else{for(E in r){if(!w[0]||C.converters[E+" "+w[0]]){U=E;break}na||(na=E)}U=U||na}U?(U!==w[0]&&w.unshift(U),r=r[U]):r=void 0}else r=b;if(200<=a&&300>a||304===a){if(e.ifModified){if(B=t.getResponseHeader("Last-Modified"))h.lastModified[l]=
B;if(B=t.getResponseHeader("Etag"))h.etag[l]=B}if(304===a)n="notmodified",m=!0;else try{B=e;B.dataFilter&&(r=B.dataFilter(r,B.dataType));var O=B.dataTypes;E={};var P,Q,qa=O.length,I,V=O[0],J,N,K,L,M;for(P=1;P<qa;P++){if(1===P)for(Q in B.converters)"string"==typeof Q&&(E[Q.toLowerCase()]=B.converters[Q]);J=V;V=O[P];if("*"===V)V=J;else if("*"!==J&&J!==V){N=J+" "+V;K=E[N]||E["* "+V];if(!K)for(L in M=b,E)if(I=L.split(" "),I[0]===J||"*"===I[0])if(M=E[I[1]+" "+V]){L=E[L];!0===L?K=M:!0===M&&(K=L);break}!K&&
!M&&h.error("No conversion from "+N.replace(" "," to "));!0!==K&&(r=K?K(r):M(L(r)))}}q=r;n="success";m=!0}catch(X){n="parsererror",F=X}}else if(F=n,!n||a)n="error",0>a&&(a=0);t.status=a;t.statusText=""+(c||n);m?j.resolveWith(g,[q,n,t]):j.rejectWith(g,[t,n,F]);t.statusCode(k);k=b;u&&f.trigger("ajax"+(m?"Success":"Error"),[t,e,m?q:F]);p.fireWith(g,[t,n]);u&&(f.trigger("ajaxComplete",[t,e]),--h.active||h.event.trigger("ajaxStop"))}}"object"==typeof a&&(c=a,a=b);var c=c||{},e=h.ajaxSetup({},c),g=e.context||
e,f=g!==e&&(g.nodeType||g instanceof h)?h(g):h.event,j=h.Deferred(),p=h.Callbacks("once memory"),k=e.statusCode||{},l,m={},q={},o,C,s,z,D,v=0,u,w,t={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase(),a=q[c]=q[c]||a;m[a]=b}return this},getAllResponseHeaders:function(){return 2===v?o:null},getResponseHeader:function(a){var c;if(2===v){if(!C)for(C={};c=Ab.exec(o);)C[c[1].toLowerCase()]=c[2];c=C[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){v||(e.mimeType=a);
return this},abort:function(a){a=a||"abort";s&&s.abort(a);d(0,a);return this}};j.promise(t);t.success=t.done;t.error=t.fail;t.complete=p.add;t.statusCode=function(a){if(a){var b;if(2>v)for(b in a)k[b]=[k[b],a[b]];else b=a[t.status],t.then(b,b)}return this};e.url=((a||e.url)+"").replace(zb,"").replace(Db,Z[1]+"//");e.dataTypes=h.trim(e.dataType||"*").toLowerCase().split(ya);null==e.crossDomain&&(D=Ta.exec(e.url.toLowerCase()),e.crossDomain=!(!D||D[1]==Z[1]&&D[2]==Z[2]&&(D[3]||("http:"===D[1]?80:443))==
(Z[3]||("http:"===Z[1]?80:443))));e.data&&e.processData&&"string"!=typeof e.data&&(e.data=h.param(e.data,e.traditional));n(la,e,c,t);if(2===v)return!1;u=e.global;e.type=e.type.toUpperCase();e.hasContent=!Cb.test(e.type);u&&0===h.active++&&h.event.trigger("ajaxStart");if(!e.hasContent&&(e.data&&(e.url+=(Sa.test(e.url)?"&":"?")+e.data,delete e.data),l=e.url,!1===e.cache)){D=h.now();var A=e.url.replace(Gb,"$1_="+D);e.url=A+(A===e.url?(Sa.test(e.url)?"&":"?")+"_="+D:"")}(e.data&&e.hasContent&&!1!==e.contentType||
c.contentType)&&t.setRequestHeader("Content-Type",e.contentType);e.ifModified&&(l=l||e.url,h.lastModified[l]&&t.setRequestHeader("If-Modified-Since",h.lastModified[l]),h.etag[l]&&t.setRequestHeader("If-None-Match",h.etag[l]));t.setRequestHeader("Accept",e.dataTypes[0]&&e.accepts[e.dataTypes[0]]?e.accepts[e.dataTypes[0]]+("*"!==e.dataTypes[0]?", "+Wa+"; q=0.01":""):e.accepts["*"]);for(w in e.headers)t.setRequestHeader(w,e.headers[w]);if(e.beforeSend&&(!1===e.beforeSend.call(g,t,e)||2===v))return t.abort(),
!1;for(w in{success:1,error:1,complete:1})t[w](e[w]);if(s=n(Va,e,c,t)){t.readyState=1;u&&f.trigger("ajaxSend",[t,e]);e.async&&0<e.timeout&&(z=setTimeout(function(){t.abort("timeout")},e.timeout));try{v=1,s.send(m,d)}catch(B){if(2>v)d(-1,B);else throw B;}}else d(-1,"No Transport");return t},param:function(a,c){var d=[],e=function(a,b){b=h.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=h.ajaxSettings.traditional);if(h.isArray(a)||a.jquery&&!h.isPlainObject(a))h.each(a,
function(){e(this.name,this.value)});else for(var g in a)k(g,a[g],c,e);return d.join("&").replace(yb,"+")}});h.extend({active:0,lastModified:{},etag:{}});var Hb=h.now(),ia=/(\=)\?(&|$)|\?\?/i;h.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return h.expando+"_"+Hb++}});h.ajaxPrefilter("json jsonp",function(b,c,d){c="string"==typeof b.data&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if("jsonp"===b.dataTypes[0]||!1!==b.jsonp&&(ia.test(b.url)||c&&ia.test(b.data))){var e,g=b.jsonpCallback=
h.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,f=a[g],j=b.url,p=b.data,k="$1"+g+"$2";!1!==b.jsonp&&(j=j.replace(ia,k),b.url===j&&(c&&(p=p.replace(ia,k)),b.data===p&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+g)));b.url=j;b.data=p;a[g]=function(a){e=[a]};d.always(function(){a[g]=f;e&&h.isFunction(f)&&a[g](e[0])});b.converters["script json"]=function(){e||h.error(g+" was not called");return e[0]};b.dataTypes[0]="json";return"script"}});h.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},
contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){h.globalEval(a);return a}}});h.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1);a.crossDomain&&(a.type="GET",a.global=!1)});h.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=v.head||v.getElementsByTagName("head")[0]||v.documentElement;return{send:function(e,g){c=v.createElement("script");c.async="async";a.scriptCharset&&(c.charset=a.scriptCharset);c.src=a.url;c.onload=c.onreadystatechange=function(a,
e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")};d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var wa=a.ActiveXObject?function(){for(var a in da)da[a](0,1)}:!1,Ib=0,da;h.ajaxSettings.xhr=a.ActiveXObject?function(){var b;if(!(b=!this.isLocal&&g()))a:{try{b=new a.ActiveXObject("Microsoft.XMLHTTP");break a}catch(c){}b=void 0}return b}:g;(function(a){h.extend(h.support,{ajax:!!a,
cors:!!a&&"withCredentials"in a})})(h.ajaxSettings.xhr());h.support.ajax&&h.ajaxTransport(function(c){if(!c.crossDomain||h.support.cors){var d;return{send:function(e,g){var f=c.xhr(),j,p;c.username?f.open(c.type,c.url,c.async,c.username,c.password):f.open(c.type,c.url,c.async);if(c.xhrFields)for(p in c.xhrFields)f[p]=c.xhrFields[p];c.mimeType&&f.overrideMimeType&&f.overrideMimeType(c.mimeType);!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(p in e)f.setRequestHeader(p,
e[p])}catch(k){}f.send(c.hasContent&&c.data||null);d=function(a,e){var p,k,l,n,m;try{if(d&&(e||4===f.readyState))if(d=b,j&&(f.onreadystatechange=h.noop,wa&&delete da[j]),e)4!==f.readyState&&f.abort();else{p=f.status;l=f.getAllResponseHeaders();n={};(m=f.responseXML)&&m.documentElement&&(n.xml=m);try{n.text=f.responseText}catch(q){}try{k=f.statusText}catch(o){k=""}!p&&c.isLocal&&!c.crossDomain?p=n.text?200:404:1223===p&&(p=204)}}catch(C){e||g(-1,C)}n&&g(p,k,n,l)};!c.async||4===f.readyState?d():(j=
++Ib,wa&&(da||(da={},h(a).unload(wa)),da[j]=d),f.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ka={},K,aa,Jb=/^(?:toggle|show|hide)$/,Kb=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,ja,fa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],ga;h.fn.extend({show:function(a,b,c){var g;if(a||0===a)return this.animate(e("show",3),a,b,c);b=0;for(c=this.length;b<c;b++)a=this[b],a.style&&(g=a.style.display,!h._data(a,
"olddisplay")&&"none"===g&&(g=a.style.display=""),(""===g&&"none"===h.css(a,"display")||!h.contains(a.ownerDocument.documentElement,a))&&h._data(a,"olddisplay",d(a.nodeName)));for(b=0;b<c;b++)if(a=this[b],a.style&&(g=a.style.display,""===g||"none"===g))a.style.display=h._data(a,"olddisplay")||"";return this},hide:function(a,b,c){if(a||0===a)return this.animate(e("hide",3),a,b,c);for(var d,b=0,c=this.length;b<c;b++)a=this[b],a.style&&(d=h.css(a,"display"),"none"!==d&&!h._data(a,"olddisplay")&&h._data(a,
"olddisplay",d));for(b=0;b<c;b++)this[b].style&&(this[b].style.display="none");return this},_toggle:h.fn.toggle,toggle:function(a,b,c){var d="boolean"==typeof a;h.isFunction(a)&&h.isFunction(b)?this._toggle.apply(this,arguments):null==a||d?this.each(function(){var b=d?a:h(this).is(":hidden");h(this)[b?"show":"hide"]()}):this.animate(e("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,
b,c,e){function g(){!1===f.queue&&h._mark(this);var b=h.extend({},f),c=1===this.nodeType,e=c&&h(this).is(":hidden"),j,p,k,l,n,m,q,o,C;b.animatedProperties={};for(k in a)if(j=h.camelCase(k),k!==j&&(a[j]=a[k],delete a[k]),(p=h.cssHooks[j])&&"expand"in p)for(k in l=p.expand(a[j]),delete a[j],l)k in a||(a[k]=l[k]);for(j in a){p=a[j];h.isArray(p)?(b.animatedProperties[j]=p[1],p=a[j]=p[0]):b.animatedProperties[j]=b.specialEasing&&b.specialEasing[j]||b.easing||"swing";if("hide"===p&&e||"show"===p&&!e)return b.complete.call(this);
c&&("height"===j||"width"===j)&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],"inline"===h.css(this,"display")&&"none"===h.css(this,"float")&&(!h.support.inlineBlockNeedsLayout||"inline"===d(this.nodeName)?this.style.display="inline-block":this.style.zoom=1))}null!=b.overflow&&(this.style.overflow="hidden");for(k in a)c=new h.fx(this,b,k),p=a[k],Jb.test(p)?(C=h._data(this,"toggle"+k)||("toggle"===p?e?"show":"hide":0),C?(h._data(this,"toggle"+k,"show"===C?"hide":"show"),
c[C]()):c[p]()):(n=Kb.exec(p),m=c.cur(),n?(q=parseFloat(n[2]),o=n[3]||(h.cssNumber[k]?"":"px"),"px"!==o&&(h.style(this,k,(q||1)+o),m*=(q||1)/c.cur(),h.style(this,k,m+o)),n[1]&&(q=("-="===n[1]?-1:1)*q+m),c.custom(m,q,o)):c.custom(m,p,""));return!0}var f=h.speed(b,c,e);if(h.isEmptyObject(a))return this.each(f.complete,[!1]);a=h.extend({},a);return!1===f.queue?this.each(g):this.queue(f.queue,g)},stop:function(a,c,d){"string"!=typeof a&&(d=c,c=a,a=b);c&&!1!==a&&this.queue(a||"fx",[]);return this.each(function(){var b,
c=!1,e=h.timers,g=h._data(this);d||h._unmark(!0,this);if(null==a)for(b in g){if(g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4){var f=g[b];h.removeData(this,b,!0);f.stop(d)}}else if(g[b=a+".run"]&&g[b].stop)g=g[b],h.removeData(this,b,!0),g.stop(d);for(b=e.length;b--;)e[b].elem===this&&(null==a||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&h.dequeue(this,a)})}});h.each({slideDown:e("show",1),slideUp:e("hide",1),slideToggle:e("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},
fadeToggle:{opacity:"toggle"}},function(a,b){h.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}});h.extend({speed:function(a,b,c){var d=a&&"object"==typeof a?h.extend({},a):{complete:c||!c&&b||h.isFunction(a)&&a,duration:a,easing:c&&b||b&&!h.isFunction(b)&&b};d.duration=h.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in h.fx.speeds?h.fx.speeds[d.duration]:h.fx.speeds._default;if(null==d.queue||!0===d.queue)d.queue="fx";d.old=d.complete;d.complete=function(a){h.isFunction(d.old)&&d.old.call(this);
d.queue?h.dequeue(this,d.queue):!1!==a&&h._unmark(this)};return d},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+0.5}},timers:[],fx:function(a,b,c){this.options=b;this.elem=a;this.prop=c;b.orig=b.orig||{}}});h.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(h.fx.step[this.prop]||h.fx.step._default)(this)},cur:function(){if(null!=this.elem[this.prop]&&(!this.elem.style||null==this.elem.style[this.prop]))return this.elem[this.prop];
var a,b=h.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||"auto"===b?0:b:a},custom:function(a,c,d){function e(a){return g.step(a)}var g=this,f=h.fx;this.startTime=ga||j();this.end=c;this.now=this.start=a;this.pos=this.state=0;this.unit=d||this.unit||(h.cssNumber[this.prop]?"":"px");e.queue=this.options.queue;e.elem=this.elem;e.saveState=function(){h._data(g.elem,"fxshow"+g.prop)===b&&(g.options.hide?h._data(g.elem,"fxshow"+g.prop,g.start):g.options.show&&h._data(g.elem,"fxshow"+g.prop,
g.end))};e()&&h.timers.push(e)&&!ja&&(ja=setInterval(f.tick,f.interval))},show:function(){var a=h._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||h.style(this.elem,this.prop);this.options.show=!0;a!==b?this.custom(this.cur(),a):this.custom("width"===this.prop||"height"===this.prop?1:0,this.cur());h(this.elem).show()},hide:function(){this.options.orig[this.prop]=h._data(this.elem,"fxshow"+this.prop)||h.style(this.elem,this.prop);this.options.hide=!0;this.custom(this.cur(),0)},step:function(a){var b,
c,d=ga||j(),e=!0,g=this.elem,f=this.options;if(a||d>=f.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();f.animatedProperties[this.prop]=!0;for(b in f.animatedProperties)!0!==f.animatedProperties[b]&&(e=!1);if(e){null!=f.overflow&&!h.support.shrinkWrapBlocks&&h.each(["","X","Y"],function(a,b){g.style["overflow"+b]=f.overflow[a]});f.hide&&h(g).hide();if(f.hide||f.show)for(b in f.animatedProperties)h.style(g,b,f.orig[b]),h.removeData(g,"fxshow"+b,!0),h.removeData(g,"toggle"+
b,!0);(a=f.complete)&&(f.complete=!1,a.call(g))}return!1}Infinity==f.duration?this.now=d:(c=d-this.startTime,this.state=c/f.duration,this.pos=h.easing[f.animatedProperties[this.prop]](this.state,c,0,1,f.duration),this.now=this.start+(this.end-this.start)*this.pos);this.update();return!0}};h.extend(h.fx,{tick:function(){for(var a,b=h.timers,c=0;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||h.fx.stop()},interval:25,stop:function(){clearInterval(ja);ja=null},speeds:{slow:600,fast:200,
_default:400},step:{opacity:function(a){h.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&null!=a.elem.style[a.prop]?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}});h.each(fa.concat.apply([],fa),function(a,b){b.indexOf("margin")&&(h.fx.step[b]=function(a){h.style(a.elem,b,Math.max(0,a.now)+a.unit)})});h.expr&&h.expr.filters&&(h.expr.filters.animated=function(a){return h.grep(h.timers,function(b){return a===b.elem}).length});var xa,Lb=/^t(?:able|d|h)$/i,Xa=/^(?:body|html)$/i;
"getBoundingClientRect"in v.documentElement?xa=function(a,b,d,e){try{e=a.getBoundingClientRect()}catch(g){}if(!e||!h.contains(d,a))return e?{top:e.top,left:e.left}:{top:0,left:0};a=b.body;b=c(b);return{top:e.top+(b.pageYOffset||h.support.boxModel&&d.scrollTop||a.scrollTop)-(d.clientTop||a.clientTop||0),left:e.left+(b.pageXOffset||h.support.boxModel&&d.scrollLeft||a.scrollLeft)-(d.clientLeft||a.clientLeft||0)}}:xa=function(a,b,c){var d,e=a.offsetParent,g=b.body;d=(b=b.defaultView)?b.getComputedStyle(a,
null):a.currentStyle;for(var f=a.offsetTop,j=a.offsetLeft;(a=a.parentNode)&&a!==g&&a!==c&&!(h.support.fixedPosition&&"fixed"===d.position);)d=b?b.getComputedStyle(a,null):a.currentStyle,f-=a.scrollTop,j-=a.scrollLeft,a===e&&(f+=a.offsetTop,j+=a.offsetLeft,h.support.doesNotAddBorder&&(!h.support.doesAddBorderForTableAndCells||!Lb.test(a.nodeName))&&(f+=parseFloat(d.borderTopWidth)||0,j+=parseFloat(d.borderLeftWidth)||0),e=a.offsetParent),h.support.subtractsBorderForOverflowNotVisible&&"visible"!==
d.overflow&&(f+=parseFloat(d.borderTopWidth)||0,j+=parseFloat(d.borderLeftWidth)||0);if("relative"===d.position||"static"===d.position)f+=g.offsetTop,j+=g.offsetLeft;h.support.fixedPosition&&"fixed"===d.position&&(f+=Math.max(c.scrollTop,g.scrollTop),j+=Math.max(c.scrollLeft,g.scrollLeft));return{top:f,left:j}};h.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){h.offset.setOffset(this,a,b)});var c=this[0],d=c&&c.ownerDocument;return!d?null:c===d.body?h.offset.bodyOffset(c):
xa(c,d,d.documentElement)};h.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;h.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(h.css(a,"marginTop"))||0,c+=parseFloat(h.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=h.css(a,"position");"static"===d&&(a.style.position="relative");var e=h(a),g=e.offset(),f=h.css(a,"top"),j=h.css(a,"left"),p={},k={},l,n;("absolute"===d||"fixed"===d)&&-1<h.inArray("auto",[f,j])?(k=e.position(),l=k.top,n=k.left):
(l=parseFloat(f)||0,n=parseFloat(j)||0);h.isFunction(b)&&(b=b.call(a,c,g));null!=b.top&&(p.top=b.top-g.top+l);null!=b.left&&(p.left=b.left-g.left+n);"using"in b?b.using.call(a,p):e.css(p)}};h.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=Xa.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(h.css(a,"marginTop"))||0;c.left-=parseFloat(h.css(a,"marginLeft"))||0;d.top+=parseFloat(h.css(b[0],"borderTopWidth"))||0;d.left+=parseFloat(h.css(b[0],
"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||v.body;a&&!Xa.test(a.nodeName)&&"static"===h.css(a,"position");)a=a.offsetParent;return a})}});h.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,d){var e=/Y/.test(d);h.fn[a]=function(g){return h.access(this,function(a,g,f){var j=c(a);if(f===b)return j?d in j?j[d]:h.support.boxModel&&j.document.documentElement[g]||j.document.body[g]:a[g];
j?j.scrollTo(e?h(j).scrollLeft():f,e?f:h(j).scrollTop()):a[g]=f},a,g,arguments.length,null)}});h.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;h.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(h.css(a,c,"padding")):this[c]():null};h.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(h.css(b,c,a?"margin":"border")):this[c]():null};h.fn[c]=function(a){return h.access(this,function(a,c,f){if(h.isWindow(a))return c=a.document,
a=c.documentElement[d],h.support.boxModel&&a||c.body&&c.body[d]||a;if(9===a.nodeType)return c=a.documentElement,c[d]>=c[e]?c[d]:Math.max(a.body[e],c[e],a.body[g],c[g]);if(f===b)return a=h.css(a,c),c=parseFloat(a),h.isNumeric(c)?c:a;h(a).css(c,f)},c,a,arguments.length,null)}});a.jQuery=a.$=h;"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return h})})(window);jQuery.easing.jswing=jQuery.easing.swing;
jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(a,b,c,d,e){return jQuery.easing[jQuery.easing.def](a,b,c,d,e)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){return 1>(b/=e/2)?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){return 1>(b/=e/2)?d/2*b*b*b+c:
d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){return 1>(b/=e/2)?d/2*b*b*b*b+c:-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){return 1>(b/=e/2)?d/2*b*b*b*b*b+c:d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/
e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return 0==b?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){return 0==b?c:b==e?c+d:1>(b/=e/2)?d/2*Math.pow(2,10*(b-1))+c:d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*
b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){return 1>(b/=e/2)?-d/2*(Math.sqrt(1-b*b)-1)+c:d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var a=1.70158,f=0,j=d;if(0==b)return c;if(1==(b/=e))return c+d;f||(f=0.3*e);j<Math.abs(d)?(j=d,a=f/4):a=f/(2*Math.PI)*Math.asin(d/j);return-(j*Math.pow(2,10*(b-=1))*Math.sin((b*e-a)*2*Math.PI/f))+c},easeOutElastic:function(a,b,c,d,e){var a=1.70158,f=0,j=d;if(0==b)return c;if(1==
(b/=e))return c+d;f||(f=0.3*e);j<Math.abs(d)?(j=d,a=f/4):a=f/(2*Math.PI)*Math.asin(d/j);return j*Math.pow(2,-10*b)*Math.sin((b*e-a)*2*Math.PI/f)+d+c},easeInOutElastic:function(a,b,c,d,e){var a=1.70158,f=0,j=d;if(0==b)return c;if(2==(b/=e/2))return c+d;f||(f=e*0.3*1.5);j<Math.abs(d)?(j=d,a=f/4):a=f/(2*Math.PI)*Math.asin(d/j);return 1>b?-0.5*j*Math.pow(2,10*(b-=1))*Math.sin((b*e-a)*2*Math.PI/f)+c:0.5*j*Math.pow(2,-10*(b-=1))*Math.sin((b*e-a)*2*Math.PI/f)+d+c},easeInBack:function(a,b,c,d,e,f){void 0==
f&&(f=1.70158);return d*(b/=e)*b*((f+1)*b-f)+c},easeOutBack:function(a,b,c,d,e,f){void 0==f&&(f=1.70158);return d*((b=b/e-1)*b*((f+1)*b+f)+1)+c},easeInOutBack:function(a,b,c,d,e,f){void 0==f&&(f=1.70158);return 1>(b/=e/2)?d/2*b*b*(((f*=1.525)+1)*b-f)+c:d/2*((b-=2)*b*(((f*=1.525)+1)*b+f)+2)+c},easeInBounce:function(a,b,c,d,e){return d-jQuery.easing.easeOutBounce(a,e-b,0,d,e)+c},easeOutBounce:function(a,b,c,d,e){return(b/=e)<1/2.75?d*7.5625*b*b+c:b<2/2.75?d*(7.5625*(b-=1.5/2.75)*b+0.75)+c:b<2.5/2.75?
d*(7.5625*(b-=2.25/2.75)*b+0.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+0.984375)+c},easeInOutBounce:function(a,b,c,d,e){return b<e/2?0.5*jQuery.easing.easeInBounce(a,2*b,0,d,e)+c:0.5*jQuery.easing.easeOutBounce(a,2*b-e,0,d,e)+0.5*d+c}});(function(a){var b=[],c=function(){},d=0,e=[],f=function(){d++;d>=b.length&&(c(e),c=function(){})},j=function(b){var c=new Image;a(c).load(function(){e.push({url:b,img:c});f()}).error(function(){e.push(c);f()}).attr("src",b)};a.fn.loader=function(d,e){d&&a.extend(b,d);"function"==typeof e&&(c=e);for(var f=0;f<b.length;f++)j(b[f])}})(jQuery);(function(a,b){function c(){if(!d.READY){d.event.determineEventTypes();for(var a in d.gestures)d.gestures.hasOwnProperty(a)&&d.detection.register(d.gestures[a]);d.event.onTouch(d.DOCUMENT,d.EVENT_MOVE,d.detection.detect);d.event.onTouch(d.DOCUMENT,d.EVENT_END,d.detection.detect);d.READY=!0}}var d=function(a,b){return new d.Instance(a,b||{})};d.defaults={stop_browser_behavior:{userSelect:"none",touchAction:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};
d.HAS_POINTEREVENTS=navigator.pointerEnabled||navigator.msPointerEnabled;d.HAS_TOUCHEVENTS="ontouchstart"in a;d.MOBILE_REGEX=/mobile|tablet|ip(ad|hone|od)|android/i;d.NO_MOUSEEVENTS=d.HAS_TOUCHEVENTS&&navigator.userAgent.match(d.MOBILE_REGEX);d.EVENT_TYPES={};d.DIRECTION_DOWN="down";d.DIRECTION_LEFT="left";d.DIRECTION_UP="up";d.DIRECTION_RIGHT="right";d.POINTER_MOUSE="mouse";d.POINTER_TOUCH="touch";d.POINTER_PEN="pen";d.EVENT_START="start";d.EVENT_MOVE="move";d.EVENT_END="end";d.DOCUMENT=document;
d.plugins={};d.READY=!1;d.Instance=function(a,b){var e=this;return c(),this.element=a,this.enabled=!0,this.options=d.utils.extend(d.utils.extend({},d.defaults),b||{}),this.options.stop_browser_behavior&&d.utils.stopDefaultBrowserBehavior(this.element,this.options.stop_browser_behavior),d.event.onTouch(a,d.EVENT_START,function(a){e.enabled&&d.detection.startDetect(e,a)}),this};d.Instance.prototype={on:function(a,b){for(var c=a.split(" "),d=0;c.length>d;d++)this.element.addEventListener(c[d],b,!1);
return this},off:function(a,b){for(var c=a.split(" "),d=0;c.length>d;d++)this.element.removeEventListener(c[d],b,!1);return this},trigger:function(a,b){var c=d.DOCUMENT.createEvent("Event");c.initEvent(a,!0,!0);c.gesture=b;var e=this.element;return d.utils.hasParent(b.target,e)&&(e=b.target),e.dispatchEvent(c),this},enable:function(a){return this.enabled=a,this}};var e=null,f=!1,j=!1;d.event={bindDom:function(a,b,c){for(var b=b.split(" "),d=0;b.length>d;d++)a.addEventListener(b[d],c,!1)},onTouch:function(a,
b,c){var n=this;this.bindDom(a,d.EVENT_TYPES[b],function(m){var o=m.type.toLowerCase();if(!o.match(/mouse/)||!j){(o.match(/touch/)||o.match(/pointerdown/)||o.match(/mouse/)&&1===m.which)&&(f=!0);o.match(/touch|pointer/)&&(j=!0);var z=0;f&&(d.HAS_POINTEREVENTS&&b!=d.EVENT_END?z=d.PointerEvent.updatePointer(b,m):o.match(/touch/)?z=m.touches.length:j||(z=o.match(/up/)?0:1),0<z&&b==d.EVENT_END?b=d.EVENT_MOVE:z||(b=d.EVENT_END),z||null===e?e=m:m=e,c.call(d.detection,n.collectEventData(a,b,m)),d.HAS_POINTEREVENTS&&
b==d.EVENT_END&&(z=d.PointerEvent.updatePointer(b,m)));z||(e=null,f=!1,j=!1,d.PointerEvent.reset())}})},determineEventTypes:function(){var a;a=d.HAS_POINTEREVENTS?d.PointerEvent.getEvents():d.NO_MOUSEEVENTS?["touchstart","touchmove","touchend touchcancel"]:["touchstart mousedown","touchmove mousemove","touchend touchcancel mouseup"];d.EVENT_TYPES[d.EVENT_START]=a[0];d.EVENT_TYPES[d.EVENT_MOVE]=a[1];d.EVENT_TYPES[d.EVENT_END]=a[2]},getTouchList:function(a){return d.HAS_POINTEREVENTS?d.PointerEvent.getTouchList():
a.touches?a.touches:[{identifier:1,pageX:a.pageX,pageY:a.pageY,target:a.target}]},collectEventData:function(a,b,c){var a=this.getTouchList(c,b),e=d.POINTER_TOUCH;return(c.type.match(/mouse/)||d.PointerEvent.matchType(d.POINTER_MOUSE,c))&&(e=d.POINTER_MOUSE),{center:d.utils.getCenter(a),timeStamp:(new Date).getTime(),target:c.target,touches:a,eventType:b,pointerType:e,srcEvent:c,preventDefault:function(){this.srcEvent.preventManipulation&&this.srcEvent.preventManipulation();this.srcEvent.preventDefault&&
this.srcEvent.preventDefault()},stopPropagation:function(){this.srcEvent.stopPropagation()},stopDetect:function(){return d.detection.stopDetect()}}}};d.PointerEvent={pointers:{},getTouchList:function(){var a=this,b=[];return Object.keys(a.pointers).sort().forEach(function(c){b.push(a.pointers[c])}),b},updatePointer:function(a,b){return a==d.EVENT_END?this.pointers={}:(b.identifier=b.pointerId,this.pointers[b.pointerId]=b),Object.keys(this.pointers).length},matchType:function(a,b){if(!b.pointerType)return!1;
var c={};return c[d.POINTER_MOUSE]=b.pointerType==b.MSPOINTER_TYPE_MOUSE||b.pointerType==d.POINTER_MOUSE,c[d.POINTER_TOUCH]=b.pointerType==b.MSPOINTER_TYPE_TOUCH||b.pointerType==d.POINTER_TOUCH,c[d.POINTER_PEN]=b.pointerType==b.MSPOINTER_TYPE_PEN||b.pointerType==d.POINTER_PEN,c[a]},getEvents:function(){return["pointerdown MSPointerDown","pointermove MSPointerMove","pointerup pointercancel MSPointerUp MSPointerCancel"]},reset:function(){this.pointers={}}};d.utils={extend:function(a,c,d){for(var e in c)a[e]!==
b&&d||(a[e]=c[e]);return a},hasParent:function(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1},getCenter:function(a){for(var b=[],c=[],d=0,e=a.length;e>d;d++)b.push(a[d].pageX),c.push(a[d].pageY);return{pageX:(Math.min.apply(Math,b)+Math.max.apply(Math,b))/2,pageY:(Math.min.apply(Math,c)+Math.max.apply(Math,c))/2}},getVelocity:function(a,b,c){return{x:Math.abs(b/a)||0,y:Math.abs(c/a)||0}},getAngle:function(a,b){return 180*Math.atan2(b.pageY-a.pageY,b.pageX-a.pageX)/Math.PI},getDirection:function(a,
b){var c=Math.abs(a.pageX-b.pageX),e=Math.abs(a.pageY-b.pageY);return c>=e?0<a.pageX-b.pageX?d.DIRECTION_LEFT:d.DIRECTION_RIGHT:0<a.pageY-b.pageY?d.DIRECTION_UP:d.DIRECTION_DOWN},getDistance:function(a,b){var c=b.pageX-a.pageX,d=b.pageY-a.pageY;return Math.sqrt(c*c+d*d)},getScale:function(a,b){return 2<=a.length&&2<=b.length?this.getDistance(b[0],b[1])/this.getDistance(a[0],a[1]):1},getRotation:function(a,b){return 2<=a.length&&2<=b.length?this.getAngle(b[1],b[0])-this.getAngle(a[1],a[0]):0},isVertical:function(a){return a==
d.DIRECTION_UP||a==d.DIRECTION_DOWN},stopDefaultBrowserBehavior:function(a,b){var c,d="webkit,khtml,moz,ms,o,".split(",");if(b&&a.style){for(var e=0;d.length>e;e++)for(var f in b)b.hasOwnProperty(f)&&(c=f,d[e]&&(c=d[e]+c.substring(0,1).toUpperCase()+c.substring(1)),a.style[c]=b[f]);"none"==b.userSelect&&(a.onselectstart=function(){return!1})}}};d.detection={gestures:[],current:null,previous:null,stopped:!1,startDetect:function(a,b){this.current||(this.stopped=!1,this.current={inst:a,startEvent:d.utils.extend({},
b),lastEvent:!1,name:""},this.detect(b))},detect:function(a){if(this.current&&!this.stopped){for(var a=this.extendEventData(a),b=this.current.inst.options,c=0,e=this.gestures.length;e>c;c++){var f=this.gestures[c];if(!this.stopped&&!1!==b[f.name]&&!1===f.handler.call(f,a,this.current.inst)){this.stopDetect();break}}return this.current&&(this.current.lastEvent=a),a.eventType==d.EVENT_END&&!a.touches.length-1&&this.stopDetect(),a}},stopDetect:function(){this.previous=d.utils.extend({},this.current);
this.current=null;this.stopped=!0},extendEventData:function(a){var b=this.current.startEvent;if(b&&(a.touches.length!=b.touches.length||a.touches===b.touches)){b.touches=[];for(var c=0,e=a.touches.length;e>c;c++)b.touches.push(d.utils.extend({},a.touches[c]))}var c=a.timeStamp-b.timeStamp,e=a.center.pageX-b.center.pageX,f=a.center.pageY-b.center.pageY,j=d.utils.getVelocity(c,e,f);return d.utils.extend(a,{deltaTime:c,deltaX:e,deltaY:f,velocityX:j.x,velocityY:j.y,distance:d.utils.getDistance(b.center,
a.center),angle:d.utils.getAngle(b.center,a.center),direction:d.utils.getDirection(b.center,a.center),scale:d.utils.getScale(b.touches,a.touches),rotation:d.utils.getRotation(b.touches,a.touches),startEvent:b}),a},register:function(a){var c=a.defaults||{};return c[a.name]===b&&(c[a.name]=!0),d.utils.extend(d.defaults,c,!0),a.index=a.index||1E3,this.gestures.push(a),this.gestures.sort(function(a,b){return a.index<b.index?-1:a.index>b.index?1:0}),this.gestures}};d.gestures=d.gestures||{};d.gestures.Hold=
{name:"hold",index:10,defaults:{hold_timeout:500,hold_threshold:1},timer:null,handler:function(a,b){switch(a.eventType){case d.EVENT_START:clearTimeout(this.timer);d.detection.current.name=this.name;this.timer=setTimeout(function(){"hold"==d.detection.current.name&&b.trigger("hold",a)},b.options.hold_timeout);break;case d.EVENT_MOVE:a.distance>b.options.hold_threshold&&clearTimeout(this.timer);break;case d.EVENT_END:clearTimeout(this.timer)}}};d.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(a,b){if(a.eventType==d.EVENT_END){var c=d.detection.previous,e=!1;a.deltaTime>b.options.tap_max_touchtime||a.distance>b.options.tap_max_distance||(c&&"tap"==c.name&&a.timeStamp-c.lastEvent.timeStamp<b.options.doubletap_interval&&a.distance<b.options.doubletap_distance&&(b.trigger("doubletap",a),e=!0),(!e||b.options.tap_always)&&(d.detection.current.name="tap",b.trigger(d.detection.current.name,a)))}}};
d.gestures.Swipe={name:"swipe",index:40,defaults:{swipe_max_touches:1,swipe_velocity:0.7},handler:function(a,b){a.eventType==d.EVENT_END&&!(0<b.options.swipe_max_touches&&a.touches.length>b.options.swipe_max_touches)&&(a.velocityX>b.options.swipe_velocity||a.velocityY>b.options.swipe_velocity)&&(b.trigger(this.name,a),b.trigger(this.name+a.direction,a))}};d.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(a,c){if(d.detection.current.name!=this.name&&this.triggered)return c.trigger(this.name+"end",a),this.triggered=!1,b;if(!(0<c.options.drag_max_touches&&a.touches.length>c.options.drag_max_touches))switch(a.eventType){case d.EVENT_START:this.triggered=!1;break;case d.EVENT_MOVE:if(a.distance<c.options.drag_min_distance&&d.detection.current.name!=this.name)break;d.detection.current.name=this.name;(d.detection.current.lastEvent.drag_locked_to_axis||
c.options.drag_lock_to_axis&&c.options.drag_lock_min_distance<=a.distance)&&(a.drag_locked_to_axis=!0);var e=d.detection.current.lastEvent.direction;a.drag_locked_to_axis&&e!==a.direction&&(a.direction=d.utils.isVertical(e)?0>a.deltaY?d.DIRECTION_UP:d.DIRECTION_DOWN:0>a.deltaX?d.DIRECTION_LEFT:d.DIRECTION_RIGHT);this.triggered||(c.trigger(this.name+"start",a),this.triggered=!0);c.trigger(this.name,a);c.trigger(this.name+a.direction,a);(c.options.drag_block_vertical&&d.utils.isVertical(a.direction)||
c.options.drag_block_horizontal&&!d.utils.isVertical(a.direction))&&a.preventDefault();break;case d.EVENT_END:this.triggered&&c.trigger(this.name+"end",a),this.triggered=!1}}};d.gestures.Transform={name:"transform",index:45,defaults:{transform_min_scale:0.01,transform_min_rotation:1,transform_always_block:!1},triggered:!1,handler:function(a,c){if(d.detection.current.name!=this.name&&this.triggered)return c.trigger(this.name+"end",a),this.triggered=!1,b;if(!(2>a.touches.length))switch(c.options.transform_always_block&&
a.preventDefault(),a.eventType){case d.EVENT_START:this.triggered=!1;break;case d.EVENT_MOVE:var e=Math.abs(1-a.scale),f=Math.abs(a.rotation);if(c.options.transform_min_scale>e&&c.options.transform_min_rotation>f)break;d.detection.current.name=this.name;this.triggered||(c.trigger(this.name+"start",a),this.triggered=!0);c.trigger(this.name,a);f>c.options.transform_min_rotation&&c.trigger("rotate",a);e>c.options.transform_min_scale&&(c.trigger("pinch",a),c.trigger("pinch"+(1>a.scale?"in":"out"),a));
break;case d.EVENT_END:this.triggered&&c.trigger(this.name+"end",a),this.triggered=!1}}};d.gestures.Touch={name:"touch",index:-1/0,defaults:{prevent_default:!1,prevent_mouseevents:!1},handler:function(a,c){return c.options.prevent_mouseevents&&a.pointerType==d.POINTER_MOUSE?(a.stopDetect(),b):(c.options.prevent_default&&a.preventDefault(),a.eventType==d.EVENT_START&&c.trigger(this.name,a),b)}};d.gestures.Release={name:"release",index:1/0,handler:function(a,b){a.eventType==d.EVENT_END&&b.trigger(this.name,
a)}};"object"==typeof module&&"object"==typeof module.exports?module.exports=d:(a.Hammer=d,"function"==typeof a.define&&a.define.amd&&a.define("hammer",[],function(){return d}))})(this);
(function(a,b){a!==b&&(Hammer.event.bindDom=function(c,d,e){a(c).on(d,function(a){var c=a.originalEvent||a;c.pageX===b&&(c.pageX=a.pageX,c.pageY=a.pageY);c.target||(c.target=a.target);c.which===b&&(c.which=c.button);c.preventDefault||(c.preventDefault=a.preventDefault);c.stopPropagation||(c.stopPropagation=a.stopPropagation);e.call(this,c)})},Hammer.Instance.prototype.on=function(b,d){return a(this.element).on(b,d)},Hammer.Instance.prototype.off=function(b,d){return a(this.element).off(b,d)},Hammer.Instance.prototype.trigger=
function(b,d){var e=a(this.element);return e.has(d.target).length&&(e=a(d.target)),e.trigger({type:b,gesture:d})},a.fn.hammer=function(b){return this.each(function(){var d=a(this),e=d.data("hammer");e?e&&b&&Hammer.utils.extend(e.options,b):d.data("hammer",new Hammer(this,b||{}))})})})(window.jQuery||window.Zepto);var VERSION_NAME="1.0.5",BUILD_DATE="20120711",isTouch=function(){return Hammer.HAS_TOUCHEVENTS&&navigator.userAgent.match(Hammer.MOBILE_REGEX)},BookType=function(){};BookType.normal_book=0;BookType.single_book=1;BookType.zoom_book=2;var normalBookStatu=function(){};normalBookStatu.book_statu_ready=0;normalBookStatu.book_statu_auto_flip=1;normalBookStatu.book_statu_mouse_flip=2;var singleBookStatu=function(){};singleBookStatu.book_statu_ready=0;singleBookStatu.book_statu_auto_flip=1;
singleBookStatu.book_statu_mouse_flip=2;var bookCorner=function(){};bookCorner.top_left=0;bookCorner.top_right=1;bookCorner.bottom_left=2;bookCorner.bottom_right=3;var PageEditor=function(){};PageEditor.AnnoType=function(){};PageEditor.AnnoType.ANNO_LINK="com.mobiano.flipbook.pageeditor.TAnnoLink";PageEditor.AnnoType.ANNO_YOUTUBE="com.mobiano.flipbook.pageeditor.TAnnoYouTube";PageEditor.AnnoType.ANNO_YOUTUBE1="com.mobiano.flipbook.pageeditor::TAnnoYoutubePlayer";
PageEditor.AnnoType.ANNO_YOUTUBE2="com.mobiano.flipbook.pageeditor.player::TAnnoYoutubePlayer02";PageEditor.AnnoType.ANNO_YOUTUBE3="com.mobiano.flipbook.pageeditor.player::TAnnoYoutubePlayer03";PageEditor.AnnoType.ANNO_YOUTUBE4="com.mobiano.flipbook.pageeditor.player::TAnnoYoutubePlayer04";PageEditor.AnnoType.ANNO_YOUTUBE5="com.mobiano.flipbook.pageeditor.player::TAnnoYoutubePlayer05";PageEditor.AnnoType.ANNO_VIDEO1="com.mobiano.flipbook.pageeditor::TAnnoVideoPlayer";
PageEditor.AnnoType.ANNO_VIDEO2="com.mobiano.flipbook.pageeditor.player::TAnnoSimpleVideoPlayer";PageEditor.AnnoType.ANNO_VIDEO3="com.mobiano.flipbook.pageeditor::TAnnoPlugIn";PageEditor.AnnoType.ANNO_AUDIO1="com.mobiano.flipbook.pageeditor::TAnnoAdvancedSound";PageEditor.AnnoType.ANNO_AUDIO2="com.mobiano.flipbook.pageeditor::TAnnoWavemusicPlayer";PageEditor.AnnoType.ANNO_AUDIO3="com.mobiano.flipbook.pageeditor::TAnnoPlugIn11";PageEditor.AnnoType.ANNO_AUDIO4="";PageEditor.AnnoType.ANNO_AUDIO5="";
PageEditor.AnnoType.ANNO_AUDIO6="";PageEditor.AnnoType.ANNO_AUDIO7="";PageEditor.AnnoType.ANNO_AUDIO8="";PageEditor.AnnoType.ANNO_AUDIO9="";PageEditor.AnnoType.ANNO_VIMEO="com.mobiano.flipbook.pageeditor.vimeoPlayer::TAnnoVimeoPlayer";PageEditor.AnnoType.ANNO_VIMEO1="com.mobiano.flipbook.pageeditor.vimeoPlayer::TAnnoVimeoPopUpPlayer";PageEditor.AnnoType.ANNO_VIDEO="com.mobiano.flipbook.pageeditor.TAnnoMovie";PageEditor.AnnoType.ANNO_AUDIO="com.mobiano.flipbook.pageeditor.TAnnoSound";
PageEditor.AnnoType.ANNO_IMAGE="com.mobiano.flipbook.pageeditor.TAnnoImage";PageEditor.AnnoType.ANNO_BUTTON="com.mobiano.flipbook.pageeditor.TAnnoButton";PageEditor.AnnoType.ANNO_LINE="com.mobiano.flipbook.pageeditor.shapes::TAnnoLine";PageEditor.AnnoType.ANNO_ARROW="com.mobiano.flipbook.pageeditor.shapes::TAnnoArrow";PageEditor.AnnoType.ANNO_ROUND="com.mobiano.flipbook.pageeditor.shapes::TAnnoEllipse";PageEditor.AnnoType.ANNO_RECTANGLE="com.mobiano.flipbook.pageeditor.shapes::TAnnoRectangle";
PageEditor.AnnoType.ANNO_TEXT="com.mobiano.flipbook.pageeditor::TAnnoText";PageEditor.AnnoType.ANNO_AREA="com.mobiano.flipbook.pageeditor::TAnnoHighLightArea";PageEditor.AnnoType.ANNO_FLASHSHOW="com.mobiano.flipbook.pageeditor.TAnnoEmbeddedSlideshow";PageEditor.AnnoType.ANNO_ATEXT="com.mobiano.flipbook.pageeditor::TAnnoDynamicText";PageEditor.AnnoType.ANNO_STARTEXT="com.mobiano.flipbook.pageeditor::TAnnoStarwarsText";PageEditor.AnnoType.ANNO_TEXTANIM="com.mobiano.flipbook.pageeditor.textAnim::TAnnoTextAnim";
PageEditor.AnnoType.ANNO_ATIMAGE="com.mobiano.flipbook.pageeditor.TAnnoClipart";PageEditor.AnnoType.ANNO_EFFECTTEXT="com.mobiano.flipbook.pageeditor.TAnnoEffectText";PageEditor.AnnoType.ANNO_CALLOUT="com.mobiano.flipbook.pageeditor.shapes::TAnnoCallout";PageEditor.AnnoType.ANNO_ADVANCEDSOUND="com.mobiano.flipbook.pageeditor::TAnnoAdvancedSound";PageEditor.PlayEvt=function(){};PageEditor.PlayEvt.EVT_PLAY="EVT_PageViewed";PageEditor.PlayEvt.EVT_STOP="EVT_PageOffView";PageEditor.TriggerEventType=function(){};
PageEditor.TriggerEventType.MouseDown="mouseDown";PageEditor.TriggerEventType.MouseOver="mouseOver";PageEditor.TriggerEventType.MouseOut="mouseOut";PageEditor.TriggerEventType.MouseUp="mouseUp";PageEditor.TriggerEventType.MouseMove="mouseMove";PageEditor.ActionType=function(){};PageEditor.ActionType.GOTO_PAGE="com.mobiano.flipbook.pageeditor.TAnnoActionGotoPage";PageEditor.ActionType.OPEN_URL="com.mobiano.flipbook.pageeditor.TAnnoActionOpenURL";PageEditor.ActionType.OPEN_WINDOW="com.mobiano.flipbook.pageeditor.TAnnoActionOpenWindow";
PageEditor.ActionType.SLIDE_SHOW="com.mobiano.flipbook.pageeditor.TAnnoActionPhotoSlide";PageEditor.ActionType.ACTION_JS="com.mobiano.flipbook.pageeditor.TAnnoActionJavascript";PageEditor.ActionType.PLAY_AUDIO="com.mobiano.flipbook.pageeditor.TAnnoActionPlayAudio";PageEditor.ActionType.PLAY_VIDEO="com.mobiano.flipbook.pageeditor.TAnnoActionPlayVideo";var _event;_event=isTouch()?{_down:"touchstart",_move:"touchmove",_end:"touchend"}:{_down:"mousedown",_move:"mousemove",_end:"mouseup"};
var bookEvent=function(){};bookEvent.onCurrentPageIndexChanged="BE_PIC";bookEvent.onCurrentPageIndexWillChange="BE_PIWC";bookEvent.onNoNextPage="BE_NNP";bookEvent.onNoPreviousPage="BE_NPP";$.fn.zoom=function(a,b,c,d,e){try{if(null==this||void 0==this)return;var f=Math.sqrt(Math.pow(b.x-a.x,2)+Math.pow(b.y-a.y,2)),j=Math.sqrt(Math.pow(d.x-c.x,2)+Math.pow(d.y-c.y,2)),g=e.width+2*(j-f);this.css({width:g+"px",height:g*e.height/e.width+"px"})}catch(k){return!1}return!0};(function(a){var b=function(b,d,e,f,j){j=a.extend({background:"green",cornersTop:!0,scale:"noresize"},j);b.prev();var g=0,k=!1,l=j.background,n=j.cornersTop,m=j.gradientColors||["#ddd","#eee","#fff"],o=j.scale,z=[],q=b.clone(),B=a.browser.msie?null:q[0].getContext("2d"),b=a.browser.msie?a(G_vmlCanvasManager.initElement(b[0])):b,A=b[0].getContext("2d"),I=0,f=f.each(function(b){if(!z[b]){var c=this;c.onload=function(){var g=1;if("noresize"!=o){var j=d/this.width,l=e/this.height;"fit"==o&&(g=1>j||1>
l?Math.min(j,l):1);"fill"==o&&(g=Math.min(j,l))}a(c).data("flip.scale",g);z[b]=A.createPattern(c,"no-repeat");I++;I==f.length&&!k&&(k=!0,R())};c.complete&&window.setTimeout(function(){c.onload()},10)}}).get(),w=d,s=e,u=a.browser.msie?b.offset():null,t,L,N,M;a.browser.msie&&function(){var f=a("<div>").width(d).height(e).css({position:"absolute",cursor:"default",zIndex:1}).appendTo(tmpContainer);7==parseInt(a.browser.version)&&f.css({opacity:1.0E-6,background:"#FFF"});var g=function(){u=b.offset();
return f.css({left:u.left+"px",top:u.top+"px"})};a(window).resize(g);return g()}();setInterval(function(){window.clearInterval(t);L=(new Date).getTime();N=w;M=s/50;t=window.setInterval(T,0);g+=1;0>g&&(g=f.length-1);g==f.length&&(g=0)},3E3);var T=function(){var a=(new Date).getTime()-L;700<=a?(window.clearInterval(t),f.push(f.shift()),z.push(z.shift()),w=d,s=e):(w=N-2*d*a/700,s=M+2*e*a/700/3);R()},v=function(b,c){var f=b*d+c,g=-c/b;a.browser.msie&&(f=Math.round(f),g=Math.round(g));A.beginPath();A.moveTo(d,
Math.min(f,e));A.lineTo(d,0);A.lineTo(Math.max(g,0),0);0>g?(A.lineTo(0,Math.min(c,e)),c<e&&A.lineTo((e-c)/b,e),A.lineTo(d,e)):f<e?A.lineTo(d,f):(A.lineTo((e-c)/b,e),A.lineTo(d,e))},R=function(){if(k){a.browser.msie&&A.clearRect(0,0,d,e);A.fillStyle=l;A.fillRect(0,0,d,e);var b=f[0],c=a(b).data("flip.scale");a.browser.msie?(A.fillStyle=z[0],A.fillStyle.width2=A.fillStyle.width*c,A.fillStyle.height2=A.fillStyle.height*c,A.fillRect(0,0,d,e)):A.drawImage(b,(d-b.width*c)/2,(e-b.height*c)/2,b.width*c,b.height*
c);if(s&&w!=d&&(b=(s-2*(w+d))/2,m2=s/(d-w),q2=w*m2,2!=m2)){var g=1,j=0;A.save();n||(j=e,g=-1);A.translate(0,j);A.scale(1,g);var o=(q2-b)/(2-m2),t=2*o+b,C=(2*t+o+4*w-2*s)/5,p=-C/2+t+o/2,c=Math.sqrt(Math.pow(o-C,2)+Math.pow(t-p,2)),D=Math.min(0.5*c,30),u;a.browser.mozilla&&1.9>parseFloat(a.browser.version)?(u=B,u.clearRect(0,0,d,e),u.save(),u.translate(1,0)):u=A;o=u.createLinearGradient(o,t,C,p);o.addColorStop(0,m[0]);o.addColorStop(D/c,m[1]);o.addColorStop(1,m[2]);u.fillStyle=o;u.beginPath();u.moveTo(-b/
2,0);u.quadraticCurveTo((-b/2+w)/2+0.02*w,s/2,w,s);u.quadraticCurveTo((d+w)/2,(2*d+b+s)/2-0.02*(e-s),d,2*d+b);a.browser.mozilla&&1.9>parseFloat(a.browser.version)?(u.save(),u.clip(),u.fillRect(0,0,d,e),u.restore(),A.drawImage(q[0],0,0),u.restore()):u.fill();A.fillStyle=l;v(2,b);A.fill();v(2,b);!a.browser.safari&&!a.browser.opera&&A.restore();b=f[1];c=a(b).data("flip.scale");if(a.browser.msie)A.fillStyle=z[1],A.fillStyle.width2=A.fillStyle.width*c,A.fillStyle.height2=A.fillStyle.height*c,A.fill();
else{A.save();A.clip();if(a.browser.safari||a.browser.opera)A.scale(1,1/g),A.translate(-0.0,-j);A.drawImage(b,(d-b.width*c)/2,(e-b.height*c)/2,b.width*c,b.height*c);A.restore();(a.browser.safari||a.browser.opera)&&A.restore()}}}}};a.fn.jFlip=function(c,d,e,f,j){return this.each(function(){a(this).wrap("<div class='bannerdiv' style='position: absolute;width:"+c+"px;height:"+d+"px;top:"+j+"px;left:"+f+"px'>");var g=a(this).find("img"),k=a(document.createElement("canvas")).attr({width:c,height:d}).css({margin:0,
width:c+"px",height:d+"px"});a(this).css({position:"absolute",left:"-9000px",top:"-9000px",display:"none"}).after(k);new b(a(this).next(),c||300,d||300,g,e)})}})(jQuery);colorTo0x=function(a){"string"!=typeof a&&(a=""+a);var b=a;"#"!=a.substr(0,1)&&"0x"!=a.substr(0,2)&&(b=parseInt(a).toString(16),b="#"+"000000".substr(0,6-b.length)+b);"0x"==a.substr(0,2)&&(b=a.replace("0x","#"));return b};var Point=function(a,b){return{x:a,y:b}};function debug(a){window.console&&window.console.log&&window.console.log(a)}
function colorSplit(a){"string"!=typeof a&&(a=""+a);var b={r:0,g:0,b:0},c="FF",d="FF",e="FF";7==a.length?(c=a.substr(1,2),d=a.substr(3,2),e=a.substr(5,2)):4==a.length&&(c=a.substr(1,1),d=a.substr(2,1),e=a.substr(3,1),c+=c,d+=d,e+=e);b.r=parseInt(c,16);b.g=parseInt(d,16);b.b=parseInt(e,16);return b}
function colorAdd(a,b){"string"!=typeof a&&(a=""+a);var c=colorSplit(a);c.r=Math.min(c.r+b,255).toString(16);c.g=Math.min(c.g+b,255).toString(16);c.b=Math.min(c.b+b,255).toString(16);c.r=1>=c.r.length?"0"+c.r:c.r;c.g=1>=c.g.length?"0"+c.g:c.g;c.b=1>=c.b.length?"0"+c.b:c.b;return"#"+c.r+c.g+c.b}
function colorDiv(a,b){"string"!=typeof a&&(a=""+a);var c=colorSplit(a);c.r=Math.max(c.r-b,0).toString(16);c.g=Math.max(c.g-b,0).toString(16);c.b=Math.max(c.b-b,0).toString(16);c.r=1>=c.r.length?"0"+c.r:c.r;c.g=1>=c.g.length?"0"+c.g:c.g;c.b=1>=c.b.length?"0"+c.b:c.b;return"#"+c.r+c.g+c.b}
$.fn.setGradient=function(a,b){"string"!=typeof a&&(a=""+a);var c=colorAdd(a,30),d=colorDiv(a,30);void 0==b&&(b=!1);var e="",f="0";b&&(e="left,",f="1");this.css({background:"linear-gradient("+e+c+", "+d+")"});switch(browserType){case 1:this.css({background:"-webkit-linear-gradient("+e+c+", "+d+")"});break;case 2:this.css({background:"-moz-linear-gradient("+e+c+", "+d+")"});break;case 3:this.css({background:"-ms-linear-gradient("+e+c+", "+d+")"});this.css("filter","progid:DXImageTransform.Microsoft.Gradient(GradientType="+
f+", EndColorStr="+d+", StartColorStr="+c+")");break;case 4:this.css({background:"-o-linear-gradient("+e+c+", "+d+")"})}};$.fn.addBorderShadow=function(a,b,c){"string"!=typeof a&&(a=""+a);var d=a;b&&(d=colorDiv(a,30));a="5px";c&&(a="-5px");this.css({"-moz-box-shadow":"0px "+a+" 5px "+d,"box-shadow":"0px "+a+" 5px "+d,"-webkit-box-shadow":"0px "+a+" 5px "+d})};
$.fn.changeButtonColor=function(a){"string"!=typeof a&&(a=""+a);var b=this.find("img:first"),c=$("<canvas></canvas>")[0],d=c.getContext("2d"),e=b.width(),f=b.height(),b=b[0];c.width=e;c.height=f;d.drawImage(b,0,0,b.naturalWidth,b.naturalHeight,0,0,e,f);var j=d.getImageData(0,0,e,f),e=d.getImageData(0,0,e,f);if(j){for(var a=colorSplit(a),f=0,g=j.data.length;f<g;f+=4)0<e.data[f+3]&&(e.data[f]=j.data[f]/255*a.r,e.data[f+1]=j.data[f+1]/255*a.g,e.data[f+2]=j.data[f+2]/255*a.b);d.putImageData(e,0,0);b.src=
c.toDataURL("image/png")}};$.fn.rotate=function(a){if(!(4<browserType&&1>browserType))switch(browserType){case 1:this.css({"-webkit-transform":"rotate("+a+"deg)"});break;case 2:this.css({"-moz-transform":"rotate("+a+"deg)"});break;case 3:this.css({"-ms-transform":"rotate("+a+"deg)"});break;case 4:this.css({"-0-transform":"rotate("+a+"deg)"})}};Array.indexOf||(Array.prototype.indexOf=function(a){for(var b=0;b<this.length;b++)if(this[b]==a)return b;return-1});
var base64EncodeChars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",base64DecodeChars=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1];
function base64encode(a){var b,c,d,e,f,j;d=a.length;c=0;for(b="";c<d;){e=a.charCodeAt(c++)&255;if(c==d){b=b+base64EncodeChars.charAt(e>>2);b=b+base64EncodeChars.charAt((e&3)<<4);b=b+"==";break}f=a.charCodeAt(c++);if(c==d){b=b+base64EncodeChars.charAt(e>>2);b=b+base64EncodeChars.charAt((e&3)<<4|(f&240)>>4);b=b+base64EncodeChars.charAt((f&15)<<2);b=b+"=";break}j=a.charCodeAt(c++);b=b+base64EncodeChars.charAt(e>>2);b=b+base64EncodeChars.charAt((e&3)<<4|(f&240)>>4);b=b+base64EncodeChars.charAt((f&15)<<
2|(j&192)>>6);b=b+base64EncodeChars.charAt(j&63)}return b}
function base64decode(a){var b,c,d,e,f;e=a.length;d=0;for(f="";d<e;){do b=base64DecodeChars[a.charCodeAt(d++)&255];while(d<e&&b==-1);if(b==-1)break;do c=base64DecodeChars[a.charCodeAt(d++)&255];while(d<e&&c==-1);if(c==-1)break;f=f+String.fromCharCode(b<<2|(c&48)>>4);do{b=a.charCodeAt(d++)&255;if(b==61)return f;b=base64DecodeChars[b]}while(d<e&&b==-1);if(b==-1)break;f=f+String.fromCharCode((c&15)<<4|(b&60)>>2);do{c=a.charCodeAt(d++)&255;if(c==61)return f;c=base64DecodeChars[c]}while(d<e&&c==-1);if(c==
-1)break;f=f+String.fromCharCode((b&3)<<6|c)}return f}
var Utf8={encode:function(a){for(var a=a.replace(/\r\n/g,"\n"),b="",c=0;c<a.length;c++){var d=a.charCodeAt(c);if(d<128)b=b+String.fromCharCode(d);else{if(d>127&&d<2048)b=b+String.fromCharCode(d>>6|192);else{b=b+String.fromCharCode(d>>12|224);b=b+String.fromCharCode(d>>6&63|128)}b=b+String.fromCharCode(d&63|128)}}return b},decode:function(a){a instanceof Array&&(a=a[0]);for(var b="",c=0,d=c1=c2=0;c<a.length;){d=a.charCodeAt(c);if(d<128){b=b+String.fromCharCode(d);c++}else if(d>191&&d<224){c2=a.charCodeAt(c+
1);b=b+String.fromCharCode((d&31)<<6|c2&63);c=c+2}else{c2=a.charCodeAt(c+1);c3=a.charCodeAt(c+2);b=b+String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63);c=c+3}}return b}};function audioPlayer(a){this.audio=document.createElement("audio");tmpContainer.append(this.audio);this.audio.src=a;var b=this;this.audio.addEventListener("ended",function(){b.audio.currentTime=0},!1)}audioPlayer.prototype.play=function(){null!=this.audio&&this.audio.play()};audioPlayer.prototype.rePlay=function(){null!=this.audio&&(0!=this.audio.currentTime&&(this.audio.currentTime=this.audio.startTime),this.audio.play())};audioPlayer.prototype.preload=function(){this.audio.preload};
audioPlayer.prototype.loop=function(){this.audio.loop};audioPlayer.prototype.autoPlay=function(){this.audio.autoplay};audioPlayer.prototype.src=function(a){this.audio.src=a};audioPlayer.prototype.control=function(){this.audio.controls};function loadingBook(a,b){this.width=700;this.height=460;this.bg=$("<div></div>");this.loadingBox=$("<div></div>");this.firstImg=$("<img />");this.titleLabel=new label(window.document.title,this.loadingBox);this.loadingImage=$("<img src='"+uiBaseURL+"progress.gif' style='position:absolute;' />");this.bg.css({"background-color":"#474747",width:window.innerWidth+"px",height:window.innerHeight+"px"});isTouch&&(this.width=window.innerWidth,this.height=window.innerHeight);this.loadingImage.css({left:(this.width-
32)/2+"px",top:this.height-80+"px"});b||(b="#805080");this.loadingBox.css({width:this.width+"px",height:this.height+"px","-webkit-border-radius":"9px","-moz-border-radius":"9px","-ms-border-radius":"9px","-o-border-radius":"9px","border-radius":"9px","-webkit-box-shadow":"0 0 10px rgba(40, 0, 0, 0.8)","-moz-box-shadow":"0 0 10px rgba(40, 0, 0, 0.8)","-o-box-shadow":"0 0 10px rgba(40, 0, 0, 0.8)","box-shadow":"0 0 10px rgba(40, 0, 0, 0.8)",position:"absolute",left:(window.innerWidth-this.width)/2+
"px",top:(window.innerHeight-this.height)/2+"px","background-color":b});var c=150;300>window.innerWidth&&(c=(window.innerWidth-10)/2);this.firstImg.attr({src:getPageDir(1,"thumb")});this.firstImg.css({"-webkit-box-shadow":"0 0 5px rgba(40, 0, 0, 0.6)","-moz-box-shadow":"0 0 5px rgba(40, 0, 0, 0.6)","-o-box-shadow":"0 0 5px rgba(40, 0, 0, 0.6)","box-shadow":"0 0 5px rgba(40, 0, 0, 0.6)",position:"absolute",width:c+"px",top:this.height/2-100+"px",left:this.width/2-(c+5)+"px","backgroud-color":"#888888"});
this.titleLabel.setLabelPosition(this.width/2+10,this.height/2-80);this.titleLabel.setFont(18,"#FFFFFF","Tahoma");a.append(this.bg);this.bg.append(this.loadingBox);this.loadingBox.append(this.firstImg);this.loadingBox.append(this.titleLabel);this.loadingBox.append(this.loadingImage)}loadingBook.prototype.hide=function(){this.bg.remove()};function initAudio(a,b,c,d){this.config=$.extend({width:80,height:30,x:20,y:20,src:null,alpha:1},b);this.audio=null;null!=this.config.src&&(this.pw=c,this.ph=d,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,"String"!=typeof this.config.src&&(this.config.src=""+this.config.src),"./"==this.config.src.substr(0,2)&&(this.config.src="."+this.config.src),this.audio=$("<audio src='"+this.config.src+"' style='width: "+
this.width+"px; height: "+this.height+"px; left: "+this.x+"px; top: "+this.y+"px; position: absolute; opacity: "+this.config.alpha+"' controls ></audio>"),a.append(this.audio))}initAudio.prototype.onResize=function(a,b){this.pw=a;this.ph=b;this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.audio.css({width:this.width+"px",height:this.height+"px"});this.setPosition()};
initAudio.prototype.setPosition=function(){this.x=this.config.x*this.pw;this.y=this.config.y*this.ph;this.audio.css({left:this.x+"px",top:this.y+"px"})};initAudio.prototype.play=function(){null!=this.audio&&this.audio[0].play()};initAudio.prototype.pause=function(){null!=this.audio&&this.audio[0].pause()};initAudio.prototype.stop=function(){null!=this.audio&&this.audio[0].stop()};initAudio.prototype.getPlayEvt=function(){return this.config.soundPlayTriggerEvt};initAudio.prototype.getStopEvt=function(){return this.config.soundStopTriggerEvt};function initYoutube(a,b,c,d){this.config=$.extend({width:400,height:300,x:0.02,y:0.02,alpha:1,id:null},b);this.youtubeFrame=null;null!=this.config.id&&(this.father=a,this.pw=c,this.ph=d,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+"?"+this.config.playerParameters+
"' frameborder='0' style='position: absolute; opacity: "+this.config.alpha+"; left:"+this.x+"px; top:"+this.y+"px;z-index:1;'></iframe>"))}initYoutube.prototype.onResize=function(a,b){this.pw=a;this.ph=b;this.youtubeFrame.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)};initYoutube.prototype.setPosition=function(a,b){this.youtubeFrame.css({top:b+"px",left:a+"px"})};initYoutube.prototype.getPlayEvt=function(){return this.config.moviePlayTriggerEvt};
initYoutube.prototype.getStopEvt=function(){return this.config.movieStopTriggerEvt};initYoutube.prototype.hide=function(){this.youtubeFrame.remove()};initYoutube.prototype.show=function(){this.father.append(this.youtubeFrame)};function initVimeo(a,b,c,d){this.config=$.extend({width:0.2,height:0.2,x:0.2,y:0.2,id:null},b);null==this.config.id||""==this.config.id||(this.pw=c,this.ph=d,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.vimeo=$("<iframe id='player' src='http://player.vimeo.com/video/"+this.config.id+"?api=1&amp;width="+this.width+" height="+this.height+" frameborder='0' webkitallowfullscreen allowfullscreen></iframe>"),a.append(this.vimeo),
this.vimeo.css({width:this.width+"px",height:this.height+"px",left:this.x+"px",top:this.y+"px",position:"absolute"}))}initVimeo.prototype.onResize=function(a,b){this.pw=a;this.ph=b;this.width=this.pw*this.config.width;this.height=this.ph*this.config.height;this.x=this.pw*this.config.x;this.y=this.ph*this.config.y;this.vimeo.css({width:this.width+"px",height:this.height+"px",left:this.x+"px",top:this.y+"px"})};
function initVimeo1(a,b,c,d){this.pw=c;this.ph=d;this.config=$.extend({backgroundColor:"#666666"},b);this.width=b.location.width*c;this.height=b.location.height*d;this.bg=$("<div></div>");a.append(this.bg);this.img=$("<img />");this.bg.css({position:"absolute",width:this.width+"px",height:this.height+"px",left:b.location.x*c+"px",top:b.location.y*d+"px",background:this.config.backgroundColor,opacity:this.config.alpha});b.shadow.hasDropShadow&&this.bg.drawShadow(b.shadow.shadowBlurX+"px",b.shadow.shadowBlurY+
"px",b.shadow.shadowDistance+"px",colorTo0x(b.shadow.shadowColor));if(this.config.url){var e=this;this.img.attr("src","./"==this.config.url.substr(0,2)?"."+this.config.url:this.config.url);this.img.load(function(){var a=getPageWidthHeight(e.width,e.height,this.width,this.height);e.img.css({position:"absolute",width:a.x+"px",height:a.y+"px",left:(e.width-a.x)/2+"px",top:(e.height-a.y)/2+"px"});e.bg.append(e.img)})}this.initEvent()}
initVimeo1.prototype.onResize=function(a,b){this.pw=a;this.ph=b;this.width=this.config.location.width*a;this.height=this.config.location.height*b;this.bg.css({width:this.width+"px",height:this.height+"px",left:this.config.location.x*a+"px",top:this.config.location.y*b+"px"});var c=getPageWidthHeight(this.width,this.height,this.img.width(),this.img.height());this.img.css({width:c.x+"px",height:c.y+"px",left:(this.width-c.x)/2+"px",top:(this.height-c.y)/2+"px"})};
initVimeo1.prototype.initEvent=function(){var a=this;this.bg.bind(_event._down,function(){videoForm1.init("vimeo",{id:a.config.videoID})})};function initVideo(a,b,c,d){this.config=$.extend({width:0.6,height:0.5,x:0.2,y:0.2,src:null,alpha:1},b);this.video=null;null==this.config.src&&".mp4"!=this.config.src.substr(this.config.src.length-4,4)||(this.pw=c,this.ph=d,this.width=this.config.width*this.pw,this.height=this.config.height*this.ph,this.x=this.config.x*this.pw,this.y=this.config.y*this.ph,isFlipPdf&&(this.config.src="../"+this.config.src),this.video=$("<video src='"+this.config.src+"' style='width: "+this.width+"px; height:"+this.height+
"px; left: "+this.x+"px; top: "+this.y+"px; position:absolute; opacity: "+this.config.alpha+";' controls='controls' loop='loop'></video>"),a.append(this.video))}initVideo.prototype.onResize=function(a,b){null!=this.video&&(this.pw=a,this.ph=b,this.width=this.config.width*this.pw,this.height=this.config.height*this.ph,this.video.css({width:this.width+"px",height:this.height+"px"}),this.setPosition())};
initVideo.prototype.setPosition=function(){null!=this.video&&(this.x=this.pw*this.config.x,this.y=this.ph*this.config.y,this.video.css({left:this.x+"px",top:this.y+"px"}))};initVideo.prototype.playVideo=function(){null!=this.video&&this.video[0].play()};initVideo.prototype.stopVideo=function(){null!=this.video&&this.video[0].stop()};initVideo.prototype.pauseVideo=function(){null!=this.video&&this.video[0].pause()};initVideo.prototype.getPlayEvt=function(){return this.config.moviePlayTriggerEvt};
initVideo.prototype.getStopEvt=function(){return this.config.soundStopTriggerEvt};function initEffText(a,b,c,d){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},b);this.pw=c;this.ph=d;this.color=colorTo0x(this.config.color);"#0"==this.color&&(this.color="#000");this.father=a;this.speed=this.pos=0;this.speed="ChangeSpeed"==this.config.moveSpeed?250:50;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.efftext=$("<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>");this.efftext2=$("<div id="+this.scrollid+" style='word-break: break-word; width:"+this.width+"px;'></div>");"false"!=this.config.sh&&this.efftext.drawShadow(this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+colorTo0x(this.config.sr));this.father=a;this.initEvent();
a.append(this.efftext);this.efftext.append(this.efftext2);this.setTextSize()}initEffText.prototype.initeffAmin=function(){var a=this,b,c=a.config.textStr;this.efftext2.html(c.substring(0,a.pos));a.pos++==c.length?(a.pos=0,clearTimeout(b)):b=setTimeout(function(){a.initeffAmin()},a.speed)};
initEffText.prototype.initeffAmin1=function(){var a=this,b={scale:2};$(b).animate({scale:1},{duration:300,step:function(){var c="scale("+b.scale+")";a.efftext2.css({"-webkit-transform-origin":"100% 0%","-moz-transform-origin":"100% 0%","-ms-transform-origin":"100% 0%","-o-transform-origin":"100% 0%","transform-origin":"100% 0%","-webkit-transform":c,"-moz-transform":c,"-ms-transform":c,"-o-transform":c,transform:c})}})};
initEffText.prototype.setTextSize=function(){var a=$(this.config.textStr),b=a.find("p"),c=this;$.each(b,function(){var a=$(this).find("font");$(this).css({"word-break":"break-all",margin:"2px"});$.each(a,function(){var a=this.getAttribute("SIZE");if(!a)for(var b=this;b.parentNode;)if(b=b.parentNode,b.getAttribute("SIZE")){a=b.getAttribute("SIZE");break}this.style.fontSize=(a?a:16)*c.ph/c.config.pageH+"px"})});this.efftext2.empty().append(a)};
initEffText.prototype.initEvent=function(){var a=this;this.flag=0;this.linkURL=null;if(null!=a.config.action){try{void 0!=this.config.action.length&&(this.config.action=this.config.action[0]),this.linkURL=this.config.action.url}catch(b){}var c;null!=this.linkURL&&"http"!=this.linkURL.substr(0,4).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{c=this.config.action.triggerEventType}catch(d){c=null}this.efftext.bind(_event._down,function(){c==PageEditor.TriggerEventType.MouseDown&&actionEvent.call(a);
browserType==3?event.cancelBubble=true:event.stopPropagation()});this.efftext.bind("mouseover",function(){c==PageEditor.TriggerEventType.MouseOver&&actionEvent.call(a)});this.efftext.bind(isTouch?_event._end:"mouseout",function(){c==PageEditor.TriggerEventType.MouseOut&&actionEvent.call(a)})}};
initEffText.prototype.onResize=function(a,b){this.pw=a;this.ph=b;this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.efftext.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());this.setTextSize()};
initEffText.prototype.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"})};
initEffText.prototype.initeffAmin1error=function(){document.getElementById("testc");for(var a=$(aaa),b=$(aaa),c=a.find("p"),d=0,e=0,f=0,j=c[0],g=$(j).find("font")[0],a=b.find("p"),d=0;d<a.length;d++)for(var k=$(a[d]).find("font"),l=0;l<k.length;l++)$(k[l]).text("");$("#testc").append(b);var n=function(a){if(a>=c.length)clearInterval(z);else return j=c[a]},m=function(a,b){b=$(b).find("font");if(a>b.length){console.log("cccccc: "+a+",,l: "+b.length);e=0;d+=1;var c=n(d);if(c)return g=m(e,c)}else return g=
b[a]},o=function(a,b){b=$(b).text();if(a>b.length){f=0;e+=1;var c=m(e,n(d));return c?void 0:o(f,c)}return b.charAt(a)},z=setInterval(function(){o(f,g);var a=b.find("p");$(a).find("font");console.log(a.length);f+=1;clearInterval(z)},1E3)};function initAminText(a,b,c,d,e){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},b);this.pw=c;this.ph=d;this.color=colorTo0x(this.config.color);this.father=a;this.pos=0;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="amintext"+e;this.scrollid=
"animscroll"+this.id;this.amintext=$("<div style='position:absolute;left:"+this.x+"px; top:"+this.y+"px;height:"+this.height+"px;width:"+this.width+"px;opacity:"+this.config.alpha+"'></div>");this.amintext2=$("<div style='word-break: break-word;width:100%;text-align:"+this.config.align+";'></div>");"false"!=this.config.sh&&this.amintext.drawShadow(this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+colorTo0x(this.config.sr));this.father=a;this.initEvent();a.append(this.amintext);this.amintext.append(this.amintext2);
this.setTextSize();switch(this.config.effectType){case "Default":this.initAmin1();break;case "Letter Spacing":this.initAmin1();break;case "Scale Word":this.initAmin1();break;case "Right To Left":this.RightText1(-this.amintext2.width(),0);break;case "Center To Edges":this.initAmin1();break;default:this.initAmin1()}}
initAminText.prototype.setTextSize=function(){var a=$(this.config.textStr),b=a.find("p"),c=this;$.each(b,function(){var a=$(this).find("font");$(this).css({"word-break":"break-all",margin:"2px"});$.each(a,function(){var a=this.getAttribute("SIZE");if(!a)for(var b=this;b.parentNode;)if(b=b.parentNode,b.getAttribute("SIZE")){a=b.getAttribute("SIZE");break}this.style.fontSize=(a?a:16)*c.ph/c.config.pageH+"px"})});this.amintext2.empty().append(a)};
initAminText.prototype.initAmin1=function(){var a=this,b={scale:2};$(b).animate({scale:1},{duration:1E3,step:function(){var c="scale("+b.scale+")";a.amintext2.css({"-webkit-transform-origin":"100% 0%","-moz-transform-origin":"100% 0%","-ms-transform-origin":"100% 0%","-o-transform-origin":"100% 0%","transform-origin":"100% 0%","-webkit-transform":c,"-moz-transform":c,"-ms-transform":c,"-o-transform":c,transform:c})}})};
initAminText.prototype.RightText1=function(a,b){var c=this,d={x:a,y:b};$(d).animate({x:0,y:0},{duration:1E3,step:function(){var a=translate(d.x,d.y);c.efftext2.css({"-webkit-transform-origin":"100% 0%","-moz-transform-origin":"100% 0%","-ms-transform-origin":"100% 0%","-o-transform-origin":"100% 0%","transform-origin":"100% 0%","-webkit-transform":a,"-moz-transform":a,"-ms-transform":a,"-o-transform":a,transform:a})}})};
initAminText.prototype.initAmin=function(){var a=this,b,c=a.config.textStr;this.amintext2.html(c.substring(0,a.pos)+"I");a.pos++==c.length?(a.pos=0,clearTimeout(b)):b=setTimeout(function(){a.initAmin()},50)};
initAminText.prototype.RightText=function(a,b,c,d,e,f,j,g){var k=this,l=tmp1="";if(b<=a.length){if("<"==a.charAt(b)){for(;">"!=a.charAt(b);)b++;b++}if("&"==a.charAt(b)&&" "!=a.charAt(b+1)){for(;";"!=a.charAt(b);)b++;b++}l=a.slice(0,b);tmp1=a.charAt(b++);c.html("<span class="+d+" style='text-align:center;'><font color='"+e+"'>"+l+"</font><font color='"+f+"'>"+tmp1+"</font></span>");setTimeout(function(){k.RightText(a,b,c,d,e,f,j,g)},j)}};
initAminText.prototype.litterText=function(a){for(var b="",c=a.length,d=0;d<c;d++)b+="<span id='"+(this.scrollid+"d"+d)+"' style='position: relative;left:0;top:0; display:none;top:-30px;'>"+a.charAt(d)+"</span>";idTObject.html(b);this.ScrollText(0,c-1)};initAminText.prototype.ScrollText=function(a,b){var c=this,d=c.amintext2;d.css("display","inline");d.animate({top:"0px"},50,function(){a<b&&c.ScrollText(a+1,b)})};
initAminText.prototype.initEvent=function(){var a=this;this.flag=0;this.linkURL=null;if(null!=a.config.action){try{void 0!=this.config.action.length&&(this.config.action=this.config.action[0]),this.linkURL=this.config.action.url}catch(b){}var c;null!=this.linkURL&&"http"!=this.linkURL.substr(0,4).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{c=this.config.action.triggerEventType}catch(d){c=null}this.amintext.bind(_event._down,function(){c==PageEditor.TriggerEventType.MouseDown&&actionEvent.call(a);
browserType==3?event.cancelBubble=true:event.stopPropagation()});this.amintext.bind("mouseover",function(){c==PageEditor.TriggerEventType.MouseOver&&actionEvent.call(a)});this.amintext.bind(isTouch?_event._end:"mouseout",function(){c==PageEditor.TriggerEventType.MouseOut&&actionEvent.call(a)})}};
initAminText.prototype.onResize=function(a,b){this.pw=a;this.ph=b;this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.amintext.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());this.setTextSize()};
initAminText.prototype.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"})};function initButton(a,b,c,d){this.config=$.extend({width:0.2,height:0.2,x:0.2,y:0.2,alpha:1,src:null},b);this.pw=c;this.ph=d;this.width=c*this.config.width;this.height=d*this.config.height;this.button=null;var b=[],e=this,b="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>"):(isFlipPdf&&(this.config.src="."+this.config.src),c=this.config.src.substring(this.config.src.lastIndexOf("/")+1,this.config.src.length),this.swfButton=0<=b.indexOf(c))?(this.config.Format.color=colorTo0x(this.config.Format.color),this.button=$("<div></div>"),this.buttonEvt=$("<div></div>"),this.buttonCaption=new label(this.config.buttonCaption,this.button),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, 0, 0, 0.7)","-moz-box-shadow":"0 0 10px rgba(40, 0, 0, 0.7)","box-shadow":"0 0 10px rgba(40, 0, 0, 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.buttonCaption.setFont(2*this.config.HRate*this.height/3,this.config.Format.color,this.config.Format.font),this.buttonCaption.setLabelPosition(this.buttonCaption.getWidth()>this.width?0:(this.width-this.buttonCaption.getWidth())/2,this.config.captionY*this.height/100),this.button.append(this.buttonEvt),this.button.bind(_event._down,function(){e.buttonEvt.css({display:"block"})}),this.button.bind(_event._end,function(){e.buttonEvt.css({display:"none"})}),
this.button.bind("mouseleave",function(){e.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});a.append(this.button);this.father=a;this.initEvt()}
initButton.prototype.onResize=function(a,b){this.pw=a;this.ph=b;this.width=this.config.width*a;this.height=this.config.height*b;this.button.css({width:this.width+"px",height:this.height+"px"});this.setPosition(this.config.x*a,this.config.y*b);if(null!=this.form)this.form.onResize(bookContainer.width(),bookContainer.height());if(null!=this.slide)this.slide.onResize(bookContainer.width(),bookContainer.height());this.swfButton&&(this.buttonCaption.setFont(2*this.config.HRate*this.height/3,this.config.Format.color,
this.config.Format.font),this.buttonCaption.setLabelPosition(this.buttonCaption.getWidth()>this.width?0:(this.width-this.buttonCaption.getWidth())/2,this.config.captionY*this.height/100),this.buttonEvt.css({width:this.width+"px",height:this.height+"px"}))};initButton.prototype.setPosition=function(a,b){this.button.css({left:a+"px",top:b+"px"})};
initButton.prototype.initEvt=function(){this.slide=this.form=null;if(void 0!=this.config.action){var a=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(b){}var c;null!=this.linkURL&&"http"!=this.linkURL.substr(0,4).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{c=this.config.action.triggerEventType}catch(d){c=null}this.button.bind(_event._down,function(){c==PageEditor.TriggerEventType.MouseDown&&
actionEvent.call(a);browserType==3?event.cancelBubble=true:event.stopPropagation()});this.button.bind("mouseover",function(){c==PageEditor.TriggerEventType.MouseOver&&actionEvent.call(a)});this.button.bind(isTouch?_event._end:"mouseout",function(){c==PageEditor.TriggerEventType.MouseOut&&actionEvent.call(a)})}};function initImage(a,b,c,d){this.config=$.extend({width:0.2,height:0.2,x:0.2,y:0.2,alpha:1,src:null},b);this.img=$("<img>");null!=this.config.src&&(this.pw=c,this.ph=d,this.width=this.config.width*c,this.height=this.config.height*d,isFlipPdf&&(this.config.src="."+this.config.src),this.img.attr({src:this.config.src}),this.img.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}),a.append(this.img),
this.father=a,this.initEvt())}
initImage.prototype.initEvt=function(){this.slide=this.form=null;if(void 0!=this.config.action){var a=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(b){}var c;null!=this.linkURL&&"http"!=this.linkURL.substr(0,4).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{c=this.config.action.triggerEventType}catch(d){c=null}this.img.bind(_event._down,function(){c==PageEditor.TriggerEventType.MouseDown&&
actionEvent.call(a);browserType==3?event.cancelBubble=true:event.stopPropagation()});this.img.bind("mouseover",function(){c==PageEditor.TriggerEventType.MouseOver&&actionEvent.call(a)});this.img.bind(isTouch?_event._end:"mouseout",function(){c==PageEditor.TriggerEventType.MouseOut&&actionEvent.call(a)})}};
initImage.prototype.onResize=function(a,b){this.pw=a;this.ph=b;this.width=a*this.config.width;this.height=b*this.config.height;this.img.css({width:this.width+"px",height:this.height+"px"});this.setPosition(this.config.x*a,this.config.y*b);if(null!=this.form)this.form.onResize(bookContainer.width(),bookContainer.height());if(null!=this.slide)this.slide.onResize(bookContainer.width(),bookContainer.height())};initImage.prototype.setPosition=function(a,b){this.img.css({left:a+"px",top:b+"px"})};function initRe(a,b,c,d,e){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},b);this.pw=c;this.ph=d;this.father=a;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"+e;this.angle=360-parseInt(this.config.angle);
this.A=colorTo0x(this.config.ColorA);this.B=colorTo0x(this.config.ColorB);this.Re="false"!=this.config.sh?$("<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;box-shadow:"+this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+colorTo0x(this.config.sr)+";opacity:"+this.config.spalpha+"'></div>"):
$("<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>");"gradient"==this.config.fillStyle&&this.Re.css({"background-image":"-webkit-linear-gradient("+this.angle+"deg, "+this.A+", "+this.B+")"});"none"==this.config.fillStyle&&this.Re.css({background:""});this.initEvent();
a.append(this.Re)}
initRe.prototype.initEvent=function(){var a=this;this.flag=0;this.linkURL=this.slide=this.form=null;if(null!=a.config.action){try{void 0!=this.config.action.length&&(this.config.action=this.config.action[0]),this.linkURL=this.config.action.url}catch(b){}var c;null!=this.linkURL&&"http"!=this.linkURL.substr(0,4).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{c=this.config.action.triggerEventType}catch(d){c=null}this.Re.bind(_event._down,function(){c==PageEditor.TriggerEventType.MouseDown&&actionEvent.call(a);
browserType==3?event.cancelBubble=true:event.stopPropagation()});this.Re.bind("mouseover",function(){c==PageEditor.TriggerEventType.MouseOver&&actionEvent.call(a)});this.Re.bind(isTouch?_event._end:"mouseout",function(){c==PageEditor.TriggerEventType.MouseOut&&actionEvent.call(a)})}};
initRe.prototype.onResize=function(a,b){this.pw=a;this.ph=b;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())};
initRe.prototype.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"})};function initRound(a,b,c,d,e){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},b);this.pw=c;this.ph=d;this.color=colorTo0x(this.config.color);this.father=a;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"+e;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=a;this.initEvent();a.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))}
initRound.prototype.initEvent=function(){var a=this;this.flag=0;this.slide=this.form=null;this.linkURL;if(null!=a.config.action){try{void 0!=this.config.action.length&&(this.config.action=this.config.action[0]),this.linkURL=this.config.action.url}catch(b){}var c;null!=this.linkURL&&"http"!=this.linkURL.substr(0,4).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{c=this.config.action.triggerEventType}catch(d){c=null}this.rounds.bind(_event._down,function(){c==PageEditor.TriggerEventType.MouseDown&&
actionEvent.call(a);browserType==3?event.cancelBubble=true:event.stopPropagation()});this.rounds.bind("mouseover",function(){c==PageEditor.TriggerEventType.MouseOver&&actionEvent.call(a)});this.rounds.bind(isTouch?_event._end:"mouseout",function(){c==PageEditor.TriggerEventType.MouseOut&&actionEvent.call(a)})}};
initRound.prototype.onResize=function(a,b){this.pw=a;this.ph=b;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())};
initRound.prototype.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"})};
initRound.prototype.roundcan=function(a,b,c,d,e,f,j,g,k,l,n,m,o,z,q,B,A,I,w){b=o=0;a=this.rounds[0].getContext("2d");k=[c/2+10,d/2+10];o=c/2;b=d/2;a.save();a.beginPath();a.strokeStyle=colorTo0x(m);a.lineWidth=l;a.globalAlpha=n;"false"!=I&&(a.shadowOffsetX=z,a.shadowOffsetY=q,a.shadowBlur=B,a.shadowColor=colorTo0x(A));a.closePath();a.stroke();a.restore();DrawEllipse(a,k,o,b);"gradient"==f&&(d=w*Math.PI/180,c=k[0]+o*Math.cos(d),d=k[1]+b*Math.sin(d),w=(w+180)*Math.PI/180,n=k[0]+o*Math.cos(w),w=k[1]+
b*Math.sin(w),w=a.createLinearGradient(c,d,n,w),w.addColorStop(0,colorTo0x(j)),w.addColorStop(1,colorTo0x(g)),a.fillStyle=w,a.fill());"none"==f&&(a.fillStyle=e,a.fill());0!=l&&a.stroke();a.closePath()};function DrawEllipse(a,b,c,d){var e=b[0]+c,f=b[1];a.moveTo(e,f);for(var j=0;360>=j;j++)f=j*Math.PI/180,e=b[0]+c*Math.cos(f),f=b[1]-d*Math.sin(f),a.lineTo(e,f)};function initText(a,b,c,d,e,f){this.config=$.extend({width:200,height:20,x:0,y:0,alpha:1,textStr:null,lineH:20,fontName:"Tahoma",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},b);this.pw=c;this.ph=d;this.color=colorTo0x(this.config.color);this.father=a;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="text"+e;this.isAnim=
f;this.text=$("<div style='overflow: hidden;position:absolute;background:"+colorTo0x(this.config.bgcolor)+";left:"+this.x+"px; top:"+this.y+"px;height:"+this.height+"px;width:"+this.width+"px;opacity:"+this.config.bgalpha+"'></div>");this.config.sh&&this.text.drawShadow(this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+colorTo0x(this.config.sr));this.father=a;this.initEvent();a.append(this.text);this.setTextSize()}
initText.prototype.setTextSize=function(){var a=$(this.config.textStr),b=a.find("p"),c=this;$.each(b,function(){var a=$(this).find("font");$(this).css({"word-break":"break-all",margin:"2px"});$.each(a,function(){var a=this.getAttribute("SIZE");if(!a)for(var b=this;b.parentNode;)if(b=b.parentNode,b.getAttribute("SIZE")){a=b.getAttribute("SIZE");break}this.style.fontSize=(a?a:16)*c.ph/c.config.pageH+"px"})});this.text.empty().append(a)};
initText.prototype.initEvent=function(){var a=this;this.flag=0;this.linkURL=this.slide=this.form=null;if(null!=a.config.action){try{void 0!=this.config.action.length&&(this.config.action=this.config.action[0]),this.linkURL=this.config.action.url}catch(b){}var c;null!=this.linkURL&&"http"!=this.linkURL.substr(0,4).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{c=this.config.action.triggerEventType}catch(d){c=null}this.text.bind(_event._down,function(){c==PageEditor.TriggerEventType.MouseDown&&
actionEvent.call(a);browserType==3?event.cancelBubble=true:event.stopPropagation()});this.text.bind("mouseover",function(){c==PageEditor.TriggerEventType.MouseOver&&actionEvent.call(a);browserType==3?event.cancelBubble=true:event.stopPropagation()});this.text.bind(isTouch?_event._end:"mouseout",function(){c==PageEditor.TriggerEventType.MouseOut&&actionEvent.call(a)})}};
initText.prototype.onResize=function(a,b){this.pw=a;this.ph=b;this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.text.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());this.setTextSize()};
initText.prototype.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"})};function initLine(a,b,c,d,e){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},b);this.pw=c;this.ph=d;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"+e;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>");a.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)}initLine.prototype.onResize=function(a,b){this.pw=a;this.ph=b;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()};initLine.prototype.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"})};
initLine.prototype.linecan=function(a,b,c,d,e,f,j,g,k,l,n,m,o,z,q,B,A,I){var w=b=a=0,s=0,u=this.line[0].getContext("2d"),l=parseFloat(l);0==c&&0==d?(s=w=10,a=j+10,b=g+10):0==c&&0!=d?(w=10,s=10+g,a=j+10,b=10):0!=c&&0==d?(w=10+j,a=s=10,b=g+10):(w=10+j,s=10+g,b=a=10);u.moveTo(w,s);u.lineWidth=k;u.globalAlpha=m;u.strokeStyle=n;"false"!=I&&(u.shadowOffsetX=z,u.shadowOffsetY=q,u.shadowBlur=B,u.shadowColor=colorTo0x(A));if("solid"==o)u.lineTo(a,b);else{j=0;n=l+2;g=w;k=s;num=0==f-d?e>c?(a-w)/n:(w-a)/n:0==
e-c?f>d?(b-s)/n:(s-b)/n:d<f&&c<e?a-w>b-s?(a-w)/n:(b-s)/n:d>f&&c<e?a-w>s-b?(a-w)/n:(s-b)/n:d<f&&c>e?w-a>b-s?(w-a)/n:(b-s)/n:w-a>s-b?(w-b)/n:(s-b)/n;n=num-1;for(i=0;i<n;i++)(u.moveTo(g,k),0==f-d?g=e>c?g+l:g-l:0==e-c?k=f>d?k+l:k-l:d<f&&c<e?a-w>b-s?(j=Math.abs((b-s)/(a-w)),g+=l,k+=l*j):(j=Math.abs((a-w)/(b-s)),g+=l*j,k+=l):d>f&&c<e?a-w>s-b?(j=Math.abs((b-s)/(a-w)),g+=l,k-=l*j):(j=Math.abs((a-w)/(b-s)),g+=l*j,k-=l):d<f&&c>e?w-a>b-s?(j=Math.abs((b-s)/(a-w)),g-=l,k+=l*j):(j=Math.abs((a-w)/(b-s)),g-=l*j,
k+=l):w-a>s-b?(j=Math.abs((b-s)/(a-w)),g-=l,k-=l*j):(j=Math.abs((a-w)/(b-s)),g-=l*j,k-=l),u.lineTo(g,k),0==f-d)?g=e>c?g+2:g-2:0==e-c?k=f>d?k+2:k-2:d<f&&c<e?a-w>b-s?(g+=2,k+=2*j):(g+=2*j,k+=2):d>f&&c<e?a-w>s-b?(g+=2,k-=2*j):(g+=2*j,k-=2):d<f&&c>e?w-a>b-s?(g-=2,k+=2*j):(g-=2*j,k+=2):w-a>s-b?(g-=2,k-=2*j):(g-=2*j,k-=2)}u.stroke()};function initArrow(a,b,c,d,e){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},b);this.pw=c;this.ph=d;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"+e;
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>");a.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)}initArrow.prototype.onResize=function(a,b){this.pw=a;this.ph=b;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()};initArrow.prototype.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"})};
initArrow.prototype.arrowcan=function(a,b,c,d,e,f,j,g,k,l,n,m,o,z,q,B,A,I){var w=b=a=0,s=0,u=0,t=this.arrow[0].getContext("2d"),l=parseFloat(l);t.clearRect(0,0,this.pw,this.ph);t.save();t.lineWidth=k;t.globalAlpha=m;t.strokeStyle=n;"false"!=I&&(t.shadowOffsetX=z,t.shadowOffsetY=q,t.shadowBlur=B,t.shadowColor=colorTo0x(A));0==c&&0==d?(u=s=10,a=j+10,b=g+10):0==c&&0!=d?(s=10,u=10+g,a=j+10,b=10):0!=c&&0==d?(s=10+j,a=u=10,b=g+10):(s=10+j,u=10+g,b=a=10);t.translate(0,0);t.beginPath();t.moveTo(s,u);"Double Arrow"==
this.config.arrowType&&(0==f-d?e>c?t.moveTo(s+5,u):t.moveTo(s-5,u):0==e-c&&(f>d?t.moveTo(s,u+5):t.moveTo(s,u-5)));if("solid"==o)0==f-d?e>c?t.lineTo(a-5,b):t.lineTo(a+5,b):0==e-c?f>d?t.lineTo(a,b-5):t.lineTo(a,b+5):t.lineTo(a,b);else{j=0;o=l+2;g=s;m=u;o=(0==f-d?e>c?(a-s)/o:(s-a)/o:0==e-c?f>d?(b-u)/o:(u-b)/o:d<f&&c<e?a-s>b-u?(a-s)/o:(b-u)/o:d>f&&c<e?a-s>u-b?(a-s)/o:(u-b)/o:d<f&&c>e?s-a>b-u?(s-a)/o:(b-u)/o:s-a>u-b?(s-b)/o:(u-b)/o)-1;for(i=0;i<o;i++)(t.moveTo(g,m),0==f-d?g=e>c?g+l:g-l:0==e-c?m=f>d?m+
l:m-l:d<f&&c<e?a-s>b-u?(j=Math.abs((b-u)/(a-s)),g+=l,m+=l*j):(j=Math.abs((a-s)/(b-u)),g+=l*j,m+=l):d>f&&c<e?a-s>u-b?(j=Math.abs((b-u)/(a-s)),g+=l,m-=l*j):(j=Math.abs((a-s)/(b-u)),g+=l*j,m-=l):d<f&&c>e?s-a>b-u?(j=Math.abs((b-u)/(a-s)),g-=l,m+=l*j):(j=Math.abs((a-s)/(b-u)),g-=l*j,m+=l):s-a>u-b?(j=Math.abs((b-u)/(a-s)),g-=l,m-=l*j):(j=Math.abs((a-s)/(b-u)),g-=l*j,m-=l),t.lineTo(g,m),0==f-d)?g=e>c?g+2:g-2:0==e-c?m=f>d?m+2:m-2:d<f&&c<e?a-s>b-u?(g+=2,m+=2*j):(g+=2*j,m+=2):d>f&&c<e?a-s>u-b?(g+=2,m-=2*j):
(g+=2*j,m-=2):d<f&&c>e?s-a>b-u?(g-=2,m+=2*j):(g-=2*j,m+=2):s-a>u-b?(g-=2,m-=2*j):(g-=2*j,m-=2)}t.fillStyle=n;t.stroke();t.save();w=2<1*k?15:10;"Double Arrow"==this.config.arrowType&&(t.moveTo(s,u),"Double Arrow"==this.config.arrowType&&(0==f-d?e>c?t.moveTo(s-1,u):t.moveTo(s+1,u):0==e-c&&(f>d?t.moveTo(s,u-1):t.moveTo(s,u+1))),t.translate(s,u),0<=b-u?t.rotate(4.7-Math.atan((a-s)/(b-u))):t.rotate(4.7-(Math.PI+Math.atan((a-s)/(b-u)))),t.lineTo(-w,w-5),t.lineTo(-(w-5),0),t.lineTo(-w,-(w-5)),t.lineTo(0,
0),t.fill(),t.restore());t.moveTo(a,b);t.translate(a,b);0<=b-u?t.rotate(1.5-Math.atan((a-s)/(b-u))):t.rotate(1.5-(Math.PI+Math.atan((a-s)/(b-u))));t.lineTo(-w,w-5);t.lineTo(-(w-5),0);t.lineTo(-w,-(w-5));t.lineTo(0,0);t.fill();t.restore()};function initAText(a,b,c,d,e){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},b);this.pw=c;this.ph=d;this.color=colorTo0x(this.config.color);this.father=a;this.speed=12E3*(1/this.config.moveSpeed);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="text"+e;this.scrollid="scroll"+this.id;this.atext=$("<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>");this.atext2=$("<div style='word-break: break-word; width:100%;'></div>");"false"!=this.config.sh&&this.atext.drawShadow(this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+colorTo0x(this.config.sr));this.father=a;this.initEvent();a.append(this.atext);this.atext.append(this.atext2);
this.setTextSize();this.initScroll()}initAText.prototype.initScroll=function(){this._wrap=this.atext2;this.initScrollText()};initAText.prototype.initScrollText=function(){var a=this,b=a._wrap,c=b.height();b.animate({marginTop:-c+"px"},a.speed,function(){"true"==a.config.repeat?(b.css("marginTop",a.height),a.initScrollText()):b.css("marginTop",0)})};
initAText.prototype.setTextSize=function(){var a=$(this.config.textStr),b=a.find("p"),c=this;0>=b.length&&(b=b.prevObject);$.each(b,function(){var a=$(this).find("font");$(this).css({"word-break":"break-all",margin:"2px"});$.each(a,function(){var a=this.getAttribute("SIZE");if(!a)for(var b=this;b.parentNode;){b=b.parentNode;if(b.getAttribute("SIZE")){a=b.getAttribute("SIZE");break}}this.style.fontSize=(a?a:16)*c.ph/c.config.pageH+"px"})});this.atext2.empty().append(a)};
initAText.prototype.initEvent=function(){var a=this;this.flag=0;this.linkURL;if(null!=a.config.action){try{void 0!=this.config.action.length&&(this.config.action=this.config.action[0]),this.linkURL=this.config.action.url}catch(b){}var c;null!=this.linkURL&&"http"!=this.linkURL.substr(0,4).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{c=this.config.action.triggerEventType}catch(d){c=null}this.atext.bind(_event._down,function(){c==PageEditor.TriggerEventType.MouseDown&&actionEvent.call(a);
browserType==3?event.cancelBubble=true:event.stopPropagation()});this.atext.bind(_event._move,function(){c==PageEditor.TriggerEventType.MouseOver&&actionEvent.call(a)});this.atext.bind(_event._end,function(){c==PageEditor.TriggerEventType.MouseOut&&actionEvent.call(a)})}};
initAText.prototype.onResize=function(a,b){this.pw=a;this.ph=b;this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.atext.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());this.setTextSize()};
initAText.prototype.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"})};function initArea(a,b,c,d,e){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},b);this.pw=c;this.ph=d;this.father=a;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"+e;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=a;this.initEvent();a.append(this.Area)}
initArea.prototype.initEvent=function(){var a=this;this.flag=0;this.slide=this.form=null;this.linkURL;if(null!=a.config.action){try{void 0!=this.config.action.length&&(this.config.action=this.config.action[0]),this.linkURL=this.config.action.url}catch(b){}var c;null!=this.linkURL&&"http"!=this.linkURL.substr(0,4).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{c=this.config.action.triggerEventType}catch(d){c=null}this.Area.bind(_event._down,function(){c==PageEditor.TriggerEventType.MouseDown&&
actionEvent.call(a);browserType==3?event.cancelBubble=true:event.stopPropagation()});this.Area.bind("mouseover",function(){c==PageEditor.TriggerEventType.MouseOver&&actionEvent.call(a)});this.Area.bind(isTouch?_event._end:"mouseout",function(){c==PageEditor.TriggerEventType.MouseOut&&actionEvent.call(a)})}};
initArea.prototype.onResize=function(a,b){this.pw=a;this.ph=b;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())};
initArea.prototype.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"})};function initFlashShow(a,b,c,d){this.pw=c;this.ph=d;this.config=$.extend({width:0.2,height:0.2,x:0.2,y:0.2,photo:null,repeatPlay:!0,customSize:!1},b);null!=this.config.photo&&(this.showingA=!0,this.showingIndex=1,this.background=$("<div></div>"),this.totalImage=this.config.photo.photos.length,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),a.append(this.background),this.photoB.fillImage(2),this.photoA.fillImage(1),this.initChangeImageEvent(!0))}
initFlashShow.prototype={onResize:function(a,b){this.pw=a;this.ph=b;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(a,b);this.photoB.onResize(a,b);this.setPosition()},setPosition:function(){this.background.css({left:this.pw*this.config.x+"px",top:this.ph*this.config.y+"px"})},initChangeImageEvent:function(a){var b=this,c=this.photoA.getImage(),d=this.photoB.getImage(),e,f;a||(c=this.photoB.getImage(),
d=this.photoA.getImage());switch(this.moveTo){case 1:e=f=1;break;case 2:e=f=-1;break;case 3:f=1;e=-1;break;case 4:f=-1,e=1}this.moveTo=4==this.moveTo?1:this.moveTo+1;var j=c.position().left+66*f,g=c.position().top+66*e,k=c.position().left+77*f,l=c.position().top+77*e;c.animate({left:j,top:g},{queue:!1,duration:3E3,complete:function(){b.showingIndex++;if(!(b.showingInde>b.totalImage)||b.config.repeatPlay){if(b.showingIndex>b.totalImage)b.showingIndex=0;c.animate({opacity:0,left:k,top:l},500,function(){a?
b.photoA.fillImage(b.showingIndex+1):b.photoB.fillImage(b.showingIndex+1);c.css({"z-index":0});d.css({"z-index":1})});b.initChangeImageEvent(!a)}}}).animate({opacity:1},500)}};function animateImage(a,b,c,d,e,f,j,g){this.img=$("<img />");this.imgIndex=-1;this.imageArr=b;this.bw=c;this.bh=d;this.repeat=e;a.append(this.img);this.img.css({position:"absolute"});f&&void 0!=j&&void 0!=g&&this.img.css({width:j+"px",height:g+"px"})}
animateImage.prototype.fillImage=function(a){if(this.imgIndex==a)this.img.css({left:(this.bw-this.img[0].width)/2+"px",top:(this.bh-this.img[0].height)/2+"px"});else if(!(a>this.imageArr.photos.length)||this.repeat){a>this.imageArr.photos.length&&(a=1);this.imgIndex==a;var b=this;this.img.attr("src",b.getImageDiv(a));this.img.load(function(){b.img.css({left:(b.bw-this.width)/2+"px",top:(b.bh-this.height)/2+"px"})})}};animateImage.prototype.getImageDiv=function(a){return this.imageArr.photos[a-1].photo};
animateImage.prototype.setZIndex=function(a){this.img.css("z-index",a)};animateImage.prototype.onResize=function(a,b){this.bw=a;this.bh=b;this.img.css({left:(this.bw-this.img[0].width)/2+"px",top:(this.bh-this.img[0].height)/2+"px"})};animateImage.prototype.setPosition=function(a,b){this.img.css({left:a+"px",top:b+"px"})};animateImage.prototype.animate=function(){};animateImage.prototype.getImage=function(){return this.img};function initCallout(a,b,c,d,e){this.config=$.extend({width:200,height:20,x:0,y:0,alpha:1,textStr:null,fontName:"Tahoma",fontSize:12,color:"#000000",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},b);this.pw=c;this.ph=d;this.father=a;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.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.id="callout"+e;this.cl=this.ct=this.hl=this.wl=this.canl=this.cant=this.canh=this.canw=this.textBoxPY=this.textBoxPX=0;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-(this.canh-this.height-10);this.canl=this.x-(this.canw-this.width-10);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.canw-this.width-10);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.container=$("<div style='position:absolute;overflow:hidden;width:"+
this.canw+"px; height:"+this.canh+"px;top:"+this.cant+"px;left:"+this.canl+"px'></div>");a.append(this.container);this.callout=$("<canvas id="+this.id+" width="+this.canw+" height="+this.canh+" style='position: absolute;'></canvas>");this.container.append(this.callout);this.textBox=$("<div style='position:absolute;width: "+(this.width-6)+"px; height:"+(this.height-6)+"px;'></div>");this.container.append(this.textBox);this.calloutDown();this.father=a;this.initEvent()}
initCallout.prototype.calloutDown=function(){var a=this.callout[0].getContext("2d"),b,c,d,e,f,j,g,k,l,n,m,o,z,q;switch(this.config.direct){case "Down":if(0>this.pointx){b=this.canw-this.width-10;c=10;d=this.canw-10;e=10;f=this.canw-10;j=this.height+10;g=this.canw-(this.width-this.cx2)-10;k=this.height+10;l=10;n=this.pointy+10;m=this.canw-(this.width-this.cx1)-10;o=this.height+10;z=this.canw-(this.width+10);q=this.height+10;break}c=b=10;d=this.width+10;e=10;f=this.width+10;j=this.height+10;g=this.cx2+
10;k=this.height+10;l=this.pointx+10;n=this.pointy+10;m=this.cx1+10;o=this.height+10;z=10;q=10+this.height;break;case "left":if(0>this.pointy){b=this.canw-this.width-10;c=this.canh-this.height-10;d=this.canw-10;e=this.canh-this.height-10;f=this.canw-10;j=this.canh-10;g=this.canw-this.width-10;k=this.canh-10;l=this.canw-this.width-10;n=this.canh-(this.height-this.cy2+10);o=m=10;z=this.canw-this.width-10;q=this.canh-(this.height-this.cy1+10);break}this.pointy>this.height?(b=this.canw-this.width-10,
c=10,d=this.canw-10,e=10,f=this.canw-10,j=this.height+10,g=this.canw-this.width-10,k=this.height+10,l=this.canw-this.width-10,n=this.cy2+10,m=10,o=this.canh-10):(b=this.canw-this.width-10,c=10,d=this.canw-10,e=10,f=this.canw-10,j=this.height+10,g=this.canw-this.width-10,k=this.height+10,l=this.canw-this.width-10,n=this.cy2+10,m=10,o=this.pointy+10);z=this.canw-this.width-10;q=this.cy1+10;break;case "Up":if(0>this.pointx){b=this.canw-this.width-10;c=this.canh-this.height-10;d=this.canw-(this.width-
this.cx2)-10;e=this.canh-this.height-10;j=f=10;g=this.canw-(this.width-this.cx1)-10;k=this.canh-this.height-10;l=this.canw-10;n=this.canh-this.height-10;m=this.canw-10;o=this.canh-10;z=this.canw-this.width-10;q=this.canh-10;break}this.pointx>this.width?(b=10,c=this.canh-this.height-10,d=this.cx2+10,e=this.canh-this.height-10,f=this.canw-10):(b=10,c=this.canh-this.height-10,d=this.cx2+10,e=this.canh-this.height-10,f=this.pointx+10);j=10;g=this.cx1+10;k=this.canh-this.height-10;l=this.width+10;n=this.canh-
this.height-10;m=this.width+10;o=this.canh-10;z=10;q=this.canh-10;break;case "Right":if(0>this.pointy){b=10;c=this.canh-this.height-10;d=this.width+10;e=this.canh-this.height-10;f=this.width+10;j=this.canh-(this.height-this.cy2+10);g=this.canw-10;k=10;l=this.width+10;n=this.canh-(this.height-this.cy1+10);m=this.width+10;o=this.canh-10;z=10;q=this.canh-10;break}this.pointy>this.height?(c=b=10,d=this.width+10,e=10,f=this.width+10,j=this.cy2+10,g=this.canw-10,k=this.canh-10):(c=b=10,d=this.width+10,
e=10,f=this.width+10,j=this.cy2+10,g=this.canw-10,k=this.pointy+10);l=this.width+10;n=this.cy1+10;m=this.width+10;o=this.height+10;z=10;q=this.height+10}this.textBoxPX=(b+3)/this.canw;this.textBoxPY=(c+3)/this.canh;this.textBox.css({left:b+3+"px",top:c+3+"px"});a.beginPath();a.lineWidth="1";a.textAlign="center";a.globalAlpha=this.config.bgalpha;a.strokeStyle=this.color;a.fillStyle=colorTo0x(this.config.bgcolor);a.moveTo(b,c);a.lineTo(d,e);a.lineTo(f,j);a.lineTo(g,k);a.lineTo(l,n);a.lineTo(m,o);a.lineTo(z,
q);a.closePath();a.fill();a.stroke();this.setTextSize();this.callout.append($("<div width='20px' height='20px' style='background-color:#dd3344'>"));a.textAlign="center";a.lineWidth=this.config.borderWidth;a.strokeStyle=colorTo0x(this.config.borderColor);a.stroke()};
initCallout.prototype.setTextSize=function(){var a=$(this.config.textStr),b=a.find("p"),c=this;$.each(b,function(){var a=$(this).find("font");$(this).css({"word-break":"break-all","margin-top":"2px","margin-bottom":"2px"});$.each(a,function(){var a=this.getAttribute("SIZE");if(!a)for(var b=this;b.parentNode;)if(b=b.parentNode,b.getAttribute("SIZE")){a=b.getAttribute("SIZE");break}this.style.fontSize=(a?a:16)*c.ph/c.config.pageH+"px"})});this.textBox.empty().append(a)};
initCallout.prototype.initEvent=function(){var a=this;this.flag=0;this.linkURL=this.form=this.form=null;if(null!=a.config.action){try{void 0!=this.config.action.length&&(this.config.action=this.config.action[0]),this.linkURL=this.config.action.url}catch(b){}var c;null!=this.linkURL&&"http"!=this.linkURL.substr(0,4).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{c=this.config.action.triggerEventType}catch(d){c=null}this.callout.bind(_event._down,function(){c==PageEditor.TriggerEventType.MouseDown&&
actionEvent.call(a);browserType==3?event.cancelBubble=true:event.stopPropagation()});this.callout.bind("mouseover",function(){c==PageEditor.TriggerEventType.MouseOver&&actionEvent.call(a)});this.callout.bind(isTouch?_event._end:"mouseout",function(){c==PageEditor.TriggerEventType.MouseOut&&actionEvent.call(a)})}};
initCallout.prototype.onResize=function(a,b){this.pw=a;this.ph=b;this.width=this.wl*this.pw;this.height=this.hl*this.ph;this.container.css({width:this.width+"px",height:this.height+"px"});this.callout.css({width:this.width+"px",height:this.height+"px"});this.textBox.css({width:this.config.width*this.pw-6+"px",height:this.config.height*this.ph-6+"px",left:this.textBoxPX*this.width+"px",top:this.textBoxPY*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());this.setTextSize()};initCallout.prototype.setPosition=function(){this.x=this.cl*this.pw;this.y=this.ct*this.ph;this.container.css({left:this.x+"px",top:this.y+"px"})};function initSlideShow(a,b,c){this.father=a;this.sw=b-8;this.sh=c-8;this.imgIndex=-1;this.imgWidth=200;this.imgHeight=300;this.boxWidth=200;this.boxHeight=300;this.slideShowBG=new grayBackground(a,"#333333",0.3,b,c);this.slideShowBG.setCSS({display:"none"});this.photoBox=$("<div></div>");this.img=$("<img style='position : absolute;' />");a.append(this.photoBox);this.leftButton=new button(1,a,{iconURL:uiBaseURL+"previous_down.png"});this.rightButton=new button(1,a,{iconURL:uiBaseURL+"next_down.png"});
this.closeButton=new button(1,a,{iconURL:uiBaseURL+"close.png"},!0);this.leftButton.setCSS({display:"none"});this.rightButton.setCSS({display:"none"});this.closeButton.setCSS({display:"none"});this.loadTextField=new label("Loading...",this.photoBox);this.loadTextField.setCSS({"z-index":-1,left:"5px",top:"5px"});this.leftButton.setButtonPosition(5,(this.sh-78)/2);this.rightButton.setButtonPosition(this.sw-55,(this.sh-78)/2);this.closeButton.setButtonPosition(this.sw-45,5);this.closeButton.setCSS({"z-index":210});
this.rightButton.setCSS({"z-index":202});this.leftButton.setCSS({"z-index":203});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(40, 0, 0, 0.7)","-moz-box-shadow":"0 0 10px rgba(40, 0, 0, 0.7)","box-shadow":"0 0 10px rgba(40, 0, 0, 0.7)",display:"none"});var d=this;this.photoBox.bind(_event._down,function(){d.nextPage()});
this.closeButton.onMouseUp(this,this.hide);this.leftButton.onMouseDown(this,this.prePage);this.rightButton.onMouseDown(this,this.nextPage)}initSlideShow.prototype.init=function(a){this.photos=$.extend([],a);this.photos.length||(this.photos=[this.photos]);this.photoBox.css({width:this.boxWidth+8+"px",height:this.boxHeight+8+"px",left:(this.sw-this.boxWidth)/2+"px",top:(this.sh-this.boxHeight)/2+"px"});this.changeImage(0);this.show()};
initSlideShow.prototype.nextPage=function(){var a=this.imgIndex+1;a>=this.photos.length&&(a=0);this.changeImage(a)};initSlideShow.prototype.prePage=function(){var a=this.imgIndex-1;0>a&&(a=this.photos.length-1);this.changeImage(a)};initSlideShow.prototype.onResize=function(a,b){this.sw=a-8;this.sh=b-8;this.slideShowBG.onResize(a,b);this.setPosition()};
initSlideShow.prototype.setPosition=function(){this.photoBox.css({left:(this.sw-this.boxWidth)/2+"px",top:(this.sh-this.boxHeight)/2+"px"});this.leftButton.setButtonPosition(5,(this.sh-78)/2);this.rightButton.setButtonPosition(this.sw-55,(this.sh-78)/2);this.closeButton.setButtonPosition(this.sw-45,5)};
initSlideShow.prototype.changeImage=function(a){this.imgIndex=a;this.img.remove().removeAttr("src");a=this.photos[a].url;"./"==a.substr(0,2)&&(a="."+a);var b=this;this.img.attr("src",a);this.img.load(function(){b.imgWidth=this.width;b.imgHeight=this.height;var a=b.imgWidth,d=b.imgHeight;if(b.imgWidth>b.sw||b.imgHeight>b.sh)a=b.imgWidth/b.imgHeight,a>b.sw/b.sh?(a=b.sw,d=b.sw*b.imgHeight/b.imgWidth):(d=b.sh,a*=b.sh);b.img.css({width:a+"px",height:d+"px"});b.boxWidth!=a||b.boxHeight!=d?b.photoBox.animate({width:a+
8,height:d+8,left:(b.sw-a)/2,top:(b.sh-d)/2},300,function(){b.photoBox.append(b.img)}):b.photoBox.append(b.img);b.boxWidth=a;b.boxHeight=d;b.img.css({left:"4px",top:"4px"})})};initSlideShow.prototype.setImagePosition=function(){};initSlideShow.prototype.show=function(){this.slideShowBG.setCSS({display:"block"});this.photoBox.css({display:"block"});this.closeButton.setCSS({display:"block"});this.leftButton.setCSS({display:"block"});this.rightButton.setCSS({display:"block"})};
initSlideShow.prototype.hide=function(){var a=this;this.photoBox.animate({width:20,height:20,top:this.sh/2-10,left:this.sw/2-10},200,function(){a.leftButton.setCSS({display:"none"});a.rightButton.setCSS({display:"none"});a.closeButton.setCSS({display:"none"});a.photoBox.css({display:"none"});a.slideShowBG.setCSS({display:"none"})})};function initVideoForm(a,b,c,d){this.config=$.extend({width:400,height:300,content:null,alpha:0.3,caption:"",closeIconURL:uiBaseURL+"close.png",winType:"0"},b);this.father=a;null!=this.config.content&&("string"!=typeof this.config.caption&&(this.config.caption=""),this.config.width=parseInt(this.config.width),this.config.height=parseInt(this.config.height),this.sw=c,this.sh=d,this.th=28,this.background=new grayBackground(a,"#333333",this.config.alpha,c,d),this.form=$("<div></div>"),this.titleBar=
$("<div></div>"),isFlipPdf&&"0"==this.config.winType&&(this.config.content="../"+this.config.content),""!=this.config.closeIconURL&&(this.closeButton=new button(1,this.titleBar,{iconURL:this.config.closeIconURL},!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.form.css({width:this.config.width+
4+"px",height:this.config.height+4+"px",left:(c-this.config.width)/2+"px",top:(d-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,overflow:"hidden"}),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"}),"0"==
this.config.winType?this.content=$("<video src='"+this.config.content+"' controls='controls'></video>"):"4"==this.config.winType&&(this.content=$("<span>"+this.config.content+"<span>"),this.content.css({overflow:"auto","font-size":"12px","font-family":"Tahoma,Georgia,Serif","line-height":"200%"})),this.content.css({width:this.config.width+"px",height:this.config.height-this.th+"px",top:this.th+2+"px",left:"2px",position:"absolute"}),a.append(this.form),this.form.append(this.titleBar),this.form.append(this.content),
this.initEvent())}initVideoForm.prototype.onResize=function(a,b){this.sw=a;this.sh=b;this.background.onResize(a,b);this.setPosition()};initVideoForm.prototype.setPosition=function(){this.form.css({left:(this.sw-this.config.width)/2+"px",top:(this.sh-this.config.height)/2+"px"})};
initVideoForm.prototype.initEvent=function(){var a=this;this.closeButton.onMouseUp(this,this.closeForm);var b=!1,c,d;this.titleBar.bind(_event._down,function(e){e=isTouch?e.originalEvent.touches:[e];b=!0;c=Point(e[0].pageX,e[0].pageY);d=Point(a.form.offset().left,a.form.offset().top);return!1});this.titleBar.bind(_event._move,function(e){e=isTouch?e.originalEvent.touches:[e];b&&a.form.css({top:d.y+(e[0].pageY-c.y)+"px",left:d.x+(e[0].pageX-c.x)+"px"});return!1});this.titleBar.bind(_event._end,function(){return b=
!1});this.titleBar.bind("mouseleave",function(){return b=!1})};initVideoForm.prototype.closeForm=function(){var a=this;this.form.animate({width:20,height:20,left:this.sw/2-10,top:this.sh/2-10},200,function(){a.background.hide();a.form.remove()})};
function initVimeoForm(a,b){this.video=$("<iframe></iframe>");this.bg=$("<div id='video_form1'></div>");this.bg.css({left:"0px",top:"0px",right:"0px",bottom:"0px",background:"rgba(51,51,51,0.7)","z-index":200,position:"absolute",display:"none"});$("body").append(this.bg);this.bg.append(this.video);this.closeButton=new button(1,this.bg,{iconURL:uiBaseURL+"close.png"},!0);this.closeButton.setButtonPosition(6,3,["right","top"]);this.video.css({position:"absolute"});var c=this;this.closeButton.background.bind(_event._end,
function(){c.bg.css({display:"none"})});this.init(a,b)}
initVimeoForm.prototype.init=function(a,b){this.config=$.extend({color:"#333333",alpha:0.7,id:""},b);if(this.config.id){this.video.css({width:window.innerWidth/2+"px",height:window.innerHeight/2+"px",top:window.innerHeight/4+"px",left:window.innerWidth/4+"px"});if("vimeo"==a){var c="http://player.vimeo.com/video/"+this.config.id+"?api=1&amp;";this.video.attr("src",c)}else"youtube"==a&&(c="http://www.youtube.com/embed/"+this.config.id,this.video.attr("src",c));this.bg.css("display","block")}};
initVimeoForm.prototype.onResize=function(){this.video.css({width:window.innerWidth/2+"px",height:window.innerHeight/2+"px",top:window.innerHeight/4+"px",left:window.innerWidth/4+"px"})};function initBanner(a,b,c,d,e){this.config=$.extend({width:200,height:20,x:0,y:0,alpha:1,action:null,banners:null},b);this.pw=c;this.ph=d;this.father=a;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"+e;this.image=null;if("string"==typeof this.a.imageUrl)this.image="<li><img src='"+this.a.imageUrl+"' /></li>";else for(b=0;b<this.a.length;b++)this.image=null!=this.image?
this.image+"<li><img src='"+this.a[b].imageUrl+"' /></li>":"<li><img src='"+this.a[b].imageUrl+"' /></li>";this.banner=$("<div style='left:"+this.x+"px;top:"+this.y+"px;'></div>");this.bannerul=$("<ul></ul>");this.bannerli=$(this.image);a.append(this.banner);this.banner.append(this.bannerul);this.bannerul.append(this.bannerli);this.imageamin();this.father=a;this.initEvent()}
initBanner.prototype.imageamin=function(){this.banner.jFlip(this.width,this.height,{background:"white",cornersTop:!1,scale:"fill"},this.x,this.y)};
initBanner.prototype.initEvent=function(){var a=this;this.flag=0;this.linkURL;if(null!=a.config.action){try{void 0!=this.config.action.length&&(this.config.action=this.config.action[0]),this.linkURL=this.config.action.url}catch(b){}var c;null!=this.linkURL&&"http"!=this.linkURL.substr(0,4).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{c=this.config.action.triggerEventType}catch(d){c=null}this.banner.bind(_event._down,function(){c==PageEditor.TriggerEventType.MouseDown&&actionEvent.call(a);
browserType==3?event.cancelBubble=true:event.stopPropagation()});this.banner.bind(_event._move,function(){c==PageEditor.TriggerEventType.MouseOver&&actionEvent.call(a)});this.banner.bind(_event._end,function(){c==PageEditor.TriggerEventType.MouseOut&&actionEvent.call(a)})}};initBanner.prototype.onResize=function(a,b){this.pw=a;this.ph=b;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()};
initBanner.prototype.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"})};function initStarText(a,b,c,d,e){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},b);this.pw=c;this.ph=d;this.color=colorTo0x(this.config.color);this.father=a;this.speed=22E3*(1/this.config.moveSpeed);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="startext"+e;this.scrollid="starwars"+this.id;this.textli="";this.offset=0;this.stepping=0.2;this.text=this.config.textStr.split("<br/>");for(b=0;b<this.text.length;b++)this.textli=this.textli+"<li style='list-style-type:none;'>"+this.text[b]+"</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>");this.startext2=$("<div style='word-break: break-word;width:100%;text-align:"+
this.config.align+";'></div>");this.contentBox=$("<div style='width:100%;position:absolute;'></div>");"false"!=this.config.sh&&this.startext.drawShadow(this.config.sx+"px "+this.config.sy+"px "+this.config.se+"px "+colorTo0x(this.config.sr));this.father=a;this.initEvent();a.append(this.startext);this.startext.append(this.startext2);this.startext2.append(this.contentBox);this.setTextSize();this.initScroll()}
initStarText.prototype.initScroll=function(){this.startext.css({"-webkit-perspective":"800px","-moz-perspective":"800px","-ms-perspective":"800px",perspective:"800px"});var a=-(800<1.2*this.contentBox.height()?1.2*this.contentBox.height():800);this.startext2.css({"-webkit-transform-style":"preserve-3d","-moz-transform-style":"preserve-3d","-ms-transform-style":"preserve-3d","transform-style":"preserve-3d","-webkit-transform-origin":"0% 0%","-moz-transform-origin":"0% 0%","-ms-transform-origin":"0% 0%",
"transform-origin":"0% 0%"});this.startext2.setTransform(translate(0,this.startext.height(),0)+"rotateX(65deg)");var b=this,c=30;interval=setInterval(function(){b.startext2?(c-=1,c<a&&(c=30),b.contentBox.setTransform(translate(0,c,0))):clearInterval(interval)},30)};
initStarText.prototype.setTextSize=function(){var a=$(this.config.textStr),b=a.find("p"),c=this;$.each(b,function(){var a=$(this).find("font");$(this).css({"word-break":"break-all",margin:"2px"});$.each(a,function(){var a=this.getAttribute("SIZE");if(!a)for(var b=this;b.parentNode;)if(b=b.parentNode,b.getAttribute("SIZE")){a=b.getAttribute("SIZE");break}this.style.fontSize=(a?a:16)*c.ph/c.config.pageH+"px"})});this.contentBox.empty().append(a)};initStarText.prototype.initScrollText=function(){};
initStarText.prototype.initEvent=function(){var a=this;this.flag=0;this.linkURL=null;if(null!=a.config.action){try{void 0!=this.config.action.length&&(this.config.action=this.config.action[0]),this.linkURL=this.config.action.url}catch(b){}var c;null!=this.linkURL&&"http"!=this.linkURL.substr(0,4).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{c=this.config.action.triggerEventType}catch(d){c=null}this.startext.bind(_event._down,function(){c==PageEditor.TriggerEventType.MouseDown&&actionEvent.call(a);
browserType==3?event.cancelBubble=true:event.stopPropagation()});this.startext.bind("mouseover",function(){c==PageEditor.TriggerEventType.MouseOver&&actionEvent.call(a)});this.startext.bind(isTouch?_event._end:"mouseout",function(){c==PageEditor.TriggerEventType.MouseOut&&actionEvent.call(a)})}};
initStarText.prototype.onResize=function(a,b){this.pw=a;this.ph=b;this.width=this.config.width*this.pw;this.height=this.config.height*this.ph;this.startext.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());this.setTextSize()};
initStarText.prototype.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"})};function grayBackground(a,b,c,d,e){this.sw=d;this.sh=e;this.background=$("<div ></div>");this.background.css({width:d+"px",height:e+"px",background:b,opacity:c,"z-index":200,position:"absolute",left:"0px",top:"0px"});a.append(this.background)}grayBackground.prototype.onResize=function(a,b){this.sw=a;this.sh=b;this.background.css({width:a+"px",height:b+"px"})};grayBackground.prototype.setPosition=function(){};grayBackground.prototype.show=function(){this.father.append(this.background)};
grayBackground.prototype.hide=function(){this.background.remove()};grayBackground.prototype.setCSS=function(a){this.background.css(a)};(function(a){var b=function(a){var c=this;this.theButton=a;this.eventSource=a[0];this.isTouch()?(a.bind("touchstart",function(){b.prototype.mouseDown.apply(c,arguments)}),a.bind("touchend",function(){b.prototype.mouseUp.apply(c,arguments)})):(a.bind("mousedown",function(){b.prototype.mouseDown.apply(c,arguments)}),a.bind("mouseleave",function(){b.prototype.mouseUp.apply(c,arguments)}),a.bind("mouseup",function(){b.prototype.mouseUp.apply(c,arguments)}))};b.prototype.isTouch=function(){return"Touch"in
window};b.prototype.mouseDown=function(){this.setAlpha(70)};b.prototype.mouseUp=function(){var a=this;window.setTimeout(function(){b.prototype.setAlpha.apply(a,[100])},100)};b.prototype.setAlpha=function(a){0>a&&(a=0);100<=a&&(a=100);this.theButton.css("opacity",a/100)};a.fn.asButton=function(){new b(this);return this};var c=function(a){this.eventSource=a[0];this.origPicture=a[0].src;var b=this.origPicture.lastIndexOf("."),f=this.origPicture.substr(0,b),b=this.origPicture.substring(b);this.pictureDown=
f+"_down"+b;var j=this;this.isTouch()?(a.bind("touchstart",function(){c.prototype.mouseDown.apply(j,arguments)}),a.bind("touchend",function(){c.prototype.mouseUp.apply(j,arguments)})):(a.bind("mousedown",function(){c.prototype.mouseDown.apply(j,arguments)}),a.bind("mouseup",function(){c.prototype.mouseUp.apply(j,arguments)}),a.bind("mouseleave",function(){c.prototype.mouseUp.apply(j,arguments)}))};c.prototype.isTouch=function(){return"Touch"in window};c.prototype.mouseDown=function(){this.eventSource.src=
this.pictureDown};c.prototype.mouseUp=function(){var a=this;window.setTimeout(function(){a.eventSource.src=a.origPicture},100)};a.fn.asImageButton=function(){new c(this);return this}})(jQuery);function rimFlip(){}rimFlip.prototype.addRimFlip=function(){};rimFlip.prototype.clearTimer=function(){};rimFlip.prototype.removeRimFlip=function(){};rimFlip.prototype.setFlipBack=function(){};var textWidth=function(a,b){var c=$("<pre>"+a+"</pre>").css({display:"none","font-size":b.size,"font-family":b.fontName});$("body").append(c);var d=Point(c.width(),c.height());c.remove();return d};
function label(a,b){this.labelBox=$('<span style = "position : absolute;font-family:Tahoma,Georgia,Serif">'+a+"</span>");this.caption=a;this.fontSize="10px";this.fontColor="#ffffff";this.fontName="Tahoma";var c=textWidth(a,{size:this.fontSize,fontName:this.fontName});this.width=c.x;this.height=c.y;b.append(this.labelBox)}label.prototype.getWidth=function(){return this.width};label.prototype.getHeight=function(){return this.height};label.prototype.getCaption=function(){return this.caption};
label.prototype.getVisible=function(){return this.labelBox[0].style.display};label.prototype.setCaption=function(a){this.caption=a;this.labelBox[0].innerHTML=a;a=textWidth(a,{size:this.fontSize,fontName:this.fontName});this.width=a.x;this.height=a.y};label.prototype.setLabelPosition=function(a,b,c){void 0==c&&(c=["left","top"]);this.labelBox.css(c[0],a+"px");this.labelBox.css(c[1],b+"px")};label.prototype.onResize=function(a,b){this.width=a;this.height=b;this.labelBox.css({width:a+"px",height:b+"px"})};
label.prototype.setFont=function(a,b,c){null==a?a=this.fontSize:this.fontSize=a;null==b?b=this.fontColor:this.fontColor=b;null==c?c=this.fontName:this.fontName=c;this.labelBox.css({"font-size":a,color:b,"font-family":c});a=textWidth(this.caption,{size:a,fontName:c});this.width=a.x;this.height=a.y};label.prototype.riseAWord=function(a){newCaption=this.caption.replaceAll(a,"<font color=rgb(226,77,66)><strong>"+a+"</strong></font>");this.labelBox[0].innerHTML=newCaption};
label.prototype.shortWord=function(a){this.caption.length>a&&(this.caption=this.caption.substring(0,a)+"..",this.setCaption(this.caption))};label.prototype.setCSS=function(a){this.labelBox.css(a)};function tipsBox(a,b){this.visible=!1;this.caption=a;this.background=$("<div style = 'position : absolute;'></div>");this.contentBox=new label(a,this.background);this.contentBox.setFont("16px","#f0f0f0",null);this.width=this.contentBox.getWidth()+12;this.height=40;$(b).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)","-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 a=this;this.timer=window.setInterval(function(){a.hideTipsBox.call(a);window.clearInterval(a.timer)},3500)};
tipsBox.prototype.resetTimer=function(){window.clearInterval(this.timer);this.setTimer()};tipsBox.prototype.setPosition=function(a,b,c){void 0==c&&(c=["left","top"]);$(this.background).css(c[0],a+"px");$(this.background).css(c[1],b+"px")};tipsBox.prototype.onResize=function(a,b){this.width=a;this.height=b;$(this.background).css({width:a+"px",height:b+"px"});this.contentBox.setLabelPosition(4,(b-this.contentBox.getHeight())/2)};tipsBox.prototype.getWidth=function(){return this.width};
tipsBox.prototype.getHeight=function(){return this.height};tipsBox.prototype.setCaption=function(a){this.contentBox.setCaption(a);this.caption=a;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"}),$(this.background).animate({opacity:0.9},300))};
tipsBox.prototype.hideTipsBox=function(){this.visible&&(this.visible=!1,$(this.background).animate({opacity:0},300,function(){$(this.background).css({display:"none"})}))};var rotate=function(a){return" rotate("+a+"deg)"},translate=function(a,b,c){return 3!=browserType?" translate3d("+a+"px,"+b+"px, "+(c?c:0)+"px)":" translate("+a+"px,"+b+"px)"},isLeft=function(a){return 0==a||2==a},isRight=function(a){return 1==a||3==a},isTop=function(a){return 0==a||1==a},isBottom=function(a){return 2==a||3==a},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).data().gotoPage(parseInt($(singlePageBook).data().currentPageIndex)+1):bookType==BookType.zoom_book&&zoomBook.gotoPage(parseInt(zoomBook.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.single_book?$(singlePageBook).data().gotoPage(parseInt($(singlePageBook).data().currentPageIndex)-1):bookType==BookType.zoom_book&&zoomBook.gotoPage(zoomBook.currentIndex-1)},firstPageFun=function(){bookType==BookType.normal_book?
flipBook.gotoPage(1):bookType==BookType.single_book?$(singlePageBook).data().gotoPage(1):bookType==BookType.zoom_book&&zoomBook.gotoPage(1)},lastPageFun=function(){bookType==BookType.normal_book?flipBook.gotoPage(totalPageCount):bookType==BookType.single_book?$(singlePageBook).data().gotoPage(originTotalPageCount):bookType==BookType.zoom_book&&zoomBook.gotoPage(originTotalPageCount)},gotoPageFun=function(a){bookType==BookType.normal_book?flipBook.gotoPage(a):bookType==BookType.single_book?(a=a>originTotalPageCount?
originTotalPageCount:a,$(singlePageBook).data().gotoPage(a)):bookType==BookType.zoom_book&&(a=a>originTotalPageCount?originTotalPageCount:a,zoomBook.gotoPage(a))},getPageDir=function(a,b){var c;switch(b){case "normal":return c=getString("normalPath","files/page/")+a+".jpg";case "large":return c=getString("largePath","files/large/")+a+".jpg";case "thumb":return c=getString("thumbPath","files/thumbnail/")+a+".jpg"}},getPageWidthHeight=function(a,b,c,d){var e=Point(0,0);a/b>c/d?(e.x=c*b/d,e.y=b):(e.x=
a,e.y=a*d/c);return e},pointToLineDistance=function(a,b,c,d,e,f){var j=f-d,g=c-e;return Math.abs(j*a+g*b+(e*d-c*f))/Math.sqrt(j*j+g*g)},globalToBook=function(a,b,c,d){void 0==d&&(d=!1);return d?Point(b-_singleBook.offset().left,c-_singleBook.offset().top):Point(b-((a?0:flipBook.getPageWidth())+flipBook.getLeft()),c-flipBook.getTop())},changeShowBook=function(a){switch(a){case 0:singlePageBook.setSingleBookVisible(!1);zoomBook.hide();flipBook.show();_rimFlip.isRimFlip&&($(singlePageBook).data().currentPage.resetPage(),
$(singlePageBook).data().currentPage.setSideAUp(!0),_rimFlip.clearTimer(),_rimFlip.addRimFlip());thumbnail.mergeAll();break;case 1:singlePageBook.setSingleBookVisible(!0);zoomBook.hide();flipBook.hide();_rimFlip.isRimFlip&&(currentPage2.resetPage(),_rimFlip.clearTimer(),_rimFlip.addRimFlip());thumbnail.fissionAll();break;case 2:singlePageBook.setSingleBookVisible(!1),zoomBook.show(),flipBook.hide(),_rimFlip.isRimFlip&&($(singlePageBook).data().currentPage.resetPage(),$(singlePageBook).data().currentPage.setSideAUp(!0),
currentPage2.resetPage(),currentPage2.setSideUp(!0),_rimFlip.clearTimer(),_rimFlip.setFlipBack(!1)),thumbnail.fissionAll()}},computeMousePoint=function(a,b,c,d,e,f){var j=function(){return 0<=a.indexOf("l")},g=function(){return 0<=a.indexOf("t")},k=function(){return 0<=a.indexOf("b")},l=Point(b,c),n,m,o,z;o=j()?d-b:b;z=k()?e-c:c;n=Math.sqrt(Math.pow(o,2)+Math.pow(z,2));m=Math.sqrt(Math.pow(o,2)+Math.pow(e-z,2));var q=Math.abs(o/z),B=d/e;if(0>z&&g()&&q>=B&&Math.abs(o)>d){if(j())return 0<b?Point(2*
d,0):Point(1,1);if(0<=a.indexOf("r"))return 0>b?Point(-d,0):Point(d-1,1)}else if(c>e&&k()&&q>=B&&Math.abs(o)>d){if(j())return 0<b?Point(2*d,e):Point(1,e-1);if(0<=a.indexOf("r"))return 0>b?Point(-d,e):Point(d-1,e-1)}if(n>d&&m>f)n-d>m-f?(l=j()?d-(d-b)*d/n:b*d/n,n=k()?e-(e-c)*d/n:c*d/n):(l=j()?d-(d-b)*f/m:b*f/m,n=g()?e-(e-c)*f/m:c*f/m),l=Point(l,n),computeMousePoint(a,l.x,l.y,d,e,f);else if(n>d&&(l=j()?d-(d-b)*d/n:b*d/n,n=k()?e-(e-c)*d/n:c*d/n,l=Point(l,n)),m>f)l=j()?d-(d-b)*f/m:b*f/m,n=g()?e-(e-c)*
f/m:c*f/m,l=Point(l,n);g()&&0==l.y?l.y=0.002*e:k()&&l.y==e&&(l.y=0.998*e);return l},computePoint=function(a,b,c,d,e,f,j,g){var k,l;k=Point(b,c);k=computeMousePoint(a,b,c,d,e,f);c=k.x;l=k.y;k=function(){return 0<=a.indexOf("l")};b=function(){return 0<=a.indexOf("t")};switch(a){case "tl":actualPoint=Point(c,l);middlePoint=Point(d-actualPoint.x/2,l/2);endPoint=Point(2*d,0);break;case "tr":actualPoint=Point(d-c,l);middlePoint=Point(d-actualPoint.x/2,actualPoint.y/2);endPoint=Point(-d,0);break;case "bl":actualPoint=
Point(c,e-l);middlePoint=Point(d-actualPoint.x/2,actualPoint.y/2);endPoint=Point(2*d,e);break;case "br":actualPoint=Point(d-c,e-l),middlePoint=Point(d-actualPoint.x/2,actualPoint.y/2),endPoint=Point(-d,e)}l=Point(0,0);var n=Math.PI/2,m=Math.atan2(actualPoint.y,actualPoint.x),o=n-m,c=180*o/Math.PI,z=o-Math.atan2(middlePoint.y,middlePoint.x);distance=Math.max(0,Math.sin(z)*Math.sqrt(Math.pow(middlePoint.x,2)+Math.pow(middlePoint.y,2)));noMovePoint=Point(distance*Math.sin(o),distance*Math.cos(o));var q;
if(o>n&&(noMovePoint.x+=Math.abs(noMovePoint.y*Math.tan(m)),noMovePoint.y=0,l=Math.PI-o,f=f-e/Math.sin(l)-(noMovePoint.x-e/Math.tan(l))*Math.cos(l),l=Point(Math.round(f*Math.cos(l)),Math.round(f*Math.sin(l))),k()&&(l.x=-l.x),b()))l.y=-l.y;n=Math.sqrt(Math.pow(endPoint.x-actualPoint.x,2)+Math.pow(endPoint.y-actualPoint.y,2));f=Math.round(noMovePoint.y/Math.tan(o)+noMovePoint.x);k()&&(f=d-f);m=k()?f:d-f;z=m*Math.cos(2*o);q=m*Math.sin(2*o);f=Point(Math.round(f+(k()?-z:z)),Math.round(b()?q:e-q));q=m*
Math.sin(o);m=Point(100*(actualPoint.x/2/d),100*(actualPoint.y/2/e));n=n<d?n/d:1;z=100<q?(q-100)/q:0;b()||(m.y=100-m.y);k()&&(m.x=100-m.x);d=Point(100*(q*Math.sin(o)/d),100*(q*Math.cos(o)/e));k()||(d.x=100-d.x);b()||(d.y=100-d.y);e=getBrowserPre();j.css({"background-image":e+"gradient(linear, "+(k()?100:0)+"% "+(b()?0:100)+"%, "+m.x+"% "+m.y+"%, color-stop("+z+",rgba(0,0,0,0)), color-stop("+(0.8*(1-z)+z)+",rgba(0,0,0,"+0.2*n+")), to(rgba(255,255,255,"+0.2*n+")))"});g.css({"background-image":e+"gradient(linear, "+
(k()?0:100)+"% "+(b()?0:100)+"%, "+d.x+"% "+d.y+"%,  color-stop(0.8,rgba(0,0,0,0)), color-stop(1, rgba(0,0,0,"+0.2*n+")), to(rgba(0,0,0,0)))"});return{Angle:c,Mv:l,Df:f,NomovePoint:noMovePoint}},setCurrentIndexTextField=function(a,b){if(1!=a&&a!=totalPageCount&&b)var c=2*Math.floor(a/2),a=rightToLeft?c+1+"-"+c:c+"-"+(c+1);c=totalPageCount;b||(c=originTotalPageCount);$("#fbCurrentPageIndex").text(a);pageIndexTextField.val(rightToLeft?c+"/"+a:a+"/"+c)},getSpeedArray=function(a,b){for(var c=b/2,d=(a-
a/4)/c,e=Array(b),f=0;f<b;f++)e[f]=f<c?a-(c-f)*d:a+(f-c+1)*d;return e.reverse()},getBrowserPre=function(){switch(browserType){case 3:return"-ms-";case 2:return"-moz-";case 1:return"-webkit-";case 4:return"-o-";default:return""}},getTransform=function(a){switch(browserType){case 3:(a=a.style["-ms-transform"])&&null!=a&&(a=a.match(/translate\((.*?)\)/));break;case 2:(a=a.style["-moz-transform"])&&null!=a&&(a=a.match(/translate3d\((.*?)\)/));break;case 1:(a=a.style["-webkit-transform"])&&null!=a&&(a=
a.match(/translate3d\((.*?)\)/));break;case 4:(a=a.style["-o-transform"])&&null!=a&&(a=a.match(/translate3d\((.*?)\)/));break;default:(a=a.style.transform)&&null!=a&&(a=a.match(/translate\((.*?)\)/))}if(null==a||""==a||2>a.length)return Point(0,0);a=a[1].split(", ");return Point(parseInt(a[0],10),parseInt(a[1],10))},actionEvent=function(){this.config.action.actionType==PageEditor.ActionType.GOTO_PAGE?gotoPageFun(this.config.action.pageIndex):this.config.action.actionType==PageEditor.ActionType.OPEN_URL?
(void 0==this.config.action.linkTarget&&(this.config.action.linkTarget="_blank"),window.open(this.linkURL,this.config.action.linkTarget)):this.config.action.actionType==PageEditor.ActionType.OPEN_WINDOW?this.form=new initVideoForm(tmpContainer,{width:this.config.action.windowWidth,height:this.config.action.windowHeight,content:this.config.action.resourceContent,winType:this.config.action.windowType,caption:this.config.action.caption},bookContainer.width(),bookContainer.height()):this.config.action.actionType==
PageEditor.ActionType.SLIDE_SHOW?slideShow.init(this.config.action.photos.photo):this.config.action.actionType==PageEditor.ActionType.PLAY_AUDIO?0==this.flag&&("./"==this.config.action.audioURL.substr(0,2)&&(this.config.action.audioURL="."+this.config.action.audioURL),this.audios=$("<audio src='"+this.config.action.audioURL+"' style='width: "+this.width+"px; height: "+this.height+"px;top:"+this.y+"px;left:"+this.x+"px;position:absolute;' controls ></audio>"),this.config.action.autoPlay&&(this.audios[0].autoPlay=
!0),this.father.append(this.audios),this.flag=1):this.config.action.actionType==PageEditor.ActionType.ACTION_JS?null!=this.config.action.scriptFun&&eval(this.config.action.scriptFun):this.config.action.actionType==PageEditor.ActionType.PLAY_VIDEO&&("TYPE_VIMEO"==this.config.action.windowType?videoForm1.init("vimeo",{id:this.config.action.id}):"TYPE_YOUTUBE"==this.config.action.windowType&&videoForm1.init("youtube",{id:this.config.action.id}))},getAliasValue=function(a){a=bookConfig[a]?bookConfig[a]:
aliasConfig[a]?aliasConfig[a]:void 0;if(a instanceof Array){if(!(1>a.length))for(var b=0;b<a.length;b++){if(void 0!=bookConfig[a[b]])return bookConfig[a[b]];if(b==a.length-1)break}}else return a},getString=function(a,b){var c=getAliasValue(a);return void 0==c?b:c},getInt=function(a,b){var c=getAliasValue(a);try{return isNaN(c)||void 0==c?b:Number(c)}catch(d){return b}},getBool=function(a,b){var c=["true","yes","show","enable"],d=["false","no","hide","disable"],e=getAliasValue(a);try{e=e.toLowerCase()}catch(f){return b}return 0>
c.indexOf(e)&&0>d.indexOf(e)?b:0<=c.indexOf(e)},getColor=function(a,b){var c=getAliasValue(a);return void 0!=c?colorTo0x(c):b},getImage=function(a){if(0<iconArray.length)for(var b=0;b<iconArray.length;b++)if(iconArray[b].url==a)return iconArray[b].img;return new Image},getLanguage=function(a,b){try{return selectedLanguage[a]?selectedLanguage[a]:b}catch(c){return b}};
$.fn.translate=function(a,b,c){a=translate(a,b,c);this.css({"-webkit-transform":a,"-moz-transform":a,"-o-transform":a,"-ms-transform":a,transform:a})};$.fn.rotate=function(a){a=rotate(a);this.css({"-webkit-transform":a,"-moz-transform":a,"-o-transform":a,"-ms-transform":a,transform:a})};$.fn.setTransform=function(a){a&&this.css({"-webkit-transform":a,"-moz-transform":a,"-o-transform":a,"-ms-transform":a,transform:a})};
$.fn.drawShadow=function(a){a||(a="0 0 5px rgba(40, 0, 0, 0.5)");this.css({"-webkit-box-shadow":a,"-moz-box-shadow":a,"-o-box-shadow":a,"-ms-box-shadow":a,"box-shadow":a})};$.fn.borderRadius=function(a){a||(a="5px");this.css({"-webkit-border-radius":a,"-moz-border-radius":a,"-o-border-radius":a,"-ms-border-radius":a,"border-radius":a})};
(function(){var a={supportsFullScreen:!1,isFullScreen:function(){return!1},requestFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"",prefix:""},b=["webkit","moz","o","ms","khtml"];if("undefined"!=typeof document.cancelFullScreen)a.supportsFullScreen=!0;else for(var c=0,d=b.length;c<d;c++)if(a.prefix=b[c],"undefined"!=typeof document[a.prefix+"CancelFullScreen"]){a.supportsFullScreen=!0;break}a.supportsFullScreen&&(a.fullScreenEventName=a.prefix+"fullscreenchange",a.isFullScreen=
function(){switch(this.prefix){case "":return document.fullScreen;case "webkit":return document.webkitIsFullScreen;default:return document[this.prefix+"FullScreen"]}},a.requestFullScreen=function(a){return""===this.prefix?a.requestFullScreen():a[this.prefix+"RequestFullScreen"]()},a.cancelFullScreen=function(){return""===this.prefix?document.cancelFullScreen():document[this.prefix+"CancelFullScreen"]()});"undefined"!=typeof jQuery&&(jQuery.fn.requestFullScreen=function(){return this.each(function(){a.supportsFullScreen&&
a.requestFullScreen(this)})});window.fullScreenApi=a})();function searchFromPages(a,b){for(var c=[],b=b.trim().toLowerCase(),d=null,d=-1==b.indexOf(" ")?[b]:b.split(" "),e=0,e=0;e<a.length;e++){var f=a[e].trim().toLowerCase(),j=f,g=-1,k=-1,l=-1,n=0,m=!0,o;for(o=0;o<d.length;o++){var j=new KMP(j,d[o]),z=d[o].length;if(j.match()){var q=n+j.getIndex();if(q>l)l=q,n=q+d[o].length,j=f.substring(n),0==o&&(g=q),o==d.length-1&&(k=q+z);else{m=!1;break}}else{m=!1;break}}m&&(l=[],l.search_page=e+1,l.search_title="page "+(e+1),g=f.substring(0,g).lastIndexOf("."),-1==
g?g=0:g++,n=f.substring(k),m=n.indexOf(".")+1,m=-1==m?n.length():k+m,f=f.substring(g,m),l.search_text=f,c.push(l))}return c};var KMP=function(a,b){this.__string=a;this.__pattern=b;this.__next=[];this.__times=0;this.__index=-1;for(var c=0,c=0;c<b.length;c++)this.__next[c]=1>=c?c-1:this.next(b.substring(0,c));this.__times=0;this.__index=-1};KMP.prototype.next=function(a){for(var b=Math.ceil(a.length/2);0<b&&0!=a.substring(0,b).compareTo(a.substring(a.length-b,a.length));)b--;return b};
KMP.prototype.match=function(){for(var a=0,b=0,c=-1;a<this.__string.length&&b<this.__pattern.length;){if(this.__string.charAt(a)==this.__pattern.charAt(b))0===b&&(c=a),a++,b++;else{for(var d=this.__next[b];-1!=d&&this.__pattern.charAt(d)==this.__pattern.charAt(b);)d=this.__next[d];b=d;-1==b?(a++,b=0):c=a-b}this.__times++}return b==this.__pattern.length?(this.__index=c,!0):!1};KMP.prototype.getTimes=function(){return this.__times};KMP.prototype.getIndex=function(){return this.__index};
String.prototype.compareTo=function(a){var b=this.length,c=a.length,d=Math.min(b,c),e=this.split(""),a=a.split(""),f=0,j=0;if(f==j){j=f;for(d+=f;j<d;){var g=e[j],k=a[j];if(g!=k)return g-k;j++}}else for(;0!=d--;)if(g=e[f++],k=a[j++],g!=k)return g-k;return b-c};String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"")};
String.prototype.replaceAll=function(a,b){for(var c=this.indexOf(a),d=[],e=this;-1!=c;){var c=c+a.length,f=e.substring(0,c),e=e.substring(c),f=f.replace(a,b);d.push(f);c=e.indexOf(a)}""!==e&&d.push(e);return d.join("")};function normalSide(a,b){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.grayColor=$("<div class='kong' style='background-color:#888888;opacity:0.1'></div>");(this.isLeft=b)?(this.midShadow=$("<div class='leftShadow'></div>"),this.midShadow.css({width:userConfig.leftShadowWidth+"px",opacity:userConfig.leftShadowAlpha})):(this.midShadow=$("<div class='rightShadow'></div>"),
this.midShadow.css({width:userConfig.rightShadowWidth+"px",opacity:userConfig.rightShadowAlpha}));this.side.css({"background-color":getColor("pageBackgroundColor","#f5f5f5")});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-32)/2+"px",top:(this.height-32)/2+"px"});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.efftextArray=[];this.soundArray=[];this.bannerArray=[];this.vimeoArray=[];a.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.initEvent()}
normalSide.prototype.getSide=function(){return this.side};normalSide.prototype.fillContent=function(a){if(a!=this.imageIndex&&(this.imageIndex=a,this.sideContent.empty(),!(this.imageIndex>originTotalPageCount))){this.showLoading();var b=this;this.sideImg.attr("src",getPageDir(this.imageIndex,"normal"));this.imgLoaded=0;this.sideImg.load(function(){b.hideLoading();b.sideContent.append(b.sideImg);b.sideContent.append(b.grayColor);void 0!=pageEditor&&b.initMM()})}};
normalSide.prototype.imgFlipOver=function(a){a?(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"}))};
normalSide.prototype.initMM=function(){this.MMBackground.empty();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.efftextArray=[];this.soundArray=[];this.bannerArray=[];this.vimeoArray=[];if(!(0>=this.imageIndex||
pageEditor.length<this.imageIndex||null==pageEditor[this.imageIndex-1][0]))for(var a=0;a<pageEditor[this.imageIndex-1].length;a++){var b=pageEditor[this.imageIndex-1][a];if(pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_LINK){var c={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,downColor:b.downColor,downAlpha:b.downAlpha,overColor:b.overColor,overAlpha:b.overAlpha,outColor:b.outColor,outAlpha:b.outAlpha,action:b.action};this.linkArray.push(new initLink(this.MMBackground,
c,this.width,this.height))}else pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_YOUTUBE||pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_YOUTUBE1||pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_YOUTUBE2||pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_YOUTUBE3||pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_YOUTUBE4||pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_YOUTUBE5?(c=
{width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,id:b.videoId,moviePlayTriggerEvt:b.moviePlayTriggerEvt,movieStopTriggerEvt:b.movieStopTriggerEvt,playerParameters:b.playerParameters},pageEditor[this.imageIndex-1][a].annotype!=PageEditor.AnnoType.ANNO_YOUTUBE&&(c.id=b.videoID),youtubeObj=new initYoutube(this.MMBackground,c,this.width,this.height),this.youtubeArray.push(youtubeObj)):pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_VIDEO?
(c={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.url,moviePlayTriggerEvt:b.moviePlayTriggerEvt,movieStopTriggerEvt:b.movieStopTriggerEvt},b=new initVideo(this.MMBackground,c,this.width,this.height),this.videoArray.push(b)):pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_AUDIO?(b=pageEditor[this.imageIndex-1][a],c={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.soundURL,soundPlayTriggerEvt:b.soundPlayTriggerEvt,
soundStopTriggerEvt:b.soundStopTriggerEvt},b=new initAudio(this.MMBackground,c,this.width,this.height),this.audioArray.push(b)):pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_IMAGE?(b=pageEditor[this.imageIndex-1][a],c={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.url,action:b.action},imageObj=new initImage(this.MMBackground,c,this.width,this.height),this.imageArray.push(imageObj)):pageEditor[this.imageIndex-1][a].annotype==
PageEditor.AnnoType.ANNO_BUTTON?(b=pageEditor[this.imageIndex-1][a],c={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.url,action:b.action,buttonCaption:b.buttonCaption,captionY:b.captionY,HRate:b.HRate,Format:b.Format},this.buttonArray.push(new initButton(this.MMBackground,c,this.width,this.height))):pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_FLASHSHOW?(b=pageEditor[this.imageIndex-1][a],c={width:b.location.width,height:b.location.height,
x:b.location.x,y:b.location.y,alpha:b.alpha,photo:b.Images,repeatPlay:b.isRepeat},this.flashShowArray.push(new initFlashShow(this.MMBackground,c,this.width,this.height))):pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_LINE?(b=pageEditor[this.imageIndex-1][a],c={StartX:b.lineStartPX,StartY:b.lineStartPY,EndX:b.lineEndPX,EndY:b.lineEndPY,x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,lineAlpha:b.lineAlpha,alpha:b.alpha,lineWidth:b.lineWidth,lineType:b.lineType,
dotWidth:b.dotWidth,color:b.color,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,sr:b.shadow.shadowColor},this.lineArray.push(new initLine(this.MMBackground,c,this.width,this.height,this.imageIndex+a))):pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_ARROW?(b=pageEditor[this.imageIndex-1][a],c={StartX:b.lineStartPX,StartY:b.lineStartPY,EndX:b.lineEndPX,EndY:b.lineEndPY,x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,
alpha:b.alpha,lineWidth:b.lineWidth,lineType:b.lineType,dotWidth:b.dotWidth,color:b.color,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,arrowType:b.arrowType,sr:b.shadow.shadowColor},this.arrowArray.push(new initArrow(this.MMBackground,c,this.width,this.height,this.imageIndex+a))):pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_ROUND?(b=pageEditor[this.imageIndex-1][a],c={x:b.location.x,y:b.location.y,width:b.location.width,
height:b.location.height,alpha:b.alpha,fillStyle:b.fillStyle,color:b.color,ColorA:b.gradientColorA,ColorB:b.gradientColorB,angle:b.angle,spalpha:b.spalpha,borderWidth:b.borderWidth,borderColor:b.borderColor,borderAlpha:b.borderAlpha,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,sr:b.shadow.shadowColor,action:b.action},this.roundArray.push(new initRound(this.MMBackground,c,this.width,this.height,this.imageIndex+a))):pageEditor[this.imageIndex-
1][a].annotype==PageEditor.AnnoType.ANNO_RECTANGLE?(b=pageEditor[this.imageIndex-1][a],c={x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,alpha:b.alpha,fillStyle:b.fillStyle,color:b.color,ColorA:b.gradientColorA,ColorB:b.gradientColorB,angle:b.angle,spalpha:b.spalpha,borderWidth:b.borderWidth,borderColor:b.borderColor,borderAlpha:b.borderAlpha,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,sr:b.shadow.shadowColor,
action:b.action},this.reArray.push(new initRe(this.MMBackground,c,this.width,this.height,this.imageIndex+a))):pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_TEXT?(b=pageEditor[this.imageIndex-1][a],c={x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,alpha:b.alpha,textStr:b.textStr,lineH:b.lineHeightRation,pageH:b.formats.defaultFormat.pageH,bgalpha:b.background.alpha,fillBg:b.background.fillBg,bgcolor:b.background.color,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,
sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,sr:b.shadow.shadowColor,action:b.action},this.textArray.push(new initText(this.MMBackground,c,this.width,this.height,this.imageIndex+a))):pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_AREA?(b=pageEditor[this.imageIndex-1][a],c={x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,alpha:b.alpha,color:b.color,rounds:b.round,ellipseWidth:b.ellipseWidth,ellipseHeight:b.ellipseHeight,sh:b.shadow.hasDropShadow,
sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,sr:b.shadow.shadowColor,action:b.action},this.areaArray.push(new initArea(this.MMBackground,c,this.width,this.height,this.imageIndex+a))):pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_CALLOUT?(b=pageEditor[this.imageIndex-1][a],c={x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,alpha:b.alpha,textStr:b.textStr,pageH:b.formats.defaultFormat.pageH,bgalpha:b.background.alpha,
fillBg:b.background.fillBg,bgcolor:b.background.color,direct:b.hookDirect,cx1:b.hookContr1RatioX,cy1:b.hookContr1RatioY,cx2:b.hookContr2RatioX,cy2:b.hookContr2RatioY,pointx:b.hookContrPointRatioX,pointy:b.hookContrPointRatioY,cornerRadiut:b.cornerRadiut,borderWidth:b.borderWidth,borderColor:b.borderColor,bordreAlpha:b.bordreAlpha,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,sr:b.shadow.shadowColor},this.calloutArray.push(new initCallout(this.MMBackground,
c,this.width,this.height,this.imageIndex+a))):pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_ATEXT?(b=pageEditor[this.imageIndex-1][a],c={x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,alpha:b.alpha,textStr:b.strText,lineH:b.lineHeightRation,pageH:b.format.pageH,align:b.format.align,action:b.action,repeat:b.repeat,moveSpeed:b.moveSpeed,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,sr:b.shadow.shadowColor},
this.atextArray.push(new initAText(this.MMBackground,c,this.width,this.height,this.imageIndex+a))):pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_STARTEXT?(b=pageEditor[this.imageIndex-1][a],c={x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,alpha:b.alpha,textStr:b.strText,pageH:b.format.pageH,align:b.format.align,action:b.action,repeat:b.repeat,moveSpeed:b.moveSpeed,lineH:b.HRate,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,
se:b.shadow.shadowDistance,sr:b.shadow.shadowColor},this.startextArray.push(new initStarText(this.MMBackground,c,this.width,this.height,this.imageIndex+a))):pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_TEXTANIM?(b=pageEditor[this.imageIndex-1][a],c={x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,alpha:b.alpha,effectType:b.effectType,pageH:b.formats.defaultFormat.pageH,textStr:b.textStr,action:b.action,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,
sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,sr:b.shadow.shadowColor},this.aminArray.push(new initAminText(this.MMBackground,c,this.width,this.height,this.imageIndex+a))):pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_ATIMAGE?(b=pageEditor[this.imageIndex-1][a],c={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.url,action:b.action},atimageObj=new initPngImage(this.MMBackground,c,this.width,this.height),this.atimageArray.push(atimageObj)):
pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_EFFECTTEXT?(b=pageEditor[this.imageIndex-1][a],c={x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,alpha:b.alpha,textStr:b.htmlText,pageH:b.pageH,moveSpeed:b.effectStyle,lineH:b.HRate,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,sr:b.shadow.shadowColor},this.efftextArray.push(new initEffText(this.MMBackground,c,this.width,this.height,this.imageIndex+
a))):pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_BANNER?(b=pageEditor[this.imageIndex-1][a],c={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,action:b.action,banners:b.banners},this.bannerArray.push(new initBanner(this.MMBackground,c,this.width,this.height,this.imageIndex+a))):pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_VIDEO1?(c={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,
alpha:b.alpha,src:b.videoURL,moviePlayTriggerEvt:b.moviePlayTriggerEvt,movieStopTriggerEvt:b.movieStopTriggerEvt},b=new initVideo(this.MMBackground,c,this.width,this.height),this.videoArray.push(b)):pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_VIDEO2?(c={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.videoURL,moviePlayTriggerEvt:b.moviePlayTriggerEvt,movieStopTriggerEvt:b.movieStopTriggerEvt},b=new initVideo(this.MMBackground,
c,this.width,this.height),this.videoArray.push(b)):pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_AUDIO1?(c={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.soundList.sound.path,soundPlayTriggerEvt:b.soundPlayTriggerEvt,soundStopTriggerEvt:b.soundStopTriggerEvt},b=new initAudio(this.MMBackground,c,this.width,this.height),this.audioArray.push(b)):pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_AUDIO2?(c={width:b.location.width,
height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.data.item.fname,soundPlayTriggerEvt:b.soundPlayTriggerEvt,soundStopTriggerEvt:b.soundStopTriggerEvt},b=new initAudio(this.MMBackground,c,this.width,this.height),this.audioArray.push(b)):pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_AUDIO3?(c={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.componentData.songs.song.url,soundPlayTriggerEvt:b.soundPlayTriggerEvt,
soundStopTriggerEvt:b.soundStopTriggerEvt},b=new initAudio(this.MMBackground,c,this.width,this.height),this.audioArray.push(b)):pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_VIMEO?(c={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,id:b.videoID},b=new initVimeo(this.MMBackground,c,this.width,this.height),this.vimeoArray.push(b)):pageEditor[this.imageIndex-1][a].annotype==PageEditor.AnnoType.ANNO_VIMEO1&&(b=new initVimeo1(this.MMBackground,b,this.width,
this.height),this.vimeoArray.push(b))}};normalSide.prototype.changeTo0x=function(a){var b=a;"#"!=a.substr(0,1)&&"0x"!=a.substr(0,2)&&(b="#"+parseInt(a).toString(16));"0x"==a.substr(0,2)&&(b=a.replace("0x","#"));return b};normalSide.prototype.showGray=function(){this.grayColor.css({display:"block"})};normalSide.prototype.hideGray=function(){this.grayColor.css({display:"none"})};
normalSide.prototype.onResize=function(a,b){this.side.css({width:a+"px",height:b+"px"});this.sideContent.css({width:a+"px",height:b+"px"});this.sideImg.css({width:a+"px",height:b+"px"});this.grayColor.css({width:a+"px",height:b+"px"});this.MMBackground.css({width:a+"px",height:b+"px"});this.midShadow.css({height:b+"px"});this.loadingImg.css({left:(a-32)/2+"px",top:(b-32)/2+"px"});for(var c=0;c<this.linkArray.length;c++)this.linkArray[c].onResize(a,b);for(c=0;c<this.youtubeArray.length;c++)this.youtubeArray[c].onResize(a,
b);for(c=0;c<this.videoArray.length;c++)this.videoArray[c].onResize(a,b);for(c=0;c<this.audioArray.length;c++)this.audioArray[c].onResize(a,b);for(c=0;c<this.imageArray.length;c++)this.imageArray[c].onResize(a,b);for(c=0;c<this.buttonArray.length;c++)this.buttonArray[c].onResize(a,b);for(c=0;c<this.flashShowArray.length;c++)this.flashShowArray[c].onResize(a,b);for(c=0;c<this.arrowArray.length;c++)this.arrowArray[c].onResize(a,b);for(c=0;c<this.lineArray.length;c++)this.lineArray[c].onResize(a,b);
for(c=0;c<this.reArray.length;c++)this.reArray[c].onResize(a,b);for(c=0;c<this.textArray.length;c++)this.textArray[c].onResize(a,b);for(c=0;c<this.roundArray.length;c++)this.roundArray[c].onResize(a,b);for(c=0;c<this.areaArray.length;c++)this.areaArray[c].onResize(a,b);for(c=0;c<this.calloutArray.length;c++)this.calloutArray[c].onResize(a,b);for(c=0;c<this.atextArray.length;c++)this.atextArray[c].onResize(a,b);for(c=0;c<this.startextArray.length;c++)this.startextArray[c].onResize(a,b);for(c=0;c<this.aminArray.length;c++)this.aminArray[c].onResize(a,
b);for(c=0;c<this.atimageArray.length;c++)this.atimageArray[c].onResize(a,b);for(c=0;c<this.efftextArray.length;c++)this.efftextArray[c].onResize(a,b);for(c=0;c<this.soundArray.length;c++)this.soundArray[c].onResize(a,b);for(c=0;c<this.bannerArray.length;c++)this.bannerArray[c].onResize(a,b);for(c=0;c<this.vimeoArray.length;c++)this.vimeoArray[c].onResize(a,b);this.width=a;this.height=b};normalSide.prototype.sideAddChild=function(a){this.side.append(a)};
normalSide.prototype.enterSide=function(){for(var a=0;a<this.youtubeArray.length;a++)this.youtubeArray[a].getPlayEvt(),this.youtubeArray[a].getStopEvt();for(a=0;a<this.videoArray.length;a++)this.videoArray[a].getPlayEvt()==PageEditor.PlayEvt.EVT_PLAY&&this.videoArray[a].playVideo(),this.videoArray[a].getStopEvt()==PageEditor.PlayEvt.EVT_PLAY&&this.videoArray[a].pauseVideo();for(a=0;a<this.audioArray.length;a++)this.audioArray[a].getPlayEvt()==PageEditor.PlayEvt.EVT_PLAY&&this.audioArray[a].play(),
this.audioArray[a].getStopEvt()==PageEditor.PlayEvt.EVT_PLAY&&this.audioArray[a].pause()};
normalSide.prototype.leaveSide=function(){for(var a=0;a<this.youtubeArray.length;a++)this.youtubeArray[a].getPlayEvt(),this.youtubeArray[a].getStopEvt();for(a=0;a<this.videoArray.length;a++)this.videoArray[a].getPlayEvt()==PageEditor.PlayEvt.EVT_STOP&&this.videoArray[a].playVideo(),this.videoArray[a].getStopEvt()==PageEditor.PlayEvt.EVT_STOP&&this.videoArray[a].pauseVideo();for(a=0;a<this.audioArray.length;a++)this.audioArray[a].getPlayEvt()==PageEditor.PlayEvt.EVT_STOP&&this.audioArray[a].play(),
this.audioArray[a].getStopEvt()==PageEditor.PlayEvt.EVT_STOP&&this.audioArray[a].pause()};normalSide.prototype.hideYoutube=function(){for(var a=0;a<this.youtubeArray.length;a++)this.youtubeArray[a].hide()};normalSide.prototype.showYoutube=function(){for(var a=0;a<this.youtubeArray.length;a++)this.youtubeArray[a].show()};
normalSide.prototype.initZoom=function(){var a=!1;this.zw=this.width;this.zh=this.height;this.isZoom=!1;var b=Point(0,0),c=Point(0,0);this.side.bind(_event._down,function(d){d=d.originalEvent.touches;2==d.length&&(a=!0,b=Point(d[0].pageX,d[0].pageY),c=Point(d[1].pageX,d[1].pageY))});this.side.bind(_event._end,function(){});this.side.bind(_event._move,function(d){d=d.originalEvent.touches;a&&(100<=Math.pow(b.x-d[0].pageX,2)+Math.pow(b.y-d[0].pageY,2)||(Math.pow(c.x-d[1].pageX,2),Math.pow(c.y-d[1].pageY,
2)))})};normalSide.prototype.showLoading=function(){this.side.append(this.loadingImg)};normalSide.prototype.hideLoading=function(){this.loadingImg.remove()};
normalSide.prototype.initEvent=function(){var a=this;this.side.hammer().on("doubletap",function(b){doubleTapTime=(new Date).getTime();var c=b.gesture.center.pageX,b=b.gesture.center.pageY;x=(c-a.side.offset().left)/a.width;y=(b-a.side.offset().top)/a.height;bookType=2;zoomBook.currentIndex=a.imageIndex;zoomBook.showPage.fillContent(zoomBook.currentIndex);setCurrentIndexTextField(zoomBook.currentIndex,!1);zoomBook.showPage.zoomFromOtherBook(a.width,a.height,a.side.offset().left,a.side.offset().top,
c,b);toolBar.btnZoom.empty().append(getImage(toolBarIconsURL[6])).attr("title",getLanguage("btnZoomOut","Zoom Out"));thumbnail.clearHighLight();thumbnail.setHighLight(zoomBook.currentIndex);changeShowBook(2)})};function normalPage(){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}
normalPage.prototype.create=function(a){this.page=$("<div class='paper'></div>");this.mask=$("<div class='pageMask'></div>");this.sideAPosition=$("<div class='sidePosition'></div>");this.sideBPosition=$("<div class='sidePosition'></div>");this.flipBackShadow=$("<div class='backShadow'></div>");this.flipFrontShadow=$("<div class='frontShadow'></div>");this.sideA=new normalSide(this.sideAPosition,!1);this.sideB=new normalSide(this.sideBPosition,!0);this.page.append(this.flipBackShadow);a.append(this.page);
this.page.append(this.mask);this.mask.append(this.sideAPosition);this.mask.append(this.sideBPosition);this.sideAPosition.append(this.sideA.side);this.sideBPosition.append(this.sideB.side)};normalPage.prototype.getSideA=function(){return this.sideA};normalPage.prototype.getSideB=function(){return this.sideB};
normalPage.prototype.onResize=function(a,b,c,d){this.page.css({width:a+"px",height:b+"px",left:d+"px"});this.mask.css({width:a+"px",height:b+"px"});this.flipBackShadow.css({width:a+"px",height:b+"px"});this.flipFrontShadow.css({width:a+"px",height:b+"px"});this.sideAPosition.css({width:a+"px",height:b+"px"});this.sideBPosition.css({width:a+"px",height:b+"px"});this.sideA.onResize(a,b);this.sideB.onResize(a,b);this.width=a;this.height=b;this.maskWidth=c};
normalPage.prototype.fillSideA=function(a){this.sideA.fillContent(a);this.pageIndex=a;this.isHardPage=!1;1==a&&hardPageEnable&&3!=browserType&&(this.isHardPage=!0)};normalPage.prototype.fillSideB=function(a){this.sideB.fillContent(a);a==totalPageCount&&hardPageEnable&&3!=browserType&&(this.isHardPage=!0)};
normalPage.prototype.beginFlip=function(a){this.corner=a;this.isLeft()?(this.sideA.sideAddChild(this.flipFrontShadow),this.pageStatu=!0):(this.sideB.sideAddChild(this.flipFrontShadow),this.pageStatu=!1);1>=flipBook.gotoPageIndex&&flipBook.bmt.leftBox.hide();flipBook.gotoPageIndex>=totalPageCount&&flipBook.bmt.rightBox.hide();3>=flipBook.gotoPageIndex&&flipBook.setLeftThicknessVisible(!1);flipBook.gotoPageIndex>=totalPageCount-2&&flipBook.setRightThicknessVisible(!1);this.mask.css({width:this.maskWidth+
"px",height:this.maskWidth+"px"});flipBook.normalBookShadow.hideShadow()};
normalPage.prototype.flipToPoint=function(a,b,c){if(this.isHardPage)this.hardFlip(a,c);else if(this.isCorner(a,b))this.resetPage(this.isLeft());else{var d=computePoint(this.corner,a,b,this.width,this.height,this.maskWidth,this.flipFrontShadow,this.flipBackShadow),a=d.Angle,b=d.Df,e=d.NomovePoint,d=d.Mv,f=this.isLeft(),j=this.isBottom();c&&(this.showShadow(),this.page.css({left:f?"0px":this.width+"px"}),this.sideAPosition.css({right:f?"0px":"auto",left:f?"auto":"0px",top:j?"auto":"0px",bottom:j?"0px":
"auto"}),this.sideBPosition.css({right:f?"0px":"auto",left:f?"auto":"0px",top:j?"auto":"0px",bottom:j?"0px":"auto"}),this.setSideUp(f),f?this.sideA.hideGray():this.sideB.hideGray());switch(this.corner){case "tl":this.rotateElement(this.mask,"100% 0%",translate(-e.x+this.width-this.maskWidth+d.x,-e.y+d.y)+rotate(-a));this.rotateElement(this.sideBPosition,"100% 0%",rotate(a)+translate(e.x-d.x,e.y-d.y));this.rotateElement(this.sideAPosition,"100% 0%",rotate(a)+translate(e.x+b.x-d.x,e.y+b.y-d.y));this.rotateElement(this.sideA.side,
"100% 0%",translate(-this.width,0)+rotate(2*(90-a)));break;case "tr":this.rotateElement(this.mask,"0% 0%",translate(e.x+d.x,-e.y+d.y)+rotate(a));this.rotateElement(this.sideAPosition,"0% 0%",rotate(-a)+translate(-e.x-d.x,e.y-d.y));this.rotateElement(this.sideBPosition,"0% 0%",rotate(-a)+translate(-e.x-d.x+b.x,e.y+b.y-d.y));this.rotateElement(this.sideB.getSide(),"0% 0%",translate(0,0)+rotate(2*(a-90)));break;case "bl":this.rotateElement(this.mask,"100% 100%",translate(-e.x+this.width-this.maskWidth+
d.x,e.y+this.height-this.maskWidth+d.y)+rotate(a));this.rotateElement(this.sideBPosition,"100% 100%",rotate(-a)+translate(e.x-d.x,-e.y-d.y));this.rotateElement(this.sideAPosition,"100% 100%",rotate(-a)+translate(e.x+b.x-d.x,-e.y-d.y+b.y));this.rotateElement(this.sideA.getSide(),"100% 100%",translate(-this.width,-this.height)+rotate(2*(a-90)));break;case "br":this.rotateElement(this.mask,"0% 100%",translate(e.x+d.x,e.y+this.height-this.maskWidth+d.y)+rotate(-a)),this.rotateElement(this.sideAPosition,
"0% 100%",rotate(a)+translate(-e.x-d.x,-e.y-d.y)),this.rotateElement(this.sideBPosition,"0% 100%",rotate(a)+translate(-e.x+b.x-d.x,-e.y+b.y-d.y)),this.rotateElement(this.sideB.getSide(),"0% 100%",translate(0,-this.height)+rotate(2*(90-a)))}}};normalPage.prototype.flipToAnPoint=function(a,b,c){this.beginFlip(c);this.flipToPoint(a,b,!0);"tl"==c||"bl"==c?this.setSideUp(!0):this.setSideUp(!1)};
normalPage.prototype.endFlip=function(){this.hideShadow();this.pageStatu=this.isLeft()?!1:!0;this.sideA.showGray();this.sideB.showGray();flipBook.normalBookShadow.showShadow()};
normalPage.prototype.hardFlip=function(a,b){var c=!1;if("tl"==this.corner||"bl"==this.corner)c=!0;var d=c?a-this.width:a;d<-this.width&&(d=-this.width);d>=this.width&&(d=this.width);d=180*Math.acos(d/this.width)/Math.PI;c?(b&&(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})),d=180-d,this.page.css({"-webkit-transform":"perspective(3000px) rotateY("+d+"deg) translate3d(0px,0px,-1px)","-moz-transform":"perspective(3000px) rotateY("+d+"deg)"}),90<=d?this.setSideUp(!0):this.setSideUp(!1)):(b&&(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("+-d+"deg)","-moz-transform":"perspective(3000px) rotateY("+-d+"deg)"}),90<=d?this.setSideUp(!1):this.setSideUp(!0))};
normalPage.prototype.resetPage=function(a){var b=this;this.isHardPage&&(this.sideA.imgFlipOver(!1),this.sideB.imgFlipOver(!1),!this.isLastPageReset&&this.pageIndex+1==totalPageCount?(this.isLastPageReset=!0,window.setTimeout(function(){b.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({"-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.page.css({left:a?"0px":this.width+"px"});this.mask.css({top:"0px",left:"0px",bottom:"auto",right:"auto",width:this.width,height:this.height});this.rotateElement(this.mask,"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))};normalPage.prototype.setSideUp=function(a){this.sideAPosition.css({"z-index":a?2:1});this.sideBPosition.css({"z-index":a?1:2})};
normalPage.prototype.rotateElement=function(a,b,c){a.css({"-webkit-transform-origin":b,"-moz-transform-origin":b,"-ms-transform-origin":b,"-o-transform-origin":b,"-webkit-transform":c,"-moz-transform":c,"-ms-transform":c,"-o-transform":c})};normalPage.prototype.translateElement=function(a,b,c){a.css({"-webkit-transform":"translate("+b+"px,"+c+"px)","-moz-transform":"translate("+b+"px,"+c+"px)","-o-transform":"translate("+b+"px,"+c+"px)","-ms-transform":"translate("+b+"px,"+c+"px)"})};
normalPage.prototype.isTop=function(){return 0<=this.corner.indexOf("t")};normalPage.prototype.isLeft=function(){return 0<=this.corner.indexOf("l")};normalPage.prototype.isBottom=function(){return 0<=this.corner.indexOf("b")};normalPage.prototype.isRight=function(){return 0<=this.corner.indexOf("r")};normalPage.prototype.isCorner=function(a,b){var c=0;this.isTop()&&0==b&&c++;this.isBottom()&&b==this.height&&c++;this.isLeft()&&0==a&&c++;this.isRight()&&a==this.width&&c++;return 2==c};
normalPage.prototype.setPageVisible=function(a){a?(this.page.css({display:"block"}),this.pageVisible=!0):(this.page.css({display:"none"}),this.pageVisible=!1)};normalPage.prototype.getPageStatu=function(){return this.pageStatu};normalPage.prototype.setPageStatu=function(a){this.pageStatu=a};normalPage.prototype.showShadow=function(){this.flipFrontShadow.css({display:"block"});this.flipBackShadow.css({display:"block"})};
normalPage.prototype.hideShadow=function(){this.flipFrontShadow.css({display:"none"});this.flipBackShadow.css({display:"none"})};normalPage.prototype.setCSS=function(a){this.page.css(a)};normalPage.prototype.showYoutube=function(){this.sideA.showYoutube();this.sideB.showYoutube()};normalPage.prototype.hideYoutube=function(){this.sideA.hideYoutube();this.sideB.hideYoutube()};function rightToLeftNormalPage(){normalPage.call(this)}$.extend(rightToLeftNormalPage.prototype,normalPage.prototype);
rightToLeftNormalPage.prototype.create=function(a){this.page=$("<div class='paper'></div>");this.mask=$("<div class='pageMask'></div>");this.sideAPosition=$("<div class='sidePosition'></div>");this.sideBPosition=$("<div class='sidePosition'></div>");this.flipBackShadow=$("<div class='backShadow'></div>");this.flipFrontShadow=$("<div class='frontShadow'></div>");this.sideA=new normalSide(this.sideAPosition,!0);this.sideB=new normalSide(this.sideBPosition,!1);this.page.append(this.flipBackShadow);a.append(this.page);
this.page.append(this.mask);this.mask.append(this.sideAPosition);this.mask.append(this.sideBPosition);this.sideAPosition.append(this.sideA.side);this.sideBPosition.append(this.sideB.side)};
rightToLeftNormalPage.prototype.beginFlip=function(a){this.corner=a;this.isLeft()?(this.sideB.sideAddChild(this.flipFrontShadow),this.pageStatu=!0):(this.sideA.sideAddChild(this.flipFrontShadow),this.pageStatu=!1);1>=flipBook.gotoPageIndex&&flipBook.bmt.rightBox.hide();flipBook.gotoPageIndex>=totalPageCount&&flipBook.bmt.leftBox.hide();3>=flipBook.gotoPageIndex&&flipBook.setLeftThicknessVisible(!1);flipBook.gotoPageIndex>=totalPageCount-2&&flipBook.setRightThicknessVisible(!1);this.mask.css({width:this.maskWidth+
"px",height:this.maskWidth+"px"});flipBook.normalBookShadow.hideShadow()};
rightToLeftNormalPage.prototype.flipToPoint=function(a,b,c){if(this.isHardPage)this.hardFlip(a,c);else if(this.isCorner(a,b))this.resetPage(!this.isLeft());else{var d=computePoint(this.corner,a,b,this.width,this.height,this.maskWidth,this.flipFrontShadow,this.flipBackShadow),a=d.Angle,b=d.Df,e=d.NomovePoint,d=d.Mv,f=this.isLeft(),j=this.isBottom();c&&(this.showShadow(),this.page.css({left:f?"0px":this.width+"px"}),this.sideAPosition.css({right:f?"0px":"auto",left:f?"auto":"0px",top:j?"auto":"0px",
bottom:j?"0px":"auto"}),this.sideBPosition.css({right:f?"0px":"auto",left:f?"auto":"0px",top:j?"auto":"0px",bottom:j?"0px":"auto"}),this.setSideUp(!f),f?this.sideA.hideGray():this.sideB.hideGray());switch(this.corner){case "tl":this.rotateElement(this.mask,"100% 0%",translate(-e.x+this.width-this.maskWidth+d.x,-e.y+d.y)+rotate(-a));this.rotateElement(this.sideAPosition,"100% 0%",rotate(a)+translate(e.x-d.x,e.y-d.y));this.rotateElement(this.sideBPosition,"100% 0%",rotate(a)+translate(e.x+b.x-d.x,e.y+
b.y-d.y));this.rotateElement(this.sideB.side,"100% 0%",translate(-this.width,0)+rotate(2*(90-a)));break;case "tr":this.rotateElement(this.mask,"0% 0%",translate(e.x+d.x,-e.y+d.y)+rotate(a));this.rotateElement(this.sideBPosition,"0% 0%",rotate(-a)+translate(-e.x-d.x,e.y-d.y));this.rotateElement(this.sideAPosition,"0% 0%",rotate(-a)+translate(-e.x-d.x+b.x,e.y+b.y-d.y));this.rotateElement(this.sideA.getSide(),"0% 0%",translate(0,0)+rotate(2*(a-90)));break;case "bl":this.rotateElement(this.mask,"100% 100%",
translate(-e.x+this.width-this.maskWidth+d.x,e.y+this.height-this.maskWidth+d.y)+rotate(a));this.rotateElement(this.sideAPosition,"100% 100%",rotate(-a)+translate(e.x-d.x,-e.y-d.y));this.rotateElement(this.sideBPosition,"100% 100%",rotate(-a)+translate(e.x+b.x-d.x,-e.y-d.y+b.y));this.rotateElement(this.sideB.getSide(),"100% 100%",translate(-this.width,-this.height)+rotate(2*(a-90)));break;case "br":this.rotateElement(this.mask,"0% 100%",translate(e.x+d.x,e.y+this.height-this.maskWidth+d.y)+rotate(-a)),
this.rotateElement(this.sideBPosition,"0% 100%",rotate(a)+translate(-e.x-d.x,-e.y-d.y)),this.rotateElement(this.sideAPosition,"0% 100%",rotate(a)+translate(-e.x+b.x-d.x,-e.y+b.y-d.y)),this.rotateElement(this.sideA.getSide(),"0% 100%",translate(0,-this.height)+rotate(2*(90-a)))}}};
rightToLeftNormalPage.prototype.hardFlip=function(a,b){var c=!1;if("tl"==this.corner||"bl"==this.corner)c=!0;var d=c?a-this.width:a;d<-this.width&&(d=-this.width);d>=this.width&&(d=this.width);d=180*Math.acos(d/this.width)/Math.PI;c?(b&&(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})),d=180-d,this.page.css({"-webkit-transform":"perspective(3000px) rotateY("+d+"deg) translate3d(0px,0px,-1px)","-moz-transform":"perspective(3000px) rotateY("+d+"deg)"}),90<=d?this.setSideUp(!1):this.setSideUp(!0)):(b&&(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("+-d+"deg)","-moz-transform":"perspective(3000px) rotateY("+-d+"deg)"}),90<=d?this.setSideUp(!0):this.setSideUp(!1))};
rightToLeftNormalPage.prototype.resetPage=function(a){var b=this;this.isHardPage&&(this.sideA.imgFlipOver(!1),this.sideB.imgFlipOver(!1),!this.isLastPageReset&&this.pageIndex+1==totalPageCount?(this.isLastPageReset=!0,window.setTimeout(function(){b.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({"-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.page.css({left:!a?"0px":this.width+"px"});this.mask.css({top:"0px",left:"0px",bottom:"auto",right:"auto",width:this.width,height:this.height});this.rotateElement(this.mask,"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))};function androidPage(){normalPage.call(this)}$.extend(androidPage.prototype,normalPage.prototype);
androidPage.prototype.flipToPoint=function(a,b,c){if(this.isHardPage)this.hardFlip(a,c);else if(this.isCorner(a,b))this.resetPage(this.isLeft());else{var d=computePoint(this.corner,a,this.isTop()?0:this.height,this.width,this.height,this.maskWidth,this.flipFrontShadow,this.flipBackShadow),a=d.Angle,b=d.Df,e=d.NomovePoint,d=d.Mv,f=this.isLeft(),j=this.isBottom();c&&(this.showShadow(),this.page.css({left:f?"0px":this.width+"px"}),this.sideAPosition.css({right:f?"0px":"auto",left:f?"auto":"0px",top:j?
"auto":"0px",bottom:j?"0px":"auto"}),this.sideBPosition.css({right:f?"0px":"auto",left:f?"auto":"0px",top:j?"auto":"0px",bottom:j?"0px":"auto"}),this.setSideUp(f),f?this.sideA.hideGray():this.sideB.hideGray());switch(this.corner){case "tl":this.rotateElement(this.mask,"100% 0%",translate(-e.x+this.width-this.maskWidth+d.x,-e.y+d.y)+rotate(-a));this.rotateElement(this.sideBPosition,"100% 0%",rotate(a)+translate(e.x-d.x,e.y-d.y));this.rotateElement(this.sideAPosition,"100% 0%",rotate(a)+translate(e.x+
b.x-d.x,e.y+b.y-d.y));this.rotateElement(this.sideA.side,"100% 0%",translate(-this.width,0)+rotate(2*(90-a)));break;case "tr":this.rotateElement(this.mask,"0% 0%",translate(e.x+d.x,-e.y+d.y)+rotate(a));this.rotateElement(this.sideAPosition,"0% 0%",rotate(-a)+translate(-e.x-d.x,e.y-d.y));this.rotateElement(this.sideBPosition,"0% 0%",rotate(-a)+translate(-e.x-d.x+b.x,e.y+b.y-d.y));this.rotateElement(this.sideB.getSide(),"0% 0%",translate(0,0)+rotate(2*(a-90)));break;case "bl":this.rotateElement(this.mask,
"100% 100%",translate(-e.x+this.width-this.maskWidth+d.x,e.y+this.height-this.maskWidth+d.y)+rotate(a));this.rotateElement(this.sideBPosition,"100% 100%",rotate(-a)+translate(e.x-d.x,-e.y-d.y));this.rotateElement(this.sideAPosition,"100% 100%",rotate(-a)+translate(e.x+b.x-d.x,-e.y-d.y+b.y));this.rotateElement(this.sideA.getSide(),"100% 100%",translate(-this.width,-this.height)+rotate(2*(a-90)));break;case "br":this.rotateElement(this.mask,"0% 100%",translate(e.x+d.x,e.y+this.height-this.maskWidth+
d.y)+rotate(-a)),this.rotateElement(this.sideAPosition,"0% 100%",rotate(a)+translate(-e.x-d.x,-e.y-d.y)),this.rotateElement(this.sideBPosition,"0% 100%",rotate(a)+translate(-e.x+b.x-d.x,-e.y+b.y-d.y)),this.rotateElement(this.sideB.getSide(),"0% 100%",translate(0,-this.height)+rotate(2*(90-a)))}}};function androidRightPage(){rightToLeftNormalPage.call(this)}$.extend(androidRightPage.prototype,rightToLeftNormalPage.prototype);
androidRightPage.prototype.flipToPoint=function(a,b,c){if(this.isHardPage)this.hardFlip(a,c);else if(this.isCorner(a,b))this.resetPage(!this.isLeft());else{var d=computePoint(this.corner,a,this.isTop()?0:this.height,this.width,this.height,this.maskWidth,this.flipFrontShadow,this.flipBackShadow),a=d.Angle,b=d.Df,e=d.NomovePoint,d=d.Mv,f=this.isLeft(),j=this.isBottom();c&&(this.showShadow(),this.page.css({left:f?"0px":this.width+"px"}),this.sideAPosition.css({right:f?"0px":"auto",left:f?"auto":"0px",
top:j?"auto":"0px",bottom:j?"0px":"auto"}),this.sideBPosition.css({right:f?"0px":"auto",left:f?"auto":"0px",top:j?"auto":"0px",bottom:j?"0px":"auto"}),this.setSideUp(!f),f?this.sideA.hideGray():this.sideB.hideGray());switch(this.corner){case "tl":this.rotateElement(this.mask,"100% 0%",translate(-e.x+this.width-this.maskWidth+d.x,-e.y+d.y)+rotate(-a));this.rotateElement(this.sideAPosition,"100% 0%",rotate(a)+translate(e.x-d.x,e.y-d.y));this.rotateElement(this.sideBPosition,"100% 0%",rotate(a)+translate(e.x+
b.x-d.x,e.y+b.y-d.y));this.rotateElement(this.sideB.side,"100% 0%",translate(-this.width,0)+rotate(2*(90-a)));break;case "tr":this.rotateElement(this.mask,"0% 0%",translate(e.x+d.x,-e.y+d.y)+rotate(a));this.rotateElement(this.sideBPosition,"0% 0%",rotate(-a)+translate(-e.x-d.x,e.y-d.y));this.rotateElement(this.sideAPosition,"0% 0%",rotate(-a)+translate(-e.x-d.x+b.x,e.y+b.y-d.y));this.rotateElement(this.sideA.getSide(),"0% 0%",translate(0,0)+rotate(2*(a-90)));break;case "bl":this.rotateElement(this.mask,
"100% 100%",translate(-e.x+this.width-this.maskWidth+d.x,e.y+this.height-this.maskWidth+d.y)+rotate(a));this.rotateElement(this.sideAPosition,"100% 100%",rotate(-a)+translate(e.x-d.x,-e.y-d.y));this.rotateElement(this.sideBPosition,"100% 100%",rotate(-a)+translate(e.x+b.x-d.x,-e.y-d.y+b.y));this.rotateElement(this.sideB.getSide(),"100% 100%",translate(-this.width,-this.height)+rotate(2*(a-90)));break;case "br":this.rotateElement(this.mask,"0% 100%",translate(e.x+d.x,e.y+this.height-this.maskWidth+
d.y)+rotate(-a)),this.rotateElement(this.sideBPosition,"0% 100%",rotate(a)+translate(-e.x-d.x,-e.y-d.y)),this.rotateElement(this.sideAPosition,"0% 100%",rotate(a)+translate(-e.x+b.x-d.x,-e.y+b.y-d.y)),this.rotateElement(this.sideA.getSide(),"0% 100%",translate(0,-this.height)+rotate(2*(90-a)))}}};var bookMouseDown=!1,nBookStatu=0;function normalBook(){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.flipBookContainer=$("<div style='left:0px;top:0px;right:0px;bottom:0px;position:absolute;'></div>")}
normalBook.prototype.create=function(a){this.father=a;this.flipBook=$("<div class='flipBook' id='flipBook'></div>");a.append(this.flipBookContainer);this.flipBookContainer.append(this.flipBook);"android"==device.name?(this.previousPage=new androidPage,this.currentPage=new androidPage,this.currentPage2=new androidPage,this.nextPage=new androidPage):(this.previousPage=new normalPage,this.currentPage=new normalPage,this.currentPage2=new normalPage,this.nextPage=new normalPage);this.previousPage.create(this.flipBook);
this.currentPage.create(this.flipBook);this.currentPage2.create(this.flipBook);this.nextPage.create(this.flipBook);this.leftThickness=thickness(!0);this.rightThickness=thickness(!1);this.normalBookShadow=new bookShadow(this.pageWidth,this.pageHeight,this.flipBook);this.bmt=new initBookMarkTab(this.flipBook);this.flipBook.append(this.leftThickness);this.flipBook.append(this.rightThickness);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);this.currentPageIndex>=totalPageCount-2&&this.rightThickness.setVisible(!1);this.resetPageZIndex();this.initBookEvent()};
normalBook.prototype.onResize=function(a,b){this.width=2*a;this.height=b;this.pageWidth=a;this.pageHeight=b;this.maskWidth=Math.sqrt(a*a+b*b);this.flipBook.css({width:this.width+"px",height:this.height+"px"});this.previousPage.onResize(a,b,this.maskWidth,0);this.currentPage.onResize(a,b,this.maskWidth,0);this.currentPage2.onResize(a,b,this.maskWidth,a);this.nextPage.onResize(a,b,this.maskWidth,a);this.leftThickness.onResize(15,b);this.rightThickness.onResize(15,b);normalEventRadius=Math.pow(Math.ceil(a/
3),2);this.normalBookShadow.onResize(this.pageWidth,this.pageHeight,1!=this.currentPageIndex&&this.currentPageIndex!=totalPageCount);this.normalBookShadow.setPosition(1==this.currentPageIndex?a:0,0);this.bmt.resize(b,60)};normalBook.prototype.getCurrentPageIndex=function(){return this.currentPageIndex};normalBook.prototype.getPageWidth=function(a){if(void 0==a)return this.pageWidth;this.pageWidth=a};
normalBook.prototype.getPageHeight=function(a){if(void 0==a)return this.pageHeight;this.pageHeight=a};normalBook.prototype.getWidth=function(){return this.width};normalBook.prototype.getHeight=function(){return this.height};normalBook.prototype.getLeft=function(){return this.flipBook.offset().left};normalBook.prototype.getTop=function(){return this.flipBook.offset().top};normalBook.prototype.setCSS=function(a){this.flipBook.css(a)};
normalBook.prototype.setPosition=function(a,b,c){void 0==c&&(c=["left","top"]);this.flipBook.css(c[0],a+"px");this.flipBook.css(c[1],b+"px")};
normalBook.prototype.timer=function(a,b,c,d,e,f,j,g){void 0==j&&(j=!1);void 0==g&&(g=!1);var k=0<=a.indexOf("l"),l=0<=a.indexOf("t");j||(this.currentPage.setCSS({"z-index":k?7:6}),this.currentPage2.setCSS({"z-index":k?6:7}));flipping=!0;stopFlip=!1;var n=(d.y-e.y)/b,m=0;getSpeedArray((d.x-e.x)/b,b);getSpeedArray(n,b);Point(0,0);var o=this;this.hideYoutube();this.intervalID=setInterval(function(){m++;o.flipPoint.x=$.easing.swing(null,m,e.x,d.x-e.x,b);o.flipPoint.y=$.easing.swing(null,m,e.y,d.y-e.y,
b);if(f)o.flipPoint.y=0.2*Math.sqrt(Math.pow(o.pageWidth,2)-Math.pow(k?o.flipPoint.x-o.pageWidth:o.flipPoint.x,2));if(m==b)o.flipPoint=d;if(stopFlip){window.clearInterval(o.intervalID);o.betweenPaperCount=k?-1:1;o.gotoPageIndex=k?Math.floor(o.currentPageIndex/2-1)*2+1:Math.floor(o.currentPageIndex/2+1)*2;var c=Point(k?2*o.pageWidth:-o.pageWidth,l?0:o.pageHeight);o.timer(a,6,30,c,o.flipPoint,false,true,true);auto_player.resetTimer()}else{o.flippingPage.flipToPoint(o.flipPoint.x,o.flipPoint.y,m==1);
if(m>=b){_rimFlip.isRimFlip||auto_player.resetTimer();window.clearInterval(o.intervalID);flipping=false;if(g||f){o.flippingPage.endFlip();o.afterGotoPage()}else if(j||!_rimFlip.isRimFlip)if(j){if(!f&&!g){nBookStatu=normalBookStatu.book_statu_ready;o.flippingPage.setSideUp(o.flippingPage.isLeft()?false:true);o.currentPageIndex>3&&!o.leftThickness.visible&&o.leftThickness.setVisible(true);o.currentPageIndex<totalPageCount-2&&!o.rightThickness.visible&&o.rightThickness.setVisible(true);o.currentPageIndex>
1&&o.bmt.leftBox.show();o.currentPageIndex<totalPageCount&&o.bmt.rightBox.show();if(o.currentPageIndex==1){o.normalBookShadow.onResize(o.pageWidth,o.pageHeight,false);o.normalBookShadow.setPosition(o.pageWidth,0)}else{if(o.currentPageIndex==totalPageCount)o.normalBookShadow.onResize(o.pageWidth,o.pageHeight,false);else o.normalBookShadow.onResize(o.pageWidth,o.pageHeight,true);o.normalBookShadow.setPosition(0,0)}o.normalBookShadow.showShadow();o.showCurrentYoutube()}}else bookMouseDown=true}}},c)};
normalBook.prototype.gotoPage=function(a){if(1>a||a>totalPageCount)_tipsBox.setCaption(1>a?"This is the first page":"This is the last page"),_tipsBox.showTipsBox();else if(0==nBookStatu&&this.setGotoPage(a)){a==totalPageCount&&this.nextPage.setPageVisible(!1);1==a&&this.previousPage.setPageVisible(!1);_rimFlip.removeRimFlip();nBookStatu=normalBookStatu.book_statu_auto_flip;this.gotoPageIndex=a;if(0<this.betweenPaperCount)var a=Point(this.pageWidth,0),b=Point(-this.pageWidth,0),c="tr";else a=Point(0,
0),b=Point(2*this.pageWidth,0),c="tl";this.flippingPage.setCSS({"z-index":7});this.flippingPage.beginFlip(c);this.timer(c,20,30,b,a,!0)}};normalBook.prototype.stopTimer=function(){window.clearInterval(this.intervalID)};
normalBook.prototype.afterGotoPage=function(){this.currentPageIndex=this.gotoPageIndex;this.currentPage.getSideB().leaveSide();this.currentPage2.getSideA().leaveSide();this.changePage();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 a=this;window.setTimeout(function(){nBookStatu=normalBookStatu.book_statu_ready;resizeBookAfterFlip&&onStageResize();3<a.currentPageIndex&&!a.leftThickness.visible&&a.leftThickness.setVisible(!0);a.currentPageIndex<totalPageCount-2&&!a.rightThickness.visible&&a.rightThickness.setVisible(!0);1<a.currentPageIndex&&a.bmt.leftBox.show();a.currentPageIndex<totalPageCount&&a.bmt.rightBox.show();a.fillNearPage(a.currentPageIndex);
a.resetPageZIndex();thumbnail.clearHighLight();thumbnail.setHighLight(a.currentPageIndex);a.currentPage.getSideB().enterSide();a.currentPage2.getSideA().enterSide();window.location.hash="#p="+a.currentPageIndex;a.bmt.separated(a.currentPageIndex);a.showCurrentYoutube()},30)};
normalBook.prototype.changePage=function(){var a;1==this.betweenPaperCount?(a=this.nextPage,this.nextPage=this.previousPage,this.previousPage=this.currentPage,this.currentPage=this.currentPage2,this.currentPage2=a):-1==this.betweenPaperCount?(a=this.previousPage,this.previousPage=this.nextPage,this.nextPage=this.currentPage2,this.currentPage2=this.currentPage,this.currentPage=a):2==this.betweenPaperCount||-2==this.betweenPaperCount?(a=this.previousPage,this.previousPage=this.currentPage2,this.currentPage2=
a,a=this.currentPage,this.currentPage=this.nextPage,this.nextPage=a):-2>this.betweenPaperCount?(a=this.nextPage,this.nextPage=this.currentPage2,this.currentPage2=this.currentPage,this.currentPage=a):2<this.betweenPaperCount&&(a=this.currentPage,this.currentPage=this.currentPage2,this.currentPage2=this.previousPage,this.previousPage=a)};normalBook.prototype.setLeftThicknessVisible=function(a){this.leftThickness.setVisible(a)};normalBook.prototype.setRightThicknessVisible=function(a){this.rightThickness.setVisible(a)};
normalBook.prototype.setThicknessPosition=function(){this.leftThickness.setThicknessPosition(-14,0);this.rightThickness.setThicknessPosition(2*this.pageWidth-1,0)};normalBook.prototype.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})};normalBook.prototype.fillAnPage=function(a,b){a.fillSideA(2*b-1);a.fillSideB(2*b)};
normalBook.prototype.fillNearPage=function(a){var b=Math.floor(a/2);3<a?(this.previousPage.setPageVisible(!0),this.previousPage.resetPage(!0),this.previousPage.setSideUp(!1),this.fillAnPage(this.previousPage,b-1)):this.previousPage.setPageVisible(!1);1<a?(this.currentPage.setPageVisible(!0),this.currentPage.resetPage(!0),this.currentPage.setSideUp(!1),this.fillAnPage(this.currentPage,b)):this.currentPage.setPageVisible(!1);2*Math.floor(a/2)+1<totalPageCount?(this.currentPage2.setPageVisible(!0),this.currentPage2.resetPage(!1),
this.currentPage2.setSideUp(!0),this.fillAnPage(this.currentPage2,b+1)):this.currentPage2.setPageVisible(!1);2*Math.floor(a/2)+3<totalPageCount?(this.nextPage.setPageVisible(!0),this.nextPage.resetPage(!1),this.nextPage.setSideUp(!0),this.fillAnPage(this.nextPage,b+2)):this.nextPage.setPageVisible(!1)};
normalBook.prototype.setGotoPage=function(a){var b,c;this.currentPageIndex>a?(b=Math.floor(a/2),c=Math.floor(this.currentPageIndex/2),this.flippingPage=this.currentPage,1<c-b?(this.flipToPage=this.nextPage,this.flipToPage.resetPage(!0),this.flipToPage.setSideUp(!1),this.flipToPage.setCSS({"z-index":6}),this.flippingPage.fillSideA(2*b+1),this.flipToPage.fillSideA(2*b-1),this.flipToPage.fillSideB(2*b)):this.flipToPage=this.previousPage,1!=a?this.flipToPage.setPageVisible(!0):this.flipToPage.setPageVisible(!1)):
(b=Math.floor(a/2)+1,c=Math.floor(this.currentPageIndex/2)+1,this.flippingPage=this.currentPage2,1<b-c?(this.flipToPage=this.previousPage,this.flipToPage.resetPage(!1),this.flipToPage.setSideUp(!0),this.flipToPage.setCSS({"z-index":6}),this.flippingPage.fillSideB(2*b-2),this.flipToPage.fillSideA(2*b-1),this.flipToPage.fillSideB(2*b)):this.flipToPage=this.nextPage,a!=totalPageCount?this.flipToPage.setPageVisible(!0):this.flipToPage.setPageVisible(!1));this.betweenPaperCount=b-c;return b!=c};
normalBook.prototype.pointInPage=function(a,b,c){return 0<=a.x&&a.x<=b&&0<=a.y&&a.y<=c?"left":a.x<=2*b&&a.x>=b&&0<=a.y&&a.y<=c?"right":!1};
normalBook.prototype.initBookEvent=function(){var a=this,b=-1,c=void 0,d,e;this.twoFingerDown=!1;this.flipBook.bind(_event._down,function(b){b=isTouch?b.originalEvent.touches:[b];if(2==b.length){if(nBookStatu==normalBookStatu.book_statu_mouse_flip){var c;"tl"==a.flippingPage.corner?c=Point(0,0):"tr"==a.flippingPage.corner?c=Point(a.pageWidth,0):"bl"==a.flippingPage.corner?c=Point(0,a.pageHeight):"br"==a.flippingPage.corner&&(c=Point(a.pageWidth,a.pageHeight));window.clearInterval(a.intervalID);a.timer(a.flippingPage.corner,
6,30,c,a.flipPoint,!1,!0)}d=globalToBook(!0,b[0].pageX,b[0].pageY);e=globalToBook(!0,b[1].pageX,b[1].pageY);b=a.pointInPage(d,a.pageWidth,a.pageHeight);c=a.pointInPage(e,a.pageWidth,a.pageHeight);b==c&&b&&(a.twoFingerDown=b);bookMouseDown=!1}else{if(nBookStatu==normalBookStatu.book_statu_ready){c=globalToBook(!0,b[0].pageX,b[0].pageY);if(0>c.x||c.x>a.width||0>c.y||c.y>a.height)return;var g,k;if(Math.pow(c.x,2)+Math.pow(c.y,2)<normalEventRadius){if(g="tl",k=Point(0,0),a.flippingPage=a.currentPage,
a.gotoPageIndex=2*Math.floor(a.currentPageIndex/2)-1,1==a.currentPageIndex)return}else if(Math.pow(2*a.pageWidth-c.x,2)+Math.pow(c.y,2)<normalEventRadius){if(g="tr",c.x-=a.pageWidth,k=Point(a.pageWidth,0),a.flippingPage=a.currentPage2,a.gotoPageIndex=2*Math.floor(a.currentPageIndex/2+1),a.currentPageIndex==totalPageCount)return}else if(Math.pow(c.x,2)+Math.pow(a.pageHeight-c.y,2)<normalEventRadius){if(g="bl",k=Point(0,a.pageHeight),a.flippingPage=a.currentPage,a.gotoPageIndex=2*Math.floor(a.currentPageIndex/
2)-1,1==a.currentPageIndex)return}else if(Math.pow(a.width-c.x,2)+Math.pow(a.height-c.y,2)<normalEventRadius){if(g="br",c.x-=a.pageWidth,k=Point(a.pageWidth,a.pageHeight),a.flippingPage=a.currentPage2,a.gotoPageIndex=2*Math.floor(a.currentPageIndex/2+1),a.currentPageIndex==totalPageCount)return}else return;_rimFlip.removeRimFlip();nBookStatu=normalBookStatu.book_statu_mouse_flip;a.flippingPage.beginFlip(g);a.timer(g,6,30,c,k,!1,!1)}b[0].preventDefault();return!1}});this.flipBookContainer.bind(_event._move,
function(f){f=isTouch?f.originalEvent.touches:[f];if(2==f.length&&a.twoFingerDown){var j=globalToBook(!0,f[0].pageX,f[0].pageY),f=globalToBook(!0,f[1].pageX,f[1].pageY);if(15<Math.abs(j.x-d.x)||15<Math.abs(j.y-d.y)||15<Math.abs(f.x-e.x)||15<Math.abs(f.y-e.y)){var g;"left"==a.twoFingerDown?g=2*Math.floor(a.currentPageIndex/2):"right"==a.twoFingerDown&&(g=2*Math.floor(a.currentPageIndex/2)+1);zoomBook.currentIndex=g;zoomBook.showPage.fillContent(zoomBook.currentIndex);changeShowBook(2);bookType=2;$("#zoomImg").attr("src",
uiBaseURL+"ZoomOut.png");$("#btnZoom").attr("title","Zoom Out");setCurrentIndexTextField(zoomBook.currentIndex,!1);thumbnail.clearHighLight();thumbnail.setHighLight(zoomBook.currentIndex)}return!1}bookMouseDown&&(j=globalToBook(a.flippingPage.isLeft(),f[0].pageX,f[0].pageY),a.flippingPage.flipToPoint(j.x,j.y,!1),-1!=b&&(c=j.x>b?!1:!0),b=j.x);return!1});this.flipBookContainer.bind(_event._end,function(b){b=isTouch?b.originalEvent.changedTouches:[b];if(bookMouseDown){a.twoFingerDown=!1;var b=globalToBook(a.flippingPage.isLeft(),
b[0].pageX,b[0].pageY),d,e,k=!0;if(a.flippingPage.isLeft()&&b.x>=a.pageWidth||!a.flippingPage.isLeft()&&0>=b.x)k=!1;void 0!=c&&(k=!(a.flippingPage.isLeft()^c));k||(a.gotoPageIndex=a.flippingPage.isLeft()?2*Math.floor(a.currentPageIndex/2-1)+1:2*Math.floor(a.currentPageIndex/2+1),a.betweenPaperCount=a.flippingPage.isLeft()?-1:1);d=Point(a.flippingPage.isLeft()?0:a.pageWidth,a.flippingPage.isTop()?0:a.pageHeight);e=Point(a.flippingPage.isLeft()?2*a.pageWidth:-a.pageWidth,a.flippingPage.isTop()?0:a.pageHeight);
a.timer(a.flippingPage.corner,6,30,k?d:e,b,!1,!0,!k);bookMouseDown=!1}else flipping&&2==nBookStatu&&(stopFlip=!0)});this.flipBookContainer[0].addEventListener("mousewheel",function(b){var c;b.wheelDelta?c=b.wheelDelta:b.detail&&(c=b.detail);0<c?a.gotoPage(2*Math.floor(a.getCurrentPageIndex()/2-1)+1):a.gotoPage(2*Math.floor(a.getCurrentPageIndex()/2+1))});2==browserType&&this.flipBookContainer[0].addEventListener("DOMMouseScroll",function(b){var c;b.wheelDelta?c=b.wheelDelta:b.detail&&(c=b.detail);
0<c?a.gotoPage(2*Math.floor(a.getCurrentPageIndex()/2-1)+1):a.gotoPage(2*Math.floor(a.getCurrentPageIndex()/2+1))})};normalBook.prototype.showYoutube=function(){this.previousPage.showYoutube();this.currentPage.showYoutube();this.currentPage2.showYoutube();this.nextPage.showYoutube()};normalBook.prototype.hideYoutube=function(){this.previousPage.hideYoutube();this.currentPage.hideYoutube();this.currentPage2.hideYoutube();this.nextPage.hideYoutube()};
normalBook.prototype.showCurrentYoutube=function(){this.currentPage.sideB.showYoutube();this.currentPage2.sideA.showYoutube()};normalBook.prototype.show=function(){this.flipBookContainer.css("display","block");this.showCurrentYoutube()};normalBook.prototype.hide=function(){this.flipBookContainer.css("display","none");this.hideYoutube()};function rightToLeftNormalBook(){normalBook.call(this)}$.extend(rightToLeftNormalBook.prototype,normalBook.prototype);
rightToLeftNormalBook.prototype.create=function(a){this.father=a;this.flipBook=$("<div class='flipBook' id='flipBook'></div>");a.append(this.flipBookContainer);this.flipBookContainer.append(this.flipBook);"android"==device.name?(this.previousPage=new androidRightPage,this.currentPage=new androidRightPage,this.currentPage2=new androidRightPage,this.nextPage=new androidRightPage):(this.previousPage=new rightToLeftNormalPage,this.currentPage=new rightToLeftNormalPage,this.currentPage2=new rightToLeftNormalPage,
this.nextPage=new rightToLeftNormalPage);this.previousPage.create(this.flipBook);this.currentPage.create(this.flipBook);this.currentPage2.create(this.flipBook);this.nextPage.create(this.flipBook);this.leftThickness=thickness(!1);this.rightThickness=thickness(!0);this.normalBookShadow=new bookShadow(this.pageWidth,this.pageHeight,this.flipBook);this.flipBook.append(this.leftThickness);this.flipBook.append(this.rightThickness);this.currentPageIndex=oriPageIndex;this.fillNearPage(this.currentPageIndex);
setCurrentIndexTextField(this.currentPageIndex,!0);3>=this.currentPageIndex&&this.leftThickness.setVisible(!1);this.currentPageIndex>=totalPageCount-2&&this.rightThickness.setVisible(!1);this.resetPageZIndex();this.initBookEvent();this.bmt=new initBookMarkTab(this.flipBook,!0);1>=this.currentPageIndex&&this.bmt.rightBox.hide();this.currentPageIndex>=totalPageCount&&this.bmt.leftBox.hide()};
rightToLeftNormalBook.prototype.onResize=function(a,b){this.width=2*a;this.height=b;this.pageWidth=a;this.pageHeight=b;this.maskWidth=Math.sqrt(a*a+b*b);this.flipBook.css({width:this.width+"px",height:this.height+"px"});this.previousPage.onResize(a,b,this.maskWidth,0);this.currentPage.onResize(a,b,this.maskWidth,0);this.currentPage2.onResize(a,b,this.maskWidth,0);this.nextPage.onResize(a,b,this.maskWidth,0);this.leftThickness.onResize(15,b);this.rightThickness.onResize(15,b);normalEventRadius=Math.pow(Math.ceil(a/
3),2);this.normalBookShadow.onResize(this.pageWidth,this.pageHeight,1!=this.currentPageIndex&&this.currentPageIndex!=totalPageCount);this.normalBookShadow.setPosition(this.currentPageIndex==totalPageCount?a:0,0);this.bmt.resize(b,60)};rightToLeftNormalBook.prototype.setThicknessPosition=function(){this.leftThickness.setThicknessPosition(2*this.pageWidth-1,0);this.rightThickness.setThicknessPosition(-14,0)};
rightToLeftNormalBook.prototype.gotoPage=function(a){if(1>a||a>totalPageCount)_tipsBox.setCaption(1>a?"This is the first page":"This is the last page"),_tipsBox.showTipsBox();else if(0==nBookStatu&&this.setGotoPage(a)){a==totalPageCount&&this.nextPage.setPageVisible(!1);1==a&&this.previousPage.setPageVisible(!1);_rimFlip.removeRimFlip();nBookStatu=normalBookStatu.book_statu_auto_flip;this.gotoPageIndex=a;if(0<this.betweenPaperCount)var a=Point(0,0),b=Point(2*this.pageWidth,0),c="tl";else a=Point(this.pageWidth,
0),b=Point(-this.pageWidth,0),c="tr";this.flippingPage.setCSS({"z-index":7});this.flippingPage.beginFlip(c);this.timer(c,20,30,b,a,!0)}};
rightToLeftNormalBook.prototype.timer=function(a,b,c,d,e,f,j,g){void 0==j&&(j=!1);void 0==g&&(g=!1);var k=0<=a.indexOf("l"),l=0<=a.indexOf("t");j||(this.currentPage.setCSS({"z-index":k?6:7}),this.currentPage2.setCSS({"z-index":k?7:6}));flipping=!0;stopFlip=!1;var n=(d.y-e.y)/b,m=0,o=getSpeedArray((d.x-e.x)/b,b),z=getSpeedArray(n,b);Point(0,0);var q=this;this.hideYoutube();this.intervalID=setInterval(function(){m++;q.flipPoint.x=e.x;q.flipPoint.y=e.y;for(var c=0;c<m;c++){q.flipPoint.x=q.flipPoint.x+
o[c];q.flipPoint.y=q.flipPoint.y+z[c]}if(f)q.flipPoint.y=0.2*Math.sqrt(Math.pow(q.pageWidth,2)-Math.pow(k?q.flipPoint.x-q.pageWidth:q.flipPoint.x,2));if(m==b)q.flipPoint=d;if(stopFlip){window.clearInterval(q.intervalID);q.betweenPaperCount=k?1:-1;q.gotoPageIndex=k?Math.floor(q.currentPageIndex/2+1)*2:Math.floor(q.currentPageIndex/2-1)*2+1;c=Point(k?2*q.pageWidth:-q.pageWidth,l?0:q.pageHeight);q.timer(a,6,30,c,q.flipPoint,false,true,true);auto_player.resetTimer()}else{q.flippingPage.flipToPoint(q.flipPoint.x,
q.flipPoint.y,m==1);if(m>=b){_rimFlip.isRimFlip||auto_player.resetTimer();window.clearInterval(q.intervalID);flipping=false;if(g||f){q.flippingPage.endFlip();q.afterGotoPage()}else if(j||!_rimFlip.isRimFlip)if(j){if(!f&&!g){nBookStatu=normalBookStatu.book_statu_ready;q.flippingPage.setSideUp(q.flippingPage.isLeft()?true:false);q.currentPageIndex>3&&!q.leftThickness.visible&&q.leftThickness.setVisible(true);q.currentPageIndex<totalPageCount-2&&!q.rightThickness.visible&&q.rightThickness.setVisible(true);
q.currentPageIndex>1&&q.bmt.rightBox.show();q.currentPageIndex<totalPageCount&&q.bmt.leftBox.show();if(q.currentPageIndex==1){q.normalBookShadow.onResize(q.pageWidth,q.pageHeight,false);q.normalBookShadow.setPosition(0,0)}else if(q.currentPageIndex==totalPageCount){q.normalBookShadow.onResize(q.pageWidth,q.pageHeight,false);q.normalBookShadow.setPosition(q.pageWidth,0)}else{q.normalBookShadow.onResize(q.pageWidth,q.pageHeight,true);q.normalBookShadow.setPosition(0,0)}q.normalBookShadow.showShadow();
q.showCurrentYoutube()}}else bookMouseDown=true}}},c)};
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 a=this;window.setTimeout(function(){nBookStatu=normalBookStatu.book_statu_ready;resizeBookAfterFlip&&onStageResize();a.currentPageIndex>3&&!a.leftThickness.visible&&a.leftThickness.setVisible(true);a.currentPageIndex<totalPageCount-2&&!a.rightThickness.visible&&a.rightThickness.setVisible(true);a.currentPageIndex>1&&a.bmt.rightBox.show();a.currentPageIndex<totalPageCount&&a.bmt.leftBox.show();
a.fillNearPage(a.currentPageIndex);a.resetPageZIndex();thumbnail.clearHighLight();thumbnail.setHighLight(a.currentPageIndex);a.currentPage.getSideB().enterSide();a.currentPage2.getSideA().enterSide();window.location.hash="#p="+a.currentPageIndex;a.bmt.separated(a.currentPageIndex);a.showCurrentYoutube()},30)};
rightToLeftNormalBook.prototype.initBookEvent=function(){var a=this,b=-1,c=void 0,d,e;this.twoFingerDown=!1;this.flipBook.bind(_event._down,function(b){b=isTouch?b.originalEvent.touches:[b];if(2==b.length){if(nBookStatu==normalBookStatu.book_statu_mouse_flip){var c;"tl"==a.flippingPage.corner?c=Point(0,0):"tr"==a.flippingPage.corner?c=Point(a.pageWidth,0):"bl"==a.flippingPage.corner?c=Point(0,a.pageHeight):"br"==a.flippingPage.corner&&(c=Point(a.pageWidth,a.pageHeight));window.clearInterval(a.intervalID);
a.timer(a.flippingPage.corner,6,30,c,a.flipPoint,!1,!0)}d=globalToBook(!0,b[0].pageX,b[0].pageY);e=globalToBook(!0,b[1].pageX,b[1].pageY);b=a.pointInPage(d,a.pageWidth,a.pageHeight);c=a.pointInPage(e,a.pageWidth,a.pageHeight);b==c&&b&&(a.twoFingerDown=b);bookMouseDown=!1}else{if(nBookStatu==normalBookStatu.book_statu_ready){b=globalToBook(!0,b[0].pageX,b[0].pageY);if(0>b.x||b.x>a.width||0>b.y||b.y>a.height)return;var g;if(Math.pow(b.x,2)+Math.pow(b.y,2)<normalEventRadius){if(c="tl",g=Point(0,0),a.flippingPage=
a.currentPage2,a.gotoPageIndex=2*Math.floor(a.currentPageIndex/2+1),a.currentPageIndex==totalPageCount)return}else if(Math.pow(2*a.pageWidth-b.x,2)+Math.pow(b.y,2)<normalEventRadius){if(c="tr",b.x-=a.pageWidth,g=Point(a.pageWidth,0),a.flippingPage=a.currentPage,a.gotoPageIndex=2*Math.floor(a.currentPageIndex/2)-1,1==a.currentPageIndex)return}else if(Math.pow(b.x,2)+Math.pow(a.pageHeight-b.y,2)<normalEventRadius){if(c="bl",g=Point(0,a.pageHeight),a.flippingPage=a.currentPage2,a.gotoPageIndex=2*Math.floor(a.currentPageIndex/
2+1),a.currentPageIndex==totalPageCount)return}else if(Math.pow(a.width-b.x,2)+Math.pow(a.height-b.y,2)<normalEventRadius){if(c="br",b.x-=a.pageWidth,g=Point(a.pageWidth,a.pageHeight),a.flippingPage=a.currentPage,a.gotoPageIndex=2*Math.floor(a.currentPageIndex/2)-1,1==a.currentPageIndex)return}else return;_rimFlip.removeRimFlip();nBookStatu=normalBookStatu.book_statu_mouse_flip;a.flippingPage.beginFlip(c);a.timer(c,6,30,b,g,!1,!1)}return!1}});this.flipBookContainer.bind(_event._move,function(f){f=
isTouch?f.originalEvent.touches:[f];if(2==f.length&&a.twoFingerDown){var j=globalToBook(!0,f[0].pageX,f[0].pageY),f=globalToBook(!0,f[1].pageX,f[1].pageY);if(15<Math.abs(j.x-d.x)||15<Math.abs(j.y-d.y)||15<Math.abs(f.x-e.x)||15<Math.abs(f.y-e.y)){var g;"left"==a.twoFingerDown?g=2*Math.floor(a.currentPageIndex/2)+1:"right"==a.twoFingerDown&&(g=2*Math.floor(a.currentPageIndex/2));zoomBook.currentIndex=g;zoomBook.showPage.fillContent(zoomBook.currentIndex);changeShowBook(2);bookType=2;$("#zoomImg").attr("src",
uiBaseURL+"ZoomOut.png");$("#btnZoom").attr("title","Zoom Out");setCurrentIndexTextField(zoomBook.currentIndex,!1);thumbnail.clearHighLight();thumbnail.setHighLight(zoomBook.currentIndex)}}else return bookMouseDown&&(j=globalToBook(a.flippingPage.isLeft(),f[0].pageX,f[0].pageY),a.flippingPage.flipToPoint(j.x,j.y,!1),-1!=b&&(c=j.x>b?!1:!0),b=j.x),!1});this.flipBookContainer.bind(_event._end,function(b){b=isTouch?b.originalEvent.changedTouches:[b];if(bookMouseDown){a.twoFingerDown=!1;var b=globalToBook(a.flippingPage.isLeft(),
b[0].pageX,b[0].pageY),d,e,k=!0;if(a.flippingPage.isLeft()&&b.x>=a.pageWidth||!a.flippingPage.isLeft()&&0>=b.x)k=!1;void 0!=c&&(k=!(a.flippingPage.isLeft()^c));k||(a.gotoPageIndex=a.flippingPage.isLeft()?2*Math.floor(a.currentPageIndex/2+1):2*Math.floor(a.currentPageIndex/2-1)+1,a.betweenPaperCount=a.flippingPage.isLeft()?1:-1);d=Point(a.flippingPage.isLeft()?0:a.pageWidth,a.flippingPage.isTop()?0:a.pageHeight);e=Point(a.flippingPage.isLeft()?2*a.pageWidth:-a.pageWidth,a.flippingPage.isTop()?0:a.pageHeight);
a.timer(a.flippingPage.corner,6,30,k?d:e,b,!1,!0,!k);bookMouseDown=!1}else flipping&&2==nBookStatu&&(stopFlip=!0)});this.flipBookContainer[0].addEventListener("mousewheel",function(b){var c;b.wheelDelta?c=b.wheelDelta:b.detail&&(c=b.detail);0<c?a.gotoPage(2*Math.floor(a.getCurrentPageIndex()/2-1)+1):a.gotoPage(2*Math.floor(a.getCurrentPageIndex()/2+1))});2==browserType&&this.flipBookContainer[0].addEventListener("DOMMouseScroll",function(b){var c;b.wheelDelta?c=b.wheelDelta:b.detail&&(c=b.detail);
0<c?a.gotoPage(2*Math.floor(a.getCurrentPageIndex()/2-1)+1):a.gotoPage(2*Math.floor(a.getCurrentPageIndex()/2+1))})};rightToLeftNormalBook.prototype.hideYoutube=function(){this.previousPage.hideYoutube();this.currentPage.hideYoutube();this.currentPage2.hideYoutube();this.nextPage.hideYoutube()};rightToLeftNormalBook.prototype.showCurrentYoutube=function(){this.currentPage.sideB.showYoutube();this.currentPage2.sideA.showYoutube()};
normalBook.prototype.show=function(){this.flipBookContainer.css("display","block");this.showCurrentYoutube()};normalBook.prototype.hide=function(){this.flipBookContainer.css("display","none");this.hideYoutube()};var _singleBook,singleBookShadow;
function singleBook(){var a=$(this).data(),b;a.previousPage=$("#singlePrePage");a.currentPage=$("#singleCurPage");a.nextPage=$("#singleNextPage");a.thickness=thickness(rightToLeft);a.flippingPage={};a.flipToPage={};a.currentPageIndex=1;a.pageWidth=768;a.pageHeight=1024;a.maskWidth=1280;a.bookStatu=0;a.differPageNum=0;a.gotoPageIndex=0;a.bookMouseDown=!1;a.isLeft=!1;a.isTop=!1;singleBookShadow=new bookShadow(a.pageWidth,a.pageHeight,_singleBook);a.cssObj={top:"0px",left:"0px",position:"absolute"};
a.gotoPage=function(b){if(1>b||b>originTotalPageCount)_tipsBox.setCaption(1>b?"This is the first page":"This is the last page"),_tipsBox.showTipsBox();else if(!(a.currentPageIndex==b||0!=a.bookStatu)){_rimFlip.removeRimFlip();a.setGotoPage(b);a.bookStatu=1;a.gotoPageIndex=b;var b=Point(0,0),d,e=Point(0,0);0<a.differPageNum?rightToLeft?(b.x=0,b.y=0,e.x=2*a.pageWidth,e.y=0,d="tl"):(b.x=a.pageWidth,b.y=0,e.x=-a.pageWidth,e.y=0,d="tr"):rightToLeft?(b.x=2*a.pageWidth,b.y=0,e.x=0,e.y=0,d="tr"):(b.x=-a.pageWidth,
b.y=0,e.x=a.pageWidth,e.y=0,d="tl");a.flippingPage.beginFlip(d);a.timer(d,20,30,e,b,!0)}};a.setVisible=function(a){$("#singleBookMask").css("display",a?"block":"none")};a.changePage=function(){var b;0<a.differPageNum?(b=a.previousPage,a.previousPage=a.currentPage,a.currentPage=a.nextPage,a.nextPage=b):(b=a.nextPage,a.nextPage=a.currentPage,a.currentPage=a.previousPage,a.previousPage=b)};a.inPointInPage=function(a,b,e){return 0<=a.x&&a.x<=b&&0<=a.y&&a.y<=e?!0:!1};a.timer=function(c,d,e,f,j,g,k,l){void 0==
k&&(k=!1);void 0==l&&(l=!1);flipping=!0;stopFlip=!1;a.flipPoint=Point(0,0);var n=(f.y-j.y)/d,m=0,o=getSpeedArray((f.x-j.x)/d,d),z=getSpeedArray(n,d);Point(0,0);a.hideYoutube();b=setInterval(function(){m++;a.flipPoint.x=j.x;a.flipPoint.y=j.y;for(var e=0;e<m;e++)a.flipPoint.x+=o[e],a.flipPoint.y+=z[e];g&&(a.flipPoint.y=rightToLeft?0.2*Math.sqrt(Math.pow(a.pageWidth,2)-Math.pow(a.flipPoint.x-a.pageWidth,2)):0.2*Math.sqrt(Math.pow(a.pageWidth,2)-Math.pow(a.flipPoint.x,2)));m==d&&(a.flipPoint=f);if(stopFlip){auto_player.resetTimer();
window.clearInterval(b);var e=0<=c.indexOf("l"),n=0<=c.indexOf("t");rightToLeft?(a.differPageNum=e?1:-1,a.gotoPageIndex=e?a.currentPageIndex+1:a.currentPageIndex-1,e=Point(e?2*a.pageWidth:0,n?0:a.pageHeight)):(a.differPageNum=e?-1:1,a.gotoPageIndex=e?a.currentPageIndex-1:a.currentPageIndex+1,e=Point(e?a.pageWidth:-a.pageWidth,n?0:a.pageHeight));a.timer(c,6,30,e,a.flipPoint,!1,!0,!0)}else if(e=1,0>a.flipPoint.x&&!rightToLeft&&(e=Math.min((a.flipPoint.x+a.pageWidth)/a.pageWidth+0.1,1),a.flippingPage.sideB.css("opacity",
e)),a.flipPoint.x>a.pageWidth&&rightToLeft&&(e=Math.min(Math.abs(a.flipPoint.x-2*a.pageWidth)/a.pageWidth+0.1,1),a.flippingPage.sideB.css("opacity",e)),a.flippingPage.flipToPoint(a.flipPoint,1==m),m>=d)if(_rimFlip.isRimFlip||auto_player.resetTimer(),window.clearInterval(b),g||l)a.flippingPage.endFlip(),a.afterGotoPage();else if(k||!_rimFlip.isRimFlip)k?!g&&!l&&(a.bookStatu=0,a.flippingPage.setSideAUp(!0),a.reset_z_index(),a.currentPageIndex!=originTotalPageCount&&a.thickness.showThickness(),a.showCurrentYoutube()):
a.bookMouseDown=!0},e)};a.stopTimer=function(){window.clearInterval(b)};a.afterGotoPage=function(){a.currentPageIndex=a.gotoPageIndex;a.changePage();setCurrentIndexTextField(a.currentPageIndex,!1);window.setTimeout(function(){a.bookStatu=0;resizeBookAfterFlip&&onStageResize();a.currentPageIndex!=originTotalPageCount&&a.thickness.showThickness();a.fillNearPage(a.currentPageIndex);a.reset_z_index();a.flippingPage.resetPage();thumbnail.clearHighLight();thumbnail.setHighLight(a.currentPageIndex);window.location.hash=
"#p="+a.currentPageIndex;a.showCurrentYoutube()},30)};a.setGotoPage=function(b){a.differPageNum=b-a.currentPageIndex;a.currentPageIndex>b?(a.flippingPage=a.previousPage,a.flipToPage=a.previousPage,a.fillAnPage(a.flipToPage,b,a.currentPageIndex-1)):(a.flippingPage=a.currentPage,a.flipToPage=a.nextPage,a.fillAnPage(a.flipToPage,b,b),a.flipToPage.css({"z-index":4}),a.flippingPage.css({"z-index":5}))};a.fillAnPage=function(a,b,e){a.resetPage();a.sideA.fillImg(b,!1);a.sideB.fillImg(e,!0);a.isHardPage=
1==b&&hardPageEnable&&3!=browserType?!0:!1};a.fillNearPage=function(b){1<b&&a.fillAnPage(a.previousPage,b-1,b-1);a.fillAnPage(a.currentPage,b,b);b<originTotalPageCount&&a.fillAnPage(a.nextPage,b+1,b+1)};a.reset_z_index=function(){a.previousPage.css("z-index",1);a.currentPage.css("z-index",3);a.nextPage.css("z-index",2)};a.addSearch=function(){a.previousPage.addSearch();a.currentPage.addSearch();a.nextPage.addSearch()};a.clearSearch=function(){a.previousPage.clearSearch();a.currentPage.clearSearch();
a.nextPage.clearSearch()};a.showYoutube=function(){a.previousPage.showYoutube();a.currentPage.showYoutube();a.nextPage.showYoutube()};a.hideYoutube=function(){a.previousPage.hideYoutube();a.currentPage.hideYoutube();a.nextPage.hideYoutube()};a.showCurrentYoutube=function(){a.currentPage.showYoutube()}}singleBook.prototype.setSingleBookVisible=function(a){var b=$(this).data();a?($("#singleBookMask").css({display:"block"}),b.showCurrentYoutube()):($("#singleBookMask").css({display:"none"}),b.hideYoutube())};
singleBook.prototype.gotoAnPoint=function(a){$(this).data().gotoPage(a)};singleBook.prototype.Create=function(){var a=$(this).data();this.initPage(a.previousPage);this.initPage(a.currentPage);this.initPage(a.nextPage);a.fillNearPage(oriPageIndex);_singleBook.append(a.thickness);a.currentPageIndex=oriPageIndex;oriPageIndex>=originTotalPageCount-1&&a.thickness.setVisible(!1)};
singleBook.prototype.onResize=function(a,b){var c=$(this).data();c.maskWidth=Math.sqrt(Math.pow(a,2)+Math.pow(b,2));_singleBook.css({width:a+"px",height:b+"px"});c.previousPage.onResize(a,b);c.currentPage.onResize(a,b);c.nextPage.onResize(a,b);c.pageWidth=a;c.pageHeight=b;$("#singleBookMask").css({width:windowWidth+"px",height:windowHeight+"px"});c.thickness.onResize(15,b);c.thickness.setThicknessPosition(rightToLeft?-14:a-1,0);singleEventRadius=Math.pow(Math.ceil(a/3),2);singleBookShadow.onResize(a,
b,!1)};singleBook.prototype.setBookPosition=function(a,b){$("#singleBookMask").css({left:a+"px"});_singleBook.css({left:"0px",top:b+"px"})};
singleBook.prototype.initPage=function(a){var b=$(this).data();a.mask=$("<div style='position:absolute;top:0px;left:0px;overflow:hidden;'></div>");a.sidePositionA=$("<div style='position:absolute;top:0px;left:0px;'></div>");a.sidePositionB=$("<div style='position:absolute;top:0px;left:0px;'></div>");a.sideA=this.initSide(a,!0);a.sideB=this.initSide(a,!1);a.shadowA=$("<div style='position:absolute;top:0px;left:0px;display: none;'></div>");a.shadowB=$("<div style='position:absolute;top:0px;left:0px; display: none;'></div>");
a.corner="tr";a.realCorner="tr";_singleBook.append(a);a.append(a.shadowA);a.append(a.mask);a.mask.append(a.sidePositionB);a.mask.append(a.sidePositionA);a.sidePositionB.append(a.sideB);a.sidePositionA.append(a.sideA);a.sideB.append(a.shadowB);a.onResize=function(c,d){a.css({width:c+"px",height:d+"px"});a.mask.css({width:b.maskWidth+"px",height:b.maskWidth+"px"});a.shadowA.css({width:c+"px",height:d+"px"});a.shadowB.css({width:c+"px",height:d+"px"});a.sidePositionA.css({width:c+"px",height:d+"px"});
a.sidePositionB.css({width:c+"px",height:d+"px"});a.sideA.onResize(c,d);a.sideB.onResize(c,d)};a.isHardPage=!1;a.beginFlip=function(c){a.realCorner=c;a.corner=0<=c.indexOf("t")?rightToLeft?"tl":"tr":rightToLeft?"bl":"br";b.gotoPageIndex==originTotalPageCount&&b.thickness.hideThickness()};a.flipToPoint=function(c,d){void 0==d&&(d=!1);"android"==device.name&&(c.y="tl"==a.corner||"tr"==a.corner?0:b.pageHeight);if(a.isHardPage)a.hardPageFlip(c.x,d);else if(a.isCorner(c.x,c.y))a.resetPage(),0<=a.realCorner.indexOf("l")&&
a.css("z-index",1);else{var e=computePoint(a.corner,c.x,c.y,b.pageWidth,b.pageHeight,b.maskWidth,a.shadowB,a.shadowA);angle=e.Angle;df=e.Df;noMovePoint=e.NomovePoint;mv=e.Mv;if(d){a.setSideAUp(!1);a.showShadow();b.flippingPage.css({"z-index":5});var e=0<=a.corner.indexOf("t"),f=0<=a.corner.indexOf("l");e?(a.sidePositionB.css({top:"0px",bottom:"auto",left:f?"auto":"0px",right:f?"0px":"auto"}),a.sidePositionA.css({top:"0px",bottom:"auto",left:f?"auto":"0px",right:f?"0px":"auto"})):(a.sidePositionB.css({top:"auto",
bottom:"0px",left:f?"auto":"0px",right:f?"0px":"auto"}),a.sidePositionA.css({top:"auto",bottom:"0px",left:f?"auto":"0px",right:f?"0px":"auto"}))}0<=a.corner.indexOf("t")?rightToLeft?(a.rotateElement(a.mask,"100% 0%",translate(-noMovePoint.x+b.pageWidth-b.maskWidth+mv.x,-noMovePoint.y+mv.y)+rotate(-angle)),a.rotateElement(a.sidePositionA,"100% 0%",rotate(angle)+translate(noMovePoint.x-mv.x,noMovePoint.y-mv.y)),a.rotateElement(a.sidePositionB,"100% 0%",rotate(angle)+translate(noMovePoint.x+df.x-mv.x,
noMovePoint.y+df.y-mv.y)),a.rotateElement(a.sideB,"100% 0%",translate(-b.pageWidth,0)+rotate(2*(90-angle)))):(a.rotateElement(a.mask,"0% 0%",translate(noMovePoint.x+mv.x,-noMovePoint.y+mv.y)+rotate(angle)),a.rotateElement(a.sidePositionA,"0% 0%",rotate(-angle)+translate(-noMovePoint.x-mv.x,noMovePoint.y-mv.y)),a.rotateElement(a.sidePositionB,"0% 0%",rotate(-angle)+translate(-noMovePoint.x-mv.x+df.x,noMovePoint.y+df.y-mv.y)),a.rotateElement(a.sideB,"0% 0%",translate(0,0)+rotate(2*(angle-90)))):rightToLeft?
(a.rotateElement(a.mask,"100% 100%",translate(-noMovePoint.x+b.pageWidth-b.maskWidth+mv.x,noMovePoint.y+b.pageHeight-b.maskWidth+mv.y)+rotate(angle)),a.rotateElement(a.sidePositionA,"100% 100%",rotate(-angle)+translate(noMovePoint.x-mv.x,-noMovePoint.y-mv.y)),a.rotateElement(a.sidePositionB,"100% 100%",rotate(-angle)+translate(noMovePoint.x+df.x-mv.x,-noMovePoint.y-mv.y+df.y)),a.rotateElement(a.sideB,"100% 100%",translate(-b.pageWidth,-b.pageHeight)+rotate(2*(angle-90)))):(a.rotateElement(a.mask,
"0% 100%",translate(noMovePoint.x+mv.x,noMovePoint.y+b.pageHeight-b.maskWidth+mv.y)+rotate(-angle)),a.rotateElement(a.sidePositionA,"0% 100%",rotate(angle)+translate(-noMovePoint.x-mv.x,-noMovePoint.y-mv.y)),a.rotateElement(a.sidePositionB,"0% 100%",rotate(angle)+translate(-noMovePoint.x+df.x-mv.x,-noMovePoint.y+df.y-mv.y)),a.rotateElement(a.sideB,"0% 100%",translate(0,-b.pageHeight)+rotate(2*(90-angle))))}};a.rotateElement=function(a,b,e){a.css({"-webkit-transform-origin":b,"-moz-transform-origin":b,
"-ms-transform-origin":b,"-o-transform-origin":b,"-webkit-transform":e,"-moz-transform":e,"-ms-transform":e,"-o-transform":e})};a.endFlip=function(){a.setSideAUp(!0);a.hideShadow()};a.hardPageFlip=function(c,d){var e=c;rightToLeft?(c>2*b.pageWidth&&(e=2*b.pageWidth),0>c&&(e=0),e=Math.acos((e-b.pageWidth)/b.pageWidth)):(c>b.pageWidth&&(e=b.pageWidth),c<-b.pageWidth&&(e=-b.pageWidth),e=Math.acos(e/b.pageWidth));e=180*e/Math.PI;rightToLeft&&(e-=180);d&&(a.sideB.imgFlipOver(!0),a.css({"-webkit-transform-style":"preserve-3d",
"-moz-transform-style":"preserve-3d","z-index":120}));var f=rightToLeft?"100% 50%":"0% 50%";a.css({"-moz-perspective-origin":"left center","-webkit-transform-origin":f,"-webkit-transform":"perspective(3000px) rotateY("+-e+"deg)","-moz-perspective-origin":"left center","-moz-transform-origin":f,"-moz-transform":"perspective(3000px) rotateY("+-e+"deg)"});rightToLeft?-90>=e?(a.setSideAUp(!1),a.css({opacity:Math.abs(e+180)/90})):(a.setSideAUp(!0),a.css({opacity:1})):90<=e?(a.setSideAUp(!1),a.css({opacity:Math.abs(e-
180)/90})):(a.setSideAUp(!0),a.css({opacity:1}))};a.setSideAUp=function(b){a.sidePositionA.css({"z-index":b?2:1});a.sidePositionB.css({"z-index":b?1:2})};a.showShadow=function(){a.shadowA.css({display:"block"});a.shadowB.css({display:"block"})};a.hideShadow=function(){a.shadowA.css({display:"none"});a.shadowB.css({display:"none"})};a.resetPage=function(){a.isHardPage&&(a.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}),a.sideA.imgFlipOver(!1),a.sideB.imgFlipOver(!1));a.rotateElement(a.mask,"0% 0%",translate(0,0)+rotate(0));a.rotateElement(a.sideA,"0% 0%",translate(0,0)+rotate(0));a.rotateElement(a.sideB,"0% 0%",translate(0,0)+rotate(0));a.rotateElement(a.sidePositionA,"0% 0%",translate(0,0)+rotate(0));a.rotateElement(a.sidePositionB,"0% 0%",translate(0,0)+rotate(0));a.sidePositionA.css({top:"0px",bottom:"auto",left:"0px",
right:"auto"});a.sidePositionB.css({top:"0px",bottom:"auto",left:"0px",right:"auto"});a.sideB.css({opacity:1});a.sideA.css({opacity:1})};a.isCorner=function(c,d){var e=0;0<=a.realCorner.indexOf("t")&&0==d&&e++;0<=a.realCorner.indexOf("b")&&d==b.pageHeight&&e++;0<=a.realCorner.indexOf("l")&&c==-b.pageWidth&&e++;0<=a.realCorner.indexOf("r")&&c==b.pageWidth&&e++;return 2<=e};a.addSearch=function(){a.sideA.initSearch();a.sideB.initSearch()};a.clearSearch=function(){a.sideA.clearSearch();a.sideB.clearSearch()};
a.showYoutube=function(){a.sideA.showYoutube();a.sideB.showYoutube()};a.hideYoutube=function(){a.sideA.hideYoutube();a.sideB.hideYoutube()}};
singleBook.prototype.initSide=function(a,b){var c=$(this).data(),d=$("<div style='position:absolute;top:0px;left:0px;-webkit-box-shadow: 0 0 10px rgba(40, 0, 0, 0.5)'></div>"),e=$("<div style='position:absolute;top:0px;left:0px;background-color:#f5f0f5'></div>"),f=$("<div style='position:absolute;top:0px;left:0px;'></div>"),j=$("<img />"),g;rightToLeft?(g=$("<div class='leftShadow'></div>"),g.css({width:userConfig.leftShadowWidth+"px",opacity:userConfig.leftShadowAlpha})):(g=$("<div class='rightShadow'></div>"),
g.css({width:userConfig.rightShadowWidth+"px",opacity:userConfig.rightShadowAlpha}));var k=$("<img src='"+uiBaseURL+"progress.gif' style='position: absolute;' />");k.css({left:(c.pageWidth-32)/2+"px",top:(c.pageHeight-32)/2+"px"});var l=$("<div style='position : absolute; '></div>"),n=[],m=[],o=[],z=[],q=[],B=[],A=[],I=[],w=[],s=[],u=[],t=[],L=[],N=[],M=[],T=[],v=[],R=[],E=[],h=[],Q=[],O=[],P=$("<div style='position : absolute; '></div>"),X=[];a.append(d);d.append(e);e.append(f);d.append(P);d.append(l);
b&&e.append(g);d.imgIndex=-1;d.onResize=function(a,b){d.css({width:a+"px",height:b+"px"});e.css({width:a+"px",height:b+"px"});f.css({width:a+"px",height:b+"px"});j.css({width:a+"px",height:b+"px"});g.css({height:b+"px"});k.css({left:(a-32)/2+"px",top:(b-32)/2+"px"});l.css({width:a,height:b});for(var c=0;c<n.length;c++)n[c].onResize(a,b);for(c=0;c<m.length;c++)m[c].onResize(a,b);for(c=0;c<z.length;c++)z[c].onResize(a,b);for(c=0;c<o.length;c++)o[c].onResize(a,b);for(c=0;c<q.length;c++)q[c].onResize(a,
b);for(c=0;c<B.length;c++)B[c].onResize(a,b);for(c=0;c<A.length;c++)A[c].onResize(a,b);for(c=0;c<I.length;c++)I[c].onResize(a,b);for(c=0;c<w.length;c++)w[c].onResize(a,b);for(c=0;c<s.length;c++)s[c].onResize(a,b);for(c=0;c<u.length;c++)u[c].onResize(a,b);for(c=0;c<t.length;c++)t[c].onResize(a,b);for(c=0;c<L.length;c++)L[c].onResize(a,b);for(c=0;c<N.length;c++)N[c].onResize(a,b);for(c=0;c<M.length;c++)M[c].onResize(a,b);for(c=0;c<T.length;c++)T[c].onResize(a,b);for(c=0;c<v.length;c++)v[c].onResize(a,
b);for(c=0;c<R.length;c++)R[c].onResize(a,b);for(c=0;c<E.length;c++)E[c].onResize(a,b);for(c=0;c<h.length;c++)h[c].onResize(a,b);for(c=0;c<Q.length;c++)Q[c].onResize(a,b);for(c=0;c<O.length;c++)O[c].onResize(a,b)};d.fillImg=function(a,b){if(d.imgIndex!=a){d.imgIndex=a;f.empty();d.showLoading();j.load(getPageDir(d.imgIndex,"normal"),function(){j.attr("src",getPageDir(d.imgIndex,"normal"));b&&j.css({"-webkit-transform":"scaleX(-1)","-moz-transform":"scaleX(-1)","-o-transform":"scaleX(-1)","-ms-transform":"scaleX(-1)",
opacity:0.2});d.hideLoading();f.append(j);pageEditor!=void 0&&d.initMM()})}};d.imgFlipOver=function(a){if(a){j.css({"-webkit-transform":"scaleX(-1)","-moz-transform":"scaleX(-1)","-o-transform":"scaleX(-1)","-ms-transform":"scaleX(-1)",transform:"scaleX(-1)"});g.attr("class",rightToLeft?"rightShadow":"leftShadow")}else{j.css({"-webkit-transform":"scaleX(1)","-moz-transform":"scaleX(1)","-ms-transform":"scaleX(1)","-o-transform":"scaleX(1)",transform:"scaleX(1)"});g.attr("class",rightToLeft?"leftShadow":
"rightShadow")}g.css({left:rightToLeft?"auto":"0px",right:rightToLeft?"0px":"auto"})};d.showLoading=function(){d.append(k)};d.hideLoading=function(){k.remove()};d.clearSearch=function(){P.empty();X=[]};d.initSearch=function(){P.empty();X=[];if(!(searchWord==""||searchPageArr.indexOf(d.imgIndex)<0||d.imgIndex==-1))for(var a=0;a<positionForPages[d.imgIndex-1].length;a++)if(positionForPages[d.imgIndex-1][a].word.toLowerCase().indexOf(searchWord.toLowerCase())>=0){var b=searchElement(positionForPages[d.imgIndex-
1][a],c.pageWidth,c.pageHeight);X.push(b);P.append(b)}};d.initMM=function(){l.empty();n=[];m=[];z=[];o=[];q=[];B=[];A=[];I=[];w=[];s=[];u=[];t=[];L=[];N=[];M=[];T=[];v=[];R=[];E=[];h=[];Q=[];O=[];if(!(d.imgIndex<0||pageEditor.length<d.imgIndex||pageEditor[d.imgIndex-1][0]==null))for(var a=0;a<pageEditor[d.imgIndex-1].length;a++){var b=pageEditor[d.imgIndex-1][a];if(pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_LINK){b={width:b.location.width,height:b.location.height,x:b.location.x,
y:b.location.y,alpha:b.alpha,downColor:b.downColor,downAlpha:b.downAlpha,overColor:b.overColor,overAlpha:b.overAlpha,outColor:b.outColor,outAlpha:b.outAlpha,action:b.action};b=new initLink(l,b,c.pageWidth,c.pageHeight);n.push(b)}else if(pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_YOUTUBE||pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_YOUTUBE1||pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_YOUTUBE2||pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_YOUTUBE3||
pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_YOUTUBE4||pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_YOUTUBE5){var e=pageEditor[d.imgIndex-1][a],b={width:e.location.width,height:e.location.height,x:e.location.x,y:e.location.y,alpha:e.alpha,id:e.videoId,moviePlayTriggerEvt:e.moviePlayTriggerEvt,movieStopTriggerEvt:e.movieStopTriggerEvt,playerParameters:e.playerParameters};pageEditor[d.imgIndex-1][a].annotype!=PageEditor.AnnoType.ANNO_YOUTUBE&&(b.id=e.videoID);youtubeObj=
new initYoutube(l,b,c.pageWidth,c.pageHeight);m.push(youtubeObj)}else if(pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_VIDEO){b=pageEditor[d.imgIndex-1][a];b={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.url,moviePlayTriggerEvt:b.moviePlayTriggerEvt,movieStopTriggerEvt:b.movieStopTriggerEvt};b=new initVideo(l,b,c.pageWidth,c.pageHeight);z.push(b)}else if(pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_AUDIO){b=pageEditor[d.imgIndex-
1][a];b={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.soundURL,soundPlayTriggerEvt:b.soundPlayTriggerEvt,soundStopTriggerEvt:b.soundStopTriggerEvt};b=new initAudio(l,b,c.pageWidth,c.pageHeight);o.push(b)}else if(pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_IMAGE){b={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.url,action:b.action};b=new initImage(l,b,c.pageWidth,c.pageHeight);
q.push(b)}else if(pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_BUTTON){b={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.url,action:b.action,buttonCaption:b.buttonCaption,captionY:b.captionY,HRate:b.HRate,Format:b.Format};b=new initButton(l,b,c.pageWidth,c.pageHeight);B.push(b)}else if(pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_FLASHSHOW){b={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,
alpha:b.alpha,photo:b.Images,repeatPlay:b.isRepeat};b=new initFlashShow(l,b,c.pageWidth,c.pageHeight);A.push(b)}else if(pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_LINE){b={StartX:b.lineStartPX,StartY:b.lineStartPY,EndX:b.lineEndPX,EndY:b.lineEndPY,x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,lineAlpha:b.lineAlpha,alpha:b.alpha,lineWidth:b.lineWidth,lineType:b.lineType,dotWidth:b.dotWidth,color:b.color,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,
sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,sr:b.shadow.shadowColor};b=new initLine(l,b,c.pageWidth,c.pageHeight,d.imgIndex+a);I.push(b)}else if(pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_ARROW){b={StartX:b.lineStartPX,StartY:b.lineStartPY,EndX:b.lineEndPX,EndY:b.lineEndPY,x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,alpha:b.alpha,lineWidth:b.lineWidth,lineType:b.lineType,dotWidth:b.dotWidth,color:b.color,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,
sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,arrowType:b.arrowType,sr:b.shadow.shadowColor};b=new initArrow(l,b,c.pageWidth,c.pageHeight,d.imgIndex+a);w.push(b)}else if(pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_ROUND){b={x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,alpha:b.alpha,fillStyle:b.fillStyle,color:b.color,ColorA:b.gradientColorA,ColorB:b.gradientColorB,angle:b.angle,spalpha:b.spalpha,borderWidth:b.borderWidth,borderColor:b.borderColor,
borderAlpha:b.borderAlpha,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,sr:b.shadow.shadowColor,action:b.action};b=new initRound(l,b,c.pageWidth,c.pageHeight,d.imgIndex+a);s.push(b)}else if(pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_RECTANGLE){b={x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,alpha:b.alpha,fillStyle:b.fillStyle,color:b.color,ColorA:b.gradientColorA,ColorB:b.gradientColorB,angle:b.angle,
spalpha:b.spalpha,borderWidth:b.borderWidth,borderColor:b.borderColor,borderAlpha:b.borderAlpha,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,sr:b.shadow.shadowColor,action:b.action};b=new initRe(l,b,c.pageWidth,c.pageHeight,d.imgIndex+a);u.push(b)}else if(pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_TEXT){b={x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,alpha:b.alpha,textStr:b.textStr,lineH:b.lineHeightRation,
pageH:b.formats.defaultFormat.pageH,bgalpha:b.background.alpha,fillBg:b.background.fillBg,bgcolor:b.background.color,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,sr:b.shadow.shadowColor,action:b.action};b=new initText(l,b,c.pageWidth,c.pageHeight,d.imgIndex+a);t.push(b)}else if(pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_AREA){b={x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,alpha:b.alpha,color:b.color,
rounds:b.round,ellipseWidth:b.ellipseWidth,ellipseHeight:b.ellipseHeight,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,sr:b.shadow.shadowColor,action:b.action,action:b.action};b=new initArea(l,b,c.pageWidth,c.pageHeight,d.imgIndex+a);L.push(b)}else if(pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_CALLOUT){b={x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,alpha:b.alpha,textStr:b.textStr,pageH:b.formats.defaultFormat.pageH,
bgalpha:b.background.alpha,fillBg:b.background.fillBg,bgcolor:b.background.color,direct:b.hookDirect,cx1:b.hookContr1RatioX,cy1:b.hookContr1RatioY,cx2:b.hookContr2RatioX,cy2:b.hookContr2RatioY,pointx:b.hookContrPointRatioX,pointy:b.hookContrPointRatioY,cornerRadiut:b.cornerRadiut,borderWidth:b.borderWidth,borderColor:b.borderColor,bordreAlpha:b.bordreAlpha,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,sr:b.shadow.shadowColor,action:b.action};
b=new initCallout(l,b,c.pageWidth,c.pageHeight,d.imgIndex+a);N.push(b)}else if(pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_ATEXT){b={x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,alpha:b.alpha,textStr:b.strText,pageH:b.format.pageH,align:b.format.align,action:b.action,repeat:b.repeat,moveSpeed:b.moveSpeed,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,sr:b.shadow.shadowColor,action:b.action};b=
new initAText(l,b,c.pageWidth,c.pageHeight,d.imgIndex+a);M.push(b)}else if(pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_STARTEXT){b={x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,alpha:b.alpha,textStr:b.strText,pageH:b.format.pageH,align:b.format.align,action:b.action,repeat:b.repeat,moveSpeed:b.moveSpeed,lineH:b.HRate,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,sr:b.shadow.shadowColor};b=new initStarText(l,
b,c.pageWidth,c.pageHeight,d.imgIndex+a);T.push(b)}else if(pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_TEXTANIM){b={x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,alpha:b.alpha,textStr:b.textStr,lineH:b.lineHeightRation,pageH:b.formats.defaultFormat.pageH,effectType:b.effectType,bgalpha:b.background.alpha,fillBg:b.background.fillBg,bgcolor:b.background.color,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,
sr:b.shadow.shadowColor,action:b.action};b=new initAminText(l,b,c.pageWidth,c.pageHeight,d.imgIndex+a,true);t.push(b)}else if(pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_ATIMAGE){b={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.url,action:b.action};atimageObj=new initPngImage(l,b,c.pageWidth,c.pageHeight);R.push(atimageObj)}else if(pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_EFFECTTEXT){b={x:b.location.x,y:b.location.y,
width:b.location.width,height:b.location.height,alpha:b.alpha,textStr:b.htmlText,pageH:b.pageH,action:b.action,lineH:b.HRate,moveSpeed:b.effectStyle,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,sr:b.shadow.shadowColor};b=new initEffText(l,b,c.pageWidth,c.pageHeight,d.imgIndex+a);E.push(b)}else if(pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_BANNER){b={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,
alpha:b.alpha,action:b.action,banners:b.banners};b=new initBanner(l,b,c.pageWidth,c.pageHeight,d.imgIndex+a);Q.push(b)}else if(pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_VIDEO1){b={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.videoURL,moviePlayTriggerEvt:b.moviePlayTriggerEvt,movieStopTriggerEvt:b.movieStopTriggerEvt};b=new initVideo(l,b,c.pageWidth,c.pageHeight);z.push(b)}else if(pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_VIDEO2){b=
{width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.videoURL,moviePlayTriggerEvt:b.moviePlayTriggerEvt,movieStopTriggerEvt:b.movieStopTriggerEvt};b=new initVideo(l,b,c.pageWidth,c.pageHeight);z.push(b)}else if(pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_AUDIO1){b={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.soundList.sound.path,soundPlayTriggerEvt:b.soundPlayTriggerEvt,soundStopTriggerEvt:b.soundStopTriggerEvt};
b=new initAudio(l,b,c.pageWidth,c.pageHeight);o.push(b)}else if(pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_AUDIO2){b={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.data.item.fname,soundPlayTriggerEvt:b.soundPlayTriggerEvt,soundStopTriggerEvt:b.soundStopTriggerEvt};b=new initAudio(l,b,c.pageWidth,c.pageHeight);o.push(b)}else if(pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_AUDIO3){b={width:b.location.width,height:b.location.height,
x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.componentData.songs.song.url,soundPlayTriggerEvt:b.soundPlayTriggerEvt,soundStopTriggerEvt:b.soundStopTriggerEvt};b=new initAudio(l,b,c.pageWidth,c.pageHeight);o.push(b)}else if(pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_VIMEO){b={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,id:b.videoID};b=new initVimeo(l,b,c.pageWidth,c.pageHeight);O.push(b)}else if(pageEditor[d.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_VIMEO1){b=
new initVimeo1(l,b,c.pageWidth,c.pageHeight);O.push(b)}}};d.changeTo0x=function(a){var b=a;a.substr(0,1)!="#"&&a.substr(0,2)!="0x"&&(b="#"+parseInt(a).toString(16));a.substr(0,2)=="0x"&&(b=a.replace("0x","#"));return b};d.showYoutube=function(){for(var a=0;a<m.length;a++)m[a].show()};d.hideYoutube=function(){for(var a=0;a<m.length;a++)m[a].hide()};d.hammer().on("doubletap",function(a){doubleTapTime=(new Date).getTime();var b=a.gesture.center.pageX,a=a.gesture.center.pageY;zoomBook.currentIndex=$(singlePageBook).data().currentPageIndex;
zoomBook.showPage.fillContent(zoomBook.currentIndex);zoomBook.showPage.zoomFromOtherBook(d.width(),d.height(),d.offset().left,d.offset().top,b,a);changeShowBook(2);bookType=2;toolBar.btnZoom.empty().append(getImage(toolBarIconsURL[6])).attr("title",getLanguage("btnZoomOut","Zoom Out"));setCurrentIndexTextField(zoomBook.currentIndex,false);thumbnail.clearHighLight();thumbnail.setHighLight(zoomBook.currentIndex)});return d};function zoomControlBar(a){this.dir=uiBaseURL;this.bar=$("<div></div>");this.btnZoomUp=new button(1,this.bar,{iconURL:this.dir+"ZoomUp.png"});this.btnZoomDown=new button(1,this.bar,{iconURL:this.dir+"ZoomDown.png"});this.btnZoomOut=new button(1,this.bar,{iconURL:this.dir+"ZoomOut.png"});this.btnPre=new button(1,this.bar,{iconURL:this.dir+"prev.png"});this.btnNext=new button(1,this.bar,{iconURL:this.dir+"next.png"});this.width=220;this.height=40;a.append(this.bar);this.bar.css({width:this.width+"px",
height:this.height+"px",position:"absolute","z-index":5,"-webkit-border-radius":"8px","-moz-border-radius":"8px","-ms-border-radius":"8px","-o-border-radius":"8px","border-radius":"8px","-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.7});
this.initEvt();this.setButtonsPos()}zoomControlBar.prototype.setPosition=function(a,b){this.bar.css({left:a+"px",top:b+"px"})};zoomControlBar.prototype.setVisible=function(a){this.bar.css({display:a?"block":"none"})};zoomControlBar.prototype.setChildIndex=function(a){this.bar.css({"z-index":a})};zoomControlBar.prototype.onResize=function(a,b){this.bar.css({width:a+"px",height:b+"px"})};
zoomControlBar.prototype.initEvt=function(){this.btnZoomUp.onMouseUp(this,this.zoomUp);this.btnZoomDown.onMouseUp(this,this.zoomDown);this.btnZoomOut.onMouseUp(this,this.zoomOut);this.btnPre.onMouseUp(this,previousPageFun);this.btnNext.onMouseUp(this,nextPageFun)};
zoomControlBar.prototype.setButtonsPos=function(){this.btnZoomUp.setButtonPosition(3,3);this.btnZoomDown.setButtonPosition(46,3);this.btnZoomOut.setButtonPosition(89,3);this.btnPre.setButtonPosition(132,3);this.btnNext.setButtonPosition(175,3)};zoomControlBar.prototype.zoomUp=function(){zoomBook.zoom(0.2)};zoomControlBar.prototype.zoomDown=function(){zoomBook.zoom(-0.2)};
zoomControlBar.prototype.zoomOut=function(){windowWidth<windowHeight?(changeShowBook(1),bookType=1,setCurrentIndexTextField($(singlePageBook).data().currentPageIndex),$(singlePageBook).data().gotoPage(zoomBook.currentIndex)):(changeShowBook(0),bookType=0,setCurrentIndexTextField(flipBook.currentPageIndex,!0),flipBook.gotoPage(zoomBook.currentIndex));thumbnail.clearHighLight();thumbnail.setHighLight(zoomBook.currentIndex);zoomBook.noZoom();$("#btnZoom").empty().append(getImage(toolBarIconsURL[5])).attr("title",
getLanguage("btnZoomIn","Zoom In"))};function zoomSide(a,b){this.side=$("<div></div>");this.sideContent=$("<div></div>");this.sideImg=$("<img style='position: absolute;' />");this.MMbg=$("<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.zoomContainerHeight=this.zoomContainerWidth=this.fitH=this.fitW=0;this.imgOriginWidth=zoomPageWidth;this.imgOriginHeight=zoomPageHeight;this.p=b;this.tmpImg=
$("<img style='position: absolute;z-index:-1;' />");a.append(this.side);this.side.append(this.sideContent);this.imgIndex=-1;this.toScale=1;this.origin="0% 0%";this.translateY=this.translateX=this.y=this.x=0;this.side.css({width:this.width+"px",height:this.height+"px",position:"absolute","-webkit-box-shadow":"10px 5px 15px rgba(40, 0, 0, 0.6)"});this.sideContent.css({width:this.width+"px",height:this.height+"px"});this.sideImg.css({width:this.width+"px",height:this.height+"px"});this.MMbg.css({width:this.width+
"px",height:this.height+"px"});this.loadingImg.css({left:(this.width-32)/2+"px",top:(this.height-32)/2+"px"});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.efftextArray=[];this.soundArray=[];this.bannerArray=
[];this.vimeoArray=[];this.father=a;this.initEvent();this.onWinResize(windowWidth-leftMargin-rightMargin,windowHeight-topMargin-bottomMargin-toolBar.getHeight(),!0)}zoomSide.prototype.hideMM=function(){this.MMbg.css({display:"none"})};zoomSide.prototype.showMM=function(){this.MMbg.css({display:"block"})};zoomSide.prototype.setCSS=function(a){this.side.css(a)};
zoomSide.prototype.onResize2=function(a){this.toScale=a/this.width;a=getTransform(this.side[0]);this.zoomObj(this.side,this.origin," scale("+this.toScale+")",a.x,a.y)};
zoomSide.prototype.onResize=function(a,b,c){var d=getPageWidthHeight(a,b,this.imgOriginWidth,this.imgOriginHeight);this.winW=a;this.winH=b;this.width=d.x;this.height=d.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.MMbg.css({width:this.width+"px",height:this.height+"px"});this.MMResize(this.width,this.height);c&&this.tmpImg.css({width:this.width+
"px",height:this.height+"px"})};zoomSide.prototype.getSide=function(){return this.side};
zoomSide.prototype.fillContent=function(a){if(a!=this.imgIndex&&(this.imgIndex=a,this.sideContent.empty(),this.showLoading(),this.sideImg.remove(),!(a>originTotalPageCount||0>a))){var b=this;b.sideImg.attr("src",getPageDir(a,"large"));this.sideImg.load(function(){b.hideLoading();b.tmpImg.attr("src",getPageDir(a,"large"));b.sideContent.append(b.sideImg);b.imgOriginWidth=this.width;b.imgOriginHeight=this.height;var c=getPageWidthHeight(b.zoomContainerWidth,b.zoomContainerHeight,b.imgOriginWidth,b.imgOriginHeight);
b.fitW=c.x;b.fitH=c.y;b.onResize(b.zoomContainerWidth,b.zoomContainerHeight,!0);b.father.append(b.tmpImg);b.sideContent.append(b.MMbg);void 0!=pageEditor&&b.initMM()})}};zoomSide.prototype.setPosition=function(a,b){this.side.css({left:a+"px",top:b+"px"})};zoomSide.prototype.setChildIndex=function(a){this.side.css({"z-index":a})};zoomSide.prototype.setVisible=function(a){this.side.css({display:a?"block":"none"})};
zoomSide.prototype.resetSize=function(){var a=this.width*this.toScale>=this.imgOriginWidth,b=a?this.imgOriginWidth:this.width*this.toScale,c=a?this.imgOriginHeight:this.height*this.toScale,d=getTransform(this.side[0]),e=this.width==this.imgOriginWidth&&b<this.imgOriginWidth||this.width!=this.imgOriginWidth;this.toScale=a?this.width*this.toScale/this.imgOriginWidth:1;if(e)this.onResize(b,c);this.zoomObj(this.side,"0% 0%","scale("+this.toScale+")",d.x,d.y);this.width=b;this.height=c;this.translateX=
d.x;this.translateY=d.y;e&&this.tmpImg.css({width:this.width+"px",height:this.height+"px"});this.zoomObj(this.tmpImg,"0% 0%","scale("+this.toScale+")",d.x,d.y)};zoomSide.prototype.resetSide=function(){};zoomSide.prototype.zoom=function(a,b){b||(b="0% 0%");var c=getTransform(this.side[0]);this.toScale+=a;this.zoomObj(this.side,b,"scale("+this.toScale+")",c.x,c.y);this.zoomObj(this.tmpImg,b,"scale("+this.toScale+")",c.x,c.y);0<a&&this.resetSize()};
zoomSide.prototype.noZoom=function(){this.onResize(this.fitW,this.fitH);this.toScale=1;this.zoomObj(this.side,"0% 0%","scale("+this.toScale+")",0,0);this.zoomObj(this.tmpImg,"0% 0%","scale("+this.toScale+")",0,0);this.tmpImg.css({width:this.fitW,height:this.fitH})};
zoomSide.prototype.zoomObj=function(a,b,c,d,e){d||(d=0);e||(e=0);d=translate(d,e);a.css({"-webkit-transform-origin":b,"-moz-transform-origin":b,"-ms-transform-origin":b,"-o-transform-origin":b,"-webkit-transform":d+c,"-moz-transform":d+c,"-ms-transform":d+c,"-o-transform":d+c})};zoomSide.prototype.setTranslate=function(a,b,c){b=translate(b,c);a.css({"-webkit-transform":b,"-moz-transform":b,"-o-transform":b,"-ms-transform":b})};zoomSide.prototype.setXY=function(a,b){this.x=a;this.y=b};
var originPoint22,inteval;zoomSide.prototype.animateTranslate=function(a,b,c){a||(a=0);b||(b=0);c||(c=25);var d=getTransform(this.side[0]),e=this;$(d).animate({x:a,y:b},{duration:c,easing:"easeOutSine",complete:function(){e.zoomObj(e.side,e.origin," scale("+e.toScale+")",d.x,d.y);e.zoomObj(e.tmpImg,e.origin," scale("+e.toScale+")",d.x,d.y)}})};
zoomSide.prototype.animateZoom=function(a,b,c,d){a||(a=this.toScale);b||(b=0);c||(c=0);d||(d=25);var e=getTransform(this.side[0]),f={scale:this.toScale,x:e.x,y:e.y},j=this;$(f).animate({scale:a,x:b,y:c},{duration:d,step:function(){j.zoomObj(j.side,j.origin," scale("+f.scale+")",f.x,f.y);j.zoomObj(j.tmpImg,j.origin," scale("+f.scale+")",f.x,f.y)},complete:function(){j.toScale=a;j.resetSize()}})};
zoomSide.prototype.onWinResize=function(a,b,c){var d=getPageWidthHeight(a,b,this.imgOriginWidth,this.imgOriginHeight);this.fitW=d.x;this.fitH=d.y;this.zoomContainerWidth=a;this.zoomContainerHeight=b;if(c)this.onResize(a,b,!0)};zoomSide.prototype.showLoading=function(){this.side.append(this.loadingImg)};zoomSide.prototype.hideLoading=function(){this.loadingImg.remove()};
zoomSide.prototype.translate=function(a,b){this.zoomObj(this.side,this.origin," scale("+this.toScale+")",a,b);this.zoomObj(this.tmpImg,this.origin," scale("+this.toScale+")",a,b)};zoomSide.prototype.tranXY=function(){};zoomSide.prototype.isFit=function(){return this.toScale==this.fitW/this.width};
zoomSide.prototype.animateBack=function(a){var b=getTransform(this.side[0]),c={x:b.x,y:b.y,scale:this.toScale},d=this.fitW/this.width,e=this;$(c).animate({x:0,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;a()}})};zoomSide.prototype.showPage=function(){this.side.css({display:"block"})};zoomSide.prototype.hidePage=function(){this.side.css({display:"none"})};
zoomSide.prototype.getWidth=function(){return this.width*this.toScale};zoomSide.prototype.tweenBack=function(){var a=getTransform(this.side[0]),b,c,d=this.width*this.toScale,e=this.height*this.toScale,f=window.innerWidth,j=window.innerHeight;d<f?b=(f-d)/2-this.x:a.x<f-d-this.x?b=f-d-this.x-10:a.x>-this.x&&(b=-this.x+10);e<j?c=(j-e)/2-this.y:a.y<j-e-this.y?c=j-e-this.y-30:a.y>-this.y&&(c=-this.y);var g={x:a.x,y:a.y},k=this;$(g).animate({x:b,y:c},{duration:250,step:function(){k.translate(g.x,g.y)}})};
zoomSide.prototype.initEvent=function(){var a=this,b=Point(0,0),c=Point(0,0),d=!1,e=!1,f=null,j=!1,g,k=0,l=0,n;this.side.bind(_event._down,function(k){if(!zoomBook.isFlipping){g=a.toScale;var k=isTouch?k.originalEvent.touches:[k],l=getTransform(a.side[0]);a.translateX=l.x;a.translateY=l.y;1==k.length?(d=!0,e=!1,b=Point(k[0].pageX,k[0].pageY),f=Point(a.side.position().left,a.side.position().top)):2==k.length&&(d=!1,e=!0,b=Point(k[0].pageX,k[0].pageY),c=Point(k[1].pageX,k[1].pageY),f=Point(a.side.offset().left,
a.side.offset().top));j=!1;if(1==browserType)event.preventDefault();else return!1}});$(this.father[0].parentNode).bind(_event._move,function(m){if(zoomBook.isFlipping)j=e=d=!1;else{m=isTouch?m.originalEvent.touches:[m];if(d){var o=m[0].pageX-b.x+a.translateX,m=m[0].pageY-b.y+a.translateY,z=(new Date).getTime(),q=Math.sqrt(Math.pow(o-k,2)+Math.pow(m-l,2)),B=0;100>z-n&&0<z-n&&(B=q/(z-n),Math.min(300*B,300),q=Math.asin((k-o)/q),Math.cos(q),Math.sin(q));a.animateTranslate(o,m,25);k=o;l=m;n=z}else e&&
(o=Point(m[0].pageX,m[0].pageY),z=Point(m[1].pageX,m[1].pageY),m=Math.sqrt(Math.pow(b.x-c.x,2)+Math.pow(b.y-c.y,2)),o=Math.sqrt(Math.pow(o.x-z.x,2)+Math.pow(o.y-z.y,2)),a.toScale=Math.max(o/m*g,0.5),o=b.y-f.y,m=a.toScale/g,a.translateX=b.x-(b.x-f.x)*m-a.x,a.translateY=b.y-o*m-a.y,a.zoomObj(a.side,a.origin," scale("+a.toScale+")",a.translateX,a.translateY),a.zoomObj(a.tmpImg,a.origin," scale("+a.toScale+")",a.translateX,a.translateY),j=!0);if(1==browserType)event.preventDefault();else return!1}});
$(this.father[0].parentNode).bind(_event._end,function(){if(isTouch||d)d&&a.tweenBack(),j&&a.resetSize(),j=e=d=!1});this.side.bind("mouseleave",function(){d=!1});this.side.hammer().on("doubletap",function(){doubleTapTime=(new Date).getTime();window.innerHeight>window.innerWidth?(changeShowBook(1),bookType=1,setCurrentIndexTextField($(singlePageBook).data().currentPageIndex),$(singlePageBook).data().gotoPage(zoomBook.currentIndex)):(changeShowBook(0),bookType=0,setCurrentIndexTextField(flipBook.currentPageIndex,
!0),flipBook.gotoPage(zoomBook.currentIndex));thumbnail.clearHighLight();thumbnail.setHighLight(zoomBook.currentIndex);toolBar.btnZoom.empty().append(getImage(toolBarIconsURL[5])).attr("title",getLanguage("btnZoomIn","Zoom In"))});if(2==browserType)return this.side[0].addEventListener("DOMMouseScroll",function(b){a.zoom(0<-b.detail?0.05:-0.05)}),!1;this.side[0].addEventListener("mousewheel",function(b){a.zoom(0<b.wheelDelta?0.05:-0.05);return!1})};
zoomSide.prototype.zoomFromOtherBook=function(a,b,c,d,e,f){this.onResize(a,b);this.setTranslate(this.side,c-this.side.offset().left,d-this.side.offset().top);this.zoom4Point(this.toScale+0.3,e,f,500,(e-c)/a,(f-d)/b)};
zoomSide.prototype.zoom4Point=function(a,b,c,d,e,f){var j=this,g=b-j.side.offset().left,k=c-j.side.offset().top,l={scale:this.toScale};e&&f&&(g=j.width*e,k=j.height*f);j.tmpImg.css({display:"none"});j.zoomObj(j.tmpImg,j.origin," scale("+a+")",b-a/j.toScale*g-j.x,c-a/j.toScale*k-j.y);$(l).animate({scale:a},{duration:d,step:function(){var a=l.scale/j.toScale;j.zoomObj(j.side,j.origin," scale("+l.scale+")",b-a*g-j.x,c-a*k-j.y)},complete:function(){j.toScale=a;j.tmpImg.css({display:"block"});j.resetSize()}})};
zoomSide.prototype.showYoutube=function(){for(var a=0;a<this.youtubeArray.length;a++)this.youtubeArray[a].show()};zoomSide.prototype.hideYoutube=function(){for(var a=0;a<this.youtubeArray.length;a++)this.youtubeArray[a].hide()};
zoomSide.prototype.initMM=function(){this.MMbg.empty();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.efftextArray=[];this.soundArray=[];this.bannerArray=[];this.vimeoArray=[];if(!(0>=this.imgIndex||
pageEditor.length<this.imgIndex||null==pageEditor[this.imgIndex-1][0]))for(var a=0;a<pageEditor[this.imgIndex-1].length;a++){var b=pageEditor[this.imgIndex-1][a];if(pageEditor[this.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_LINK){var c={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,downColor:b.downColor,downAlpha:b.downAlpha,overColor:b.overColor,overAlpha:b.overAlpha,outColor:b.outColor,outAlpha:b.outAlpha,action:b.action};this.linkArray.push(new initLink(this.MMbg,
c,this.width,this.height))}else pageEditor[this.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_YOUTUBE||pageEditor[this.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_YOUTUBE1||pageEditor[this.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_YOUTUBE2||pageEditor[this.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_YOUTUBE3||pageEditor[this.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_YOUTUBE4||pageEditor[this.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_YOUTUBE5?(c={width:b.location.width,
height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,id:b.videoId,moviePlayTriggerEvt:b.moviePlayTriggerEvt,movieStopTriggerEvt:b.movieStopTriggerEvt,playerParameters:b.playerParameters},pageEditor[this.imgIndex-1][a].annotype!=PageEditor.AnnoType.ANNO_YOUTUBE&&(c.id=b.videoID),youtubeObj=new initYoutube(this.MMbg,c,this.width,this.height),this.youtubeArray.push(youtubeObj)):pageEditor[this.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_VIDEO?(c={width:b.location.width,height:b.location.height,
x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.url,moviePlayTriggerEvt:b.moviePlayTriggerEvt,movieStopTriggerEvt:b.movieStopTriggerEvt},b=new initVideo(this.MMbg,c,this.width,this.height),this.videoArray.push(b)):pageEditor[this.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_AUDIO?(c={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.soundURL,soundPlayTriggerEvt:b.soundPlayTriggerEvt,soundStopTriggerEvt:b.soundStopTriggerEvt},b=new initAudio(this.MMbg,
c,this.width,this.height),this.audioArray.push(b)):pageEditor[this.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_IMAGE?(c={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.url,action:b.action},imageObj=new initImage(this.MMbg,c,this.width,this.height),this.imageArray.push(imageObj)):pageEditor[this.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_BUTTON?(c={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,
src:b.url,action:b.action,buttonCaption:b.buttonCaption,captionY:b.captionY,HRate:b.HRate,Format:b.Format},this.buttonArray.push(new initButton(this.MMbg,c,this.width,this.height))):pageEditor[this.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_FLASHSHOW?(c={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,photo:b.Images,repeatPlay:b.isRepeat},this.flashShowArray.push(new initFlashShow(this.MMbg,c,this.width,this.height))):pageEditor[this.imgIndex-1][a].annotype==
PageEditor.AnnoType.ANNO_LINE?(c={StartX:b.lineStartPX,StartY:b.lineStartPY,EndX:b.lineEndPX,EndY:b.lineEndPY,x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,lineAlpha:b.lineAlpha,alpha:b.alpha,lineWidth:b.lineWidth,lineType:b.lineType,dotWidth:b.dotWidth,color:b.color,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,sr:b.shadow.shadowColor},this.lineArray.push(new initLine(this.MMbg,c,this.width,this.height,this.imgIndex+
a))):pageEditor[this.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_ARROW?(c={StartX:b.lineStartPX,StartY:b.lineStartPY,EndX:b.lineEndPX,EndY:b.lineEndPY,x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,alpha:b.alpha,lineWidth:b.lineWidth,lineType:b.lineType,dotWidth:b.dotWidth,color:b.color,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,arrowType:b.arrowType,sr:b.shadow.shadowColor},this.arrowArray.push(new initArrow(this.MMbg,
c,this.width,this.height,this.imgIndex+a))):pageEditor[this.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_ROUND?(c={x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,alpha:b.alpha,fillStyle:b.fillStyle,color:b.color,ColorA:b.gradientColorA,ColorB:b.gradientColorB,angle:b.angle,spalpha:b.spalpha,borderWidth:b.borderWidth,borderColor:b.borderColor,borderAlpha:b.borderAlpha,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,
sr:b.shadow.shadowColor,action:b.action},this.roundArray.push(new initRound(this.MMbg,c,this.width,this.height,this.imgIndex+a))):pageEditor[this.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_RECTANGLE?(c={x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,alpha:b.alpha,fillStyle:b.fillStyle,color:b.color,ColorA:b.gradientColorA,ColorB:b.gradientColorB,angle:b.angle,spalpha:b.spalpha,borderWidth:b.borderWidth,borderColor:b.borderColor,borderAlpha:b.borderAlpha,sh:b.shadow.hasDropShadow,
sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,sr:b.shadow.shadowColor,action:b.action},this.reArray.push(new initRe(this.MMbg,c,this.width,this.height,this.imgIndex+a))):pageEditor[this.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_TEXT?(c={x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,alpha:b.alpha,textStr:b.textStr,lineH:b.lineHeightRation,pageH:b.formats.defaultFormat.pageH,bgalpha:b.background.alpha,fillBg:b.background.fillBg,bgcolor:b.background.color,
sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,sr:b.shadow.shadowColor,action:b.action},this.textArray.push(new initText(this.MMbg,c,this.width,this.height,this.imgIndex+a))):pageEditor[this.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_AREA?(c={x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,alpha:b.alpha,color:b.color,rounds:b.round,ellipseWidth:b.ellipseWidth,ellipseHeight:b.ellipseHeight,sh:b.shadow.hasDropShadow,
sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,sr:b.shadow.shadowColor,action:b.action},this.areaArray.push(new initArea(this.MMbg,c,this.width,this.height,this.imgIndex+a))):pageEditor[this.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_CALLOUT?(c={x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,alpha:b.alpha,textStr:b.textStr,pageH:b.formats.defaultFormat.pageH,bgalpha:b.background.alpha,fillBg:b.background.fillBg,bgcolor:b.background.color,
direct:b.hookDirect,cx1:b.hookContr1RatioX,cy1:b.hookContr1RatioY,cx2:b.hookContr2RatioX,cy2:b.hookContr2RatioY,pointx:b.hookContrPointRatioX,pointy:b.hookContrPointRatioY,cornerRadiut:b.cornerRadiut,borderWidth:b.borderWidth,borderColor:b.borderColor,bordreAlpha:b.bordreAlpha,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,sr:b.shadow.shadowColor},this.calloutArray.push(new initCallout(this.MMbg,c,this.width,this.height,this.imgIndex+a))):pageEditor[this.imgIndex-
1][a].annotype==PageEditor.AnnoType.ANNO_ATEXT?(c={x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,alpha:b.alpha,textStr:b.strText,pageH:b.format.pageH,align:b.format.align,action:b.action,repeat:b.repeat,moveSpeed:b.moveSpeed,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,sr:b.shadow.shadowColor},this.atextArray.push(new initAText(this.MMbg,c,this.width,this.height,this.imgIndex+a))):pageEditor[this.imgIndex-1][a].annotype==
PageEditor.AnnoType.ANNO_STARTEXT?(c={x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,alpha:b.alpha,textStr:b.strText,pageH:b.format.pageH,align:b.format.align,action:b.action,repeat:b.repeat,moveSpeed:b.moveSpeed,lineH:b.HRate,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,sr:b.shadow.shadowColor},this.startextArray.push(new initStarText(this.MMbg,c,this.width,this.height,this.imgIndex+a))):pageEditor[this.imgIndex-
1][a].annotype==PageEditor.AnnoType.ANNO_TEXTANIM?(c={x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,alpha:b.alpha,textStr:b.textStr,lineH:b.lineHeightRation,pageH:b.formats.defaultFormat.pageH,effectType:b.effectType,bgalpha:b.background.alpha,fillBg:b.background.fillBg,bgcolor:b.background.color,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,sr:b.shadow.shadowColor,action:b.action},this.textArray.push(new initAminText(this.MMbg,
c,this.width,this.height,this.imgIndex+a,!0))):pageEditor[this.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_ATIMAGE?(c={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.url,action:b.action},atimageObj=new initPngImage(this.MMbg,c,this.width,this.height),this.atimageArray.push(atimageObj)):pageEditor[this.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_EFFECTTEXT?(c={x:b.location.x,y:b.location.y,width:b.location.width,height:b.location.height,
alpha:b.alpha,textStr:b.htmlText,pageH:b.pageH,action:b.action,moveSpeed:b.effectStyle,lineH:b.HRate,sh:b.shadow.hasDropShadow,sx:b.shadow.shadowBlurX,sy:b.shadow.shadowBlurY,se:b.shadow.shadowDistance,sr:b.shadow.shadowColor},this.efftextArray.push(new initEffText(this.MMbg,c,this.width,this.height,this.imgIndex+a))):pageEditor[this.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_BANNER?(c={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,action:b.action,
banners:b.banners},this.bannerArray.push(new initBanner(this.MMbg,c,this.width,this.height,this.imgIndex+a))):pageEditor[this.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_VIDEO1?(c={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.videoURL,moviePlayTriggerEvt:b.moviePlayTriggerEvt,movieStopTriggerEvt:b.movieStopTriggerEvt},b=new initVideo(this.MMbg,c,this.width,this.height),this.videoArray.push(b)):pageEditor[this.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_VIDEO2?
(c={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.videoURL,moviePlayTriggerEvt:b.moviePlayTriggerEvt,movieStopTriggerEvt:b.movieStopTriggerEvt},b=new initVideo(this.MMbg,c,this.width,this.height),this.videoArray.push(b)):pageEditor[this.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_AUDIO1?(c={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.soundList.sound.path,soundPlayTriggerEvt:b.soundPlayTriggerEvt,
soundStopTriggerEvt:b.soundStopTriggerEvt},b=new initAudio(this.MMbg,c,this.width,this.height),this.audioArray.push(b)):pageEditor[this.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_AUDIO2?(c={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.data.item.fname,soundPlayTriggerEvt:b.soundPlayTriggerEvt,soundStopTriggerEvt:b.soundStopTriggerEvt},b=new initAudio(this.MMbg,c,this.width,this.height),this.audioArray.push(b)):pageEditor[this.imgIndex-1][a].annotype==
PageEditor.AnnoType.ANNO_AUDIO3?(c={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,alpha:b.alpha,src:b.componentData.songs.song.url,soundPlayTriggerEvt:b.soundPlayTriggerEvt,soundStopTriggerEvt:b.soundStopTriggerEvt},b=new initAudio(this.MMbg,c,this.width,this.height),this.audioArray.push(b)):pageEditor[this.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_VIMEO?(c={width:b.location.width,height:b.location.height,x:b.location.x,y:b.location.y,id:b.videoID},b=new initVimeo(this.MMbg,
c,this.width,this.height),this.vimeoArray.push(b)):pageEditor[this.imgIndex-1][a].annotype==PageEditor.AnnoType.ANNO_VIMEO1&&(b=new initVimeo1(this.MMbg,b,this.width,this.height),this.vimeoArray.push(b))}};
zoomSide.prototype.MMResize=function(a,b){for(var c=0;c<this.linkArray.length;c++)this.linkArray[c].onResize(a,b);for(c=0;c<this.youtubeArray.length;c++)this.youtubeArray[c].onResize(a,b);for(c=0;c<this.videoArray.length;c++)this.videoArray[c].onResize(a,b);for(c=0;c<this.audioArray.length;c++)this.audioArray[c].onResize(a,b);for(c=0;c<this.imageArray.length;c++)this.imageArray[c].onResize(a,b);for(c=0;c<this.buttonArray.length;c++)this.buttonArray[c].onResize(a,b);for(c=0;c<this.flashShowArray.length;c++)this.flashShowArray[c].onResize(a,
b);for(c=0;c<this.lineArray.length;c++)this.lineArray[c].onResize(a,b);for(c=0;c<this.arrowArray.length;c++)this.arrowArray[c].onResize(a,b);for(c=0;c<this.roundArray.length;c++)this.roundArray[c].onResize(a,b);for(c=0;c<this.reArray.length;c++)this.reArray[c].onResize(a,b);for(c=0;c<this.textArray.length;c++)this.textArray[c].onResize(a,b);for(c=0;c<this.areaArray.length;c++)this.areaArray[c].onResize(a,b);for(c=0;c<this.calloutArray.length;c++)this.calloutArray[c].onResize(a,b);for(c=0;c<this.atextArray.length;c++)this.atextArray[c].onResize(a,
b);for(c=0;c<this.startextArray.length;c++)this.startextArray[c].onResize(a,b);for(c=0;c<this.aminArray.length;c++)this.aminArray[c].onResize(a,b);for(c=0;c<this.atimageArray.length;c++)this.atimageArray[c].onResize(a,b);for(c=0;c<this.efftextArray.length;c++)this.efftextArray[c].onResize(a,b);for(c=0;c<this.soundArray.length;c++)this.soundArray[c].onResize(a,b);for(c=0;c<this.bannerArray.length;c++)this.bannerArray[c].onResize(a,b);for(c=0;c<this.vimeoArray.length;c++)this.vimeoArray[c].onResize(a,
b)};function initZoomBook(a){this.bookContainer=$("<div style='left:0px;right:0px;top:0px;bottom:0px;position:absolute;display:none;'></div>");this.book=$("<div></div>");a.append(this.bookContainer);this.bookContainer.append(this.book);this.prePage=new zoomSide(this.book,"p");this.nextPage=new zoomSide(this.book,"n");this.showPage=new zoomSide(this.book,"c");this.width=zoomPageWidth;this.height=zoomPageHeight;this.prePage.setChildIndex(1);this.showPage.setChildIndex(3);this.nextPage.setChildIndex(2);
this.diffPageCount=0;this.currentIndex=1;this.slidePageB=this.slidePageA=this.showingPage=this.flipPage=null;this.isFlipping=!1;isTouch||(this.controlBar=new zoomControlBar(this.bookContainer),this.controlBar.setPosition((windowWidth-this.controlBar.width)/2,20));this.initEvent();this.book.css({width:this.width+"px",height:this.height+"px",position:"absolute"});this.fillNear(1)}
initZoomBook.prototype.onResize=function(a,b){var c=getPageWidthHeight(a,b,zoomPageWidth,zoomPageHeight);this.width=c.x;this.height=c.y;this.book.css({width:this.width+"px",height:this.height+"px",left:(a-this.width)/2+leftMargin+"px",top:(b-this.height)/2+topMargin+"px"});this.prePage.onWinResize(a,b,!0);this.showPage.onWinResize(a,b);this.nextPage.onWinResize(a,b,!0);this.controlBar&&this.controlBar.setPosition((windowWidth-this.controlBar.width)/2,20);this.prePage.setXY((tmpContainer.width()-this.width)/
2,(tmpContainer.height()-toolBar.getHeight()-this.height)/2);this.showPage.setXY((tmpContainer.width()-this.width)/2,(tmpContainer.height()-toolBar.getHeight()-this.height)/2);this.nextPage.setXY((tmpContainer.width()-this.width)/2,(tmpContainer.height()-toolBar.getHeight()-this.height)/2);this.prePage.translate(-(a-this.width)/2-this.prePage.getWidth()-leftMargin-10,0);this.nextPage.translate((a-this.width)/2+this.width+rightMargin+10,0)};
initZoomBook.prototype.setTranslate=function(a,b,c){b=translate(b,c);a.css({"-webkit-transform":b,"-moz-transform":b,"-o-transform":b,"-ms-transform":b})};
initZoomBook.prototype.gotoPage=function(a){if(this.currentIndex==a||1>a||a>originTotalPageCount||this.isFlipping){if(1>a||a>originTotalPageCount)_tipsBox.setCaption(1>a?"This is the first page":"This is the last page"),_tipsBox.showTipsBox()}else{this.hideYoutube();this.isFlipping=!0;this.diffPageCount=a-this.currentIndex;var b=0,c=0,d=this,e=Point(0,windowWidth);this.currentIndex>a?(c=0,b=e.y,this.slidePageA=this.prePage,this.slidePageB=this.showPage,this.slidePageA.fillContent(a)):(c=e.y,b=0,this.slidePageA=
this.showPage,this.slidePageB=this.nextPage,this.slidePageB.fillContent(a));var f=function(){var f=getSpeedArray((b-c)/30,30),g=0,k=window.setInterval(function(){g++;e.x=c;for(var b=0;b<g;b++)e.x=e.x+f[b];d.slidePageA.translate(e.x-e.y,0);d.slidePageB.translate(e.x,0);if(g>=30){window.clearInterval(k);window.setTimeout(function(){d.showPage.noZoom();auto_player.resetTimer();d.changePage();d.endFlip(a);d.isFlipping=false},20)}},20)};this.showPage.isFit()?f():this.showPage.animateBack(f)}};
initZoomBook.prototype.changePage=function(){var a=null;0<this.diffPageCount?(a=this.showPage,this.showPage=this.nextPage,this.nextPage=this.prePage):(a=this.nextPage,this.nextPage=this.showPage,this.showPage=this.prePage);this.prePage=a};
initZoomBook.prototype.endFlip=function(a){this.currentIndex=a;this.prePage.p="p";this.showPage.p="c";this.nextPage.p="n";this.fillNear(a);setCurrentIndexTextField(this.currentIndex,!1);window.location.hash="#p="+this.currentIndex;thumbnail.clearHighLight();thumbnail.setHighLight(this.currentIndex);this.showCurrentYoutube();this.prePage.translate(-windowWidth,0);this.nextPage.translate(windowWidth,0)};
initZoomBook.prototype.setVisible=function(a){this.bookContainer.css({display:a?"block":"none"});isTouch||this.controlBar.setVisible(a)};initZoomBook.prototype.setPosition=function(a,b){this.book.css({left:a+"px",top:b+"px"})};initZoomBook.prototype.fillNear=function(a){1<a&&this.prePage.fillContent(a-1);this.showPage.fillContent(a);a<originTotalPageCount&&this.nextPage.fillContent(a+1)};initZoomBook.prototype.initEvent=function(){};
initZoomBook.prototype.initMouseEvt=function(){var a=this,b=Point(0,0),c=!1,d=null;this.book.bind(_event._down,function(e){c=!0;b.x=e.pageX;b.y=e.pageY;d={x:a.book.offset().left,y:a.book.offset().top};return!1});this.book.bind(_event._end,function(){c=!1});this.book.bind(_event._move,function(e){c&&bookType==BookType.zoom_book&&a.book.css({left:e.pageX-b.x+d.x+"px",top:e.pageY-b.y+d.y+"px"})});this.book.bind("mouseleave",function(){c=!1})};
initZoomBook.prototype.initTouchEvt=function(){var a=this,b=Point(0,0),c=Point(0,0),d=!1,e=!1,f=null,j;this.book.bind(_event._down,function(g){g=g.originalEvent.touches;1==g.length?(d=!0,e=!1,b.x=g[0].pageX,b.y=g[0].pageY,f={x:a.book.offset().left,y:a.book.offset().top}):2==g.length&&(a.showPage.hideMM(),e=!0,d=!1,b.x=g[0].pageX,b.y=g[0].pageY,c.x=g[1].pageX,c.y=g[1].pageY,f={x:g[0].pageX,y:g[0].pageY,left:0,top:0,width:a.book.width(),height:a.book.height()},a.prePage.setVisible(!1),a.nextPage.setVisible(!1))});
this.book.bind(_event._end,function(){e=d=!1;a.prePage.setVisible(!0);a.nextPage.setVisible(!0);a.showPage.showMM()});this.book.bind(_event._move,function(g){g=g.originalEvent.touches;if(d)a.book.css({left:g[0].pageX-b.x+f.x+"px",top:g[0].pageY-b.y+f.y+"px"});else if(e){var k=Point(g[0].pageX,g[0].pageY),l=Point(g[1].pageX,g[1].pageY),g=Math.sqrt(Math.pow(c.x-b.x,2)+Math.pow(c.y-b.y,2)),k=Math.sqrt(Math.pow(l.x-k.x,2)+Math.pow(l.y-k.y,2));j=Math.max((f.width+2*(k-g))/f.width,1);a.showPage.sideImg.css({"-webkit-transform-origin":b.x+
"px "+b.y+"px","-webkit-transform":"scale("+j+")"})}return!1})};initZoomBook.prototype.zoom=function(a){this.showPage.zoom(a)};initZoomBook.prototype.noZoom=function(){this.showPage.noZoom()};initZoomBook.prototype.getLeft=function(){return this.book.offset().left};initZoomBook.prototype.getTop=function(){return this.book.offset().top};initZoomBook.prototype.show=function(){this.setVisible(!0);this.prePage.showPage();this.nextPage.showPage();this.showPage.showPage();this.showCurrentYoutube()};
initZoomBook.prototype.hide=function(){this.setVisible(!1);this.hideYoutube()};initZoomBook.prototype.showYoutube=function(){this.prePage.showYoutube();this.showPage.showYoutube();this.nextPage.showYoutube()};initZoomBook.prototype.hideYoutube=function(){this.prePage.hideYoutube();this.showPage.hideYoutube();this.nextPage.hideYoutube()};initZoomBook.prototype.showCurrentYoutube=function(){this.showPage.showYoutube()};var setBackGround=function(){var a=gradientColorA,b=gradientColorB,c=gradientColorAngle,d=$("<img />"),e=backGroundImgURL,f="0% 0%,100% 0%";switch(c){case 45:f="0% 0%,100% 100%";break;case 90:f="0% 0%,0% 100%";break;case 135:f="100% 0%,0% 100%";break;case 180:f="100% 0%,0% 0%";case 0:f="0% 0%,100% 0%"}1==browserType?bookContainer.css("background-image","-webkit-gradient(linear,"+f+",from("+a+"),to("+b+"))"):2==browserType?bookContainer.css("background-image","-moz-linear-gradient(left "+c+"deg,"+
a+","+b+")"):3==browserType&&bookContainer.css("filter","progid:DXImageTransform.Microsoft.Gradient(GradientType=1, EndColorStr="+b+", StartColorStr="+a+");");if(""!=e&&"undefined"!=e){var j=new Image;j.src=e;j.onload=function(){j.complete&&(d.attr("src",e),bookContainer.append(d),d.css("z-index",0),d.width(windowWidth),d.height(windowHeight))}}$.fn.extend(bookContainer,{resizeBackGroundImg:function(){d.width(windowWidth);d.height(windowHeight)}})},initBackground=function(a,b,c,d,e,f,j){var g=$("<div></div>"),
k=$("<div></div>"),l=$("<img />"),n=e,m=f,o=function(a,b,c){var d=c*Math.PI/180,c=Math.abs(b*Math.sin(d))+Math.abs(a*Math.cos(d)),a=Math.abs(b*Math.cos(d))+Math.abs(a*Math.sin(d));return Point(c,a)},d=d%360;g.css({position:"absolute",left:"0px",top:"0px",width:n+"px",height:m+"px","z-index":-1});k.css({position:"absolute","z-index":0});1==browserType?k.css({"background-image":"-webkit-linear-gradient("+d+"deg, "+b+", "+c+")",width:n+"px",height:m+"px"}):2==browserType?k.css({"background-image":"-moz-linear-gradient("+
d+"deg, "+b+", "+c+")",width:n+"px",height:m+"px"}):4==browserType?k.css({"background-image":"-o-linear-gradient("+d+"deg, "+b+", "+c+")",width:n+"px",height:m+"px"}):3==browserType?(o(n,m,d),k.css({filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType=1, EndColorStr="+c+", StartColorStr="+b+");",width:n+"px",height:m+"px"})):k.css({"background-image":"linear-gradient("+d+"deg, "+b+", "+c+")",width:n+"px",height:m+"px"});void 0!=j&&""!=j&&(l.attr({src:j}),l.load(function(){g.append(l);l.css({width:n+
"px",height:m+"px",position:"absolute","z-index":1})}));a.append(g);g.append(k);this.onResize=function(a,e){n=a;m=e;g.css({width:a+"px",height:e+"px"});l.css({width:a+"px",height:e+"px"});if(browserType==3){o(a,e,d);k.css({filter:"progid:DXImageTransform.Microsoft.Gradient(GradientType=1, EndColorStr="+c+", StartColorStr="+b+");",width:a+"px",height:e+"px"})}else k.css({width:a+"px",height:e+"px"})}};function autoFlip(){this.autoPlay=getBool("autoPlayAutoStart",!1)&&getBool("AutoPlayButtonVisible",!0);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 a=this;this.timer=window.setInterval(function(){a.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(){0==bookType&&flipBook.currentPageIndex==totalPageCount||1==bookType&&$(singlePageBook).data().currentPageIndex==originTotalPageCount||2==bookType&&zoomBook.currentIndex==originTotalPageCount?(this.loopNum++,-1==this.loopCount||this.loopCount>this.loopNum?firstPageFun():(this.stop(),$("#autoPlayImg").attr("src",uiBaseURL+"autoPlay.png"),$("#autoPlay").attr("title",getLanguage("btnStopAutoFlip","Stop Auto Play")))):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 buttonType=function(){};buttonType.caption_button=0;buttonType.icon_button=1;buttonType.double_button=2;var buttonAlign=function(){};buttonAlign.icon_left=0;buttonAlign.icon_top=1;buttonAlign.icon_right=2;buttonAlign.icon_bottom=3;
function button(a,b,c,d,e){this.background=$("<div></div>");this.caption="button1";this.iconURL="";this.mainColor="#888888";this.height=this.width=40;this.buttonType=a;this.config=c;this.iconBox=$("<img />");this.needResize=e;this.asImgButton=d;this.create();$(b).append(this.background);$(this.background).asButton()}
button.prototype.create=function(){var a=this;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());
if(this.buttonType!=buttonType.caption_button){this.iconURL=this.config.iconURL;var b=new Image;b.src=this.iconURL;b.onload=function(){if(b.complete==true){$(a.iconBox).attr("src",a.iconURL);a.background.append(a.iconBox);a.width=this.width;a.height=this.height;a.setPosition();a.asImgButton&&$(a.iconBox).asImageButton()}}}};
button.prototype.setPosition=function(){if(this.buttonType==buttonType.double_button){var a=this.captionBox.getWidth(),b=this.captionBox.getHeight(),c=this.iconBox.width(),d=this.iconBox.height();switch(this.config.align){case buttonAlign.icon_left:this.width=a+c+12;this.height=Math.max(d,b)+6;$(this.iconBox).css({top:(this.height-d)/2+"px",left:"4px"});$(this.captionBox).css({top:(this.height-b)/2+"px",right:"4px"});break;case buttonAlign.icon_top:this.width=Math.max(c,a)+6;this.height=b+d+8;$(this.iconBox).css({top:"2px",
left:(this.width-c)/2+"px"});$(this.captionBox).css({bottom:"2px",left:(this.width-a)/2+"px"});break;case buttonAlign.icon_right:this.width=a+c+12;this.height=Math.max(d,b)+6;$(this.iconBox).css({top:(this.height-d)/2+"px",right:"4px"});$(this.captionBox).css({top:(this.height-b)/2+"px",left:"4px"});break;case buttonAlign.icon_bottom:this.width=Math.max(c,a)+6,this.height=b+d+8,$(this.iconBox).css({bottom:"2px",left:(this.width-c)/2+"px"}),$(this.captionBox).css({top:"2px",left:(this.width-a)/2+"px"})}}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).css({top:"0px",left:"0px"});if(this.needResize)this.onResize(40,50);else $(this.background).css({width:this.width+"px",height:this.height+"px"})};button.prototype.onResize=function(a,b){$(this.background).css({width:a+"px",height:b+"px"});$(this.iconBox).css({position:"absolute",top:"10px",left:"3px"})};
button.prototype.getWidth=function(){return this.width};button.prototype.getHeight=function(){return this.height};button.prototype.setCSS=function(a){$(this.background).css(a)};button.prototype.setButtonPosition=function(a,b,c){void 0==c&&(c=["left","top"]);this.background.css(c[0],a+"px");this.background.css(c[1],b+"px")};button.prototype.setVisible=function(a){$(this.background).css({display:a?"block":"none"})};
button.prototype.changeIcon=function(a){this.iconURL=a;var b=new Image,c=this;b.src=this.iconURL;b.onload=function(){!0==b.complete&&$(c.iconBox).attr("src",c.iconURL)};this.setPosition()};button.prototype.setColor=function(a){this.mainColor=a;$(this.background).css({"background-color":this.mainColor})};button.prototype.onMouseDown=function(a,b){this.background.bind(_event._down,function(c){b.call(a,c);return!1})};
button.prototype.onMouseUp=function(a,b){3==browserType?this.background.bind("click",function(c){b.call(a,c);return!1}):this.background.bind(_event._end,function(){b.call(a);return!1})};button.prototype.onMouseOver=function(a,b){this.background.bind(_event._move,function(){b.call(a);return!1})};button.prototype.onMouseOut=function(){};button.prototype.onMouseLeave=function(){};button.prototype.onMouseMove=function(){};button.prototype.remove=function(){this.background.remove()};var demoBar,initDemoBar=function(){var a=homePage;demoBar=$("<div></div>");demoBar.css({width:"305px",height:"70px",position:"absolute","background-color":"#cccccc",opacity:0.5,"z-index":10,"-moz-border-radius":"5px","-webkit-border-radius":"5px","border-radius":"5px"});var b=$("<img />");b.css({position:"absolute",top:"10px",left:"5px"});var c=$("<div></div>");c.css({position:"absolute",top:"13px",left:"65px"});var d=$("<span>"+productName+"</span>"),a=$("<a href='"+a+"' target='_blank'>"+a+"</a>");
a.css({position:"absolute",top:"25px",left:"0px"});d.css({"font-size":"15px",color:"#333333"});bookContainer.append(demoBar);demoBar.append(c);c.append(d);c.append(a);$.fn.extend(demoBar,{setDemoPosition:function(){demoBar.css({top:(windowHeight-70)/2+"px",left:(windowWidth-305)/2+"px"})},loadImg:function(){b.load(function(){demoBar.append(b)});b.attr({src:uiBaseURL+"demo.png"})}});demoBar.loadImg();demoBar.setDemoPosition()};function initLeftOrRightButton(a,b){this.buttonBar=$("<div></div>");this.buttonIcon=$("<img />");this.buttonBackColor;this.height=this.width=0;this.buttonBar.css({position:"absolute",left:b?"0px":"auto",right:b?"auto":"0px"});a.append(this.buttonBar);this.buttonBar.append(this.buttonIcon);var c=this;this.buttonIcon.attr("src",b?uiBaseURL+"previous_normal.png":uiBaseURL+"next_normal.png");this.buttonIcon.load(function(){0==userConfig.shortcutButtonWidth&&0==userConfig.shortcutButtonHeight?(c.width=
this.width,c.height=this.height):0==userConfig.shortcutButtonWidth?(c.width=this.width*userConfig.shortcutButtonHeight/this.height,c.height=userConfig.shortcutButtonHeight):0==userConfig.shortcutButtonHeight?(c.width=userConfig.shortcutButtonWidth,c.height=this.height*userConfig.shortcutButtonWidth/this.width):(c.width=userConfig.shortcutButtonWidth,c.height=userConfig.shortcutButtonHeight);c.buttonBar.css({width:c.width+"px",height:c.height+"px",top:(windowHeight-c.height)/2+"px"});c.buttonIcon.css({width:c.width+
"px",height:c.height+"px"})});this.buttonIcon.asImageButton();this.buttonBar.bind(_event._end,function(){b?previousPageFun():nextPageFun()});this.buttonBar.bind(_event._down,function(){3==browserType?event.cancelBubble=!0:event.stopPropagation();event.preventDefault()})}initLeftOrRightButton.prototype.onResize=function(a,b){this.buttonBar.css({width:a+"px",height:b+"px"});this.buttonIcon.css({width:a+"px",height:b+"px"});this.width=a;this.height=b;this.setPosition()};
initLeftOrRightButton.prototype.setPosition=function(){this.buttonBar.css({top:(windowHeight-this.height)/2+"px"})};
function initLeftButton(a){this.buttonBar=$("<div></div>");this.buttonIcon=null;this.buttonBackColor;this.height=this.width=50;this.showing=!0;this.init();0==userConfig.shortcutButtonWidth&&0==userConfig.shortcutButtonHeight?(this.width=this.width,this.height=this.height):0==userConfig.shortcutButtonWidth?(this.width=this.width*userConfig.shortcutButtonHeight/this.height,this.height=userConfig.shortcutButtonHeight):0==userConfig.shortcutButtonHeight?(this.width=userConfig.shortcutButtonWidth,this.height=
this.height*userConfig.shortcutButtonWidth/this.width):(this.width=userConfig.shortcutButtonWidth,this.height=userConfig.shortcutButtonHeight);a.append(this.buttonBar);this.buttonBar.append(this.buttonIcon);this.buttonBar.css({width:this.width+"px",height:this.height+"px",top:(windowHeight-this.height)/2+"px"});this.buttonIcon.css({width:this.width+"px",height:this.height+"px"});this.buttonIcon.asImageButton();this.buttonBar.bind(_event._down,function(){browserType==3?event.cancelBubble=true:event.stopPropagation();
event.preventDefault()})}initLeftButton.prototype.init=function(){this.buttonIcon=$(getImage(toolBarIconsURL[17]));this.width=this.buttonIcon[0].width;this.height=this.buttonIcon[0].height;this.buttonBar.css({position:"absolute",left:-this.width-10+"px",right:"auto"});this.buttonBar.bind(_event._end,function(){rightToLeft?nextPageFun():previousPageFun()})};
initLeftButton.prototype.onResize=function(a,b){this.buttonBar.css({width:a+"px",height:b+"px"});this.buttonIcon.css({width:a+"px",height:b+"px"});this.width=a;this.height=b;this.setPosition()};initLeftButton.prototype.setPosition=function(){this.buttonBar.css({top:(windowHeight-this.height)/2+"px"})};initLeftButton.prototype.show=function(){this.buttonBar.animate({left:0},500)};initLeftButton.prototype.setVisible=function(a){this.showing=a;this.buttonBar.css({display:a?"block":"none"})};
function initRightButton(a){initLeftButton.call(this,a)}$.extend(initRightButton.prototype,initLeftButton.prototype);initRightButton.prototype.init=function(){this.buttonIcon=$(getImage(toolBarIconsURL[19]));this.width=this.buttonIcon[0].width;this.height=this.buttonIcon[0].height;this.buttonBar.css({position:"absolute",right:-this.width-10+"px",left:"auto"});this.buttonBar.bind(_event._end,function(){rightToLeft?previousPageFun():nextPageFun()})};
initRightButton.prototype.show=function(){this.buttonBar.animate({right:0},500)};function initShotButton(a,b,c){this.button=$("<div></div>");this.showing=!0;this.button.css({width:"40px",height:"250px",display:"inline-block","background-image":"url("+b+")","background-repeat":"no-repeat","background-position":"0px 0px",position:"absolute"});this.initEvent(c);a.append(this.button)}initShotButton.prototype.setCSS=function(a){this.button.css(a)};
initShotButton.prototype.initEvent=function(a){var b=this;this.button.bind(_event._down,function(){b.button.css({"background-position":"-80px 0px"});return!1}).bind(_event._end,function(){isTouch?b.button.css({"background-position":"0px 0px"}):b.button.css({"background-position":"-40px 0px"});rightToLeft^a?previousPageFun():nextPageFun();return!1}).bind("mouseover",function(){b.button.css({"background-position":"-40px 0px"})}).bind("mouseleave",function(){b.button.css({"background-position":"0px 0px"})})};
initShotButton.prototype.show=function(a){a?this.button.animate({left:0},500):this.button.animate({right:0},500)};initShotButton.prototype.setVisible=function(a){this.showing=a;this.buttonBar.css({display:a?"inline-block":"none"})};initShotButton.prototype.setPosition=function(){this.button.css({top:(windowHeight-250)/2+"px"})};function bookShadow(a,b,c){this.backgroun=$("<div></div>");this.width=a;this.height=b;$(this.backgroun).css({position:"absolute",width:this.width+"px",height:this.height+"px","-webkit-box-shadow":"0 0 15px rgba(40, 0, 0, 0.7)"});$(c).append(this.backgroun)}bookShadow.prototype.onResize=function(a,b,c){this.width=c?2*a:a;this.height=b;$(this.backgroun).css({width:this.width+"px",height:this.height+"px"})};bookShadow.prototype.setPosition=function(a,b){$(this.backgroun).css({top:b+"px",left:a+"px"})};
bookShadow.prototype.showShadow=function(){$(this.backgroun).css({"-webkit-box-shadow":"0 0 15px rgba(40, 0, 0, 0.7)"})};bookShadow.prototype.hideShadow=function(){$(this.backgroun).css({"-webkit-box-shadow":"0 0 15px rgba(40, 0, 0, 0)"})};function searchElement(a,b,c){var d=$("<div style='position: absolute'></div>"),e=getString("searchColor","#ffff00"),f=getInt("searchAlpha",0.3);d.css({top:a.top*c+"px",left:a.left*b+"px",width:b*a.width+"px",height:c*a.height+"px","background-color":e,opacity:f});$.fn.extend(d,{onResize:function(b,c){d.css({top:a.top*c+"px",left:a.left*b+"px",width:b*a.width+"px",height:c*a.height+"px"})}});return d};function searchItem(a,b,c,d){this.width=d;this.height=85;this.background=$("<div></div>");this.textField=new label(b,this.background);this.mainColor="#888888";this.pageIndex=a;$(this.background).css({"background-color":this.mainColor,width:this.width+"px",height:this.height+"px",position:"absolute",border:"1px solid #555555",overflow:"hidden",cursor:"pointer"});this.textField.onResize(this.Width-20,this.height-16);this.textField.setLabelPosition(10,8);this.isMouseMove=!1;this.downPoint=Point(0,0);
var e=this;$(c).append(this.background);$(this.background).bind(_event._end,function(){isSearchDrag||gotoPageFun(e.pageIndex)});this.textField.setCaption("P."+a+": "+this.cutText(b,searchWord));this.textField.riseAWord(searchWord);this.textField.setFont("13.5px","#111111",null)}searchItem.prototype.onResize=function(a,b){this.width=a;this.height=b;$(this.background).css({width:a+"px",height:b+"px"});this.textField.onResize(a-20,b-16)};
searchItem.prototype.setPosition=function(a,b){$(this.background).css({top:b+"px",left:a+"px"})};searchItem.prototype.getWidth=function(){return this.width};searchItem.prototype.getHeight=function(){return this.height};
searchItem.prototype.cutText=function(a,b){if(120>a.length||""==b)return a;var c=a.length,d=a.toLowerCase().indexOf(b.toLowerCase()),e;60<=d?(e=Math.max(60<=c-d?d-60:c-120,0),e=".."+a.substring(e,d)):e=a.substring(0,d);c=60<c-d?a.substring(d,60<=d?d+60:120)+"..":a.substring(d,c);return e+c};function form(a,b){this.height=this.width=300;this.mainColor="#888888";$(this).data();this.background=$('<div style="position:absolute; width:300px; height:300px;"></div>');this.formConfig=$.extend({width:this.width,height:this.height,mainColor:this.mainColor},a);this.create();$(b).append(this.background);this.visible=!1}
form.prototype.create=function(){$(this).data();var a=this,b=colorDiv(this.formConfig.mainColor,50);this.titleBox=$('<div style="position:absolute; width:300px; height:300px;"></div>');this.contentBox=$('<div style="position:absolute; width:300px; height:300px;"></div>');this.background.append(this.titleBox);this.background.append(this.contentBox);this.background.css({"background-color":this.formConfig.mainColor,"-webkit-border-radius":"5px","-moz-border-radius":"5px","border-radius":"5px",width:this.formConfig.width+
"px",height:this.formConfig.height+"px","-webkit-box-shadow":"0 0 5px rgba(40, 0, 0, 0.5)",left:-(this.formConfig.width+20)+"px"});this.titleBox.css({"background-color":b,"-webkit-border-radius":"5px","-moz-border-radius":"5px","border-radius":"5px",width:this.formConfig.width+"px",height:"35px"});this.contentBox.css({top:"35px",left:"0px",width:this.formConfig.width+"px",height:this.formConfig.height-35+"px"});this.initTitleBox();this.drapable=!1;this.formPositionY=this.formPositionX=this.mouseDownPointY=
this.mouseDownPointX=0;$(this.titleBox).bind(_event._down,function(b){var d=a.titleBox[0];d.setCapture?d.setCapture():window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);b=isTouch?b.originalEvent.touches:[b];a.drapable=!0;a.mouseDownPointX=b[0].pageX;a.mouseDownPointY=b[0].pageY;a.formPositionX=$(a.titleBox).offset().left;a.formPositionY=$(a.titleBox).offset().top;return!1});$(this.titleBox).bind(_event._end,function(){var b=a.titleBox[0];b.releaseCapture?b.releaseCapture():window.captureEvents(Event.MOUSEMOVE|
Event.MOUSEUP);return a.drapable=!1});$(this.titleBox).bind(_event._move,function(b){b=isTouch?b.originalEvent.touches:[b];if(a.drapable){var d=b[0].pageX-a.mouseDownPointX,b=b[0].pageY-a.mouseDownPointY;$(a.background).css({left:a.formPositionX+d+"px",top:a.formPositionY+b+"px"})}return!1});$(this.titleBox).bind("mouseleave",function(){return a.drapable=!1});$(this.background).bind(_event._down,function(){3==browserType?event.cancelBubble=!0:event.stopPropagation()});$(this.background).bind(_event._move,
function(){});$(this.background).bind(_event._end,function(){})};form.prototype.initTitleBox=function(){$(this).data();this.captionBox=new label(this.formConfig.caption,this.titleBox);this.closeButton=new button(1,this.titleBox,{iconURL:this.formConfig.closeIconURL},!0);this.captionBox.setLabelPosition(5,(30-this.captionBox.getHeight())/2);this.closeButton.setButtonPosition(5,3,["right","top"]);this.closeButton.onMouseUp(this,this.closeForm)};form.prototype.getWidth=function(){return this.width};
form.prototype.setWidth=function(a){$(this).data();this.width=a;100>a&&(this.width=100);this.background.css({width:this.width+"px"});this.contentBox.css({width:this.width+"px"});this.titleBox.css({width:this.width+"px"})};form.prototype.getHeight=function(){return this.height};form.prototype.setHeight=function(a){$(this).data();this.height=a;100>=a&&(this.height=100);this.background.css({height:this.height+"px"});this.contentBox.css({height:this.height-this.titleBox.height()+"px"})};
form.prototype.onResize=function(a,b){this.setWidth(a);this.setHeight(b)};form.prototype.setColor=function(){};form.prototype.closeForm=function(){$(this.background).css({display:"none"})};form.prototype.setCaption=function(a){this.formConfig.caption=a;this.captionBox.setCaption(a)};var searchWord="",searchPageArr=[],isSearchDrag=!1;
function searchForm(a,b){form.call(this,a,b);this.textField=$('<input id="search_text_textField" style="position : absolute" type="text" size="13">');this.searchButton=new button(1,this.contentBox,{iconURL:uiBaseURL+"searchButton.png"});this.textField.css({top:"9px",left:"5px",width:"160px"});this.searchButton.setButtonPosition(190,5);this.searchItemsBox=$("<div></div>");this.searchScrollBox=$("<div></div>");this.lblSearchTotalItem=new label(" ",this.contentBox);this.lblSearchTotalItem.setFont("14px",
"#000000",null);this.itemArr=[];this.contentBox.append(this.textField);this.contentBox.append(this.searchScrollBox);void 0==window.textForPages&&(window.textForPages=[]);this.searchScrollBox.css({position:"absolute",width:this.width-10+"px",height:this.height-95+"px","overflow-y":"auto",top:"55px",left:"5px"});this.lblSearchTotalItem.setLabelPosition(15,34);this.background.translate(-(windowWidth/2+20),0);this.background.css({top:"0px",left:"0px","z-index":100,opacity:0.95,display:"none"});this.initEvent();
this.captionBox.setFont("15px","#f0f0f0",null);this.captionBox.setCaption("<strong>Search</strong>");this.mouseDownY=-1;this.scrollMouseDown=!1}$.extend(searchForm.prototype,form.prototype);
$.extend(searchForm.prototype,{initEvent:function(){this.titleBox.unbind(_event._down);this.titleBox.unbind(_event._move);this.titleBox.unbind(_event._end);var a=this;this.searchButton.onMouseUp(this,this.searchStart);this.textField.bind("keydown",function(b){13==b.keyCode&&a.searchStart()});this.contentBox.bind(_event._down,function(b){a.scrollMouseDown=!0;isSearchDrag=!1;b=isTouch?b.originalEvent.touches:[b];a.mouseDownY=b[0].pageY});this.contentBox.bind(_event._move,function(b){a.scrollMouseDown&&
(b=isTouch?b.originalEvent.touches:[b],20<Math.abs(a.mouseDownY-b[0].pageY)&&(isSearchDrag=!0))});this.contentBox.bind(_event._end,function(){a.scrollMouseDown=!1})},addItems:function(a){this.itemArr=[];searchPageArr=[];for(var b=0;b<a.length;b++){var c=a[b],d=new searchItem(c.search_page,c.search_text,this.searchScrollBox,this.width-40);this.itemArr.push(d);searchPageArr.push(c.search_page);d.setPosition(11,b*d.getHeight()+2)}},onScrollBoxResize:function(a,b){this.searchScrollBox.css({width:a+"px",
height:b+"px"})},clearItems:function(){this.searchScrollBox.empty();searchWord="";this.lblSearchTotalItem.setCaption("");this.textField.val("")},searchStart:function(){this.searchScrollBox.empty();var a=this.textField.val();searchWord=a;a=searchFromPages(textForPages,a);this.addItems(a);this.lblSearchTotalItem.setCaption("Searched "+a.length+" items")},search:function(a){this.searchScrollBox.empty();searchWord=a;a=searchFromPages(textForPages,a);this.addItems(a);this.lblSearchTotalItem.setCaption("Searched "+
a.length+" items")},closeForm:function(){if(this.isSearchShow){var a=this,b=getTransform(this.background[0]);left={x:b.x,y:b.y};b=function(){$(left).animate({x:-windowWidth/2-20},{duration:400,step:function(){a.background.translate(left.x,left.y)},complete:function(){a.clearItems();a.itemArr=[];a.isSearchShow=!1}})};"iphone"==device.name?setTimeout(b,200):b()}},showForm:function(){if(!this.isSearchShow){"none"==this.background[0].style.display&&this.background.css({display:"block"});var a=this,b=
getTransform(this.background[0]);left={x:b.x,y:b.y};$(left).animate({x:0},{duration:400,step:function(){a.background.translate(left.x,left.y)},complete:function(){a.textField.focus();a.isSearchShow=!0}});$("#preSearch")&&(b=$("#preSearch").val(),""!=b&&void 0!=b&&this.search(b))}},onResizeA:function(a,b){this.width=100>a?100:a;this.height=100>b?100:b;this.background.css({width:this.width+"px",height:this.height+"px"});this.titleBox.css({width:this.width+"px"});this.contentBox.css({width:this.width+
"px",height:this.height-$(this.titleBox).height()+"px"});this.searchItemsBox.css({width:this.width-10+"px",height:this.height-95+"px"});this.searchScrollBox.css({width:this.width-10+"px",height:this.height-95+"px"})},onResize:function(a,b){this.width=100>a?100:a;this.height=100>b?100:b;this.background.translate(this.isSearchShow?0:-this.width-20,0);this.background.css({width:this.width+"px",height:this.height+"px"});this.titleBox.css({width:this.width+"px"});this.contentBox.css({width:this.width+
"px",height:this.height-$(this.titleBox).height()+"px"});this.searchItemsBox.css({width:this.width-10+"px",height:this.height-95+"px"});this.searchScrollBox.css({width:this.width-10+"px",height:this.height-95+"px"});this.textField.css({width:this.width-90+"px"});this.searchButton.setButtonPosition(this.width-73,5);for(var c=0;c<this.itemArr.length;c++)this.itemArr[c].onResize(this.width-10,85)},correctPosition:function(a){this.background.offset().left+290>a&&this.background.css({left:a-320+"px"})},
isSearchShow:!1});function bookMarkTab(a,b,c,d){this.fnShow=b;this.fnHide=c;this.maxWidth=d?d:300;this.config=$.extend({caption:"",color:"#888"},a);if(this.config.pageIndex&&!(""==this.config.caption||this.config.pageIndex>originTotalPageCount))this.bg=$("<div></div>"),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.height=60,this.hiding=this.showing=!1,this.bg.css({position:"absolute",width:this.width+"px",
height:this.height+"px","background-color":this.config.color,"-webkit-border-radius":"6px","-moz-border-radius":"6px","-o-border-radius":"6px","-ms-border-radius":"6px","border-radius":"6px",border:"1px solid #000",cursor:"pointer"}),this.bg.append(this.caption),this.caption.setLabelPosition(5,8),this.initEvent()}bookMarkTab.prototype.resize=function(a,b){a>this.maxWidth&&(a=this.maxWidth);this.width=a;this.height=b;this.bg.css({width:a+"px",height:b+"px"})};
bookMarkTab.prototype.setPosition=function(a,b,c){c?this.bg.css({top:b+"px",right:a+"px",left:"auto"}):this.bg.css({top:b+"px",left:a+"px",right:"auto"})};bookMarkTab.prototype.show=function(){if(!this.showing){this.showing=!0;var a=this;this.bg.animate({top:0},150,function(){a.showing=!1})}};bookMarkTab.prototype.hide=function(){if(!this.hiding){this.hiding=!0;var a=this;this.bg.animate({top:30},150,function(){a.hiding=!1})}};
bookMarkTab.prototype.setMaxWidth=function(a){this.maxWidth=a;this.resize(this.width,this.height)};bookMarkTab.prototype.getWidth=function(){return this.width};bookMarkTab.prototype.initEvent=function(){var a=this;this.bg.bind("mouseover",function(){a.show()});this.bg.bind("mouseleave",function(){a.hide()});this.bg.bind(_event._down,function(){gotoPageFun(a.config.pageIndex)})};function tabBox(a){this.tabArray=[];this.bg=$("<div></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":20});a.append(this.bg)}tabBox.prototype.resize=function(a,b,c){this.width=a;this.height=b;this.bg.css({width:this.width+"px",height:this.height+"px"});this.setTabPosition(c)};tabBox.prototype.setPosition=function(a,b){this.bg.css({left:a+"px",top:b+"px"})};
tabBox.prototype.rotate=function(a){a=rotate(a);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":a,"-moz-transform":a,"-ms-transform":a,"-o-transform":a})};tabBox.prototype.show=function(){this.bg.css({display:"block"})};tabBox.prototype.hide=function(){this.bg.css({display:"none"})};tabBox.prototype.setItem=function(a){this.tabArray=a||[];this.setTabPosition()};
tabBox.prototype.initItem=function(a){for(var b=0;b<this.tabArray.length;b++)this.bg.append(this.tabArray[b].bg);this.setTabPosition(a)};
tabBox.prototype.setTabPosition=function(a){for(var b=0,c=0,d=0;d<this.tabArray.length;d++)b+=this.tabArray[d].getWidth(),this.bg.append(this.tabArray[d]);if(b<=this.width)for(b=0;b<this.tabArray.length;b++)this.tabArray[b].setPosition(c,30,a),c=c+this.tabArray[b].getWidth()+2;else for(d=0;d<this.tabArray.length;d++)this.tabArray[d].setPosition(c,30,a),c+=this.tabArray[d].getWidth()*this.width/b};function initBookMarkTab(a,b){this.isRight=b;this.tabArray=[];this.leftBox=new tabBox(a);this.rightBox=new tabBox(a);this.leftTabArr=[];this.rightTabArr=[];this.tipBox=$("<div></div>");this.tipImg=$("<img />");this.tipLabel=new label("page 1",this.tipBox);a.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,"z-index":10});this.tipImg.attr({src:""});this.tipLabel.setLabelPosition(5,this.tipBoxHeight-25);0!=bmtConfig.length&&(this.setPosition(),this.initItem())}initBookMarkTab.prototype.resize=function(a,b){this.leftBox.resize(a,b,!0);this.rightBox.resize(a,b,!1);this.setPosition()};initBookMarkTab.prototype.setPosition=function(){this.leftBox.setPosition(-60,flipBook.height);this.rightBox.setPosition(flipBook.width+60,0);this.leftBox.rotate(-90);this.rightBox.rotate(90)};
initBookMarkTab.prototype.initItem=function(){for(var a=0;a<bmtConfig.length;a++)this.tabArray.push(new bookMarkTab(bmtConfig[a],this.showTipBox,this.hideTipBox));this.isRight?(this.leftBox.tabArray=this.tabArray,this.leftBox.initItem(!0)):(this.rightBox.tabArray=this.tabArray,this.rightBox.initItem(!1))};initBookMarkTab.prototype.showTipBox=function(a){this.tipLabel.setCaption("page "+a);this.tipBox.animate({opacity:1,top:(windowHeight-this.tipBoxHeight)/2},{duration:300})};
initBookMarkTab.prototype.hideTipBox=function(){var a=this,b=(windowHeight-this.tipBoxHeight)/2-200;this.tipBox.animate({opacity:0},300,function(){a.tipBox.css({top:b+"px"})})};
initBookMarkTab.prototype.separated=function(a){this.leftTabArr=[];this.rightTabArr=[];if(this.isRight)for(var b=0;b<this.tabArray.length;b++)this.tabArray[b].config.pageIndex>=a?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>=a?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 shareButton(a,b){this.config=$.extend({iconURL:"",caption:"",link:""},b);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"});a.append(this.bg);this.bg.append(this.icon);this.caption.setLabelPosition(40,10);this.initEvent()}shareButton.prototype.onResize=function(a,b){this.bg.css({width:a+"px",height:b+"px"});100>a?(this.caption.setCSS({display:"none"}),this.icon.css({left:(a-30)/2+"px"})):100<=a&&(this.caption.setCSS({display:"block"}),this.icon.css({left:"5px"}))};
shareButton.prototype.initEvent=function(){this.bg.css({cursor:"pointer"});var a=this;this.bg.bind(_event._down,function(){window.open(a.config.link,"_blank")})};shareButton.prototype.setPosition=function(a,b){this.bg.css({left:a+"px",top:b+"px"})};function shareForm(a,b){form.call(this,a,b);this.visible=!1;this.itemArray=[];(this.isConfigItem=window.socialShareConfig)?this.addConfigItem():(this.addItem(),this.setButtonPos());this.background.translate(-windowWidth/2-20,0);this.background.css({left:"0px",overflow:"hidden",display:"none"})}$.extend(shareForm.prototype,form.prototype);
shareForm.prototype.addItem=function(){var a=window.location.href,b=window.document.title,c=window.location.pathname,c=c.substring(0,c.lastIndexOf("/"))+"/files/thumb/1.jpg",a="?&url="+a+"&title="+b+"&description="+bookDescription+"&screenshot="+c,b={iconURL:uiBaseURL+"facebook.png",caption:"Facebook",link:"http://api.addthis.com/oexchange/0.8/forward/facebook/offer"+a},c={iconURL:uiBaseURL+"google.png",caption:"Google+",link:"http://api.addthis.com/oexchange/0.8/forward/igoogle/offer"+a},d={iconURL:uiBaseURL+
"myspace.png",caption:"MySpace",link:"http://api.addthis.com/oexchange/0.8/forward/myspace/offer"+a},e={iconURL:uiBaseURL+"twitter.png",caption:"Twitter",link:"http://api.addthis.com/oexchange/0.8/forward/twitter/offer"+a},f={iconURL:uiBaseURL+"digg.png",caption:"Digg",link:"http://api.addthis.com/oexchange/0.8/forward/digg/offer"+a},j={iconURL:uiBaseURL+"more.png",caption:"More",link:"http://api.addthis.com/oexchange/0.8/offer"+a};this.emailButton=new shareButton(this.contentBox,{iconURL:uiBaseURL+
"email.png",caption:"Email",link:"http://api.addthis.com/oexchange/0.8/forward/email/offer"+a});this.fbButton=new shareButton(this.contentBox,b);this.ggButton=new shareButton(this.contentBox,c);this.msButton=new shareButton(this.contentBox,d);this.twButton=new shareButton(this.contentBox,e);this.diggButton=new shareButton(this.contentBox,f);this.moreButton=new shareButton(this.contentBox,j)};
shareForm.prototype.onResize=function(a,b){this.width=100>a?100:a;this.height=100>b?100:b;this.background.translate(this.visible?0:-this.width-20,0);this.background.css({width:this.width+"px",height:this.height+"px"});this.titleBox.css({width:this.width+"px"});this.contentBox.css({width:this.width+"px",height:this.height-this.titleBox.height()+"px"});if(this.isConfigItem)for(var c=0;c<this.itemArray.length;c++)this.itemArray[c].onResize(this.width/2-20,40);else 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.isConfigItem?this.setItemPosition():(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(){if(!this.visible){"none"==this.background[0].style.display&&this.background.css({display:"block"});var a=this,b=getTransform(this.background[0]),c={x:b.x,y:b.y};$(c).animate({x:0},{duration:400,step:function(){a.background.translate(c.x,c.y)},complete:function(){a.visible=!0}})}};
shareForm.prototype.hide=function(){if(this.visible){var a=this,b=getTransform(this.background[0]),c={x:b.x,y:b.y},b=function(){$(c).animate({x:-(a.width+20)},{duration:400,step:function(){a.background.translate(c.x,c.y)},complete:function(){a.visible=!1}})};"iphone"==device.name?setTimeout(b,200):b()}};shareForm.prototype.closeForm=function(){this.hide()};
shareForm.prototype.addConfigItem=function(){for(var a=window.location.href,b=window.document.title,c=window.location.pathname,d=bookDescription,c=c.substring(0,c.lastIndexOf("/"))+"/files/thumb/1.jpg",a="?&url="+a+"&title="+b+"&description="+d+"&screenshot="+c,b=0;b<socialShareConfig.items.length;b++)this.itemArray.push(new shareButton(this.contentBox,{iconURL:uiBaseURL+socialShareConfig.items[b].imgURL,caption:socialShareConfig.items[b].name,link:socialShareConfig.items[b].url+a,fontName:socialShareConfig.fontName,
fontColor:socialShareConfig.fontColor}));this.setItemPosition()};shareForm.prototype.setItemPosition=function(){for(var a=0;a<this.itemArray.length;a++)this.itemArray[a].setPosition(1==a%2?this.width/2:5,50*Math.floor(a/2)+10)};function treeNode(a,b){this.config=$.extend({caption:"untitled",page:0,width:280,height:40,backColor:"#888888",level:0},a);var c=this;this.background=$('<div style="position:relative; overflow : hidden;"></div>');this.contentBox=$('<div style="position:absolute;"></div>');this.textField=new label(this.config.caption,this.contentBox);this.expandButton=new button(1,this.contentBox,{iconURL:uiBaseURL+"closed.png"},!1,!0);this.children=[];this.opened=this.hasChild=!1;this.totalHeight=0;this.textField.shortWord(25);
this.isDrag=!1;this.expandButton.setVisible(!1);$(b).append(this.background);$(this.background).append(this.contentBox);this.expandButton.setButtonPosition(0,0);this.textField.setLabelPosition(38,10);$(this.contentBox).css({width:this.config.width-(12*(this.config.level-1)+30)+"px",height:this.config.height+"px",left:12*(this.config.level-1)+5+"px",cursor:"pointer"});$(this.background).css({width:this.config.width-25+"px",height:this.config.height+"px",left:"16px",top:"10px","background-color":this.config.backColor,
"border-left":"1px solid #555555","border-right":"1px solid #555555","border-bottom":"1px solid #555555"});this.expandButton.onMouseUp(this,this.onExpand);$(this.contentBox).bind(_event._end,function(){isBookmarkDrag||gotoPageFun(c.config.page);$(c.background).css({"background-color":c.config.backColor})});$(this.contentBox).bind(_event._down,function(){var a=colorDiv(c.config.backColor,60);$(c.background).css({"background-color":a})});$(this.contentBox).bind("mouseleave",function(){$(c.background).css({"background-color":c.config.backColor})})}
treeNode.prototype.setBorderTop=function(){$(this.background).css("border-top","1px solid #555555")};treeNode.prototype.setButtonVisible=function(a){this.expandButton.setVisible(a)};treeNode.prototype.setHasChildren=function(a){this.hasChild=a};treeNode.prototype.setVisible=function(a){$(this.background).css({display:a?"block":"none"})};treeNode.prototype.getIsExpand=function(){return this.opened};treeNode.prototype.setIsExpand=function(a){this.opened=a};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(a){this.config.caption=a};treeNode.prototype.setColor=function(){};treeNode.prototype.setPosition=function(a,b,c){void 0==c&&(c=["left","top"]);$(this.background).css(c[0],a+"px");$(this.background).css(c[1],b+"px")};
treeNode.prototype.onResize=function(a,b){this.config.width=a;b&&(this.config.height=b);this.background.css({width:this.config.width+"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 a=0;a<this.children.length;a++)this.children[a].setVisible(!0),this.children[a].getIsExpand()&&this.children[a].expand()}};
treeNode.prototype.collapse=function(){if(this.hasChild){this.expandButton.changeIcon(uiBaseURL+"closed.png");for(var a=0;a<this.children.length;a++)this.children[a].setVisible(!1),this.children[a].collapse()}};treeNode.prototype.onExpand=function(){this.opened?this.collapse():this.expand();this.opened=!this.opened;$(this.background).css({"background-color":this.config.backColor})};treeNode.prototype.addChildren=function(a){this.children.push(a)};
treeNode.prototype.addNode=function(a){this.children.push(new treeNode(a,this.background))};treeNode.prototype.deleteNode=function(){};treeNode.prototype.getPageIndex=function(){return this.config.page};var isBookmarkDrag=!1;
function tableContent(a,b){form.call(this,a,b);this.scrollMask=$('<div style = "position : absolute;"></div>');this.scrollBox=$('<div style = "position : absolute; width : 290px; height : 300px; overflow-y : auto;"></div>');this.scrollMouseDown=!1;this.mouseDownY=-1;this.showing=!1;this.itemArr=[];$(this.contentBox).append(this.scrollMask);$(this.scrollMask).append(this.scrollBox);this.captionBox.setFont("15px","#f0f0f0",null);this.captionBox.setCaption("<strong>Table of Content</strong>");this.initScrollEvent();
try{this.addContent(ols,!1)}catch(c){$("#btnBookmark").css({display:"none"}),bookmarkButtonEnable=!1}this.background.translate(-(windowWidth/2+20),0);this.background.css({opacity:0.95,"z-index":99,top:"0px",left:"0px",display:"none"});this.titleBox.unbind(_event._down);this.titleBox.unbind(_event._move);this.titleBox.unbind(_event._end)}$.extend(tableContent.prototype,form.prototype);
tableContent.prototype.addContent=function(a,b,c){for(var d=0;d<a.length;d++){var e=new treeNode(a[d],this.scrollBox);this.itemArr.push(e);!b&&0==d&&e.setBorderTop();b&&(c.addChildren(e),e.setVisible(!1));1<=a[d].children.length&&(e.setButtonVisible(!0),e.setHasChildren(!0),this.addContent(a[d].children,!0,e))}};
tableContent.prototype.onResize=function(a,b){this.width=100>a?100:a;this.height=100>b?100:b;this.background.translate(this.showing?0:-(this.width+20),0);this.background.css({width:this.width+"px",height:this.height+"px"});this.contentBox.css({width:this.width+"px",height:this.height-this.titleBox.height()+"px"});this.titleBox.css({width:this.width+"px"});$(this.scrollMask).css({width:this.width+"px",height:this.height-this.titleBox.height()+"px"});$(this.scrollBox).css({width:this.width+"px",height:this.height-
this.titleBox.height()-15+"px"});for(var c=0;c<this.itemArr.length;c++)this.itemArr[c].onResize(this.width-30)};tableContent.prototype.showForm=function(){"none"==this.background[0].style.display&&this.background.css({display:"block"});if(!this.showing){var a=this,b=getTransform(this.background[0]);left={x:b.x,y:b.y};$(left).animate({x:0},{duration:400,step:function(){a.background.translate(left.x,left.y)},complete:function(){a.showing=!0}})}};
tableContent.prototype.closeForm=function(){if(this.showing){var a=this,b=getTransform(this.background[0]);left={x:b.x,y:b.y};b=function(){$(left).animate({x:-windowWidth/2-20},{duration:400,step:function(){a.background.translate(left.x,left.y)},complete:function(){a.showing=!1}})};"iphone"==device.name?setTimeout(b,200):b()}};tableContent.prototype.getShowStatu=function(){return this.showing};tableContent.prototype.setShowStatu=function(a){this.showing=a};
tableContent.prototype.setPosition=function(a,b,c){void 0==c&&(c=["left","top"]);$(this.background).css(c[0],a+"px");$(this.background).css(c[1],b+"px")};
tableContent.prototype.initScrollEvent=function(){var a=this;$(this.scrollBox).bind(_event._down,function(b){a.scrollMouseDown=!0;isBookmarkDrag=!1;b=isTouch?b.originalEvent.touches:[b];a.mouseDownY=b[0].pageY;3==browserType?event.cancelBubble=!0:event.stopPropagation()});$(this.scrollBox).bind(_event._move,function(b){a.scrollMouseDown&&(b=isTouch?b.originalEvent.touches:[b],20<Math.abs(a.mouseDownY-b[0].pageY)&&(isBookmarkDrag=!0))});$(this.scrollBox).bind(_event._end,function(){a.scrollMouseDown=
!1})};function loadToolBar(a,b){this.visible=!1;this.icons=b;this.toolBG=$("<div class='fbToolBar' id='fbToolBar' style='opacity: 0.65;'></div>");this.logoBar=$("<div id='logoBar' style='position: absolute;z-index: 2;'></div>");this.buttonBar=$("<div class='bottom right' style='position: absolute;left: auto;right: 0px;z-index: 3;'></div>");this.btnLast=$("<div title='Last Page' id='btnLast' class='numbering'></div>");this.btnNext=$("<div title='Next Page' id='btnRight' class='numbering'></div>");this.btnPrevious=
$("<div title='Previous Page'  id='btnLeft' class='numbering'></div>");this.edtPageNumber=$("<div style='position:absolute;'><input type='text' id='currentPageIndexTextField' size='13' value='' style='text-align: center' /></div>");this.btnFirst=$("<div title='First Page' id='btnFirst' class='numbering' ></div>");this.btnZoom=$("<div title='Zoom In' id='btnZoom' class='numbering'></div>");this.btnAutoPlay=$("<div title='Auto Play' id='btnAutoPlay' class='numbering' ></div>");this.btnThumb=$("<div title='Thumbnails'  id='btnThumb' class='numbering'></div>");
this.btnShare=$("<div title='Share'  id='btnShare' class='numbering'></div>");this.btnSearch=$("<div title='Search' id='btnSearch' class='numbering'></div>");this.btnBookMark=$("<div title='Bookmark' id='btnBookmark' class='numbering'></div>");this.btnDownload=$("<div title='Download' id='btnDownload' class='numbering'></div>");this.btnSound=$("<div title='Sound On' id='btnSound' class='numbering'></div>");this.btnHome=$("<div title='Home' id='btnHome' class='numbering'></div>");this.btnChangeLanguage=
$("<div title='Change Language' id='btnLanguage' class='numbering'></div>");this.btnFullscreen=$("<div title='Enable Fullscreen' id='btnFullscreen' class='numbering'></div>");this.btnHelp=$("<div title='Help' id='btnHelp' class='numbering'></div>");a.append(this.toolBG);this.toolBG.append(this.logoBar);this.toolBG.append(this.buttonBar);this.buttonBar.append(this.btnLast);this.buttonBar.append(this.btnNext);this.buttonBar.append(this.edtPageNumber);this.buttonBar.append(this.btnPrevious);this.buttonBar.append(this.btnFirst);
this.buttonBar.append(this.btnZoom);this.buttonBar.append(this.btnAutoPlay);this.buttonBar.append(this.btnThumb);this.buttonBar.append(this.btnShare);this.buttonBar.append(this.btnSearch);this.buttonBar.append(this.btnBookMark);this.buttonBar.append(this.btnDownload);this.buttonBar.append(this.btnSound);this.buttonBar.append(this.btnHome);this.buttonBar.append(this.btnChangeLanguage);this.buttonBar.append(this.btnFullscreen);this.buttonBar.append(this.btnHelp);this.toolBG.append(getImage(toolBarIconsURL[0]));
this.btnLast.append(getImage(toolBarIconsURL[1])).asButton().attr("title",getLanguage("btnLastPage","Last"));this.btnNext.append(getImage(toolBarIconsURL[2])).asButton().attr("title",getLanguage("btnNextPage","Next"));this.btnPrevious.append(getImage(toolBarIconsURL[3])).asButton().attr("title",getLanguage("btnPrePage","Previous"));this.btnFirst.append(getImage(toolBarIconsURL[4])).asButton().attr("title",getLanguage("btnFirstPage","First"));this.btnZoom.append(getImage(toolBarIconsURL[5])).asButton().attr("title",
getLanguage("btnZoomIn","Zoom In"));this.btnAutoPlay.append(getImage(toolBarIconsURL[7])).asButton().attr("title",getLanguage("btnAutoFlip","Auto Flip"));this.btnThumb.append(getImage(toolBarIconsURL[9])).asButton().attr("title",getLanguage("btnThumb","Thumbnails"));this.btnShare.append(getImage(toolBarIconsURL[10])).asButton().attr("title",getLanguage("btnSocialShare","Share"));this.btnSearch.append(getImage(toolBarIconsURL[11])).asButton().attr("title",getLanguage("btnSearch","Search"));this.btnBookMark.append(getImage(toolBarIconsURL[14])).asButton().attr("title",
getLanguage("btnBookMark","Book Mark"));this.btnDownload.append(getImage(toolBarIconsURL[12])).asButton().attr("title",getLanguage("btnDownload","Download"));this.btnHome.append(getImage(toolBarIconsURL[13])).asButton().attr("title",getLanguage("btnLastPage","Last"));this.btnChangeLanguage.append($("<img src='"+uiBaseURL+"language.png' />")).asButton().attr("title",getLanguage("btnChangeLanguage","Change Language"));this.btnFullscreen.append($("<img src='"+uiBaseURL+"fullscreen.png' />")).asButton().attr("title",
getLanguage("btnFullScreen","Enable Fullscreen"));this.btnHelp.append(getImage(toolBarIconsURL[24])).asButton().attr("title",getLanguage("btnHelp","Help"));rightToLeft&&(this.btnFirst.attr({title:getLanguage("btnLastPage","Last")}),this.btnLast.attr({title:getLanguage("btnFirstPage","First")}),this.btnNext.attr({title:getLanguage("btnPrePage","Previous")}),this.btnPrevious.attr({title:getLanguage("btnNextPage","Next")}));getBool("autoPlayAutoStart",!1)&&(this.btnAutoPlay.empty().append(getImage(toolBarIconsURL[8])),
this.btnAutoPlay.attr("title",getLanguage("btnStopAutoFlip","Stop Auto Flip")));thumbnail=rightToLeft?new rightThumbnailBar(tmpContainer):new thumbnailBar(tmpContainer);initLogoBar();userConfig.autoPlayButtonVisible||this.btnAutoPlay.css("display","none");zoomButtonEnable||this.btnZoom.css("display","none");thumbButtonEnable||this.btnThumb.css("display","none");shareButtonEnable||this.btnShare.css("display","none");searchButtonEnable||this.btnSearch.css("display","none");bookmarkButtonEnable||this.btnBookMark.css("display",
"none");userConfig.downloadButtonVisible||this.btnDownload.css({display:"none"});userConfig.fullscreenButtonVisible||this.btnFullscreen.css({display:"none"});userConfig.helpButtonVisible||this.btnHelp.css({display:"none"});userConfig.homeButtonVisible||this.btnHome.css({display:"none"});userConfig.languageButtonVisible||this.btnChangeLanguage.css({display:"none"});userConfig.languageButtonVisible&&(languageBar=new languageList(tmpContainer));this.initEvent()}
loadToolBar.prototype.setButtonPosition=function(){var a=45,b=3,c=!1;600>window.innerWidth&&(c=!0,a=40);$(getImage(toolBarIconsURL[0])).css({width:windowWidth+"px",height:"42px"});c?this.btnLast.css({display:"none"}):(this.btnLast.css({display:"block"}),this.btnLast.css({right:b+"px"}),b+=a);this.btnNext.css({right:b+"px"});b+=a;c?this.edtPageNumber.css({display:"none"}):(this.edtPageNumber.css({display:"block"}),this.edtPageNumber.css({right:b-3+"px",top:"3px"}),b=b+this.edtPageNumber.width()+3);
this.btnPrevious.css({right:b+"px"});b+=a;c?this.btnFirst.css({display:"none"}):(this.btnFirst.css({display:"block"}),this.btnFirst.css({right:b+"px"}),b+=a);zoomButtonEnable&&(this.btnZoom.css({top:"2px",right:b+"px"}),b+=a);userConfig.autoPlayButtonVisible&&(this.btnAutoPlay.css({top:"2px",right:b+"px"}),b+=a);thumbButtonEnable&&(this.btnThumb.css({top:"2px",right:b+"px"}),b+=a);shareButtonEnable&&(this.btnShare.css({top:"2px",right:b+"px"}),b+=a);searchButtonEnable&&(this.btnSearch.css({top:"2px",
right:b+"px"}),b+=a);bookmarkButtonEnable&&(this.btnBookMark.css({top:"2px",right:b+"px"}),b+=a);userConfig.downloadButtonVisible&&(this.btnDownload.css({top:"2px",right:b+"px"}),b+=a);userConfig.homeButtonVisible&&(this.btnHome.css({top:"2px",right:b+"px"}),b+=a);userConfig.languageButtonVisible&&(this.btnChangeLanguage.css({top:"2px",right:b+"px"}),null!=languageBar&&languageBar.setPosition(b-70,40,["right","bottom"]),b+=a);userConfig.fullscreenButtonVisible&&(this.btnFullscreen.css({top:"2px",
right:b+"px"}),b+=a);userConfig.helpButtonVisible&&this.btnHelp.css({top:"2px",right:b+"px"})};loadToolBar.prototype.show=function(){var a=this;a.animate=a.toolBG.animate({bottom:0,opacity:0.65},500,function(){a.visible=!0})};loadToolBar.prototype.hide=function(){var a=this;a.animate=a.toolBG.animate({bottom:-50,opacity:0},500,function(){a.visible=!1})};
loadToolBar.prototype.initEvent=function(){var a=this;this.btnLast.bind(_event._end,function(){a.lastPage()});this.btnNext.bind(_event._end,function(){a.nextPage()});this.btnPrevious.bind(_event._end,function(){a.prePage()});this.btnFirst.bind(_event._end,function(){a.firstPage()});this.btnZoom.bind(_event._end,function(){2==bookType?(windowWidth<windowHeight?(changeShowBook(1),bookType=1,setCurrentIndexTextField($(singlePageBook).data().currentPageIndex),$(singlePageBook).data().gotoPage(zoomBook.currentIndex)):
(changeShowBook(0),bookType=0,setCurrentIndexTextField(flipBook.currentPageIndex,!0),flipBook.gotoPage(zoomBook.currentIndex)),thumbnail.clearHighLight(),thumbnail.setHighLight(zoomBook.currentIndex),a.btnZoom.empty().append(getImage(toolBarIconsURL[5])).attr("title",getLanguage("btnZoomIn","Zoom In"))):(zoomBook.currentIndex=0==bookType?flipBook.currentPageIndex:$(singlePageBook).data().currentPageIndex,zoomBook.showPage.fillContent(zoomBook.currentIndex),changeShowBook(2),bookType=2,a.btnZoom.empty().append(getImage(toolBarIconsURL[6])).attr("title",
getLanguage("btnZoomOut","Zoom Out")),setCurrentIndexTextField(zoomBook.currentIndex,!1),thumbnail.clearHighLight(),thumbnail.setHighLight(zoomBook.currentIndex))});this.btnAutoPlay.bind(_event._end,function(){auto_player.isPlaying()?(auto_player.stop(),a.btnAutoPlay.empty().append(getImage(toolBarIconsURL[7])).attr("title",getLanguage("btnStopAutoFlip","Stop Auto Flip"))):(auto_player.start(),a.btnAutoPlay.empty().append(getImage(toolBarIconsURL[8])).attr("title",getLanguage("btnAutoFlip","Auto Flip")))});
this.btnThumb.bind(_event._end,function(){thumbnail.getShowStatu()?thumbnail.hideBox():thumbnail.showshow()});this.btnShare.bind(_event._end,function(){frmShare.visible?frmShare.hide():frmShare.show();return!1});this.btnShare.bind(_event._down,function(){return!1});this.btnSearch.bind(_event._end,function(){frmSearch.isSearchShow?frmSearch.closeForm():frmSearch.showForm()});this.btnBookMark.bind(_event._end,function(){frmBookmark.getShowStatu()?frmBookmark.closeForm():frmBookmark.showForm()});this.btnDownload.bind(_event._end,
function(){""!=userConfig.downloadURL&&window.open(userConfig.downloadURL,"_Blank")});this.btnSound.bind(_event._end,function(){});this.btnHome.bind(_event._end,function(){if(void 0!=userConfig.homeURL&&""!=userConfig.homeURL){var a=userConfig.homeURL;"http"!=a.substr(0,4)&&(a="http://"+a);window.open(a,"_Blank")}});this.btnChangeLanguage.bind(_event._end,function(){userConfig.languageButtonVisible&&null!=languageBar&&(languageBar.showing?languageBar.hide():languageBar.show());return!1});this.btnChangeLanguage.bind(_event._down,
function(){return!1});this.btnFullscreen.bind(_event._end,function(){fullScreenApi.isFullScreen()?fullScreenApi.cancelFullScreen(this):$(document.body).requestFullScreen()});this.btnHelp.bind(_event._down,function(){helpSlide&&helpSlide.init([{url:uiBaseURL+"user_help1.png"},{url:uiBaseURL+"user_help2.png"},{url:uiBaseURL+"user_help3.png"}])});this.toolBG.bind(_event._down,function(){frmShare.visible&&frmShare.hide();userConfig.languageButtonVisible&&null!=languageBar&&languageBar.showing&&languageBar.hide()})};
loadToolBar.prototype.lastPage=function(){rightToLeft?firstPageFun():lastPageFun()};loadToolBar.prototype.nextPage=function(){rightToLeft?previousPageFun():nextPageFun()};loadToolBar.prototype.prePage=function(){rightToLeft?nextPageFun():previousPageFun()};loadToolBar.prototype.firstPage=function(){rightToLeft?lastPageFun():firstPageFun()};
loadToolBar.prototype.changeLanguage=function(){this.btnLast.attr("title",getLanguage("btnLastPage","Last"));this.btnNext.attr("title",getLanguage("btnNextPage","Next"));this.btnPrevious.attr("title",getLanguage("btnPrePage","Previous"));this.btnFirst.attr("title",getLanguage("btnFirstPage","First"));this.btnZoom.attr("title",2==bookType?getLanguage("btnZoomOut","Zoom Out"):getLanguage("btnZoomIn","Zoom In"));this.btnAutoPlay.attr("title",auto_player.isPlaying()?getLanguage("btnStopAutoFlip","Stop Auto Flip"):
getLanguage("btnAutoFlip","Auto Flip"));this.btnThumb.attr("title",getLanguage("btnThumb","Thumbnails"));this.btnShare.attr("title",getLanguage("btnSocialShare","Share"));this.btnSearch.attr("title",getLanguage("btnSearch","Search"));this.btnBookMark.attr("title",getLanguage("btnBookMark","Book Mark"));this.btnDownload.attr("title",getLanguage("btnDownload","Download"));this.btnHome.attr("title",getLanguage("btnLastPage","Last"));rightToLeft&&(this.btnFirst.attr({title:getLanguage("btnLastPage","Last")}),
this.btnLast.attr({title:getLanguage("btnFirstPage","First")}),this.btnNext.attr({title:getLanguage("btnPrePage","Previous")}),this.btnPrevious.attr({title:getLanguage("btnNextPage","Next")}))};loadToolBar.prototype.getHeight=function(){return this.getTopHeight()+this.getBottomHeight()};loadToolBar.prototype.getTopHeight=function(){return 0};loadToolBar.prototype.getBottomHeight=function(){return this.toolBG.height()};loadToolBar.prototype.getLogoHeight=function(){return 0};
loadToolBar.prototype.moveButtonBar=function(a){this.buttonBar.css({right:a+"px"})};
function languageList(a){!language.length||1>=language.length?(userConfig.languageButtonVisible=!1,languageBar=null):(this.showing=!1,this.width=120,this.height=80,this.color="#808080",this.buttonArray=[],this.bg=$("<div></div>"),this.bg.css({display:"none",position:"absolute",width:this.width+"px",height:this.height+"px","background-color":this.color,"-webkit-box-shadow":"0 0 5px rgba(40, 0, 0, 0.8)","-moz-box-shadow":"0 0 5px rgba(40, 0, 0, 0.5)","-o-box-shadow":"0 0 5px rgba(40, 0, 0, 0.5)","-ms-box-shadow":"0 0 5px rgba(40, 0, 0, 0.5)",
"box-shadow":"0 0 5px rgba(40, 0, 0, 0.5)"}),a.append(this.bg),this.addButton())}languageList.prototype.setPosition=function(a,b,c){c||(c=["left","top"]);this.bg.css(c[0],a+"px");this.bg.css(c[1],b+"px")};languageList.prototype.addButton=function(){for(var a=0;a<language.length;a++)this.buttonArray.push(new languageButton(this.bg,language[a].language,this.color));this.resize(this.width,30*this.buttonArray.length+5);this.setButtonPosition()};
languageList.prototype.setButtonPosition=function(){for(var a=0;a<this.buttonArray.length;a++)this.buttonArray[a].setPosition(5,30*a+5)};languageList.prototype.resize=function(a,b){this.width=a;this.height=b;this.bg.css({width:this.width+"px",height:this.height+"px"});for(var c=0;c<this.buttonArray.length;c++)this.buttonArray[c].resize(this.width-10,25)};
languageList.prototype.show=function(){this.showing||(this.bg.css({opacity:0,display:"block"}),this.animate=this.bg.animate({opacity:1},300),this.showing=!0)};languageList.prototype.hide=function(){this.showing&&(this.bg.animate({opacity:0},300),this.showing=!1)};
function languageButton(a,b,c){this.bg=$("<div></div>");this.width=110;this.height=25;this.color=c;this.bg.css({position:"absolute",width:this.width+"px",height:this.height+"px"});this.caption=b;this.captionLabel=new label(this.caption,this.bg);this.captionLabel.setLabelPosition(5,2);a.append(this.bg);this.initEvent()}languageButton.prototype.setPosition=function(a,b,c){c||(c=["left","top"]);this.bg.css(c[0],a+"px");this.bg.css(c[1],b+"px")};
languageButton.prototype.resize=function(a,b){this.bg.css({width:a+"px",height:b+"px"})};
languageButton.prototype.initEvent=function(){var a=this;this.bg.bind(_event._down,function(){changeLanguage(a.caption);languageBar.hide();if(isTouch){var b=colorDiv(a.color,40);a.bg.css("background-color",b)}});this.bg.bind("mouseover",function(){var b=colorDiv(a.color,40);a.bg.css("background-color",b)});this.bg.bind("mouseleave",function(){a.bg.css("background-color",a.color)});this.bg.bind(_event._end,function(){isTouch&&a.bg.css("background-color",a.color)})};function thumbnailCell(a){this.background=$("<div></div>");this.img=$("<img />");this.pageIndex=-1;this.width=130;this.height=170;this.pageTextField=new label(1,this.background);this.imgHeight=this.imgWidth=-1;$(a).append(this.background);$(this.background).css({position:"absolute",width:this.width+"px",height:this.height+"px"});$(this.img).css({position:"absolute"});this.pageTextField.setFont("12px","#f0f0f0",null);this.pageTextField.setLabelPosition((this.width-this.pageTextField.getWidth())/2,
0,["left","bottom"])}thumbnailCell.prototype.getPageIndex=function(){return this.pageIndex};thumbnailCell.prototype.getWidth=function(){return this.width};thumbnailCell.prototype.getHeight=function(){return this.height};thumbnailCell.prototype.setPosition=function(a,b,c){void 0==c&&(c=["left","top"]);$(this.background).css(c[0],a+"px");$(this.background).css(c[1],b+"px")};thumbnailCell.prototype.onResize=function(a,b){$(this.background).css({width:a+"px",height:b+"px"});this.onResizeImage(a,b)};
thumbnailCell.prototype.onResizeImage=function(){var a=getPageWidthHeight(this.width,this.height-20,zoomPageWidth,zoomPageHeight);this.imgWidth=a.x;this.imgHeight=a.y;$(this.img).css({width:a.x+"px",height:a.y+"px"});$(this.img).css({left:(this.width-a.x)/2+"px",top:(this.height-20-a.y)/2+4+"px"})};
thumbnailCell.prototype.setImgPosition=function(a){switch(a){case "l":$(this.img).css({left:"0px",right:"auto"});break;case "r":$(this.img).css({right:"0px",left:"auto"});break;case "c":$(this.img).css({left:(this.width-this.imgWidth)/2+"px",right:"auto"})}};thumbnailCell.prototype.setCaption=function(a){this.pageTextField.setCaption(a)};
thumbnailCell.prototype.fillImage=function(a){this.pageIndex=a;$(this.img).attr("src",getPageDir(a,"thumb"));$(this.background).append(this.img);this.onResizeImage(this.width,this.height);this.pageTextField.setCaption(a)};thumbnailCell.prototype.showBorder=function(){$(this.background).css({border:"1px solid #444444"})};thumbnailCell.prototype.hideBorder=function(){$(this.background)[0].style.border=""};thumbnailCell.prototype.getTextField=function(){return this.pageTextField};
thumbnailCell.prototype.hideTextField=function(){this.pageTextField.setCSS({display:"none"})};thumbnailCell.prototype.showTextField=function(){this.pageTextField.setCSS({display:"block"})};thumbnailCell.prototype.showCell=function(a){$(this.background).css({display:a?"block":"none"})};thumbnailCell.prototype.onMouseUp=function(a,b){var c=this;$(this.background).bind(_event._end,function(){b.call(a,c)})};thumbnailCell.prototype.unbindMouseUp=function(){this.background.unbind(_event._end)};
thumbnailCell.prototype.highLight=function(a){$(this.background).css({"background-color":a})};thumbnailCell.prototype.clearHighLight=function(){$(this.background).css({"background-color":""})};function thumbnailItem(a,b){this.background=$("<div></div>");this.itemB=new thumbnailCell(this.background);this.itemA=new thumbnailCell(this.background);this.oriWidth=this.width=260;this.height=170;this.isMerge=this.isDoublePage=!0;this.pageIndex=b;this.fillImage=!1;this.mainColor="#888888";this.textField=new label(b+"-"+(b+1),this.background);this.textField.setLabelPosition((this.width-this.textField.getWidth())/2,0,["left","bottom"]);this.textField.setFont("12px","#f0f0f0",null);$(a).append(this.background);
$(this.background).css({position:"absolute",border:"1px solid #555555",width:this.width+"px",height:this.height+"px"});1!=b&&b!=totalPageCount?(this.itemA.setPosition(0,0),this.itemB.setPosition(0,0,["right","top"]),this.itemB.onMouseUp(this,this.onItemMouseUp)):(this.itemA.setPosition(0,0),this.itemB.showCell(!1),this.textField.setCSS({display:"none"}),this.setBorder(!1));this.itemA.onMouseUp(this,this.onItemMouseUp)}thumbnailItem.prototype.getWidth=function(){return this.width};
thumbnailItem.prototype.addImage=function(){this.fillImage||(this.itemA.fillImage(this.pageIndex),1!=this.pageIndex&&this.pageIndex!=totalPageCount&&this.itemB.fillImage(this.pageIndex+1),this.fillImage=!0)};thumbnailItem.prototype.setPosition=function(a,b,c){void 0==c&&(c=["left","top"]);$(this.background).css(c[0],a+"px");$(this.background).css(c[1],b+"px")};thumbnailItem.prototype.onResize=function(a,b){this.width=a;this.height=b;$(this.background).css({width:a+"px",height:b+"px"})};
thumbnailItem.prototype.resetItem=function(){};thumbnailItem.prototype.fission=function(){1==this.pageIndex||this.pageIndex==totalPageCount||(this.setBorder(!1),this.itemA.setImgPosition("c"),this.itemB.setImgPosition("c"),this.showTextField(!1),this.isMerge=!1,this.onResize(this.oriWidth+10,170))};
thumbnailItem.prototype.merge=function(){1==this.pageIndex||this.pageIndex==totalPageCount||(this.setBorder(!0),this.itemA.setImgPosition("r"),this.itemB.setImgPosition("l"),this.showTextField(!0),this.isMerge=!0,this.onResize(this.width,170))};thumbnailItem.prototype.showBorder=function(){$(this.background).css({border:"1px solid #444444"})};thumbnailItem.prototype.hideBorder=function(){$(this.background)[0].style.border=""};
thumbnailItem.prototype.showTextField=function(a){var b=a?"none":"block";this.textField.setCSS({display:a?"block":"none"});this.itemA.getTextField().setCSS({display:b});this.itemB.getTextField().setCSS({display:b})};thumbnailItem.prototype.setBorder=function(a){a?($(this.background).css({border:"1px solid #444444"}),this.itemA.hideBorder(),this.itemB.hideBorder()):($(this.background)[0].style.border="",this.itemA.showBorder(),this.itemB.showBorder())};
thumbnailItem.prototype.onItemMouseUp=function(a){isThumbDrag||(a=a.getPageIndex(),gotoPageFun(a))};thumbnailItem.prototype.highLight=function(a){var b=colorDiv(this.mainColor,50);this.isMerge?1==a||a==totalPageCount?this.itemA.highLight(b):$(this.background).css({"background-color":b}):a==this.pageIndex?this.itemA.highLight(b):this.itemB.highLight(b)};thumbnailItem.prototype.clearHighLight=function(){$(this.background).css({"background-color":""});this.itemA.clearHighLight();this.itemB.clearHighLight()};
function rightThumbnailItem(a,b){thumbnailItem.call(this,a,b);this.textField.setCaption(b+1+"-"+b,this.background);1!=b&&b!=totalPageCount?(this.itemA.setPosition(0,0),this.itemB.setPosition(0,0,["right","top"])):(this.itemB.setPosition(0,0,["right","top"]),this.itemA.showCell(!1),this.itemB.showCell(!0),this.textField.setCSS({display:"none"}),this.setBorder(!1),this.itemA.unbindMouseUp);this.itemB.onMouseUp(this,this.onItemMouseUp)}$.extend(rightThumbnailItem.prototype,thumbnailItem.prototype);
rightThumbnailItem.prototype.addImage=function(){this.fillImage||(this.itemB.fillImage(this.pageIndex),1!=this.pageIndex&&this.pageIndex!=totalPageCount&&this.itemA.fillImage(this.pageIndex+1),this.fillImage=!0)};rightThumbnailItem.prototype.highLight=function(a){var b=colorDiv(this.mainColor,50);this.isMerge?1==a||a==totalPageCount?this.itemB.highLight(b):$(this.background).css({"background-color":b}):a==this.pageIndex?this.itemB.highLight(b):this.itemA.highLight(b)};var isThumbDrag=!1;
function thumbnailBar(a){this.background=$("<div class='thumbBar'></div>");this.contentBox=$("<div class='thumbBG'></div>");this.scrollBox=$("<div class='thumbBox'></div>");this.mouseDown=this.showing=!1;this.scrollBoxX=this.mouseDownX=-1;this.width=800;this.height=210;this.mainColor="#888888";this.thumbArray=[];this.lastMoveTime=this.lastMoveX=-1;this.mergeing=this.moveLeft=!1;$(this.contentBox).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.background.css({height:this.height+"px",bottom:-(this.height+10)+"px"});this.contentBox.css({height:this.height-10+"px"});this.scrollBox.css({height:this.height-26+"px"});$(a).append(this.background);$(this.background).append(this.contentBox);$(this.contentBox).append(this.scrollBox);this.closeButton=new button(1,this.background,{iconURL:uiBaseURL+"close.png"},!0);this.closeButton.setButtonPosition(5,0,["right","top"]);this.addItem();this.initEvent();
this.setHighLight(1);this.currentCellIndex=1;this.fillNearByImages(0)}thumbnailBar.prototype.onResize=function(){var a=$(this.background).width(),b=$(this.scrollBox).width();if(a>b)$(this.scrollBox).css({left:(a-b)/2+"px"});else{var c=$(this.scrollBox).offset().left;0<c&&(c=0);c<a-b&&(c=a-b);$(this.scrollBox).css({left:c+"px"});this.fillNearByImages(c)}};
thumbnailBar.prototype.setPosition=function(a,b,c){void 0==c&&(c=["left","top"]);$(this.background).css(c[0],a+"px");$(this.background).css(c[1],b+"px")};thumbnailBar.prototype.addItem=function(){for(var a=0;a<=originTotalPageCount;){var b=0==a?new thumbnailItem(this.scrollBox,1):new thumbnailItem(this.scrollBox,a);b.getWidth();b.setPosition(this.thumbArray.length*(b.getWidth()+5)+5,5);this.thumbArray.push(b);a+=2}$(this.scrollBox).css({width:this.thumbArray.length*(b.getWidth()+5)+10+"px"});this.mergeAll()};
thumbnailBar.prototype.resetItemPosition=function(){for(var a=0,b=0;b<this.thumbArray.length;b++){var c=this.thumbArray[b];0==b?(c.setPosition(5,5),a=140):(c.setPosition(a,5),a=a+c.getWidth()+5)}$(this.scrollBox).css({width:a+"px"})};thumbnailBar.prototype.mergeAll=function(){if(!this.mergeing){for(var a=0;a<this.thumbArray.length;a++)this.thumbArray[a].merge();this.resetItemPosition();this.mergeing=!0}};
thumbnailBar.prototype.fissionAll=function(){for(var a=0;a<this.thumbArray.length;a++)this.thumbArray[a].fission();this.resetItemPosition();this.mergeing=!1};thumbnailBar.prototype.getShowStatu=function(){return this.showing};thumbnailBar.prototype.setShowStatu=function(a){this.showing=a};thumbnailBar.prototype.showshow=function(){$(this.background).animate({bottom:0},300);this.showing=!0};thumbnailBar.prototype.hideBox=function(){$(this.background).animate({bottom:-220},300);this.showing=!1};
thumbnailBar.prototype.initEvent=function(){var a=this;this.background.bind(_event._down,function(){return!1});this.closeButton.onMouseUp(this,this.hideBox);$(this.contentBox).bind(_event._down,function(b){a.mouseDown=!0;isThumbDrag=!1;b=isTouch?b.originalEvent.touches:[b];a.mouseDownX=b[0].pageX;a.scrollBoxX=$(a.scrollBox).offset().left;return!1});$(this.contentBox).bind(_event._move,function(b){if(a.mouseDown){var b=isTouch?b.originalEvent.touches:[b],c=a.mouseDownX-b[0].pageX;20<Math.abs(c)&&(isThumbDrag=
!0);$(a.background).width()>$(a.scrollBox).width()||(c=a.scrollBoxX-c,0<c&&(c=0),c<$(a.background).width()-$(a.scrollBox).width()&&(c=$(a.background).width()-$(a.scrollBox).width()),$(a.scrollBox).css({left:c+"px"}),a.moveLeft=a.lastMoveX>b[0].pageX?!0:!1,a.lastMoveX=b[0].pageX,a.lastMoveTime=(new Date).getTime())}});$(this.contentBox).bind(_event._end,function(){a.mouseDown=!1;if(100>(new Date).getTime()-a.lastMoveTime&&-1!=a.lastMoveTime){var b=a.moveLeft?-30:30;a.tweener($(a.scrollBox).offset().left,
b,10)}else a.fillNearByImages(a.scrollBox.offset().left)});$(this.contentBox).bind("mouseleave",function(){a.mouseDown=!1})};
thumbnailBar.prototype.setHighLight=function(a){this.currentCellIndex=a;var b=Math.floor(a/2);if(!(a>originTotalPageCount))if(this.thumbArray[b].highLight(a),$(this.background).width()>$(this.scrollBox).width())$(this.scrollBox).css({left:($(this.background).width()-$(this.scrollBox).width())/2+"px"});else{var c=this.mergeing?140:70,a=$(this.scrollBox).offset().left,d=$(this.background).width(),c=(b-1)*(this.thumbArray[b].getWidth()+5)+c,b=this.thumbArray[b].getWidth();this.tweener(a,-(c+a-(d-b)/
2)/6,6)}};thumbnailBar.prototype.clearHighLight=function(){for(var a=0;a<this.thumbArray.length;a++)this.thumbArray[a].clearHighLight()};
thumbnailBar.prototype.tweener=function(a,b,c){var d=function(a,b){for(var c=b/2,d=(a-a/4)/c,e=Array(b),g=0;g<b;g++)e[g]=g<c?a-(c-g)*d:a+(g-c+1)*d;return e.reverse()}(b,c),e=a,f=0,j=this,g=window.setInterval(function(){e+=d[f];f++;f==c&&(e=a+b*c);0<e&&(e=0);e<$(j.background).width()-$(j.scrollBox).width()&&(e=$(j.background).width()-$(j.scrollBox).width());$(j.scrollBox).css({left:e+"px"});f>=c&&(window.clearInterval(g),j.fillNearByImages(e))},30)};
thumbnailBar.prototype.fillNearByImages=function(a){var b=Math.ceil(this.background.width()/120)+4;this.background.width()>this.scrollBox.width()?(a=0,b=originTotalPageCount+1):a=Math.abs(Math.floor(a/this.thumbArray[1].getWidth()))-2;for(var c,d=0;d<Math.ceil(b/2);d++)c=a+d,this.thumbArray[c]&&this.thumbArray[c].addImage()};function rightThumbnailBar(a){thumbnailBar.call(this,a);this.scrollBox.css({left:"auto",right:"0px"})}$.extend(rightThumbnailBar.prototype,thumbnailBar.prototype);
rightThumbnailBar.prototype.onResize=function(){var a=$(this.background).width(),b=$(this.scrollBox).width();if(a>b)$(this.scrollBox).css({right:(a-b)/2+"px"});else{var c=this.background.width()-this.scrollBox.offset().left-this.scrollBox.width();0<c&&(c=0);c<a-b&&(c=a-b);$(this.scrollBox).css({right:c+"px"});this.fillNearByImages(c)}};
rightThumbnailBar.prototype.addItem=function(){for(var a=0;a<=originTotalPageCount;){var b=new rightThumbnailItem(this.scrollBox,0==a?1:a);b.getWidth();b.setPosition(this.thumbArray.length*(b.getWidth()+5)+5,5,["right","top"]);this.thumbArray.push(b);a+=2}$(this.scrollBox).css({width:this.thumbArray.length*(b.getWidth()+5)+10+"px"});this.mergeAll()};
rightThumbnailBar.prototype.resetItemPosition=function(){for(var a=0,b=0;b<this.thumbArray.length;b++){var c=this.thumbArray[b];0==b?(c.setPosition(5,5,["right","top"]),a=140):(c.setPosition(a,5,["right","top"]),a=a+c.getWidth()+5)}$(this.scrollBox).css({width:a+"px"})};
rightThumbnailBar.prototype.initEvent=function(){var a=this;this.background.bind(_event._down,function(){return!1});this.closeButton.onMouseUp(this,this.hideBox);$(this.contentBox).bind(_event._down,function(b){a.mouseDown=!0;isThumbDrag=!1;b=isTouch?b.originalEvent.touches:[b];a.mouseDownX=b[0].pageX;a.scrollBoxX=a.background.width()-$(a.scrollBox).offset().left-a.scrollBox.width();return!1});$(this.contentBox).bind(_event._move,function(b){if(a.mouseDown){var b=isTouch?b.originalEvent.touches:[b],
c=a.mouseDownX-b[0].pageX;20<Math.abs(c)&&(isThumbDrag=!0);$(a.background).width()>$(a.scrollBox).width()||(c=a.scrollBoxX+c,0<c&&(c=0),c<$(a.background).width()-$(a.scrollBox).width()&&(c=$(a.background).width()-$(a.scrollBox).width()),$(a.scrollBox).css({right:c+"px"}),a.moveLeft=a.lastMoveX>b[0].pageX?!0:!1,a.lastMoveX=b[0].pageX,a.lastMoveTime=(new Date).getTime())}});$(this.contentBox).bind(_event._end,function(){a.mouseDown=!1;if(100>(new Date).getTime()-a.lastMoveTime&&-1!=a.lastMoveTime){var b=
a.moveLeft?30:-30;a.tweener(a.background.width()-$(a.scrollBox).offset().left-a.scrollBox.width(),b,10)}else a.fillNearByImages(a.background.width()-$(a.scrollBox).offset().left-a.scrollBox.width())});$(this.contentBox).bind("mouseleave",function(){a.mouseDown=!1})};
rightThumbnailBar.prototype.tweener=function(a,b,c){var d=function(a,b){for(var c=b/2,d=(a-a/4)/c,e=Array(b),g=0;g<b;g++)e[g]=g<c?a-(c-g)*d:a+(g-c+1)*d;return e.reverse()}(b,c),e=a,f=0,j=this,g=window.setInterval(function(){e+=d[f];f++;f==c&&(e=a+b*c);0<e&&(e=0);e<$(j.background).width()-$(j.scrollBox).width()&&(e=$(j.background).width()-$(j.scrollBox).width());$(j.scrollBox).css({right:e+"px"});f>=c&&(window.clearInterval(g),j.fillNearByImages(e))},30)};
rightThumbnailBar.prototype.setHighLight=function(a){this.currentCellIndex=a;var b=Math.floor(a/2);if(!(a>originTotalPageCount))if(this.thumbArray[b].highLight(a),$(this.background).width()>$(this.scrollBox).width())$(this.scrollBox).css({right:($(this.background).width()-$(this.scrollBox).width())/2+"px"});else{var a=this.mergeing?140:70,c=this.background.width()-this.scrollBox.offset().left-this.scrollBox.width(),d=this.background.width(),e=this.thumbArray[b].getWidth();this.tweener(c,-((b-1)*(e+
5)+a+c-(d-e)/2)/6,6)}};function link(a,b){var c=$("<div style='position: absolute;'></div>"),d=pageEditor[a-1][b].action;void 0!=d.length&&(d=d[0]);var e=d.url;null!=e&&"www."==e.substr(0,4).toLowerCase()&&(e="http://"+e);var f;try{f=d.triggerEventType}catch(j){f=null}c.bind(_event._down,function(){var g=colorTo0x(pageEditor[a-1][b].downColor);c.css({"background-color":g,opacity:pageEditor[a-1][b].downAlpha});f==PageEditor.TriggerEventType.MouseDown&&(d.actionType==PageEditor.ActionType.GOTO_PAGE?gotoPageFun(d.pageIndex):
d.actionType==PageEditor.ActionType.OPEN_URL&&window.open(e,d.linkTarget));3==browserType?event.cancelBubble=!0:event.stopPropagation()});c.bind("mouseover",function(){var g=colorTo0x(pageEditor[a-1][b].overColor);c.css({"background-color":g,opacity:pageEditor[a-1][b].overAlpha});f==PageEditor.TriggerEventType.MouseOver&&(d.actionType==PageEditor.ActionType.GOTO_PAGE?gotoPageFun(d.pageIndex):d.actionType==PageEditor.ActionType.OPEN_URL&&window.open(e,d.linkTarget))});c.bind(isTouch?_event._end:"mouseout",
function(){var g=colorTo0x(pageEditor[a-1][b].outColor);c.css({"background-color":g,opacity:pageEditor[a-1][b].outAlpha});f==PageEditor.TriggerEventType.MouseOut&&(d.actionType==PageEditor.ActionType.GOTO_PAGE?gotoPageFun(d.pageIndex):d.actionType==PageEditor.ActionType.OPEN_URL&&window.open(e,d.linkTarget))});$.fn.extend(c,{onResize:function(d,e){var f=pageEditor[a-1][b].location;c.css({top:f.y*e+"px",left:f.x*d+"px",width:f.width*d+"px",height:f.height*e+"px"})}});return c}
function initLink(a,b,c,d){this.link=$("<div style='position: absolute;'></div>");this.config=$.extend({width:0.2,height:0.2,x:0.2,y:0.2,action:null},b);this.pw=c;this.ph=d;this.width=this.pw*this.config.width;this.height=this.ph*this.config.height;a.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",height:this.height+"px","background-color":this.config.outColor,opacity:this.config.outAlpha});this.father=a;this.initEvt()}
initLink.prototype.onResize=function(a,b){this.pw=a;this.ph=b;this.width=this.config.width*a;this.height=this.config.height*b;var c=this.config.y*b,d=this.config.x*a;this.link.css({width:this.width+"px",height:this.height+"px"});this.setPosition(d,c);if(null!=this.form)this.form.onResize(bookContainer.width(),bookContainer.height());if(null!=this.slide)this.slide.onResize(bookContainer.width(),bookContainer.height())};initLink.prototype.setPosition=function(a,b){this.link.css({left:a+"px",top:b+"px"})};
initLink.prototype.initEvt=function(){var a=this;this.flag=0;this.slide=this.form=null;this.linkURL;if(null!=a.config.action){try{void 0!=this.config.action.length&&(this.config.action=this.config.action[0]),this.linkURL=this.config.action.url}catch(b){}var c;null!=this.linkURL&&"http"!=this.linkURL.substr(0,4).toLowerCase()&&(this.linkURL="http://"+this.linkURL);try{c=this.config.action.triggerEventType}catch(d){c=null}}this.link.bind(_event._down,function(){a.link.css({"background-color":a.config.downColor,
opacity:a.config.downAlpha});c==PageEditor.TriggerEventType.MouseDown&&actionEvent.call(a);3==browserType?event.cancelBubble=!0:event.stopPropagation()});this.link.bind("mouseover",function(){a.link.css({"background-color":a.config.overColor,opacity:a.config.overAlpha});c==PageEditor.TriggerEventType.MouseOver&&actionEvent.call(a)});this.link.bind(isTouch?_event._end:"mouseout",function(){a.link.css({"background-color":a.config.outColor,opacity:a.config.outAlpha});c==PageEditor.TriggerEventType.MouseOut&&
actionEvent.call(a)});this.link.bind("mouseleave",function(){a.link.css({"background-color":a.config.outColor,opacity:a.config.outAlpha})});this.link.bind("mouseup",function(){a.link.css({"background-color":a.config.overColor,opacity:a.config.overAlpha});c==PageEditor.TriggerEventType.MouseUp&&actionEvent.call(a)});this.link.bind(_event._move,function(){c==PageEditor.TriggerEventType.MouseMove&&actionEvent.call(a)})};function thickness(a){var b=$("<div></div>"),c=$("<img src='"+uiBaseURL+"thickness.png' style='position:absolute;' />");b.append(c);$.fn.extend(b,{visible:!0,onResize:function(a,e){b.css({width:a,height:e});c.css({width:a,height:e})},setThicknessPosition:function(c,e){b.css({left:c,top:e,position:"absolute","z-index":a?8:9})},hideThickness:function(){b.css("display","none")},showThickness:function(){b.css("display","block")},setVisible:function(a){b.css({display:a?"block":"none"});b.visible=a}});
a&&c.css({"-webkit-transform":"scaleX(-1)","-moz-transform":"scaleX(-1)","-o-transform":"scaleX(-1)"});return b};var gradientColorA,gradientColorB,gradientColorAngle,backGroundImgURL,zoomButtonEnable=!0,thumbButtonEnable=!0,shareButtonEnable=!0,searchButtonEnable=!0,bookmarkButtonEnable=!0,windowWidth=0,windowHeight=0,toolBarColor,buttonColor,originTotalPageCount,totalPageCount,leftShadowWidth=50,rightShadowWidth=50,zoomPageWidth,zoomPageHeight,flipTime=600,isRegister=!1,bookDescription,bookTitle,showFlipButton,normalEventRadius=1E4,singleEventRadius=1E4,stopFlip=!1,flipping=!1,isTouch=isTouch(),bookContainer,
tmpContainer,zoomBook,flipBook,toolBar,pageIndexTextField,topMargin,leftMargin,bottomMargin,rightMargin,bookType=BookType.normal_book,resizeBookAfterFlip=!1,frmSearch,frmShare,_rimFlip,flipAudio,backgroundAudio,auto_player,productName,homePage,_tipsBox,frmBookmark,thumbnail,oriPageIndex=1,googleID,hardPageEnable,uiBaseURL,browserType,rightToLeft=!1,isFlipPdf=!1,flaudio=0,flagspeak=0,hadBMT,selectedLanguage,languageBar=null,bgSound,isIphonePlaySound=!1,backgroundObj,bmtBox,doubleTapTime,videoForm1,
slideShow,helpSlide,iconArray,toolBarIconsURL,ua=navigator.userAgent.toLowerCase(),device={};device.name=ua.match(/ipad/)?"ipad":ua.match(/ipod/)?"ipod":ua.match(/iphone/)?"iphone":ua.match(/android/)?"android":ua.match(/mac|win|linux/)?"pc":"other";
var userConfig={leftShadowWidth:30,leftShadowAlpha:1,rightShadowWidth:30,rightShadowAlpha:1,shortcutButtonHeight:370,shortcutButtonWidth:90,autoPlayButtonVisible:"true",downloadButtonVisible:"false",downloadURL:"",bgSoundButtonVisible:"yes",bgSoundAutoStart:"yes",bgSoundURL:"",homeButtonVisible:!0,homeURL:"",languageButtonVisible:!0,helpButtonVisible:!0},originWindow=Point(0,0),testLog=$("<div width='300px' height='300px' style='position:absolute;left:10px;top:10px;'></div>"),logStr=function(a){testLog[0].innerHTML=
a},singlePageBook,leftShortcutButton,rightShortcutButton,init=function(){if(compareov()){""==userConfig.bgSoundURL&&(userConfig.bgSoundButtonVisible=!1);_singleBook=$("#singleBook");pageIndexTextField=$("#currentPageIndexTextField");flipBook=rightToLeft?new rightToLeftNormalBook:new normalBook;flipBook.create(bookContainer);zoomBook=new initZoomBook(bookContainer);backgroundObj=new initBackground(tmpContainer,gradientColorA,gradientColorB,gradientColorAngle,windowWidth,windowHeight,backGroundImgURL);
var a=$("<div id='singleBookMask' style='display: none; position: absolute;'></div>");_singleBook=$("<div id='singleBook' class='singleBook' style='position: absolute;'></div>");var b=$("<div id='singlePrePage' style='position: absolute;z-index: 1;'></div>"),c=$("<div id='singleCurPage' style='position: absolute;z-index: 3;'></div>"),d=$("<div id='singleNextPage' style='position: absolute;z-index: 2;'></div>");bookContainer.append(a);a.append(_singleBook);_singleBook.append(b);_singleBook.append(c);
_singleBook.append(d);singlePageBook=new singleBook;singlePageBook.Create();initDemoBar();showFlipButton&&(leftShortcutButton=new initShotButton(tmpContainer,uiBaseURL+"left_arrow.png",!0),leftShortcutButton.setCSS({left:"-50px"}),rightShortcutButton=new initShotButton(tmpContainer,uiBaseURL+"right_arrow.png",!1),rightShortcutButton.setCSS({right:"-50px"}));frmBookmark=new tableContent({caption:getLanguage("frmBookMark","Table of Content"),closeIconURL:uiBaseURL+"close.png"},tmpContainer);frmSearch=
new searchForm({caption:getLanguage("frmSearch","Search"),closeIconURL:uiBaseURL+"close.png"},tmpContainer);frmShare=new shareForm({caption:getLanguage("frmShare","Share"),closeIconURL:uiBaseURL+"close.png"},tmpContainer);videoForm1=new initVimeoForm;slideShow=new initSlideShow(tmpContainer,tmpContainer.width(),tmpContainer.height());userConfig.helpButtonVisible&&(helpSlide=new initSlideShow(tmpContainer,tmpContainer.width(),tmpContainer.height()));_rimFlip=new rimFlip;1!=oriPageIndex&&_rimFlip.removeRimFlip();
beforStageResize();_tipsBox=new tipsBox("This is the last page",bookContainer);_tipsBox.setPosition((windowWidth-_tipsBox.getWidth())/2,100);auto_player=new autoFlip;bookType=windowWidth>=windowHeight?BookType.normal_book:BookType.single_book;isTouch&&(window.onorientationchange=function(){window.setTimeout(function(){beforStageResize()},200)});$(window).resize(function(){beforStageResize()});a=window.location.hash;if(""!=a&&3<a.length&&"#p="==a.substr(0,3)&&!isNaN(a.substr(3,a.length-3))){var e=
parseInt(a.substr(3,a.length-3));window.setTimeout(function(){gotoPageFun(e)},1E3)}initEvent();setPageIndexTextField();("iphone"==device.name||"ipod"==device.name||"#mobile"==window.location.hash)&&getBool("checkIphone",!1)?(zoomBook.currentIndex=oriPageIndex,zoomBook.showPage.fillContent(zoomBook.currentIndex),changeShowBook(2),bookType=2,$("#btnZoom").empty().append(getImage(toolBarIconsURL[6])).attr("title",getLanguage("btnZoomOut","Zoom Out")),setCurrentIndexTextField(zoomBook.currentIndex,!1),
thumbnail.clearHighLight(),thumbnail.setHighLight(zoomBook.currentIndex),window.setTimeout(function(){zoomBook.showCurrentYoutube()},1500)):window.innerWidth>=window.innerHeight?window.setTimeout(function(){flipBook.showCurrentYoutube()},1500):window.setTimeout(function(){$(singlePageBook).data().showCurrentYoutube()},1500)}else alert("Purchase from www.flipbuilder.com to preview the book.")},initBGSound=function(){var a=$("<audio loop autoplay><audio>"),b=userConfig.bgSoundButtonVisible,c=this;this.isPaused=
function(){return a[0].paused};this.pause=function(){a[0].pause()};this.play=function(){a[0].play()};if(!(void 0==userConfig.bgSoundURL||""==userConfig.bgSoundURL||!userConfig.bgSoundButtonVisible)){setTimeout(function(){a.attr("src",userConfig.bgSoundURL);tmpContainer.append(a)},200);$("#btnSound").bind(_event._end,function(){b?(c.pause(),b=!1,$("#imgSoundOn").attr("src",uiBaseURL+"soundOff.png"),$("#btnSound").attr("title","Sound Off")):(c.play(),$("#imgSoundOn").attr("src",uiBaseURL+"soundOn.png"),
$("#btnSound").attr("title","Sound On"),b=!0)});var d,e=function(){d=Date.now();setTimeout(e,50)};e();a[0].addEventListener("timeupdate",function(){500<Date.now()-d&&this.pause()},!1);window.onfocus=function(){a[0].paused&&a[0].play()}}};
function createAll(){selectLanguage(getString("Language","English"));tmpContainer=$("<div class='bookStage' id= 'tmpContainer'></div>");bookContainer=$("<div class='bookStage' id= 'bookContainer'></div>");$("body").append(tmpContainer);tmpContainer.append(bookContainer);bookContainer.css({"-webkit-transform":"perspective(1000px)","-moz-transform":"perspective(1000px)"});windowWidth=bookContainer.width();windowHeight=bookContainer.height();originWindow=Point(tmpContainer.width(),tmpContainer.height());
var a=new loadingBook(tmpContainer,getColor("mainColor","#805080"));toolBarIconsURL=[uiBaseURL+"BackGround.jpg",uiBaseURL+"Last.png",uiBaseURL+"next.png",uiBaseURL+"prev.png",uiBaseURL+"First.png",uiBaseURL+"ZoomIn.png",uiBaseURL+"ZoomOut.png",uiBaseURL+"autoPlay.png",uiBaseURL+"stopAutoPlay.png",uiBaseURL+"thumbnails.png",uiBaseURL+"sharethis.png",uiBaseURL+"search.png",uiBaseURL+"download.png",uiBaseURL+"home.png",uiBaseURL+"bookmark.png",uiBaseURL+"soundOn.png",uiBaseURL+"soundOff.png",uiBaseURL+
"previous_normal.png",uiBaseURL+"previous_normal_down.png",uiBaseURL+"next_normal.png",uiBaseURL+"next_normal_down.png",uiBaseURL+"language.png",uiBaseURL+"fullscreen.png",uiBaseURL+"disableFullscreen.png",uiBaseURL+"Help.png"];$(window).loader(toolBarIconsURL,function(b){a.hide();iconArray=b;toolBar=new loadToolBar(tmpContainer,iconArray);init();bgSound=new initBGSound;window.setTimeout(function(){bookContainer.animate({opacity:1},1E3);toolBar.show();showFlipButton&&(leftShortcutButton.show(!0),
rightShortcutButton.show(!1))},200)});if("undefined"!=typeof speakConfig&&"none"!=speakConfig.title){var b=$("<div id='LectureBook' style='position:absolute;right:20px;bottom:40px; width:190px; height:330px;'></div>"),c=$("<div id='LectureBox' style='position:absolute;z-index:70; width:190px; height:88px;top:0;opacity:0.6;background-image:url(style/icon/lecturetext.png)'></div>"),d=$("<div style='position:absolute;overflow: hidden; height:60px;top:5px;'><div id='LectureText' style='word-break: break-word;color:#fff;padding:5px 10px 5px 10px;text-shadow: 2px 2px 2px #000000;'></div></div>"),
e=$("<div id='LecturePre' style='position:absolute; top:95px;left:25px;z-index:100;'></div>");LectureCon=$("<div id='LectureCon' style='position:absolute; display:none;z-index:101; width:105px; height:105px; top:150px;left:40px;background-image:url(style/icon/co_bg.png)'><div style='position:absolute; cursor: pointer;width:23px;height:23px;left:41px; top:15px'><img id='lstop' src='style/icon/Pause.png' title='Pause' /></div><div style='position:absolute; cursor: pointer;width:23px;height:23px;right:15px;top:41px;'><img id='lnext' src='style/icon/Nextpage.png' title='Next Page' /></div><div style='position:absolute; cursor: pointer;width:23px;height:23px;left:15px;top:41px;'><img id='lpre' src='style/icon/Pre.png' title='Previous Page' /></div><div style='position:absolute; cursor: pointer;width:23px;height:23px;left:41px;bottom:15px;'><img id='laudio' src='style/icon/Muteclose.png' title='Mute' /></div></div>");
LectureClose=$("<div id='LectureClose' style='position:absolute; right:60px; top:85px;display:none;z-index:200;cursor:pointer;'><img style='z-index:200;' src='style/icon/Closediv.png' title='Close' /></div>");LectureShow=$("<div id='LectureShow' style='position:absolute; right:0;bottom:35px;display:none;z-index:200;cursor:pointer;'><img  src='style/icon/LectureShow.png' /></div>");bookContainer.append(b);b.append(c);c.append(d);b.append(e);b.append(LectureCon);b.append(LectureClose);bookContainer.append(LectureShow)}}
function LectureAudio(a){var b=document.getElementById("LecturePre");b.innerHTML="<img id='LectureSpe' style='width:126px;' src='"+uiBaseURL+"speak.gif' />";var c=document.createElement("audio");c.setAttribute("id","LectureID");c.type="audio/mpeg";c.setAttribute("autoplay","autoplay");0==speakConfig.page[a].type?c.src=speakConfig.page[a].speakmp3:(c.src=speakConfig.page[a].importmp3,$("#LectureBox").css("display","none"));b.appendChild(c)}
function LectureSoll(a){var b=$("#LectureText");$("#LectureBox").css("display","block");b.html(speakConfig.page[a].speaktext);var c=b.height();40<c&&b.animate({marginTop:-c+40+"px"},90*c,function(){b.css("marginTop",0);$("#LectureBox").css("display","none");$("#LectureSpe").attr("src",uiBaseURL+"nospeak.gif");a+1<totalPageCount/2+1&&0==flaudio&&(nextPageFun(),LectureAudio(a+1),LectureSoll(a+1))})}
var onStageResize=function(){resizeBookAfterFlip=!1;if(bookType==BookType.normal_book&&nBookStatu==normalBookStatu.book_statu_auto_flip||bookType==BookType.single_book&&1==$(singlePageBook).data().bookStatu)resizeBookAfterFlip=!0;else{windowWidth=tmpContainer.width();windowHeight=tmpContainer.height();var a,b,c=windowWidth,d=windowHeight,e=bookConfig.largePageWidth,f=bookConfig.largePageHeight,j=c-leftMargin-rightMargin,g=d-topMargin-bottomMargin;backgroundObj.onResize(c,d);a=2*e/f;j/g>a?(b=g,a*=
b):(a=j,b=f*a/(2*e));flipBook.onResize(a/2,b);flipBook.setCSS({top:(g-b)/2+topMargin+"px",left:(j-a)/2+leftMargin+"px"});flipBook.fillNearPage(flipBook.getCurrentPageIndex());b=getPageWidthHeight(j,g,e,f);singlePageBook.onResize(b.x,b.y);singlePageBook.setBookPosition((j-b.x)/2+leftMargin,(d-topMargin-bottomMargin-b.y)/2+topMargin);e=b=0;zoomBook.width<j&&(b=(j-zoomBook.width)/2+leftMargin);zoomBook.height<g&&(e=(g-zoomBook.height)/2+topMargin);zoomBook.setPosition(b,e);zoomBook.onResize(j,g);flipBook.setThicknessPosition();
bookType==BookType.normal_book&&c<d&&(changeShowBook(1),bookType=BookType.single_book,g=flipBook.currentPageIndex>originTotalPageCount?originTotalPageCount:flipBook.currentPageIndex,$(singlePageBook).data().gotoPage(g),setCurrentIndexTextField($(singlePageBook).data().currentPageIndex,!1),thumbnail.clearHighLight(),thumbnail.setHighLight(flipBook.currentPageIndex));bookType==BookType.single_book&&c>=d&&(changeShowBook(0),bookType=BookType.normal_book,flipBook.gotoPage($(singlePageBook).data().currentPageIndex),
setCurrentIndexTextField(flipBook.currentPageIndex,!0),thumbnail.clearHighLight(),thumbnail.setHighLight($(singlePageBook).data().currentPageIndex));thumbnail.onResize();toolBar.setButtonPosition();demoBar.setDemoPosition();if(frmSearch)frmSearch.onResize(j/2,d);if(void 0!=frmBookmark)frmBookmark.onResize(j/2,d);if(frmShare)frmShare.onResize(j/2,d);(300>windowWidth||300>windowHeight)&&showFlipButton?(leftShortcutButton.setVisible(!1),rightShortcutButton.setVisible(!1)):300<=windowWidth&&300<=windowHeight&&
showFlipButton&&!leftShortcutButton.showing&&(leftShortcutButton.setVisible(!0),rightShortcutButton.setVisible(!0));void 0!=_tipsBox&&_tipsBox.setPosition((windowWidth-_tipsBox.getWidth())/2,100);showFlipButton&&(leftShortcutButton.setPosition(),rightShortcutButton.setPosition());videoForm1.onResize();slideShow.onResize(tmpContainer.width(),tmpContainer.height());userConfig.helpButtonVisible&&helpSlide.onResize(tmpContainer.width(),tmpContainer.height())}},beforStageResize=function(a){if("iphone"==
device.name||"ipod"==device.name)if(stageHeight=window.innerWidth>window.innerHeight?320==window.innerHeight?320:window.innerHeight+60:window.innerHeight+60,stageWidth=window.innerWidth,tmpContainer.css({width:stageWidth+"px",height:stageHeight+"px"}),window.setTimeout(function(){window.scrollTo(0,0);setTimeout(function(){tmpContainer.css({width:window.innerWidth+"px",height:window.innerHeight+"px"});onStageResize(a)},100)},30),320==window.innerHeight){var b=navigator.userAgent.match(/iPhone OS \d/);
6>=b[0].substr(b[0].length-1,1)&&toolBar.moveButtonBar(40)}else toolBar.moveButtonBar(0);else onStageResize(a)};
function initEvent(){var a=-1,b=void 0,c,d,e=!1;tmpContainer.bind(_event._move,function(f){f=isTouch?f.originalEvent.touches:[f];if(2==f.length&&e){var g=$(singlePageBook).data(),k=globalToBook(!0,f[0].pageX,f[0].pageY,!0),f=globalToBook(!0,f[1].pageX,f[1].pageY);if(15<Math.abs(k.x-c.x)||15<Math.abs(k.y-c.y)||15<Math.abs(f.x-d.x)||15<Math.abs(f.y-d.y))zoomBook.currentIndex=g.currentPageIndex,zoomBook.showPage.fillContent(zoomBook.currentIndex),changeShowBook(2),bookType=2,$("#zoomImg").attr("src",
uiBaseURL+"ZoomOut.png"),$("#btnZoom").attr("title","Zoom Out"),setCurrentIndexTextField(zoomBook.currentIndex,!1),thumbnail.clearHighLight(),thumbnail.setHighLight(zoomBook.currentIndex);return!1}1==bookType&&$(singlePageBook).data().bookMouseDown&&(flipPoint=globalToBook(!0,f[0].pageX,f[0].pageY,!0),$(singlePageBook).data().flippingPage.flipToPoint(flipPoint),-1!=a&&(b=flipPoint.x>a?!1:!0),a=flipPoint.x);return!1});bookContainer.bind(_event._end,function(a){var c=$(singlePageBook).data(),a=isTouch?
a.originalEvent.changedTouches:[a];e=!1;if(bookType==BookType.single_book)if(c.bookMouseDown){var a=globalToBook(!0,a[0].pageX,a[0].pageY,!0),d=!0,f;if(c.isLeft&&a.x>=c.pageWidth/2||!c.isLeft&&a.x<c.pageWidth/2)d=!1;void 0!=b&&(d=!(c.isLeft^b));d||(rightToLeft?(c.gotoPageIndex=c.isLeft?c.currentPageIndex+1:c.currentPageIndex-1,c.differPageNum=c.isLeft?1:-1):(c.gotoPageIndex=c.isLeft?c.currentPageIndex-1:c.currentPageIndex+1,c.differPageNum=c.isLeft?-1:1));f=rightToLeft?d?Point(c.isLeft?0:2,c.isTop?
0:1):Point(c.isLeft?2:0,c.isTop?0:1):d?Point(c.isLeft?-1:1,c.isTop?0:1):Point(c.isLeft?1:-1,c.isTop?0:1);f=Point(f.x*c.pageWidth,f.y*c.pageHeight);c.timer("tr",6,30,f,a,!1,!0,!d);c.bookMouseDown=!1}else flipping&&2==c.bookStatu&&(stopFlip=!0)});tmpContainer.bind(_event._down,function(){if(("iphone"==device.name||"ipod"==device.name)&&!isIphonePlaySound&&userConfig.bgSoundAutoStart&&bgSound&&bgSound.isPaused())isIphonePlaySound=!0,bgSound.play()});bookContainer.bind(_event._down,function(f){if(("iphone"==
device.name||"ipod"==device.name)&&!isIphonePlaySound&&userConfig.bgSoundAutoStart&&bgSound&&bgSound.isPaused())isIphonePlaySound=!0,bgSound.play();document.getElementById("currentPageIndexTextField").blur();thumbnail.hideBox();a=-1;b=void 0;var g=$(singlePageBook).data(),f=isTouch?f.originalEvent.touches:[f];if(2==f.length){if(2==g.bookStatu){var k;"tl"==g.flippingPage.realCorner?k=rightToLeft?Point(0,0):Point(-g.pageWidth,0):"tr"==g.flippingPage.realCorner?k=rightToLeft?Point(2*g.pageWidth,g.pageHeight):
Point(g.pageWidth,0):"bl"==g.flippingPage.realCorner?k=rightToLeft?Point(0,g.pageHeight):Point(-g.pageWidth,g.pageHeight):"br"==g.flippingPage.realCorner&&(k=rightToLeft?Point(2*g.pageWidth,g.pageHeight):Point(g.pageWidth,g.pageHeight));g.stopTimer();g.timer(g.flippingPage.realCorner,6,30,k,g.flipPoint,!1,!0,!1)}c=globalToBook(!0,f[0].x,f[0].y,!0);d=globalToBook(!0,f[1].x,f[1].y,!0);f=g.isPointInPage(c,g.pageWidth,g.pageHeight);k=g.isPointInPage(d,g.pageWidth,g.pageHeight);e=f&&k;return g.bookMouseDown=
!1}if(bookType==BookType.single_book&&0==g.bookStatu){var f=globalToBook(!0,f[0].pageX,f[0].pageY,!0),l;if(0>f.x||f.x>g.pageWidth||0>f.y||f.y>g.pageHeight)return;if(Math.pow(f.x,2)+Math.pow(f.y,2)<singleEventRadius)if(l="tl",g.isLeft=!0,g.isTop=!0,k=Point(-g.pageWidth,0),rightToLeft){if(k=Point(0,0),g.flippingPage=g.currentPage,g.gotoPageIndex=g.currentPageIndex+1,g.currentPageIndex==originTotalPageCount){_tipsBox.setCaption("This is the last page");_tipsBox.showTipsBox();return}}else{if(g.flippingPage=
g.previousPage,g.gotoPageIndex=g.currentPageIndex-1,1==g.currentPageIndex){_tipsBox.setCaption("This is the first page");_tipsBox.showTipsBox();return}}else if(Math.pow(f.x,2)+Math.pow(g.pageHeight-f.y,2)<singleEventRadius)if(l="bl",g.isLeft=!0,g.isTop=!1,k=Point(-g.pageWidth,g.pageHeight),rightToLeft){if(k=Point(0,g.pageHeight),g.flippingPage=g.currentPage,g.gotoPageIndex=g.currentPageIndex+1,g.currentPageIndex==originTotalPageCount){_tipsBox.setCaption("This is the last page");_tipsBox.showTipsBox();
return}}else{if(g.flippingPage=g.previousPage,g.gotoPageIndex=g.currentPageIndex-1,1==g.currentPageIndex){_tipsBox.setCaption("This is the first page");_tipsBox.showTipsBox();return}}else if(Math.pow(g.pageWidth-f.x,2)+Math.pow(f.y,2)<singleEventRadius)if(l="tr",g.isLeft=!1,g.isTop=!0,k=Point(g.pageWidth,0),rightToLeft){if(k=Point(2*g.pageWidth,0),g.flippingPage=g.previousPage,g.gotoPageIndex=g.currentPageIndex-1,1==g.currentPageIndex){_tipsBox.setCaption("This is the first page");_tipsBox.showTipsBox();
return}}else{if(g.flippingPage=g.currentPage,g.gotoPageIndex=g.currentPageIndex+1,g.currentPageIndex==originTotalPageCount){_tipsBox.setCaption("This is the last page");_tipsBox.showTipsBox();return}}else if(Math.pow(g.pageWidth-f.x,2)+Math.pow(g.pageHeight-f.y,2)<singleEventRadius)if(l="br",g.isLeft=!1,g.isTop=!1,k=Point(g.pageWidth,g.pageHeight),rightToLeft){if(g.gotoPageIndex=g.currentPageIndex-1,k=Point(2*g.pageWidth,g.pageHeight),g.flippingPage=g.previousPage,1==g.currentPageIndex){_tipsBox.setCaption("This is the first page");
_tipsBox.showTipsBox();return}}else{if(g.flippingPage=g.currentPage,g.gotoPageIndex=g.currentPageIndex+1,g.currentPageIndex==originTotalPageCount){_tipsBox.setCaption("This is the last page");_tipsBox.showTipsBox();return}}else return;_rimFlip.removeRimFlip();g.bookStatu=2;g.flippingPage.beginFlip(l);g.timer(l,6,30,f,k,!1,!1)}else if(2==bookType)return;return!1});var f=function(a){var b;a.wheelDelta?b=a.wheelDelta:a.detail&&(b=a.detail);0<b?$(singlePageBook).data().gotoPage($(singlePageBook).data().currentPageIndex+
1):$(singlePageBook).data().gotoPage($(singlePageBook).data().currentPageIndex-1)};2==browserType?tmpContainer[0].addEventListener("DOMMouseScroll",function(a){1==bookType&&f(a)}):tmpContainer[0].addEventListener("mousewheel",function(a){1==bookType&&f(a)});bookContainer.hammer().on("doubletap",function(){doubleTapTime=(new Date).getTime()});bookContainer.hammer().on("tap",function(){("iphone"==device.name||"ipod"==device.name)&&window.scrollTo(0,1);var a=(new Date).getTime();0==bookType&&0!=nBookStatu||
1==bookType&&0!=$(singlePageBook).data().bookStatu||setTimeout(function(){300>a-doubleTapTime||(toolBar.visible?(toolBar.hide(),toolBar.visible=!1):(toolBar.show(),toolBar.visible=!0))},250)});bookContainer.bind(_event._down,function(){frmShare.visible&&frmShare.hide();userConfig.languageButtonVisible&&languageBar.showing&&languageBar.hide()});fullScreenApi.supportsFullScreen&&window.addEventListener(fullScreenApi.fullScreenEventName,function(){fullScreenApi.isFullScreen()?toolBar.btnFullscreen.empty().append(getImage(toolBarIconsURL[23])).attr("title",
getLanguage("btnDisableFullScreen","Disable FullScreen")):toolBar.btnFullscreen.empty().append(getImage(toolBarIconsURL[22])).attr("title",getLanguage("btnFullScreen","Enable Fullscreen"))});"undefined"!=typeof speakConfig&&"none"!=speakConfig.title&&($("#LecturePre").bind(_event._down,function(){"none"===$("#LectureCon").css("display")?($("#LectureCon").css("display","block"),$("#LectureClose").css("display","block")):($("#LectureCon").css("display","none"),$("#LectureClose").css("display","none"));
$("#lnext").asImageButton();$("#lpre").asImageButton()}),$("#lstop").bind(_event._down,function(){var a=document.getElementById("LectureID"),b=document.getElementById("LectureSpe");0==flaudio?(a.pause(),$("#LectureText").stop(!0),b.src="style/icon/nospeak.gif",$("#lstop").attr("src",uiBaseURL+"Play.png"),$("#lstop").attr("title","Play"),$("#LectureBox").css("display","none"),flaudio=1):(flaudio=0,LectureSoll(Math.floor(flipBook.getCurrentPageIndex()/2)),a.play(),b.src="style/icon/speak.gif",$("#lstop").attr("src",
uiBaseURL+"Pause.png"),$("#lstop").attr("title","Pause"))}),$("#lnext").bind(_event._down,function(){nextPageFun()}),$("#lnext").bind(_event._move,function(){$("#lnext").attr("src",uiBaseURL+"Nextpage_down.png")}),$("#lpre").bind(_event._down,function(){previousPageFun()}),$("#lpre").bind(_event._move,function(){$("#lpre").attr("src",uiBaseURL+"Pre_down.png")}),$("#laudio").bind(_event._down,function(){var a=document.getElementById("LectureID");!1==a.muted?(a.muted=!0,$("#laudio").attr("src",uiBaseURL+
"Mute.png"),$("#laudio").attr("title","Play"),$("#LectureSpe").attr("src",uiBaseURL+"nospeak.gif")):(a.muted=!1,$("#laudio").attr("src",uiBaseURL+"Muteclose.png"),$("#laudio").attr("title","Mute"),$("#LectureSpe").attr("src",uiBaseURL+"speak.gif"))}),$("#LectureClose").bind(_event._down,function(){document.getElementById("LectureID").pause();$("#LectureText").stop(!0);$("#LectureBook").css("display","none");$("#LectureShow").css("display","block");flagspeak=1}),$("#LectureShow").bind(_event._down,
function(){$("#LectureBook").css("display","block");$("#LectureShow").css("display","none");$("#LectureBox").css("display","none");$("#LectureSpe").attr("src",uiBaseURL+"nospeak.gif");$("#LectureCon").css("display","none");$("#LectureClose").css("display","none");flagspeak=0}))}
var selectLanguage=function(a){if(1==language.length)selectedLanguage=language[0],userConfig.languageButtonVisible=!1;else for(var b,c=0;c<language.length;c++){if(language[c].language==a){selectedLanguage=language[c];break}"English"==language[c].language&&(b=language[c]);c==language.length-1&&(selectedLanguage=b)}},changeLanguage=function(a){selectLanguage(a);toolBar.changeLanguage();frmBookmark.setCaption(getLanguage("frmBookMark","Book Mark"));frmSearch.setCaption(getLanguage("frmSearch","Search"))};
jQuery(document).ready(function(){$.browser.msie&&9>$.browser.version&&alert("Your browser version is too low, please use version 9.0 or above.");void 0==window.aliasConfig&&(window.aliasConfig={});uiBaseURL=getString("UIBaseURL","");"string"==typeof uiBaseURL&&"/"!=uiBaseURL.substr(uiBaseURL.length-1,1)&&""!=uiBaseURL&&(uiBaseURL+="/");uiBaseURL+="style/icon/";zoomButtonEnable=getBool("ZoomButtonVisible",!0);thumbButtonEnable=getBool("ThumbnailsButtonVisible",!0);shareButtonEnable=getBool("ShareButtonVisible",
!0);searchButtonEnable=getBool("SearchButtonVisible",!1);bookmarkButtonEnable=getBool("BookMarkButtonVisible",!1);originTotalPageCount=getInt("totalPageCount",2);totalPageCount=originTotalPageCount+(1==originTotalPageCount%2?1:0);zoomPageWidth=getInt("largePageWidth",640);zoomPageHeight=getInt("largePageHeight",920);gradientColorA=getColor("bgBeginColor","#a93268");gradientColorB=getColor("bgEndColor","#588643");gradientColorAngle=getInt("bgMRotation",0);backGroundImgURL=getString("backGroundImgURL",
"");bookDescription=getString("bookDescription","This is a jQuery book.");bookTitle=getString("bookTitle","flipBook");showFlipButton=getBool("flipshortcutbutton",!0);if("iphone"==device.name||"ipod"==device.name||600>window.innerWidth||600>window.innerHeight)showFlipButton=!1;productName=getString("productName","Demo created by Flip PDF for iPad");homePage=getString("homePage","http://www.flipbuilder.com/");leftMargin=getInt("leftMargin",10);topMargin=getInt("topMargin",10);rightMargin=getInt("rightMargin",
10);bottomMargin=getInt("bottomMargin",10);rightToLeft=getBool("RightToLeft",!1);isFlipPdf=getString("isFlipPdf",!1);try{_gaq[0]=["_setAccount",getString("googleAnalyticsID","")]}catch(a){}oriPageIndex=getInt("OriginPageIndex",1);hardPageEnable=getBool("HardPageEnable",!1);userConfig.leftShadowWidth=getInt("LeftShadowWidth",40);userConfig.leftShadowAlpha=getInt("LeftShadowAlpha",1);userConfig.rightShadowWidth=getInt("RightShadowWidth",40);userConfig.rightShadowAlpha=getInt("RightShadowAlpha",1);userConfig.shortcutButtonHeight=
getInt("ShortcutButtonHeight",0);userConfig.shortcutButtonWidth=getInt("ShortcutButtonWidth",0);userConfig.autoPlayButtonVisible=getBool("AutoPlayButtonVisible",!0);userConfig.downloadButtonVisible=getBool("DownloadButtonVisible",!1);userConfig.downloadURL=getString("DownloadURL","");userConfig.bgSoundButtonVisible=getBool("BackgroundSoundButtonVisible",!0);userConfig.bgSoundAutoStart=getBool("BackgroundSoundAutoStart",!0);userConfig.bgSoundURL=getString("BackgroundSoundURL","");userConfig.homeButtonVisible=
getBool("HomeButtonVisible",!1);userConfig.homeURL=getString("HomeURL","");userConfig.languageButtonVisible=getBool("LanguageButtonVisible",!0);userConfig.fullscreenButtonVisible=getBool("FullscreenButtonVisible",!0)&&!isTouch;userConfig.helpButtonVisible=getBool("helpButtonVisible",!0);if(void 0==window.bookConfig)alert("Miss book config.");else{void 0==window.pageEditor&&(window.pageEditor=void 0);void 0==window.textForPages&&(window.textForPages=[],searchButtonEnable=!1);void 0==window.ols&&(window.ols=
{},bookmarkButtonEnable=!1);void 0==window.bmtConfig&&(window.bmtConfig=[]);if(void 0==window.language||1>window.language.length)userConfig.languageButtonVisible=!1,window.language=[];window.document.title=bookTitle;$.browser.msie?browserType=3:$.browser.mozilla?browserType=2:$.browser.safari?browserType=1:$.browser.opera&&(browserType=4);createAll();"undefined"!=typeof speakConfig&&"none"!=speakConfig.title&&(LectureAudio(0),LectureSoll(0))}});var _thumbBar,isThumbShow=!1,thumbBar=function(){var a=$("<div class='thumbBG'></div>"),b=$("<img src='"+uiBaseURL+"close.png' style='top:0px;right:1px;position:absolute;'>"),c=$("<div class='thumbBox'></div>"),d=$("<div class='scrollButton' style='display:none; left:0px;'></div>"),e=$("<div class='scrollButton' style='display:none;right:0px;'></div>"),f=$("<img src='"+uiBaseURL+"previous_down.png' style='position:absolute;top:-5px;left:-5px;' />"),j=$("<img src='"+uiBaseURL+"next_down.png' style='position:absolute;top:-5px;left:-5px;' />");
b.asImageButton();d.asButton();e.asButton();_thumbBar=$("<div class='thumbBar' style='display:none;'></div>");_thumbBar.append(a);_thumbBar.append(b);a.append(c);a.append(d);a.append(e);bookContainer.append(_thumbBar);d.append(f);e.append(j);d.bind(_event._end,function(){if(!_thumbBar.thumbDrag){var a=parseInt(c.css("left").substring(0,c.css("left").length-2));_thumbBar.contentPos=-158>a?a+200:42;c.animate({left:_thumbBar.contentPos},100,"linear")}});e.bind(_event._end,function(){if(!_thumbBar.thumbDrag){var a=
parseInt(c.css("left").substring(0,c.css("left").length-2));_thumbBar.contentPos=a+c.width()>_thumbBar.width()+158?a-200:_thumbBar.width()-42-c.width();c.animate({left:_thumbBar.contentPos},100,"linear")}});$.fn.extend(_thumbBar,{thumbDown:Point(0,0),thumbMove:Point(0,0),thumbEnd:0,thumbStartTime:0,thumbMoveTime:0,thumbEndTime:0,contentPos:0,thumbMouseDown:!1,thumbDrag:!1,dragEnable:!1,showThumb:function(){_thumbBar.css("display","block");_thumbBar.animate({bottom:0},300,"linear")},hideThumb:function(){_thumbBar.animate({bottom:-120},
300,"linear")},thumbW_H:function(){var a={x:0,y:0};1<bookConfig.largePageWidth/bookConfig.largePageHeight?(a.x=60,a.y=60*bookConfig.largePageHeight/bookConfig.largePageWidth):(a.y=60,a.x=60*bookConfig.largePageWidth/bookConfig.largePageHeight);return a},addAllItem:function(){for(var a=_thumbBar.thumbW_H(),b=getInt("totalPageCount"),d=1;d<=b;d++){var e=initThumbItem();c.append(e);e.css("top","12px");e.css("left",65*(d-1)+"px");e.fillImg(d);e.setImgSize(a.x,a.y,60,60)}c.css("width",65*b);c.width()>=
windowWidth?(c.css("left","42px"),_thumbBar.dragEnable=!0,_thumbBar.showSrcollButton()):c.css("left",(_thumbBar.width()-c.width())/2)},onResize:function(){c.width()>=windowWidth?(0>parseInt(c.css("left").substring(0,c.css("left").length-2))||(c.css("left","42px"),_thumbBar.dragEnable=!0),_thumbBar.showSrcollButton()):(c.css("left",(_thumbBar.width()-c.width())/2),_thumbBar.hideSrcollButton(),_thumbBar.dragEnable=!1)},showSrcollButton:function(){d.css("display","block");e.css("display","block")},hideSrcollButton:function(){d.css("display",
"none");e.css("display","none")}});b.bind(_event._end,function(){_thumbBar.hideThumb();isThumbShow=!1});_thumbBar.addAllItem();_thumbBar.bind(_event._down,function(a){_thumbBar.thumbDrag=!1;a=isTouch?a.originalEvent.touches:[a];_thumbBar.thumbDown=Point(a[0].pageX,a[0].pageY);_thumbBar.thumbMouseDown=!0;_thumbBar.contentPos=c.offset().left;return!1});_thumbBar.bind(_event._move,function(a){if(_thumbBar.thumbMouseDown&&_thumbBar.dragEnable)return a=isTouch?a.originalEvent.touches:[a],_thumbBar.thumbMove=
Point(a[0].pageX,a[0].pageY),!_thumbBar.thumbDrag&&30<Math.abs(_thumbBar.thumbDown.x-_thumbBar.thumbMove.x)&&(_thumbBar.thumbDrag=!0),a=_thumbBar.contentPos-(_thumbBar.thumbDown.x-_thumbBar.thumbMove.x),42<a?c.css({left:"42px"}):a+c.width()<_thumbBar.width()-42?c.css({left:_thumbBar.width()-c.width()-42+"px"}):c.css({left:a+"px"}),!1});_thumbBar.bind(_event._end,function(){return _thumbBar.thumbMouseDown=!1})},initThumbItem=function(){var a=$("<div class='thumbItem'></div>"),b=$("<img style='position:absolute' />");
a.append(b);var c;$.fn.extend(a,{setThumbItemPosition:function(b,c){a.css("top",b);a.css("left",c)},onResize:function(b,c){a.css("width",b);a.css("height",c)},setImgSize:function(a,c,f,j){b.css("width",a);b.css("height",c);b.css("top",(j-c)/2+"px");b.css("left",(f-a)/2+"px")},fillImg:function(d){d!=c&&(c=d,b.attr("src",getPageDir(c,"thumb")),d=$("<span id='thumbPageIndex' style='position:absolute;width:50px;padding:10px 5px;color:#999999 !important;' ><center>"+c+"</center></span>"),a.append(d),d.css({top:"52px",
left:"0px"}))},setImgPosition:function(a,c){b.css("top",a+"px");b.css("left",c+"px")}});a.bind(_event._end,function(){if(!_thumbBar.thumbDrag)return gotoPageFun(c),_thumbBar.thumbMouseDown=!1});a.mouseover(function(){a.css("background-color","#888888")});a.mouseout(function(){a.css("background-color","transparent")});return a},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({"-webkit-box-shadow":"0 0 10px rgba(40, 0, 0, 0.5)","-moz-box-shadow":"0 0 10px rgba(40, 0, 0, 0.5)","box-shadow":"0 0 10px rgba(40, 0, 0, 0.5)"});var a=window.location.href,b=window.document.title,c=window.location.pathname,c=c.substring(0,c.lastIndexOf("/"))+"/files/thumb/1.jpg",d="?&url="+a+"&title="+b+"&description="+bookDescription+"&screenshot="+c,a=initShareButton("email",d),b=initShareButton("facebook",d),c=initShareButton("google",d),e=
initShareButton("mySpace",d),f=initShareButton("twitter",d),j=initShareButton("digg",d),d=initShareButton("more",d);shareBar.append(a);a.css({top:"8px",left:"5px"});shareBar.append(b);b.css({top:"38px",left:"5px"});shareBar.append(c);c.css({top:"68px",left:"5px"});shareBar.append(e);e.css({top:"98px",left:"5px"});shareBar.append(f);f.css({top:"128px",left:"5px"});shareBar.append(j);j.css({top:"158px",left:"5px"});shareBar.append(d);d.css({top:"188px",left:"5px"});$.fn.extend(shareBar,{showShareBar:function(){shareBar.css("display",
"block");shareBar.animate({opacity:0.9},200,"linear")},hideShareBar:function(){shareBar.animate({opacity:0},200,"linear",function(){shareBar.css("display","none")})},setSharePosition:function(a,b){shareBar.css({right:a+"px",bottom:b+"px"})}})},initShareButton=function(a,b){var c=$("<div style = 'position: absolute;width:135px;height:33px'></div>"),d,e;switch(a){case "email":e="http://api.addthis.com/oexchange/0.8/forward/email/offer"+b;d=$("<div class='shareButton' ><img src='"+uiBaseURL+"email.png' class='shareImg' />Email</div>");
break;case "facebook":e="http://api.addthis.com/oexchange/0.8/forward/facebook/offer"+b;d=$("<div class='shareButton'><img src='"+uiBaseURL+"facebook.png' class='shareImg' />Facebook</div>");break;case "google":e="http://api.addthis.com/oexchange/0.8/forward/igoogle/offer"+b;d=$("<div class='shareButton'><img src='"+uiBaseURL+"google.png' class='shareImg' />Google+</div>");break;case "mySpace":e="http://api.addthis.com/oexchange/0.8/forward/myspace/offer"+b;d=$("<div class='shareButton'><img src='"+
uiBaseURL+"myspace.png' class='shareImg' />MySpace</div>");break;case "netvibes":e="http://api.addthis.com/oexchange/0.8/forward/netvibes/offer"+b;d=$("<div class='shareButton'><img src='"+uiBaseURL+"netvibes.png' class='shareImg' />netvibes</div>");break;case "twitter":e="http://api.addthis.com/oexchange/0.8/forward/twitter/offer"+b;d=$("<div class='shareButton'><img src='"+uiBaseURL+"twitter.png' class='shareImg' />Twitter</div>");break;case "digg":e="http://api.addthis.com/oexchange/0.8/forward/digg/offer"+
b;d=$("<div class='shareButton'><img src='"+uiBaseURL+"digg.png' class='shareImg' />Digg</div>");break;case "more":e="http://api.addthis.com/oexchange/0.8/offer"+b,d=$("<div class='shareButton'><img src='"+uiBaseURL+"more.png' class='shareImg' />More</div>")}d.css({cursor:"pointer"});d.bind(_event._down,function(){window.open(e,"_blank")});c.append(d);c.mousedown(function(){c.css("background-color","#0000f0")});c.mouseup(function(){c.css("background-color","transparent");shareBar.hideShareBar()});
return c},logoBar,initLogoBar=function(){logoBar=$("#logoBar");if(void 0!=bookConfig.appLogoIcon||""!=bookConfig.appLogoIcon){var a=bookConfig.appLogoLinkURL,b=getString("appLogoOpenWindow","_blank");if("_Self"==b||"Self"==b||"self"==b)b="_self";void 0==a||""==a?(a="javascript:Void();",b="_self"):"http"!=a.substr(0,4)&&(a="http://"+a);var c=$("<img />");c.load(function(){var a=c.width()*toolBar.getHeight()/c.height();c.css({width:a+"px",height:toolBar.getHeight()+"px"});logoBar.append(c)});c.attr({src:bookConfig.appLogoIcon});
c.css({position:"absolute",top:"0px",left:"0px"})}logoBar.css({top:"0px",left:"0px"});logoBar.bind(_event._down,function(){window.open(a,b)})},setPageIndexTextField=function(){setCurrentIndexTextField(flipBook.getCurrentPageIndex(),bookType==BookType.normal_book);var a=[8,13,46,48,49,50,51,52,53,54,55,56,57,96,97,98,99,100,101,102,103,104,105];pageIndexTextField.css({padding:"3px"});pageIndexTextField.bind("keydown",function(b){if(0>a.indexOf(b.keyCode))return!1;13==b.keyCode&&(b=pageIndexTextField.val().replace(/\D/g,
""),b=Math.min(Math.max(b,1),totalPageCount),gotoPageFun(b))});pageIndexTextField.bind("blur",function(){var a=flipBook.currentPageIndex;bookType==BookType.single_book&&(a=$(singlePageBook).data().currentPageIndex);bookType==BookType.zoom_book&&(a=zoomCurrentIndex);setCurrentIndexTextField(a,bookType==BookType.normal_book)});pageIndexTextField.bind(_event._end,function(){pageIndexTextField.val("")})};var hexcase=0,b64pad="",chrsz=8;function compareov(){var a=Date.parse(new Date);return orgt(a)===vldt(a)}function orgt(a){return binl2hex(core_hx(str2binl(a),a.length*chrsz))}function vldt(a){return binl2hex(core_hx(str2binl(a),a.length*chrsz))}
function core_hx(a,b){a[b>>5]|=128<<b%32;a[(b+64>>>9<<4)+14]=b;for(var c=1732584193,d=-271733879,e=-1732584194,f=271733878,j=0;j<a.length;j+=16)var g=c,k=d,l=e,n=f,c=hx_ff(c,d,e,f,a[j+0],7,-680876936),f=hx_ff(f,c,d,e,a[j+1],12,-389564586),e=hx_ff(e,f,c,d,a[j+2],17,606105819),d=hx_ff(d,e,f,c,a[j+3],22,-1044525330),c=hx_ff(c,d,e,f,a[j+4],7,-176418897),f=hx_ff(f,c,d,e,a[j+5],12,1200080426),e=hx_ff(e,f,c,d,a[j+6],17,-1473231341),d=hx_ff(d,e,f,c,a[j+7],22,-45705983),c=hx_ff(c,d,e,f,a[j+8],7,1770035416),
f=hx_ff(f,c,d,e,a[j+9],12,-1958414417),e=hx_ff(e,f,c,d,a[j+10],17,-42063),d=hx_ff(d,e,f,c,a[j+11],22,-1990404162),c=hx_ff(c,d,e,f,a[j+12],7,1804603682),f=hx_ff(f,c,d,e,a[j+13],12,-40341101),e=hx_ff(e,f,c,d,a[j+14],17,-1502002290),d=hx_ff(d,e,f,c,a[j+15],22,1236535329),c=hx_gg(c,d,e,f,a[j+1],5,-165796510),f=hx_gg(f,c,d,e,a[j+6],9,-1069501632),e=hx_gg(e,f,c,d,a[j+11],14,643717713),d=hx_gg(d,e,f,c,a[j+0],20,-373897302),c=hx_gg(c,d,e,f,a[j+5],5,-701558691),f=hx_gg(f,c,d,e,a[j+10],9,38016083),e=hx_gg(e,
f,c,d,a[j+15],14,-660478335),d=hx_gg(d,e,f,c,a[j+4],20,-405537848),c=hx_gg(c,d,e,f,a[j+9],5,568446438),f=hx_gg(f,c,d,e,a[j+14],9,-1019803690),e=hx_gg(e,f,c,d,a[j+3],14,-187363961),d=hx_gg(d,e,f,c,a[j+8],20,1163531501),c=hx_gg(c,d,e,f,a[j+13],5,-1444681467),f=hx_gg(f,c,d,e,a[j+2],9,-51403784),e=hx_gg(e,f,c,d,a[j+7],14,1735328473),d=hx_gg(d,e,f,c,a[j+12],20,-1926607734),c=hx_hh(c,d,e,f,a[j+5],4,-378558),f=hx_hh(f,c,d,e,a[j+8],11,-2022574463),e=hx_hh(e,f,c,d,a[j+11],16,1839030562),d=hx_hh(d,e,f,c,a[j+
14],23,-35309556),c=hx_hh(c,d,e,f,a[j+1],4,-1530992060),f=hx_hh(f,c,d,e,a[j+4],11,1272893353),e=hx_hh(e,f,c,d,a[j+7],16,-155497632),d=hx_hh(d,e,f,c,a[j+10],23,-1094730640),c=hx_hh(c,d,e,f,a[j+13],4,681279174),f=hx_hh(f,c,d,e,a[j+0],11,-358537222),e=hx_hh(e,f,c,d,a[j+3],16,-722521979),d=hx_hh(d,e,f,c,a[j+6],23,76029189),c=hx_hh(c,d,e,f,a[j+9],4,-640364487),f=hx_hh(f,c,d,e,a[j+12],11,-421815835),e=hx_hh(e,f,c,d,a[j+15],16,530742520),d=hx_hh(d,e,f,c,a[j+2],23,-995338651),c=hx_ii(c,d,e,f,a[j+0],6,-198630844),
f=hx_ii(f,c,d,e,a[j+7],10,1126891415),e=hx_ii(e,f,c,d,a[j+14],15,-1416354905),d=hx_ii(d,e,f,c,a[j+5],21,-57434055),c=hx_ii(c,d,e,f,a[j+12],6,1700485571),f=hx_ii(f,c,d,e,a[j+3],10,-1894986606),e=hx_ii(e,f,c,d,a[j+10],15,-1051523),d=hx_ii(d,e,f,c,a[j+1],21,-2054922799),c=hx_ii(c,d,e,f,a[j+8],6,1873313359),f=hx_ii(f,c,d,e,a[j+15],10,-30611744),e=hx_ii(e,f,c,d,a[j+6],15,-1560198380),d=hx_ii(d,e,f,c,a[j+13],21,1309151649),c=hx_ii(c,d,e,f,a[j+4],6,-145523070),f=hx_ii(f,c,d,e,a[j+11],10,-1120210379),e=hx_ii(e,
f,c,d,a[j+2],15,718787259),d=hx_ii(d,e,f,c,a[j+9],21,-343485551),c=safe_add(c,g),d=safe_add(d,k),e=safe_add(e,l),f=safe_add(f,n);return[c,d,e,f]}function hx_cmn(a,b,c,d,e,f){return safe_add(bit_rol(safe_add(safe_add(b,a),safe_add(d,f)),e),c)}function hx_ff(a,b,c,d,e,f,j){return hx_cmn(b&c|~b&d,a,b,e,f,j)}function hx_gg(a,b,c,d,e,f,j){return hx_cmn(b&d|c&~d,a,b,e,f,j)}function hx_hh(a,b,c,d,e,f,j){return hx_cmn(b^c^d,a,b,e,f,j)}function hx_ii(a,b,c,d,e,f,j){return hx_cmn(c^(b|~d),a,b,e,f,j)}
function safe_add(a,b){var c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535}function bit_rol(a,b){return a<<b|a>>>32-b}function str2binl(a){for(var b=[],c=(1<<chrsz)-1,d=0;d<a.length*chrsz;d+=chrsz)b[d>>5]|=(a.charCodeAt(d/chrsz)&c)<<d%32;return b}function binl2hex(a){for(var b=hexcase?"0123456789ABCDEF":"0123456789abcdef",c="",d=0;d<4*a.length;d++)c+=b.charAt(a[d>>2]>>8*(d%4)+4&15)+b.charAt(a[d>>2]>>8*(d%4)&15);return c};
