jQuery(document).ready(function($){

  $('.showcaseItem').hover(function(){
    $(this).animate({height:'471px'},{queue:false,duration:500});
    $(this).siblings().animate({height:'121px'},{queue:false,duration:500});
    $(this).find(".hover").animate({height:'100px'},{queue:false,duration:500});
    $(this).find(".showcase .nav").css('display', 'block');
  }, function(){
    $(this).animate({height:'223px'},{queue:false,duration:500});
    $(this).siblings().animate({height:'223px'},{queue:false,duration:500});
    $(this).find(".hover").animate({height:'0px'},{queue:false,duration:500});
    $(this).find(".desc").animate({height:'0px'},{queue:false,duration:500});
    $(this).find(".showcase .nav").css('display', 'none');

    if ( $(this).find(".desc").hasClass('opened') ) {
      $(this).find(".desc").removeClass('opened');
      $(this).find(".desc").addClass('closed');
      $(this).find(".details").html("Show Details &raquo;");
    }

  });

  $('.details').click(function(){
    if ( $(this).parent().parent().find(".desc").hasClass('closed') ) {
      $(this).parent().parent().parent().find(".hover").animate({height:'471px'},{queue:false,duration:500});
      $(this).parent().parent().find(".desc").animate({height:'361px'},{queue:false,duration:500});
      $(this).parent().parent().find(".desc").removeClass("closed");
      $(this).parent().parent().find(".desc").addClass("opened");
      $(this).parent().parent().find(".details").html("Hide Details &raquo;");
    } else {
      $(this).parent().parent().parent().find(".hover").animate({height:'100px'},{queue:false,duration:500});
      $(this).parent().parent().find(".desc").animate({height:'0px'},{queue:false,duration:500});
      $(this).parent().parent().find(".desc").removeClass("opened");
      $(this).parent().parent().find(".desc").addClass("closed");
      $(this).parent().parent().find(".details").html("Show Details &raquo;");
    }
  });
  

  $('.blink').focus(
    function() { if(this.title==this.value) { this.value = ''; }} 
    ).blur(
    function(){ if(this.value=='') { this.value = this.title; } }
  ); 
	$('#footer ul li').click(function() {
  		var target = $(this).attr('class');
  		target = '#' + target;
  		var targetOffset = $(target).offset().top - 99 + 'px';
  		jQuery('html,body').animate({scrollTop: targetOffset}, 1000);		
	});  
});