<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>私塾家</title>
<script th:include="sys/common/sys_css" th:remove="tag"></script> 
<body>

	<!-- 页面顶部¨ -->
	<div th:include="sys/common/head" th:remove="tag"></div> 
	<div id="websocket_button"></div>
	<div class="container-fluid" id="main-container">
		<a href="#" id="menu-toggler"><span></span></a>
		<!-- menu toggler -->

		<!-- 左侧菜单 -->
		<div th:include="sys/common/menu" th:remove="tag"></div> 

		<div id="main-content" class="clearfix">

			<div id="jzts" style="display:none; width:100%; position:fixed; z-index:99999999;">
			<div class="commitopacity" id="bkbgjz"></div>
			<div style="padding-left: 70%;padding-top: 1px;">    
				<div style="float: left;margin-top: 3px;"><img th:src="@{/static/sys/images/loadingi.gif}" /> </div>
				<div style="margin-top: 5px;"><h4 class="lighter block red">&nbsp;加载中 ...</h4></div>
			</div>
			</div>

            <div>
				<iframe name="mainFrame" id="mainFrame" frameborder="0"  style="width:100%;height:100%;"></iframe>
			</div>
			<!-- 换肤 -->
			<div id="ace-settings-container">
				<div class="btn btn-app btn-mini btn-warning" id="ace-settings-btn">
					<i class="icon-cog"></i>
				</div>
				<div id="ace-settings-box">
					<div>
						<div class="pull-left">
							<select id="skin-colorpicker" class="hidden">
								<option data-class="default" value="#438EB9"
									>#438EB9</option>
								<option data-class="skin-1" value="#222A2D" 
									>#222A2D</option>
								<option data-class="skin-2" value="#C6487E"
									>#C6487E</option>
								<option data-class="skin-3" value="#D0D0D0"
									>#D0D0D0</option>
							</select>
						</div>
						<span>&nbsp; 选择皮肤</span>
					</div>
					<div>
						<label><input type='checkbox' name='menusf' id="menusf" checked="checked"
							onclick="menusf();" /><span class="lbl" style="padding-top: 5px;">菜单缩放</span></label>
					</div>
				</div>
			</div>
			<!--/#ace-settings-container-->

		</div>
		<!-- #main-content -->
	</div>
<script th:include="sys/common/sys_js" th:remove="tag"></script> 
<script src="js/jquery.cookie.js" th:src="@{/static/js/jquery.cookie.js}"></script> 	
<script type="text/javascript">

  $(function(){
	  if(typeof($.cookie('sys_menu_url')) == "undefined"){

		  var url= $("ul.submenu").find('li').eq(0).attr('data-url');
	  	if(url == "undefined"){
		 	 $("#mainFrame").attr("src", "[[${sysUrl}]]/sys/login/home.html");
	  	}else{
		  	$("#mainFrame").attr("src", "[[${sysUrl}]]"+url);
	  	}

		}else{
			var id = $.cookie('mid');
			var fid = $.cookie('fmid');
			$("#fhindex").removeClass();
			$("#"+fid).attr("class","active open");
			$("#"+id).attr("class","active");
			$("#"+fmid).find('ul').css('display','block'); 
			
			
			 var url =$.cookie('sys_menu_url');
			 $("#mainFrame").attr("src", '[[${sysUrl}]]'+url);
		}
  });
		//菜单状态切换
		var fmid = "fhindex";
		var mid = "fhindex";
		function siMenu(id,fid,MENU_URL){
			if(MENU_URL=='#'){
				return;
			}
			if(id != mid){
				$("#"+mid).removeClass();
				mid = id;
			}
			if(fid != fmid){
				$("#"+fmid).removeClass();
				$("#"+fmid).find('ul').css('display','none'); 
				fmid = fid;
				
			}
			$("#"+fid).attr("class","active open");
			$("#"+id).attr("class","active");
			 $.cookie('sys_menu_url',MENU_URL,{expires:7});
			 $.cookie('fmid',fmid,{expires:7});
			 $.cookie('mid',mid,{expires:7});
			$('#mainFrame').attr("src", '[[${sysUrl}]]'+MENU_URL);
		}
		function cmainFrame(){
			var hmain = document.getElementById("mainFrame");
			var bheight = document.documentElement.clientHeight;
			hmain.style.width = '100%';
			hmain.style.height = (bheight  - 51) + 'px';
			var bkbgjz = document.getElementById("bkbgjz");
			bkbgjz.style.height = (bheight  - 41) + 'px';
			
		}
		cmainFrame();
		window.onresize=function(){  
			cmainFrame();
		};
</script>
</body>

<script src="js/layer/layer.js" th:src="@{/static/js/layer/layer.js}"></script>
<script type="text/javascript">
layer.config({
    skin:'layer-ext-espresso',
    extend:'skin/espresso/style.css'
});
		var sysUrl = '[[${sysUrl}]]';
		var imgUrl = '[[${imgUrl}]]';
</script>
</html>





