<%@ page import="com.wisedu.coeus.web.LoginContext" %>
<%@ page import="com.wisedu.coeus.helper.ApplicationHelper" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="/WEB-INF/jsp/includes.jsp" %>
<%@ page import="java.util.regex.Pattern" %>
<%@ page import="java.util.regex.Matcher" %>
<%@ page import="com.wisedu.coeus.util.UrlUtils" %>

<%
    String userAgent = request.getHeader("User-Agent");

    Pattern pattern;
    Matcher matcher;

    boolean find = false;

    String redirectUrl = "/upgrade/";

    pattern = Pattern.compile("MSIE[ \\/]([\\d\\.]+)", Pattern.CASE_INSENSITIVE);
    matcher = pattern.matcher(userAgent);
    double version = 100.0D;
    if (matcher.find()) {
        version = Double.parseDouble(matcher.group(1));
        find = true;
        /*if (version < 8.0D) {
            UrlUtils.redirect(request, response, redirectUrl);
            return;
        }*/
    }

    if (!find) {
        pattern = Pattern.compile("Chrome[ \\/]([\\d]+)", Pattern.CASE_INSENSITIVE);
        matcher = pattern.matcher(userAgent);
        if (matcher.find()) {
            version = Double.parseDouble(matcher.group(1));
            find = true;
            if (version < 28.0D) {
                UrlUtils.redirect(request, response, redirectUrl);
                return;
            }
        }
    }

    if (!find) {
        pattern = Pattern.compile("Firefox[ \\/]([\\d]+)", Pattern.CASE_INSENSITIVE);
        matcher = pattern.matcher(userAgent);
        if (matcher.find()) {
            version = Double.parseDouble(matcher.group(1));
            find = true;
            if (version < 28.0D) {
                UrlUtils.redirect(request, response, redirectUrl);
                return;
            }
        }
    }
    request.setAttribute("curSite", LoginContext.getLoginUser().getAttribute("curSite"));

%>
<!DOCTYPE html>
<html>
<head>
    <title><coeus:title /></title>
    <meta name="renderer" content="webkit">
    <meta name="keywords" content="<coeus:keywords />">
    <meta name="description" content="<coeus:description />">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta http-equiv="X-UA-Compatible" content='<tiles:getAsString name="ie" ignore="true"/>'/>
    <!--[if lt IE 8]>
    <meta http-equiv="Refresh" content="0;url=<%=redirectUrl%>">
    <![endif]-->
    <meta name="PowerBy" content="江苏知途教育科技有限公司">
    <coeus:css href="/theme/default/plugins/animate.css?<%--[#ReleaseNo#]--%>"/>
    <%--[#MinifyCSS="/theme/plugin.min.css"]--%>
    <coeus:css href="/theme/default/upload/jquery.jcrop.css"/>
    <coeus:css href="/theme/default/plugins/animate.css"/>
    <coeus:css href="/theme/default/plugins/art-dialog.css"/>
    <coeus:css href="/theme/default/plugins/dropkick.css"/>
    <coeus:css href="/theme/default/plugins/introjs.css"/>
    <coeus:css href="/theme/default/plugins/jquery-ui.min.css"/>
    <%--[MinifyCSS#]--%>
    <%--[#MinifyCSS="/theme/import.min.css"]--%>
    <coeus:css href="/theme/reset.css"/>
    <coeus:css href="/theme/default/layout.css"/>
    <%--[MinifyCSS#]--%>
    <%--[#MinifyCSS="/theme/elements.min.css"]--%>
    <coeus:css href="/theme/default/elements.css"/>
    <%--[MinifyCSS#]--%>
    <%--[#MinifyCSS="/theme/view.min.css"]--%>
    <coeus:css href="/theme/default/view.css"/>
    <%--[MinifyCSS#]--%>
    <%--[#MinifyCSS="/theme/d-view.min.css"]--%>
    <coeus:css href="/theme/default/d-view.css"/>
    <%--[MinifyCSS#]--%>
    <%--[#MinifyJS="/js/base.min.js"]--%>
    <coeus:js src="/js/jquery-1.10.2/jquery.js"/>
    <coeus:js src="/js/jquery-ui-1.11.1/jquery-ui.min.js"/>
    <coeus:js src="/js/core/help.js"/>
    <%--[MinifyJS#]--%>
    <script type="text/javascript">
        <% request.setAttribute("contextPath", ApplicationHelper.getContextPath()); %>

        CONTEXTPATH = '${contextPath}';
    </script>
</head>
<body>
<tiles:insertAttribute name="header"/>
<tiles:insertAttribute name="content"/>
<tiles:insertAttribute name="footer"/>
<%--[#MinifyJS="/js/plugins.min.js"]--%>
<coeus:js src="/js/plugins/jquery.form.js"/>
<coeus:js src="/js/plugins/jquery.defaultvalue.js"/>
<coeus:js src="/js/core/message.js"/>
<coeus:js src="/js/plugins/dropkick.min.js"/>
<coeus:js src="/js/plugins/jquery.md5.js"/>
<coeus:js src="/js/plugins/jquery-migrate-1.2.1.min.js"/>
<coeus:js src="/js/plugins/jquery-ui-timepicker-addon.js"/>
<coeus:js src="/js/plugins/jquery.nivo.slider.js"/>
<coeus:js src="/js/plugins/jquery.ztree.all-3.5.min.js"/>
<coeus:js src="/js/validationEngine/languages/jquery.validationEngine-zh_CN.js"/>
<coeus:js src="/js/validationEngine/jquery.validationEngine.js"/>
<coeus:js src="/js/validationEngine/validation.default.js"/>
<coeus:js src="/js/artDialog-5.0.4/source/jquery.artDialog.js"/>
<coeus:js src="/js/artDialog-5.0.4/source/artDialog.plugins.js"/>
<coeus:js src="/js/jscrollpane/jquery.mousewheel.js"/>
<coeus:js src="/js/jscrollpane/jquery.jscrollpane.min.js"/>
<coeus:js src="/js/plugins/jquery.fullPage.js"/>
<coeus:js src="/js/core/query.checkbox.js"/>

<%--[MinifyJS#]--%>
<coeus:js src="/js/plugins/jquery.slides.min.js"/>
<coeus:js src="/js/plugins/Chart.min.js"/>
<!--[if lt IE 10]>
<coeus:js src="/js/plugins/PIE.js"/>
<![endif]-->

<!--[if !IE 9]>
<style>
    .view-shadow {
        filter: alpha(opacity=50);
        background-color: #000;
    }

    .mooc-item:hover {
        filter: alpha(opacity=80);
        background-color: #f2f6f6;
    }

    .search-nav {
        background-color: #b2b2b2;
        filter: alpha(opacity=80);
    }
</style>
<![endif]-->

<!--[if IE9]>
    <style>
        .slider-container .mask-right { left: 0;}
        .slider-container .mask-left { right: 0;}
    </style>
<![endif]-->
<!--[if lt IE 9]>
    <style>
        .slider-container { width: 1000px; }
        .slider-container .heros{ width: 1000px; }
        .slider-container .slider-item, .slider-container .slider-item a{width: 1000px;}
        .slider-container .mask-right { left: 0;}
        .slider-container .mask-left { right: 0;}
    </style>
<![endif]-->
<%--[#MinifyJS="/js/core.min.js"]--%>
<coeus:js src="/js/core/public.js"/>
<coeus:js src="/js/core/pagemark.js"/>
<coeus:js src="/js/core/user.visit.log.js"/>
<%--[MinifyJS#]--%>
<%--[#MinifyJS="/js/uploader/uploader.min.js"]--%>
<coeus:js src="/js/uploader/uploader.js"/>
<%--[MinifyJS#]--%>
<%--[#MinifyJS="/js/plugins2.min.js"]--%>
<coeus:js src="/js/plugins/raphael-min.js"/>
<coeus:js src="/js/plugins/jquery-ui-timepicker-addon.js"/>
<coeus:js src="/js/plugins/jquery.Jcrop.min.js"/>
<%--[MinifyJS#]--%>
<div id="dialog_home" style="display: none"></div>
</body>
</html>
