$(function(){
	// Fill all img tags with meta keywords
	var keywords = $('meta[name=keywords]').attr("content");
	$("img:not(.loading_bar)").attr("alt", keywords);
	//Fill the caption div with our first image tag
	$('#slideshow #caption').html($('#slideshow img:first').attr("rel"));
	//Function to pulse the news items
	setInterval(function(){	
			$("#news #news_header div").animate({opacity: '0.1'}, 800).animate({opacity: '1'}, 500, function() {
				//Remove filter for IE to help with cleartype bug
				if ($.browser.msie)
					$(this).css('filter', 'none');	
			});
		}, 3000);
});
$(window).load(function () {
	setInterval(function(){
			// Start the slideshow once the window has loaded
			$('#slideshow #caption').animate({height: 'toggle', opacity: 'toggle'}, 1000, function(){
					$('#slideshow #caption').html($('#slideshow img:first').next().attr("rel"));
					$('#slideshow img:first').fadeOut(1500, function(){ 
							$(this).appendTo('#slideshow');
						}).next().fadeIn(1500, function(){
							$('#slideshow #caption').animate({height: 'toggle', opacity: 'toggle'}, 1000);
						});
			});
	}, 6000);
});
