<!-- Copyright 2002 (C) Gambit Design Internet Services -->
<!-- This is licensed under the GNU Public License -->
<!-- Author: Derek T Del Conte - derek@gambitdesign.com -->

<?php include_once("config.inc.php"); ?>
<html>
	<head>
		<title><?php echo $isp_name; ?> - Speed Test - Download</title>
		<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
		<META HTTP-EQUIV="Expires" CONTENT="Fri, Jun 12 1981 08:20:00 GMT"> 
		<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
		<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache"> 
		<link rel="stylesheet" href="style.css">
	</head>
<body><center>
<?php 
echo $header;

echo '<br><h1>Speed Test - Download</h1><br>';

echo '<br><br><br><br><br><font size=+1>Testuji...</font>';


	$rate = $_GET['kbps'];
	$nearest = GetNearest($rate);
	$test_kbytes = $avail_images[$nearest-1];

echo "
<script language=\"JavaScript\">
<!--
	function RightNow() {
		time = new Date();
		return time.getTime();
		}
	starttime = RightNow();

function CalculateSpeed(starttime) {
	endtime = RightNow();

	downloadtime = (endtime - starttime)/1000;

	kbytes_of_data = ".$test_kbytes.";
	linespeed     = kbytes_of_data/downloadtime;
	kbps          = (Math.round((linespeed*8)*10*1.024))/10;

	nextpage = 'results.php?kbps=' + kbps + '&downloadtime=' + downloadtime + '&KB=' + kbytes_of_data;
	document.location.href=nextpage;
	}

// -->
</script>";

echo '<iframe src="'.$images_path_1.($nearest).$images_path_2.'" width="1" height="1" border="0" style="border:none;color:white;background:white;" onload="CalculateSpeed(starttime);"></iframe>';
?>

</center>
</body>
</html>
