

// jQuery
jQuery.fn.extend({
  scrollTo : function(speed, easing) {
    return this.each(function() {
      var targetOffset = $(this).offset().top;
      $('html,body').animate({scrollTop: targetOffset}, speed, easing);
    });
  }
});

$(document).ready(function () {

	$('#nav li a').click(function() {
		$('#nav li a').removeClass('selected');
		$(this).addClass('selected');

		var scrollToId = "#"+this.id.substring(4);
		$(scrollToId).scrollTo(1000);

		return false;
	});

	$('#say-hello').click(function(){
		l = "mailto:"+"hello"+"@"+"nearlybearded.com"+"?subject= Hello";
		window.location = l;
		return false;
	});
});