{=var-set:cancache=yPInstall=}
{=var-set:dboxshot={=if-file-exists:/bin/dboxshot~/bin/dboxshot~{=if-file-exists:/var/bin/dboxshot~/var/bin/dboxshot~/var/bin/dboxshot=}=}=}
{=include-block:Y_Blocks.txt;head=}
<script type="text/javascript" src="/Y_Baselib.js"></script>
<script type="text/javascript">
//<![CDATA[
function rcsim(_key)
{
	loadSyncURL("/control/rcem?"+_key);
	do_dboxshot();
}
function do_dboxshot()
{
	{=if-empty:{=var-get:dboxshot=}~~
	var _shot = document.getElementById("shot");
	var res = dbox_exec_command("{=var-get:dboxshot=} -o /tmp/a.bmp");
	if(res != "")
		dbox_exec_command("{=var-get:dboxshot=} -o /tmp/a.bmp");
	_shot.src = "/tmp/a.bmp?"+Math.random();
	=}
}
function do_clearshot()
{
	window.setTimeout("do_clearshot2()", 500);
}
function do_clearshot2()
{
	var _shot = document.getElementById("shot");
	dbox_exec_command("rm /tmp/a.*");
	show_waitbox(false);
}
//]]>
</script>
</head>
<body>
{=var-set:wait_text=Snapshot taken=}{=include-block:Y_Blocks.txt;snip_wait=}
<div class="work_box">
	<div class="work_box_head"><div class="work_box_head_h2">
	{=var-set:help_url=Neutrino:yWeb:BoxControl#Remote_OSD=}{=var-set:menu=Remote &amp; OSD=}{=include-block:Y_Blocks.txt;work_menu=}</div></div>
	<div class="work_box_body">
		{=if-empty:{=var-get:dboxshot=}~~
		<button name="dboxshot" onclick="do_dboxshot()">shot</button>
		=}
		<button name="clearshot" onclick="do_clearshot()">Delete shots</button>
		<table cellpadding="0">
		<tr>
			<td>{=include-block:Y_Blocks.txt;remote=}</td>
			<td><img id="shot" src="" style="width:600px"/></td>
		</tr>
		</table>
		
	</div>
</div>
<script type="text/javascript">
//<![CDATA[
	do_dboxshot();
//]]>
</script>
</body>
</html>
