///报表数据
//function GetOrgDataMap() {
//    var timestart = $("#start").val();
//  
//    var timeend = $("#end").val();
//    var orgid = $('#orgdiv', parent.document).find("span").html(); //获取部门id
//    getAjax("/Training/TeachingMent/GetOrgDataMap.ashx", "orgid=" + orgid + "&&timestart=" + timestart + "&&timeend=" + timeend, function (rs) {
//        if (rs != -1) {
//            $("#container").html(rs);
//        }
//    });
//}

///获取培训考试任务
//function GetPlanAndExam() {
//    var orgid = $('#orgdiv', parent.document).find("span").html(); //获取部门id
//    getAjax("/Training/TeachingMent/GetTeachingPlanAndExam.ashx", "orgid=" + orgid, function (rs) {
//        if (rs != "1") {
//            $("#Rmiddle").html(rs);
//        }
//    });
//}
$(function () {
    GetTeaching();
    GetorgcreditUser();
    GetLogin();
});

(function ($) {
    var $cate = $('#cate'),
        $tri = $('.cate_tri', $cate),
        $drop = $('div.cate_drop', $cate),
        $inp = $('div.cate_inp', $cate);
    $tri.on('click', function (event) {
        var $el = $(this);
        if ($el.data('active') !== 'on') {
            $drop[0].style.display = 'block';
            $el.data('active', 'on');
        } else {
            $drop[0].style.display = 'none';
            $el.data('active', 'off')
        }
    });
    $drop.on('mouseover', 'li', function (event) {
        $inp[0].innerHTML = this.innerHTML;
    }).on('click', 'li', function (event) {
        // do something
        $drop[0].style.display = 'none';
        $tri.data('active', 'off');
        GetorgcreditUser();
        GetTeaching();
       $("#main").attr("src","/Training/TeachingMent/TeachingRight.aspx");    
    });
} (jQuery));


function getAjax(url, parm, callBack) {
    $.ajax({
        type: 'post',
        dataType: "text",
        url: url,
        data: parm,
        cache: false,
        async: false,
        success: function (msg) {
            callBack(msg);
        }
    });
}

///获取各种数据
function GetTeaching() {
    var orgid = $("#orgdiv").find("span").html(); //获取部门id
    getAjax("/Training/TeachingMent/GetTeaching.ashx", "orgid=" + orgid + "&&status=1", function (rs) {
        if (rs != "1") {
            $("#ziyuan").html(rs);
        }
    });
}
///查询部门排名
function Getorgcredit() {
    var orgid = $("#orgdiv").find("span").html(); //获取部门id
    getAjax("/Training/TeachingMent/GetTeaching.ashx", "orgid=" + orgid + "&&status=2", function (rs) {
        if (rs != "1") {
            $("#credit").html(rs);
        }
    });
}
///查询个人学分排名
function GetorgcreditUser() {
    var orgid = $("#orgdiv").find("span").html(); //获取部门id
    getAjax("/Training/TeachingMent/GetTeaching.ashx", "orgid=" + orgid + "&&status=3", function (rs) {
        if (rs != "1") {
            $("#credit").html(rs);
        }
    });
}


//获取登录名
function GetLogin() {
    getAjax("/Mall/Mall_HeadLoginStatus.ashx", "id=2", function (rs) {
        if (rs != "end") {
            $("#login").html(rs);
        }
    });
}



///部门 排名样式
function PaiMingCss(obj) {
    $("#PaiMing").find("a").each(
    function () { $(this).attr("class", ""); }
    );
   
    $(obj).attr("class", "tab_on");
}