var datasize=31468; // in Bytes
var startTime=0;
var endTime=0;
var date=0;
var textMessage="";

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%
    //setCookie("MediaThroughput", throughput, getExpireDate());
    //textMessage = "time to load: (sec): <B>" + diffTimeSeconds + "</B><BR>kbits:<B> " + kbits + "</B><BR>Throughput (kbps): <B>" + throughput +"</B>"
    return throughput;
}

date = new Date();
startTime=date.getTime();
