$(document).ready(function(){
	/* image fades */
	$(".teaser-wrapper a img, #social a, .entry.collection a img").hover(function(){
		$(this).fadeTo(150, 0.8);
	},function(){
		$(this).fadeTo(250, 1.0);
	});
	
	/* link target blank in #social */
	$("#social a[href^='http://']").attr('target', '_blank');
	
	/* removes p um a img */
	$("p:has(img)").css('margin' , '0');
	
	/* removes img title tag from homepage */
	$('.teaser-wrapper img[title], #slider img[title]').each(function() { $(this).removeAttr('title'); });
	
	/* ngg hover & video hover */
	$('.ngg-gallery-thumbnail').hover(function(){
		$("div.caption", this).stop().animate({bottom:'0px', left:'0px'},{queue:false, duration:250 });
	}, function() {
		$("div.caption", this).stop().animate({bottom:'-100px', left:'0px'},{queue:false, duration:400});
	});
	$('.video li').hover(function(){
		$("p.wp-caption-text", this).stop().animate({bottom:'0px', left:'0px'},{queue:false, duration:250});
	}, function() {
		$("p.wp-caption-text", this).stop().animate({bottom:'-100px', left:'0px'},{queue:false, duration:400});
	});
});


/* navigation colorswitch */
$("#navigation a").not("#navigation .current-menu-item a, #navigation .current_page_item a, #navigation .current-page-item a").each(function(){
	$(this).bind({
		mouseenter: function(){
			$(this).stop().animate({ color: '#ffffff', backgroundColor: "#838583" }, 250);
		},
		mouseleave: function(){
			$(this).stop(false,true).animate({ color: '#797979', backgroundColor: "#ffffff" }, 600);
		},
		focusin: function(){
			$(this).stop().animate({ color: '#ffffff', backgroundColor: "#838583" }, 250);
		},
		focusout: function(){
			$(this).stop(false,true).animate({ color: '#ffffff', backgroundColor: "#838583" }, 600);
		}
	})
});

/* meta colorswitch */
$("#meta a").not("#meta .current-menu-item a, #meta .current-page-item a").each(function(){
	$(this).bind({
		mouseenter: function(){
			$(this).stop().animate({ color: "#3d3d3d" }, 250);
		},
		mouseleave: function(){
			$(this).stop(false,true).animate({ color: "#838583" }, 500);
		},
		focusin: function(){
			$(this).stop().animate({ color: "#3d3d3d" }, 250);
		},
		focusout: function(){
			$(this).stop(false,true).animate({ color: "#838583" }, 500);
		}
	})
});
