<!--

var siteurl   = 'http://aussieassault.net'; // Full URL to website.
var callurl   = siteurl + '/overview.php'; // Relative URL to calls API.

// function switchTo( caller )
// Do everything necessary to switch tabs.
function switchTo( caller )
{
	_response_identifiers = new Array();

	updateClasses( caller.parentNode );
	showLoader( document.getElementById( 'content' ) );
	dataRequest( caller.innerHTML );
}

// function updateClasses( tab )
// Change the active tab.
function updateClasses( tab )
{
	// Unset class names of all tabs.
	for( var i = 0; i < tab.parentNode.childNodes.length; i++ )
	{
		tab.parentNode.childNodes.item(i).className = "";
	}

	// Set the class name of the requested tab.
	tab.className = "active";
}

// function showLoader( element )
// Display the AJAX loader image.
function showLoader( element )
{
	element.className = "active";
	element.innerHTML = "";
}

// function dataRequest( string type, boolean initial )
// Request data from the server
function dataRequest( type )
{
	// Create a message to send to the server, including a random token so IE won't cache the response.
	var message = '&type=' + type + '&token=' + Math.random();

	// Send the data to the server.
	$.ajax
	( 
		{
			type: "GET",
			url: callurl,
			data: message,
			success: function( data ) 
			{
				dataResponse( data );
			}
		}
	);
}

// function dataResponse( data )
// Process data from the server and display it.
function dataResponse( data ) 
{
	element = document.getElementById('content');
	element.innerHTML = data;
	element.className = "inactive";
}

$(document).ready(function (){
	dataRequest('Recent Posts');
});

// -->