<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ExamIntroduce.aspx.cs"
    Inherits="RM.Web.Training.Exam.ExamIntroduce" %>

<!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 runat="server">
    <title></title>
    <link href="Themes/Css/ExamGlobal.css" rel="stylesheet" type="text/css" />
    <link href="Themes/Css/ExamIntroduceCss.css" rel="stylesheet" type="text/css" />
    <script src="../../Themes/Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="../../Themes/Scripts/artDialog/artDialog.js" type="text/javascript"></script>
    <script src="../../Themes/Scripts/artDialog/iframeTools.js" type="text/javascript"></script>
    <script src="../../Themes/Scripts/FunctionJS.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {

            var examKey = QueryString("ExamKey");

            if (!examKey || examKey.length < 1) {
                showTipsMsg("<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ChapterList_ymxxbzq")%>", 4000, 5);
            }
            $("#btnStartExam").click(function () {
                if (!examKey || examKey.length < 1) {
                    showTipsMsg("<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ChapterList_ymxxbzq")%>", 3000, 5);
                    return false;
                }
                if(window.parent.frames["main"] != undefined){}else {var winRef = window.open("", "_blank");}
                $("#handleIcon").fadeIn(100);
                $.ajax({
                    url: "CreateExam.ashx",
                    type: "post",
                    data: { "ExamKey": examKey, "EPKey": QueryString("EPKey") },
                    dataType: "text",
                    success: function (data) {
                        var result = data ? parseInt(data) : -1;
                        if (result == -3) {
                            top.showTipsMsg("<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Examination_sjsjsjychxst")%>", 4000, 5);
                        } else if (result < 0) {
                            top.showTipsMsg("<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ChapterList_ymxxbzq")%>", 2000, 5);
                        } else {                            
                            if(window.parent.frames["main"] != undefined)
                            {
//                            alert(1);
                                window.parent.frames["main"].location = "/Training/Exam/Examination.aspx?exam=<%=Request["exam"] %>&HashKey=" + data + "&&EPKey=" + QueryString("EPKey")+"&&NewExam=isok";
                            }else{
//                            alert(2);
                             setTimeout(winRef.location="/Training/Exam/Examination.aspx?exam=<%=Request["exam"] %>&HashKey=" + data + "&&EPKey=" + QueryString("EPKey")+"&&NewExam=isok",800);
                              OpenClose();
//                            $("#form2").attr("href","/Training/Exam/Examination.aspx?exam="+QueryString("exam")+"&&HashKey="+data+"&&EPKey="+QueryString("EPKey"));
                            document.getElementById("form2").click();
                           // $("#form2").click();
                           }    
                                                  
                          if(top.art!=undefined){
                            var list = top.art.dialog.list; //关闭上层所有的对话框
                                for (var i in list) {
                                    list[i].close();
                                }
                          }
                        }
                        $("#handleIcon").fadeOut(100);
                    },
                    error: function () {
                        top.showTipsMsg("<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ChapterList_ymxxbzq")%>", 2000, 5);
                        $("#handleIcon").fadeOut(100);
                    }
                });
            });
            $("#continueClick").click(function () {
                if ($(this).attr("data") == "" || $(this).attr("data").length < 1){return false;}
                if(window.parent.frames["main"] != undefined){}else {var winRef2 = window.open("", "_blank");}
              //$("#form2").attr("href","/Training/Exam/Examination.aspx?exam=<%=Request["exam"] %>&HashKey=" + $(this).attr("data") + "&&EPKey=" + QueryString("EPKey"));
  //document.getElementById("form2").click();
                if(window.parent.frames["main"] != undefined){
//                            alert(1);
                    window.parent.frames["main"].location = "/Training/Exam/Examination.aspx?exam=<%=Request["exam"] %>&HashKey=" + $(this).attr("data") + "&&EPKey=" + QueryString("EPKey");
                }else{
//                            alert(2);
                    setTimeout(winRef2.location="/Training/Exam/Examination.aspx?exam=<%=Request["exam"] %>&HashKey=" +  $(this).attr("data") + "&&EPKey=" + QueryString("EPKey")+"&&NewExam=isok",800);
                    OpenClose();
//                            $("#form2").attr("href","/Training/Exam/Examination.aspx?exam="+QueryString("exam")+"&&HashKey="+data+"&&EPKey="+QueryString("EPKey"));
                    document.getElementById("form2").click();
                           // $("#form2").click();
                } 
                if(top.art!=undefined){
                    var list = top.art.dialog.list; //关闭上层所有的对话框
                    for (var i in list) {
                        list[i].close();
                    }
                }
                return false;
            });
            //查询禁止学员
             getAjax("/Training/ExamPlan/NewGetExamPlanUserList.ashx", "status=7&examid=" + QueryString("ExamKey") + "&key=" + QueryString("EPKey"), function (rs) {
            if (rs == 1) {
                $("#btnStartExam").hide();
                $("#continueClick").hide();
                $("#promptTxt").append("<lable><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("StopTest")%></lable>");
            }
        });
        });
    </script>
</head>
<body>
<a href="" id="form2" target="_blank"></a>
 <%--   <form id="form1" action="/Training/Exam/Examination.aspx" target="_blank" method="post">
    <input name="exam" id="exam" type="hidden" />
    <input name="HashKey" id="HashKey" type="hidden" />
    <input name="EPKey" id="EPKey" type="hidden" />
    </form>--%>
    <div id="exam_Priview">
        <div id="exam_Title">
            <h1 id="Exam_TitleInfo" runat="server">
                无</h1>
        </div>
        <div id="exam_Context">
            <fieldset id="exam_Info">
                <legend>
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ExamIntroduce_kjxx")%></legend>
                <ul id="examInfo">
                    <li>
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Credit_User_Date")%>：<label runat="server"
                            id="Exam_StartDate"></label>
                        ～
                        <label id="Exam_EndDate" runat="server">
                        </label>
                    </li>
                    <li>
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ExamIntroduce_kssc")%>：<label runat="server"
                            id="Exam_SumDate"></label>
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Courseware_Minute")%></li>
                    <li>
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Examination_ExamCount")%>：<label
                            runat="server" id="Exam_SumCount"></label></li>
                    <li>
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("MyExamPlan-sjzf")%>：<label runat="server"
                            id="Exam_SumScore"></label>
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ChapterList_fen")%></li>
                    <li>
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("MyExamPlan-jgfs")%>：<label runat="server"
                            id="Exam_PassScore"></label>
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ChapterList_fen")%></li>
                    <li>
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("MyExamPlan-sjlx")%>：<label runat="server"
                            id="Exam_Type"></label>
                    </li>
                </ul>
            </fieldset>
            <fieldset id="exam_Matter">
                <legend>
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ExamIntroduce_ksxz")%></legend>
                <ol id="exma_Notice">
                    <li>
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ExamIntroduce_ksdxgzthczxx")%></li>
                    <li>
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ExamIntroduce_ycssjmgtmdth")%></li>
                    <li>
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ExamIntroduce_dtjsjdjcyxsj")%></li>
                </ol>
            </fieldset>
            <fieldset id="examDiscription">
                <legend>
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ExamIntroduce_kjsm")%></legend>
                <div class="exam_DisContext">
                    <pre id="exam_DisContext" runat="server"></pre>
                </div>
            </fieldset>
            <div id="btnBar">
                <span id="promptTxt" runat="server"></span><a href="javascript:void(0)" id="btnStartExam"
                    runat="server" class="examLink2">
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ExamIntroduce_kjsm")%></a>
                <a href="javascript:void(0)" id="continueClick" runat="server" class="examLink3"
                    style="display: none;">
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ExamIntroduce_jxks")%></a>
                <a href="javascript:void(0)" id="btnCloseWindow" onclick="OpenClose();" class="examLink3">
                    &nbsp;<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Close")%>&nbsp;</a>
            </div>
        </div>
    </div>
    <div id="handleIcon">
        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("CorrectExam_loading")%></div>
</body>
</html>
