$(document).ready(function() {      
  $(".content").css("opacity", 0);
  $(".content").css("display", "none");

  $("#navigation li a.nav_link").click(function() {
		clicked = $("." + $(this).attr("href").split("#")[1])
		if (display[0] !== clicked[0]) { switchContent(clicked); }
    return false;      
  });
  
	$('.portfolio img').tooltip({ 
	  track: true, 
	  delay: 0, 
	  showURL: false, 
		showBody: " - "
	});
	
  display = $(".portfolio");        
  switchContent(display);
  
});
    
function switchContent(section)
{
  display.animate({ opacity: 0 }, 800, function() {
    display.css("display", "none");
    section.css("display", "block");
    section.animate({ opacity: 1 }, 800);
    display = section;
  });        
}
$(document).ready(function(){
      $('a[href*=#].contact').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}, 1000);
           return false;
          }
        }
      });
    });