<?php
if (!defined('USING_SYSTEM')) exit;
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" rel="stylesheet" href="admin/images/main.css" />
<script type="text/javascript" src="skins/common/images/jquery-1.11.0.min.js"></script>
<script type="text/javascript">
$(document).ready(function(e) {
    resizeUI();
	$('#leftNavList a').on('click', function() {
		$(this).siblings('.select').removeClass('select');
		$(this).addClass('select');
		$('#mainIframe').attr('src', 'admin.php?ac=p'+($(this).parent().index()+1)+'0'+($(this).index()+1));
	});
	$('#header a').on('click', function() {
		if($(this).index() != '5') {
			$(this).siblings('.select').removeClass('select');
			$(this).addClass('select');
			$('#leftNavList>div:visible').hide()
			$('#leftNavList>div').eq($(this).index()).show();
			$('#mainIframe').attr('src', 'admin.php?ac=p'+($(this).index()+1)+'0'+($('#leftNavList div:eq('+$(this).index()+') .select').index()+1));
		} else {
			window.parent.showWindow('<div class="windowContent">您真的要退出后台管理么？</div><div class="windowBottom"><a class="button" href="javascript:void(0);" onclick="return false;">确定<i></i></a>　<a class="button" href="javascript:void(0);" onclick="hideWindow();return false;">取消<i></i></a></div>', [function() {
				$('#mainIframe').attr('src', 'admin.php?ac=p601');
			}]);
		}
	});
});
$(window).on('resize', function() {
	resizeUI();
});

function resizeUI() {
	$('#mainIframe').height($(window).height()-$('#mainTable').offset().top).width($(window).width()-170);
	$('#mainTable').height($(window).height()-$('#mainTable').offset().top);
	$('#mask').height($(window).height());
}

function showWindow(dom, func) {
	$win = $('<div class="window"></div>').show().appendTo('body').css({'opacity':'0'});
	$win.html(dom);
	var top = $(window).height()/2-$win.outerHeight()/2;
	$win.css({'left':$(window).width()/2-$win.outerWidth()/2+'px','top':top-60+'px'}).animate({'opacity':'1','top':top+'px'},300);
	$('#mask').show().css({'opacity':'0'}).animate({'opacity':'.2'},300);
	$('<div class="windowMask"></div>').appendTo($win).css({'opacity':'0','height':$win.height()+'px','width':$win.width()+'px'});
	// --- 绑定事件 ---
	for(var k in func) {
		if(func[k] != null)
			$win.find('.windowBottom').find('.button').eq(k).on('click', function() {
				func[k]($(this).parents('.window')[0]);
			});
	}
	//*/
}
function hideWindow() {
	$('#mask').animate({'opacity':'0'}, 300, function() {
		$(this).hide();
	});
	$win.animate({'opacity':'0','top':'-=60px'},300,function() {
		$(this).remove();
	});
}
function showWindowMask(win) {
	$(win).children('.windowMask').show().animate({opacity:'.2'}, 300);
}
function hideWindowMask(win) {
	$(win).children('.windowMask').animate({opacity:'0'}, 300, function() {
		$(this).hide();
	});
}
</script>
<title>Filiant Control Panel</title>
</head>
<body>
<div id="header">
  <a href="javascript:void(0);" class="select">核心设置</a><a href="javascript:void(0);">用户相关</a><a href="javascript:void(0);">模板风格</a><a href="javascript:void(0);">存储设置</a><a href="javascript:void(0);">系统设置</a><a href="javascript:void(0);">退出管理</a>
</div>
<table id="mainTable" width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="170" valign="top" id="leftNavList">
      <div style="display:block;">
        <a href="javascript:void(0);" class="select">后台首页</a>
        <a href="javascript:void(0);">站点信息</a>
        <a href="javascript:void(0);">注册设置</a>
        <a href="javascript:void(0);">SEO设置</a>
        <a href="javascript:void(0);">SMTP设置</a>
      </div>
      <div>
        <a href="javascript:void(0);" class="select">管理用户</a>
        <a href="javascript:void(0);">管理用户组</a>
      </div>
      <div>
        <a href="javascript:void(0);" class="select">管理模板</a>
      </div>
      <div>
        <a href="javascript:void(0);" class="select">管理云卷</a>
        <a href="javascript:void(0);">文件清理</a>
        <a href="javascript:void(0);">文件预览</a>
      </div>
      <div>
        <a href="javascript:void(0);" class="select">缓存更新</a>
        <a href="javascript:void(0);">语言编辑</a>
      </div>
    </td>
    <td valign="top">
      <iframe id="mainIframe" src="admin.php?ac=p101" frameborder="0"></iframe>
    </td>
  </tr>
</table>
<div id="mask"></div>
</body>
</html>