var picNum = 0;
var xmlHttp;

function ajaxRequest(url)
{
	//Prepare the request
	xmlHttp = null;
	if (window.XMLHttpRequest) //Non-IE
	{
		xmlHttp = new XMLHttpRequest();
	}
	else 
		if (window.ActiveXObject) 
		{
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
	
	if (xmlHttp != null) 
	{
		//Handle state change
		xmlHttp.onreadystatechange = stateChange;
		//Open and send the request
		xmlHttp.open("GET", url, true);
		xmlHttp.send(null);
	}
	else 
	{
		alert("Your browser does not support AJAX");
	}
}

function stateChange()
{
	if(xmlHttp.readyState==4) //response is "loaded"
	{
		document.getElementById("content").innerHTML = xmlHttp.responseText;
	}
}

function displayContent(topic)
{
	ajaxRequest("frags/" + topic + ".html");
}

function initialize()
{
    displayContent("about");
    setInterval(switchPic, 30000);
}

function switchPic()
{
    picNum++;
    document.headerPic.src = "images/cBluemel" + (picNum % 3) + ".jpg";
}

