function getVideo(ip, camera)
{
// Set the BaseURL to the URL of your camera
//function video( ip, camera)
var BaseURL = "http://"+ip;


// 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 = "704";
var DisplayHeight = "480";

// This is the path to the image generating file inside the camera itself
//var File = "axis-cgi/mjpg/video.cgi?resolution=CIF&camera=quad";
var File = "axis-cgi/mjpg/video.cgi?resolution=CIF&camera=" +camera;
// No changes required below this point
var output = "";
  var AppletDir = BaseURL + "java/ama";
  var VideoPath = "axis-cgi/mjpg/video.cgi?resolution=";
//  var restOfPath = "&camera=quad";
  var restOfPath = "&camera=" +camera;
  var VideoURL = BaseURL + VideoPath;

  output = '<html><body style="background:#AAA">';
  output += '<APPLET archive="ama.jar" codeBase="';
  output += AppletDir + '"';
  output += ' code="ama.MediaApplet" height=';
  output += DisplayHeight;
  output += ' width=';
  output += DisplayWidth;
  output += '>';
  output += '<PARAM NAME="code" VALUE="ama.MediaApplet">';
  output += '<PARAM NAME="archive" VALUE="ama.jar">';
  output += '<PARAM NAME="codebase" VALUE="';
  output += AppletDir + '">';
  output += '<PARAM NAME="ama_cgi-path" VALUE="axis-cgi">';
  output += '<PARAM NAME="cache_archive" VALUE="ama.jar, ptz.jar">';
  output += '<PARAM NAME="cache_version" VALUE="1.0.0.0, 1.2.0.0">';
  output += '<PARAM NAME="ama_plugins" VALUE="ptz.PTZ">';
  output += '<PARAM NAME="type" VALUE="application/x-java-applet;version=1.4">';
  output += '<PARAM NAME="ama_url" VALUE="';
  output += VideoURL;
  output += DisplayWidth + 'x' + DisplayHeight;
   output += restOfPath +'">';
  output += '</APPLET>';
  output +='</body></html>';
//document.getElementbyId('video').innerHTML = document.write(output);

myWindow=window.open('','','top=70px,left=300px,height=500px,width=730px,location=no')
myWindow.document.write(output)
//myWindow.focus()
}

