function ajouter_favoris()
{ 
	if (navigator.appName != 'Microsoft Internet Explorer')
  	window.sidebar.addPanel(document.title, location.href, '');
	else
		window.external.AddFavorite(location.href, document.title);
}

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="http://agaycam01.dyndns.org:8083/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://agaycam01.dyndns.org:8083/activex/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://agaycam01.dyndns.org:8083/activex/axis-cgi/operator/param.cgi?ImageSource=' + [camnbr - 1] + '" />');
			document.write('<param name="MotionDataURL" value="http://agaycam01.dyndns.org:8083/activex/axis-cgi/motion/motiondata.cgi" />');
		}
    document.write('</object>');
}

function video(imagepath)
{
  var width = 640
  var height = 480
  var picturepath = imagepath.replace(/video/, "image")
  picturepath = picturepath.replace(/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);
  }
}
