﻿$(function() {

    $('.helpinfo').css({ cursor: 'pointer' }).click(function() {
        if ($('#msgbox').size() == 0) {
            $("<div id='msgbox' style='display:none;position:absolute;padding:0;left:0;top:0;width:600px;border:2px solid #93845f;background-color:#FFFFCC;'><p style='margin:0;margin-bottom:10px;background-color:#93845f;line-height:30px;padding:0 5px;color:#ffeea8;'><span style='display:block;float:right;cursor:pointer'><a style='color:#FFF;' onclick=\"$('#msgbox').fadeOut();\">Close</a></span><span>"+$('.content_inner h1:eq(0)').text()+"</span></p><div id='helpbody' style='padding:0 5px;height:300px;overflow:auto;word-wrap:wrap'>載入中...</div></div>").appendTo('body');
            $('#msgbox').css({ top: $('.helpinfo').offset().top - 0, left: $('.helpinfo').offset().left - 0 }).fadeIn();
            //$('#helpbody').html(window.location.href.substring(window.location.href.lastIndexOf('/')+1 ));
            $.post("../helpfile.ashx", { urlmapping: encodeURIComponent(window.location.href.substring(window.location.href.lastIndexOf('/') + 1)) }, function(data) {
                $('#helpbody').html(data);
            });
        }
        else { // exists
            $('#msgbox').fadeIn();
        }
    });

    $('table tr:odd').addClass('stripped');

});

function CheckAll(check) {
    with (document.forms[0]) {
        for (i = 0; i < elements.length; i++)
            if (elements[i].type == "checkbox" && elements[i].name.indexOf("CheckBox1") >= 0) elements[i].checked = check;
    }
}
