// JavaScript Document

(function($){
	$.fn.autoscroll=function(){
			return this.each(function(){
				
			var $this=$(this),
			$body=$("body"),
			$scroll=($.browser.mozilla || $.browser.msie) ? $("html"):$body,
			anchor=$this.attr("href"),
			$section=$(anchor);
			$actual=$(".projectsubmenu").find("li.actual");
			if($section.length>0){
				$this.click(function(event){
					event.preventDefault();
					$posicion=$section.offset().top-($("#opciones").height());
					
					$actual.removeClass("actual");
					$this.parent().addClass("actual");
					$actual=$this.parent();
					//alert($actual);
					$scroll.animate({scrollTop:$posicion},1000,"swing",function(){
						//window.location.hash=anchor;
					})
									 
				 })
			}
			
			
		})
	};
})(jQuery);
