<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
<%@ Import Namespace="Domain" %>

<link type="text/css" rel="stylesheet" href="/Styles/app/tv.css" />
<script type="text/javascript">
    $(function () {
        $('#tv-panel a').click(function () {
            $.ajax({
                url: '/App/Television',
                type: 'POST',
                dataType: 'JSON',
                data: {
                    RoomNumber: RoomConfig.RoomNumber,
                    TvModalId: $('#hfTvModalId').val(),
                    Key: $(this).attr('key')
                },
                success: function (r) {
                    if (!r.IsSuccess) {
                        showTip(r.Message);
                    }
                }
            });
        });

        $('#menu li a').click(function () {
            $(this).parents('ul').find('.selected').removeClass('selected');
            $(this).addClass('selected');
        });
    });
	</script>
<div id="tv-panel">	
	<div class="top clearfix">
		<a href="javascript:void(0)" class="tv-key tv-key-power" key='<%: TvKey.Power.ToString() %>'></a>
		<a href="javascript:void(0)" class="tv-key tv-key-mute" key='<%: TvKey.Mute.ToString() %>'></a>
	</div>
	<div class="middle clearfix">
		<div class="tv-key-channel-panel">
			<a href="javascript:void(0)" class="tv-key tv-key-channel-inc" key='<%: TvKey.ChannelInc.ToString() %>'>+</a>
			CH
			<a href="javascript:void(0)" class="tv-key tv-key-channel-dec" key='<%: TvKey.ChannelDec.ToString() %>'>-</a>
		</div>

		<div class="tv-key-dir-panel">
			<a href="javascript:void(0)" class="tv-key tv-key-dir-left" key='<%: TvKey.Left.ToString() %>'></a>
			<a href="javascript:void(0)" class="tv-key tv-key-dir-up"  key='<%: TvKey.Up.ToString() %>'></a>
			<a href="javascript:void(0)" class="tv-key tv-key-dir-ok" key='<%: TvKey.Ok.ToString() %>'>OK</a>
			<a href="javascript:void(0)" class="tv-key tv-key-dir-right" key='<%: TvKey.Right.ToString() %>'></a>
			<a href="javascript:void(0)" class="tv-key tv-key-dir-bottom" key='<%: TvKey.Down.ToString() %>'></a>
		</div>

		<div class="tv-key-voice-panel">
			<a href="javascript:void(0)" class="tv-key tv-key-voice-inc" key='<%: TvKey.VoiceInc.ToString() %>'>+</a>
			VOL
			<a href="javascript:void(0)" class="tv-key tv-key-voice-dec" key='<%: TvKey.VoiceDec.ToString() %>'>-</a>
		</div>
	</div>

	<ul class="bottom clearfix">
		<li><a href="javascript:void(0)" class="tv-key tv-key-home" key='<%: TvKey.Home.ToString() %>'></a></li>
		<li><a href="javascript:void(0)" class="tv-key tv-key-menu" key='<%: TvKey.Menu.ToString() %>'></a></li>
		<li><a href="javascript:void(0)" class="tv-key tv-key-source" key='<%: TvKey.Source.ToString() %>'></a></li>
		<li><a href="javascript:void(0)" class="tv-key tv-key-replay" key='<%: TvKey.Replay.ToString() %>'></a></li>
	</ul>
</div>