// Set the BaseURL to the URL of your camera
var BaseURL = "http://62.195.142.210:2024/";

// DisplayWidth & DisplayHeight specifies the displayed width & height of the image.
// You may change these numbers, the effect will be a stretched or a shrunk image
var DisplayWidth = "240";
var DisplayHeight = "180";
var DisplayHeightpop = "720";
var DisplayWidthpop = "1280";

function reloadImage() {
  theDate = new Date();
  var url = BaseURL;
  url += File;
  url += '&dummy=' + theDate.getTime().toString(10);
  // The dummy above enforces a bypass of the browser image cache
  // Here we load the image
  document.theImage.src = url;

  // Reload the image every ten seconds (2000 ms)
  theTimer = setTimeout('reloadImage()', 2000);
}

// This is the path to the image generating file inside the camera itself
var File = "axis-cgi/mjpg/video.cgi?resolution=240x180";
// No changes required below this point
var output = "";
if ((navigator.appName == "Microsoft Internet Explorer") &&
   (navigator.platform != "MacPPC") && (navigator.platform != "Mac68k"))
{
  // If Internet Explorer under Windows then use ActiveX 
  // DisplayWidth & DisplayHeight specifies the displayed width & height of the image.
  // You may change these numbers, the effect will be a stretched or a shrunk image
  //var DisplayWidth = "240";
  //var DisplayHeight = "180";

  // This is the path to the image generating file inside the camera itself
  var File = "axis-cgi/jpg/image.cgi?resolution=240x180";

  // Force an immediate image load
  var theTimer = setTimeout('reloadImage()', 1);

  document.write('<a href="javascript:void(0);" onclick="window.open(\'/live-feed-camerabewaking\', null,\'width=1280,height=720,left=\'+(screen.availWidth/2-512)+\',top=\'+(screen.availHeight/2-300)+\'\');return false;"><img name="theImage" src="" height="' + DisplayHeight + '"');
  document.write('width="' + DisplayWidth + '" alt="Live image"></a>');
  // document.write('width="' + DisplayWidth + '" alt="Live image"><br /><br /><a onclick="window.open('[~24~]','Live feed camerabewaking','width=1280,height=720,left='+(screen.availWidth/2-512)+',top='+(screen.availHeight/2-300)+'');return false;" href="[~24~]">contact</a><br /><br />');
} else {
  // If not IE for Windows use the browser itself to display
  theDate = new Date();
  output  = '<a href="javascript:void(0);" onclick="window.open(\'/live-feed-camerabewaking\', null,\'width=1280,height=720,left=\'+(screen.availWidth/2-512)+\',top=\'+(screen.availHeight/2-300)+\'\');return false;"><IMG SRC="';
  output += BaseURL;
  output += File;
  output += '&dummy=' + theDate.getTime().toString(10);
  output += '" HEIGHT="';
  output += DisplayHeight;
  output += '" WIDTH="';
  output += DisplayWidth;
  output += '" ALT="Camera Image"></a>';
  document.write(output);
}
//document.Player.ToolbarConfiguration = "play,+snapshot,+fullscreen"
