<?php

include('../style.php');
ShowHeader('Kamera', 'Webová kamera');

$ReloadPeriod = $Config['Web']['WebcamRefresh'] * 1000; // ms

echo('
<script language="JavaScript">
// Set the BaseURL to the url of your camera
// Note: Since this file is located inside the unit itself, no base url is specified here
// Example:  var BaseURL = "http://172.21.1.122/";
var BaseURL = "http://centrala.zdechov.net/";

// This is the filepath to the image generating file inside the camera itself
var File = "webcam/webcam.jpg";
   
// Force an immediate image load
var theTimer = setTimeout("reloadImage()", 1);
	
function reloadImage() 
{
  theDate = new Date();
  var url = BaseURL;
  url += File;
  url += "?dummy=";
  url += theDate.getTime().toString(10);
  // The above dummy cgi-parameter enforce a bypass of the browser image cache.
  // Here we actually load the image
  document.theImage.src = url;
		 
  // Reload the image every 10 seconds (10000 ms)
  theTimer = setTimeout("reloadImage()", '.$ReloadPeriod.');   
}
			       
</script>');

echo('<br><div align="center"><img name="theImage" src="" idth="640" height="480" alt="Webcam image"><br>Poslední aktualizace: '.date('j.n.Y G:i', filemtime('webcam.jpg')).'<br>Obnovování po '.$Config['Web']['WebcamRefresh'].' sekundách</div><br>');

echo('<strong>Kamery v okolí:</strong><br><a href="http://www.inext.cz/webkamera_updated.htm">Ulice nádražní a Smetanova Vsetín</a><br>');
ShowFooter();
?>