
// '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_46_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_46_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_46_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;
	
//-- Totem RSS Stack v1.1.1 by Joe Workman --//

/*  Totem Ticker Plugin
 *	Copyright (c) 2011 Zach Dunn / www.buildinternet.com
 *	Released under MIT License */
(function(a){if(!a.omr){a.omr=new Object()}a.omr.totemticker=function(c,b){var d=this;d.el=c;d.$el=a(c);d.$el.data("omr.totemticker",d);d.init=function(){d.options=a.extend({},a.omr.totemticker.defaultOptions,b);d.ticker;d.format_ticker();d.setup_nav();d.start_interval()};d.start_interval=function(){clearInterval(d.ticker);if(d.options.direction=="up"){d.ticker=setInterval(function(){d.$el.find("li:last").detach().prependTo(d.$el).css("marginTop","-"+d.options.row_height);d.$el.find("li:first").animate({marginTop:"0px",},d.options.speed,function(){})},d.options.interval)}else{d.ticker=setInterval(function(){d.$el.find("li:first").animate({marginTop:"-"+d.options.row_height,},d.options.speed,function(){a(this).detach().css("marginTop","0").appendTo(d.$el)})},d.options.interval)}};d.reset_interval=function(){clearInterval(d.ticker);d.start_interval()};d.stop_interval=function(){clearInterval(d.ticker)};d.format_ticker=function(){if(typeof(d.options.max_items)!="undefined"&&d.options.max_items!=null){var f=d.options.row_height.replace(/px/i,"");var e=f*d.options.max_items;d.$el.css({height:e+"px",overflow:"hidden",})}else{d.$el.css({overflow:"hidden",})}};d.setup_nav=function(){if(typeof(d.options.stop)!="undefined"&&d.options.stop!=null){a(d.options.stop).click(function(){d.stop_interval();return false})}if(typeof(d.options.start)!="undefined"&&d.options.start!=null){a(d.options.start).click(function(){d.start_interval();return false})}if(typeof(d.options.previous)!="undefined"&&d.options.previous!=null){a(d.options.previous).click(function(){d.$el.find("li:last").detach().prependTo(d.$el).css("marginTop","-"+d.options.row_height);d.$el.find("li:first").animate({marginTop:"0px",},d.options.speed,function(){d.reset_interval()});return false})}if(typeof(d.options.next)!="undefined"&&d.options.next!=null){a(d.options.next).click(function(){d.$el.find("li:first").animate({marginTop:"-"+d.options.row_height,},d.options.speed,function(){a(this).detach().css("marginTop","0px").appendTo(d.$el);d.reset_interval()});return false})}if(typeof(d.options.mousestop)!="undefined"&&d.options.mousestop===true){d.$el.mouseenter(function(){d.stop_interval()}).mouseleave(function(){d.start_interval()})}};d.debug_info=function(){console.log(d.options)};d.init()};a.omr.totemticker.defaultOptions={message:"Ticker Loaded",next:null,previous:null,stop:null,start:null,row_height:"100px",speed:800,interval:4000,max_items:null,mousestop:false,direction:"down",};a.fn.totemticker=function(b){return this.each(function(){(new a.omr.totemticker(this,b))})}})(jQuery);

jQuery.fn.exists = function(){return jQuery(this).length>0;}

//---------------------------
// Start Common RSS Code
//---------------------------
formatString = function(str) {
	str = str.replace(/<[^>]+>/ig,'');
	str = str.replace(/\n/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);
    }
    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://gettingthroughcustoms.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 get_link(obj) {
	return false == true ? null : 'href="'+ find_link(obj) +'"';
}
function add_feed_item(obj) {
    var maxLength = 150;
    if (true == true) {
		$('#totem_stacks_in_46_page0').append(
			'<li><div class="feed_content"><a class="title tiptip" title="' + find_date(obj) +
		  	' - ' + find_descr(obj).substring(0, maxLength) + '...'+
			'" ' + get_link(obj) +
			' target="_self">'+ find_title(obj) +'</a>'+ 
			'<p class="date">'+ find_date(obj) +'</p>'+
			'<p class="desc">'+ find_descr(obj).substring(0, maxLength) +'...</p>'+
	    	'</div></li>'
		);
    }
    else {
		$('#totem_stacks_in_46_page0').append(
			'<li><a class="title centered tiptip" title="' + find_date(obj) +
		  	' - ' + find_descr(obj).substring(0, maxLength) + '...'+
			'" ' + get_link(obj) +
			' target="_self">'+ find_title(obj) +'</a>'+ 
	    	'</li>'
		);    
    }

	return;    	        
};

function post_process_feed(obj) {
	$('#totem_stacks_in_46_page0').totemticker({
		row_height	:	'150px',
		next		:	'#totem_next_stacks_in_46_page0',
		previous	:	'#totem_prev_stacks_in_46_page0',
		stop		:	'#totem_stop',
		start		:	'#totem_start',
		mousestop	:	true,
        speed       :   1800,
        interval    :   8000,
        max_items   :   1
	});	

	var bg_color = $('#stacks_in_46_page0').css('background-color');
	if (bg_color) { 
		$('#stacks_in_46_page0').css({'background-color': 'transparent'});	
		$('#totem_stacks_in_46_page0').css({'background-color': bg_color });	
	}
	var bg_border_style = $('#stacks_in_46_page0').css('border-bottom-style');
	if (bg_border_style) { 
		var bg_border_color  = $('#stacks_in_46_page0').css('border-bottom-color');
		var bg_border_top 	 = $('#stacks_in_46_page0').css('border-top-width');
		var bg_border_right  = $('#stacks_in_46_page0').css('border-right-width');
		var bg_border_bottom = $('#stacks_in_46_page0').css('border-bottom-width');
		var bg_border_left 	 = $('#stacks_in_46_page0').css('border-left-width');
		$('#stacks_in_46_page0').css({'border-width':0});	
		$('#stacks_in_46_page0 .totem_wrapper').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
		});	
	}

	if (! $('#totem_next_stacks_in_46_page0 img').exists()) {
	    $('#totem_next_stacks_in_46_page0').remove();
	}
	if (! $('#totem_prev_stacks_in_46_page0 img').exists()) {
	    $('#totem_prev_stacks_in_46_page0').remove();
	}
		
	// Take the bottom borders into effect when calculating the height
	$('#totem_stacks_in_46_page0').height( (1 * 150) + (1 - 1));
	$('#totem_stacks_in_46_page0 .feed_content').css('max-height', 150 - 20);

	// Set with Width for centered titles. Table cells cannot be 100% so have to find the width for it. 
	$('#totem_stacks_in_46_page0 li a.centered').width($('#totem_stacks_in_46_page0').width());
	
	if ($().tipTip) { $(".tiptip").tipTip(); }
};

//-- End Totem Stack --//

	return stack;
})(stacks.stacks_in_46_page0);


// Javascript for stacks_in_32_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_32_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_32_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;
	

//-- HTML5 Audio Stack v1.2.0 by Joe Workman --//
// This is a customized build of html5media - http://github.com/etianen/html5media/
(function(){function n(a){if(!a||typeof a!="object")return a;var b=new a.constructor,e;for(e in a)a.hasOwnProperty(e)&&(b[e]=n(a[e]));return b}function k(a,b){if(a){var e,d=0,c=a.length;if(c===void 0)for(e in a){if(b.call(a[e],e,a[e])===!1)break}else for(e=a[0];d<c&&b.call(e,d,e)!==!1;e=a[++d]);return a}}function l(a,b,e){if(typeof b!="object")return a;a&&b&&k(b,function(d,b){if(!e||typeof b!="function")a[d]=b});return a}function f(a){var b=a.indexOf(".");if(b!=-1){var e=a.slice(0,b)||"*",d=a.slice(b+
1,a.length),c=[];k(document.getElementsByTagName(e),function(){this.className&&this.className.indexOf(d)!=-1&&c.push(this)});return c}}function r(a){a=a||window.event;a.preventDefault?(a.stopPropagation(),a.preventDefault()):(a.returnValue=!1,a.cancelBubble=!0);return!1}function m(a,b,e){a[b]=a[b]||[];a[b].push(e)}function s(){return"_"+(""+Math.random()).slice(2,10)}function o(a,h,e){var d=this,j=null,f=!1,o,u,i=[],w={},p={},t,x,v,y,q,z;l(d,{id:function(){return t},isLoaded:function(){return j!==
null&&j.fp_play!==void 0&&!f},getParent:function(){return a},hide:function(b){if(b)a.style.height="0px";if(d.isLoaded())j.style.height="0px";return d},show:function(){a.style.height=z+"px";if(d.isLoaded())j.style.height=q+"px";return d},isHidden:function(){return d.isLoaded()&&parseInt(j.style.height,10)===0},load:function(b){if(!d.isLoaded()&&d._fireEvent("onBeforeLoad")!==!1){var u=0;k(c,function(){this.unload(function(){if(++u==c.length){if((o=a.innerHTML)&&!flashembed.isSupported(h.version))a.innerHTML=
"";if(b)b.cached=!0,m(p,"onLoad",b);flashembed(a,h,{config:e})}})})}return d},unload:function(b){if(this.isFullscreen()&&/WebKit/i.test(navigator.userAgent))return b&&b(!1),d;if(o.replace(/\s/g,"")!==""){if(d._fireEvent("onBeforeUnload")===!1)return b&&b(!1),d;f=!0;try{j&&(j.fp_close(),d._fireEvent("onUnload"))}catch(e){}setTimeout(function(){j=null;a.innerHTML=o;f=!1;b&&b(!0)},50)}else b&&b(!1);return d},getClip:function(a){a===void 0&&(a=y);return i[a]},getCommonClip:function(){return u},getPlaylist:function(){return i},
getPlugin:function(a){var e=w[a];if(!e&&d.isLoaded()){var c=d._api().fp_getPlugin(a);c&&(e=new b(a,c,d),w[a]=e)}return e},getScreen:function(){return d.getPlugin("screen")},getControls:function(){return d.getPlugin("controls")._fireEvent("onUpdate")},getLogo:function(){try{return d.getPlugin("logo")._fireEvent("onUpdate")}catch(a){}},getPlay:function(){return d.getPlugin("play")._fireEvent("onUpdate")},getConfig:function(a){return a?n(e):e},getFlashParams:function(){return h},loadPlugin:function(a,
e,c,h){typeof c=="function"&&(h=c,c={});var u=h?s():"_";d._api().fp_loadPlugin(a,e,c,u);e={};e[u]=h;h=new b(a,null,d,e);return w[a]=h},getState:function(){return d.isLoaded()?j.fp_getState():-1},play:function(a,b){var e=function(){a!==void 0?d._api().fp_play(a,b):d._api().fp_play()};d.isLoaded()?e():f?setTimeout(function(){d.play(a,b)},50):d.load(function(){e()});return d},getVersion:function(){if(d.isLoaded()){var a=j.fp_getVersion();a.push("flowplayer.js 3.2.6");return a}return"flowplayer.js 3.2.6"},
_api:function(){if(!d.isLoaded())throw"Flowplayer "+d.id()+" not loaded when calling an API method";return j},setClip:function(a){d.setPlaylist([a]);return d},getIndex:function(){return v},_swfHeight:function(){return j.clientHeight}});k("Click*,Load*,Unload*,Keypress*,Volume*,Mute*,Unmute*,PlaylistReplace,ClipAdd,Fullscreen*,FullscreenExit,Error,MouseOver,MouseOut".split(","),function(){var a="on"+this;if(a.indexOf("*")!=-1){var a=a.slice(0,a.length-1),b="onBefore"+a.slice(2);d[b]=function(a){m(p,
b,a);return d}}d[a]=function(b){m(p,a,b);return d}});k("pause,resume,mute,unmute,stop,toggle,seek,getStatus,getVolume,setVolume,getTime,isPaused,isPlaying,startBuffering,stopBuffering,isFullscreen,toggleFullscreen,reset,close,setPlaylist,addClip,playFeed,setKeyboardShortcutsEnabled,isKeyboardShortcutsEnabled".split(","),function(){var a=this;d[a]=function(b,e){if(!d.isLoaded())return d;var c=null,c=b!==void 0&&e!==void 0?j["fp_"+a](b,e):b===void 0?j["fp_"+a]():j["fp_"+a](b);return c==="undefined"||
c===void 0?d:c}});d._fireEvent=function(a){typeof a=="string"&&(a=[a]);var b=a[0],c=a[1],h=a[2],t=a[3],f=0;e.debug&&console.log("$f.fireEvent",[].slice.call(a));!d.isLoaded()&&b=="onLoad"&&c=="player"&&(j=j||document.getElementById(x),q=d._swfHeight(),k(i,function(){this._fireEvent("onLoad")}),k(w,function(a,b){b._fireEvent("onUpdate")}),u._fireEvent("onLoad"));if(!(b=="onLoad"&&c!="player")){if(b=="onError"&&(typeof c=="string"||typeof c=="number"&&typeof h=="number"))c=h,h=t;if(b=="onContextMenu")k(e.contextMenu[c],
function(a,b){b.call(d)});else if(b=="onPluginEvent"||b=="onBeforePluginEvent"){if(t=w[c.name||c])return t._fireEvent("onUpdate",c),t._fireEvent(h,a.slice(3))}else{if(b=="onPlaylistReplace"){i=[];var l=0;k(c,function(){i.push(new g(this,l++,d))})}if(b=="onClipAdd"){if(c.isInStream)return;c=new g(c,h,d);i.splice(h,0,c);for(f=h+1;f<i.length;f++)i[f].index++}var v=!0;if(typeof c=="number"&&c<i.length&&(y=c,(a=i[c])&&(v=a._fireEvent(b,h,t)),!a||v!==!1))v=u._fireEvent(b,h,t,a);k(p[b],function(){v=this.call(d,
c,h);this.cached&&p[b].splice(f,1);if(v===!1)return!1;f++});return v}}};if(typeof a=="string"){var A=document.getElementById(a);if(!A)throw"Flowplayer cannot access element: "+a;a=A}(function(){function j(a){var b=d.hasiPadSupport&&d.hasiPadSupport();if(/iPad|iPhone|iPod/i.test(navigator.userAgent)&&!/.flv$/i.test(i[0].url)&&!b)return!0;!d.isLoaded()&&d._fireEvent("onBeforeClick")!==!1&&d.load();return r(a)}$f(a)?($f(a).getParent().innerHTML="",v=$f(a).getIndex(),c[v]=d):(c.push(d),v=c.length-1);
z=parseInt(a.style.height,10)||a.clientHeight;t=a.id||"fp"+s();x=h.id||t+"_api";h.id=x;e.playerId=t;typeof e=="string"&&(e={clip:{url:e}});if(typeof e.clip=="string")e.clip={url:e.clip};e.clip=e.clip||{};if(a.getAttribute("href",2)&&!e.clip.url)e.clip.url=a.getAttribute("href",2);u=new g(e.clip,-1,d);e.playlist=e.playlist||[e.clip];var f=0;k(e.playlist,function(){var a=this;typeof a=="object"&&a.length&&(a={url:""+a});k(e.clip,function(b,c){c!==void 0&&a[b]===void 0&&typeof c!="function"&&(a[b]=c)});
e.playlist[f]=a;a=new g(a,f,d);i.push(a);f++});k(e,function(a,b){if(typeof b=="function"){if(u[a])u[a](b);else m(p,a,b);delete e[a]}});k(e.plugins,function(a,c){c&&(w[a]=new b(a,c,d))});if(!e.plugins||e.plugins.controls===void 0)w.controls=new b("controls",null,d);w.canvas=new b("canvas",null,d);o=a.innerHTML;setTimeout(function(){o.replace(/\s/g,"")!==""?a.addEventListener?a.addEventListener("click",j,!1):a.attachEvent&&a.attachEvent("onclick",j):(a.addEventListener&&a.addEventListener("click",r,
!1),d.load())},0)})()}function q(a){this.length=a.length;this.each=function(b){k(a,b)};this.size=function(){return a.length}}var g=function(a,b,c){var d=this,j={},f={};d.index=b;typeof a=="string"&&(a={url:a});l(this,a,!0);k("Begin*,Start,Pause*,Resume*,Seek*,Stop*,Finish*,LastSecond,Update,BufferFull,BufferEmpty,BufferStop".split(","),function(){var a="on"+this;if(a.indexOf("*")!=-1){var a=a.slice(0,a.length-1),i="onBefore"+a.slice(2);d[i]=function(a){m(f,i,a);return d}}d[a]=function(b){m(f,a,b);
return d};b==-1&&(d[i]&&(c[i]=d[i]),d[a]&&(c[a]=d[a]))});l(this,{onCuepoint:function(a,i){if(arguments.length==1)return j.embedded=[null,a],d;typeof a=="number"&&(a=[a]);var f=s();j[f]=[a,i];c.isLoaded()&&c._api().fp_addCuepoints(a,b,f);return d},update:function(a){l(d,a);c.isLoaded()&&c._api().fp_updateClip(a,b);var i=c.getConfig();l(b==-1?i.clip:i.playlist[b],a,!0)},_fireEvent:function(a,i,g,p){if(a=="onLoad")return k(j,function(a,d){d[0]&&c._api().fp_addCuepoints(d[0],b,a)}),!1;p=p||d;if(a=="onCuepoint"){var t=
j[i];if(t)return t[1].call(c,p,g)}if(i&&"onBeforeBegin,onMetaData,onStart,onUpdate,onResume".indexOf(a)!=-1&&(l(p,i),i.metaData))p.duration?p.fullDuration=i.metaData.duration:p.duration=i.metaData.duration;var x=!0;k(f[a],function(){x=this.call(c,p,i,g)});return x}});if(a.onCuepoint){var g=a.onCuepoint;d.onCuepoint.apply(d,typeof g=="function"?[g]:g);delete a.onCuepoint}k(a,function(b,c){typeof c=="function"&&(m(f,b,c),delete a[b])});if(b==-1)c.onCuepoint=this.onCuepoint},b=function(a,b,c,d){var j=
this,f={},g=!1;d&&l(f,d);k(b,function(a,c){typeof c=="function"&&(f[a]=c,delete b[a])});l(this,{animate:function(d,i,g){if(!d)return j;typeof i=="function"&&(g=i,i=500);if(typeof d=="string"){var k=d,d={};d[k]=i;i=500}if(g){var t=s();f[t]=g}i===void 0&&(i=500);b=c._api().fp_animate(a,d,i,t);return j},css:function(d,f){if(f!==void 0){var g={};g[d]=f;d=g}b=c._api().fp_css(a,d);l(j,b);return j},show:function(){this.display="block";c._api().fp_showPlugin(a);return j},hide:function(){this.display="none";
c._api().fp_hidePlugin(a);return j},toggle:function(){this.display=c._api().fp_togglePlugin(a);return j},fadeTo:function(b,d,h){typeof d=="function"&&(h=d,d=500);if(h){var g=s();f[g]=h}this.display=c._api().fp_fadeTo(a,b,d,g);this.opacity=b;return j},fadeIn:function(a,b){return j.fadeTo(1,a,b)},fadeOut:function(a,b){return j.fadeTo(0,a,b)},getName:function(){return a},getPlayer:function(){return c},_fireEvent:function(b,d){if(b=="onUpdate"){var h=c._api().fp_getPlugin(a);if(!h)return;l(j,h);delete j.methods;
g||(k(h.methods,function(){var b=""+this;j[b]=function(){var d=[].slice.call(arguments),d=c._api().fp_invoke(a,b,d);return d==="undefined"||d===void 0?j:d}}),g=!0)}return(h=f[b])?(h=h.apply(j,d),b.slice(0,1)=="_"&&delete f[b],h):j}})},c=[];window.flowplayer=window.$f=function(){var a=null,b=arguments[0];if(!arguments.length)return k(c,function(){if(this.isLoaded())return a=this,!1}),a||c[0];if(arguments.length==1)if(typeof b=="number")return c[b];else{if(b=="*")return new q(c);k(c,function(){if(this.id()==
b.id||this.id()==b||this.getParent()==b)return a=this,!1});return a}if(arguments.length>1){var e=arguments[1],d=arguments.length==3?arguments[2]:{};typeof e=="string"&&(e={src:e});e=l({bgcolor:"#000000",version:[9,0],expressInstall:"http://static.flowplayer.org/swf/expressinstall.swf",cachebusting:!1},e);if(typeof b=="string")if(b.indexOf(".")!=-1){var g=[];k(f(b),function(){g.push(new o(this,n(e),n(d)))});return new q(g)}else{var m=document.getElementById(b);return new o(m!==null?m:b,e,d)}else if(b)return new o(b,
e,d)}return null};l(window.$f,{fireEvent:function(){var a=[].slice.call(arguments),b=$f(a[0]);return b?b._fireEvent(a.slice(1)):null},addPlugin:function(a,b){o.prototype[a]=b;return $f},each:k,extend:l});if(typeof jQuery=="function")jQuery.fn.flowplayer=function(a,b){if(!arguments.length||typeof arguments[0]=="number"){var c=[];this.each(function(){var a=$f(this);a&&c.push(a)});return arguments.length?c[arguments[0]]:new q(c)}return this.each(function(){$f(this,n(a),b?n(b):{})})}})();
(function(){function n(){if(g.done)return!1;var b=document;if(b&&b.getElementsByTagName&&b.getElementById&&b.body){clearInterval(g.timer);g.timer=null;for(b=0;b<g.ready.length;b++)g.ready[b].call();g.ready=null;g.done=!0}}function k(b,c){if(c)for(key in c)c.hasOwnProperty(key)&&(b[key]=c[key]);return b}function l(b){switch(f(b)){case "string":return b=b.replace(RegExp('(["\\\\])',"g"),"\\$1"),b=b.replace(/^\s?(\d+)%/,"$1pct"),'"'+b+'"';case "array":return"["+r(b,function(a){return l(a)}).join(",")+
"]";case "function":return'"function()"';case "object":var c=[],a;for(a in b)b.hasOwnProperty(a)&&c.push('"'+a+'":'+l(b[a]));return"{"+c.join(",")+"}"}return String(b).replace(/\s/g," ").replace(/\'/g,'"')}function f(b){if(b===null||b===void 0)return!1;var c=typeof b;return c=="object"&&b.push?"array":c}function r(b,c){var a=[],f;for(f in b)b.hasOwnProperty(f)&&(a[f]=c(b[f]));return a}function m(b,c){var a=k({},b),f=document.all,e='<object width="'+a.width+'" height="'+a.height+'"';if(f&&!a.id)a.id=
"_"+(""+Math.random()).substring(9);a.id&&(e+=' id="'+a.id+'"');a.cachebusting&&(a.src+=(a.src.indexOf("?")!=-1?"&":"?")+Math.random());e+=a.w3c||!f?' data="'+a.src+'" type="application/x-shockwave-flash"':' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';e+=">";if(a.w3c||f)e+='<param name="movie" value="'+a.src+'" />';a.width=a.height=a.id=a.w3c=a.src=null;for(var d in a)a[d]!==null&&(e+='<param name="'+d+'" value="'+a[d]+'" />');a="";if(c){for(var g in c)c[g]!==null&&(a+=g+"="+(typeof c[g]==
"object"?l(c[g]):c[g])+"&");a=a.substring(0,a.length-1);e+='<param name="flashvars" value=\''+a+"' />"}e+="</object>";return e}function s(b,c,a){var f=flashembed.getVersion();k(this,{getContainer:function(){return b},getConf:function(){return c},getVersion:function(){return f},getFlashvars:function(){return a},getApi:function(){return b.firstChild},getHTML:function(){return m(c,a)}});var e=c.version,d=c.expressInstall,g=!e||flashembed.isSupported(e);if(g)c.onFail=c.version=c.expressInstall=null,b.innerHTML=
m(c,a);else if(e&&d&&flashembed.isSupported([6,65]))k(c,{src:d}),a={MMredirectURL:location.href,MMplayerType:"PlugIn",MMdoctitle:document.title},b.innerHTML=m(c,a);else if(b.innerHTML.replace(/\s/g,"")===""&&(b.innerHTML="<h2>Flash version "+e+" or greater is required</h2><h3>"+(f[0]>0?"Your version is "+f:"You have no flash plugin installed")+"</h3>"+(b.tagName=="A"?"<p>Click here to download latest version</p>":"<p>Download latest version from <a href='http://www.adobe.com/go/getflashplayer'>here</a></p>"),
b.tagName=="A"))b.onclick=function(){location.href="http://www.adobe.com/go/getflashplayer"};if(!g&&c.onFail&&(e=c.onFail.call(this),typeof e=="string"))b.innerHTML=e;document.all&&(window[c.id]=document.getElementById(c.id))}var o=typeof jQuery=="function",q={width:"100%",height:"100%",allowfullscreen:!0,allowscriptaccess:"always",quality:"high",version:null,onFail:null,expressInstall:null,w3c:!1,cachebusting:!1};if(o)jQuery.tools=jQuery.tools||{},jQuery.tools.flashembed={version:"1.0.4",conf:q};
var g=o?jQuery:function(b){if(g.done)return b();g.timer?g.ready.push(b):(g.ready=[b],g.timer=setInterval(n,13))};window.attachEvent&&window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}});window.flashembed=function(b,c,a){if(typeof b=="string"){var f=document.getElementById(b);if(f)b=f;else{g(function(){flashembed(b,c,a)});return}}if(b)return typeof c=="string"&&(c={src:c}),f=k({},q),k(f,c),new s(b,f,a)};k(window.flashembed,{getVersion:function(){var b=
[0,0];if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){var c=navigator.plugins["Shockwave Flash"].description;typeof c!="undefined"&&(c=c.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),b=parseInt(c.replace(/^(.*)\..*$/,"$1"),10),c=/r/.test(c)?parseInt(c.replace(/^.*r(.*)$/,"$1"),10):0,b=[b,c])}else if(window.ActiveXObject){try{c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(a){try{c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"),b=[6,0],c.AllowScriptAccess="always"}catch(f){if(b[0]==
6)return b}try{c=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(e){}}typeof c=="object"&&(c=c.GetVariable("$version"),typeof c!="undefined"&&(c=c.replace(/^\S+\s+(.*)$/,"$1").split(","),b=[parseInt(c[0],10),parseInt(c[2],10)]))}return b},isSupported:function(b){var c=flashembed.getVersion();return c[0]>b[0]||c[0]==b[0]&&c[1]>=b[1]},domReady:g,asString:l,getHTML:m});if(o)jQuery.fn.flashembed=function(b,c){var a=null;this.each(function(){a=flashembed(this,b,c)});return b.api===!1?this:a}})();(function(){function n(){if(!o&&(o=!0,q)){for(var f=0;f<q.length;f++)q[f].call(window,[]);q=[]}}function k(f){var b=window.onload;window.onload=typeof window.onload!="function"?f:function(){b&&b();f()}}function l(){if(!s){s=!0;document.addEventListener&&!m.opera&&document.addEventListener("DOMContentLoaded",n,!1);m.msie&&window==top&&function(){if(!o){try{document.documentElement.doScroll("left")}catch(b){setTimeout(arguments.callee,0);return}n()}}();m.opera&&document.addEventListener("DOMContentLoaded",
function(){if(!o){for(var b=0;b<document.styleSheets.length;b++)if(document.styleSheets[b].disabled){setTimeout(arguments.callee,0);return}n()}},!1);if(m.safari){var f;(function(){if(!o)if(document.readyState!="loaded"&&document.readyState!="complete")setTimeout(arguments.callee,0);else{if(f===void 0){for(var b=document.getElementsByTagName("link"),c=0;c<b.length;c++)b[c].getAttribute("rel")=="stylesheet"&&f++;b=document.getElementsByTagName("style");f+=b.length}document.styleSheets.length!=f?setTimeout(arguments.callee,
0):n()}})()}k(n)}}var f=window.DomReady={},r=navigator.userAgent.toLowerCase(),m={version:(r.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(r),opera:/opera/.test(r),msie:/msie/.test(r)&&!/opera/.test(r),mozilla:/mozilla/.test(r)&&!/(compatible|webkit)/.test(r)},s=!1,o=!1,q=[];f.ready=function(f){l();o?f.call(window,[]):q.push(function(){return f.call(window,[])})};l()})();(function(n,k){function l(a,b){for(var c=[],d=0;d<a.length;d++)c.push(a[d]);for(d=0;d<c.length;d++)b(c[d])}function f(){l([g,b],function(a){l(k.getElementsByTagName(a),function(b){function c(a){return b.canPlayType(a)||e&&a.search("mp4")>-1}var d=!0,e=navigator.userAgent.toLowerCase().search("android")>-1;b.canPlayType&&(b.src?c(r(a,b.src))&&(d=!1):l(b.getElementsByTagName("source"),function(b){c(r(a,b.src,b.type))&&(d=!1)}));d?f.createFallback(a,b):e&&b.addEventListener("click",function(){b.play()},
!1)})})}function r(a,b,c){return c||i[a][b.split(".").slice(-1)[0]]||C[a]}function m(a,b){var c=a.getAttribute(b);return c==!0||typeof c=="string"}function s(a){return a.substr(0,1)=="/"?w+a:a.substr(0,1)=="."||!a.match(/^\s*\w+:\/\//)?p+a:a}function o(a,b,c){var d=a.getAttribute(b);if(d)return d+"px";if(a.currentStyle)a=a.currentStyle[b];else if(n.getComputedStyle)a=k.defaultView.getComputedStyle(a,null).getPropertyValue(b);else return c;return a=="auto"?c:a}function q(a){return a.match(/\s*([\w-]+\/[\w-]+)(;|\s|$)/)[1]}
var g="video",b="audio";k.createElement(g).canPlayType||l(["video","audio","source"],function(a){k.createElement(a)});f.flowplayerSwf="files/html5media/flowplayer.swf";f.flowplayerAudioSwf="files/html5media/flowplayer.audio.swf";f.flowplayerControlsSwf="files/html5media/flowplayer.controls.swf";var c=f.THEORA_FORMAT='video/ogg; codecs="theora, vorbis"',a=f.H264_FORMAT='video/mp4; codecs="avc1.42E01E, mp4a.40.2"',h=f.VORBIS_FORMAT='audio/ogg; codecs="vorbis"',e=f.WEBM_FORMAT="video/webm;",
d=f.M4A_FORMAT="audio/x-m4a;",j=f.MP3_FORMAT="audio/mpeg;",B=f.WAV_FORMAT='audio/wav; codecs="1"',C=f.assumedFormats={video:a,audio:j},u=f.fallbackFormats=[f.H264_FORMAT,f.M4A_FORMAT,f.MP3_FORMAT],i=f.fileExtensions={video:{ogg:c,ogv:c,avi:a,mp4:a,mkv:a,h264:a,264:a,avc:a,m4v:a,"3gp":a,"3gpp":a,"3g2":a,mpg:a,mpeg:a,webm:e},audio:{ogg:h,oga:h,aac:d,m4a:d,mp3:j,wav:B}},w=n.location.protocol+"//"+n.location.host,p=String(n.location);l(k.getElementsByTagName("base"),function(a){if(a.href)p=a.href});p=
p.split("/").slice(0,-1).join("/")+"/";f.configureFlowplayer=function(a,b,c){return c};f.createFallback=function(a,b){var c=m(b,"controls"),d=b.getAttribute("poster")||"",e=b.getAttribute("src")||"",i;e?i=r(a,e):l(b.getElementsByTagName("source"),function(b){var c=b.getAttribute("src");c&&!e&&l(u,function(d){i=r(a,c,b.getAttribute("type"));q(i)==q(d)&&(e=c)})});var h=k.createElement("span");h.id=b.id;h.className=b.className;h.title=b.title;h.style.display="block";h.style.width=o(b,"width","300px");
h.style.height=a=="audio"?"26px":o(b,"height","200px");b.parentNode.replaceChild(h,b);var n=(b.getAttribute("preload")||"").toLowerCase(),p=[];d&&p.push({url:s(d)});e&&p.push({url:s(e),autoPlay:m(b,"autoplay"),autoBuffering:m(b,"autobuffer")||m(b,"preload")&&(n==""||n=="auto"),onBeforeFinish:function(){return!m(b,"loop")}});d={controls:c&&{url:s(f.flowplayerControlsSwf),fullscreen:!1,autoHide:a==g&&"always"||"never"}||null};if(q(i)==q(j)&&(d.audio={url:s(f.flowplayerAudioSwf)},!c))d.controls={url:s(f.flowplayerControlsSwf),
display:"none"},h.style.height=0;c={play:null,playlist:p,clip:{scaling:"fit",fadeInSpeed:0,fadeOutSpeed:0},plugins:d};f.configureFlowplayer(a,b,c);flowplayer(h,{src:s(f.flowplayerSwf),wmode:"opaque"},c)};n.jQuery?jQuery(f):n.DomReady&&DomReady.ready(f);n.html5media=f})(this,document);

$(document).ready(function() {	
	$('#html5audio_stacks_in_32_page0 source').each(function() {
		if( $(this).attr('src').length == 0 ) { 
			$(this).remove(); 
		}
	});  
});
//-- End HTML5 Audio Stack --//

	return stack;
})(stacks.stacks_in_32_page0);


// Javascript for stacks_in_42_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_42_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_42_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 ( 3 ) {
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 ( 5 ) {
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 ( 0 ) {
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 ( 3 ) {
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 (3 != 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_42_page0);



