function handleOnLoad()
{
	changeContent("main");
}

function handleReadyStateChange()
{
	if (http.readyState == 4)
	{
		results = http.responseText.split("|");
		document.getElementById('Content').innerHTML = "<p>" + results[0] + "</p><p>" + results[1] + "</p>";
		document.getElementById('contentlink_' + g_content_id).style.fontWeight = 'bold';	
	}
}

function changeContent(content_id)
{
	if (content_id != g_content_id)
	{
		var url = "getContent.php?content_id=" + content_id;
		http.open("GET", url, true);
		http.onreadystatechange = handleReadyStateChange;
		http.send(null);
		if (g_content_id != -1)
			document.getElementById('contentlink_' + g_content_id).style.fontWeight = 'normal';
		g_content_id = content_id;
	}
}

function getHTTPObject() 
{ 
	var xmlhttp; 
	/*@cc_on 
	@if (@_jscript_version >= 5) 
	try 
	{ 
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
	} 
	catch (e) 
	{ 
		try 
		{ 
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
		} 
		catch (E) 
		{ 
			xmlhttp = false; 
		} 
	} 
	@else 	
	xmlhttp = false; 
	@end @*/  
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') 
	{ 
		try 
		{ 
			xmlhttp = new XMLHttpRequest(); 
		} 
		catch (e) 
		{ 	
			xmlhttp = false; 
		} 
	} 
	return xmlhttp; 
} 

var http = getHTTPObject(); // We create the HTTP Object 
var g_content_id = -1;
