
(function($)
{
	$(function()
	{
		$('#left-column .side-buttons img').each(function()
		{
			var bouncer = $(this).clone().addClass('bouncer');
			bouncer.insertBefore(this);
		});
		
		$('#left-column .side-buttons a').hover(function()
		{
			var original = $('img:not(.bouncer)', this);
			var bouncer = $('img.bouncer', this);
			
			bouncer.css(original.offset());
			original.css('visibility', 'hidden');
			
			bouncer.show().stop().animate({'margin-top': '-10px'}, 150).animate({'margin-top': '0px'}, 150, function()
			{
				bouncer.hide();
				original.css('visibility', 'visible');
			});	
		}, function()
		{
		});
		
		$('#left-menu li').hover(function()
		{
			$(this).stop().animate({'margin-left': 10}, 100);
		}, function()
		{
			$(this).stop().animate({'margin-left': 0}, 100);
			
		});
		
		var headerImage = 0;
		var headerImages = $('#header-slideshow li');
		var headerSlideshow = function()
		{
			headerImages.eq(headerImage).fadeOut();
			headerImage = (headerImage + 1) % headerImages.length;
			headerImages.eq(headerImage).fadeIn();
		};
		
		// Stack in reverse order
		headerImages.each(function(i)
		{
			$(this).css('z-index', headerImages.length - i);
		});
		
		setInterval(headerSlideshow, 5000);
	});
})(jQuery);

// Fancy fonts
//Cufon.replace('h1');

