<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

<head>
	<title>VDRAdmin-AM - <%! TV !%> (<tmpl_var host>)</title>
	<meta http-equiv="Content-Type" content="text/html; <%! charset=ISO-8859-1 !%>" />
	<link href="style.css" rel="stylesheet" media="screen" type="text/css" />
	<tmpl_if usercss>
		<link href="user.css" rel="stylesheet" media="screen" type="text/css" />
	</tmpl_if>
	<script type="text/javascript" language="JavaScript1.2" src="library.js"></script>
	<script type="text/javascript" language="JavaScript">
		<!--
		var timeout;
		var interval = <tmpl_var interval>;
		var size = "<tmpl_var size>";

		function switch_by_select() {
			for (i = 0; i < document.forms[0].channel.length; ++i)
				if (document.forms[0].channel.options[i].selected == true)
				{
					switch_channel('./vdradmin.pl?aktion=tv_switch&channel=' + encodeURIComponent(document.forms[0].channel.options[i].value));
					return;
				}
		}

		function switch_channel(url) {
			v_Stop();
			Now = new Date();
			document.switchimage.src = url + "&rand=" + Now.getTime();
      timeout = window.setTimeout("WebcamUpdate()", 500);
		}

		function WebcamUpdate() {
			Before = new Date();
			NewPicUrl = "<tmpl_var url>&size=" + size + "&rand=" + Before.getTime();
			document.Bild.src = NewPicUrl;
			if(interval > 0) {
				After = new Date();
				wait_sec = (interval * 1000) - (After - Before);
				timeout = window.setTimeout("WebcamUpdate()", wait_sec > 0 ? wait_sec : 0);
			}
		}

		function v_Stop() {
			window.clearTimeout(timeout);
		}

		function v_changeInterval(val) {
			interval = val;
			v_Stop();
			if(interval > 0) {
			  WebcamUpdate();
			};
		}

		function v_changeSize(val) {
			size = val;
			v_Stop();
			WebcamUpdate();
		}

		function tv_open() {
	 		window.open("./vdradmin.pl?aktion=tv_show&new_win=1", "vdradminTV", "width=615, height=548, resizable=yes, scrollbars=no, status=no, toolbar=no");
		}
		//-->
	</script>
</head>

<body onLoad="window.focus();WebcamUpdate()" id="tv"> 
	<form action="<tmpl_var url>" method="get" name="liveform">
		<table width="200" border="0" cellspacing="0" cellpadding="0" style="background-image: url(bilder/tv_bottom.gif);">
			<tr>
				<td align="center" valign="middle"><img name="Bild" src="<tmpl_var url>" border="1" hspace="2" vspace="2" /></td>
				<td><img src="bilder/spacer.gif" name="switchimage" width="2" height="1" /></td>
<tmpl_unless tv_only>
				<td valign="top">
					<table width="200" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td></td>
							<td><img src="bilder/spacer.gif" alt="" height="20" width="50" border="0" /></td>
							<td></td>
						</tr>
						<tr>
							<td></td>
							<td></td>
							<td><a href="javascript:switch_channel('./vdradmin.pl?aktion=rc_hitk&amp;key=power');"><img src="bilder/fern_03.jpg" alt="" height="27" width="68" border="0" /></a></td>
						</tr>
						<tr>
							<td></td>
							<td><img src="bilder/spacer.gif" alt="" height="20" width="50" border="0" /></td>
							<td></td>
						</tr>
						<tr>
							<td><a href="javascript:switch_channel('./vdradmin.pl?aktion=rc_hitk&amp;key=1');"><img src="bilder/fern_05.jpg" alt="" height="28" width="67" border="0" /></a></td>
							<td><a href="javascript:switch_channel('./vdradmin.pl?aktion=rc_hitk&amp;key=2');"><img src="bilder/fern_06.jpg" alt="" height="28" width="66" border="0" /></a></td>
							<td><a href="javascript:switch_channel('./vdradmin.pl?aktion=rc_hitk&amp;key=3');"><img src="bilder/fern_07.jpg" alt="" height="28" width="67" border="0" /></a></td>
						</tr>
						<tr>
							<td><a href="javascript:switch_channel('./vdradmin.pl?aktion=rc_hitk&amp;key=4');"><img src="bilder/fern_08.jpg" alt="" height="28" width="67" border="0" /></a></td>
							<td><a href="javascript:switch_channel('./vdradmin.pl?aktion=rc_hitk&amp;key=5');"><img src="bilder/fern_09.jpg" alt="" height="28" width="66" border="0" /></a></td>
							<td><a href="javascript:switch_channel('./vdradmin.pl?aktion=rc_hitk&amp;key=6');"><img src="bilder/fern_10.jpg" alt="" height="28" width="67" border="0" /></a></td>
						</tr>
						<tr>
							<td><a href="javascript:switch_channel('./vdradmin.pl?aktion=rc_hitk&amp;key=7');"><img src="bilder/fern_11.jpg" alt="" height="28" width="67" border="0" /></a></td>
							<td><a href="javascript:switch_channel('./vdradmin.pl?aktion=rc_hitk&amp;key=8');"><img src="bilder/fern_12.jpg" alt="" height="28" width="66" border="0" /></a></td>
							<td><a href="javascript:switch_channel('./vdradmin.pl?aktion=rc_hitk&amp;key=9');"><img src="bilder/fern_13.jpg" alt="" height="28" width="67" border="0" /></a></td>
						</tr>
						<tr>
							<td></td>
							<td><a href="javascript:switch_channel('./vdradmin.pl?aktion=rc_hitk&amp;key=0');"><img src="bilder/fern_15.jpg" alt="" height="28" width="66" border="0" /></a></td>
							<td></td>
						</tr>
						<tr>
							<td></td>
							<td><img src="bilder/spacer.gif" alt="" height="20" width="50" border="0" /></td>
							<td></td>
						</tr>
						<tr>
							<td><a href="javascript:switch_channel('./vdradmin.pl?aktion=rc_hitk&amp;key=menu');"><img src="bilder/fern_18.jpg" alt="" height="27" width="67" border="0" /></a></td>
							<td></td>
							<td><a href="javascript:switch_channel('./vdradmin.pl?aktion=rc_hitk&amp;key=back');"><img src="bilder/fern_19.jpg" alt="" height="27" width="67" border="0" /></a></td>
						</tr>
						<tr>
							<td colspan="3"><a href="javascript:switch_channel('./vdradmin.pl?aktion=rc_hitk&amp;key=red');"><img src="bilder/fern_22.jpg" alt="" height="28" width="50" border="0" /></a><a href="javascript:switch_channel('./vdradmin.pl?aktion=rc_hitk&amp;key=green');"><img src="bilder/fern_23.jpg" alt="" height="28" width="49" border="0" /></a><a href="javascript:switch_channel('./vdradmin.pl?aktion=rc_hitk&amp;key=yellow');"><img src="bilder/fern_24.jpg" alt="" height="28" width="51" border="0" /></a><a href="javascript:switch_channel('./vdradmin.pl?aktion=rc_hitk&amp;key=blue');"><img src="bilder/fern_25.jpg" alt="" height="28" width="50" border="0" /></a></td>
						</tr>
						<tr>
							<td></td>
							<td><img src="bilder/spacer.gif" alt="" height="20" width="50" border="0" /></td>
							<td></td>
						</tr>
						<tr>
							<td></td>
							<td><a href="javascript:switch_channel('./vdradmin.pl?aktion=rc_hitk&amp;key=up');"><img src="bilder/fern_28.jpg" alt="" height="27" width="66" border="0" /></a></td>
							<td></td>
						</tr>
						<tr>
							<td></td>
							<td><img src="bilder/spacer.gif" alt="" height="20" width="50" border="0" /></td>
							<td></td>
						</tr>
						<tr>
							<td><a href="javascript:switch_channel('./vdradmin.pl?aktion=rc_hitk&amp;key=left');"><img src="bilder/fern_31.jpg" alt="" height="27" width="67" border="0" /></a></td>
							<td><a href="javascript:switch_channel('./vdradmin.pl?aktion=rc_hitk&amp;key=ok');"><img src="bilder/fern_32.jpg" alt="" height="27" width="66" border="0" /></a></td>
							<td><a href="javascript:switch_channel('./vdradmin.pl?aktion=rc_hitk&amp;key=right');"><img src="bilder/fern_33.jpg" alt="" height="27" width="67" border="0" /></a></td>
						</tr>
						<tr>
							<td></td>
							<td><img src="bilder/spacer.gif" alt="" height="20" width="50" border="0" /></td>
							<td></td>
						</tr>
						<tr>
							<td></td>
							<td><a href="javascript:switch_channel('./vdradmin.pl?aktion=rc_hitk&amp;key=down');"><img src="bilder/fern_36.jpg" alt="" height="27" width="66" border="0" /></a></td>
							<td></td>
						</tr>
						<tr>
							<td></td>
							<td><img src="bilder/spacer.gif" alt="" height="20" width="50" border="0" /></td>
							<td></td>
						</tr>
						<tr>
							<td><a href="javascript:switch_channel('./vdradmin.pl?aktion=rc_hitk&amp;key=VolumeMinus');"><img src="bilder/fern_39.jpg" alt="" height="27" width="67" border="0" /></a></td>
							<td><a href="javascript:switch_channel('./vdradmin.pl?aktion=rc_hitk&amp;key=mute');"><img src="bilder/fern_mute.jpg" alt="" height="27" width="67" border="0" /></a></td>
							<td><a href="javascript:switch_channel('./vdradmin.pl?aktion=rc_hitk&amp;key=VolumePlus');"><img src="bilder/fern_40.jpg" alt="" height="27" width="67" border="0" /></a></td>
						</tr>
						<tr>
							<td></td>
							<td><img src="bilder/spacer.gif" alt="" height="20" width="50" border="0" /></td>
							<td></td>
						</tr>
					</table>
				</td>
				<td align="center">
					<select name="channel" size="30" onchange="javascript:switch_channel('./vdradmin.pl?aktion=tv_switch&amp;channel=' + encodeURIComponent(this.options[this.selectedIndex].value));">
<tmpl_loop channels>
						<option value="<tmpl_var vdr_id>" <tmpl_if cur>selected</tmpl_if>><tmpl_var name></option>
</tmpl_loop>
					</select>
<!--					<a class="submit" href="javascript:switch_by_select();">Switch</a>-->
				</td>
</tmpl_unless>
			</tr>
<tmpl_unless tv_only>
			<tr>
				<td colspan="4"></td>
			</tr>
			<tr valign="middle">
				<td valign="middle" style="white-space: nowrap;">
					<h5><%! Interval: !%></h5>
					<select name="Seconds" class="submit" onChange="v_changeInterval(this.options[this.selectedIndex].value)">
						<option value="0"><%! off !%></option>
						<option value="1" <tmpl_if expr="interval == 1">selected="selected"</tmpl_if>> 1 <%! sec. !%></option>
						<option value="2" <tmpl_if expr="interval == 2">selected="selected"</tmpl_if>> 2 <%! sec. !%></option>
						<option value="3" <tmpl_if expr="interval == 3">selected="selected"</tmpl_if>> 3 <%! sec. !%></option>
						<option value="5" <tmpl_if expr="interval == 5">selected="selected"</tmpl_if>> 5 <%! sec. !%></option>
						<option value="10" <tmpl_if expr="interval == 10">selected="selected"</tmpl_if>>10 <%! sec. !%></option>
						<option value="30" <tmpl_if expr="interval == 30">selected="selected"</tmpl_if>>30 <%! sec. !%></option>
						<option value="60" <tmpl_if expr="interval == 60">selected="selected"</tmpl_if>>60 <%! sec. !%></option>
					</select>
					<input type="button" class="submit" name="livebild" value='<%! G !%>' title="<%! Grab the picture! !%>" onClick="WebcamUpdate()" />
					&nbsp;&nbsp;<h5><%! Size: !%></h5>
					<select name="Size" class="submit" onChange="v_changeSize(this.options[this.selectedIndex].value)">
						<option value="full" <tmpl_if expr="size eq 'full'">selected="selected"</tmpl_if>>1:1</option>
						<option value="half" <tmpl_if expr="size eq 'half'">selected="selected"</tmpl_if>>1:2</option>
						<option value="quarter" <tmpl_if expr="size eq 'quarter'">selected="selected"</tmpl_if>>1:4</option>
					</select>
					<input type="button" class="submit" name="livebild" value='<%! G !%>' title="<%! Grab the picture! !%>" onClick="WebcamUpdate()" />
				</td>
				<td colspan="3" align="right"><tmpl_unless new_win>[<a class="submit" href="javascript:tv_open();"><%! Open in separate window !%></a>]&nbsp;&nbsp;</tmpl_unless></td>
			</tr>
			<tr>
				<td colspan="4"></td>
			</tr>
</tmpl_unless>
		</table>
	</form>
</body>
</html>
