<?php
   include("./inc/func.php");

   //clearstatcache();//velikost souboru je cachovana a toto zajisti aktualni hodnotu
   if(filemtime("usr/". uzivatel('LOGIN') ."/download.dwn")>=(time()-10))
   {
      clearstatcache();
      $velikost0=(@filesize("usr/". uzivatel('LOGIN') ."/download.dwn")+0);
   }else{
      $velikost0=0;
   };
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<?php
  if(@$_GET['velikost']>$velikost0)
  {
?>
<meta http-equiv="refresh" content="1;URL=?velikost=<?php echo @$_GET['velikost']; ?>&cas=<?php echo time(); ?>">
<?php
  ;}else{
?>
<script language="JavaScript">
  window.open("usr/<?php echo uzivatel('LOGIN'); ?>/download.dwn");
</script>
<?php
  };
?>
</head>
<body>
<script language="JavaScript">
<?php
  if(@$_GET['velikost']<=$velikost0)
  {
?>
  parent.document.getElementById('prubeh').style.visibility="hidden";
<?php
  }else{
?>
  parent.download_progress("<?php echo round(($velikost0/@$_GET['velikost'])*200); ?>");
<?php
  ;};
?>
</script>
</body>
</html>
