window.log = function(){
  log.history = log.history || [];
  log.history.push(arguments);
  arguments.callee = arguments.callee.caller;  
  if(this.console) console.log( Array.prototype.slice.call(arguments) );
};

(function(b){function c(){}for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();)b[a]=b[a]||c})(window.console=window.console||{});

(function($) {
	$.fn.overflowList = function (settings) {

		settings = $.extend({
			inital: 5,
			increment: 5
		}, settings || {});

		return this.each(function () {

			var $this = $(this),
                $items = $this.children(),
                $more = $('<a href="#" class="button button-more">Show More Courses</a>'),
                $buttons = $('<div class="buttons" />'),
                limit = settings.increment;
                
		  	if ($items.length - 1 > settings.inital) {

				$('div.item:gt(' + (settings.inital - 1) + ')', $this).hide();

				$this.append($buttons.html($more));

				$more.click(function (e) {

				    $('div.item:eq(' + limit + ')', $this).addClass('limit');

					limit += settings.increment;
					$('div.item:lt(' + limit + ')', $this).fadeIn();

					if (limit > $items.length) {
						$(this).hide();
					}
					e.preventDefault();
				});

			}


		});
	};
})(jQuery);


/*
 * jQuery Gallery Plugin
 * version: 1.0
 * Author: Oliver Relph
 * Copyright: Copyright 2011 Oliver Relph
 */

(function ($) {
	$.fn.gallery = function (settings) {
		
		settings = $.extend({
			item: '.item',
            hashPrefix: 'item-',
            hashChange: function () {},
            fadeTime: 500,
            delayTime: 5000,
            hashNav: true
		}, settings || {});
        
		return this.each(function () {

			var $this = $(this),
				$items = $(settings.item, $this),
				currentItemIndex = 0,
                first = true;
                
			pauseGallery();

			$items.each(function (i) {
				
				$(this).attr('id', 'image-' + i).css('z-index', $items.length - i);

			});

            

			var oldHash = undefined;

			setInterval(function () {
            
				var newHash = window.location.hash;

                var gotoPhotoForCurrentHash = function () {
            
                        settings.hashChange.call(null, newHash);

					    var $gotoPhoto = $('a.image-anchor[name = "' + newHash.replace('#' + settings.hashPrefix, '') + '"]').parent().parent(),
						    gotoIndex = 0;

					    for (var i = 0; i < $items.length; i++) {

						    if ($gotoPhoto.attr('id') == $($items[i]).attr('id')) {

							    gotoIndex = i;
							    break;

						    }

					    }
                    
					    animateToPhoto(gotoIndex, function (newIndex) {
						
						    currentItemIndex = newIndex;

					    });

                        first = false;
                }

                
				if ((newHash != oldHash && typeof oldHash != 'undefined')) {
                
					gotoPhotoForCurrentHash();

				} else if (typeof oldHash == 'undefined' && newHash === '') {
					
					playGallery();
                    first = false;


				} else if (first) {
                
                    gotoPhotoForCurrentHash();

                }
				oldHash = newHash;

			}, 50);
            

			// slideshow loop
			function hidePhoto(index) {

				currentItemIndex = index;
						
				var currPhoto = $($items[index]).attr('id');

				for (var i = 0; i < $items.length + 1; i++) {

					if (currPhoto == $($items[i-1]).attr('id')) {
						gotoIndex = i;
						break;
					}

				}

				if (gotoIndex == $items.length) {
					gotoIndex = 0;
				}


				if ($this.data('playing')) {

					setTimeout(function () {

						var hash = $($items[gotoIndex]).find('a.image-anchor').attr('name');

						window.location.hash = '#' + settings.hashPrefix + hash;

					}, settings.delayTime);


				}

			}

			function animateToPhoto (next, callback) {

				var $next = $($items[next]);

				$next.hide();

				$items.each(function (i) {

					var $this = $(this);

					$this.css('z-index', +($this.css('z-index')) - 1);

				});

				$next.css('z-index', $items.length).fadeIn(settings.fadeTime, function () {

					callback.call(this, next);

					if ($this.data('playing')) {
						
						if (next == $items.length) {

							next = 0;

						}

						hidePhoto(next)
					}

				});

			}
            
            function playGallery () {
                
                $this.data('playing', true);
        				
		        hidePhoto(currentItemIndex)
				
	        };

            function pauseGallery () {
        
                $this.data('playing', false);

	        };

		});

	};

})(jQuery);
// twitterlib.js (c) 2009 Remy Sharp
// Licensed under the terms of the MIT license.
(function(f,l){function C(b){var a='';a+='';a+='<div class="hentry"><strong><a href="http://twitter.com/';a+=b.user.screen_name+'" ';a+='title="'+b.user.name+'" target="_blank">'+b.user.screen_name+"</a></strong> ";a+='<span class="entry-content">';a+=l[f].ify.clean(b.text);
a+='</span> <span class="meta entry-meta"><a href="http://twitter.com/'+b.user.screen_name;a+="/status/"+b.id+'" class="entry-date" rel="bookmark" target="_blank"><span class="published" title="';a+=b.created_at+'">'+l[f].time.datetime(b.created_at)+"</span></a>";if(b.source)a+=" <span>from "+b.source+"</span>";a+="</span></div></div>";return a}function u(b){s.getElementById(f+b)&&x.removeChild(s.getElementById(f+b));delete t[f+b];m[f+b]=n;try{delete m[f+b]}catch(a){}}function y(b,a,d){var c=s.createElement("script"),
e=null;if(a==n)a={};o++;t[f+o]=true;m[f+o]=function(k,h){return function(g){var i=0,p=[];if(g.results){g=g.results;for(i=g.length;i--;){g[i].user={id:g[i].from_user_id,screen_name:g[i].from_user,profile_image_url:g[i].profile_image_url};g[i].source=l[f].ify.entities(g[i].source);p=g[i].created_at.split(" ");g[i].created_at=[p[0],p[2],p[1],p[4],p[5],p[3]].join(" ").replace(/,/,"")}}else if(g.length&&g[0].sender)for(i=g.length;i--;){g[i].user=g[i].sender;g[i].originalText=g[i].text;g[i].text="@"+g[i].recipient_screen_name+
" "+g[i].text}h.originalTweets=g;if(h.filter)g=z.matchTweets(g,h.filter);if(q&&h.page>1){sessionStorage.setItem(f+".page"+h.page,"true");sessionStorage.setItem(f+".page"+h.page+".tweets",JSON.stringify(g));sessionStorage.setItem(f+".page"+h.page+".originalTweets",JSON.stringify(h.originalTweets))}h.cached=false;d.call(l[f],g,h);u(k)}}(o,a);e=b.match(/callback=(.*)/);if(e!=null&&e.length>1)m[e[1]]=m[f+o];else b+="&callback="+f+o;if(!q||a.page<=1||q&&sessionStorage.getItem(f+".page"+a.page)==null){c.src=
b;c.id=f+o;x.appendChild(c)}else if(q){u(o);a.cached=true;a.originalTweets=JSON.parse(sessionStorage.getItem(f+".page"+a.page+".originalTweets"));d.call(l[f],JSON.parse(sessionStorage.getItem(f+".page"+a.page+".tweets")),a)}}function A(b,a){return r[b].replace(/(\b.*?)%(.*?)(\|.*?)?%/g,function(d,c,e,k){if(k&&k.substr(1)=="remove"&&a[e]==n)return"";return c+(a[e]===n?k.substr(1):a[e])})}function v(b,a){if(typeof b=="function"){a=b;b={}}if(b===n)b={};b.page=b.page||1;b.callback=a;b.limit===0&&delete b.limit;
return b}function w(b,a,d){j={method:b,arg:a,options:d,callback:d.callback,page:d.page||1};if(q){b=JSON.parse(sessionStorage.getItem(f+".last_request")||"{}");if(j.method!=b.method||j.arg!=b.arg){D();sessionStorage.setItem(f+".last_request",JSON.stringify(j))}}}function D(){for(var b=sessionStorage.length;b--;)sessionStorage.key(b).substr(0,f.length)==f&&sessionStorage.removeItem(sessionStorage.key(b))}function E(b,a){if(a&&r[b]==n)r[b]=a;if(this[b]==n)this[b]=function(d,c,e){if(typeof d=="function"){e=
d;d=""}else if(d.toString()=="[Object object]"){e=c;c=d;d=""}c=v(c,e);w(b,d,c);c[b]=c.user=d;c.search=encodeURIComponent(d);c.callback&&y(A(b,c),c,c.callback);return this};return this[b]}var o=+new Date,m=this,s=m.document,x=s.getElementsByTagName("head")[0],j={},t={},F={"&quot;":'"',"&lt;":"<","&gt;":">"},B={search:"http://search.twitter.com/search.json?q=%search%&page=%page|1%&rpp=%limit|100%&since_id=%since|remove%",timeline:"http://twitter.com/statuses/user_timeline/%user%.json?count=%limit|200%&page=%page|1%&since_id=%since|remove%",
list:"http://api.twitter.com/1/%user%/lists/%list%/statuses.json?page=%page|1%&per_page=%limit|200%&since_id=%since|remove%",favs:"http://twitter.com/favorites/%user%.json?page=%page|1%"},r=B,n,q=false,G=function(){return{entities:function(b){return b.replace(/(&[a-z0-9]+;)/g,function(a){return F[a]})},link:function(b){return b.replace(/[a-z]+:\/\/[a-z0-9-_]+\.[a-z0-9-_:~\+#%&\?\/.=]+[^:\.,\)\s*$]/ig,function(a){return'<a href="'+a+'" target="_blank">'+(a.length>25?a.substr(0,24)+"...":a)+"</a>"})},at:function(b){return b.replace(/(^|[^\w]+)\@([a-zA-Z0-9_]{1,15}(\/[a-zA-Z0-9-_]+)*)/g,
function(a,d,c){return d+'@<a href="http://twitter.com/'+c+'" target="_blank">'+c+"</a>"})},hash:function(b){return b.replace(/(^|[^&\w'"]+)\#([a-zA-Z0-9_]+)/g,function(a,d,c){return d+'#<a href="http://search.twitter.com/search?q=%23'+c+'" target="_blank">'+c+"</a>"})},clean:function(b){return this.hash(this.at(this.link(b)))}}}(),H=function(){var b=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return{time:function(a){var d=a.getHours();a=a.getMinutes()+"";var c="AM";if(d==0)d=12;else if(d==12)c="PM";
else if(d>12){d-=12;c="PM"}if(a.length==1)a="0"+a;return d+":"+a+" "+c},date:function(a){a.toDateString().split(/ /);var d=b[a.getMonth()],c=a.getDate()+"",e=~~c;a=a.getFullYear();var k=(new Date).getFullYear(),h="th";if(e%10==1&&c.substr(0,1)!="1")h="st";else if(e%10==2&&c.substr(0,1)!="1")h="nd";else if(e%10==3&&c.substr(0,1)!="1")h="rd";if(c.substr(0,1)=="0")c=c.substr(1);return d+" "+c+h+(k!=a?", "+a:"")},datetime:function(a){a=a.split(" ");a=new Date(Date.parse(a[1]+" "+a[2]+", "+a[5]+" "+a[3]));
return this.time(a)+" "+this.date(a)},relative:function(a){var d=a.split(" "),c=Date.parse(d[1]+" "+d[2]+", "+d[5]+" "+d[3]);d=new Date(c);var e=arguments.length>1?arguments[1]:new Date;c=~~((e.getTime()-c)/1E3);var k="";c+=e.getTimezoneOffset()*60;return k=c<5?"less than 5 seconds ago":c<30?"half a minute ago":c<60?"less than a minute ago":c<120?"1 minute ago":c<2700?(~~(c/60)).toString()+" minutes ago":c<10800?"about 1 hour ago":c<86400?"about "+(~~(c/3600)).toString()+" hours ago":c<172800?this.time(d)+
" yesterday":this.time(d)+" "+this.date(d)}}}(),z=function(){return{match:function(b,a){var d=0,c="",e=b.text.toLowerCase();if(typeof a=="string")a=this.format(a);if(a.not.length){for(d=0;d<a.not.length;d++)if(e.indexOf(a.not[d])!==-1)return false;if(!a.and.length&&!a.or.length)return true}if(a.and.length)for(d=0;d<a.and.length;d++){c=a.and[d];if(c.substr(0,3)==="to:"){if(!RegExp("^@"+c.substr(3)).test(e))return false}else if(c.substr(0,5)=="from:"){if(b.user.screen_name!==c.substr(5))return false}else if(e.indexOf(c)===
-1)return false}if(a.or.length)for(d=0;d<a.or.length;d++){c=a.or[d];if(c.substr(0,3)==="to:"){if(RegExp("^@"+c.substr(3)).test(e))return true}else if(c.substr(0,5)=="from:"){if(b.user.screen_name===c.substr(5))return true}else if(e.indexOf(a.or[d])!==-1)return true}else if(a.and.length)return true;return false},format:function(b){var a=[],d=[],c=[],e=0,k=[];b.replace(/(-?["'](.*?)["']|\S+\b)/g,function(h){var g=false;if(h.substr(0,1)=="-")g=true;h=h.replace(/["']+|["']+$/g,"");g?k.push(h.substr(1).toLowerCase()):
a.push(h)});for(e=0;e<a.length;e++)if(a[e]=="OR"&&a[e+1]){d.push(a[e-1].toLowerCase());d.push(a[e+1].toLowerCase());e++;c.pop()}else c.push(a[e].toLowerCase());return{or:d,and:c,not:k}},matchTweets:function(b,a,d){var c=[],e=0;if(typeof a=="string")a=this.format(a);for(e=0;e<b.length;e++)this.match(b[e],a,d)&&c.push(b[e]);return c}}}();l[f]={custom:E,status:function(b,a,d){a=v(a,d);a.limit=1;w("status",b,a);return this.timeline(b,a,a.callback)},list:function(b,a,d){var c=b.split("/");a=v(a,d);w("list",
b,a);a.user=c[0];a.list=c[1];a.callback&&y(A("list",a),a,a.callback);return this},next:function(){if(j.method){j.page++;j.options.page=j.page;this[j.method](j.arg,j.options,j.callback)}return this},time:H,ify:G,filter:z,cancel:function(){for(var b in t)m[b]=function(){return function(a){u(a)}}(b.replace(f,""));t={};return this},reset:function(){r=B;j.method=""},render:C,debug:function(b){for(var a in b)r[a]=b[a];return this},cache:function(b){q=b==n?true:b;if(!m.JSON||!m.sessionStorage)q=false}};
l[f].custom("search");l[f].custom("timeline");l[f].custom("favs")})("twitterlib",this);

/*
 * jTube
 * http://jtube.monkeecreate.com
 * 
 * jQuery Youtube API Feed Plugin
 * 
 * Developed by John Hoover <john@defvayne23.com>
 * Another project from monkeeCreate <http://monkeecreate.com>
 *
 * Version 1.3.6 - Last updated: May 25, 2010
*/
(function($){$.extend({jTube:function(i){var i=$.extend({user:'',userType:'uploads',search:'',feed:'',playlist:'',format:'flash',order:'published',time:'all_time',limit:5,page:1,success:function(a,b){},error:function(a){}},i);var j='http://gdata.youtube.com/feeds/';var k=this;var l='';if(i.user!='')j+='api/users/'+i.user+'/'+i.userType+'?';else if(i.search!='')j+='api/videos?q='+i.search+'&';else if(i.feed!='')j+='api/standardfeeds/'+i.feed+'?';else if(i.playlist!='')j+='api/playlists/'+i.playlist+'?';else{i.error("No feed choices given.");return false}j+='alt=json-in-script';j+='&max-results='+i.limit;j+='&start-index='+(((i.page*i.limit)-i.limit)+1);j+='&orderby='+i.order;j+='&time='+i.time;j+='&callback=?';$.getJSON(j,function(d){if(d!=''&&d!=null){if(i.user!=''&&i.userType=='playlists'){var e=[];$(d.feed.entry).each(function(){var a={title:this.title.$t,description:this.yt$description.$t,id:this.yt$playlistId.$t,link:this.link[1].href,published:new Date(this.published.$t)};e[e.length]=a});var f=e}else if(i.user!=''&&i.userType=='subscriptions'){var g=[];$(d.feed.entry).each(function(){var a={title:this.title.$t,username:this.yt$username.$t,link:this.link[1].href,thumbnail:this.media$thumbnail.url,published:new Date(this.published.$t),updated:new Date(this.updated.$t)};g[g.length]=a});var f=g}else if(i.user!=''&&i.userType=='contacts'){var h=[];$(d.feed.entry).each(function(){var a={username:this.yt$username.$t,status:this.yt$status.$t,link:this.link[1].href};h[h.length]=a});var f=h}else{var f=[];$(d.feed.entry).each(function(){var b=[];$(this.category).each(function(a){if(a!=0){b[a-1]=this.term}});var c={title:this.title.$t,link:this.link[0].href,categories:b,author:{name:this.author[0].name.$t,link:this.author[0].uri.$t}};if(this.media$group.media$description){c.description=this.media$group.media$description.$t}if(this.media$group.media$thumbnail){c.thumbnail=this.media$group.media$thumbnail[3].url}videoFormats=[];$(this.media$group.media$content).each(function(){videoFormats[this.yt$format]=this.url});if(i.format=="mpeg")c.video=videoFormats[6];else if(i.format=="h263")c.video=videoFormats[1];else c.video=videoFormats[5];if(this.published)c.published=new Date(this.published.$t);if(this.media$group.yt$duration){duration=this.media$group.yt$duration.seconds;hours=0;minutes=0;seconds=0;while(duration>=3600){hours=hours+1;duration=duration-3600}while(duration>=60){minutes=minutes+1;duration=duration-60}seconds=duration;if(seconds<10)seconds='0'+seconds;c.length=minutes+':'+seconds;if(hours>0)c.length=hours+':'+c.length}if(this.yt$statistics)c.views=this.yt$statistics.viewCount;f[f.length]=c})}pages=Math.ceil(d.feed.openSearch$totalResults.$t/i.limit);i.success(f,pages)}else{i.error("Bad request.")}});return this},jTubeEmbed:function(a,b){var b=$.extend({width:290,height:250,autoplay:true,fullscreeen:false,related:true,loop:false,keyboard:true,genie:false,border:false,highdef:true,start:0},b);var c=a+"?";c+='autoplay='+(b.autoPlay?1:0);c+='&fs='+(b.fullscreen?1:0);c+='&rl=1'+(b.related?1:0);c+='&loop=1'+(b.loop?1:0);c+='&disablekb=0'+(b.keyboard?0:1);c+='&egm=1'+(b.genie?1:0);c+='&border=1'+(b.border?1:0);c+='&hd=1'+(b.highdef?1:0);c+='&start='+b.start;var d='<object width="'+b.width+'" height="'+b.height+'">';d+='<param name="movie" value="'+c+'"</param>';d+='<param name="allowScriptAccess" value="always"></param>';if(b.fullscreen==true)d+='<param name="allowFullScreen" value="true"></param>';d+='<embed src="'+c+'"';d+='    type="application/x-shockwave-flash"';if(b.fullscreen==true)d+='    allowfullscreen="true"';d+='    allowscriptaccess="always"';d+='    width="'+b.width+'" height="'+b.height+'">';d+='    </embed>';d+='</object>';return d}})})(jQuery);

// $('#content-with-images').imagesLoaded( myFunction )
// execute a callback when all images inside a parent have loaded.
// needed because .load() doesn't work on cached images

// Useful for Masonry or Isotope, triggering dynamic layout
// after images have loaded:
//    $('#content').imagesLoaded( function(){
//      $('#content').masonry();
//    });

// mit license. paul irish. 2010.
// webkit fix from Oren Solomianik. thx!

// callback function is passed the last image to load
//   as an argument, and the collection as `this`


$.fn.imagesLoaded = function (callback) {
    var elems = this.find('img'),
      len = elems.length,
      _this = this;

    if (!elems.length) {
        callback.call(this);
    }

    elems.bind('load', function () {
        if (--len <= 0) {
            callback.call(_this);
        }
    }).each(function () {
        // cached images don't fire load sometimes, so we reset src.
        if (this.complete || this.complete === undefined) {
            var src = this.src;
            // webkit hack from http://groups.google.com/group/jquery-dev/browse_thread/thread/eee6ab7b2da50e1f
            // data uri bypasses webkit log warning (thx doug jones)
            this.src = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";
            this.src = src;
        }
    });

    return this;
};

