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

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

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

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

//-- YouTube HTML5 v1.6.0 by Joe Workman --//
/* jQuery YouTube 1.0.3 - https://github.com/nirvanatikku/jQuery-TubePlayer-Plugin */
(function(g){var d={};d.ytplayers={};d.inits=[];d.iframeScriptInited=false;d.inited=false;g.tubeplayer={};g.tubeplayer.defaults={afterReady:function(){},stateChange:function(a){var b=this.onPlayer;return function(c){if(typeof c=="object")c=c.data;switch(c){case -1:return b.unstarted[a]();case 0:return b.ended[a]();case 1:return b.playing[a]();case 2:return b.paused[a]();case 3:return b.buffering[a]();case 5:return b.cued[a]();default:return null}}},onError:function(a){var b=this.onErr;return function(c){if(typeof c==
"object")c=c.data;switch(c){case 2:return b.invalidParameter[a]();case 100:return b.notFound[a]();case 101:case 150:return b.notEmbeddable[a]();default:return null}}},qualityChange:function(a){var b=this;return function(c){if(typeof c=="object")c=c.data;return b.onQualityChange[a](c)}},onQualityChange:{},onPlayer:{unstarted:{},ended:{},playing:{},paused:{},buffering:{},cued:{}},onErr:{notFound:{},notEmbeddable:{},invalidParameter:{}}};var j={width:425,height:355,allowFullScreen:"true",initialVideo:"DkoeNLuMbcI",
start:0,preferredQuality:"default",showControls:true,showRelated:false,autoPlay:false,autoHide:true,theme:"dark",color:"red",showinfo:false,modestbranding:true,wmode:"transparent",swfobjectURL:"http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js",loadSWFObject:true,allowScriptAccess:"always",playerID:"tubeplayer-player-container",iframed:true,onPlay:function(){},onPause:function(){},onStop:function(){},onSeek:function(){},onMute:function(){},onUnMute:function(){},onPlayerUnstarted:function(){},
onPlayerEnded:function(){},onPlayerPlaying:function(){},onPlayerPaused:function(){},onPlayerBuffering:function(){},onPlayerCued:function(){},onQualityChange:function(){},onErrorNotFound:function(){},onErrorNotEmbeddable:function(){},onErrorInvalidParameter:function(){}};g.fn.tubeplayer=function(a,b){var c=g(this),f=typeof a;if(arguments.length==0||f=="object")return c.each(function(){d.init(g(this),a)});else if(f=="string")return c.triggerHandler(a+".tubeplayer",b||null)};var h=function(a){return function(b,
c){var f=d.getPkg(b);if(f.ytplayer){b=a(b,c,f);if(typeof b=="undefined")b=f.$player;return b}return f.$player}};g.tubeplayer.getPlayers=function(){return d.ytplayers};d.init=function(a,b){if(a.hasClass("jquery-youtube-tubeplayer"))return a;b=g.extend({},j,b);b.playerID+=(new Date).valueOf();a.addClass("jquery-youtube-tubeplayer").data("opts.tubeplayer",b);for(e in i)a.bind(e+".tubeplayer",a,i[e]);d.initDefaults(g.tubeplayer.defaults,b);jQuery("<div></div>").attr("id",b.playerID).appendTo(a);d.initPlayer(a,
b);return a};d.getPkg=function(a){a=a.data;var b=a.data("opts.tubeplayer");return{$player:a,opts:b,ytplayer:d.ytplayers[b.playerID]}};d.iframeReady=function(a){d.inits.push(function(){new YT.Player(a.playerID,{videoId:a.initialVideo,width:a.width,height:a.height,playerVars:{autoplay:a.autoPlay?1:0,autohide:a.autoHide?1:0,controls:a.showControls?1:0,rel:a.showRelated?1:0,fs:a.allowFullScreen?1:0,wmode:a.wmode,showinfo:a.showinfo?1:0,modestbranding:a.modestbranding?1:0,start:a.start,theme:a.theme,color:a.color},
events:{onReady:function(b){d.ytplayers[a.playerID]=b.target;b=g(b.target).parents(".jquery-youtube-tubeplayer");g.tubeplayer.defaults.afterReady(b)},onPlaybackQualityChange:g.tubeplayer.defaults.qualityChange(a.playerID),onStateChange:g.tubeplayer.defaults.stateChange(a.playerID),onError:g.tubeplayer.defaults.onError(a.playerID)}})});if(d.inits.length>=1&&!d.inited)return function(){for(var b=0;b<d.inits.length;b++)d.inits[b]();d.inited=true};d.inited&&d.inits.pop()();return onYouTubePlayerAPIReady};
d.supportsHTML5=function(){return!!document.createElement("video").canPlayType};d.initDefaults=function(a,b){var c=b.playerID,f=a.onPlayer;f.unstarted[c]=b.onPlayerUnstarted;f.ended[c]=b.onPlayerEnded;f.playing[c]=b.onPlayerPlaying;f.paused[c]=b.onPlayerPaused;f.buffering[c]=b.onPlayerBuffering;f.cued[c]=b.onPlayerCued;a.onQualityChange[c]=b.onQualityChange;a=a.onErr;a.notFound[c]=b.onErrorNotFound;a.notEmbeddable[c]=b.onErrorNotEmbeddable;a.invalidParameter[c]=b.onErrorInvalidParameter};d.initPlayer=
function(a,b){b.iframed&&d.supportsHTML5()?d.initIframePlayer(a,b):d.initFlashPlayer(a,b)};d.initIframePlayer=function(a,b){if(!d.iframeScriptInited){a=document.createElement("script");a.src="http://www.youtube.com/player_api";var c=document.getElementsByTagName("script")[0];c.parentNode.insertBefore(a,c);d.iframeScriptInited=true}onYouTubePlayerAPIReady=d.iframeReady(b)};d.initFlashPlayer=function(a,b){b.loadSWFObject?g.getScript(b.swfobjectURL,d.initFlashPlayerFN(b)):d.initFlashPlayerFN(b)()};d.initFlashPlayerFN=
function(a){return function(){var b=["//www.youtube.com/v/"];b.push(a.initialVideo);b.push("?fs="+(a.allowFullScreen?1:0));b.push("&enablejsapi=1&version=3");b.push("&playerapiid="+a.playerID);b.push("&rel= "+(a.showRelated?1:0));b.push("&autoplay="+(a.autoPlay?1:0));b.push("&autohide="+(a.autoHide?1:0));b.push("&controls="+(a.showControls?1:0));b.push("&showinfo="+(a.showinfo?1:0));b.push("&modestbranding="+(a.modestbranding?1:0));b.push("&start="+a.start);b.push("&theme="+a.theme);b.push("&color="+
a.color);swfobject.embedSWF(b.join(""),a.playerID,a.width,a.height,"8",null,null,{allowScriptAccess:a.allowScriptAccess,wmode:a.wmode,allowFullScreen:a.allowFullScreen},{id:a.playerID});onYouTubePlayerReady=function(c){var f=document.getElementById(c);d.ytplayers[c]=f;f.addEventListener("onStateChange","$.tubeplayer.defaults.stateChange('"+c+"')");f.addEventListener("onError","$.tubeplayer.defaults.onError('"+c+"')");f.addEventListener("onPlaybackQualityChange","$.tubeplayer.defaults.qualityChange('"+
c+"')");c=g(f).parents(".jquery-youtube-tubeplayer");g.tubeplayer.defaults.afterReady(c)}}};d.getVideoIDFromURL=function(a){var b=a.indexOf("youtube.com/watch?v=")+20,c=a.indexOf("&",b)||a.length;if(b>c)return"";return a.substring(b,c)};var i={cue:h(function(a,b,c){c.ytplayer.cueVideoById(b,c.opts.preferredQuality)}),play:h(function(a,b,c){if(typeof b=="object")c.ytplayer.loadVideoById(b.id,b.time,c.opts.preferredQuality);else b?c.ytplayer.loadVideoById(b,0,c.opts.preferredQuality):c.ytplayer.playVideo();
c.opts.onPlay(b)}),pause:h(function(a,b,c){c.ytplayer.pauseVideo();c.opts.onPause()}),stop:h(function(a,b,c){c.ytplayer.stopVideo();c.opts.onStop()}),seek:h(function(a,b,c){c.ytplayer.seekTo(b,true);c.opts.onSeek(b)}),mute:h(function(a,b,c){c.$player.attr("data-prev-mute-volume",c.ytplayer.getVolume());c.ytplayer.mute();c.opts.onMute()}),unmute:h(function(a,b,c){c.ytplayer.unMute();c.ytplayer.setVolume(c.$player.attr("data-prev-mute-volume")||50);c.opts.onUnMute()}),isMuted:h(function(a,b,c){return c.ytplayer.isMuted()}),
volume:h(function(a,b,c){if(b){c.ytplayer.setVolume(b);c.$player.attr("data-prev-mute-volume",c.ytplayer.getVolume())}else return c.ytplayer.getVolume()||0}),quality:h(function(a,b,c){if(b)c.ytplayer.setPlaybackQuality(b);else return c.ytplayer.getPlaybackQuality()}),data:h(function(a,b,c){a={};c=c.ytplayer;a.bytesLoaded=c.getVideoBytesLoaded();a.bytesTotal=c.getVideoBytesTotal();a.startBytes=c.getVideoStartBytes();a.state=c.getPlayerState();a.currentTime=c.getCurrentTime();a.availableQualityLevels=
c.getAvailableQualityLevels();a.duration=c.getDuration();a.videoURL=c.getVideoUrl();a.getVideoEmbedCode=c.getVideoEmbedCode();a.videoID=d.getVideoIDFromURL(a.videoURL);return a}),videoId:h(function(a,b,c){return d.getVideoIDFromURL(c.ytplayer.getVideoUrl())}),size:h(function(a,b,c){if(b.width&&b.height){c.ytplayer.setSize(b.width,b.height);g(c.ytplayer).css(b)}}),destroy:h(function(a,b,c){c.$player.removeClass("jquery-youtube-tubeplayer").data("opts.tubeplayer",null).unbind(".tubeplayer").html("");
delete d.ytplayers[c.opts.playerID];g(c.ytplayer).remove();return null}),player:h(function(a,b,c){return c.ytplayer})}})(jQuery);

$(document).ready(function() {
	$("#youtube_stacks_in_9_page5").tubeplayer({
		width: 400, // the width of the player
		height: 220, // the height of the player
		allowFullScreen: true, 
		initialVideo: "HKmzRS1SauU", 
		preferredQuality: "default",// preferred quality: default, small, medium, large, hd720
		showControls: true,
		showRelated: false,
		autoPlay: false,
		autoHide: true,
		theme: 'dark', // 'dark' or 'light'
		color: 'red', // 'red' or 'white'
		showinfo: false,
		modestbranding: false,
		wmode: 'transparent' // use 'window' when optimizing for mobile devices
	});
});
//-- End YouTube HTML5 Stack --//

	return stack;
})(stacks.stacks_in_9_page5);


// Javascript for stacks_in_13_page5
// ---------------------------------------------------------------------

// Each stack has its own object with its own namespace.  The name of
// that object is the same as the stack's id.
stacks.stacks_in_13_page5 = {};

// 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_13_page5 = (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 ( 0 ) {
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 (0 != 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_13_page5);


// Javascript for stacks_in_15_page5
// ---------------------------------------------------------------------

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

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

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

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

/*
 * rfc3339date.js
 * Copyright (c) 2010 Paul GALLAGHER http://tardate.com
 * Licensed under the MIT license:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * jQuery Templates Plugin 1.0.0pre
 * Copyright Software Freedom Conservancy, Inc.
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * jQuery Lifestream Plug-in
 * @version 0.1.1
 * Copyright 2011, Christian Vuerings - http://denbuzze.com
 */

function parseDate(b){if(typeof b=="undefined")return false;var a=new Date(b);isValidDate(a)||(a=Date.parse(b),isValidDate(a)||(b=b.split(" "),a=new Date(Date.parse(b[1]+" "+b[2]+", "+b[5]+" "+b[3]+" UTC"))));return a}function isValidDate(b){return Object.prototype.toString.call(b)!=="[object Date]"?false:!isNaN(b.getTime())}Number.prototype.toPaddedString=function(b,a){var i=this.toString();for(typeof a=="undefined"&&(a="0");i.length<b;)i=a+i;return i};
Date.prototype.toRFC3339UTCString=function(b,a){var i=b?"":"-",f=b?"":":",c=this.getUTCFullYear().toString();c+=i+(this.getUTCMonth()+1).toPaddedString(2);c+=i+this.getUTCDate().toPaddedString(2);c+="T"+this.getUTCHours().toPaddedString(2);c+=f+this.getUTCMinutes().toPaddedString(2);c+=f+this.getUTCSeconds().toPaddedString(2);!a&&this.getUTCMilliseconds()>0&&(c+="."+this.getUTCMilliseconds().toPaddedString(3));return c+"Z"};
Date.prototype.toRFC3339LocaleString=function(b,a){var i=b?"":"-",f=b?"":":",c=this.getFullYear().toString();c+=i+(this.getMonth()+1).toPaddedString(2);c+=i+this.getDate().toPaddedString(2);c+="T"+this.getHours().toPaddedString(2);c+=f+this.getMinutes().toPaddedString(2);c+=f+this.getSeconds().toPaddedString(2);!a&&this.getMilliseconds()>0&&(c+="."+this.getMilliseconds().toPaddedString(3));i=-this.getTimezoneOffset();c+=i<0?"-":"+";c+=(i/60).toPaddedString(2);c+=f+(i%60).toPaddedString(2);return c};
Date.parseRFC3339=function(b){if(typeof b=="string"){var a;if(b=b.match(RegExp(/(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)(T)?(\d\d)(:)?(\d\d)?(:)?(\d\d)?([\.,]\d+)?($|Z|([+-])(\d\d)(:)?(\d\d)?)/i))){var i=parseInt(b[1],10),f=parseInt(b[3],10)-1,c=parseInt(b[5],10),g=parseInt(b[7],10),d=b[9]?parseInt(b[9],10):0,h=b[11]?parseInt(b[11],10):0,e=b[12]?parseFloat(String(1.5).charAt(1)+b[12].slice(1))*1E3:0;b[13]?(a=new Date,a.setUTCFullYear(i),a.setUTCMonth(f),a.setUTCDate(c),a.setUTCHours(g),a.setUTCMinutes(d),a.setUTCSeconds(h),
a.setUTCMilliseconds(e),b[13]&&b[14]&&(i=b[15]*60,b[17]&&(i+=parseInt(b[17],10)),i*=b[14]=="-"?-1:1,a.setTime(a.getTime()-i*6E4))):a=new Date(i,f,c,g,d,h,e)}return a}};if(typeof Date.parse!="function")Date.parse=Date.parseRFC3339;else{var oldparse=Date.parse;Date.parse=function(b){var a=Date.parseRFC3339(b);!a&&oldparse&&(a=oldparse(b));return a}}
(function(b){function a(a,d,c,g){g={data:g||g===0||g===false?g:d?d.data:{},_wrap:d?d._wrap:null,tmpl:null,parent:d||null,nodes:[],calls:e,nest:j,wrap:l,html:n,update:s};a&&b.extend(g,a,{nodes:[],parent:d});if(c)g.tmpl=c,g._ctnt=g._ctnt||g.tmpl(b,g),g.key=++u,(w.length?q:k)[u]=g;return g}function i(a,d,c){var g,c=c?b.map(c,function(b){return typeof b==="string"?a.key?b.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g,"$1 "+o+'="'+a.key+'" $2'):b:i(b,a,b._ctnt)}):a;if(d)return c;c=c.join("");c.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,
function(a,d,c,e){g=b(c).get();h(g);d&&(g=f(d).concat(g));e&&(g=g.concat(f(e)))});return g?g:f(c)}function f(a){var d=document.createElement("div");d.innerHTML=a;return b.makeArray(d.childNodes)}function c(a){return new Function("jQuery","$item","var $=jQuery,call,__=[],$data=$item.data;with($data){__.push('"+b.trim(a).replace(/([\\'])/g,"\\$1").replace(/[\r\t\n]/g," ").replace(/\$\{([^\}]*)\}/g,"{{= $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,
function(a,c,g,e,h,i,f){a=b.tmpl.tag[g];if(!a)throw"Unknown template tag: "+g;g=a._default||[];i&&!/\w$/.test(h)&&(h+=i,i="");h?(h=d(h),f=f?","+d(f)+")":i?")":"",f=i?h.indexOf(".")>-1?h+d(i):"("+h+").call($item"+f:h,i=i?f:"(typeof("+h+")==='function'?("+h+").call($item):("+h+"))"):i=f=g.$1||"null";e=d(e);return"');"+a[c?"close":"open"].split("$notnull_1").join(h?"typeof("+h+")!=='undefined' && ("+h+")!=null":"true").split("$1a").join(i).split("$1").join(f).split("$2").join(e||g.$2||"")+"__.push('"})+
"');}return __;")}function g(a,d){a._wrap=i(a,true,b.isArray(d)?d:[r.test(d)?d:b(d).html()]).join("")}function d(a){return a?a.replace(/\\'/g,"'").replace(/\\\\/g,"\\"):null}function h(d){function c(d){function e(b){var y;b+=g;y=i[b]=i[b]||a(j,k[j.parent.key+g]||j.parent),j=y}var h,f=d,j,t;if(t=d.getAttribute(o)){for(;f.parentNode&&(f=f.parentNode).nodeType===1&&!(h=f.getAttribute(o)););if(h!==t){f=f.parentNode?f.nodeType===11?0:f.getAttribute(o)||0:0;if(!(j=k[t]))j=q[t],j=a(j,k[f]||q[f]),j.key=++u,
k[u]=j;p&&e(t)}d.removeAttribute(o)}else if(p&&(j=b.data(d,"tmplItem")))e(j.key),k[j.key]=j,f=(f=b.data(d.parentNode,"tmplItem"))?f.key:0;if(j){for(h=j;h&&h.key!=f;)h.nodes.push(d),h=h.parent;delete j._ctnt;delete j._wrap;b.data(d,"tmplItem",j)}}var g="_"+p,e,h,i={},f,j,m;for(f=0,j=d.length;f<j;f++)if((e=d[f]).nodeType===1){h=e.getElementsByTagName("*");for(m=h.length-1;m>=0;m--)c(h[m]);c(e)}}function e(a,b,d,c){if(!a)return w.pop();w.push({_:a,tmpl:b,item:this,data:d,options:c})}function j(a,d,c){return b.tmpl(b.template(a),
d,c,this)}function l(a,d){var c=a.options||{};c.wrapped=d;return b.tmpl(b.template(a.tmpl),a.data,c,a.item)}function n(a,d){var c=this._wrap;return b.map(b(b.isArray(c)?c.join(""):c).filter(a||"*"),function(a){if(d)a=a.innerText||a.textContent;else{var b;if(!(b=a.outerHTML))b=document.createElement("div"),b.appendChild(a.cloneNode(true)),b=b.innerHTML;a=b}return a})}function s(){var a=this.nodes;b.tmpl(null,null,null,this).insertBefore(a[0]);b(a).remove()}var m=b.fn.domManip,o="_tmplitem",r=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,
k={},q={},v,x={key:0,data:{}},u=0,p=0,w=[];b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,d){b.fn[a]=function(c){var g=[],c=b(c),h,e,f;h=this.length===1&&this[0].parentNode;v=k||{};if(h&&h.nodeType===11&&h.childNodes.length===1&&c.length===1)c[d](this[0]),g=this;else{for(e=0,f=c.length;e<f;e++)p=e,h=(e>0?this.clone(true):this).get(),b(c[e])[d](h),g=g.concat(h);p=0;g=this.pushStack(g,a,c.selector)}c=v;v=null;b.tmpl.complete(c);
return g}});b.fn.extend({tmpl:function(a,d,c){return b.tmpl(this[0],a,d,c)},tmplItem:function(){return b.tmplItem(this[0])},template:function(a){return b.template(a,this[0])},domManip:function(a,d,c,g){if(a[0]&&b.isArray(a[0])){for(var h=b.makeArray(arguments),e=a[0],f=e.length,i=0,j;i<f&&!(j=b.data(e[i++],"tmplItem")););j&&p&&(h[2]=function(a){b.tmpl.afterManip(this,a,c)});m.apply(this,h)}else m.apply(this,arguments);p=0;v||b.tmpl.complete(k);return this}});b.extend({tmpl:function(d,c,h,e){var f=
!e;if(f)e=x,d=b.template[d]||b.template(null,d),q={};else if(!d)return d=e.tmpl,k[e.key]=e,e.nodes=[],e.wrapped&&g(e,e.wrapped),b(i(e,null,e.tmpl(b,e)));if(!d)return[];typeof c==="function"&&(c=c.call(e||{}));h&&h.wrapped&&g(h,h.wrapped);c=b.isArray(c)?b.map(c,function(b){return b?a(h,e,d,b):null}):[a(h,e,d,c)];return f?b(i(e,null,c)):c},tmplItem:function(a){var d;for(a instanceof b&&(a=a[0]);a&&a.nodeType===1&&!(d=b.data(a,"tmplItem"))&&(a=a.parentNode););return d||x},template:function(a,d){return d?
(typeof d==="string"?d=c(d):d instanceof b&&(d=d[0]||{}),d.nodeType&&(d=b.data(d,"tmpl")||b.data(d,"tmpl",c(d.innerHTML))),typeof a==="string"?b.template[a]=d:d):a?typeof a!=="string"?b.template(null,a):b.template[a]||b.template(null,r.test(a)?a:b(a)):null},encode:function(a){return(""+a).split("<").join("&lt;").split(">").join("&gt;").split('"').join("&#34;").split("'").join("&#39;")}});b.extend(b.tmpl,{tag:{tmpl:{_default:{$2:"null"},open:"if($notnull_1){__=__.concat($item.nest($1,$2));}"},wrap:{_default:{$2:"null"},
open:"$item.calls(__,$1,$2);__=[];",close:"call=$item.calls();__=call._.concat($item.wrap(call,__));"},each:{_default:{$2:"$index, $value"},open:"if($notnull_1){$.each($1a,function($2){with(this){",close:"}});}"},"if":{open:"if(($notnull_1) && $1a){",close:"}"},"else":{_default:{$1:"true"},open:"}else if(($notnull_1) && $1a){"},html:{open:"if($notnull_1){__.push($1a);}"},"=":{_default:{$1:"$data"},open:"if($notnull_1){__.push($.encode($1a));}"},"!":{open:""}},complete:function(){k={}},afterManip:function(a,
d,c){var g=d.nodeType===11?b.makeArray(d.childNodes):d.nodeType===1?[d]:[];c.call(a,d);h(g);p++}})})(jQuery);
(function(b){b.fn.lifestream=function(a){return this.each(function(){var i=b(this),f=jQuery.extend({classname:"lifestream",feedloaded:null,limit:10,list:[]},a),c=0,g=0,d=[],h=jQuery.extend(true,{},f),e=null,j=function(){i.removeClass("loading");d.sort(function(a,b){return b.date-a.date});for(var c=d.length<f.limit?d.length:f.limit,g=0,e,h=b('<ul class="'+f.classname+'"/>');g<c;g++)e=d[g],e.html&&(e=b('<li class="'+f.classname+"-"+e.config.service+(a.showIcons?"-icon":"")+'">').data("time",e.date).append(e.html),
f.showTime&&e.append(" ("+relative_time(d[g].date)+")"),e.appendTo(h));i.html(h);b.isFunction(f.feedloaded)&&f.feedloaded()},l=function(a){g++;b.merge(d,a);clearTimeout(e);f.waitUntilLoaded&&g!=c?e=setTimeout(j,1500):j()};(function(){i.addClass("loading");e=setTimeout(j,1500);var a=0,d=f.list.length;for(delete h.list;a<d;a++){var g=f.list[a];g.openLinksInNewWindow=f.openLinksInNewWindow;g.showPrefix=f.showPrefix;if(g.service.match(/rss/))g.service="rss";if(b.fn.lifestream.feeds[g.service]&&b.isFunction(b.fn.lifestream.feeds[g.service])&&
g.user&&g.user!="...")c++,g._settings=h,b.fn.lifestream.feeds[g.service](g,l)}})()})};b.fn.lifestream.createYqlUrl=function(a){return"http://query.yahooapis.com/v1/public/yql?q=__QUERY__&env=store://datatables.org/alltableswithkeys&format=json".replace("__QUERY__",encodeURIComponent(a))};b.fn.lifestream.feeds=b.fn.lifestream.feeds||{};b.fn.lifestream.feeds.blogger=function(a,i){var f=b.extend({},{posted:(a.showPrefix?"posted ":"")+'<a href="${origLink}"'+(a.openLinksInNewWindow?' target="_blank"':
"")+">${title}</a>"},a.template);b.ajax({url:b.fn.lifestream.createYqlUrl('select * from xml where url="http://'+a.user+'.blogspot.com/feeds/posts/default"'),success:function(c){var g=[],d=0,h,e,j,l;if(c.query&&c.query.count&&c.query.count>0){c=c.query.results.feed&&c.query.results.feed.entry?c.query.results.feed.entry:c.query.results.rss.channel.item;for(h=c.length;d<h;d++){e=c[d];if(!e.origLink){j=0;for(l=e.link.length;j<l;j++)if(e.link[j].rel==="alternate")e.origLink=e.link[j].href}if(e.origLink){if(e.title.content)e.title=
e.title.content;g.push({date:parseDate(e.published?e.published:e.pubDate),config:a,html:b.tmpl(f.posted,e)})}}}i(g)},error:function(){i([])}});return{template:f}};b.fn.lifestream.feeds.dailymotion=function(a,i){a.template={item:(a.showPrefix?"uploaded a video ":"")+'<a href="${link}"'+(a.openLinksInNewWindow?' target="_blank"':"")+">${title}</a>"};a.link="http://www.dailymotion.com/rss/user/"+a.user;b.fn.lifestream.feeds.rss(a,i)};b.fn.lifestream.feeds.delicious=function(a,i){var f=b.extend({},{bookmarked:(a.showPrefix?
"bookmarked ":"")+'<a href="${u}"'+(a.openLinksInNewWindow?' target="_blank"':"")+">${d}</a>"},a.template);b.ajax({dataType:"jsonp",url:"http://feeds.delicious.com/v2/json/"+a.user,success:function(c){var g=[],d=0,h;if(c&&c.length&&c.length>0)for(h=c.length;d<h;d++){var e=c[d];g.push({date:parseDate(e.dt),config:a,html:b.tmpl(f.bookmarked,e)})}i(g)},error:function(){i([])}});return{template:f}};b.fn.lifestream.feeds.deviantart=function(a,i){var f=b.extend({},{posted:(a.showPrefix?"posted ":"")+'<a href="${link}"'+
(a.openLinksInNewWindow?' target="_blank"':"")+">${title}</a>"},a.template);b.ajax({dataType:"jsonp",url:b.fn.lifestream.createYqlUrl('select title,link,pubDate from rss where url="http://backend.deviantart.com/rss.xml?q=gallery%3A'+encodeURIComponent(a.user)+'&type=deviation" | unique(field="title")'),success:function(c){var g=[],d,h=0,e;if(c.query&&c.query.count>0){c=c.query.results.item;for(e=c.length;h<e;h++)d=c[h],g.push({date:parseDate(d.pubDate),config:a,html:b.tmpl(f.posted,d)})}i(g)},error:function(){i([])}});
return{template:f}};b.fn.lifestream.feeds.dribbble=function(a,i){var f=b.extend({},{posted:(a.showPrefix?"posted a shot ":"")+'<a href="${url}"'+(a.openLinksInNewWindow?' target="_blank"':"")+">${title}</a>"},a.template);b.ajax({dataType:"jsonp",url:"http://api.dribbble.com/players/"+a.user+"/shots",success:function(c){var g=[],d=0,h;if(c&&c.total)for(h=c.shots.length;d<h;d++){var e=c.shots[d];g.push({date:parseDate(e.created_at),config:a,html:b.tmpl(f.posted,e)})}i(g)},error:function(){i([])}});
return{template:f}};b.fn.lifestream.feeds.flickr=function(a,i){var f=b.extend({},{posted:(a.showPrefix?"posted a photo ":"")+'<a href="${link}"'+(a.openLinksInNewWindow?' target="_blank"':"")+">${title}</a>"},a.template);b.ajax({dataType:"jsonp",jsonp:"jsoncallback",url:"http://api.flickr.com/services/feeds/photos_public.gne?id="+a.user+"&lang=en-us&format=json",success:function(c){var g=[],d=0,h;if(c&&c.items&&c.items.length>0)for(h=c.items.length;d<h;d++){var e=c.items[d];g.push({date:parseDate(e.published),
config:a,html:b.tmpl(f.posted,e)})}i(g)},error:function(){i([])}});return{template:f}};b.fn.lifestream.feeds.foomark=function(a,i){var f=b.extend({},{bookmarked:(a.showPrefix?"bookmarked ":"")+'<a href="${url}"'+(a.openLinksInNewWindow?' target="_blank"':"")+">${url}</a>"},a.template);b.ajax({dataType:"jsonp",url:"http://api.foomark.com/urls/list/?username="+a.user+"&format=json",success:function(c){var g=[],d=0,h;if(c&&c.length&&c.length>0)for(h=c.length;d<h;d++){var e=c[d];g.push({date:parseDate(e.created_at.replace(" ",
"T")),config:a,html:b.tmpl(f.bookmarked,e)})}i(g)},error:function(){i([])}});return{template:f}};b.fn.lifestream.feeds.formspring=function(a,i){a.template={item:(a.showPrefix?"answered a question ":"")+'<a href="${link}"'+(a.openLinksInNewWindow?' target="_blank"':"")+">${title}</a>"};a.link="http://www.formspring.me/profile/"+a.user+".rss";b.fn.lifestream.feeds.rss(a,i)};b.fn.lifestream.feeds.forrst=function(a,i){var f=b.extend({},{posted:(a.showPrefix?"posted a ${post_type} ":"")+'<a href="${post_url}"'+
(a.openLinksInNewWindow?' target="_blank"':"")+">${title}</a>"},a.template);b.ajax({dataType:"jsonp",url:"http://forrst.com/api/v2/users/posts?username="+a.user,success:function(c){var g=[],d=0,h;if(c&&c.resp.length&&c.resp.length>0)for(h=c.resp.length;d<h;d++){var e=c.resp[d];g.push({date:parseDate(e.created_at.replace(" ","T")),config:a,html:b.tmpl(f.posted,e)})}i(g)},error:function(){i([])}});return{template:f}};b.fn.lifestream.feeds.foursquare=function(a,i){var f=b.extend({},{checkedin:(a.showPrefix?
"checked in @ ":"")+'<a href="${link}"'+(a.openLinksInNewWindow?' target="_blank"':"")+">${title}</a>"},a.template);b.ajax({dataType:"jsonp",url:b.fn.lifestream.createYqlUrl('select * from rss where url="https://feeds.foursquare.com/history/'+a.user+'.rss"'),success:function(c){var g=[],d=0,h;if(c.query&&c.query.count&&c.query.count>0)for(h=c.query.count;d<h;d++){var e=c.query.results.item[d];g.push({date:parseDate(e.pubDate),config:a,html:b.tmpl(f.checkedin,e)})}i(g)},error:function(){i([])}});return{template:f}};
b.fn.lifestream.feeds.github=function(a,i){var f=b.extend({},{pushed:'<a href="${status.url}" title="{{if title}}${title} by ${author} {{/if}}"'+(a.openLinksInNewWindow?' target="_blank"':"")+'>pushed</a> to <a href="http://github.com/${repo}/tree/${branchname}"'+(a.openLinksInNewWindow?' target="_blank"':"")+'>${branchname}</a> at <a href="http://github.com/${repo}"'+(a.openLinksInNewWindow?' target="_blank"':"")+">${repo}</a>",gist:'<a href="${status.payload.url}" title="${status.payload.desc || ""}"'+
(a.openLinksInNewWindow?' target="_blank"':"")+">${status.payload.name}</a>",commented:'commented on <a href="${status.url}"'+(a.openLinksInNewWindow?' target="_blank"':"")+'>${what}</a> on <a href="http://github.com/${repo}"'+(a.openLinksInNewWindow?' target="_blank"':"")+">${repo}</a>",pullrequest:'${status.payload.action} <a href="${status.url}"'+(a.openLinksInNewWindow?' target="_blank"':"")+'>pull request #${status.payload.number}</a> on <a href="http://github.com/${repo}"'+(a.openLinksInNewWindow?
' target="_blank"':"")+">${repo}</a>",created:'created ${status.payload.ref_type || status.payload.object} <a href="${status.url}"'+(a.openLinksInNewWindow?' target="_blank"':"")+'>${status.payload.ref || status.payload.object_name}</a> for <a href="http://github.com/${repo}"'+(a.openLinksInNewWindow?' target="_blank"':"")+">${repo}</a>",createdglobal:'created ${status.payload.object} <a href="${status.url}"'+(a.openLinksInNewWindow?' target="_blank"':"")+">${title}</a>",deleted:'deleted ${status.payload.ref_type} ${status.payload.ref} at <a href="http://github.com/${status.repository.owner}/${status.repository.name}"'+
(a.openLinksInNewWindow?' target="_blank"':"")+">${status.repository.owner}/${status.repository.name}</a>"},a.template),c=function(a){return a.payload.repo||(a.repository?a.repository.owner+"/"+a.repository.name:null)||a.url.split("/")[3]+"/"+a.url.split("/")[4]},g=function(a){var g,e;if(a.type==="PushEvent")return g=a.payload&&a.payload.shas&&a.payload.shas.json&&a.payload.shas.json[2],c(a),b.tmpl(f.pushed,{status:a,title:g,author:g?a.payload.shas.json[3]:"",branchname:a.payload.ref.split("/")[2],
repo:c(a)});else if(a.type==="GistEvent")return b.tmpl(f.gist,{status:a});else if(a.type==="CommitCommentEvent")return e="commit "+a.url.split("commit/")[1].split("#")[0].substring(0,7),g=c(a),b.tmpl(f.commented,{what:e,repo:g,status:a});else if(a.type==="IssueCommentEvent")return e="issue "+a.url.split("issues/")[1].split("#")[0],g=c(a),b.tmpl(f.commented,{what:e,repo:g,status:a});else if(a.type==="PullRequestEvent")return g=c(a),b.tmpl(f.pullrequest,{repo:g,status:a});else if(a.type==="CreateEvent"&&
(a.payload.ref_type==="tag"||a.payload.ref_type==="branch"||a.payload.object==="tag"))return g=c(a),b.tmpl(f.created,{repo:g,status:a});else if(a.type==="CreateEvent")return g=a.payload.object_name==="null"?a.payload.name:a.payload.object_name,b.tmpl(f.createdglobal,{title:g,status:a});else if(a.type==="DeleteEvent")return b.tmpl(f.deleted,{status:a})};b.ajax({dataType:"jsonp",url:b.fn.lifestream.createYqlUrl('select json.repository.owner,json.repository.name,json.payload,json.type,json.url, json.created_at from json where url="http://github.com/'+
a.user+'.json"'),success:function(b){var c=[],e=0,f;if(b.query&&b.query.count&&b.query.count>0)for(f=b.query.count;e<f;e++){var l=b.query.results.json[e].json;c.push({date:parseDate(l.created_at),config:a,html:g(l)})}i(c)},error:function(){i([])}});return{template:f}};b.fn.lifestream.feeds.googlereader=function(a,i){var f=b.extend({},{starred:(a.showPrefix?"shared ":"")+'<a href="{{if link.href}}${link.href}{{else}}${source.link.href}{{/if}}"'+(a.openLinksInNewWindow?' target="_blank"':"")+">${title.content}</a>"},
a.template);b.ajax({dataType:"jsonp",url:b.fn.lifestream.createYqlUrl('select * from xml where url="www.google.com/reader/public/atom/user%2F'+a.user+'%2Fstate%2Fcom.google%2Fstarred"'),success:function(c){var g=[],d=0,h;if(c.query&&c.query.count&&c.query.count>0){c=c.query.results.feed.entry;for(h=c.length;d<h;d++){var e=c[d];g.push({date:parseDate(parseInt(e["crawl-timestamp-msec"],10)),config:a,html:b.tmpl(f.starred,e)})}}i(g)},error:function(){i([])}});return{template:f}};b.fn.lifestream.feeds.instapaper=
function(a,i){a.template={item:(a.showPrefix?"loved ":"")+'<a href="${link}"'+(a.openLinksInNewWindow?' target="_blank"':"")+">${title}</a>"};a.link="http://www.instapaper.com/starred/rss/"+a.user;b.fn.lifestream.feeds.rss(a,i)};b.fn.lifestream.feeds.iusethis=function(a,i){var f=b.extend({},{global:(a.showPrefix?"${action} ":"")+'<a href="${link}"'+(a.openLinksInNewWindow?' target="_blank"':"")+">${what}</a> on (${os})"},a.template);b.ajax({dataType:"jsonp",url:b.fn.lifestream.createYqlUrl('select * from xml where url="http://iphone.iusethis.com/user/feed.rss/'+
a.user+'" or url="http://osx.iusethis.com/user/feed.rss/'+a.user+'" or url="http://win.iusethis.com/user/feed.rss/'+a.user+'"'),success:function(c){var g=[],d,h,e,j,l,n=0,s,m,o,r,k,q;if(c.query&&c.query.count&&c.query.count>0&&c.query.results.rss){s=c.query.results.rss.length||1;if(s==1)c.query.results.rss=[c.query.results.rss];r="started using,stopped using,stopped loving,Downloaded,commented on,updated entry for,started loving,registered".split(",");l=r.length;for(s=2;n<s;n++)if(c.query.results.rss[n]&&
c.query.results.rss[n].channel&&c.query.results.rss[n].channel.item){q=c.query.results.rss[n].channel.link.match(/iphone/)?"iPhone":c.query.results.rss[n].channel.link.match(/osx/)?"OS X":"Windows";d=c.query.results.rss[n].channel.item;h=0;for(e=d.length;h<e;h++){m=d[h];o=m.title.replace(a.user+" ","");for(j=0;j<l;j++)if(o.indexOf(r[j])>-1){k=r[j];break}j=o.split(k);g.push({date:parseDate(m.pubDate),config:a,html:b.tmpl(f.global,{action:k.toLowerCase(),link:m.link,what:j[1],os:q})})}}}i(g)},error:function(){i([])}});
return{template:f}};b.fn.lifestream.feeds.lastfm=function(a,i){var f=b.extend({},{loved:(a.showPrefix?"loved ":"")+'<a href="${url}"'+(a.openLinksInNewWindow?' target="_blank"':"")+'>${name}</a> by <a href="${artist.url}"'+(a.openLinksInNewWindow?' target="_blank"':"")+">${artist.name}</a>"},a.template);b.ajax({dataType:"jsonp",url:b.fn.lifestream.createYqlUrl('select * from xml where url="http://ws.audioscrobbler.com/2.0/user/'+a.user+'/lovedtracks.xml"'),success:function(c){var g=[],d=0,h;if(c.query&&
c.query.count&&c.query.count>0&&c.query.results.lovedtracks&&c.query.results.lovedtracks.track){c=c.query.results.lovedtracks.track;for(h=c.length;d<h;d++){var e=c[d];g.push({date:parseDate(parseInt(e.date.uts*1E3,10)),config:a,html:b.tmpl(f.loved,e)})}}i(g)},error:function(){i([])}});return{template:f}};b.fn.lifestream.feeds.mlkshk=function(a,i){a.template={item:(a.showPrefix?"posted ":"")+'<a href="${link}"'+(a.openLinksInNewWindow?' target="_blank"':"")+">${title}</a>"};a.link="http://mlkshk.com/shake/"+
a.user+"/rss";b.fn.lifestream.feeds.rss(a,i)};b.fn.lifestream.feeds.picplz=function(a,i){var f=b.extend({},{uploaded:(a.showPrefix?"uploaded ":"")+'<a href="${url}"'+(a.openLinksInNewWindow?' target="_blank"':"")+">${title}</a>"},a.template);b.ajax({dataType:"jsonp",url:"http://picplz.com/api/v2/user.json?username="+a.user+"&include_pics=1",success:function(c){var g=[],d=0,h;if((h=c.value.users[0].pics)&&h.length&&h.length>0)for(c=h.length;d<c;d++){var e=h[d];g.push({date:parseDate(e.date*1E3),config:a,
html:b.tmpl(f.uploaded,{url:e.pic_files["640r"].img_url,title:e.caption||e.id})})}i(g)},error:function(){i([])}});return{template:f}};b.fn.lifestream.feeds.pinboard=function(a,i){var f=b.extend({},{bookmarked:(a.showPrefix?"bookmarked ":"")+'<a href="${link}"'+(a.openLinksInNewWindow?' target="_blank"':"")+">${title}</a>"},a.template);b.ajax({dataType:"jsonp",url:b.fn.lifestream.createYqlUrl('select * from xml where url="http://feeds.pinboard.in/rss/u:'+a.user+'"'),success:function(c){var g=[],d=
0,h,e;if(c.query&&c.query.count&&c.query.count>0){c=c.query.results.RDF.item;for(h=c.length;d<h;d++)e=c[d],g.push({date:parseDate(e.date),config:a,html:b.tmpl(f.bookmarked,e)})}i(g)},error:function(){i([])}});return{template:f}};b.fn.lifestream.feeds.posterous=function(a,i){a.link="http://"+a.user+".posterous.com/rss.xml";b.fn.lifestream.feeds.rss(a,i)};b.fn.lifestream.feeds.reddit=function(a,i){var f=b.extend({},{commented:'<a href="http://www.reddit.com/r/${item.data.subreddit}/comments/${item.data.link_id.substring(3)}/u/${item.data.name.substring(3)}?context=3"'+
(a.openLinksInNewWindow?' target="_blank"':"")+'>commented (${score})</a> in <a href="http://www.reddit.com/r/${item.data.subreddit}"'+(a.openLinksInNewWindow?' target="_blank"':"")+">${item.data.subreddit}</a>",created:'<a href="http://www.reddit.com${item.data.permalink}"'+(a.openLinksInNewWindow?' target="_blank"':"")+'>created new thread (${score})</a> in <a href="http://www.reddit.com/r/${item.data.subreddit}"'+(a.openLinksInNewWindow?' target="_blank"':"")+">${item.data.subreddit}</a>"},a.template),
c=function(a){var c=a.data.ups-a.data.downs,c={item:a,score:c>0?"+"+c:c};if(a.kind==="t1")return b.tmpl(f.commented,c);else if(a.kind==="t3")return b.tmpl(f.created,c)};b.ajax({dataType:"jsonp",url:"http://www.reddit.com/user/"+a.user+".json",success:function(b){var d=[],h=0,e;if(b&&b.data&&b.data.children&&b.data.children.length>0)for(e=b.data.children.length;h<e;h++){var f=b.data.children[h];d.push({date:parseDate(f.data.created*1E3),config:a,html:c(f)})}i(d)},error:function(){i([])}});return{template:f}};
b.fn.lifestream.feeds.slideshare=function(a,i){a.template={item:(a.showPrefix?"uploaded a presentation ":"")+'<a href="${link}"'+(a.openLinksInNewWindow?' target="_blank"':"")+">${title}</a>"};a.link="http://www.slideshare.net/rss/user/"+a.user;b.fn.lifestream.feeds.rss(a,i)};b.fn.lifestream.feeds.snipplr=function(a,i){a.template={item:(a.showPrefix?"posted a snippet ":"")+'<a href="${link}"'+(a.openLinksInNewWindow?' target="_blank"':"")+">${title}</a>"};a.link="http://snipplr.com/rss/users/"+a.user;
b.fn.lifestream.feeds.rss(a,i)};b.fn.lifestream.feeds.stackoverflow=function(a,i){var f=b.extend({},{global:'<a href="${link}"'+(a.openLinksInNewWindow?' target="_blank"':"")+">${text}</a> - ${title}"},a.template),c=function(b){var c="",h="",e="",f="http://stackoverflow.com/users/"+a.user;if(b.timeline_type==="badge")c=b.timeline_type+" "+b.action+": "+b.description,h=b.detail,e=f+"?tab=reputation";else if(b.timeline_type==="revision"||b.timeline_type==="comment"||b.timeline_type==="accepted"||b.timeline_type===
"askoranswered")c=b.post_type+" "+b.action,h=b.detail||b.description||"",e="http://stackoverflow.com/questions/"+b.post_id;return{link:e,title:h,text:c}};b.ajax({dataType:"jsonp",url:"http://api.stackoverflow.com/1.1/users/"+a.user+"/timeline?jsonp",success:function(g){var d=[],h=0,e;if(g&&g.total&&g.total>0&&g.user_timelines)for(e=g.user_timelines.length;h<e;h++){var j=g.user_timelines[h];d.push({date:parseDate(j.creation_date*1E3),config:a,html:b.tmpl(f.global,c(j))})}i(d)},error:function(){i([])}});
return{template:f}};b.fn.lifestream.feeds.tumblr=function(a,i){var f=b.extend({},{posted:(a.showPrefix?"posted a ${type} ":"")+'<a href="${url}"'+(a.openLinksInNewWindow?' target="_blank"':"")+">${title}</a>"},a.template),c=function(a,c){return{date:parseDate(c.date),config:a,html:b.tmpl(f.posted,{type:c.type,url:c.url,title:(c["regular-title"]||c["quote-text"]||c["conversation-title"]||c["photo-caption"]||c["video-caption"]||c["audio-caption"]||c["regular-body"]||c["link-text"]||c.type||"").replace(/<.+?>/gi,
" ")})}};b.ajax({dataType:"jsonp",url:b.fn.lifestream.createYqlUrl('select * from tumblr.posts where username="'+a.user+'"'),success:function(g){var d=[],h=0,e,f;if(g.query&&g.query.count&&g.query.count>0)if(b.isArray(g.query.results.posts.post))for(e=g.query.results.posts.post.length;h<e;h++)f=g.query.results.posts.post[h],d.push(c(a,f));else b.isPlainObject(g.query.results.posts.post)&&d.push(c(a,g.query.results.posts.post));i(d)},error:function(){i([])}});return{template:f}};b.fn.lifestream.feeds.twitter=
function(a,i){var f=b.extend({},{posted:"{{html tweet}}"},a.template),c=function(a,b){return function(a){return a.replace(/(^|[^\w'"]+)\#([a-zA-Z0-9_]+)/g,function(a,c,g){return c+'<a href="http://search.twitter.com/search?q=%23'+g+'"'+(b?' target="_blank"':"")+">#"+g+"</a>"})}(function(a){return a.replace(/(^|[^\w]+)\@([a-zA-Z0-9_]{1,15})/g,function(a,c,g){return c+'<a href="http://twitter.com/'+g+'"'+(b?' target="_blank"':"")+">@"+g+"</a>"})}(function(a){return a.replace(/[a-z]+:\/\/[a-z0-9-_]+\.[a-z0-9-_:~%&\?\/.=]+[^:\.,\)\s*$]/ig,
function(a){return'<a href="'+a+'"'+(b?' target="_blank"':"")+">"+(a.length>25?a.substr(0,24)+"...":a)+"</a>"})}(a)))};b.ajax({dataType:"jsonp",url:b.fn.lifestream.createYqlUrl('select status.id, status.user.screen_name, status.created_at,status.text from twitter.user.timeline where screen_name="'+a.user+'"'),success:function(g){var d=[],h=0,e;if(g.query&&g.query.count&&g.query.count>0)for(e=g.query.count;h<e;h++){var j=g.query.results.statuses[h].status;d.push({date:parseDate(j.created_at),config:a,
html:b.tmpl(f.posted,{tweet:c(j.text,a.openLinksInNewWindow)+' <a href="http://twitter.com/#!/'+j.user.screen_name+"/statuses/"+j.id+'"'+(a.openLinksInNewWindow?' target="_blank"':"")+">#</a>"})})}i(d)},error:function(){i([])}});return{template:f}};b.fn.lifestream.feeds.vimeo=function(a,i){var f=b.extend({},{posted:(a.showPrefix?"posted ":"")+'<a href="${url}"'+(a.openLinksInNewWindow?' target="_blank"':"")+' title="${description}">${title}</a>'},a.template);b.ajax({dataType:"jsonp",url:"http://vimeo.com/api/v2/"+
a.user+"/videos.json",success:function(c){var g=[],d=0,h,e;if(c)for(h=c.length;d<h;d++)e=c[d],g.push({date:parseDate(e.upload_date.replace(" ","T")),config:a,html:b.tmpl(f.posted,{url:e.url,description:e.description.replace(/"/g,"'").replace(/<.+?>/gi,""),title:e.title})});i(g)},error:function(){i([])}});return{template:f}};b.fn.lifestream.feeds.rss=function(a,i){var f=b.extend({},{item:(a.showPrefix?"posted ":"")+'<a href="${link}"'+(a.openLinksInNewWindow?' target="_blank"':"")+">${title}</a>"},
a.template);parseRss=function(c){var g=[],d=0,h,e;if(c.query&&c.query.count&&c.query.count>0)if(c.query.results.rss&&c.query.results.rss.channel&&c.query.results.rss.channel.item){c=c.query.results.rss.channel.item;for(h=c.length;d<h;d++){e=c[d];if(e.date&&!e.pubDate)e.pubDate=e.date;g.push({date:parseDate(e.pubDate),config:a,html:b.tmpl(f.item,e)})}}else if(c.query.results.feed&&c.query.results.feed.entry){c=c.query.results.feed.entry;for(h=c.length;d<h;d++){e=c[d];if(e.link.href)e.link=e.link.href;
if(e.title.content)e.title=e.title.content;g.push({date:parseDate(e.published),config:a,html:b.tmpl(f.item,e)})}}else if(c.query.results.item)for(h=c.query.count;d<h;d++){e=c.query.results.item[d];if(e.date&&!e.pubDate)e.pubDate=e.date;g.push({date:parseDate(e.pubDate),config:a,html:b.tmpl(f.checkedin,e)})}return g};b.ajax({dataType:"jsonp",url:b.fn.lifestream.createYqlUrl('select * from xml where url="'+(a.link?a.link:a.user)+'"'),success:function(a){i(parseRss(a))},error:function(){i([])}});return{template:f}};
b.fn.lifestream.feeds.wordpress=function(a,i){a.link="http://"+a.user+".wordpress.com/feed";b.fn.lifestream.feeds.rss(a,i)};b.fn.lifestream.feeds.youtube=function(a,i){var f=b.extend({},{uploaded:(a.showPrefix?"uploaded ":"")+"<a href=\"${player['default']}\""+(a.openLinksInNewWindow?' target="_blank"':"")+' title="${description}">${title}</a>'},a.template);b.ajax({dataType:"jsonp",url:"http://gdata.youtube.com/feeds/api/users/"+a.user+"/uploads?v=2&alt=jsonc",success:function(c){var g=[],d=0,h,e;
if(c.data&&c.data.items)for(h=c.data.items.length;d<h;d++)e=c.data.items[d],g.push({date:parseDate(e.uploaded),config:a,html:b.tmpl(f.uploaded,e)});i(g)},error:function(){i([])}});return{template:f}};b.fn.lifestream.feeds.facebook=function(a,i){var f=b.extend({},{posted:"{{html message}}"},a.template),c=function(a){var b,c,e,f;if(a.indexOf(" ")==-1&&a.substr(4,1)=="-"&&a.substr(7,1)=="-"&&a.substr(10,1)=="T")b=a.substr(0,4),c=parseInt(a.substr(5,1)=="0"?a.substr(6,1):a.substr(5,2))-1,e=a.substr(8,
2),f=a.substr(11,2),a=a.substr(14,2),f=Date.UTC(b,c,e,f,a),f=parseDate(f);else{b=a.split(" ");if(b.length!=6||b[4]!="at")return a;f=b[5].split(":");c=f[1].substr(2);a=f[1].substr(0,2);f=parseInt(f[0]);c=="pm"&&(f+=12);f=parseDate(b[1]+" "+b[2]+" "+b[3]+" "+f+":"+a);f.setTime(f.getTime()-252E5)}return f};parseFacebook=function(g){var d=[];g.data&&b(g.data).each(function(){var g=this.type=="link"?(a.showPrefix?"posted a link ":"")+'<a href="'+this.link+'"'+(a.openLinksInNewWindow?' target="_blank"':
"")+">"+this.name+"</a>":this.type=="status"?this.message?this.message:this.name:(a.showPrefix?"posted a "+this.type+" "+(this.type=="photo"?"in ":""):"")+(this.link?'<a href="'+this.link+'"'+(a.openLinksInNewWindow?' target="_blank"':"")+">"+this.name+"</a> ":"")+(this.message&&this.message!=this.name?" - "+this.message:this.description?" - "+this.description:"");d.push({date:c(this.created_time),config:a,html:b.tmpl(f.posted,{message:g})})});return d};b.ajax({dataType:"jsonp",url:"https://graph.facebook.com/"+
a.user+"/posts?access_token="+a.access_token+"&limit=20",success:function(a){i(parseFacebook(a))},error:function(){i([])}});return{template:f}}})(jQuery);function relative_time(b){b=parseInt(((new Date).getTime()-b)/1E3);return b<60?"less than a minute ago":b<120?"about a minute ago":b<3600?parseInt(b/60).toString()+" minutes ago":b<7200?"about an hour ago":b<86400?"about "+parseInt(b/3600).toString()+" hours ago":b<172800?"1 day ago":parseInt(b/86400).toString()+" days ago"};

$(document).ready(function(){	
	$("#stacks_in_15_page5container").lifestream({
      limit: 7,
 	  waitUntilLoaded: true,
      showTime: true,
	  openLinksInNewWindow: true,
	  showPrefix: true,
      showIcons: ('icon' == 'icon' ? true : false),
      list:[
	  		  {service: "twitter", user: $.trim("suzanne_savage")},
	  		  {service: "facebook", user: $.trim(""), "access_token": $.trim("")},
	  		  {service: "tumblr", user: $.trim("")},
	  		  {service: "posterous", user: $.trim($('#posterous_stacks_in_15_page5').text()) },
	  		  {service: "wordpress", user: $.trim($('#wordpress_stacks_in_15_page5').text()) },
			  {service: "youtube", user: $.trim("")},
			  {service: "vimeo", user: $.trim("")},
			  {service: "flickr", user: $.trim("")},
			  {service: "delicious", user: $.trim($('#delicious_stacks_in_15_page5').text()) },
			  {service: "lastfm", user: $.trim($('#lastfm_stacks_in_15_page5').text()) },
			  {service: "googlereader", user: $.trim($('#googlereader_stacks_in_15_page5').text()) },
		      {service: "blogger", user: $.trim($('#blogger_stacks_in_15_page5').text()) },
		      {service: "dailymotion", user: $.trim($('#dailymotion_stacks_in_15_page5').text()) },
		      {service: "deviantart", user: $.trim($('#deviantart_stacks_in_15_page5').text()) },
		      {service: "dribbble", user: $.trim($('#dribbble_stacks_in_15_page5').text()) },
		      {service: "foomark", user: $.trim($('#foomark_stacks_in_15_page5').text()) },
		      {service: "formspring", user: $.trim($('#formspring_stacks_in_15_page5').text()) },
		      {service: "forrst", user: $.trim($('#forrst_stacks_in_15_page5').text()) },
		      {service: "foursquare", user: $.trim($('#foursquare_stacks_in_15_page5').text()) },
		      {service: "github", user: $.trim($('#github_stacks_in_15_page5').text()) },
		      {service: "instapaper", user: $.trim($('#instapaper_stacks_in_15_page5').text()) },
		      {service: "iusethis", user: $.trim($('#iusethis_stacks_in_15_page5').text()) },
		      {service: "mlkshk", user: $.trim($('#mlkshk_stacks_in_15_page5').text()) },
		      {service: "picplz", user: $.trim($('#picplz_stacks_in_15_page5').text()) },
		      {service: "pinboard", user: $.trim($('#pinboard_stacks_in_15_page5').text()) },
		      {service: "reddit", user: $.trim($('#reddit_stacks_in_15_page5').text()) },
		      {service: "rss", user: $.trim($('#rss_stacks_in_15_page5').text()) },
		      {service: "rss_2", user: $.trim($('#rss_2_stacks_in_15_page5').text()) },
		      {service: "rss_3", user: $.trim($('#rss_3_stacks_in_15_page5').text()) },
		      {service: "rss_4", user: $.trim($('#rss_4_stacks_in_15_page5').text()) },
		      {service: "rss_5", user: $.trim($('#rss_5_stacks_in_15_page5').text()) },
		      {service: "slideshare", user: $.trim($('#slideshare_stacks_in_15_page5').text()) },
		      {service: "snipplr", user: $.trim($('#snipplr_stacks_in_15_page5').text()) },
		      {service: "stackoverflow", user: $.trim($('#stackoverflow_stacks_in_15_page5').text()) }
			]
    });
});

	return stack;
})(stacks.stacks_in_15_page5);



