$(document).ready(function()
{
	/*
	 * Make the first JSON call
	 */
	firstRunTwitter = true;
	getTwitter();

	firstRunLastFm = true;
	getLastFm();

	getPicasa();

	/*
	 * Start a loop on Twitter, LastFm
	 */
	setInterval("getTwitter()", 10000);
	setInterval("getLastFm()", 10000);

	/*
	 * Make the lighthouse call
	 */
	$('#tickets').ready(function()
	{
		getRedmine();
	});

	/*
	 * Hide and show on the post page
	 */
	$('#tabs').ready(function()
	{
		$('#tickets').hide();
		$('#comments').hide();
		$('#donations').hide();

		$('#documentation-tab').click(function()
		{
			$('#tickets').fadeOut("fast");
			$('#comments').fadeOut("fast");
			$('#donations').fadeOut("fast");
			$('#documentation').fadeIn("slow");
			return false
		});

		$('#tickets-tab').click(function()
		{
			$('#documentation').fadeOut("fast");
			$('#comments').fadeOut("fast");
			$('#donations').fadeOut("fast");
			$('#tickets').fadeIn("slow");
			return false
		});

		$('#comments-tab').click(function()
		{
			$('#tickets').fadeOut("fast");
			$('#documentation').fadeOut("fast");
			$('#donations').fadeOut("fast");
			$('#comments').fadeIn("slow");
			return false
		});

		$('#donations-tab').click(function()
		{
			$('#tickets').fadeOut("fast");
			$('#comments').fadeOut("fast");
			$('#documentation').fadeOut("fast");
			$('#donations').fadeIn("slow");
			return false
		});

		$('#documentation aside ul').ready(function ()
		{
			$('#documentation aside ul').hide();
		});

		$('#documentation aside a#older-versions').click(function ()
		{
			$('#documentation aside ul').slideToggle('slow');
		});
	});
});
