jQuery(document).ready(function(){

	/**
	 * Fix png transparency in IE 6 and below
	 * Requires jquery.pngFix.js
	 */
	jQuery(function(){jQuery(document).pngFix();});
	
	/**
	 * Open external links in a new window
	 */
	jQuery("a[href*='http://']:not([href*='"+location.hostname+"'])").attr("target","_blank");
	
	/**
	 * Banner captions
	 */
	var captionFadeSpeed = 400;
	var caption = jQuery('#header p.caption').hide();
	var camera = jQuery('#header .camera-icon').show();
	
	// Clicking the camera icon hides it, and shows the caption
	camera.toggle(
		function(){
			caption.fadeIn(captionFadeSpeed);
			camera.removeClass('open').addClass('close');
		},
		function(){
			caption.fadeOut(captionFadeSpeed);
			camera.removeClass('close').addClass('open');
		}
	);
	
	// Hovering a media thumbnail
	jQuery('ul.media-thumbnails.fade').children('li').children('a').children('img').each(function(){
		jQuery(this).fadeTo(0, 0.6);
	
		jQuery(this).hover(
			function(){ jQuery(this).fadeTo('fast', 1); },
			function(){ jQuery(this).fadeTo('fast', 0.6); }
		);
	});
	

});