
connectionSpeed = 0;

function drawCSImageTag( fileLocation, fileSize, imgTagProperties ) {
	
	start = (new Date()).getTime();		
	loc = fileLocation + '?t=' + escape(start);		
	
	document.write('<img src="' + loc + '" ' + imgTagProperties + ' onload="computeConnectionSpeed(' + start + ',' + fileSize + ');" id="speedImage">');
	return;
}

function computeConnectionSpeed( start, fileSize ) {
	
	var labelSpeed	 = document.getElementById("CommentFormControl1_HiddenSpeedDetect") 
	
	end = (new Date()).getTime();
	connectSpeed = (Math.floor((((fileSize * 8) / ((end - start) / 1000)) / 1024) * 10) / 10);
    
    labelSpeed.value	= connectSpeed + ' kbps.';
    //alert(labelSpeed.value);
}



