connectSpeed = 0;
function dit( fileLocation, fileSize) {
	start = (new Date()).getTime();
	loc = fileLocation + '?t=' + escape(start);
	document.write('<br/><br/><div align = "center"><img src="' + loc + '" ' + ' onload="ccs(' + start + ',' + fileSize + ');" width = "45%" height = "45%"></div>');
	return;
}
function ccs( start, fileSize ) {	
	end = (new Date()).getTime();
	connectSpeed = (Math.floor((((fileSize * 8) / ((end - start) / 1000)) / 1024) * 10) / 10);
	if(navigator.userAgent.indexOf('Android') != -1) {
	  document.getElementById('results').innerHTML = "<h2>Result: " + connectSpeed + " kbps</h2><h3>How are you connected <br/>to the Internet?</h3><br/><div id = 'nav'><ul><li><a href = '/android_results/new?type=edge&result=" + Math.round(connectSpeed) + "'>Edge</a></li><li><a href = '/android_results/new?type=3g&result=" + Math.round(connectSpeed) + "'>3G</a></li><li><a href = '/android_results/new?type=wifi&result=" + Math.round(connectSpeed) + "'>WiFi</a></li></ul></div><div class = 'clear'>";
	}
  else {
  	document.getElementById('results').innerHTML = "<h2>" + connectSpeed + " kbps<br/>Sorry we have detected you are Not an Android Phone</h2>"
	}
}