
/*
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
*
* Uses the built in easing capabilities added In jQuery 1.1
* to offer multiple easing options
*
* TERMS OF USE - jQuery Easing
* 
* Open source under the BSD License. 
* 
* Copyright © 2008 George McGinley Smith
* All rights reserved.
* 
* Redistribution and use in source and binary forms, with or without modification, 
* are permitted provided that the following conditions are met:
* 
* Redistributions of source code must retain the above copyright notice, this list of 
* conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list 
* of conditions and the following disclaimer in the documentation and/or other materials 
* provided with the distribution.
* 
* Neither the name of the author nor the names of contributors may be used to endorse 
* or promote products derived from this software without specific prior written permission.
* 
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
*  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
*  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
*  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
*  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
* OF THE POSSIBILITY OF SUCH DAMAGE. 
*
*/

// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend(jQuery.easing,
{
    def: 'easeOutQuad',
    swing: function (x, t, b, c, d) {
        //alert(jQuery.easing.default);
        return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
    },
    easeInQuad: function (x, t, b, c, d) {
        return c * (t /= d) * t + b;
    },
    easeOutQuad: function (x, t, b, c, d) {
        return -c * (t /= d) * (t - 2) + b;
    },
    easeInOutQuad: function (x, t, b, c, d) {
        if ((t /= d / 2) < 1) return c / 2 * t * t + b;
        return -c / 2 * ((--t) * (t - 2) - 1) + b;
    },
    easeInCubic: function (x, t, b, c, d) {
        return c * (t /= d) * t * t + b;
    },
    easeOutCubic: function (x, t, b, c, d) {
        return c * ((t = t / d - 1) * t * t + 1) + b;
    },
    easeInOutCubic: function (x, t, b, c, d) {
        if ((t /= d / 2) < 1) return c / 2 * t * t * t + b;
        return c / 2 * ((t -= 2) * t * t + 2) + b;
    },
    easeInQuart: function (x, t, b, c, d) {
        return c * (t /= d) * t * t * t + b;
    },
    easeOutQuart: function (x, t, b, c, d) {
        return -c * ((t = t / d - 1) * t * t * t - 1) + b;
    },
    easeInOutQuart: function (x, t, b, c, d) {
        if ((t /= d / 2) < 1) return c / 2 * t * t * t * t + b;
        return -c / 2 * ((t -= 2) * t * t * t - 2) + b;
    },
    easeInQuint: function (x, t, b, c, d) {
        return c * (t /= d) * t * t * t * t + b;
    },
    easeOutQuint: function (x, t, b, c, d) {
        return c * ((t = t / d - 1) * t * t * t * t + 1) + b;
    },
    easeInOutQuint: function (x, t, b, c, d) {
        if ((t /= d / 2) < 1) return c / 2 * t * t * t * t * t + b;
        return c / 2 * ((t -= 2) * t * t * t * t + 2) + b;
    },
    easeInSine: function (x, t, b, c, d) {
        return -c * Math.cos(t / d * (Math.PI / 2)) + c + b;
    },
    easeOutSine: function (x, t, b, c, d) {
        return c * Math.sin(t / d * (Math.PI / 2)) + b;
    },
    easeInOutSine: function (x, t, b, c, d) {
        return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;
    },
    easeInExpo: function (x, t, b, c, d) {
        return (t == 0) ? b : c * Math.pow(2, 10 * (t / d - 1)) + b;
    },
    easeOutExpo: function (x, t, b, c, d) {
        return (t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b;
    },
    easeInOutExpo: function (x, t, b, c, d) {
        if (t == 0) return b;
        if (t == d) return b + c;
        if ((t /= d / 2) < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
        return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;
    },
    easeInCirc: function (x, t, b, c, d) {
        return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b;
    },
    easeOutCirc: function (x, t, b, c, d) {
        return c * Math.sqrt(1 - (t = t / d - 1) * t) + b;
    },
    easeInOutCirc: function (x, t, b, c, d) {
        if ((t /= d / 2) < 1) return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b;
        return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b;
    },
    easeInElastic: function (x, t, b, c, d) {
        var s = 1.70158; var p = 0; var a = c;
        if (t == 0) return b; if ((t /= d) == 1) return b + c; if (!p) p = d * .3;
        if (a < Math.abs(c)) { a = c; var s = p / 4; }
        else var s = p / (2 * Math.PI) * Math.asin(c / a);
        return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
    },
    easeOutElastic: function (x, t, b, c, d) {
        var s = 1.70158; var p = 0; var a = c;
        if (t == 0) return b; if ((t /= d) == 1) return b + c; if (!p) p = d * .3;
        if (a < Math.abs(c)) { a = c; var s = p / 4; }
        else var s = p / (2 * Math.PI) * Math.asin(c / a);
        return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b;
    },
    easeInOutElastic: function (x, t, b, c, d) {
        var s = 1.70158; var p = 0; var a = c;
        if (t == 0) return b; if ((t /= d / 2) == 2) return b + c; if (!p) p = d * (.3 * 1.5);
        if (a < Math.abs(c)) { a = c; var s = p / 4; }
        else var s = p / (2 * Math.PI) * Math.asin(c / a);
        if (t < 1) return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
        return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b;
    },
    easeInBack: function (x, t, b, c, d, s) {
        if (s == undefined) s = 1.70158;
        return c * (t /= d) * t * ((s + 1) * t - s) + b;
    },
    easeOutBack: function (x, t, b, c, d, s) {
        if (s == undefined) s = 1.70158;
        return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
    },
    easeInOutBack: function (x, t, b, c, d, s) {
        if (s == undefined) s = 1.70158;
        if ((t /= d / 2) < 1) return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;
        return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
    },
    easeInBounce: function (x, t, b, c, d) {
        return c - jQuery.easing.easeOutBounce(x, d - t, 0, c, d) + b;
    },
    easeOutBounce: function (x, t, b, c, d) {
        if ((t /= d) < (1 / 2.75)) {
            return c * (7.5625 * t * t) + b;
        } else if (t < (2 / 2.75)) {
            return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b;
        } else if (t < (2.5 / 2.75)) {
            return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b;
        } else {
            return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;
        }
    },
    easeInOutBounce: function (x, t, b, c, d) {
        if (t < d / 2) return jQuery.easing.easeInBounce(x, t * 2, 0, c, d) * .5 + b;
        return jQuery.easing.easeOutBounce(x, t * 2 - d, 0, c, d) * .5 + c * .5 + b;
    }
});

/*
*
* TERMS OF USE - EASING EQUATIONS
* 
* Open source under the BSD License. 
* 
* Copyright © 2001 Robert Penner
* All rights reserved.
* 
* Redistribution and use in source and binary forms, with or without modification, 
* are permitted provided that the following conditions are met:
* 
* Redistributions of source code must retain the above copyright notice, this list of 
* conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list 
* of conditions and the following disclaimer in the documentation and/or other materials 
* provided with the distribution.
* 
* Neither the name of the author nor the names of contributors may be used to endorse 
* or promote products derived from this software without specific prior written permission.
* 
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
*  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
*  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
*  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
*  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
* OF THE POSSIBILITY OF SUCH DAMAGE. 
*
*/


/**
* jQuery.ScrollTo - Easy element scrolling using jQuery.
* Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
* Dual licensed under MIT and GPL.
* Date: 5/25/2009
* @author Ariel Flesler
* @version 1.4.2
*
* http://flesler.blogspot.com/2007/10/jqueryscrollto.html
*/
; (function (d) { var k = d.scrollTo = function (a, i, e) { d(window).scrollTo(a, i, e) }; k.defaults = { axis: 'xy', duration: parseFloat(d.fn.jquery) >= 1.3 ? 0 : 1 }; k.window = function (a) { return d(window)._scrollable() }; d.fn._scrollable = function () { return this.map(function () { var a = this, i = !a.nodeName || d.inArray(a.nodeName.toLowerCase(), ['iframe', '#document', 'html', 'body']) != -1; if (!i) return a; var e = (a.contentWindow || a).document || a.ownerDocument || a; return d.browser.safari || e.compatMode == 'BackCompat' ? e.body : e.documentElement }) }; d.fn.scrollTo = function (n, j, b) { if (typeof j == 'object') { b = j; j = 0 } if (typeof b == 'function') b = { onAfter: b }; if (n == 'max') n = 9e9; b = d.extend({}, k.defaults, b); j = j || b.speed || b.duration; b.queue = b.queue && b.axis.length > 1; if (b.queue) j /= 2; b.offset = p(b.offset); b.over = p(b.over); return this._scrollable().each(function () { var q = this, r = d(q), f = n, s, g = {}, u = r.is('html,body'); switch (typeof f) { case 'number': case 'string': if (/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)) { f = p(f); break } f = d(f, this); case 'object': if (f.is || f.style) s = (f = d(f)).offset() } d.each(b.axis.split(''), function (a, i) { var e = i == 'x' ? 'Left' : 'Top', h = e.toLowerCase(), c = 'scroll' + e, l = q[c], m = k.max(q, i); if (s) { g[c] = s[h] + (u ? 0 : l - r.offset()[h]); if (b.margin) { g[c] -= parseInt(f.css('margin' + e)) || 0; g[c] -= parseInt(f.css('border' + e + 'Width')) || 0 } g[c] += b.offset[h] || 0; if (b.over[h]) g[c] += f[i == 'x' ? 'width' : 'height']() * b.over[h] } else { var o = f[h]; g[c] = o.slice && o.slice(-1) == '%' ? parseFloat(o) / 100 * m : o } if (/^\d+$/.test(g[c])) g[c] = g[c] <= 0 ? 0 : Math.min(g[c], m); if (!a && b.queue) { if (l != g[c]) t(b.onAfterFirst); delete g[c] } }); t(b.onAfter); function t(a) { r.animate(g, j, b.easing, a && function () { a.call(this, n, b) }) } }).end() }; k.max = function (a, i) { var e = i == 'x' ? 'Width' : 'Height', h = 'scroll' + e; if (!d(a).is('html,body')) return a[h] - d(a)[e.toLowerCase()](); var c = 'client' + e, l = a.ownerDocument.documentElement, m = a.ownerDocument.body; return Math.max(l[h], m[h]) - Math.min(l[c], m[c]) }; function p(a) { return typeof a == 'object' ? a : { top: a, left: a} } })(jQuery);

/**
* npjReader (c) 2011 Netpublicator
* @author Netpublicator
* @version 0.9b
*/
var npjSettings={Document:{Pages:72,Width:0,Height:0,ID:"",URL:"",oWidth:0,oHeight:0,ZoomPath:"",ImagePath:"",SplitZoom:false},Reader:{Width:0,Height:0,ContentHeight:0,isSpread:true,Slides:38,PreloadImages:6,HeaderHeight:0},Position:{totPositionX:0,totPositionY:0,dynPositionX:0,dynPositionY:0,maxPositionXP:0,maxPositionXN:0,maxPositionYP:0,maxPositionYN:0},Zoom:{isZooming:false,isZoomed:false,isZoomMoving:false,totScale:1,dynScale:0,MaxZoom:3,MinZoom:1.39,dblZoom:2,dblZoomD:3,ZoomedOnce:0,AddScale:0,ZoomMovement:{Timer:null,LengthX:0,LengthY:0}},Slide:{isSliding:false,isSwitch:false,isSwitching:false,SwitchForward:false,currentPage:0,currentSlide:0,currentPageLoad:0,currentSlideLoad:0,currentSwitch:0},Pointers:{Fingers:0,currentX:0,currentY:0,startX:0,startY:0,endX:0,endY:0},User:{iOS:false,Android:false,touchOS:false,RunMultiTouch:false,RunDoubleTapZoom:false}};function npjReaderLoad(d,g,l,b,j,o,s){var a=navigator.userAgent.toLowerCase();var h=(a.indexOf("series60")!=-1)||(a.indexOf("symbian")!=-1)||(a.indexOf("windows ce")!=-1)||(a.indexOf("blackberry")!=-1);var k=typeof e!="undefined"?true:false;var m=("ontouchstart" in document.documentElement)?true:false;var f=(navigator.platform.indexOf("iPhone")!=-1)||(navigator.platform.indexOf("iPad")!=-1)?true:false;var q=(a.indexOf("android")!=-1)||(!f&&!h&&m&&k)?true:false;npjSettings.User.iOS=f;npjSettings.User.Android=q;npjSettings.User.touchOS=m;if(f){npjSettings.User.RunMultiTouch=true;npjSettings.User.RunDoubleTapZoom=false}else{if(q){npjSettings.User.RunMultiTouch=false;npjSettings.User.RunDoubleTapZoom=true}}npjSettings.Document.Pages=b;if(npjSettings.User.iOS||npjSettings.User.Android){npjSettings.Document.SplitZoom=s;if(s){npjSettings.Document.ImagePath="device";npjSettings.Document.ZoomPath="device"}else{npjSettings.Document.ImagePath="imgs";npjSettings.Document.ZoomPath="imgs_zoomed"}npjSettings.Document.URL=g;npjSettings.Document.ID=l;npjSettings.Document.oWidth=j;npjSettings.Document.oHeight=o;npjSettings.Reader.Width=$(window).width();npjSettings.Reader.Height=$(window).height();npjSettings.Reader.ContentHeight=(npjSettings.Reader.Height-npjSettings.Reader.HeaderHeight);var e=window.orientation;var r=npjSettings.Slide.currentSlide;var p=npjSettings.Slide.currentPage;if(e===0||e===180){npjSettings.Reader.isSpread=false;var r=(npjSettings.Slide.currentSlide*2)-1;npjSettings.Reader.Slides=npjSettings.Document.Pages;npjSettings.Slide.currentPageLoad=1;npjSettings.Slide.currentPage=1;npjSettings.Slide.currentSlideLoad=0;npjSettings.Slide.currentSlide=0;npjSettings.Zoom.MaxZoom=8}else{npjSettings.Reader.isSpread=true;npjSettings.Zoom.MaxZoom=8;npjSettings.Reader.Slides=(npjSettings.Document.Pages/2)+1;r=Math.round((npjSettings.Slide.currentSlide/2));if(!npjisEven(p)){p=(p-1)}npjSettings.Slide.currentPageLoad=0;npjSettings.Slide.currentPage=0;npjSettings.Slide.currentSlideLoad=0;npjSettings.Slide.currentSlide=0}npjSettings.Zoom.AddScale=0;npjSettings.Zoom.dynScale=0;npjSettings.Zoom.isZoomed=false;npjSettings.Zoom.isZooming=false;npjSettings.Zoom.isZoomMoving=false;npjSettings.Zoom.totScale=1;npjSettings.Zoom.ZoomedOnce=0;npjSettings.Position.dynPositionX=0;npjSettings.Position.dynPositionY=0;npjSettings.Position.totPositionX=0;npjSettings.Position.totPositionY=0;npjSetImageWidthHeight();var t=$("#npjReader");t.width(npjSettings.Reader.Width);t.height(npjSettings.Reader.Height);t.append('<div id="npjHeader"></div>');var c="absolute";if(f){c="fixed"}t.append('<div style="position:'+c+"; width:"+(npjSettings.Reader.Width)+"px; height:"+npjSettings.Reader.ContentHeight+'px;" id="npjZoom"></div>');t.append('<div style="position:'+c+"; width:"+(npjSettings.Reader.Width)+"px; height:"+npjSettings.Reader.ContentHeight+'px;" id="npjZoomA"></div>');t.append('<div style="width:'+(npjSettings.Reader.Width)+"px; height:"+npjSettings.Reader.ContentHeight+'px;" id="npjSlidesWrap"></div><div style="clear:both;"></div>');$("#npjSlidesWrap").append('<div style="width:'+(npjSettings.Reader.Width*npjSettings.Document.Pages)+"px; height:"+npjSettings.Reader.ContentHeight+'px;" id="npjContent"></div><div style="clear:both;"></div>');if(d){for(var n=0;n<npjSettings.Reader.Slides;n++){npjSlideCreate(n);if(n<(r+4)){npjImagePreLoad(n,npjSettings.Slide.currentPageLoad);npjSettings.Slide.currentPageLoad++;if(npjSettings.Reader.isSpread){npjSettings.Slide.currentPageLoad++}npjSettings.Slide.currentSlideLoad++}}$("#npjSlidesWrap").scrollTo((($("#npjReader").width()*(r))),0,{queue:false});npjSettings.Slide.currentPage=p;npjSettings.Slide.currentSlide=r}else{for(var n=0;n<npjSettings.Reader.Slides;n++){npjSlideCreate(n);if(n<npjSettings.Reader.PreloadImages){npjImagePreLoad(n,npjSettings.Slide.currentPageLoad);npjSettings.Slide.currentPageLoad++;if(npjSettings.Reader.isSpread){npjSettings.Slide.currentPageLoad++}npjSettings.Slide.currentSlideLoad++}}$("#npjReader").npjTouch()}}}(function(a){a.fn.delay=function(b,c){jQuery.fx.step.delay=function(){};return this.animate({delay:1},b,c)}})(jQuery);function npjisEven(a){if(a%2==0){return true}else{return false}}function npjSetImageWidthHeight(){var h=npjSettings.Reader.Height;var f=h/npjSettings.Document.oHeight;var e=npjSettings.Document.oWidth*f;var b=Math.round(e);if((b*2)>npjSettings.Reader.Width&&npjSettings.Reader.isSpread||b>npjSettings.Reader.Width&&!npjSettings.Reader.isSpread){var c=(npjSettings.Reader.Width/2);if(!npjSettings.Reader.isSpread){c=npjSettings.Reader.Width}var a=c/npjSettings.Document.oWidth;var g=npjSettings.Document.oHeight*a;var d=Math.round(g);npjSettings.Document.Width=c;npjSettings.Document.Height=d}else{npjSettings.Document.Width=b;npjSettings.Document.Height=h}}var npj_myslide;function npjZoomMovementStart(){npjSettings.Zoom.isZoomMoving=true}function npjZoomMovement(c,b,a,d){if(npjSettings.Zoom.isZoomMoving){if(a>0&&!c){npjSettings.Position.dynPositionX=npjSettings.Position.totPositionX+(a*1.7)}else{if(a<0&&!c){npjSettings.Position.dynPositionX=npjSettings.Position.totPositionX+(a*1.7)}else{if(a>0&&c){npjSettings.Position.dynPositionX=npjSettings.Position.totPositionX-(a*1.7)}else{if(a<0&&c){npjSettings.Position.dynPositionX=npjSettings.Position.totPositionX-(a*1.7)}}}}npjSettings.Zoom.ZoomMovement.LengthX=a;if(d>0&&!b){npjSettings.Position.dynPositionY=npjSettings.Position.totPositionY+(d*1.7)}else{if(a<0&&!b){npjSettings.Position.dynPositionY=npjSettings.Position.totPositionY+(d*1.7)}else{if(a>0&&b){npjSettings.Position.dynPositionY=npjSettings.Position.totPositionY-(d*1.7)}else{if(a<0&&b){npjSettings.Position.dynPositionY=npjSettings.Position.totPositionY-(d*1.7)}}}}npjSettings.Zoom.ZoomMovement.LengthY=d;if(npjSettings.Reader.isSpread&&npjSettings.Slide.currentPage==npjSettings.Document.Pages){if(npjSettings.Position.dynPositionX<npjSettings.Position.maxPositionXN){npjSettings.Position.dynPositionX=npjSettings.Position.maxPositionXN}if(npjSettings.Position.dynPositionX>npjSettings.Position.maxPositionXP){npjSettings.Position.dynPositionX=npjSettings.Position.maxPositionXP}}else{if(npjSettings.Position.dynPositionX>npjSettings.Position.maxPositionXP){npjSettings.Position.dynPositionX=npjSettings.Position.maxPositionXP}if(npjSettings.Position.dynPositionX<npjSettings.Position.maxPositionXN){npjSettings.Position.dynPositionX=npjSettings.Position.maxPositionXN}}if(npjSettings.Position.dynPositionY>npjSettings.Position.maxPositionYP){npjSettings.Position.dynPositionY=npjSettings.Position.maxPositionYP}if(npjSettings.Position.dynPositionY<npjSettings.Position.maxPositionYN){npjSettings.Position.dynPositionY=npjSettings.Position.maxPositionYN}document.getElementById("npjZoomA").style.webkitTransform="translate3d("+npjSettings.Position.dynPositionX+"px, "+npjSettings.Position.dynPositionY+"px, 0px) scale3d("+1+","+1+", "+1+" )"}}function npjZoomMovementEnd(){if(npjSettings.Zoom.isZoomMoving){npjSettings.Position.totPositionY=npjSettings.Position.dynPositionY;npjSettings.Position.totPositionX=npjSettings.Position.dynPositionX;npj_myslide.style.webkitTransform="translate3d("+npjSettings.Position.totPositionX+"px, "+npjSettings.Position.totPositionY+"px, 0px) scale3d("+npjSettings.Zoom.totScale+","+npjSettings.Zoom.totScale+", "+npjSettings.Zoom.totScale+" )";npjSettings.Zoom.isZoomMoving=false}}function npjZoomMovementEnd_momentum(h,b,f,a){var e=3.5,g=2.2,c=Math.abs(h)/b*1000,d=c*c/e/1000,i=0;if(h>0&&d>f){c=c*f/d/e;d=f}else{if(h<0&&d>a){c=c*a/d/e;d=a}}d=d*(h<0?-1:1);i=c/g;return{dist:Math.round(d),time:Math.round(i)}}function npjDoubleClick(){if(npjSettings.Zoom.isZoomed){if(npjSettings.User.RunDoubleTapZoom&&npjSettings.Zoom.ZoomedOnce==1){npjSettings.Zoom.isZooming=true;npjSettings.Pointers.Fingers=2;npjZooming(npjSettings.Zoom.dblZoomD);npjSettings.Zoom.ZoomedOnce=2}else{npjSettings.Zoom.isZooming=true;npjSettings.Pointers.Fingers=2;npjSettings.Zoom.totScale=1;npjZooming(0.1)}}else{npjSettings.Zoom.isZooming=true;npjSettings.Pointers.Fingers=2;npjZooming(npjSettings.Zoom.dblZoom);npjSettings.Zoom.ZoomedOnce=1}npjZommingEnd()}function npjZoomingStart(){npjSettings.Pointers.Fingers=2;if(!npjSettings.Zoom.isZoomed){npjSettings.Zoom.AddScale=0.4}npjSettings.Zoom.isZooming=true;$("#npjZoomA").hide()}function npjZooming(b,a){if(npjSettings.Zoom.isZooming||a){if(!npjSettings.Zoom.isZoomed){npj_myslide=document.getElementById("npjZoom");$("#npjZoom").append($("#npjTable"+npjSettings.Slide.currentPage));npjZoomAload();$("#npjZoom").show()}npjSettings.Zoom.isZoomed=true;if(npjSettings.Zoom.AddScale!=0){b=b+npjSettings.Zoom.AddScale}npjSettings.Zoom.dynScale=b*npjSettings.Zoom.totScale;if(npjSettings.Zoom.dynScale<=npjSettings.Zoom.MaxZoom){npjSettings.Position.dynPositionX=((npjSettings.Position.totPositionX/npjSettings.Zoom.totScale)*npjSettings.Zoom.dynScale)+(-1*((npjSettings.Pointers.currentX*b)-npjSettings.Pointers.currentX));npjSettings.Position.dynPositionY=((npjSettings.Position.totPositionY/npjSettings.Zoom.totScale)*npjSettings.Zoom.dynScale)+(-1*((npjSettings.Pointers.currentY*b)-npjSettings.Pointers.currentY));if(npjSettings.Zoom.dynScale<=npjSettings.Zoom.MinZoom){npjSettings.Zoom.dynScale=1;npjSettings.Position.dynPositionX=0;npjSettings.Position.dynPositionY=0}else{if(npjSettings.Reader.isSpread){if(npjSettings.Slide.currentPage==0){npjSettings.Position.maxPositionXP=(0-(((npjSettings.Reader.Width/2))*npjSettings.Zoom.dynScale))}else{npjSettings.Position.maxPositionXP=(0-(((npjSettings.Reader.Width/2)-npjSettings.Document.Width)*npjSettings.Zoom.dynScale))}}else{npjSettings.Position.maxPositionXP=(0-(((npjSettings.Reader.Width-npjSettings.Document.Width)/2)*npjSettings.Zoom.dynScale))}npjSettings.Position.maxPositionYP=(npjSettings.Reader.HeaderHeight-(npjSettings.Reader.HeaderHeight*2))-((((npjSettings.Reader.Height-npjSettings.Reader.HeaderHeight)-npjSettings.Document.Height)/2)*npjSettings.Zoom.dynScale);if(npjSettings.Reader.isSpread){if(npjSettings.Slide.currentPage==npjSettings.Document.Pages){npjSettings.Position.maxPositionXN=(-1*(((npjSettings.Reader.Width*npjSettings.Zoom.dynScale)-npjSettings.Reader.Width)-(((npjSettings.Reader.Width)/2)*npjSettings.Zoom.dynScale)))}else{npjSettings.Position.maxPositionXN=(-1*(((npjSettings.Reader.Width*npjSettings.Zoom.dynScale)-npjSettings.Reader.Width)-(((npjSettings.Reader.Width/2)-npjSettings.Document.Width)*npjSettings.Zoom.dynScale)))}}else{npjSettings.Position.maxPositionXN=(-1*(((npjSettings.Reader.Width*npjSettings.Zoom.dynScale)-npjSettings.Reader.Width)-(((npjSettings.Reader.Width-npjSettings.Document.Width)/2)*npjSettings.Zoom.dynScale)))}npjSettings.Position.maxPositionYN=(-1*((((npjSettings.Reader.Height-npjSettings.Reader.HeaderHeight)*npjSettings.Zoom.dynScale)-(npjSettings.Reader.Height-npjSettings.Reader.HeaderHeight))-((((npjSettings.Reader.Height-npjSettings.Reader.HeaderHeight)-npjSettings.Document.Height)/2)*npjSettings.Zoom.dynScale)));if(npjSettings.Reader.isSpread&&npjSettings.Slide.currentPage==npjSettings.Document.Pages){if(npjSettings.Position.dynPositionX<npjSettings.Position.maxPositionXN){npjSettings.Position.dynPositionX=npjSettings.Position.maxPositionXN}if(npjSettings.Position.dynPositionX>npjSettings.Position.maxPositionXP){npjSettings.Position.dynPositionX=npjSettings.Position.maxPositionXP}}else{if(npjSettings.Position.dynPositionX>npjSettings.Position.maxPositionXP){npjSettings.Position.dynPositionX=npjSettings.Position.maxPositionXP}if(npjSettings.Position.dynPositionX<npjSettings.Position.maxPositionXN){npjSettings.Position.dynPositionX=npjSettings.Position.maxPositionXN}}if(npjSettings.Position.dynPositionY>npjSettings.Position.maxPositionYP){npjSettings.Position.dynPositionY=npjSettings.Position.maxPositionYP}if(npjSettings.Position.dynPositionY<npjSettings.Position.maxPositionYN){npjSettings.Position.dynPositionY=npjSettings.Position.maxPositionYN}npj_myslide.style.webkitTransform="translate3d("+npjSettings.Position.dynPositionX+"px, "+npjSettings.Position.dynPositionY+"px, 0px) scale3d("+npjSettings.Zoom.dynScale+","+npjSettings.Zoom.dynScale+", "+npjSettings.Zoom.dynScale+" )"}}else{npjSettings.Zoom.dynScale=npjSettings.Zoom.MaxZoom}}}function npjZommingEnd(){if(npjSettings.Zoom.isZoomed&&npjSettings.Zoom.isZooming){npjSettings.Zoom.totScale=npjSettings.Zoom.dynScale;npjSettings.Position.totPositionX=npjSettings.Position.dynPositionX;npjSettings.Position.totPositionY=npjSettings.Position.dynPositionY;npjSettings.Zoom.isZooming=false;npjZoomReposition();$("#npjZoomA").fadeIn();if(npjSettings.Zoom.totScale<=npjSettings.Zoom.MinZoom){npj_tz_currentOffsetX=0;npj_tz_currentOffsetY=0;var a=document.getElementById("npjZoom");a.style.webkitTransform="translate3d("+0+"px, "+0+"px, 0px) scale3d("+1+","+1+", "+1+" )";$("#npjSlide"+npjSettings.Slide.currentSlide).append($("#npjTable"+npjSettings.Slide.currentPage));$("#npjTableA"+npjSettings.Slide.currentPage).remove();$("#npjZoom").hide().delay(300,function(){$("#npjZoomA").fadeOut();npjSettings.Zoom.ZoomedOnce=0;npjSettings.Zoom.isZoomed=false})}npjSettings.Zoom.AddScale=0}}function npjZoomReposition(){document.getElementById("npjZoomA").style.webkitTransform="translate3d("+npjSettings.Position.totPositionX+"px, "+npjSettings.Position.totPositionY+"px, 0px) scale3d("+1+","+1+", "+1+" )";$("#npjZoomA").css({width:(npjSettings.Reader.Width*npjSettings.Zoom.totScale)+"px",height:(npjSettings.Reader.Height*npjSettings.Zoom.totScale)+"px"});var c=1;var b=npjSettings.Document.Width;var a=npjSettings.Document.Height;if(npjSettings.Document.SplitZoom){c=6;b=npjSettings.Document.Width/2;a=npjSettings.Document.Height/3}for(var d=1;d<=c;d++){$("#"+d+"npjImageA"+npjSettings.Slide.currentPage).width(b*npjSettings.Zoom.totScale);$("#"+d+"npjImageA"+npjSettings.Slide.currentPage).height(a*npjSettings.Zoom.totScale)}if(npjSettings.Reader.isSpread){for(var d=1;d<=c;d++){$("#"+d+"npjImageA"+(npjSettings.Slide.currentPage+1)).width(b*npjSettings.Zoom.totScale);$("#"+d+"npjImageA"+(npjSettings.Slide.currentPage+1)).height(a*npjSettings.Zoom.totScale)}}}function npjZoomAload(){var a=npjSettings.Slide.currentSlide;var e=npjSettings.Slide.currentPage;var c=1;if(npjSettings.Document.SplitZoom){c=6}if(npjSettings.Reader.isSpread&&a<=npjSettings.Reader.Slides){var g='<table id="npjTableA'+e+'" cellpadding="0" cellspacing="0" border="0" style="width:100%; height:100%;"><tr>';g+='<td id="npjTdA'+e+'" style="width:50%; height:100%;" align="right"></td>';g+='<td id="npjTdA'+(e+1)+'" style=" width:50%; height:100%;" align="left"></td>';g+="</tr></table>";$("#npjZoomA").append(g);if(e>0){for(var d=1;d<=c;d++){var b=new Image();b.id=d+"npjImageA"+e;b.css="npjImage";if(npjSettings.Document.SplitZoom){$(b).height(npjSettings.Document.Height).delay(100).attr("src",npjSettings.Document.URL+npjSettings.Document.ID+"/"+npjSettings.Document.ZoomPath+"/"+e+"_"+d+".jpg")}else{$(b).height(npjSettings.Document.Height).delay(100).attr("src",npjSettings.Document.URL+npjSettings.Document.ID+"/"+npjSettings.Document.ZoomPath+"/"+e+".jpg")}$("#npjTdA"+e).append(b);if(d==2||d==4){$("#npjTdA"+e).append("<br/>")}npjZoomReposition()}}if((e+1)<npjSettings.Document.Pages){for(var d=1;d<=c;d++){var f=new Image();f.id=d+"npjImageA"+(e+1);f.css="npjImage";if(npjSettings.Document.SplitZoom){$(f).height(npjSettings.Document.Height).delay(100).attr("src",npjSettings.Document.URL+npjSettings.Document.ID+"/"+npjSettings.Document.ZoomPath+"/"+(e+1)+"_"+d+".jpg")}else{$(f).height(npjSettings.Document.Height).delay(100).attr("src",npjSettings.Document.URL+npjSettings.Document.ID+"/"+npjSettings.Document.ZoomPath+"/"+(e+1)+".jpg")}$("#npjTdA"+(e+1)).append(f);if(d==2||d==4){$("#npjTdA"+(e+1)).append("<br/>")}npjZoomReposition()}}}else{if(!npjSettings.Reader.isSpread&&a<=npjSettings.Reader.Slides){var g='<table id="npjTableA'+e+'" cellpadding="0" cellspacing="0" border="0" style="width:100%; height:100%;"><tr>';g+='<td id="npjTdA'+e+'" style="width:100%; height:100%;" align="center"></td>';g+="</tr></table>";$("#npjZoomA").append(g);for(var d=1;d<=6;d++){var b=new Image();b.id=d+"npjImageA"+e;b.css="npjImage";if(npjSettings.Document.SplitZoom){$(b).height(npjSettings.Document.Height).delay(100).attr("src",npjSettings.Document.URL+npjSettings.Document.ID+"/"+npjSettings.Document.ZoomPath+"/"+e+"_"+d+".jpg")}else{$(b).height(npjSettings.Document.Height).delay(100).attr("src",npjSettings.Document.URL+npjSettings.Document.ID+"/"+npjSettings.Document.ZoomPath+"/"+e+".jpg")}$("#npjTdA"+e).append(b)}npjZoomReposition()}}}function npjPagingStart(){npjSettings.Pointers.Fingers=1}function npjPaging(c,b,a){npjSettings.Slide.isSliding=true;if(npjSettings.Slide.isSliding&&!npjSettings.Zoom.isZoomed){if(c){npjSettings.Slide.currentSwitch=($("#npjReader").width()*(npjSettings.Slide.currentSlide))+(b);$("#npjSlidesWrap").scrollTo(npjSettings.Slide.currentSwitch,{queue:false})}else{if(npjSettings.Slide.currentSlide>0){if(b<0){npjSettings.Slide.currentSwitch=($("#npjReader").width()*(npjSettings.Slide.currentSlide))+((b))}else{npjSettings.Slide.currentSwitch=($("#npjReader").width()*(npjSettings.Slide.currentSlide))-((b))}$("#npjSlidesWrap").scrollTo(npjSettings.Slide.currentSwitch,{queue:false})}}}}function npjPagingEnd(){if(npjSettings.Slide.isSliding&&!npjSettings.Zoom.isZoomed&&npjSettings.Pointers.Fingers==1){var a=($("#npjReader").width()*(npjSettings.Slide.currentSlide));if(npjSettings.Slide.currentSwitch>(a+80)&&npjSettings.Slide.currentPage!=npjSettings.Document.Pages){if(npjSettings.Slide.currentSlide<npjSettings.Reader.Slides){npjSettings.Slide.currentPage++;if(npjSettings.Reader.isSpread){npjSettings.Slide.currentPage++}npjSettings.Slide.currentSlide++;$("#npjSlidesWrap").scrollTo(($("#npjReader").width()*(npjSettings.Slide.currentSlide)),500,{queue:false}).delay(100,function(){npjSlideAnimateComplete()})}}else{if(npjSettings.Slide.currentSwitch<(a-80)&&npjSettings.Slide.currentPage!=0){if(npjSettings.Slide.currentSlide>0){npjSettings.Slide.currentPage--;if(npjSettings.Reader.isSpread){npjSettings.Slide.currentPage--}npjSettings.Slide.currentSlide--;$("#npjSlidesWrap").scrollTo(($("#npjReader").width()*(npjSettings.Slide.currentSlide)),500,{queue:false}).delay(100,function(){npjSlideAnimateComplete()})}}else{$("#npjSlidesWrap").scrollTo((($("#npjReader").width()*(npjSettings.Slide.currentSlide))),500,{queue:false})}}}npjSettings.Slide.isSliding=false}function npjSlideAnimateComplete(){npjImagePreLoad(npjSettings.Slide.currentSlideLoad,npjSettings.Slide.currentPageLoad);npjSettings.Slide.currentPageLoad++;if(npjSettings.Reader.isSpread){npjSettings.Slide.currentPageLoad++}npjSettings.Slide.currentSlideLoad++}function npjSlideCreate(a){var b='<div id="npjSlide'+a+'" style="height:'+npjSettings.Reader.ContentHeight+"px; width:"+npjSettings.Reader.Width+'px; " class="npjPage"></div>';$("#npjContent").append(b)}function npjImagePreLoad(a,c){if(npjSettings.Reader.isSpread&&a<=npjSettings.Reader.Slides){var f='<table id="npjTable'+c+'" cellpadding="0" cellspacing="0" border="0" style="width:100%; height:100%;"><tr>';var e='class="npjTdItem"';if(c==0||c==npjSettings.Document.Pages){e=""}f+="<td "+e+' id="npjTd'+c+'" style="width:50%; height:100%;" align="right"></td>';var e='class="npjTdItem"';if((c+1)==0||(c+1)>npjSettings.Document.Pages){e=""}f+="<td "+e+' id="npjTd'+(c+1)+'" style="width:50%; height:100%;" align="left"></td>';f+="</tr></table>";$("#npjSlide"+a).append(f);if(c>0){var b=new Image();b.id="npjImage"+c;b.css="npjImage";$("#npjTd"+c).append(b);$("#npjImage"+c).height(npjSettings.Document.Height).delay(100).attr("src",npjSettings.Document.URL+npjSettings.Document.ID+"/"+npjSettings.Document.ImagePath+"/"+c+".jpg")}if((c+1)<npjSettings.Document.Pages){var d=new Image();d.id="npjImage"+(c+1);d.css="npjImage";$("#npjTd"+(c+1)).append(d);$("#npjImage"+(c+1)).height(npjSettings.Document.Height).delay(100).attr("src",npjSettings.Document.URL+npjSettings.Document.ID+"/"+npjSettings.Document.ImagePath+"/"+(c+1)+".jpg")}}else{if(!npjSettings.Reader.isSpread&&a<=npjSettings.Reader.Slides){var f='<table id="npjTable'+c+'" cellpadding="0" cellspacing="0" border="0" style="width:100%; height:100%;"><tr>';var e='class="npjTdItem"';if(c==0||c==npjSettings.Document.Pages){e=""}f+="<td "+e+' id="npjTd'+c+'" style="width:100%; height:100%;" align="center"></td>';f+="</tr></table>";$("#npjSlide"+a).append(f);if(c>0){var b=new Image();b.id="npjImage"+c;b.css="npjImage";$("#npjTd"+c).append(b);$("#npjImage"+c).height(npjSettings.Document.Height).delay(100).attr("src",npjSettings.Document.URL+npjSettings.Document.ID+"/"+npjSettings.Document.ImagePath+"/"+c+".jpg")}}}}(function(a){a.fn.npjTouch=function(){var e={wipeLeft:function(o,n){npjPaging(true,o,n)},wipeRight:function(o,n){npjPaging(false,o,n)},wipeStart:function(){npjPagingStart()},wipeEnd:function(){npjPagingEnd()},gestureEnd:function(){npjZommingEnd()},doubleTap:function(){npjDoubleClick()},gestureChange:function(o,n){npjZooming(o,n)},gestureStart:function(){npjZoomingStart()},ZoomMovement:function(o,n){npjZoomMovement(true,true,o,n)},ZoomMovementStart:function(){npjZoomMovementStart()},ZoomMovementEnd:function(){npjZoomMovementEnd()},preventDefaultEvents:true};var i=0;var h=0;function b(q){if(e.preventDefaultEvents){q.preventDefault()}if(q.touches.length<=1){var n=q.touches[0].pageX;var r=q.touches[0].pageY;var p=i-n;var o=h-r;if(npjSettings.Zoom.isZoomed){e.ZoomMovement(p,o)}else{if(p>0){e.wipeLeft(p,o)}else{e.wipeRight(p,o)}}}}var j=null;function g(o){if(e.preventDefaultEvents){o.preventDefault()}if(o.touches.length==1){if(j!=null){var p=i;var n=h;i=o.touches[0].pageX;h=o.touches[0].pageY;npjSettings.Pointers.currentX=i;npjSettings.Pointers.currentY=h;if((new Date()-j)<400&&i<=(p+20)&&i>=(p-20)&&h<=(n+20)&&h>=(n-20)){e.doubleTap()}else{j=new Date();if(npjSettings.Zoom.isZoomed){e.ZoomMovementStart()}else{e.wipeStart(true)}}}else{j=new Date();i=o.touches[0].pageX;h=o.touches[0].pageY;npjSettings.Pointers.currentX=o.touches[0].pageX;npjSettings.Pointers.currentY=o.touches[0].pageY;if(npjSettings.Zoom.isZoomed){e.ZoomMovementStart()}else{e.wipeStart(true)}}}else{if(o.touches.length==2){if(o.touches[0].pageX>o.touches[1].pageX){npjSettings.Pointers.currentX=o.touches[1].pageX+((o.touches[0].pageX-o.touches[1].pageX)/2)}else{npjSettings.Pointers.currentX=o.touches[0].pageX+((o.touches[1].pageX-o.touches[0].pageX)/2)}if(o.touches[0].pageY>o.touches[1].pageY){npjSettings.Pointers.currentY=o.touches[1].pageY+((o.touches[0].pageY-o.touches[1].pageY)/2)}else{npjSettings.Pointers.currentY=o.touches[0].pageY+((o.touches[1].pageY-o.touches[0].pageY)/2)}}}}function f(n){if(npjSettings.Zoom.isZoomed){e.ZoomMovementEnd()}else{e.wipeEnd()}}function l(n){if(npjSettings.Zoom.isZoomed){e.ZoomMovementEnd()}else{e.wipeEnd()}}function d(n){e.gestureStart()}function c(n){n.preventDefault();e.gestureChange(n.scale,false)}function k(n){e.gestureEnd()}var m=document.getElementById("npjReader");m.addEventListener("touchstart",g,false);m.addEventListener("touchmove",b,false);m.addEventListener("touchcancel",f,false);m.addEventListener("touchend",l,false);if(npjSettings.User.RunMultiTouch){m.addEventListener("gesturestart",d,false);m.addEventListener("gesturechange",c,false);m.addEventListener("gestureend",k,false)}return this}})(jQuery);
