//Auto-scroll jQuery Plugin
(function( $ ){
	
	$.fn.autoscroll = function() {
		
		return this.each(function(){
			
			//Plugin Code 
			
			var $this = $(this), //<a> tag
				$scroll = ($.browser.mozilla || $.browser.msie) ? $('html') : $body,
				anchor = $this.attr('href'),
				$section = $(anchor);
			
			if($section.length > 0) {
				
				$this.click(function(event){
					event.preventDefault();
					$scroll.stop().animate({scrollTop: $section.offset().top}, 1000, "swing", function(){
						window.location.hash = anchor;
					});
				});
			}
			
		});
		
	};
	
})( jQuery );
