#from Plugins.Extensions.OpenWebif.local import tstrings
<!-- OSD -->
<style>
.ib,.id{float:left;position:relative;margin:0 0 3px 3px;height:26px;}
.id{width:64px;background-image:url(/images/osd/icon_64x26.png);}
.ib{width:44px;background-image:url(/images/osd/icon_44x26.png);}
.iconadl{float:left;position:relative;top:6px;left:15px;height:26px;}
.d14 { position:relative;height:14px;font-size:13px;left:0px;top:0px;}
.d24 { position:relative;font-size:13px;left:0px;top:10px;}
.d120 { float:left;display:block;width:120px;}
.dh24 { float:left;height:24px;}
.dh20 { float:left;height:20px;}
.dh14 { float:left;height:14px;}
</style>
<div id="dcurrent" class="ui-widget-content">
	<div style="float:left;width:120px;height:137px;">
		<div class='d120' style="height:37px;">
			<div style="position:relative;top:10px;left:18px;font-size:13px;font-weight:bold;">$info.date</div>
		</div>
		<div class='d120' style="height:60px;">
			<div style="position:relative;top:0px;left:15px;"><img border='0' width="100px" height="60px" src='$getVar("info.picon", "images/default_picon.png")' onclick="open_epg_dialog('$info.ref','$info.name');" href="#" title="$tstrings['show_epg_for'] $info.name" border="0" alt='' /></div>
 		</div>
		<div class='d120' style="height:40px;">
			<div style="position:relative;top:8px;left:0px;text-align:center;font-size:11px;font-weight:bold;">$info.provider</div>
		</div>
	</div>
	<div style="float:left;width:560px;height:137px;">
		<div style="float:left;width:560px;height:25px;">
			<div style="float:left;position:relative;top:5px;left:0px;width:480px;text-align:center;font-size:18px;"><a target="_blank" title="$tstrings['stream'] $getVar('now.title', '') from $info.name" href='web/stream.m3u?ref=$info.ref&name=$info.name'>$info.name</a></div>
		</div>
		<div style="float:left;width:560px;height:24px;">
			<div class='dh24' style="width:70px;">
				<div class='d24' style="left:15px;">$getVar("now.begin", " ")</div>
			</div>
			<div class='dh24' style="width:360px;-o-text-overflow: ellipsis;text-overflow: ellipsis;white-space: nowrap;">
				<div class='d24'>$getVar("now.title", " ")</div>
			</div>
			<div class='dh24' style="width:130px;">
				<div class='d24'>+$getVar("now.tleft", " ") min</div>
			</div>
		</div>
		<div style="float:left;width:560px;height:16px;">
			<div style="float:left;position:relative;top:2px;left:15px;width:400px;height:14px;background-image:url(images/osd/chan_bar_back.png);">
				<div class='dh14' style="width:400px;"><img border='0' height='14px' width='${getVar("now.progress", "0")}px' src='images/osd/chan_bar.png' alt='' /></div>
			</div>
		</div>
		<div class='dh14' style="width:560px;">
			<div class='dh14' style="width:70px;">
				<div class='d14' style="left:15px;">$getVar("next.begin", " ")</div>
			</div>
			<div class='dh14'style="width:360px;-o-text-overflow: ellipsis;text-overflow: ellipsis;white-space: nowrap;">
				<div class='d14'>$getVar("next.title", " ")</div>
			</div>
			<div class='dh14' style="width:130px;">
				<div class='d14'>&nbsp; $getVar("next.duration", " ") min</div>
			</div>
		</div>
		<div class='dh20' style="width:560px;">
			<div class='dh20' style="width:100px;">
				<div class='d14' style="top:6px;left:15px;">$getVar("info.tunertype", " ")</div>
			</div>
			<div class='dh20' style="width:80px;">
				<div class='d14' style="float:left;top:6px;">Snr: $getVar("info.snr", "0") % </div>
			</div>
			<div class='dh20' style="width:100px;">
				<div class='dh14' style="position:relative;top:8px;left:0px;width:100px;background-image:url(images/osd/snr_bar_back.png);">
					<div class='dh14' style="width:100px;"><img border='0' height='14px' width='${getVar("info.snr", "0")}px' src='images/osd/chan_bar.png' alt='' /></div>
				</div>
			</div>
			<div class='dh20' style="width:100px;">
				<div class='d14' style="float:left;top:6px;left:7px;"> Ber: $getVar("info.ber", "N/A") </div>
			</div>
			<div class='dh20' style="width:125px;">
				<div class='d14' style="top:6px;">$info.width x $info.height</div>
			</div>
		</div>
		<div style="float:left;width:560px;height:60px">
			<div style="float:left;width:auto;height:26px;padding-top:8px">
				<div id="currenttuners">
#set $tnum = 0
#for $tuner in $info.tuners
	#if $info.tunernumber == $tnum
		<span style="opacity:1">$tuner</span>
	#else
		<span>$tuner</span>
	#end if
	#set $tnum = $tnum + 1
#end for
				</div>
			</div>
			<div style="float:left;height:32px;">
				<div class="iconadl" style="left:10px">
#set $ta = '44px'
#if $info.crypt == 1
#set $ta = '0px'
#end if
					<div class="ib" style="background-position: -$ta 0px"></div>
#set $ta = '64px'
#if $info.dolby == True
#set $ta = '0px'
#end if
					<div class="id" style="background-position: -$ta 0px"></div>
#set $ta = '132px'
#if $info.wide == True
#set $ta = '88px'
#end if
					<div class="ib" style="background-position: -$ta 0px"></div>
#set $ta = '220px'
#if $info.width > 1900
#set $ta = '176px'
#end if
					<div class="ib" style="background-position: -$ta 0px"></div>
#set $ta = '220px'
#if $info.txtpid != "N/A"
#set $ta = '176px'
#end if
					<div class="ib" style="background-position: -$ta -26px"></div>
#set $ta = '132px'
#if $info.subs == True
#set $ta = '88px'
#end if
					<div class="ib" style="background-position: -$ta -26px"></div>
#set $ta = '44px'
#if $info.rec_state == True
#set $ta = '0px'
#end if
					<div class="ib" style="background-position: -$ta -26px"></div>
				</div>
			</div>
		</div>
	</div>
</div>

<!-- /END OSD -->

<br />
<table class="ui-widget-content tcurrent" width="100%" border="0" cellspacing="1" cellpadding="5" style="background-image:none;">
	<tr style="background-color:initial;" >
		<th colspan="3" class="ui-widget-header">$tstrings['service']</th>
	</tr>
	<tr>
		<td>$tstrings['name']: $info.name</td>
		<td>$tstrings['provider']: $info.provider</td>
		<td id="ns" data-ns="$info.namespace">$tstrings['namespace']: $info.namespace</td>
	</tr>
	<tr>
		<td>$tstrings['video_width']: $info.width</td>
		<td>$tstrings['video_height']: $info.height</td>
		<td>$tstrings['video_wide']: $info.wide</td>
	</tr>
	<tr>
		<td>$tstrings['encrypted']: $info.crypt</td>
		<td>$tstrings['dolby']: $info.dolby</td>
		<td>$tstrings['subservices']: $info.subs</td>
	</tr>
	<tr>
		<td>$tstrings['teletext']: $info.txtpid</td>
		<td>$tstrings['rec_status']: $info.rec_state</td>
		<td id="pmtpid" data-pmtpid="$info.pmtpid">$tstrings['pmt_pid']: $info.pmtpid</td>
	</tr>
	<tr>
		<td id="apid" data-apid="$info.apid">$tstrings['a_pid']: $info.apid</td>
		<td id="vpid" data-vpid="$info.vpid">$tstrings['v_pid']: $info.vpid</td>
		<td id="pcrpid" data-pcrpid="$info.pcrpid">$tstrings['pcr_pid']: $info.pcrpid</td>
	</tr>
	<tr>
		<td id="tsid" data-tsid="$info.tsid">$tstrings['ts_id']: $info.tsid </td>
		<td id="onid" data-onid="$info.onid">$tstrings['on_id']: $info.onid</td>
		<td id="sid" data-sid="$info.sid">$tstrings['s_id']: $info.sid</td>
	</tr>
	<tr>
		<td>$tstrings['s_ref']: $info.sref</td>
		<td>$getVar("info.srefv2", "")</td>
		<td>$getVar("info.orbital_position", "")</td>
	</tr>
	<tr style="background-color:initial;" >
		<th colspan="3" class="ui-widget-header">$tstrings['tuner_signal']</th>
	</tr>
	<tr>
		<td>$tstrings['tuner_type']: $getVar("info.tunertype", "N/A")</td>
		<td>$tstrings['tuner_number']:  $getVar("info.tunernumber", "N/A")</td>
		<td>$tstrings['tuner_signal_snr']:  $getVar("info.snr", "N/A")</td>
	</tr>
	<tr>
		<td>$tstrings['tuner_signal_snr_db']:  $getVar("info.snr_db", "N/A")</td>
		<td>$tstrings['tuner_signal_agc']:  $getVar("info.agc", "N/A")</td>
		<td>$tstrings['tuner_ber']:  $getVar("info.ber", "N/A")</td>
	</tr>
	<tr style="background-color:initial;" >
		<th colspan="3" class="ui-widget-header">$tstrings['current_event']</th>
	</tr>
	<tr>
		<td colspan="3">$tstrings['title']: $getVar("now.title", " ")</td>
	</tr>
	<tr>
		<td>$tstrings['begin']: $getVar("now.begin", " ")</td>
		<td>$tstrings['end']: $getVar("now.end", " ")</td>
		<td>$tstrings['duration']: $getVar("now.duration", " ")</td>
	</tr>
	<tr>
		<td colspan="3">$tstrings['description']:  $getVar("now.shortdesc", " ")
		<br>$getVar("now.longdesc", " ")
		</td>
	</tr>
</table>
<script type="text/javascript">
#raw
function PrintDH(i)
{
var result = "0000";
if (i >= 0 && i <= 15) {result="000"+i.toString(16);}
else if (i >= 16 && i <= 255) {result="00"+i.toString(16);}
else if (i >= 256 && i <= 4095) {result="0"+i.toString(16);}
else if (i >= 4096 && i <= 65535) {result=i.toString(16);}
else {result=i.toString(16);}
return " (" + result + ")";
}
var v = parseInt($("#pmtpid").data("pmtpid"));
$("#pmtpid").html($("#pmtpid").html() + PrintDH(v));
v = parseInt($("#apid").data("apid"));
$("#apid").html($("#apid").html() + PrintDH(v));
v = parseInt($("#vpid").data("vpid"));
$("#vpid").html($("#vpid").html() + PrintDH(v));
v = parseInt($("#pcrpid").data("pcrpid"));
$("#pcrpid").html($("#pcrpid").html() + PrintDH(v));
v = parseInt($("#tsid").data("tsid"));
$("#tsid").html($("#tsid").html() + PrintDH(v));
v = parseInt($("#onid").data("onid"));
$("#onid").html($("#onid").html() + PrintDH(v));
v = parseInt($("#sid").data("sid"));
$("#sid").html($("#sid").html() + PrintDH(v));
v = parseInt($("#ns").data("ns"));
$("#ns").html($("#ns").html() + PrintDH(v));
#end raw

</script>
