function get_kbytes(){ var time = new Date(); var starttime = time.getTime(); var url = new URL(); var rand = Math.random ( ); url.location = "http://speedcheck.ispconnect.co.uk/speedcheck/initialmeter.php?isp=DSLConnect%20UK&logo=images/tiscali_logo.gif&rand="+ rand; var data = url.fetch(); var time = new Date(); var endtime = time.getTime(); if (endtime == starttime) {downloadtime = 0 } else {downloadtime = (endtime - starttime)/1000; } //we will need to work on the calculation of the mb file size as this may change kbytes_of_data = 3000; linespeed = kbytes_of_data/downloadtime; kbps = (Math.round((linespeed*8)*10*1.024))/10 + "kbps"; return kbps; }