$(document).ready(function() {
	
	$('.wp-caption').hover(
		function(){
			var exifContent = $('.exif ul',this).html();
			if(exifContent){
				var newLeft = $(this).width() - 11;
				$('.exif',this).css('left',newLeft+"px").show(100);
			}
		},
		function(){
			var exifContent = $('.exif ul',this).html();
			if(exifContent){
				$('.exif',this).hide(250);
			}
		}
	);
	
	$('#menu li a').hover(function(){
	    $(this).stop().animate({color: '#333333'});
	}, function() {
	    $(this).stop().animate({color: '#959595'});
	});
	
	$('.navigation a').hover(function(){
	    $(this).stop().animate({backgroundColor: '#444444'}, 100);
	}, function() {
	    $(this).stop().animate({backgroundColor: '#161616'}, 400);
	});
	
	
	$('input,textarea').focus(function(){
		$(this).addClass("active");
	});
	$('input,textarea').blur(function(){
		$(this).removeClass("active");
	});
	
	// smooth scroller - got it here: http://snipplr.com/view/12510/smooth-scrolling-with-jquery-and-internal-page-links/
	$('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}, 1000);
					return false;
				}
		}
	});
	
	
	$('.fotesmail').defuscate();
	
});