<!--
var xmlHttp = createXmlHttp();

function createXmlHttp()
{
	var xmlHttp;
	try
	{
		xmlHttp = new XMLHttpRequest();
	}
	catch(e)
	{
		try
		{
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(e)
		{
			xmlHttp = false;
		}
	}

	if(!xmlHttp)	
		document.location.href = "browser.htm";
	else
		return xmlHttp;
}

function listFreeArbs()
{
	if(xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
	{
		// send data
		xmlHttp.open("GET", "ajax.php", true);
		xmlHttp.onreadystatechange = listFreeArbsResponse;
		xmlHttp.send(null);
		setTimeout("listFreeArbs()", 60000); // run again after 60 seconds
	}
	else
	{
		setTimeout("listFreeArbs()", 1000);
	}
}

function listFreeArbsResponse()
{
	if(xmlHttp.readyState == 4)
	{
		if(xmlHttp.status == 200)
		{
			try
			{
				document.getElementById("divFreeArbs").innerHTML = "";
				document.getElementById("divFreeArbs").innerHTML = xmlHttp.responseText;
			}
			catch(e)
			{
				txtError = "There was an error reading the server response.<br><br>" + e.toString() + "<br><br>";
				document.getElementById("divFreeArbs").innerHTML = "";
				document.getElementById("divFreeArbs").innerHTML = txtError;
			}
		}
		else
		{
			txtError = "There was a problem accessing the server.<br><br>" + xmlHttp.statusText + "<br><br>";
			document.getElementById("divFreeArbs").innerHTML = "";
			document.getElementById("divFreeArbs").innerHTML = txtError;
		}
	}
}

/* --------------------------------------------------------------------------------------------- */

function listPaidArbs()
{
	if(xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
	{
		// send data
		xmlHttp.open("GET", "ajax_paid.php", true);
		xmlHttp.onreadystatechange = listPaidArbsResponse;
		xmlHttp.send(null);
		setTimeout("listPaidArbs()", 60000); // run again after 60 seconds
	}
	else
	{
		setTimeout("listPaidArbs()", 1000);
	}
}

function listPaidArbsResponse()
{
	if(xmlHttp.readyState == 4)
	{
		if(xmlHttp.status == 200)
		{
			try
			{
				if(xmlHttp.responseText != "none")
				{
					document.getElementById("divPaidArbs").innerHTML = "";
					document.getElementById("divPaidArbs").innerHTML = "<br>" + xmlHttp.responseText;
				}
				else
				{
					document.getElementById("divPaidArbs").innerHTML = "<br>";
				}
			}
			catch(e)
			{
				txtError = "There was an error reading the server response.<br><br>" + e.toString() + "<br><br>";
			}
		}
	}
}

/* --------------------------------------------------------------------------------------------- */

function listUsers()
{
	if(xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
	{
		// send data
		xmlHttp.open("GET", "users.php", true);
		xmlHttp.onreadystatechange = listUsersResponse;
		xmlHttp.send(null);
		setTimeout("listUsers()", 60000); // run again after 60 seconds
	}
	else
	{
		setTimeout("listUsers()", 1000);
	}
}

function listUsersResponse()
{
	if(xmlHttp.readyState == 4)
	{
		if(xmlHttp.status == 200)
		{
			try
			{
				if(xmlHttp.responseText >= 1)
				{
					document.getElementById("divUsers").innerHTML = "";
					if(xmlHttp.responseText == 1)
					{
						document.getElementById("divUsers").innerHTML = "<br><hr class='hr_1'><br><div align=center><font face='Tahoma, Arial, Helvetica, sans-serif'>Currently there is <b>" + xmlHttp.responseText + "</b> other user viewing this page.</font></div>";
					}
					else
					{
						document.getElementById("divUsers").innerHTML = "<br><hr class='hr_1'><br><div align=center><font face='Tahoma, Arial, Helvetica, sans-serif'>Currently there are <b>" + xmlHttp.responseText + "</b> other users viewing this page.</font></div>";
					}
				}
				else
				{
					document.getElementById("divUsers").innerHTML = "";
				}
			}
			catch(e)
			{
				txtError = "There was an error reading the server response.<br><br>" + e.toString() + "<br><br>";
			}
		}
	}
}
//-->