jQuery(document).ready(function($) {
	var featuredPhotos = $('#featuredPhotos img');
	var featuredPhotosLength = featuredPhotos.length;
	var featuredPhotosCurrent = 0;
	var featuredVideos = $('#featuredVideos img');
	var featuredVideosLength = featuredVideos.length;
	var featuredVideosCurrent = 0;
	var featuredRotator = function() {
		featuredPhotos.hide();
		featuredVideos.hide();
		$(featuredPhotos.get(featuredPhotosCurrent)).fadeIn('slow');
		$(featuredVideos.get(featuredVideosCurrent)).fadeIn('slow');
		featuredPhotosCurrent = (featuredPhotosCurrent + 1) % featuredPhotosLength;
		featuredVideosCurrent = (featuredVideosCurrent + 1) % featuredVideosLength;
		window.setTimeout(featuredRotator, 5000);
	};
	featuredPhotos.hide();
	featuredVideos.hide();
	if (featuredPhotosLength) {
		featuredRotator();
	}
	$('.rollover h2,.rollover h3').each(function() {
		var jThis = $(this);
		var height = jThis.height();
		var top = 50 - height / 2 - 3;
		jThis.css('height', height);
		jThis.css('top', top.toString() + 'px');
	});
	$('.rollover').hover(function() {
		var jThis = $(this);
		var jImg = jThis.find('img'); 
		jThis.find('h2,h3').show();
		jImg.css('opacity', '.5'); 
		jImg.css('filter', 'alpha(opacity=50)');
	}, function() {
		var jThis = $(this);
		var jImg = jThis.find('img'); 
		jThis.find('h2,h3').hide();
		jImg.css('opacity', '1'); 
		jImg.css('filter', 'alpha(opacity=100)');
	})
});
