var TransferStats = null;
var timeOut = 0;

function processPIChange() 
{
if (TransferStats.readyState == 4) {
	if (TransferStats.status == 200) {
		response=TransferStats.responseXML.documentElement;
		TransferStats=null;
		document.getElementById('PBarCell').width=response.getElementsByTagName('CompleteTo300')[0].firstChild.data;
		document.getElementById('PercentComplete').innerHTML=response.getElementsByTagName('CompleteTo100')[0].firstChild.data;
		document.getElementById('TimeRemaining').innerHTML=response.getElementsByTagName('TimeRemaining')[0].firstChild.data;
		document.getElementById('CurrentFile').innerHTML=response.getElementsByTagName('CurrentFile')[0].firstChild.data;
		}
	else {
		TransferStats=null;
		}
	}
}

function UpdatePI()
{
if (TransferStats == null) {
	timeOut = 0;
	if (window.ActiveXObject) TransferStats=new ActiveXObject("Microsoft.XMLHTTP");
	else TransferStats=new XMLHttpRequest();
	TransferStats.onreadystatechange=processPIChange;
	TransferStats.open("GET", "http://ftp.studiocity.com/RumpusProgressIndicator.xml", true);
	TransferStats.send(null);
	}
else {
	timeOut++;
	if (timeOut > 5) TransferStats = null;
	}
}

