<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MainMobile.aspx.cs" Inherits="RM.Web.Frame.MainMobile" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>
        <%=RM.Common.DotNetConfig.ConfigHelper.GetAppSettings("CustomerCompanyName")%>-触屏版
    </title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes" />
    <link href="/Themes/Styles/Mobile.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div class="menu" id="menu">
        <h1 id="menuhead">
            菜单 <span>MENU</span><a href="javascript:MenuShow()" style=" float:right; color:White;">返回</a></h1>
        <div id="menutab">
        </div>
        <div id="htmlMenuPanel">
        </div>
    </div>
    <div class="main">
        <div class="main_head" id="head">
            <img src="../Themes/Images/bmslogo.png" alt="TKS在线培训系统" style="width: 15em; float: left;" />
            <img src="../Themes/Images/MoblieMenu_btn.png" alt="菜单" class="main_head_btn" onclick="MenuShow()" />
            <div style="clear: both;">
            </div>
        </div>
        <div id="Content">
            <iframe id="main" name="main" scrolling="auto" frameborder="0" scrolling="yes" width="100%"
                height="100%" src=""></iframe>
        </div>
    </div>
    <script src="/Themes/Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
    <link href="/Themes/Scripts/artDialog/skins/opera.css" rel="stylesheet" type="text/css" />
    <script src="/Themes/Scripts/artDialog/artDialog.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/artDialog/iframeTools.source.js" type="text/javascript"></script>
    <script type="text/javascript" src="../Themes/Scripts/FunctionJS.js"></script>
    <script type="text/javascript">
        function MenuShow() {
            $("#menu").slideToggle();
            var divkuangH = $(window).height();
            var divhead = $("#menuhead").height();
            //$("#menu").height(divkuangH);
            $("#menutab").height(divkuangH - divhead);

        }
        /**自应高度**/
        function iframeresize() {
            resizeU();
            $(window).resize(resizeU);
            function resizeU() {
                var divkuangH = $(window).height();
                var divhead = $("#head").height();
                $("#main").height(divkuangH - divhead);


            }
        }
        function loadUrl() {
            var url = QueryString("url"); //课程的地址
            if (url != "") {
                document.getElementById("main").src = url;
            }
            else {
                document.getElementById("main").src = "HomeIndex.aspx";
            }
        }
        //菜单
        var V_JSON = "";
        function GetMenu() {
            var parm = 'action=Menu';
            $("#menutab").empty();
            getAjax('Frame.ashx', parm, function (rs) {
                try {
                    V_JSON = rs;
                    var j = 0;
                    var json = eval("(" + V_JSON + ")");
                    var css = "removesel";
                    for (var i = 0; i < json.MENU.length; i++) {
                        var menu = json.MENU[i];
                        if (menu.PARENTID == 0) {
                            $("#menutab").append("<div class=\"" + css + "\" onclick=\"GetSeedMenu(this,'" + menu.MENU_ID + "')\">" + menu.MENU_NAME + "</div>");
                            GetSeedMenu(this, menu.MENU_ID);
                            j++;
                        }
                    }

                } catch (e) {
                    alert(e);
                }
            });
        }
        //子菜单
        function GetSeedMenu(e, menu_id) {
            var j = 0;
            var json = eval("(" + V_JSON + ")");
            for (var i = 0; i < json.MENU.length; i++) {
                var menu = json.MENU[i];
                if (menu.PARENTID == menu_id) {
                    $("#menutab").append("<li><div onclick=\"NavMenuUrl('" + menu.NAVIGATEURL + "')\"><img src=\"/Themes/Images/32/" + menu.MENU_IMG + "\" width=\"28\" height=\"28\" /> " + menu.MENU_NAME + "</div></li>");
                }
            }

        }
        function NavMenuUrl(url) {
            $("#main").attr("src", url);
            MenuShow();
            return false;
        }
        $(function () {
            loadUrl();
            iframeresize();
            GetMenu();
        })
    </script>
</body>
</html>
