
// '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_2_page45
// ---------------------------------------------------------------------

// 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_2_page45 = {};

// 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_2_page45 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
//-- Tabulous Stack v1.2.4 by Joe Workman --//

/*
 * 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 Coda-Slider v2.0 - http://www.ndoherty.biz/coda-slider
	Copyright (c) 2009 Niall Doherty
	This plugin available for use in all personal or commercial projects under both MIT and GPL licenses.
*/
$(function(){
	// Remove the coda-slider-no-js class from the body
	$("body").removeClass("coda-slider-no-js");
	// Preloader
	$(".coda-slider").children('.panel').hide().end().prepend('<p class="loading">Loading...<br /><img src="files/tabulous-images/ajax-loader.gif" alt="loading..." /></p>');
});

var sliderCount = 1;

$.fn.codaSlider = function(settings) {

	settings = $.extend({
		autoHeight: true,
		autoHeightEaseDuration: 1000,
		autoHeightEaseFunction: "easeInOutExpo",
		autoSlide: false,
		autoSlideInterval: 7000,
		autoSlideStopWhenClicked: true,
		crossLinking: true,
		dynamicArrows: true,
		dynamicArrowLeftText: "&#171; left",
		dynamicArrowRightText: "right &#187;",
		dynamicTabs: true,
		dynamicTabsAlign: "center",
		dynamicTabsPosition: "top",
		externalTriggerSelector: "a.xtrig",
		firstPanelToLoad: 1,
		panelTitleSelector: "h2.title",
		slideEaseDuration: 1000,
		slideEaseFunction: "easeInOutExpo"
	}, settings);
	
	return this.each(function(){
		
		// Uncomment the line below to test your preloader
		// alert("Testing preloader");
		
		var slider = $(this);
		
		// If we need arrows
		if (settings.dynamicArrows) {
			slider.parent().addClass("arrows");
			slider.before('<div class="coda-nav-left" id="coda-nav-left-' + sliderCount + '"><a href="#">' + settings.dynamicArrowLeftText + '</a></div>');
			slider.after('<div class="coda-nav-right" id="coda-nav-right-' + sliderCount + '"><a href="#">' + settings.dynamicArrowRightText + '</a></div>');
		};
		
		// Joe Workman - I changed the following lines to allow for fluid layouts with 100% widths.
		var panelWidth = slider.width();
		$(".panel", slider).css({ width: panelWidth });
		
		var panelCount = slider.find(".panel").size();
		var panelContainerWidth = panelWidth*panelCount;
		var navClicks = 0; // Used if autoSlideStopWhenClicked = true
		
		// Surround the collection of panel divs with a container div (wide enough for all panels to be lined up end-to-end)
		$('.panel', slider).wrapAll('<div class="panel-container"></div>');
		// Specify the width of the container div (wide enough for all panels to be lined up end-to-end)
		$(".panel-container", slider).css({ width: panelContainerWidth });
		
		// Specify the current panel.
		// If the loaded URL has a hash (cross-linking), we're going to use that hash to give the slider a specific starting position...
		if (settings.crossLinking && location.hash && parseInt(location.hash.slice(1)) <= panelCount) {
			var currentPanel = parseInt(location.hash.slice(1));
			var offset = - (panelWidth*(currentPanel - 1));
			$('.panel-container', slider).css({ marginLeft: offset });
		// If that's not the case, check to see if we're supposed to load a panel other than Panel 1 initially...
		} else if (settings.firstPanelToLoad != 1 && settings.firstPanelToLoad <= panelCount) { 
			var currentPanel = settings.firstPanelToLoad;
			var offset = - (panelWidth*(currentPanel - 1));
			$('.panel-container', slider).css({ marginLeft: offset });
		// Otherwise, we'll just set the current panel to 1...
		} else { 
			var currentPanel = 1;
		};
			
		// Left arrow click
		$("#coda-nav-left-stacks_in_2_page45 a").click(function(){
			navClicks++;
			if (currentPanel == 1) {
				offset = - (panelWidth*(panelCount - 1));
				alterPanelHeight(panelCount - 1);
				currentPanel = panelCount;
				slider.siblings('.coda-nav').find('a.current').removeClass('current').parents('ul').find('li:last a').addClass('current');
			} else {
				currentPanel -= 1;
				alterPanelHeight(currentPanel - 1);
				offset = - (panelWidth*(currentPanel - 1));
				slider.siblings('.coda-nav').find('a.current').removeClass('current').parent().prev().find('a').addClass('current');
			};
			$('.panel-container', slider).animate({ marginLeft: offset }, settings.slideEaseDuration, settings.slideEaseFunction);
			if (settings.crossLinking) { location.hash = currentPanel }; // Change the URL hash (cross-linking)
			return false;
		});
			
		// Right arrow click
		$('#coda-nav-right-stacks_in_2_page45 a').click(function(){
			navClicks++;
			if (currentPanel == panelCount) {
				offset = 0;
				currentPanel = 1;
				alterPanelHeight(0);
				slider.siblings('.coda-nav').find('a.current').removeClass('current').parents('ul').find('a:eq(0)').addClass('current');
			} else {
				offset = - (panelWidth*currentPanel);
				alterPanelHeight(currentPanel);
				currentPanel += 1;
				slider.siblings('.coda-nav').find('a.current').removeClass('current').parent().next().find('a').addClass('current');
			};
			$('.panel-container', slider).animate({ marginLeft: offset }, settings.slideEaseDuration, settings.slideEaseFunction);
			if (settings.crossLinking) { location.hash = currentPanel }; // Change the URL hash (cross-linking)
			return false;
		});
		
		// If we need a dynamic menu
		if (settings.dynamicTabs) {
			var dynamicTabs = '<div class="coda-nav" id="coda-nav-' + sliderCount + '"><ul></ul></div>';
			switch (settings.dynamicTabsPosition) {
				case "bottom":
					slider.parent().append(dynamicTabs);
					break;
				default:
					slider.parent().prepend(dynamicTabs);
					break;
			};
			ul = $('#coda-nav-' + sliderCount + ' ul');
			// Create the nav items
			$('.panel', slider).each(function(n) {
				ul.append('<li class="tab' + (n+1) + '"><a class="tab_link" href="#' + (n+1) + '">' + $(this).find(settings.panelTitleSelector).text() + '</a></li>');												
			});
			// Joe Workman Added this if statement. This is a bug in the plugin IMHO.
			// If dynamicTabs are used but not DynamicArrows, then the Nav Width got set wrong.  
			if (settings.dynamicArrows) {
				navContainerWidth = slider.width() + slider.siblings('.coda-nav-left').width() + slider.siblings('.coda-nav-right').width();
			}
			else {
				navContainerWidth = slider.width();
			}
			ul.parent().css({ width: navContainerWidth });

			switch (settings.dynamicTabsAlign) {
				case "center":
				// Joe Workman completely changed this center logic to calculate the width of the ul then center it
					//ul.css({ width: ($("li", ul).width() + 2) * panelCount });
					//Joe Workman - I am setting the width of the coda-nav div to the width of the tabs. 
					var ul_width = 0;
					$('.coda-nav ul li').each(function(index) {
					    ul_width += $(this).outerWidth();
					});
					if ($.browser.msie) {
						$('.coda-nav').css('width', ul_width + panelCount);//IE Hack
					}
					else {
						$('.coda-nav').css('width', ul_width);						
					}
					$('.coda-nav').css('margin-left', 'auto');
					$('.coda-nav').css('margin-right', 'auto');
					break;
				case "right":
					//Joe Workman - I am setting the width of the coda-nav div to the width of the tabs. 
					var ul_width = 0;
					$('.coda-nav ul li').each(function(index) {
					    ul_width += $(this).outerWidth();
					});
					if ($.browser.msie) {
						$('.coda-nav').css('width', ul_width + panelCount);//IE Hack
					}
					else {
						$('.coda-nav').css('width', ul_width);						
					}
					$('.coda-nav').css('float','right');
					break;
				case "full":
				// Joe Workman - added this option to allow for full width. 
					$('.coda-nav ul li a').css('padding-left',0);
					$('.coda-nav ul li a').css('padding-right',0);
					var navWidth = $('.coda-nav').outerWidth();
					var tabWidth = Math.floor(navWidth/panelCount) - 1; //take into account 1px margin on each tab
					var lastTabWidth = tabWidth + 1; //last tab has no margin
					var remainder = navWidth - (lastTabWidth*panelCount);
					$('.coda-nav ul li a').css('width',tabWidth); 
					if ($.browser.msie) {
						$('.coda-nav ul li a').last().css('width', tabWidth+remainder ); // IE Sucks
					}
					else {
						$('.coda-nav ul li a').last().css('width', lastTabWidth+remainder ); // add the remainder to the last tab
					}
					break;
			};
		};
			
		// If we need a tabbed nav
		$('#coda-nav-' + sliderCount + ' a').each(function(z) {
			// What happens when a nav link is clicked
			$(this).bind("click", function() {
				navClicks++;
				$(this).addClass('current').parents('ul').find('a').not($(this)).removeClass('current');
				offset = - (panelWidth*z);
				alterPanelHeight(z);
				currentPanel = z + 1;
				$('.panel-container', slider).animate({ marginLeft: offset }, settings.slideEaseDuration, settings.slideEaseFunction);
				if (!settings.crossLinking) { return false }; // Don't change the URL hash unless cross-linking is specified
			});
		});
		
		// External triggers (anywhere on the page)
		$(settings.externalTriggerSelector).each(function() {
			// Make sure this only affects the targeted slider
			if (sliderCount == parseInt($(this).attr("rel").slice(12))) {
				$(this).bind("click", function() {
					navClicks++;
					targetPanel = parseInt($(this).attr("href").slice(1));
					offset = - (panelWidth*(targetPanel - 1));
					alterPanelHeight(targetPanel - 1);
					currentPanel = targetPanel;
					// Switch the current tab:
					slider.siblings('.coda-nav').find('a').removeClass('current').parents('ul').find('li:eq(' + (targetPanel - 1) + ') a').addClass('current');
					// Slide
					$('.panel-container', slider).animate({ marginLeft: offset }, settings.slideEaseDuration, settings.slideEaseFunction);
					if (!settings.crossLinking) { return false }; // Don't change the URL hash unless cross-linking is specified
				});
			};
		});
			
		// Specify which tab is initially set to "current". Depends on if the loaded URL had a hash or not (cross-linking).
		if (settings.crossLinking && location.hash && parseInt(location.hash.slice(1)) <= panelCount) {
			$("#coda-nav-" + sliderCount + " a:eq(" + (location.hash.slice(1) - 1) + ")").addClass("current");
		// If there's no cross-linking, check to see if we're supposed to load a panel other than Panel 1 initially...
		} else if (settings.firstPanelToLoad != 1 && settings.firstPanelToLoad <= panelCount) {
			$("#coda-nav-" + sliderCount + " a:eq(" + (settings.firstPanelToLoad - 1) + ")").addClass("current");
		// Otherwise we must be loading Panel 1, so make the first tab the current one.
		} else {
			$("#coda-nav-" + sliderCount + " a:eq(0)").addClass("current");
		};
		
		// Set the height of the first panel
		if (settings.autoHeight) {
			panelHeight = $('.panel:eq(' + (currentPanel - 1) + ')', slider).height();
			slider.css({ height: panelHeight });
		};
		
		// Trigger autoSlide
		if (settings.autoSlide) {
			slider.ready(function() {
				setTimeout(autoSlide,settings.autoSlideInterval);
			});
		};
		
		function alterPanelHeight(x) {
			if (settings.autoHeight) {
				panelHeight = $('.panel:eq(' + x + ')', slider).height()
				slider.animate({ height: panelHeight }, settings.autoHeightEaseDuration, settings.autoHeightEaseFunction);
			};
		};
		
		function autoSlide() {
			if (navClicks == 0 || !settings.autoSlideStopWhenClicked) {
				if (currentPanel == panelCount) {
					var offset = 0;
					currentPanel = 1;
				} else {
					var offset = - (panelWidth*currentPanel);
					currentPanel += 1;
				};
				alterPanelHeight(currentPanel - 1);
				// Switch the current tab:
				slider.siblings('.coda-nav').find('a').removeClass('current').parents('ul').find('li:eq(' + (currentPanel - 1) + ') a').addClass('current');
				// Slide:
				$('.panel-container', slider).animate({ marginLeft: offset }, settings.slideEaseDuration, settings.slideEaseFunction);
				setTimeout(autoSlide,settings.autoSlideInterval);
			};
		};
		
		// Kill the preloader
		$('.panel', slider).show().end().find("p.loading").remove();
		slider.removeClass("preload");
		
		sliderCount++;
	});
};

$(document).ready(function(){
	var bg_color = $('#stacks_in_2_page45').css('background-color');
	if (bg_color) { 
		$('#stacks_in_2_page45').css({'background-color': 'transparent'});	
		$('#stacks_in_2_page45 .coda-slider').css({'background-color': bg_color });	
	}
	if ('true' == 'false') {
		$('#stacks_in_2_page45 .coda-slider-wrapper').addClass('no_tabs');
	}
	if ('none' == 'none') {
		$('#stacks_in_2_page45 .coda-slider').removeClass('nav');
	}

	var bg_border_style = $('#stacks_in_2_page45').css('border-bottom-style');
	if (bg_border_style) { 
		var bg_border_color = $('#stacks_in_2_page45').css('border-bottom-color');
		var bg_border_top = $('#stacks_in_2_page45').css('border-top-width');
		var bg_border_right = $('#stacks_in_2_page45').css('border-right-width');
		var bg_border_bottom = $('#stacks_in_2_page45').css('border-bottom-width');
		var bg_border_left = $('#stacks_in_2_page45').css('border-left-width');
		$('#stacks_in_2_page45').css({'border-width':0});	
		$('#coda-slider-stacks_in_2_page45').css({'border-style':bg_border_style,
									'border-color':bg_border_color,
									'border-top-width':bg_border_top,
									'border-right-width':bg_border_right,
									'border-bottom-width':bg_border_bottom,	
									'border-left-width':bg_border_left
		});	
	}
	
	$("#coda-slider-stacks_in_2_page45").codaSlider({ 
		dynamicArrows: false, 
		dynamicTabsAlign: "full",
		panelTitleSelector: ".panel_title_stacks_in_2_page45",
		autoHeight: true,
		autoSlide: true,
		autoHeightEaseFunction: "easeInOutExpo",
		autoSlideInterval: 12000,
		autoSlideStopWhenClicked: true,
		dynamicTabs: true,
		dynamicTabsPosition: "top",
		slideEaseFunction: "easeInOutExpo"
	});
	// Ease Functions: http://www.robertpenner.com/easing/easing_demo.html
});

//-- End Tabulous Stack --//
	return stack;
})(stacks.stacks_in_2_page45);


// Javascript for stacks_in_2261_page45
// ---------------------------------------------------------------------

// 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_2261_page45 = {};

// 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_2261_page45 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	

//-- RSS JS Stack v1.3.0 by Joe Workman --//

//---------------------------
// Start Common RSS Code
//---------------------------
formatString = function(str) {
	str = str.replace(/<[^>]+>/ig,'');
	str=' '+str;
	return $.trim(str);
}

enrichString = function(str) {
	str = str.replace(/((ftp|https?):\/\/([-\w\.]+)+(:\d+)?(\/([\w/_\.]*(\?\S+)?)?)?)/gm,'<a href="$1" target="_blank">$1</a>');
	str = str.replace(/([^\w])\@([\w\-]+)/gm,'$1@<a href="http://twitter.com/$2" target="_blank">$2</a>');
	str = str.replace(/([^\w])\#([\w\-]+)/gm,'$1<a href="http://twitter.com/search?q=%23$2" target="_blank">#$2</a>');
	return $.trim(str);
}

parse_date = function(str) {
    if (str.match(/^\d+\-\d+\-\d+T/)) {
        str = str.replace(/T.+$/,'');
    }
	var d = new Date(str);
	var m = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec'];
	if (d.getUTCDate()) {
		return d.getUTCDate() + ' ' + m[d.getUTCMonth()] + ' ' + d.getFullYear();
    }
    return str;
};

find_link = function(obj) {
    var default_string = '#';
    if (obj == null || obj == undefined) {
        return default_string;
    }	
    else if (typeof obj.origLink == 'string') {
        return obj.origLink;
    }
    else if ($.isArray(obj.link)) {
        var mylink = obj.link[0].href;
        $.each(obj.link,function(index, value){
            if (value.rel === 'alternate') {
                mylink = value.href;
            }
		})
        return mylink;
    }
    else if (typeof obj.link == 'object') {
        return obj.link.href;
    }
    else if (typeof obj.link == 'string') {
        return obj.link;
    }
    else if (typeof obj.enclosure == 'object' && typeof obj.enclosure.url == 'string') {
        return obj.enclosure.url;
    }
    return default_string;
};

find_title = function(obj) {
    var default_string = 'No Items in RSS Feed';
    if (obj == null || obj == undefined) {
        return default_string;
    }	
    else if (typeof obj.title.content == 'string') {
        return formatString(obj.title.content);
    }
    else if (typeof obj.title == 'string') {
        return formatString(obj.title);
    }
    else if (typeof obj.title == 'object') {
        return formatString(obj.title[0]);
    }
    return default_string;
};

find_date = function(obj) {
    var default_string = 'Date Unknown';
    if (obj == null || obj == undefined) {
        return default_string;
    }	
    else if (typeof obj.pubDate == 'string') {
		return parse_date(obj.pubDate);
    }
    else if (typeof obj.date == 'string') {
		return parse_date(obj.date);
    }
    else if (typeof obj.published == 'string') {
		return parse_date(obj.published);
    }
    else if (typeof obj.updated == 'string') {
		return parse_date(obj.updated);
    }
    return default_string;
};

find_descr = function(obj) {
    var default_string = 'RSS Feed Invalid. No Description Found.';
    if (obj == null || obj == undefined) {
        return default_string;
    }	
    else if (typeof obj.description == 'string') {
		return formatString(obj.description);
    }
    else if (typeof obj.encoded == 'string') {
		return formatString(obj.encoded);
    }
    else if (typeof obj.content == 'object' && typeof obj.content.content == 'string') {
		return formatString(obj.content.content);
    }
    return default_string;
};

find_author = function(obj) {
    var default_string = 'Unknown Author';
    if (obj == null || obj == undefined) {
        return default_string;
    }	
    else if (typeof obj.creator == 'string') {
		return obj.creator;
    }
    else if ($.isArray(obj.author)) {
        return obj.author[0];
    }
    else if (typeof obj.author == 'object' && typeof obj.author.email == 'string') {
		return obj.author.email;
    }
    else if (typeof obj.author == 'string') {
		return obj.author;
    }
    return default_string;
};

$(document).ready(function() {
	/* Forming the query: */
	var feed = "http://ves-news.blogspot.com/feeds/posts/default";
	feed = feed.replace(/feed:\/\//,'http://'); // Replace feed:// with http://
	var query = 'select * from feed where url="' + feed + '" LIMIT 5';

	/* Forming the URL to YQL: */
	var url = "http://query.yahooapis.com/v1/public/yql?q="+encodeURIComponent(query)+"&format=json&callback=?";

	$.getJSON(url,function(data){
		if (data.query == null || data.query == undefined || data.query.results == null || data.query.results == undefined) {
			// Invalid or Empty RSS Feed - Add Blank/Default Entries
			add_feed_item();
	 	}
	 	else if ($.isArray(data.query.results.item || data.query.results.entry) ) {  //item exists in RSS and entry in ATOM feeds
			$.each(data.query.results.item || data.query.results.entry,function(){
	       		//Normal RSS Feed
	       		add_feed_item(this);
			})
		}
		else {
		    // RSS Feed with only one item in it
			add_feed_item(data.query.results.item || data.query.results.entry || null);
		}
		post_process_feed(this);
	});
});
//---------------------------
// End Common RSS Code
//---------------------------

function add_feed_item(obj) {
    var maxLength = 150;
	$('#rss-js-list-stacks_in_2261_page45').append('<li><a  href="'+ find_link(obj) +
	  '" target="_blank"><p class="rss-js-title">'+ find_title(obj) +
	  '</p><p class="rss-js-date">'+ find_date(obj) + 
	  '</p><p class="rss-js-desc">'+ find_descr(obj).substring(0, maxLength) +
	  '</p></a></li>'
	);
	return;    	        
};
function post_process_feed(obj) {
	if ($().tipTip) { $(".tiptip").tipTip(); }
	return;    	        
};
//-- End RSS JS Stack --//

	return stack;
})(stacks.stacks_in_2261_page45);


// Javascript for stacks_in_2262_page45
// ---------------------------------------------------------------------

// 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_2262_page45 = {};

// 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_2262_page45 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	

//-- Sweet Button Stack v1.5.2 by Joe Workman --//


//-- End Sweet Button Stack --//


	return stack;
})(stacks.stacks_in_2262_page45);


// Javascript for stacks_in_2271_page45
// ---------------------------------------------------------------------

// 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_2271_page45 = {};

// 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_2271_page45 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	

//-- RSS JS Stack v1.3.0 by Joe Workman --//

//---------------------------
// Start Common RSS Code
//---------------------------
formatString = function(str) {
	str = str.replace(/<[^>]+>/ig,'');
	str=' '+str;
	return $.trim(str);
}

enrichString = function(str) {
	str = str.replace(/((ftp|https?):\/\/([-\w\.]+)+(:\d+)?(\/([\w/_\.]*(\?\S+)?)?)?)/gm,'<a href="$1" target="_blank">$1</a>');
	str = str.replace(/([^\w])\@([\w\-]+)/gm,'$1@<a href="http://twitter.com/$2" target="_blank">$2</a>');
	str = str.replace(/([^\w])\#([\w\-]+)/gm,'$1<a href="http://twitter.com/search?q=%23$2" target="_blank">#$2</a>');
	return $.trim(str);
}

parse_date = function(str) {
    if (str.match(/^\d+\-\d+\-\d+T/)) {
        str = str.replace(/T.+$/,'');
    }
	var d = new Date(str);
	var m = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec'];
	if (d.getUTCDate()) {
		return d.getUTCDate() + ' ' + m[d.getUTCMonth()] + ' ' + d.getFullYear();
    }
    return str;
};

find_link = function(obj) {
    var default_string = '#';
    if (obj == null || obj == undefined) {
        return default_string;
    }	
    else if (typeof obj.origLink == 'string') {
        return obj.origLink;
    }
    else if ($.isArray(obj.link)) {
        var mylink = obj.link[0].href;
        $.each(obj.link,function(index, value){
            if (value.rel === 'alternate') {
                mylink = value.href;
            }
		})
        return mylink;
    }
    else if (typeof obj.link == 'object') {
        return obj.link.href;
    }
    else if (typeof obj.link == 'string') {
        return obj.link;
    }
    else if (typeof obj.enclosure == 'object' && typeof obj.enclosure.url == 'string') {
        return obj.enclosure.url;
    }
    return default_string;
};

find_title = function(obj) {
    var default_string = 'No Items in RSS Feed';
    if (obj == null || obj == undefined) {
        return default_string;
    }	
    else if (typeof obj.title.content == 'string') {
        return formatString(obj.title.content);
    }
    else if (typeof obj.title == 'string') {
        return formatString(obj.title);
    }
    else if (typeof obj.title == 'object') {
        return formatString(obj.title[0]);
    }
    return default_string;
};

find_date = function(obj) {
    var default_string = 'Date Unknown';
    if (obj == null || obj == undefined) {
        return default_string;
    }	
    else if (typeof obj.pubDate == 'string') {
		return parse_date(obj.pubDate);
    }
    else if (typeof obj.date == 'string') {
		return parse_date(obj.date);
    }
    else if (typeof obj.published == 'string') {
		return parse_date(obj.published);
    }
    else if (typeof obj.updated == 'string') {
		return parse_date(obj.updated);
    }
    return default_string;
};

find_descr = function(obj) {
    var default_string = 'RSS Feed Invalid. No Description Found.';
    if (obj == null || obj == undefined) {
        return default_string;
    }	
    else if (typeof obj.description == 'string') {
		return formatString(obj.description);
    }
    else if (typeof obj.encoded == 'string') {
		return formatString(obj.encoded);
    }
    else if (typeof obj.content == 'object' && typeof obj.content.content == 'string') {
		return formatString(obj.content.content);
    }
    return default_string;
};

find_author = function(obj) {
    var default_string = 'Unknown Author';
    if (obj == null || obj == undefined) {
        return default_string;
    }	
    else if (typeof obj.creator == 'string') {
		return obj.creator;
    }
    else if ($.isArray(obj.author)) {
        return obj.author[0];
    }
    else if (typeof obj.author == 'object' && typeof obj.author.email == 'string') {
		return obj.author.email;
    }
    else if (typeof obj.author == 'string') {
		return obj.author;
    }
    return default_string;
};

$(document).ready(function() {
	/* Forming the query: */
	var feed = "https://www.google.com/calendar/feeds/info.ves25%40googlemail.com/public/full-noattendees?futureevents=true&singleevents=true&orderby=starttime&sortorder=ascending";
	feed = feed.replace(/feed:\/\//,'http://'); // Replace feed:// with http://
	var query = 'select * from feed where url="' + feed + '" LIMIT 1';

	/* Forming the URL to YQL: */
	var url = "http://query.yahooapis.com/v1/public/yql?q="+encodeURIComponent(query)+"&format=json&callback=?";

	$.getJSON(url,function(data){
		if (data.query == null || data.query == undefined || data.query.results == null || data.query.results == undefined) {
			// Invalid or Empty RSS Feed - Add Blank/Default Entries
			add_feed_item();
	 	}
	 	else if ($.isArray(data.query.results.item || data.query.results.entry) ) {  //item exists in RSS and entry in ATOM feeds
			$.each(data.query.results.item || data.query.results.entry,function(){
	       		//Normal RSS Feed
	       		add_feed_item(this);
			})
		}
		else {
		    // RSS Feed with only one item in it
			add_feed_item(data.query.results.item || data.query.results.entry || null);
		}
		post_process_feed(this);
	});
});
//---------------------------
// End Common RSS Code
//---------------------------

function add_feed_item(obj) {
    var maxLength = 150;
	$('#rss-js-list-stacks_in_2271_page45').append('<li><a  href="'+ find_link(obj) +
	  '" target="_blank"><p class="rss-js-title">'+ find_title(obj) +
	  '</p><p class="rss-js-date">'+ find_date(obj) + 
	  '</p><p class="rss-js-desc">'+ find_descr(obj).substring(0, maxLength) +
	  '</p></a></li>'
	);
	return;    	        
};
function post_process_feed(obj) {
	if ($().tipTip) { $(".tiptip").tipTip(); }
	return;    	        
};
//-- End RSS JS Stack --//

	return stack;
})(stacks.stacks_in_2271_page45);


// Javascript for stacks_in_2274_page45
// ---------------------------------------------------------------------

// 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_2274_page45 = {};

// 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_2274_page45 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	

//-- RSS JS Stack v1.3.0 by Joe Workman --//

//---------------------------
// Start Common RSS Code
//---------------------------
formatString = function(str) {
	str = str.replace(/<[^>]+>/ig,'');
	str=' '+str;
	return $.trim(str);
}

enrichString = function(str) {
	str = str.replace(/((ftp|https?):\/\/([-\w\.]+)+(:\d+)?(\/([\w/_\.]*(\?\S+)?)?)?)/gm,'<a href="$1" target="_blank">$1</a>');
	str = str.replace(/([^\w])\@([\w\-]+)/gm,'$1@<a href="http://twitter.com/$2" target="_blank">$2</a>');
	str = str.replace(/([^\w])\#([\w\-]+)/gm,'$1<a href="http://twitter.com/search?q=%23$2" target="_blank">#$2</a>');
	return $.trim(str);
}

parse_date = function(str) {
    if (str.match(/^\d+\-\d+\-\d+T/)) {
        str = str.replace(/T.+$/,'');
    }
	var d = new Date(str);
	var m = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec'];
	if (d.getUTCDate()) {
		return d.getUTCDate() + ' ' + m[d.getUTCMonth()] + ' ' + d.getFullYear();
    }
    return str;
};

find_link = function(obj) {
    var default_string = '#';
    if (obj == null || obj == undefined) {
        return default_string;
    }	
    else if (typeof obj.origLink == 'string') {
        return obj.origLink;
    }
    else if ($.isArray(obj.link)) {
        var mylink = obj.link[0].href;
        $.each(obj.link,function(index, value){
            if (value.rel === 'alternate') {
                mylink = value.href;
            }
		})
        return mylink;
    }
    else if (typeof obj.link == 'object') {
        return obj.link.href;
    }
    else if (typeof obj.link == 'string') {
        return obj.link;
    }
    else if (typeof obj.enclosure == 'object' && typeof obj.enclosure.url == 'string') {
        return obj.enclosure.url;
    }
    return default_string;
};

find_title = function(obj) {
    var default_string = 'No Items in RSS Feed';
    if (obj == null || obj == undefined) {
        return default_string;
    }	
    else if (typeof obj.title.content == 'string') {
        return formatString(obj.title.content);
    }
    else if (typeof obj.title == 'string') {
        return formatString(obj.title);
    }
    else if (typeof obj.title == 'object') {
        return formatString(obj.title[0]);
    }
    return default_string;
};

find_date = function(obj) {
    var default_string = 'Date Unknown';
    if (obj == null || obj == undefined) {
        return default_string;
    }	
    else if (typeof obj.pubDate == 'string') {
		return parse_date(obj.pubDate);
    }
    else if (typeof obj.date == 'string') {
		return parse_date(obj.date);
    }
    else if (typeof obj.published == 'string') {
		return parse_date(obj.published);
    }
    else if (typeof obj.updated == 'string') {
		return parse_date(obj.updated);
    }
    return default_string;
};

find_descr = function(obj) {
    var default_string = 'RSS Feed Invalid. No Description Found.';
    if (obj == null || obj == undefined) {
        return default_string;
    }	
    else if (typeof obj.description == 'string') {
		return formatString(obj.description);
    }
    else if (typeof obj.encoded == 'string') {
		return formatString(obj.encoded);
    }
    else if (typeof obj.content == 'object' && typeof obj.content.content == 'string') {
		return formatString(obj.content.content);
    }
    return default_string;
};

find_author = function(obj) {
    var default_string = 'Unknown Author';
    if (obj == null || obj == undefined) {
        return default_string;
    }	
    else if (typeof obj.creator == 'string') {
		return obj.creator;
    }
    else if ($.isArray(obj.author)) {
        return obj.author[0];
    }
    else if (typeof obj.author == 'object' && typeof obj.author.email == 'string') {
		return obj.author.email;
    }
    else if (typeof obj.author == 'string') {
		return obj.author;
    }
    return default_string;
};

$(document).ready(function() {
	/* Forming the query: */
	var feed = "https://www.google.com/calendar/feeds/0e3chlorteq9kjfbl2kgjhue2g%40group.calendar.google.com/public/full-noattendees?futureevents=true&singleevents=true&orderby=starttime&sortorder=ascending";
	feed = feed.replace(/feed:\/\//,'http://'); // Replace feed:// with http://
	var query = 'select * from feed where url="' + feed + '" LIMIT 1';

	/* Forming the URL to YQL: */
	var url = "http://query.yahooapis.com/v1/public/yql?q="+encodeURIComponent(query)+"&format=json&callback=?";

	$.getJSON(url,function(data){
		if (data.query == null || data.query == undefined || data.query.results == null || data.query.results == undefined) {
			// Invalid or Empty RSS Feed - Add Blank/Default Entries
			add_feed_item();
	 	}
	 	else if ($.isArray(data.query.results.item || data.query.results.entry) ) {  //item exists in RSS and entry in ATOM feeds
			$.each(data.query.results.item || data.query.results.entry,function(){
	       		//Normal RSS Feed
	       		add_feed_item(this);
			})
		}
		else {
		    // RSS Feed with only one item in it
			add_feed_item(data.query.results.item || data.query.results.entry || null);
		}
		post_process_feed(this);
	});
});
//---------------------------
// End Common RSS Code
//---------------------------

function add_feed_item(obj) {
    var maxLength = 150;
	$('#rss-js-list-stacks_in_2274_page45').append('<li><a  href="'+ find_link(obj) +
	  '" target="_blank"><p class="rss-js-title">'+ find_title(obj) +
	  '</p><p class="rss-js-date">'+ find_date(obj) + 
	  '</p><p class="rss-js-desc">'+ find_descr(obj).substring(0, maxLength) +
	  '</p></a></li>'
	);
	return;    	        
};
function post_process_feed(obj) {
	if ($().tipTip) { $(".tiptip").tipTip(); }
	return;    	        
};
//-- End RSS JS Stack --//

	return stack;
})(stacks.stacks_in_2274_page45);


// Javascript for stacks_in_2293_page45
// ---------------------------------------------------------------------

// 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_2293_page45 = {};

// 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_2293_page45 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	

//-- RSS JS Stack v1.3.0 by Joe Workman --//

//---------------------------
// Start Common RSS Code
//---------------------------
formatString = function(str) {
	str = str.replace(/<[^>]+>/ig,'');
	str=' '+str;
	return $.trim(str);
}

enrichString = function(str) {
	str = str.replace(/((ftp|https?):\/\/([-\w\.]+)+(:\d+)?(\/([\w/_\.]*(\?\S+)?)?)?)/gm,'<a href="$1" target="_blank">$1</a>');
	str = str.replace(/([^\w])\@([\w\-]+)/gm,'$1@<a href="http://twitter.com/$2" target="_blank">$2</a>');
	str = str.replace(/([^\w])\#([\w\-]+)/gm,'$1<a href="http://twitter.com/search?q=%23$2" target="_blank">#$2</a>');
	return $.trim(str);
}

parse_date = function(str) {
    if (str.match(/^\d+\-\d+\-\d+T/)) {
        str = str.replace(/T.+$/,'');
    }
	var d = new Date(str);
	var m = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec'];
	if (d.getUTCDate()) {
		return d.getUTCDate() + ' ' + m[d.getUTCMonth()] + ' ' + d.getFullYear();
    }
    return str;
};

find_link = function(obj) {
    var default_string = '#';
    if (obj == null || obj == undefined) {
        return default_string;
    }	
    else if (typeof obj.origLink == 'string') {
        return obj.origLink;
    }
    else if ($.isArray(obj.link)) {
        var mylink = obj.link[0].href;
        $.each(obj.link,function(index, value){
            if (value.rel === 'alternate') {
                mylink = value.href;
            }
		})
        return mylink;
    }
    else if (typeof obj.link == 'object') {
        return obj.link.href;
    }
    else if (typeof obj.link == 'string') {
        return obj.link;
    }
    else if (typeof obj.enclosure == 'object' && typeof obj.enclosure.url == 'string') {
        return obj.enclosure.url;
    }
    return default_string;
};

find_title = function(obj) {
    var default_string = 'No Items in RSS Feed';
    if (obj == null || obj == undefined) {
        return default_string;
    }	
    else if (typeof obj.title.content == 'string') {
        return formatString(obj.title.content);
    }
    else if (typeof obj.title == 'string') {
        return formatString(obj.title);
    }
    else if (typeof obj.title == 'object') {
        return formatString(obj.title[0]);
    }
    return default_string;
};

find_date = function(obj) {
    var default_string = 'Date Unknown';
    if (obj == null || obj == undefined) {
        return default_string;
    }	
    else if (typeof obj.pubDate == 'string') {
		return parse_date(obj.pubDate);
    }
    else if (typeof obj.date == 'string') {
		return parse_date(obj.date);
    }
    else if (typeof obj.published == 'string') {
		return parse_date(obj.published);
    }
    else if (typeof obj.updated == 'string') {
		return parse_date(obj.updated);
    }
    return default_string;
};

find_descr = function(obj) {
    var default_string = 'RSS Feed Invalid. No Description Found.';
    if (obj == null || obj == undefined) {
        return default_string;
    }	
    else if (typeof obj.description == 'string') {
		return formatString(obj.description);
    }
    else if (typeof obj.encoded == 'string') {
		return formatString(obj.encoded);
    }
    else if (typeof obj.content == 'object' && typeof obj.content.content == 'string') {
		return formatString(obj.content.content);
    }
    return default_string;
};

find_author = function(obj) {
    var default_string = 'Unknown Author';
    if (obj == null || obj == undefined) {
        return default_string;
    }	
    else if (typeof obj.creator == 'string') {
		return obj.creator;
    }
    else if ($.isArray(obj.author)) {
        return obj.author[0];
    }
    else if (typeof obj.author == 'object' && typeof obj.author.email == 'string') {
		return obj.author.email;
    }
    else if (typeof obj.author == 'string') {
		return obj.author;
    }
    return default_string;
};

$(document).ready(function() {
	/* Forming the query: */
	var feed = "https://www.google.com/calendar/feeds/6np42lt5s5q6g00d8ig5a1um64%40group.calendar.google.com/public/full-noattendees?futureevents=true&singleevents=true&orderby=starttime&sortorder=ascending";
	feed = feed.replace(/feed:\/\//,'http://'); // Replace feed:// with http://
	var query = 'select * from feed where url="' + feed + '" LIMIT 1';

	/* Forming the URL to YQL: */
	var url = "http://query.yahooapis.com/v1/public/yql?q="+encodeURIComponent(query)+"&format=json&callback=?";

	$.getJSON(url,function(data){
		if (data.query == null || data.query == undefined || data.query.results == null || data.query.results == undefined) {
			// Invalid or Empty RSS Feed - Add Blank/Default Entries
			add_feed_item();
	 	}
	 	else if ($.isArray(data.query.results.item || data.query.results.entry) ) {  //item exists in RSS and entry in ATOM feeds
			$.each(data.query.results.item || data.query.results.entry,function(){
	       		//Normal RSS Feed
	       		add_feed_item(this);
			})
		}
		else {
		    // RSS Feed with only one item in it
			add_feed_item(data.query.results.item || data.query.results.entry || null);
		}
		post_process_feed(this);
	});
});
//---------------------------
// End Common RSS Code
//---------------------------

function add_feed_item(obj) {
    var maxLength = 150;
	$('#rss-js-list-stacks_in_2293_page45').append('<li><a  href="'+ find_link(obj) +
	  '" target="_blank"><p class="rss-js-title">'+ find_title(obj) +
	  '</p><p class="rss-js-date">'+ find_date(obj) + 
	  '</p><p class="rss-js-desc">'+ find_descr(obj).substring(0, maxLength) +
	  '</p></a></li>'
	);
	return;    	        
};
function post_process_feed(obj) {
	if ($().tipTip) { $(".tiptip").tipTip(); }
	return;    	        
};
//-- End RSS JS Stack --//

	return stack;
})(stacks.stacks_in_2293_page45);


// Javascript for stacks_in_2294_page45
// ---------------------------------------------------------------------

// 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_2294_page45 = {};

// 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_2294_page45 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	

//-- Sweet Button Stack v1.5.2 by Joe Workman --//



jQuery.fn.exists = function(){return jQuery(this).length>0;}
$(document).ready(function() {
	function change_button_state() {
        $('#stacks_in_2294_page45 .sweet_button_wrapper').removeClass('animate');
	    if($('#stacks_in_2294_page45 .sweet_button.clicked').exists() && false){
            $('#stacks_in_2294_page45 .sweet_button').removeClass('clicked');
            
            	if ('=' != '[') {
            		$('#stacks_in_2294_page45 .button_icon').html('[');
            	}
            
            if ('Thanks!' != 'Veranstaltungskalender') {
            	$('#stacks_in_2294_page45 .button_label').html('Veranstaltungskalender');
            }		
            
	    }
	    else {
            $('#stacks_in_2294_page45 .sweet_button').addClass('clicked');
            
            	if ('=' != '[') {
            		$('#stacks_in_2294_page45 .button_icon').html('=');
            	}
            
            if ('Thanks!' != 'Veranstaltungskalender') {
            	$('#stacks_in_2294_page45 .button_label').html('Thanks!');
            }		
            
	    }
	}
    
	$('#stacks_in_2294_page45 .sweet_button').click(function() {
		change_button_state();
		
	});
});

//-- End Sweet Button Stack --//


	return stack;
})(stacks.stacks_in_2294_page45);



