
function drawCSImageTag( fileLocation, fileSize, imgTagProperties ) {	
	start = (new Date()).getTime();		
	loc = fileLocation + '?t='+escape(start);		
	document.getElementById('TestResults').innerHTML = '<img src="'+loc+'" '+imgTagProperties+' onload="computeConnectionSpeed('+start+','+fileSize+');">';	
	return;
}

function computeConnectionSpeed( start, fileSize ) {	
	end = (new Date()).getTime();
	connectSpeed = (Math.floor((((fileSize * 8) / ((end - start) / 1000)) / 1024) * 10) / 10);
	var html = connectSpeed+" kbps - ";
	if (connectSpeed<700) html += "Low Quality";
	else if (connectSpeed<2000) html += "Medium Quality";
	else html += "High Quality";
	document.getElementById('TestResults').innerHTML = html;
	ShowRow('ResultsArea_0');
	ShowRow('ResultsArea_1');
}

function TestConnection() {
	drawCSImageTag( 'Media/Images/test.png',46636,'');
}

function ForceInteger(obj) {
	return IsInt(obj.value,false,false);	
}
