
// 'stacks' is the Stacks global object.
// All of the other Stacks related Javascript will 
// be attatched to it.
var stacks = {};


// this call to jQuery gives us access to the globaal
// jQuery object. 
// 'noConflict' removes the '$' variable.
// 'true' removes the 'jQuery' variable.
// removing these globals reduces conflicts with other 
// jQuery versions that might be running on this page.
stacks.jQuery = jQuery.noConflict(true);

// Javascript for stacks_in_10_page0
// ---------------------------------------------------------------------

// Each stack has its own object with its own namespace.  The name of
// that object is the same as the stack's id.
stacks.stacks_in_10_page0 = {};

// A closure is defined and assined to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for refering
// to this object from elsewhere.
stacks.stacks_in_10_page0 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
// Styled Stack v1.3.0 by Joe Workman
$(document).ready(function() {	
	var custom_bg_src = $("#custom_bg_stacks_in_10_page0 img").attr("src");
	if (custom_bg_src) { 
	    $("#stacks_in_10_page0").css({'background-image':'url(' + custom_bg_src + ')'});	
	}
	else {
	    var bg_src = 'index_files/styled-stack-images/stack-bg0.png';
    	if (0 != 0) { $("#stacks_in_10_page0").css({'background-image':'url(' + bg_src + ')'}); }
	}
});
// End Styled Stack

	return stack;
})(stacks.stacks_in_10_page0);


// Javascript for stacks_in_16_page0
// ---------------------------------------------------------------------

// Each stack has its own object with its own namespace.  The name of
// that object is the same as the stack's id.
stacks.stacks_in_16_page0 = {};

// A closure is defined and assined to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for refering
// to this object from elsewhere.
stacks.stacks_in_16_page0 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
/*
 * jQuery Color Animations
 * Copyright 2007 John Resig
 * Released under the MIT and GPL licenses.
 *
 * RGBA support by Mehdi Kabab <http://pioupioum.fr>
 */

(function(jQuery){
    jQuery.extend(jQuery.support, {
        "rgba": supportsRGBA()
    });

    // We override the animation for all of these color styles
    jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){
        jQuery.fx.step[attr] = function(fx){
            var tuples = [];
            if ( !fx.colorInit ) {
                fx.start = getColor( fx.elem, attr );
                fx.end = getRGB( fx.end );
                fx.alphavalue = {
                    start: 4 === fx.start.length,
                    end:   4 === fx.end.length
                };
                if ( !fx.alphavalue.start ) {
                    fx.start.push( 1 );
                }
                if ( !fx.alphavalue.end ) {
                    fx.end.push( 1 );
                }
                if ( jQuery.support.rgba &&
                     (!fx.alphavalue.start && fx.alphavalue.end) || // RGB => RGBA
                     (fx.alphavalue.start && fx.alphavalue.end)  || // RGBA => RGBA
                     (fx.alphavalue.start && !fx.alphavalue.end)    // RGBA => RGB
                ) {
                    fx.colorModel = 'rgba';
                } else {
                    fx.colorModel = 'rgb';
                }
                fx.colorInit = true;
            }

            tuples.push( Math.max(Math.min( parseInt( (fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0) ); // R
            tuples.push( Math.max(Math.min( parseInt( (fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0) ); // G
            tuples.push( Math.max(Math.min( parseInt( (fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0) ); // B

            if ( fx.colorModel == 'rgba' ) {
                // Alpha
                tuples.push( Math.max(Math.min( parseFloat((fx.pos * (fx.end[3] - fx.start[3])) + fx.start[3]), 1), 0).toFixed(2) );
            }

            fx.elem.style[attr] = fx.colorModel + "(" + tuples.join(",") + ")";
        };
    });

    // Color Conversion functions from highlightFade
    // By Blair Mitchelmore
    // http://jquery.offput.ca/highlightFade/

    // Parse strings looking for color tuples [255,255,255[,1]]
    function getRGB(color) {
        var result, ret,
            ralpha = '(?:,\\s*((?:1|0)(?:\\.0+)?|(?:0?\\.[0-9]+))\\s*)?\\)',
            rrgbdecimal = new RegExp( 'rgb(a)?\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*' + ralpha ),
            rrgbpercent = new RegExp( 'rgb(a)?\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*' + ralpha );

        // Check if we're already dealing with an array of colors
        if ( color && color.constructor == Array && color.length >= 3 && color.length <= 4 ) {
            return color;
        }

        // Look for #a0b1c2
        if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color)) {
            return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];
        }

        // Look for #fff
        if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color)) {
            return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];
        }

        // Look for rgb[a](num,num,num[,num])
        if (result = rrgbdecimal.exec(color)) {
            ret = [parseInt(result[2]), parseInt(result[3]), parseInt(result[4])];
            // is rgba?
            if (result[1] && result[5]) {
                ret.push(parseFloat(result[5]));
            }

            return ret;
        }

        // Look for rgb[a](num%,num%,num%[,num])
        if (result = rrgbpercent.exec(color)) {
            ret = [parseFloat(result[2]) * 2.55, parseFloat(result[3]) * 2.55, parseFloat(result[4]) * 2.55];
            // is rgba?
            if (result[1] && result[5]) {
                ret.push(parseFloat(result[5]));
            }

            return ret;
        }

        // Otherwise, we're most likely dealing with a named color
        return colors[jQuery.trim(color).toLowerCase()];
    }

    function getColor(elem, attr) {
        var color;

        do {
            color = jQuery.curCSS(elem, attr);

            // Keep going until we find an element that has color, or we hit the body
            if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") )
                break;

            attr = "backgroundColor";
        } while ( elem = elem.parentNode );

        return getRGB(color);
    };

    function supportsRGBA() {
        var $script = jQuery('script:first'),
            color = $script.css('color'),
            result = false;
        if (/^rgba/.test(color)) {
                result = true;
        } else {
            try {
                result = ( color != $script.css('color', 'rgba(0, 0, 0, 0.5)').css('color') );
                $script.css('color', color);
            } catch (e) {};
        }

        return result;
    };

    // Some named colors to work with
    // From Interface by Stefan Petre
    // http://interface.eyecon.ro/

    var colors = {
        aqua:[0,255,255],
        azure:[240,255,255],
        beige:[245,245,220],
        black:[0,0,0],
        blue:[0,0,255],
        brown:[165,42,42],
        cyan:[0,255,255],
        darkblue:[0,0,139],
        darkcyan:[0,139,139],
        darkgrey:[169,169,169],
        darkgreen:[0,100,0],
        darkkhaki:[189,183,107],
        darkmagenta:[139,0,139],
        darkolivegreen:[85,107,47],
        darkorange:[255,140,0],
        darkorchid:[153,50,204],
        darkred:[139,0,0],
        darksalmon:[233,150,122],
        darkviolet:[148,0,211],
        fuchsia:[255,0,255],
        gold:[255,215,0],
        green:[0,128,0],
        indigo:[75,0,130],
        khaki:[240,230,140],
        lightblue:[173,216,230],
        lightcyan:[224,255,255],
        lightgreen:[144,238,144],
        lightgrey:[211,211,211],
        lightpink:[255,182,193],
        lightyellow:[255,255,224],
        lime:[0,255,0],
        magenta:[255,0,255],
        maroon:[128,0,0],
        navy:[0,0,128],
        olive:[128,128,0],
        orange:[255,165,0],
        pink:[255,192,203],
        purple:[128,0,128],
        violet:[128,0,128],
        red:[255,0,0],
        silver:[192,192,192],
        white:[255,255,255],
        yellow:[255,255,0],
        transparent: ( jQuery.support.rgba ) ? [0,0,0,0] : [255,255,255]
    };

})(jQuery);

function HexToR(h) {return parseInt((cutHex(h)).substring(0,2),16)}
function HexToG(h) {return parseInt((cutHex(h)).substring(2,4),16)}
function HexToB(h) {return parseInt((cutHex(h)).substring(4,6),16)}
function cutHex(h) {return (h.charAt(0)=="#") ? h.substring(1,7):h}
function opaHex(o) {
	var i = Math.floor(0.8 * 255);
	return i.toString(16);
	
}

$(document).ready(function(){
	$('#stacks_in_16_page0 .transbox').css('background','rgb('+HexToR('9AD0FF')+', '+HexToG('9AD0FF')+', '+HexToB('9AD0FF')+')');
	$('#stacks_in_16_page0 .transbox').css('background','rgba('+HexToR('9AD0FF')+', '+HexToG('9AD0FF')+', '+HexToB('9AD0FF')+', 0.8)');  
	if ( $.browser.msie && parseInt($.browser.version, 10) < 9) {
		var ho = opaHex(0.8);
		$('#stacks_in_16_page0 .transbox').css('filter', 'progid:DXImageTransform.Microsoft.gradient(startColorstr=#'+ho+'9AD0FF, endColorstr=#'+ho+'9AD0FF)');  
		$('#stacks_in_16_page0 .transbox').css('-ms-filter', 'progid:DXImageTransform.Microsoft.gradient(startColorstr=#'+ho+'9AD0FF, endColorstr=#'+ho+'9AD0FF)');
	}
	if(false){
		$('#stacks_in_16_page0 .transbox').addClass('shadow');
	}

	if(false){
		$('#stacks_in_16_page0 .transbox').mouseenter(function(){
			$(this).animate({ "backgroundColor": 'rgba('+HexToR('9AD0FF')+', '+HexToG('9AD0FF')+', '+HexToB('9AD0FF')+', 1.0)' }, 250);
			if(false){
				$(this).addClass('shadow');
			}
			else{
				$(this).removeClass('shadow');
			}
		});
	
		$('#stacks_in_16_page0 .transbox').mouseleave(function(){
			$(this).animate({ "backgroundColor": 'rgba('+HexToR('9AD0FF')+', '+HexToG('9AD0FF')+', '+HexToB('9AD0FF')+', 0.8)' }, 250);
			if ( $.browser.msie && parseInt($.browser.version, 10) < 9) {
				$(this).css('filter', 'progid:DXImageTransform.Microsoft.gradient(startColorstr=#'+opaHex(0.8)+'9AD0FF, endColorstr=#889AD0FF)');  
				$(this).css('-ms-filter', 'progid:DXImageTransform.Microsoft.gradient(startColorstr=#'+opaHex(0.8)+'9AD0FF, endColorstr=#889AD0FF)');
			}
			if(false){
				$(this).addClass('shadow');
			}
			else{
				$(this).removeClass('shadow');
			}			
		});
	}
	
});
	return stack;
})(stacks.stacks_in_16_page0);


// Javascript for stacks_in_22_page0
// ---------------------------------------------------------------------

// Each stack has its own object with its own namespace.  The name of
// that object is the same as the stack's id.
stacks.stacks_in_22_page0 = {};

// A closure is defined and assined to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for refering
// to this object from elsewhere.
stacks.stacks_in_22_page0 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
/*
 * 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. 
 *
*/

jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){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}});

/*
 * jQuery viewbook plugin
 * Copyright (c) 2010 W. Grauvogel (http://builtbywill.com/)
 *
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Version : 1.0.1
 *
 * Originally based on the work of:
 *	1) Charles Mangin (http://clickheredammit.com/pageflip/)
 */
(function(d){function U(c,e,f){var b,a,i,s,j,k,h=[],D=[],l=[],G=[],m=[],n=[],t=[],M=[],H,E,I,J,F,N,u,o,v,K,p,w,O,q,r,x,y,z,A,B,P,Q,C,R,S;k=false;b=this;b.options=e;b.id=f;b.hash="";a=b.options;c=c.addClass("viewbook");c.find(".vb-load").children().each(function(g){h[g]=d(this);l[g]=d(this).attr("rel")?d(this).attr("rel"):"";D[g]=d(this).attr("title");G[g]=d(this).attr("class")});if(h.length%2!=0){h[h.length]='<div class="vb-page-blank"></div>';l[h.length]="";D[h.length]="";G[h.length]=""}c.data("viewbook",
true);c.data("id",f);c.data("total",h.length);c.prepend('<div class="vb-pN vb-page"><div class="vb-p-wrap"></div></div><div class="vb-p1 vb-page"><div class="vb-p-wrap"></div></div><div class="vb-p4 vb-page"><div class="vb-p-wrap"></div></div><div class="vb-p2 vb-page"><div class="vb-p-wrap"></div></div><div class="vb-p3 vb-page"><div class="vb-p-wrap"></div></div><div class="vb-p0 vb-page"><div class="vb-p-wrap"></div></div><div class="vb-overlay vb-overlay-prev vb-prev" title="'+a.prevText+'"></div><div class="vb-overlay vb-overlay-next vb-next" title="'+
a.nextText+'"></div>');H=c.find(".vb-pN");E=c.find(".vb-p0");I=c.find(".vb-p1");J=c.find(".vb-p2");F=c.find(".vb-p3");N=c.find(".vb-p4");u=c.find(".vb-pN .vb-p-wrap");o=c.find(".vb-p0 .vb-p-wrap");v=c.find(".vb-p1 .vb-p-wrap");K=c.find(".vb-p2 .vb-p-wrap");p=c.find(".vb-p3 .vb-p-wrap");w=c.find(".vb-p4 .vb-p-wrap");O=c.find(".vb-p-wrap");q=r=null;c.find(".vb-overlay-next");c.find(".vb-overlay-prev");f=c.find(".vb-overlay");if(a.shadows){q=d('<div class="vb-shadow-f"></div>').appendTo(F);r=d('<div class="vb-shadow-b"></div>').appendTo(E)}if(!a.width)a.width=
c.width();if(!a.height)a.height=c.height();c.width(a.width);c.height(a.height);a.pWidth=a.width/2;a.pWidthN="-"+a.width/2+"px";a.pWidthH=a.width/4;a.pHeight=a.height;a.pTotal=h.length;a.speedH=a.speed/2;if(a.direction=="RTL"){s=0;for(e=a.pTotal-1;e>=0;e--){m[s]=h[e];t[s]=l[e];n[s]=D[e];M[s]=G[e];s++}h=m;l=t;D=n;G=M}if(a.direction=="LTR")a.curr=0;else if(a.direction=="RTL")a.curr=a.pTotal-2;if(!isNaN(a.startingPage)&&a.startingPage<=a.pTotal&&a.startingPage>0){a.startingPage%2!=0&&a.startingPage--;
a.curr=a.startingPage}if(a.name)document.title=a.name;else a.name=document.title;if(a.shadows){a.shadowTopFwdWidth="-"+a.shadowTopFwdWidth+"px";a.shadowTopBackWidth="-"+a.shadowTopBackWidth+"px"}if(a.menu){m=d(a.menu).addClass("vb-menu");if(a.pageSelector){n=d('<div class="vb-selector vb-selector-page"><span class="vb-current">'+(a.curr+1)+"-"+(a.curr+2)+"</span></div>").appendTo(m);B=d("<ul></ul>").appendTo(n).empty().css("height","auto");for(e=0;e<a.pTotal;e+=2){t=d('<li><a href="#/page/'+(e+1)+
'" id="selector-page-'+e+'"><span class="vb-text">'+D[e]+'</span><span class="vb-num">'+(e+1)+" - "+(e+2)+"</span></a></li>").appendTo(B);t=t.find("a");a.hash||t.click(function(){Q=parseInt(d(this).attr("id").replace("selector-page-",""));b.gotoPage(Q);return false})}P=B.height();B.css({height:0,"padding-bottom":0});n.unbind("hover").hover(function(){B.stop().animate({height:P,paddingBottom:10},500)},function(){B.stop().animate({height:0,paddingBottom:0},500)})}if(a.chapterSelector){e=l[a.curr];if(e==
"")e=l[a.curr+1];m=d('<div class="vb-selector vb-selector-chapter"><span class="vb-current">'+e+"</span></div>").appendTo(m);C=d("<ul></ul>").appendTo(m).empty().css("height","auto");for(e=0;e<a.pTotal;e+=1)if(l[e]!=""){n=d('<li><a href="#/page/'+(e+1)+'" id="selector-page-'+e+'"><span class="vb-text">'+l[e]+"</span></a></li>").appendTo(C);n=n.find("a");a.hash||n.click(function(){S=parseInt(d(this).attr("id").replace("selector-page-",""));b.gotoPage(S);return false})}R=C.height();C.css({height:0,
"padding-bottom":0});m.unbind("hover").hover(function(){C.stop().animate({height:R,paddingBottom:10},500)},function(){C.stop().animate({height:0,paddingBottom:0},500)})}}d.extend(b,{next:function(){if(a.curr+2<a.pTotal&&!k){k=true;a.curr+=2;a.before.call(b);b.updatePager();b.updateCtrls();L(a.curr+1,a);J.animate({width:0},a.speedH,a.easeIn);if(a.shadows)d.support.opacity?q.animate({opacity:1},a.speedH,a.easeIn).animate({opacity:0},a.speedH,a.easeOut):q.animate({right:a.shadowTopFwdWidth},a.speed,
a.easeIn);F.animate({left:a.pWidthH,width:a.pWidthH,paddingLeft:a.shadowBtmWidth},a.speedH,a.easeIn).animate({left:0,width:a.pWidth,paddingLeft:0},a.speedH);p.animate({left:a.shadowBtmWidth},a.speedH,a.easeIn).animate({left:0},a.speedH,a.easeOut,function(){b.resetPages();b.updatePager();b.updateCtrls();a.after.call(b);k=false})}},prev:function(){if(a.curr-2>=0&&!k){k=true;a.curr-=2;a.before.call(b);b.updatePager();b.updateCtrls();L(a.curr+1,a);H.show();I.animate({left:a.pWidth,width:0},a.speed,a.easing);
v.animate({left:a.pWidthN},a.speed,a.easing);if(a.shadows)d.support.opacity?r.animate({opacity:1},a.speedH,a.easeIn).animate({opacity:0},a.speedH,a.easeOut):r.animate({left:a.shadowTopBackWidth},a.speed,a.easeIn);E.animate({left:a.pWidthH,width:a.pWidthH},a.speedH,a.easeIn).animate({left:a.pWidth,width:a.pWidth},a.speedH,a.easeOut);o.animate({right:a.shadowBtmWidth},a.speedH,a.easeIn).animate({right:0},a.speedH,a.easeOut,function(){b.resetPages();b.updatePager();b.updateCtrls();a.after.call(b);k=
false})}},gotoPage:function(g){if(g>a.curr&&g<a.pTotal&&g>=0&&!k){k=true;a.curr=g;a.before.call(b);b.updatePager();b.updateCtrls();p.html(h[a.curr]);w.html(h[a.curr+1]);if(a.pageNumbers){p.append('<div class="vb-counter">'+(a.curr+1)+"</div>");w.append('<div class="vb-counter">'+(a.curr+2)+"</div>")}J.animate({width:0},a.speedH,a.easeIn);if(a.shadows)d.support.opacity?q.animate({opacity:1},a.speedH,a.easeIn).animate({opacity:0},a.speedH,a.easeOut):q.animate({right:a.shadowTopFwdWidth},a.speed,a.easeIn);
F.animate({left:a.pWidthH,width:a.pWidthH,paddingLeft:a.shadowBtmWidth},a.speedH,a.easeIn).animate({left:0,width:a.pWidth,paddingLeft:0},a.speedH);p.animate({left:a.shadowBtmWidth},a.speedH,a.easeIn).animate({left:0},a.speedH,a.easeOut,function(){b.resetPages();b.updatePager();b.updateCtrls();a.after.call(b);k=false})}else if(g<a.curr&&g<a.pTotal&&g>=0&&!k){k=true;a.curr=g;a.before.call(b);b.updatePager();b.updateCtrls();u.html(h[a.curr]);o.html(h[a.curr+1]);if(a.pageNumbers){u.append('<div class="vb-counter">'+
(a.curr+1)+"</div>");o.append('<div class="vb-counter">'+(a.curr+2)+"</div>")}H.show();I.animate({left:a.pWidth,width:0},a.speed,a.easing);v.animate({left:a.pWidthN},a.speed,a.easing);if(a.shadows)d.support.opacity?r.animate({opacity:1},a.speedH,a.easeIn).animate({opacity:0},a.speedH,a.easeOut):r.animate({left:a.shadowTopBackWidth},a.speed,a.easeIn);E.animate({left:a.pWidthH,width:a.pWidthH},a.speedH,a.easeIn).animate({left:a.pWidth,width:a.pWidth},a.speedH,a.easeOut);o.animate({right:a.shadowBtmWidth},
a.speedH,a.easeIn).animate({right:0},a.speedH,a.easeOut,function(){b.resetPages();b.updatePager();b.updateCtrls();a.after.call(b);k=false})}},resetPages:function(){O.css({width:a.pWidth-20,height:a.pHeight-20});v.html(h[a.curr]).css({left:0,opacity:1});I.css({left:0,width:a.pWidth,height:a.pHeight});K.html(h[a.curr+1]);J.css({left:a.pWidth,width:a.pWidth,opacity:1,height:a.pHeight});u.html(h[a.curr-2]);H.css({left:0,width:a.pWidth,height:a.pHeight}).hide();o.html(h[a.curr-1]);E.css({left:0,width:0,
height:a.pHeight});p.html(h[a.curr+2]);F.css({left:a.pWidth*2,width:0,height:a.pHeight});w.html(h[a.curr+3]);N.css({left:a.pWidth,width:a.pWidth,height:a.pHeight});if(a.shadows){q.css({right:0,width:a.pWidth,height:a.pHeight});r.css({left:0,width:a.pWidth,height:a.pHeight})}if(a.pageNumbers){j=a.curr+1;u.append('<div class="vb-counter">'+(j-2)+"</div>");o.append('<div class="vb-counter">'+(j-1)+"</div>");v.append('<div class="vb-counter">'+j+"</div>");K.append('<div class="vb-counter">'+(j+1)+"</div>");
p.append('<div class="vb-counter">'+(j+2)+"</div>");w.append('<div class="vb-counter">'+(j+3)+"</div>");if(a.direction=="RTL"){d(".vb-counter").remove();j=Math.abs(a.pTotal-1-a.curr);u.append('<div class="vb-counter">'+(j+3)+"</div>");o.append('<div class="vb-counter">'+(j+2)+"</div>");v.append('<div class="vb-counter">'+(j+1)+"</div>");K.append('<div class="vb-counter">'+j+"</div>");p.append('<div class="vb-counter">'+(j-1)+"</div>");w.append('<div class="vb-counter">'+(j-2)+"</div>")}}},updateCtrls:function(){if(a.overlays||
a.tabs||a.arrows){a.curr<a.pTotal-2?z.fadeIn("fast").css("cursor",a.cursor):z.fadeOut("fast").css("cursor","default");a.curr>=2&&a.curr!=0?A.fadeIn("fast").css("cursor",a.cursor):A.fadeOut("fast").css("cursor","default")}},updatePager:function(){a.pageSelector&&d(a.menu+" .vb-selector-page .vb-current").text(a.curr+1+" - "+(a.curr+2));a.chapterSelector&&l[a.curr]!=""&&d(a.menu+" .vb-selector-chapter .vb-current").text(l[a.curr])},setupHash:function(){i=T();if(!isNaN(i)&&i<=a.pTotal-1&&i>=0&&i!=""){i%
2!=0&&i--;a.curr=i}else L(a.curr+1,a);b.hash=i},pollHash:function(){i=T();if(!isNaN(i)&&i<=a.pTotal-1&&i>=0)if(i!=a.curr&&i.toString()!=b.hash){i%2!=0&&i--;document.title=a.name+" - Page "+(i+1);if(!k){b.gotoPage(i);b.hash=i}}}});if(a.next){e=d(a.next);e.click(function(g){g.preventDefault();b.next()})}if(a.prev){e=d(a.prev);e.click(function(g){g.preventDefault();b.prev()})}if(a.overlays)d.browser.msie&&f.css({background:"#fff",filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0) !important"});
else f.remove();if(a.tabs){f=typeof a.prevText=="undefined"?"Previous":a.prevText;e=typeof a.nextText=="undefined"?"Next":a.nextText;c.append('<div class="vb-tab vb-tab-prev vb-prev" title="'+f+'">'+f+"</div>");c.append('<div class="vb-tab vb-tab-next vb-next" title="'+e+'">'+e+"</div>");e=c.find(".vb-tab-next");m=c.find(".vb-tab-prev");f=c.find(".vb-tab");a.tabWidth&&f.width(a.tabWidth);a.tabHeight&&f.height(a.tabHeight);f.css({top:"-"+e.outerHeight()+"px"});c.css({marginTop:e.outerHeight()});if(a.direction==
"RTL"){e.html("Previous").attr("title","Previous Page");m.html("Next").attr("title","Next Page")}}else c.css({marginTop:0});if(a.arrows){c.append('<div class="vb-arrow vb-arrow-prev vb-prev" title="Previous Page"><div>Previous</div></div>');c.append('<div class="vb-arrow vb-arrow-next vb-next" title="Next Page"><div>Next</div></div>');x=c.find(".vb-arrow-next");y=c.find(".vb-arrow-prev");c.find(".vb-arrow");if(a.direction=="RTL"){x.html("<div>Previous</div>").attr("title","Previous Page");y.html("<div>Next</div>").attr("title",
"Next Page")}}z=c.find(".vb-next");A=c.find(".vb-prev");z.click(function(g){g.preventDefault();b.next()});A.click(function(g){g.preventDefault();b.prev()});if(a.arrows)if(d.support.opacity){z.hover(function(){x.find("div").stop().fadeTo("fast",1)},function(){x.find("div").stop().fadeTo("fast",0)});A.hover(function(){y.find("div").stop().fadeTo("fast",1)},function(){y.find("div").stop().fadeTo("fast",0)})}else{z.hover(function(){x.find("div").show()},function(){x.find("div").hide()});A.hover(function(){y.find("div").show()},
function(){y.find("div").hide()})}a.keyboard&&d(document).keyup(function(g){if(g.keyCode==37)b.prev();else g.keyCode==39&&b.next()});if(a.hash){b.setupHash();clearInterval();setInterval(function(){b.pollHash()},250)}b.gotoPage(a.curr)}function T(){var c=window.location.hash.split("/");return c.length>1?parseInt(c[2])-1:""}function L(c,e){if(e.hash)window.location.hash="/page/"+c}d.fn.viewbook=function(c){var e=d.extend({},d.fn.viewbook.defaults,c);return d(this).each(function(){var f,b,a;if(typeof c==
"string"){if(d(this).data("viewbook")){f=c.toLowerCase();b=d.fn.viewbook.interfaces[d(this).data("id")];if(f=="next")b.next();else f=="prev"&&b.prev()}}else if(typeof c=="number"){if(d(this).data("viewbook")){f=c;b=d.fn.viewbook.interfaces[d(this).data("id")];if(f%2!=0)f-=1;b.gotoPage(f)}}else{b=d.extend(true,{},e);f=d.fn.viewbook.interfaces.length;for(a=0;a<f;a++)if(typeof d.fn.viewbook.interfaces[a]=="undefined"){f=a;break}b=new U(d(this),b,f);d.fn.viewbook.interfaces[f]=b;b.resetPages();b.updateCtrls()}})};
d.fn.viewbook.interfaces=[];d.fn.viewbook.defaults={name:null,width:600,height:500,speed:875,direction:"LTR",startingPage:0,easing:"easeInOutQuad",easeIn:"easeInQuad",easeOut:"easeOutQuad",overlays:true,tabs:true,tabWidth:60,tabHeight:20,arrows:false,cursor:"pointer",next:null,nextText:"Next",prev:null,prevText:"Previous",hash:false,keyboard:true,menu:null,pageSelector:false,chapterSelector:false,pageNumbers:true,shadows:true,shadowTopFwdWidth:166,shadowTopBackWidth:166,shadowBtmWidth:50,before:function(){},
after:function(){}}})(jQuery);

// get it going - SymfoniP.com BookViewer Startup
jQuery(document).ready(function($) {
	$('#mybook_stacks_in_22_page0').viewbook({
		width:800,
		height:600,
		nextText:'Next',
		prevText:'Previous',
		tabs:false,
		pageNumbers:true
		});
});


	return stack;
})(stacks.stacks_in_22_page0);



