/**
 * jQuery animate scroll plugin
 * 
 * @requires jQuery
 * @category jquery plugin
 */

(function($) {
	$.fn.extend({
		animateScroll : function(options) {
			
			var defaults = {
				duration : 800
			};
			
			var options = $.extend({}, defaults, options || {});
			
			return this.each(function() {
				
				var target = $(this).attr('href');
				var targetOffset = $(target).offset().top;
				
				$(this).click(function() {
					$('html,body').animate({scrollTop: targetOffset}, options.duration);
        			return false;
				});
			});
		}
	});
})(jQuery);

$(function() {
	$('a.scroll').animateScroll();
});

