$(document).ready(function (){
	function showMain(){
		$('#main').slideDown('slow', function(){
			$('#footer').fadeIn();
		});
	}
	
	function hashScroll() {
		var hash = window.location.hash.substr(1);
		if (hash!="") {
			$target = $('[name="' + hash +'"]');
			var targetOffset = $target.offset().top;
			$('html,body').animate({scrollTop: targetOffset}, {duration: 2000, easing:'easeOutExpo'});
		}
	}
	
	$('HTML').addClass('JS');
	setTimeout(showMain,800);
	
	$('#port_menu').slideDown(1500, hashScroll);
	
	$('a[href*=#]').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') 
        && location.hostname == this.hostname) {
            var $target = $(this.hash);
            $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
            if ($target.length) {
                var targetOffset = $target.offset().top;
                $('html,body').animate({scrollTop: targetOffset}, {duration: 2000, easing:'easeOutExpo'});
                return false;
            }
        }
    });
});
 