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

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

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

$(document).ready(function(){	
	$("#stacks_in_6_page3container").lifestream({
      limit: 5,
 	  waitUntilLoaded: true,
      showTime: true,
	  openLinksInNewWindow: true,
      list:[
	  		  {service: "twitter", user: "Denise_Olson"},
	  		  {service: "facebook", user: "", "access_token": ""},
	  		  {service: "tumblr", user: "littlethoughts-us.tumblr.com"},
	  		  {service: "posterous", user: $('#posterous_user_stacks_in_6_page3').text() },
	  		  {service: "wordpress", user: $('#wordpress_user_stacks_in_6_page3').text() },
			  {service: "youtube", user: ""},
			  {service: "vimeo", user: ""},
			  {service: "flickr", user: ""},
			  {service: "delicious", user: $('#delicious_stacks_in_6_page3').text() },
			  {service: "lastfm", user: $('#lastfm_stacks_in_6_page3').text() },
			  {service: "googlereader", user: $('#googlereader_stacks_in_6_page3').text() },
		      {service: "blogger", user: $('#blogger_stacks_in_6_page3').text() },
		      {service: "dailymotion", user: $('#dailymotion_stacks_in_6_page3').text() },
		      {service: "deviantart", user: $('#deviantart_stacks_in_6_page3').text() },
		      {service: "dribbble", user: $('#dribbble_stacks_in_6_page3').text() },
		      {service: "foomark", user: $('#foomark_stacks_in_6_page3').text() },
		      {service: "formspring", user: $('#formspring_stacks_in_6_page3').text() },
		      {service: "forrst", user: $('#forrst_stacks_in_6_page3').text() },
		      {service: "foursquare", user: $('#foursquare_stacks_in_6_page3').text() },
		      {service: "github", user: $('#github_stacks_in_6_page3').text() },
		      {service: "instapaper", user: $('#instapaper_stacks_in_6_page3').text() },
		      {service: "iusethis", user: $('#iusethis_stacks_in_6_page3').text() },
		      {service: "mlkshk", user: $('#mlkshk_stacks_in_6_page3').text() },
		      {service: "picplz", user: $('#picplz_stacks_in_6_page3').text() },
		      {service: "pinboard", user: $('#pinboard_stacks_in_6_page3').text() },
		      {service: "reddit", user: $('#reddit_stacks_in_6_page3').text() },
		      {service: "rss", user: $('#rss_stacks_in_6_page3').text() },
		      {service: "slideshare", user: $('#slideshare_stacks_in_6_page3').text() },
		      {service: "snipplr", user: $('#snipplr_stacks_in_6_page3').text() },
		      {service: "stackoverflow", user: $('#stackoverflow_stacks_in_6_page3').text() }
			]
    });
});

	return stack;
})(stacks.stacks_in_6_page3);


// Javascript for stacks_in_647_page3
// ---------------------------------------------------------------------

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

// A closure is defined and assined to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for refering
// to this object from elsewhere.
stacks.stacks_in_647_page3 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
// Background Stack by http://www.doobox.co.uk
// Copyright@2010 Mr JG Simpson, trading as Doobox.
// all rights reserved.



$(document).ready(function() {
jQuery.url = function()
{
	var segments = {};
	
	var parsed = {};
	
	/**
    * Options object. Only the URI and strictMode values can be changed via the setters below.
    */
  	var options = {
	
		url : window.location, // default URI is the page in which the script is running
		
		strictMode: false, // 'loose' parsing by default
	
		key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], // keys available to query 
		
		q: {
			name: "queryKey",
			parser: /(?:^|&)([^&=]*)=?([^&]*)/g
		},
		
		parser: {
			strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,  //less intuitive, more accurate to the specs
			loose:  /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ // more intuitive, fails on relative paths and deviates from specs
		}
		
	};
	
    /**
     * Deals with the parsing of the URI according to the regex above.
 	 * Written by Steven Levithan - see credits at top.
     */		
	var parseUri = function()
	{
		str = decodeURI( options.url );
		
		var m = options.parser[ options.strictMode ? "strict" : "loose" ].exec( str );
		var uri = {};
		var i = 14;

		while ( i-- ) {
			uri[ options.key[i] ] = m[i] || "";
		}

		uri[ options.q.name ] = {};
		uri[ options.key[12] ].replace( options.q.parser, function ( $0, $1, $2 ) {
			if ($1) {
				uri[options.q.name][$1] = $2;
			}
		});

		return uri;
	};

    /**
     * Returns the value of the passed in key from the parsed URI.
  	 * 
	 * @param string key The key whose value is required
     */		
	var key = function( key )
	{
		if ( ! parsed.length )
		{
			setUp(); // if the URI has not been parsed yet then do this first...	
		} 
		if ( key == "base" )
		{
			if ( parsed.port !== null && parsed.port !== "" )
			{
				return parsed.protocol+"://"+parsed.host+":"+parsed.port+"/";	
			}
			else
			{
				return parsed.protocol+"://"+parsed.host+"/";
			}
		}
	
		return ( parsed[key] === "" ) ? null : parsed[key];
	};
	
	/**
     * Returns the value of the required query string parameter.
  	 * 
	 * @param string item The parameter whose value is required
     */		
	var param = function( item )
	{
		if ( ! parsed.length )
		{
			setUp(); // if the URI has not been parsed yet then do this first...	
		}
		return ( parsed.queryKey[item] === null ) ? null : parsed.queryKey[item];
	};

    /**
     * 'Constructor' (not really!) function.
     *  Called whenever the URI changes to kick off re-parsing of the URI and splitting it up into segments. 
     */	
	var setUp = function()
	{
		parsed = parseUri();
		
		getSegments();	
	};
	
    /**
     * Splits up the body of the URI into segments (i.e. sections delimited by '/')
     */
	var getSegments = function()
	{
		var p = parsed.path;
		segments = []; // clear out segments array
		segments = parsed.path.length == 1 ? {} : ( p.charAt( p.length - 1 ) == "/" ? p.substring( 1, p.length - 1 ) : path = p.substring( 1 ) ).split("/");
	};
	
	return {
		
	    /**
	     * Sets the parsing mode - either strict or loose. Set to loose by default.
	     *
	     * @param string mode The mode to set the parser to. Anything apart from a value of 'strict' will set it to loose!
	     */
		setMode : function( mode )
		{
			strictMode = mode == "strict" ? true : false;
			return this;
		},
		
		/**
	     * Sets URI to parse if you don't want to to parse the current page's URI.
		 * Calling the function with no value for newUri resets it to the current page's URI.
	     *
	     * @param string newUri The URI to parse.
	     */		
		setUrl : function( newUri )
		{
			options.url = newUri === undefined ? window.location : newUri;
			setUp();
			return this;
		},		
		
		/**
	     * Returns the value of the specified URI segment. Segments are numbered from 1 to the number of segments.
		 * For example the URI http://test.com/about/company/ segment(1) would return 'about'.
		 *
		 * If no integer is passed into the function it returns the number of segments in the URI.
	     *
	     * @param int pos The position of the segment to return. Can be empty.
	     */	
		segment : function( pos )
		{
			if ( ! parsed.length )
			{
				setUp(); // if the URI has not been parsed yet then do this first...	
			} 
			if ( pos === undefined )
			{
				return segments.length;
			}
			return ( segments[pos] === "" || segments[pos] === undefined ) ? null : segments[pos];
		},
		
		attr : key, // provides public access to private 'key' function - see above
		
		param : param // provides public access to private 'param' function - see above
		
	};
	
}();


var yourfolder = jQuery.url.attr("directory");
if(yourfolder == "/"){yourfolder = ""};


var rptx = "0";
var rpty = "0";
var axisrepeat = "repeat";
var positionlmr = "2";
var positiontmb = "2";




if(rptx == 0 && rpty == 0){
    axisrepeat = "no-repeat";
}
else if(rptx == 0 && rpty == 1){
    axisrepeat = "repeat-y";
}
else if(rptx == 1 && rpty == 0){
    axisrepeat = "repeat-x";
}
else{
    axisrepeat = "repeat";
}



                switch (positiontmb) {
                	case "1":
                        positiontmb = "top";
                        break;
                    case "2":
                        positiontmb = "center";
                        break;
                    case "3":
                        positiontmb = "bottom";
                        break;  
                    default:
                        positiontmb = "center";
                };
                
                switch (positionlmr) {
                	case "1":
                        positionlmr = "left";
                        break;
                    case "2":
                        positionlmr = "center";
                        break;
                    case "3":
                        positionlmr = "right";
                        break;  
                    default:
                        positionlmr = "center";
                };




var bgimage = $("#stacks_in_647_page3 .stacks_in_647_page3bgimage img").attr("src");

var bgcolor = "";
if (bgcolor == "") {var bgcolor = "#F3F7FF";}
else {
	var bgcolor = "";
}

var itsIEnine = navigator.userAgent.match(/MSIE 9/i) != null;


if(itsIEnine){
	$("#stacks_in_647_page3 .stacks_in_647_page3bgimagestack").css({
    "background":"url("+bgimage+") " + axisrepeat + " " + bgcolor,
    "background-position": positionlmr + " " + positiontmb,
    "-webkit-border-radius" : "8px",
    "-moz-border-radius" : "8px",
    "border-radius" : "8px"
    });
}
else{
    $("#stacks_in_647_page3 .stacks_in_647_page3bgimagestack").css({
    "background":"url("+bgimage+") " + axisrepeat + " " + bgcolor,
    "background-position": positionlmr + " " + positiontmb,
    "-webkit-border-radius" : "8px",
    "-moz-border-radius" : "8px",
    "border-radius" : "8px",
    "behavior":"url(" + yourfolder + "files/RBPIE.htc)" 
    });
}

     
});

	return stack;
})(stacks.stacks_in_647_page3);


// Javascript for stacks_in_42_page3
// ---------------------------------------------------------------------

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

// A closure is defined and assined to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for refering
// to this object from elsewhere.
stacks.stacks_in_42_page3 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
(function($){
	$.fn.jTruncate = function(options) {
	   
       
       var options = $.extend(defaults, options);
       
		var defaults = {
                    length: 84,  
                    minTrail: 0,  
                    moreText: "[Read More]",  
                    lessText: "[Close]",  
                    ellipsisText: " ",  
                    moreAni: "slow",  
                    lessAni: "slow" 
		};
		
		
	   
		return this.each(function() {
			obj = $(this);
			var body = obj.html();
			
			if(body.length > options.length + options.minTrail) {
				var splitLocation = body.indexOf(' ', options.length);
				if(splitLocation != -1) {
					// truncate tip
					var splitLocation = body.indexOf(' ', options.length);
					var str1 = body.substring(0, splitLocation);
					var str2 = body.substring(splitLocation, body.length - 1);
					obj.html(str1 + '<span class="truncate_ellipsis">' + options.ellipsisText + 
						'</span>' + '<span class="truncate_more">' + str2 + '</span>');
					obj.find('.truncate_more').css("display", "none");
					
					// insert more link
					obj.append(
						'<div class="clearboth">' +
							'<a href="#" class="truncate_more_link">' + options.moreText + '</a>' +
						'</div>'
					);

					// set onclick event for more/less link
					var moreLink = $('.truncate_more_link', obj);
					var moreContent = $('.truncate_more', obj);
					var ellipsis = $('.truncate_ellipsis', obj);
					moreLink.click(function() {
						if(moreLink.text() == options.moreText) {
							moreContent.show(options.moreAni);
							moreLink.text(options.lessText);
							ellipsis.css("display", "none");
						} else {
							moreContent.hide(options.lessAni);
							moreLink.text(options.moreText);
							ellipsis.css("display", "inline");
						}
						return false;
				  	});
				}
			} // end if
			
		});
	};
})(jQuery);


                    $().ready(function() {  
                    $('#stacks_in_42_page3 .trunky').jTruncate({  
                    length: 84,  
                    minTrail: 0,  
                    moreText: "[Read More]",  
                    lessText: "[Close]",  
                    ellipsisText: " ",  
                    moreAni: "slow",  
                    lessAni: "slow"  
                    });  
                    }); 
	return stack;
})(stacks.stacks_in_42_page3);



