
// '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_28_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_28_page0 = {};

// A closure is defined and assigned to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for referring
// to this object from elsewhere.
stacks.stacks_in_28_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;
	

/*
 * Slidorion Stack By WeaverAddons.com
 * Version 1.0.0
 *
 * Visit http://weaveraddons.com for more information on how to use this stack in RapidWeaver.
 *
 */

/*
 * 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(e,a,c,b,d){return jQuery.easing[jQuery.easing.def](e,a,c,b,d)},easeInQuad:function(e,a,c,b,d){return b*(a/=d)*a+c},easeOutQuad:function(e,a,c,b,d){return-b*(a/=d)*(a-2)+c},easeInOutQuad:function(e,a,c,b,d){return 1>(a/=d/2)?b/2*a*a+c:-b/2*(--a*(a-2)-1)+c},easeInCubic:function(e,a,c,b,d){return b*(a/=d)*a*a+c},easeOutCubic:function(e,a,c,b,d){return b*((a=a/d-1)*a*a+1)+c},easeInOutCubic:function(e,a,c,b,d){return 1>(a/=d/2)?b/2*a*a*a+c:
b/2*((a-=2)*a*a+2)+c},easeInQuart:function(e,a,c,b,d){return b*(a/=d)*a*a*a+c},easeOutQuart:function(e,a,c,b,d){return-b*((a=a/d-1)*a*a*a-1)+c},easeInOutQuart:function(e,a,c,b,d){return 1>(a/=d/2)?b/2*a*a*a*a+c:-b/2*((a-=2)*a*a*a-2)+c},easeInQuint:function(e,a,c,b,d){return b*(a/=d)*a*a*a*a+c},easeOutQuint:function(e,a,c,b,d){return b*((a=a/d-1)*a*a*a*a+1)+c},easeInOutQuint:function(e,a,c,b,d){return 1>(a/=d/2)?b/2*a*a*a*a*a+c:b/2*((a-=2)*a*a*a*a+2)+c},easeInSine:function(e,a,c,b,d){return-b*Math.cos(a/
d*(Math.PI/2))+b+c},easeOutSine:function(e,a,c,b,d){return b*Math.sin(a/d*(Math.PI/2))+c},easeInOutSine:function(e,a,c,b,d){return-b/2*(Math.cos(Math.PI*a/d)-1)+c},easeInExpo:function(e,a,c,b,d){return 0==a?c:b*Math.pow(2,10*(a/d-1))+c},easeOutExpo:function(e,a,c,b,d){return a==d?c+b:b*(-Math.pow(2,-10*a/d)+1)+c},easeInOutExpo:function(e,a,c,b,d){return 0==a?c:a==d?c+b:1>(a/=d/2)?b/2*Math.pow(2,10*(a-1))+c:b/2*(-Math.pow(2,-10*--a)+2)+c},easeInCirc:function(e,a,c,b,d){return-b*(Math.sqrt(1-(a/=d)*
a)-1)+c},easeOutCirc:function(e,a,c,b,d){return b*Math.sqrt(1-(a=a/d-1)*a)+c},easeInOutCirc:function(e,a,c,b,d){return 1>(a/=d/2)?-b/2*(Math.sqrt(1-a*a)-1)+c:b/2*(Math.sqrt(1-(a-=2)*a)+1)+c},easeInElastic:function(e,a,c,b,d){var e=1.70158,f=0,g=b;if(0==a)return c;if(1==(a/=d))return c+b;f||(f=0.3*d);g<Math.abs(b)?(g=b,e=f/4):e=f/(2*Math.PI)*Math.asin(b/g);return-(g*Math.pow(2,10*(a-=1))*Math.sin((a*d-e)*2*Math.PI/f))+c},easeOutElastic:function(e,a,c,b,d){var e=1.70158,f=0,g=b;if(0==a)return c;if(1==
(a/=d))return c+b;f||(f=0.3*d);g<Math.abs(b)?(g=b,e=f/4):e=f/(2*Math.PI)*Math.asin(b/g);return g*Math.pow(2,-10*a)*Math.sin((a*d-e)*2*Math.PI/f)+b+c},easeInOutElastic:function(e,a,c,b,d){var e=1.70158,f=0,g=b;if(0==a)return c;if(2==(a/=d/2))return c+b;f||(f=d*0.3*1.5);g<Math.abs(b)?(g=b,e=f/4):e=f/(2*Math.PI)*Math.asin(b/g);return 1>a?-0.5*g*Math.pow(2,10*(a-=1))*Math.sin((a*d-e)*2*Math.PI/f)+c:0.5*g*Math.pow(2,-10*(a-=1))*Math.sin((a*d-e)*2*Math.PI/f)+b+c},easeInBack:function(e,a,c,b,d,f){void 0==
f&&(f=1.70158);return b*(a/=d)*a*((f+1)*a-f)+c},easeOutBack:function(e,a,c,b,d,f){void 0==f&&(f=1.70158);return b*((a=a/d-1)*a*((f+1)*a+f)+1)+c},easeInOutBack:function(e,a,c,b,d,f){void 0==f&&(f=1.70158);return 1>(a/=d/2)?b/2*a*a*(((f*=1.525)+1)*a-f)+c:b/2*((a-=2)*a*(((f*=1.525)+1)*a+f)+2)+c},easeInBounce:function(e,a,c,b,d){return b-jQuery.easing.easeOutBounce(e,d-a,0,b,d)+c},easeOutBounce:function(e,a,c,b,d){return(a/=d)<1/2.75?b*7.5625*a*a+c:a<2/2.75?b*(7.5625*(a-=1.5/2.75)*a+0.75)+c:a<2.5/2.75?
b*(7.5625*(a-=2.25/2.75)*a+0.9375)+c:b*(7.5625*(a-=2.625/2.75)*a+0.984375)+c},easeInOutBounce:function(e,a,c,b,d){return a<d/2?0.5*jQuery.easing.easeInBounce(e,2*a,0,b,d)+c:0.5*jQuery.easing.easeOutBounce(e,2*a-d,0,b,d)+0.5*b+c}});


/*
 *
 * 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. 
 *
 */


/*
* Slidorion, An Image Slider and Accordion Combined
* Intructions: http://www.slidorion.com
* Created by Ben Holland - http://www.ben-holland.co.uk
* Version: 0.94
* Copyright 2011 Ben Holland <benholland99@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
(function(b){b.fn.extend({slidorion:function(p){p=b.extend({autoPlay:!0,easing:"",effect:"fade",first:"section1",interval:7E3,hoverPause:!1,speed:1E3},p);return this.each(function(){function q(){$objHeader=b(this,a);j=b(this,a).attr("rel");if(j==g)return!1;$objHeader.parent().next().is(":hidden")&&(b(".slider-link.active",a).removeClass("active").parent().next().slideUp(),$objHeader.addClass("active").parent().next().slideDown());var c=g,h=j,d=l,f=m,e=n;"none"==e&&(e="");if(!x&&w)switch(r&&y(),$current=
b('.slider-image[rel="'+c+'"] img',a),$new=b('.slider-image[rel="'+h+'"] img',a),c=$current.outerWidth(),h=$current.outerHeight(),"random"==d&&(d="fade,slideLeft,slideRight,slideUp,slideDown,overLeft,overRight,overUp,overDown".split(","),d=d[Math.floor(Math.random()*d.length)]),d){case "fade":$new.css({"z-index":i,display:"none"}).fadeIn(f);break;case "slideLeft":$new.css({left:c,opacity:"1"});$current.animate({left:"-="+c,top:"0",opacity:"1"},{queue:!0,duration:f,easing:e});$new.animate({left:"-="+
c,top:"0",opacity:"1"},{queue:!0,duration:f,easing:e});break;case "slideRight":$new.css({left:"-"+c+"px",opacity:"1"});$current.animate({left:"+="+c,top:"0",opacity:"1"},{queue:!0,duration:f,easing:e});$new.animate({left:"+="+c,top:"0",opacity:"1"},{queue:!0,duration:f,easing:e});break;case "slideUp":$new.css({top:h,opacity:"1"});$current.animate({top:"-="+h,left:"0",opacity:"1"},{queue:!0,duration:f,easing:e});$new.animate({top:"-="+h,left:"0",opacity:"1"},{queue:!0,duration:f,easing:e});break;case "slideDown":$new.css({top:"-"+
h+"px",opacity:"1"});$current.animate({top:"+="+h,left:"0",opacity:"1"},{queue:!0,duration:f,easing:e});$new.animate({top:"+="+h,left:"0",opacity:"1"},{queue:!0,duration:f,easing:e});break;case "overLeft":$new.css({left:c,top:"0",opacity:"1","z-index":i});$new.animate({left:"-="+c,top:"0",opacity:"1"},{queue:!0,duration:f,easing:e});break;case "overRight":$new.css({left:"-"+c+"px",top:"0",opacity:"1","z-index":i});$new.animate({left:"+="+c,top:"0",opacity:"1"},{queue:!0,duration:f,easing:e});break;
case "overUp":$new.css({top:h,left:"0",opacity:"1","z-index":i});$new.animate({top:"-="+h,left:"0",opacity:"1"},{queue:!0,duration:f,easing:e});break;case "overDown":$new.css({top:"-"+h+"px",left:"0",opacity:"1","z-index":i});$new.animate({top:"+="+h,left:"0",opacity:"1"},{queue:!0,duration:f,easing:e});break;case "none":$new.css({"z-index":i})}i++;g=j;return!1}function s(c){if(!1==t){var c=c.substr(c.length-1),d=a.data("slideCount")+1;c++;c==d?b('.slider-link[rel="section1"]',a).trigger("click",
q):(j="section"+c,b('.slider-link[rel="'+j+'"]',a).trigger("click",q))}}function z(){k=setInterval(function(){s(g,l,m,n)},u);a.data("interval",k)}function y(){clearInterval(a.data("interval"));k=setInterval(function(){s(g,l,m,n)},u);a.data("interval",k)}function A(c){var d=b("#slider",a).outerHeight(),g=b("#slider",a).outerWidth(),f,e,j,k=0,l=a.css("backgroundColor");b(".slider-image img",a).each(function(){f=b(this).outerHeight();e=b(this).outerWidth();j=0.5*(d-f);k=0.5*(g-e);b(this).css({"padding-top":j,
"padding-bottom":j,"padding-left":k,"padding-right":k,"background-color":l,position:"absolute"});b(this).css({"z-index":i});i++});b('.slider-image[rel="'+c+'"] img',a).css({"z-index":i});i++}var d=p,g=d.first,j="",m=d.speed,l=d.effect,n=d.easing,u=d.interval,B=d.hoverPause,r=d.autoPlay,i=1,v=0,o=0,t=!1,x=!1,w=!1,a=b(this);if(v==o){b(".slider-image",a).each(function(){v++;a.data("slideCount",v)});b(".slider-link",a).each(function(){o++;a.data("accordCount",o)});g=g<=o?"section"+g:"section1";if(!0==
r){var k=setInterval(function(){s(g,l,m,n)},u);a.data("interval",k)}!0==B&&!0==r&&a.hover(function(){t=!0;clearInterval(a.data("interval"))},function(){t=!1;z()});d=b(".slider-link",a);b(".content",a).hide();b('.header a[rel="'+g+'"]',a).addClass("active").parent().next().show();A(g);d.click(q)}b(window).load(function(){w=!0})})}})})(jQuery);


$(function(){	
	var items = $('#stacks_in_28_page0container div.stacks_in_28_page0item');
	var data = [];
	
	var firstImageWidth = 0;
	var firstImageHeight = 0;
	
	$.each(items, function(i, item) {				
		var title = $(item).find('div.stacks_in_28_page0title:first').text();
		var description = $(item).find('div.stacks_in_28_page0slice:first').html();
		
		var image = $(item).find('img:first');
				
		if (!image.length) {
			return true;
		}
				
		var parent = $(image).parent();
		
		var link = false;
		
		if (parent.is('a')) {
			var link = {url: parent.attr('href'), target: parent.attr('target'), rel: parent.attr('rel')};
		} 
			
		var thumbnailSrc = $(image).attr('src');
					
		var imageWidth = $(image).attr('width');
		var imageHeight = $(image).attr('height');
			
		if (!imageWidth || !imageHeight) {
			var result = false;
			var html = $(image).parent().html();
				
			result = html.match(/width\s*=\s*["']?([0-9]+)/);
			if (result) { 
				imageWidth = result[1];
			}
			result = html.match(/height\s*=\s*["']?([0-9]+)/);
			if (result) {
				imageHeight = result[1];
			}
		}
			
		imageWidth = parseInt(imageWidth, 10);
		imageHeight = parseInt(imageHeight, 10);
		
		if (i == 0) {
			firstImageWidth = imageWidth;
			firstImageHeight = imageHeight;
		}
		
		data.push({
			title: title, 
			description: description,
			image: {src: thumbnailSrc, width: imageWidth, height: imageHeight},
			link: link
		})
	});
	
	if (data.length == 0) {
		return;
	}
		  
	items.empty();
		
	if ("normal" == "reverse") {
		data = data.reverse();
	} else if ("normal" == "randomize") {
		function random_sort() {
			return (0.5 - Math.random() );
		}
		
		data.sort(random_sort);
	}
	
	var slider = '';
	var accordion = '';
	
	var width  = 0;
	var height = 0;
	
	var last = data.length-1;
	
	var contentHeight = firstImageHeight - (3+1) * 36 + 3-1;
		
	$.each(data, function(i, item) {
		accordion += '<div class="header"' + (i == 0 ? ' style="border-top:none;"' : '') +  '><a class="slider-link" rel="section' + (i+1) + '">' + (item.title ? item.title : 'Image ' + (i+1)) + '</a></div>';
		accordion += '<div class="content" style="height:' + contentHeight + 'px;">' + item.description + '</div>';
		slider += '<div class="slider-image" rel="section' + (i+1) + '">' + (item.link ? '<a href="' + item.link.url + '"' + (item.link.target ? ' target="' + item.link.target + '"' : '') +  (item.link.rel ? ' rel="' + item.link.rel + '"' : '') + '>' : '') + '<img src="' + item.image.src + '" width="' + item.image.width + '" height="' + item.image.height + '" />' + (item.link ? '</a>' : '') + '</div>';
		
	});
	
	var parent = $('#stacks_in_28_page0slider').parent();
	
	if (4 || 4 || 10) {
		parent.css({'-webkit-box-shadow': '#000000 4px 4px 10px', 
				    '-khtml-box-shadow': '#000000 4px 4px 10px',
					'-moz-box-shadow': '#000000 4px 4px 10px',
					'box-shadow': '#000000 4px 4px 10px'});
	
		var margin = parseInt(parent.css('margin-bottom'), 10);
	
		var biggestOffset = (4 > 4 ? 4 : 4);
	
		if (margin <  + biggestOffset) {
			margin = 10 + biggestOffset;
		
			parent.css('margin', margin);
		}
	}
	
	$('#stacks_in_28_page0slider').width(parent.width());
	var accordionWidth = parent.width() - firstImageWidth;
		
	var sliderStyling = 'width:' + firstImageWidth + 'px;height:' + firstImageHeight + 'px';
	var accordionStyling = 'width:' + accordionWidth + 'px;height:' + firstImageHeight + 'px';
	
	if ('right' == 'right') {
		$('#stacks_in_28_page0slider').html('<div id="slider" style="' + sliderStyling + '">' + slider + '</div><div id="accordion" style="' + accordionStyling + '">' + accordion + '</div>');
	} else {
		$('#stacks_in_28_page0slider').html('<div id="accordion" style="' + accordionStyling + '">' + accordion + '</div><div id="slider" style="' + sliderStyling + '">' + slider + '</div>');
	}
		
	$('#stacks_in_28_page0slider').slidorion({
		speed: 500,
		interval: 5*1000,
		effect: 'fade',
		easing: 'none',
		autoPlay: false,
		first: 1,
		hoverPause: false
	});
});

	return stack;
})(stacks.stacks_in_28_page0);


// Javascript for stacks_in_331_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_331_page0 = {};

// A closure is defined and assigned to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for referring
// to this object from elsewhere.
stacks.stacks_in_331_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;
	
                             
$(document).ready(function(){
            

$.fn.reverseOrder = function() {
	return this.each(function() {
		$(this).prependTo( $(this).parent() );
	});
};





            $('#stacks_in_331_page0 .listContainer').hover(function(){
					$(".sliderBox", this).stop().animate({top:'-60px'},{queue:false,duration:100});
				}, function() {
					$(".sliderBox", this).stop().animate({top:'0px'},{queue:false,duration:300});
                       
            });
                
                

               
               

       
});
            
     

 

	return stack;
})(stacks.stacks_in_331_page0);


// Javascript for stacks_in_366_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_366_page0 = {};

// A closure is defined and assigned to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for referring
// to this object from elsewhere.
stacks.stacks_in_366_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;
	
// imagelist Stack by http://www.doobox.co.uk
// Copyright@2010 Mr JG Simpson, trading as Doobox.
// all rights reserved.



$(document).ready(function() {


if("no" == "yes"){
var thefirstsource = $( "#stacks_in_366_page0:first-child img" ).attr("src");
$( "#stacks_in_366_page0 .listIcon .centered_image" ).each(function(){
$(this).html('<img width="128" height="128" src="' + thefirstsource + '" />');
});
}

else{

$("#stacks_in_366_page0 .listIcon").each(function(){
if(!$(this).find("img").attr("src")){
$(this).html('<img width="128" height="128" src="index_files/imagelistimages/tick.png" />');
}
});

}

$( "#stacks_in_366_page0 li" ).css("list-style-type", "none");
});

	return stack;
})(stacks.stacks_in_366_page0);



