var xml;
var t = setInterval("updateScores();",30000);
window.onerror = Errors;

function Errors()
{
	return true;
}

function ajaxtype()
{
	var type = null;
	
	if(window.XMLHttpRequest)
		type = new XMLHttpRequest();
	else if(window.ActiveXObject)
		type = new ActiveXObject("Microsoft.XMLHTTP");
	
	return type;
}

function getinfo()
{
	if(xml.readyState == 4 || xml.readyState == 'complete')
	{
		doc = xml.responseText;
		
		if(doc == 'stop')
		{
			clearInterval(t);
			return;
		}
			
		doc = doc.replace(/\[/g,'<');
		doc = doc.replace(/\]/g,'>');
	
		document.getElementById('scores').innerHTML = doc;
	}
}

function updateScores()
{
	if((!month) || (!year) || (!day))
		return;
		
	xml = ajaxtype();
	
	if(xml == null)
		return;
	
	xml.onreadystatechange = getinfo;
	
	xml.open('GET','/refresh/' + month + '-' + day + '-' + year + '.xml',true);
	xml.send(null);
}