
// '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_5_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_5_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_5_page0 = (function(stack) {

jQuery(document).ready(function($){
	$('#nav ul li').hover(
		function(){
			$('ul:first',this).show();
		},
		function(){
			$('ul:first',this).hide();
		}
	);
});
	return stack;
})(stacks.stacks_in_5_page0);


// Javascript for stacks_in_8_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_8_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_8_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_8_page0 img").attr("src");
	if (custom_bg_src) { 
	    $("#stacks_in_8_page0").css({'background-image':'url(' + custom_bg_src + ')'});	
	}
	else {
	    var bg_src = 'files/styled-stack-images/stack-bg0.png';
    	if (0 != 0) { $("#stacks_in_8_page0").css({'background-image':'url(' + bg_src + ')'}); }
	}
});
// End Styled Stack

	return stack;
})(stacks.stacks_in_8_page0);


// Javascript for stacks_in_13_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_13_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_13_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;
	
/*	aniMate Pro Stack jQuery Code 3.0.0  *//* ***********************************************************************************	Copyright (c) 2011, Mauricio Sabene. All rights reserved./* ************************************************************************************/(function($) {  $.fn.aniMatePro = function(start_delay, loops) {    var cum_delay = start_delay, $$this = this, callback;    loops = loops ? loops : 1;    this.each(function() {      var $this = $(this),          topS = $this.data('aniMatePro_topStart'),          leftS = $this.data('aniMatePro_leftStart'),          fadeIn = $this.data('aniMatePro_transition'),          topE = $this.data('aniMatePro_topEnd'),          leftE = $this.data('aniMatePro_leftEnd'),          opac = $this.data('aniMatePro_opacity') / 100,          holdIn = $this.data('aniMatePro_holdIn'),          holdOut = $this.data('aniMatePro_holdOut'),          animation = $this.data('aniMatePro_animation'),          topM = $this.data('aniMatePro_topMiddle'),          leftM = $this.data('aniMatePro_leftMiddle'),          holdM = $this.data('aniMatePro_durationMiddle'),          effect = $this.data('aniMatePro_effect');      $this.css({top: topS + 'px', left: leftS + 'px'});      if (effect === 'grow') $this.fadeTo(0,1).hide(0);      else if (effect === 'slide') $this.fadeTo(0,1).slideUp(0);      else $this.fadeTo(0,0);      $this.delay(cum_delay);      if (effect === 'grow') $this.show(fadeIn);      else if (effect === 'slide') $this.slideDown(fadeIn);      else $this.fadeTo(fadeIn,1);      $this.delay(100);      $this.animate({top: topM + 'px', left: leftM + 'px'}, holdM);      $this.delay(holdIn);      $this.animate({top: topE + 'px', left: leftE + 'px', opacity: opac}, animation).delay(holdOut);      cum_delay = cum_delay + fadeIn + 100 + holdM + holdIn + animation + holdOut;    });    callback = function(loops) {      setTimeout(function() {        $$this.aniMatePro(0);        if (loops > 1) callback(loops - 1);      }, cum_delay);    }    if (loops >= 2) callback(loops - 1);    return this;  };$(window).load(function() {    var rwId = 'stacks_in_13_page0',        rwDelay = 3,        rwLoops = 10,        allLayers = $('.aniMatePro_slide', document.getElementById('ms_aniMatePro' + rwId)),        animate_comp = $('#ms_aniMatePro' + rwId),        aniMateProouter = $('#aniMateProouter' + rwId);    allLayers.hide(0);    aniMateProouter.css('background-image', 'none');    animate_comp.css('visibility', 'visible');    allLayers.aniMatePro(rwDelay * 1000, rwLoops);    aniMateProouter.children('.toggleaniMatePro').click(function() {      animate_comp.toggle('slow');      return false;    });    aniMateProouter.children('.reloadaniMatePro').click(function() {      if (!allLayers.parent().children().is(':animated')) {        animate_comp.show('slow');        setTimeout(function() {          allLayers.aniMatePro(1000);        }, 500);      }      return false;    });  });})(jQuery);
	return stack;
})(stacks.stacks_in_13_page0);


// Javascript for stacks_in_188_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_188_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_188_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;
	
var $fis = jQuery.noConflict();
$fis(window).load(function(){
	$fis('#fadeInStackstacks_in_188_page0').hide().delay(1000).fadeIn(16000);
});
	return stack;
})(stacks.stacks_in_188_page0);


// Javascript for stacks_in_205_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_205_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_205_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;
	
/*
	Background Stretcher jQuery Plugin
	� 2009 ajaxBlender.com
	For any questions please visit www.ajaxblender.com 
	or email us at support@ajaxblender.com
	
	Version: 1.2 (modified by MS)
*/

	/*  Variables  */
	var container = null;
	var allImgs = '', allLIs = '', containerStr = '';	
	var element = this;
	var _bgStretcherPause = false;
	var _bgStretcherTm = null;
	
	jQuery.fn.bgStretcher = function(settings){
		settings = jQuery.extend({}, jQuery.fn.bgStretcher.defaults, settings);
		jQuery.fn.bgStretcher.settings = settings;
		
		function _build(){
			if(!settings.images.length){ return; }
			
			_genHtml();
			
			containerStr = '#' + settings.imageContainer;
			container = jQuery(containerStr);
			allImgs = '#' + settings.imageContainer + ' IMG';
			allLIs = '#' + settings.imageContainer + ' LI';

			jQuery(allLIs).hide();
			var bgrandom = Math.round(Math.random() * jQuery(allLIs).length);
			if(settings.randomFirst) {
			jQuery(allLIs + ':eq(' + bgrandom + ')').fadeIn(1000).addClass('bgs-current');
			} else {
			jQuery(allLIs + ':first').fadeIn(1000).addClass('bgs-current');}
			
			if(!container.length){ return; }
			jQuery(window).resize(_resize);
			
			if(settings.slideShow && jQuery(allImgs).length > 1){
				_bgStretcherTm = setTimeout( bgSlideshow , settings.nextSlideDelay);
			}
			_resize();
		};
		
		function _resize(){
			var winW = jQuery(window).width();
			var winH = jQuery(window).height();
			var imgW = 0, imgH = 0;

			//	Update container's height
			container.width(winW);
			container.height(winH);
			
			//	Non-proportional resize
			if(!settings.resizeProportionally){
				imgW = winW;
				imgH = winH;
			} else {
				var initW = settings.imageWidth, initH = settings.imageHeight;
				var ratio = initH / initW;
				
				imgW = winW;
				imgH = winW * ratio;
				
				if(imgH < winH){
				imgH = winH;
				imgW = imgH / ratio;
				}
			}
			
			//	Apply new size for images
			if(!settings.resizeAnimate){
				jQuery(allImgs).width(imgW).height(imgH);
			} else {
				jQuery(allImgs).animate({width: imgW, height: imgH}, 'normal');
			}
		};
		
		function _genHtml(){
			var code = '<div id="' + settings.imageContainer + '" class="bgstretcher"><ul>';
			for(i = 0; i < settings.images.length; i++){
				code += '<li><img src="' + settings.images[i] + '" alt="" /></li>';
			}
			code += '</ul></div>';
			jQuery(settings.codeLocation).prepend(code);
		};

		function bgSlideshow (){
			var current = jQuery(containerStr + ' LI.bgs-current');
			var next = current.next();
			if(!next.length){
			if(settings.stopEnd)	
			{ return false; }
			else { next = jQuery(containerStr + ' LI:first'); }
			}

			jQuery(containerStr + ' LI').removeClass('bgs-current');
			next.addClass('bgs-current');

			next.fadeIn( jQuery.fn.bgStretcher.settings.slideShowSpeed );
			current.fadeOut( jQuery.fn.bgStretcher.settings.slideShowSpeed );
			_bgStretcherTm = setTimeout( bgSlideshow, jQuery.fn.bgStretcher.settings.nextSlideDelay);
		};
		
		/*  Start bgStretcher  */
		_build();
	};

	/*  Default Settings  */
	jQuery.fn.bgStretcher.defaults = {
		imageContainer:             'bgstretcher',
		resizeProportionally:       true,
		resizeAnimate:              false,
		images:                     [],
		imageWidth:                 1024,
		imageHeight:                768,
		nextSlideDelay:             3000,
		slideShowSpeed:             'slow',
		codeLocation: 				'body',
		randomFirst: 				false,
		slideShow:                  true
	};
	jQuery.fn.bgStretcher.settings = {};

jQuery(document).ready(function(){
	var bg_images = [];
	jQuery('div#inputimages ol li').each(function() {
		bg_images.push(jQuery(this).html())
	});

		jQuery(document).bgStretcher({
			images: bg_images,
			imageWidth: 1200,
			imageHeight: 758,
			imageContainer: 'stretcher',
			nextSlideDelay: 3000,
			slideShowSpeed: 'slow',
			resizeAnimate: false,
			codeLocation: 'body',
			randomFirst: false,
			slideShow: false,
			stopEnd: false
		});
});
	return stack;
})(stacks.stacks_in_205_page0);



