
function zoom(size)
{
  var url = document.URL

  if (url.indexOf("size=") != -1)
    url = url.substring(0, url.indexOf("size=")-1)
  if (url.indexOf("?") == -1)
    url += '?'
  else
    url += '&'
  document.location = url + 'size=' + size
}

function snapshot(imagepath)
{
  var picturepath = imagepath.replace('http://olimpija.provideo.lv/video/', "image")
  picturepath = picturepath.replace('http://olimpija.provideo.lv/mjpg/g', "jpg")
  var page = 'snapshot.shtml?picturepath=' + picturepath

  openPopUp(page, 'Take_snapshot', 640, 480)
}

function DrawAMC(height, width, imagepath, CLSID_AMC, ver_AMC, ShowAMCToolbar, ptzgui, useWithCam, camnbr, UseRel, UseMotion)
{

    document.write('<OBJECT ID="Player" height="' + height + '" width="' + width + '" border="0" CLASSID="CLSID:' + CLSID_AMC + '" CODEBASE="/activex/AMC.cab#version=' + ver_AMC + '" STANDBY="Loading Axis Media Control components...">');
    document.write('<param name="MediaURL" value="' + imagepath + '">');
    document.write('<param name="MediaType" value="mjpeg-unicast">');
    document.write('<param name="ShowStatusBar" value="0">');
    document.write('<param name="ShowToolbar"');
		if(ShowAMCToolbar == "yes")
		{
			document.write('value="1">');
		} else {
			document.write('value="0">');
		}
    document.write('<param name="AutoStart" value="1">');
    document.write('<param name="StretchToFit" value="1">');
		if(ShowAMCToolbar == "yes")
		{
		document.write('<param name="ToolbarConfiguration" value="play,+snapshot,+fullscreen">');
		}
		if((ptzgui == "yes") && (useWithCam == "yes"))
		{
      document.write('<param name="PTZControlURL" value="http://olimpija.provideo.lv/axis-cgi/com/ptz.cgi?camera=' + camnbr + '">');
      document.write('<param name="UIMode"');
				if(UseRel == "yes")
				{
					document.write('value="ptz-relative">');
				} else {
					document.write('value="ptz-absolute">');
				}
 		}
		if(UseMotion == "yes")
		{
			document.write('<param name="UIMode" value="MDConfig">');
			document.write('<param name="MotionConfigURL" value="http://olimpija.provideo.lv/axis-cgi/operator/param.cgi?ImageSource=' + [camnbr - 1] + '">');
			document.write('<param name="MotionDataURL" value="http://olimpija.provideo.lv/axis-cgi/motion/motiondata.cgi">');
		}
    document.write('</OBJECT>');
}

function video(imagepath)
{



  var width = 640
  var height = 480





  var picturepath = imagepath.replace('http://olimpija.provideo.lv/video/', "image")
  picturepath = picturepath.replace('http://olimpija.provideo.lv/mjpg/g', "jpg")

  if ('1' != '1') {
    width = width*1
    height = height*1
  }


  if ((navigator.appName == "Microsoft Internet Explorer")&&(navigator.platform != "MacPPC")&&(navigator.platform != "Mac68k")) {


    DrawAMC(height, width, imagepath, "745395C8-D0E1-4227-8586-624CA9A10A8D", "3,11,0,1", "", "", "", "", "", "no");





  } else {
    theDate = new Date();


        var output = '<img SRC="' + imagepath + '"width="' + width + '"height="' + height +'" width="' + width;





        output += '" border=0 ALT="If no image is displayed, there might be too many viewers, or the browser configuration may have to be changed. See help for detailed instructions on how to do this." width=' + width + ' height=' + height +' width=' + width + '>';



      document.write(output);

  }
}
