$(document).ready( function()
{
	
	var speed = 200;
	
	$('.expand-box').hide();
	$('.collapse-button').hide();
	
	$('.news').click( function(event)
	{
		newsButton = $(this);
		
		if(event.preventDefault) event.preventDefault();
		else event.returnValue = false;
		
		if ($(this).next().is('div.ajaxnewsfield'))
		{
			var removable = $(this).next();
			removable.fadeOut(400);
			removable.delay(400).remove();
		}
		else
		{
			var link = $(this).attr('href');
			//$(this).next('div.ajaxnewsfield').load(link);
			div = $('<div class="ajaxnewsfield"></div>');
			div.load(link, function ()
			{
				div.insertAfter(newsButton);
				div.fadeOut(0);
				div.fadeIn(400);
			});
			//$(this).children('div.ajaxnewsfield').load(link);
		}
		
	});
	
	$('.collapse-button').click( function()
	{
		
		$(this).nextAll('.expand-box:lt(1)').hide(speed);
		$(this).prevAll('.expand-button:lt(1)').show(speed);
		$(this).hide(speed);
		
	});
});
