function dotnet(addr, i, w, h) {
	var html = '<object id="Image' + i + '" width="' + w + '" height="' + h + '" classid="StarDotNet.dll#StarDotNet.HttpImage"><param name="url" value="http://' + addr + '/nph-mjpeg.cgi?' + i + '"><param name="status" value="1"></object>';
	document.write(html);
}

function reload(n) {
	var img, src, j, now;

	if (document.images) {
		img = document.images[n];
		if (img) {
			src = img.src;
			j = src.indexOf('&');
			if (j != -1) {
				src = src.slice(0, j);
			}
			now = new Date();
			img.src = src + '&' + now.getTime();
		}
	}
}

/*@cc_on
  @if (@_jscript)
function doSaveAs(w)
{
	w.document.execCommand("SaveAs");
}
  @end
  @*/

function saveImage(img)
{
/*@cc_on
  @if (@_jscript)
	if (typeof img == 'object')
		img = img.src;
	var win = window.open(img);
                                                                                
	if (win.addEventListener) {
		win.addEventListener("load", function() { doSaveAs(win); }, false);
	} else if (win.attachEvent) {
		win.attachEvent("onload", function() { doSaveAs(win); } );
	}
  @else*/
	var win = window.open();
	win.document.write("<img src='" + img + "'><br>");
	win.document.write("<span style='font: 80% tahoma, verdana, sans-serif !important;'>Right click on the image, then select 'Save Image As...'</span>");
	win.document.close();
/*@end
  @*/
}
