;(function($){
	$.ewsc = {
		defaults: {
			easing: 'swing',
			duration: 1000,
			offset: 50 // offset from target element
		},
		_dir: function ( ) { try { for(i=0;i<arguments.length;i++){console.dir(arguments[i]);} } catch(e) {} },
		_log: function ( ) { try { for(i=0;i<arguments.length;i++){console.log(arguments[i]);} } catch(e) {} }
	};
	$.fn.extend({
		ewsc: function ( options ){
			var s = $.extend ( {}, $.ewsc.defaults, options );
			return this.each ( function ( ) {
				var $o = $(this);
				$o.click(function(){
					if ( $o.attr('href').substring(0,1) === '#' )
					{
						$('html,body').animate({scrollTop: $($o.attr('href')).offset().top-s.offset}, s.duration, s.easing);
						return false;
					}
					else
					{
						$.ewsc._log ( 'Error: No hash in URL?' );
					}
				});
			});
		}
	});
})(jQuery);
