
// '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_1_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_1_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_1_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;
	
/**
 *
 * RapidWeaver Fancy Intro stack by Tsooj Media.
 * Version 1.1.1.
 *
 * Visit http://www.tsooj.net for more information on how to use this stacks product for RapidWeaver.
 *
 */

/**
 *
 *  Globals.
 *
 */
var atm_strFancyIntroCookieName = 'atm_FancyIntroDays',
	atm_strFancyIntroDays = '',
	atm_blnFancyIntroSkipBrowser = false,
	atm_strFancyIntroLineHeight = '',
	atm_blnFancyIntroAsync = false;
	
/**
 * Get the value of a cookie with the given name.
 *
 * @example $.cookie('the_cookie');
 * @desc Get the value of a cookie.
 *
 * @param String name The name of the cookie.
 * @return The value of the cookie.
 * @type String
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */
 
(function($){
 	$.cookie = function(key, value, options) {
 		if(arguments.length > 1) {
 			var o = $.extend({}, $.cookie.defaults, options);
 	        if (value === null || value === undefined) {
 	            value = '';
 	            o.expires = -1;
 	        }
 	        if (o.expires.constructor != Date) {
 				var today = new Date();
 				today.setDate(today.getDate() + o.expires);
 				o.expires = today;
 			}
 			// Create the cookie string
 			document.cookie = 
 				key + '=' + value +
 				'; expires=' + o.expires.toUTCString() +
 				(o.path? '; path=' + (o.path) : '') +
 				(o.domain? '; domain=' + (o.domain) : '') +
 				(o.secure? '; secure' : '');
 		} else {
 			if(result = new RegExp(key+"=(.*?)(?:;|$)").exec(document.cookie))
 				return decodeURIComponent(result[1]);
 			return false;
 		}
 	};
 	$.cookie.defaults = {
 		expires: ((0 == 0) ? -1 : 0),
 		path: '/',
 		domain: document.domain,
 		secure: ((document.location.protocol == 'https:') ? true : false)
 	}
})(jQuery);
 

/** 
 *
 * Main Fancy Intro Function.
 *
 */
function atm_ShowFancyIntro() {

	// Hide normal page elements and add Fancy Intro elements.
	$('iframe').hide();
	$('body').css('overflow-y', 'hidden');
	$('<div class="atmFancyIntroBackground"></div>').appendTo('body');
	$('<div class="atmFancyIntroText atmFancyIntroUpperText"></div>').appendTo('body');
	$('<div class="atmFancyIntroText atmFancyIntroLowerText"></div>').appendTo('body');	
	$('<div class="atmFancyIntroLine"></div>').appendTo('body');
	$('.atmFancyIntroUpperText').html($('.atmFancyIntroUpperTextHolder').html());
	$('.atmFancyIntroLowerText').html($('.atmFancyIntroLowerTextHolder').html());	

	// Opera percentage fix.
	if ($.browser.opera) { $('.atmFancyIntroLine').css('height', '2px'); }
	
	// IE7 margin fix.	
	if (navigator.userAgent.match(/MSIE (\d+(?:\.\d+)+(?:b\d*)?)/) == "MSIE 7.0,7.0") {
		atm_strFancyIntroLineHeight = String(parseInt(100 + parseInt(32))) + '% !important';	
		$('.atmFancyIntroText').css('line-height', atm_strFancyIntroLineHeight);
	} else {
		$('.atmFancyIntroText').css('line-height', '100% !important');
	}
		
	$('.atmFancyIntroBackground').css('visibility', 'visible');
	$('body').css('visibility', 'hidden');
	$('.atmFancyIntroText').css('visibility', 'visible');
	$('.atmFancyIntroLine').css('visibility', 'visible');

	// Fancy the Intro.
	$('.atmFancyIntroLine').delay(2500).animate({ width: '+=100%' }, 3000, function() {
		$('.atmFancyIntroLine').animate({ height: '+=100%', top: '-=50%' }, 3000, function() {
			$('body').attr('style','');
			$('body').css('visibility', 'visible');
			$('.atmFancyIntroText').css('visibility', 'hidden');
			$('.atmFancyIntroBackground').css('visibility', 'hidden');

			// IE Filter Fix.
			if ($.browser.msie) { $('.atmFancyIntroLine').css('filter', ''); }

			// Fadeout and remove Fancy Intro elements.
			$('.atmFancyIntroLine').animate({ opacity: 0 }, 2000, function() {
				$('.atmFancyIntroBackground').remove();
				$('.atmFancyIntroText').remove();
				$('.atmFancyIntroLine').remove();
				$('#stacks_in_1_page0').remove();
				$('iframe').show();
				$('body').css('overflow-y', 'visible');
			});
		});
	});
};


/** 
 *
 * Add Hour(s) Function.
 *
 */
Date.prototype.atm_addHours = function(h){
    this.setHours(this.getHours()+h);
    return this;
}



/** 
 *
 * Document Ready Actions.
 *
 */
 
$(document).ready(function() {

	// Skip old IE6 Browser
	if (navigator.userAgent.match(/MSIE (\d+(?:\.\d+)+(?:b\d*)?)/) == "MSIE 6.0,6.0") {
		atm_blnFancyIntroSkipBrowser = true;
	} else {
		atm_strFancyIntroDays = $.cookie(atm_strFancyIntroCookieName);
		if ((atm_strFancyIntroDays == '') || (0 == 0)) {

			// Show the Fancy Intro.
			atm_ShowFancyIntro();
			
			// Hide for given number of Days or Hours.
			if ((false) && (0 != 0)) {
				$.cookie(atm_strFancyIntroCookieName, 0, { expires: new Date().atm_addHours(0)});
			} else {
				$.cookie(atm_strFancyIntroCookieName, 0);
			}
		} else {
			$('.atmFancyIntroBackground').remove();
		}	
	}

});

	return stack;
})(stacks.stacks_in_1_page0);


// Javascript for stacks_in_17_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_17_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_17_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;
	
/*** danceSwitcher - A unique content switcher with a dazzling effect**** Copyright (C) 2011 by Adrian Sinclair http://forrst.me/adrusi**** This program is free software: you can redistribute it and/or modify** it under the terms of the GNU General Public License as published by** the Free Software Foundation, either version 3 of the License, or** (at your option) any later version.**** This program is distributed in the hope that it will be useful,** but WITHOUT ANY WARRANTY; without even the implied warranty of** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the** GNU General Public License for more details.**** You should have received a copy of the GNU General Public License** along with this program.  If not, see <http://www.gnu.org/licenses/>.*//* Adapted to Stacks by Mauricio Sabene at RWExtras.com version 2.0 */(function($) {  $.fn.extend({    danceSwitcher: function(options) {      var defaults = {        speed: 1,        collapsedWidth: 230,        collapsedHeight: 80,        collapsedMPB: [10, 10, 10, 10],        collapsedLineHeight: '80px',        activeLineHeight: '48px',        animationSequence: 'prevnext'      },      options = $.extend(defaults, options);      return $(this).each(function() {        var $this = $(this),            speed = options.speed,            first = $(this).children('div').eq(0), // the first child of the switcher, so that it is open by default            i;          $this.css('height', ($this.children('div').length - 1) * (options.collapsedHeight + options.collapsedMPB[0] + options.collapsedMPB[2]) + 'px'); // set the height of the switcher to the appropriate value        first.addClass('active'); // make the first box active        for (i = 1; i < $this.children('div').length; i++) { // position all of the boxes appropriately          $this.children('div').eq(i).css('top', (i - 1) * (options.collapsedHeight + options.collapsedMPB[0] + options.collapsedMPB[2]) + 'px');        }        if (options.animationSequence === 'prevnext') { // using the default animation          $this.children('div').click(function() { // bind a click event to all the boxes            var $$this = $(this);            if (!$$this.hasClass('active') && !$this.hasClass('inprogress')) { // if the box clicked isn't already active and there isn't already animation going on              var next, prev;              $this.addClass('inprogress'); // make sure 2 animations don't happen at once              $this.children('.active').children('.ds_content').animate({ // fade out the content of the active box                opacity: 0              }, 750 / speed);              $this.children('.active').children('h3').animate({ // animate the active header line height                lineHeight: options.collapsedLineHeight              }, 750 / speed);              if ($$this.next(':not(.active)').get(0)) { // if the clicked box isn't last                next = $(this).next();                prev = false;              }              else {                next = $$this.prev();                prev = true;              }              $$this.css({ // convert the height property of the clicked box to the bottom property                bottom: $this.height() - $$this.position().top - (options.collapsedHeight + options.collapsedMPB[0] + options.collapsedMPB[2]),                height: 'auto'              });              $this.children('.active').animate({                top: next.css('top'), // move the active box to the vertical position of its final destination                height: options.collapsedHeight // make its height the height of a collapsed box              }, 750 / speed, function() {                $$this.animate({ // move the clicked box out until it's the same dimensions as the previously active box                  left: 0,                  right: (options.collapsedWidth + options.collapsedMPB[1] + options.collapsedMPB[3])                }, 500 / speed, function() {                  next.animate({ // move the box next to the previously active box (to the right) to the place where the clicked box used to be                    top: $$this.css('top')                  }, 750 / speed, function() {                    $this.children('.active').animate({ // move the previously active box to where the last animated box just was                      left: next.position().left,                      right: 0                    }, 750 / speed, function() {                      $$this.children('h3').animate({ // animate the line height of the clicked box to the height of an active box                        lineHeight: options.activeLineHeight // , paddingBottom: 0                      }, 750 / speed );                      $$this.children('.ds_content').animate({ // and make its content opaque                        opacity: 1                      }, 1500 / speed ); // changed from 750 (MS)                      $$this.animate({ // and give it the dimensions of an active box                        top: 0,                        bottom: 0                      }, 750 / speed, function() {                        if (!prev) {                          $this.children('.active').insertAfter(next); // if the "next" box was the box underneath the now active box, mave its position in the DOM to where it now is visually on the page                        }                        else if (prev) {                          $this.children('.active').insertBefore(next); // same thing but if it was above the now active box                        }                        $this.children('.active').removeClass('active'); // remove the active class from the box that is no longer active                        $$this.addClass('active'); // and add it to the now active box                        $$this.prependTo($$this.parent()); // move the now active box to the top of the switcher DOM tree                        $this.removeClass('inprogress'); // and set the switcher to not animating                      });                    });                  });                });              });            }          });        }        else if (options.animationSequence === 'firstlast'){          $this.children('div').click(function() {            var $$this = $(this), active = $this.children('.active'), last = !$$this.next().get(0), alreadyCalled = false,                callback = function() {                  active.css('bottom', 'auto').animate({                    right: 0,                    left: $this.width() - (options.collapsedWidth + options.collapsedMPB[1] + options.collapsedMPB[3])                  }, 750 / speed, function() {                    $$this.animate({                      top: 0,                      bottom: 0                    }, 750 / speed).children('h3').animate({                      lineHeight: options.activeLineHeight // , paddingBottom: 0                    }, 750 / speed);					$$this.children('.ds_content').animate({                      opacity: 1                    }, 1500 / speed, function() { // changed from 750 (MS)                      if (!last) {                        active.appendTo($this).removeClass('active');					  }                      else {                        active.prependTo($this).removeClass('active');					  }	                      $$this.prependTo($this).addClass('active');                      $this.removeClass('inprogress');                    });                  });                };            if (!$$this.hasClass('active') && !$this.hasClass('inprogress')) {              $this.addClass('inprogress');              active.children('h3').animate({                lineHeight: options.collapsedLineHeight              }, 750 / speed);              active.children('.ds_content').animate({                opacity: 0              });              active.animate({                top: (!last) ? $this.height() - options.collapsedHeight - options.collapsedMPB[0] - options.collapsedMPB[2] : 0,                bottom: (!last) ? 0 : $this.height() - options.collapsedHeight - options.collapsedMPB[0] - options.collapsedMPB[2]              }, 750 / speed, function() {                active.css({                  top: (!last) ? $this.height() - active.height() - options.collapsedMPB[0] - options.collapsedMPB[2] : 0,                  height: active.height()                });                $$this.css({                  bottom: $this.height() - $$this.position().top - (options.collapsedHeight + options.collapsedMPB[0] + options.collapsedMPB[2]),                  height: 'auto'                });                $$this.animate({                  left: 0,                  right: (options.collapsedWidth + options.collapsedMPB[1] + options.collapsedMPB[3])                }, 500 / speed, function() {                  if (!last) {                    $$this.nextAll('div').each(function() {                      var $$$this = $(this);                      $$$this.animate({                        top: $$$this.position().top - (options.collapsedHeight + options.collapsedMPB[0] + options.collapsedMPB[2])                      }, 750 / speed, function() {                        if (!alreadyCalled) callback();                        alreadyCalled = true;                      });                    });                  }                  else {                    $$this.prevAll('div:not(.active)').each(function() {                      var $$$this = $(this);                      $$$this.animate({                        top: $$$this.position().top + (options.collapsedHeight + options.collapsedMPB[0] + options.collapsedMPB[2])                      }, 750 / speed, function() {                        if (!alreadyCalled) callback();                        alreadyCalled = true;                      });                    });                  }                });              });            }          });        }      });    }  });})(jQuery);jQuery(document).ready(function(){jQuery('#switcherstacks_in_17_page0').danceSwitcher({        speed: 3,        collapsedWidth: 180,        collapsedHeight: 70,        collapsedMPB: [10, 10, 10, 10],        collapsedLineHeight: '70px',        activeLineHeight: '48px',        animationSequence: 'firstlast'      });});
	return stack;
})(stacks.stacks_in_17_page0);


// Javascript for stacks_in_38_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_38_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_38_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;
	
//-- Like It Stack v1.1.0 by Joe Workman --//

/*  Tallest jQuery Plugin
 *	@author	nickf
 *	@date	2009-08-19
 *	@version 1.0 $Id: jquery.tallest.js 100 2009-08-19 00:40:09Z spadgos $
 */
jQuery(function($) {
	$.fn.tallest = function()       { return this._extremities({ 'aspect' : 'height', 'max' : true  })[0] };
	$.fn.tallestSize = function()   { return this._extremities({ 'aspect' : 'height', 'max' : true  })[1] };
	$.fn.shortest = function()      { return this._extremities({ 'aspect' : 'height', 'max' : false })[0] };
	$.fn.shortestSize = function()  { return this._extremities({ 'aspect' : 'height', 'max' : false })[1] };
	$.fn.widest = function()        { return this._extremities({ 'aspect' : 'width',  'max' : true  })[0] };
	$.fn.widestSize = function()    { return this._extremities({ 'aspect' : 'width',  'max' : true  })[1] };
	$.fn.thinnest = function()      { return this._extremities({ 'aspect' : 'width',  'max' : false })[0] };
	$.fn.thinnestSize = function()  { return this._extremities({ 'aspect' : 'width',  'max' : false })[1] };
	$.fn._extremities = function(options) {
		var defaults = {
			aspect : 'height', // or 'width'
			max : true	// or false to find the min
		};
		options = $.extend(defaults, options);
		if (this.length < 2) {
			return [this, this[options.aspect]()];
		}
		var bestIndex = 0,
			bestSize = this.eq(0)[options.aspect](),
			thisSize
		;
		for (var i = 1; i < this.length; ++i) {
			thisSize = this.eq(i)[options.aspect]();
			if ((options.max && thisSize > bestSize) || (!options.max && thisSize < bestSize)) {
				bestSize = thisSize;
				bestIndex = i;
			}
		}
		return [ this.eq(bestIndex), bestSize ];
	};
});
(function($){ 
    $.getScript = function(url, callback, cache){
    	$.ajax({
    			type: "GET",
    			url: url,
    			success: callback,
    			dataType: "script",
    			cache: true
    	});
    };
})(jQuery)

$(document).ready(function() {	
    
// Twitter Buttons
switch ( 2 ) {
case 1:
	$('#like_twitter1 a').attr('data-count', 'vertical');
    $.getScript('http://platform.twitter.com/widgets.js');
    break;
case 2:
    $('#like_twitter2 a').attr('data-count', 'horizontal');
    $.getScript('http://platform.twitter.com/widgets.js');
    break;
case 3:
    $('#like_twitter3 a').attr('data-count', 'none');
    $.getScript('http://platform.twitter.com/widgets.js');
    break;
default:
    // Do Nothing
}
// Google Buttons
switch ( 4 ) {
case 1:
	$('#like_google1 .like_google').html('<g:plusone size="small" count="false"></g:plusone>');
    $.getScript('https://apis.google.com/js/plusone.js');
    break;
case 2:
	$('#like_google2 .like_google').html('<g:plusone size="small" count="true"></g:plusone>');
    $.getScript('https://apis.google.com/js/plusone.js');
    break;
case 3:
	$('#like_google3 .like_google').html('<g:plusone size="medium" count="false"></g:plusone>');
    $.getScript('https://apis.google.com/js/plusone.js');
    break;
case 4:
	$('#like_google4 .like_google').html('<g:plusone size="medium" count="true"></g:plusone>');
    $.getScript('https://apis.google.com/js/plusone.js');
    break;
case 5:
	$('#like_google5 .like_google').html('<g:plusone size="standard" count="false"></g:plusone>');
    $.getScript('https://apis.google.com/js/plusone.js');
    break;
case 6:
	$('#like_google6 .like_google').html('<g:plusone size="standard" count="true"></g:plusone>');
    $.getScript('https://apis.google.com/js/plusone.js');
    break;
case 7:
	$('#like_google7 .like_google').html('<g:plusone size="tall" count="true"></g:plusone>');
    $.getScript('https://apis.google.com/js/plusone.js');
    break;
default:
    // Do Nothing
}

// Facebook Buttons
switch ( 2 ) {
case 1:
    $('#like_facebook1 .like_facebook').html('<fb:like show_faces="false" width="280"></fb:like>');
    break;
case 2:
    $('#like_facebook2 .like_facebook').html('<fb:like layout="button_count" show_faces="false" width="50"></fb:like>');
    break;
case 3:
    $('#like_facebook3 .like_facebook').html('<fb:like layout="box_count" show_faces="false" width="50"></fb:like>');
    break;
case 4:
    $('#like_facebook4 .like_facebook').html('<fb:like show_faces="false" width="450" action="recommend"></fb:like>');
    break;
case 5:
    $('#like_facebook5 .like_facebook').html('<fb:like layout="button_count" show_faces="false" width="50" action="recommend"></fb:like>');
    break;
case 6:
    $('#like_facebook6 .like_facebook').html('<fb:like layout="box_count" show_faces="false" width="50" action="recommend"></fb:like>');
    break;
default:
    // Do Nothing
}
// Digg Buttons
switch ( 3 ) {
case 1:
    $('#like_digg1 a').addClass('DiggWide');
    $.getScript('http://widgets.digg.com/buttons.js');
    break;
case 2:
    $('#like_digg2 a').addClass('DiggMedium');
    $.getScript('http://widgets.digg.com/buttons.js');
    break;
case 3:
    $('#like_digg3 a').addClass('DiggCompact');
    $.getScript('http://widgets.digg.com/buttons.js');
    break;
case 4:
    $('#like_digg4 a').addClass('DiggIcon');
    $.getScript('http://widgets.digg.com/buttons.js');
    break;
default:
    // Do Nothing
}
// LinkedIn Buttons
switch ( 2 ) {
case 1:
    $('#like_linkedin1').html('<script type="in/share" data-counter="top"></script>');
    $.getScript('http://platform.linkedin.com/in.js');
    break;
case 2:
	$('#like_linkedin2').html('<script type="in/share" data-counter="right"></script>');
	$.getScript('http://platform.linkedin.com/in.js');
	break;
case 3:
	$('#like_linkedin3').html('<script type="in/share"></script>');
	$.getScript('http://platform.linkedin.com/in.js');
	break;
default:
    // Do Nothing
}
// Evernote Button
if (2 != 0) {
    $.getScript('http://static.evernote.com/noteit.js');
}
//Email Button
$('.like_email a').attr('href','mailto:?subject=Check out this webpage&body='+location.href);
// Make all buttons have the same height and display it
// $('.like_button_wrapper').height( $('.like_button').tallest().height() );
});

//-- End Like It Stack --//
	return stack;
})(stacks.stacks_in_38_page0);



