{=var-set:cancache=yPDefault=}
{=include-block:Y_Blocks.txt;head=}
{=include-block:Y_Blocks.txt;js_jquery=}
<script src="/Y_Baselib.js"></script>
<script>
function goConfirmUrl(_meld, _url){
	if (confirm(_meld)==true) goUrl(_url);
}
function set_btn_standby(){
	var res = trim(loadSyncURL("/control/standby"));
	var color = "gray";
	switch(res){
		case "off": color = "green"; break;
		case "on":  color = "red";   break;
	}
	id('btn_standby').style.borderColor = color;
}
function standby(_standby){
	var _cec = (id('checkCEC').checked == true) ? "on" : "off";
	goUrl("/control/standby?"+_standby+"&cec="+_cec);
}
function init() {
	set_btn_standby();
	window.setInterval("set_btn_standby();", 5000);
}
</script>
{=include-block:Y_Blocks.txt;head_close=}
<body onload="init()">
<div class="work_box">
	<div class="work_box_head"><div class="work_box_head_h2">
	{=var-set:menu={=L:bc.menue.control=}=}{=include-block:Y_Blocks.txt;work_menu=}</div></div>
	<div class="work_box_body">
	<form action="">
		<table class="y_invisible_table" cellpadding="5" width="100%">
		<tr><td class="y_form_header">{=L:bc.control.box=}</td><td class="y_form_header">{=L:bc.control.standby_mode=}</td></tr>
		<tr>
			<td>
			<input type="button" value="{=L:bc.control.reboot=}" onclick='goUrl("/control/exec?Y_Tools&amp;yreboot");'/>
			<input type="button" value="{=L:bc.control.shutdown=}" onclick='goConfirmUrl("{=L:bc.control.shutdown.ask=}","/control/shutdown");'/>
			</td>
			<td>
			<input type="button" value="{=L:on=}" onclick='standby("on");'/>
			<input type="button" value="{=L:off=}" onclick='standby("off");'/>
			<input type="button" value="{=L:bc.control.status=}" onclick='goUrl("/control/standby");' id="btn_standby"/>
			CEC: <input id="checkCEC" name="checkCEC" type="checkbox" checked="checked"/>
			</td>
		</tr>
		<tr><td class="y_form_header">{=L:neutrino=}</td><td class="y_form_header">&nbsp; <!-- just a placeholder --></td></tr>
			<td>
			<input type="button" value="{=L:bc.control.restart=}" onclick='goUrl("/control/restart");'/>
			</td>
			<td>
			&nbsp; <!-- just a placeholder -->
			</td>
		</tr>
		<tr><td class="y_form_header">{=L:bc.control.playback=}</td><td class="y_form_header">{=L:bc.control.recording_mode=}</td></tr>
		<tr>
			<td>
			<input type="button" value="{=L:on=}" onclick='goUrl("/control/zapto?startplayback");'/>
			<input type="button" value="{=L:off=}" onclick='goUrl("/control/zapto?stopplayback");'/>
			<input type="button" value="{=L:bc.control.status=}" onclick='goUrl("/control/zapto?statusplayback");'/>
			</td>
			<td>
			<input type="button" value="{=L:on=}" onclick='goUrl("/control/setmode?record=start");'/>
{=comment:disable non-working rec off button~
			<input type="button" value="{=L:off=}" onclick='goUrl("/control/setmode?record=stop");'/>
=}
			<input type="button" value="{=L:bc.control.status=}" onclick='goUrl("/control/setmode?status");'/>
			</td>
		</tr>
		<tr><td class="y_form_header">{=L:bc.control.epg_sectiond=}</td><td class="y_form_header">&nbsp; <!-- just a placeholder --></td></tr>
		<tr>
			<td>
			<input type="button" value="{=L:on=}" onclick='goUrl("/control/zapto?startsectionsd");'/>
			<input type="button" value="{=L:off=}" onclick='goUrl("/control/zapto?stopsectionsd");'/>
			<input type="button" value="{=L:bc.control.status=}" onclick='goUrl("/control/zapto?statussectionsd");'/>
			</td>
			<td>
			&nbsp; <!-- just a placeholder -->
			</td>
		</tr>
		<tr><td class="y_form_header">{=L:bc.control.remote=}</td><td class="y_form_header">{=L:bc.control.live_lock=}</td></tr>
		<tr>
			<td>
			<input type="button" value="{=L:on=}" onclick='goUrl("/control/rc?unlock");'/>
			<input type="button" value="{=L:off=}" onclick='goUrl("/control/rc?lock");'/>
			<input type="button" value="{=L:bc.control.status=}" onclick='goUrl("/control/rc?status");'/>
			</td>
			<td>
			<input type="button" value="{=L:bc.control.lock=}" onclick='live_lock();' />
			<input type="button" value="{=L:bc.control.unlock=}" onclick='live_unlock();' />
			</td>
		</tr>
		</table>
	</form>
	</div>
</div>
<div class="work_box">
	<div class="work_box_head"><div class="work_box_head_h2">
	{=var-set:menu={=L:answer=}=}{=include-block:Y_Blocks.txt;work_menu=}</div></div>
	<div class="work_box_body">
		<div id="out"></div>
	</div>
</div>
<script>
	init();
	window.setInterval("get_data();",5000);
</body>
</html>
