/* Superfish v1.4.8 - jQuery menu widget Copyright (c) 2008 Joel Birch	 Dual licensed under the MIT and GPL licenses. */;(function($){$.fn.superfish=function(op){var sf=$.fn.superfish,c=sf.c,$arrow=$(['<span class="',c.arrowClass,'"> »</span>'].join('')),over=function(){var $$=$(this),menu=getMenu($$);clearTimeout(menu.sfTimer);$$.showSuperfishUl().siblings().hideSuperfishUl();},out=function(){var $$=$(this),menu=getMenu($$),o=sf.op;clearTimeout(menu.sfTimer);menu.sfTimer=setTimeout(function(){o.retainPath=($.inArray($$[0],o.$path)>-1);$$.hideSuperfishUl();if(o.$path.length&&$$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}},o.delay);},getMenu=function($menu){var menu=$menu.parents(['ul.',c.menuClass,':first'].join(''))[0];sf.op=sf.o[menu.serial];return menu;},addArrow=function($a){$a.addClass(c.anchorClass).append($arrow.clone());};return this.each(function(){var s=this.serial=sf.o.length;var o=$.extend({},sf.defaults,op);o.$path=$('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){$(this).addClass([o.hoverClass,c.bcClass].join(' ')).filter('li:has(ul)').removeClass(o.pathClass);});sf.o[s]=sf.op=o;$('li:has(ul)',this)[($.fn.hoverIntent&&!o.disableHI)?'hoverIntent':'hover'](over,out).each(function(){if(o.autoArrows)addArrow($('>a:first-child',this));}).not('.'+c.bcClass).hideSuperfishUl();var $a=$('a',this);$a.each(function(i){var $li=$a.eq(i).parents('li');$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});});o.onInit.call(this);}).each(function(){var menuClasses=[c.menuClass];if(sf.op.dropShadows&&!($.browser.msie&&$.browser.version<7))menuClasses.push(c.shadowClass);$(this).addClass(menuClasses.join(' '));});};var sf=$.fn.superfish;sf.o=[];sf.op={};sf.IE7fix=function(){var o=sf.op;if($.browser.msie&&$.browser.version>6&&o.dropShadows&&o.animation.opacity!=undefined)
this.toggleClass(sf.c.shadowClass+'-off');};sf.c={bcClass:'sf-breadcrumb',menuClass:'sf-js-enabled',anchorClass:'sf-with-ul',arrowClass:'sf-sub-indicator',shadowClass:'sf-shadow'};sf.defaults={hoverClass:'sfHover',pathClass:'overideThisToUse',pathLevels:1,delay:800,animation:{opacity:'show'},speed:'normal',autoArrows:true,dropShadows:true,disableHI:false,onInit:function(){},onBeforeShow:function(){},onShow:function(){},onHide:function(){}};$.fn.extend({hideSuperfishUl:function(){var o=sf.op,not=(o.retainPath===true)?o.$path:'';o.retainPath=false;var $ul=$(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass).find('>ul').hide().css('visibility','hidden');o.onHide.call($ul);return this;},showSuperfishUl:function(){var o=sf.op,sh=sf.c.shadowClass+'-off',$ul=this.addClass(o.hoverClass).find('>ul:hidden').css('visibility','visible');sf.IE7fix.call($ul);o.onBeforeShow.call($ul);$ul.animate(o.animation,o.speed,function(){sf.IE7fix.call($ul);o.onShow.call($ul);});return this;}});})(jQuery);

// -----------------------------------------------------------------------------
//  TIME AGO
// -----------------------------------------------------------------------------
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(4($){$.7=4(a){8(a 1h x){5 9(a)}R 8(1i a==="1j"){5 9($.7.y(a))}R{5 9($.7.p(a))}};3 o=$.7;$.1k($.7,{v:{z:1l,S:1m,U:{V:W,X:W,Y:"1n",10:"1o 1p",11:"1q 1r a w",w:"u a w",A:"%d A",B:"u 1s B",C:"u %d C",D:"a D",E:"%d E",F:"u a F",G:"%d G",H:"u a H",I:"%d I",J:[]}},9:4(e){3 f=t.v.U;3 g=f.V;3 h=f.Y;8(t.v.S){8(e<0){g=f.X;h=f.10}e=q.1t(e)}3 i=e/1u;3 j=i/K;3 k=j/K;3 l=k/12;3 m=l/13;4 6(a,b){3 c=$.1v(a)?a(b,e):a;3 d=(f.J&&f.J[b])||b;5 c.r(/%d/i,d)}3 n=i<14&&6(f.11,q.L(i))||i<15&&6(f.w,1)||j<14&&6(f.A,q.L(j))||j<15&&6(f.B,1)||k<12&&6(f.C,q.L(k))||k<1w&&6(f.D,1)||l<16&&6(f.E,q.M(l))||l<K&&6(f.F,1)||l<13&&6(f.G,q.M(l/16))||m<2&&6(f.H,1)||6(f.I,q.M(m));5 $.N([g,n,h].1x(" "))},y:4(a){3 s=$.N(a);s=s.r(/\\.\\d\\d\\d+/,"");s=s.r(/-/,"/").r(/-/,"/");s=s.r(/T/," ").r(/Z/," 1y");s=s.r(/([\\+\\-]\\d\\d)\\:?(\\d\\d)/," $1$2");5 17 x(s)},p:4(a){3 b=$(a).1z(0).1A.1B()==="18";3 c=b?$(a).O("p"):$(a).O("19");5 o.y(c)}});$.1C.7=4(){3 a=t;a.1a(P);3 b=o.v;8(b.z>0){1D(4(){a.1a(P)},b.z)}5 a};4 P(){3 a=1b(t);8(!1E(a.p)){$(t).1c(9(a.p))}5 t}4 1b(a){a=$(a);8(!a.Q("7")){a.Q("7",{p:o.p(a)});3 b=$.N(a.1c());8(b.1F>0){a.O("19",b)}}5 a.Q("7")}4 9(a){5 o.9(1d(a))}4 1d(a){5(17 x().1e()-a.1e())}1f.1g("1G");1f.1g("18")}(1H));',62,106,'|||var|function|return|substitute|timeago|if|inWords||||||||||||||||datetime|Math|replace||this|about|settings|minute|Date|parse|refreshMillis|minutes|hour|hours|day|days|month|months|year|years|numbers|60|round|floor|trim|attr|refresh|data|else|allowFuture||strings|prefixAgo|null|prefixFromNow|suffixAgo||suffixFromNow|seconds|24|365|45|90|30|new|time|title|each|prepareData|text|distance|getTime|document|createElement|instanceof|typeof|string|extend|60000|false|ago|from|now|less|than|an|abs|1000|isFunction|48|join|UTC|get|tagName|toLowerCase|fn|setInterval|isNaN|length|abbr|jQuery'.split('|'),0,{}));



// Start theme variables
jQuery(document).ready(function() {
	jQuery('ul.nav').superfish({
		speed: 'fast',
		dropShadows: false
	});
});
// End theme variables


// -----------------------------------------------------------------------------
//  TWITTER FEED
// -----------------------------------------------------------------------------

jQuery(document).ready(function($) {
	if($("#tweets").length) {
		$.ajax({
			type : 'GET',
			dataType : 'jsonp',
			url : 'https://api.twitter.com/1/statuses/user_timeline.json?screen_name=minstriesbydsgn&exclude_replies=true&include_rts=false&count=4',
			success : function(tweets) {
				$.each(tweets, function(i) {
					if(i < 4) {
						//console.log(tweets[i]);
						var tweet = tweets[i].text;
						tweet = tweet.replace(/http:\/\/\S+/g,  '<a href="$&" target="_blank">$&</a>');
						tweet = tweet.replace(/\s(@)(\w+)/g,    ' @<a class="at-reply" href="http://twitter.com/$2" target="_blank">$2</a>');
						tweet = tweet.replace(/\s(#)(\w+)/g,    ' #<a class="hashtag" href="http://search.twitter.com/search?q=%23$2" target="_blank">$2</a>');
						
						var time = tweets[i].created_at;
												
						$("#tweets").append('<li><span class="text">' + tweet + '</span> &mdash; <span class="time">' + $.timeago(time) + '</span></li>').hide();	
						
						if(i == 3) {
							$("#tweets").animate({ opacity: "show", height: "show" }, 500);
						}	
					}	
				});
				
			}
		});
	}
});
