<!--

// ConnectionSpeed Detection section
var datasize=31468; // in Bytes
var startTime=0;
var endTime=0;
var date=0;
	
function calcThroughput() {
	    
	var diffTimeMilliseconds = endTime - startTime;
	var diffTimeSeconds = diffTimeMilliseconds/1000;
	    
	var bits = (datasize*8);   // convert Bytes to bits,
	var kbits = bits/1024;     // convert bits to kbits
	var throughput = kbits/(diffTimeSeconds);
	throughput = throughput * .93;  // account for IP packet header overhead - averages about 7%
	
	return throughput;

}

function detectMediaSize(){
	var connspeed = calcThroughput();
	var MediaSize2Use = 'size1';
	
	for(var i in dimensions){
		if( connspeed > dimensions[i].speedbound ){
			MediaSize2Use = i;
		}
	}
	
	return MediaSize2Use;
}

// -->
