(function(a) {
    a.fn.Qbox = function(d) {
        var b = a.extend({
            title: "",
            fadespeed: 1E3,
            width: 300,
            height: 0,
            url: "",
            param: "",
            minTop: 0,
            minWidth: "",
            minHeight: "",
            data: ""
        }, d);
        a("#q_content").remove();
        a(this).append('<div id="overlay"></div><div id="q_content"><div id="title_box"></div><div id="close_box"></div><div id="q_box"></div></div>');
        a("#q_content").css({
            "border": "1px solid #445871",
            position: "fixed",
            display: "none",
            "z-index": "5",
            "box-shadow": "0 0 5px rgba(0,0,0,0.3)"
        });
        a("#q_box").css({
            overflow: "auto",
            height: "auto",
            width: "auto",
            background: "#ffffff",
            color: "#3e3e3e"
        });
        a("#title_box").css({
            "border-bottom": "1px solid #445871",
            "border-top": "1px solid #5e7899",
            color: "#e9e9e9",
            "font-size": "11px",
            "font-weight": "bold",
            padding: "12px",
            background: "#335783",
            "text-shadow": "0 1px 0 rgba(72,93,119,0.7)"
        });
        a("#overlay").css({
            display: "none",
            position: "fixed",
            top: "0",
            left: "0",
            width: "100%",
            height: "100%",
            "z-index": "4",
            background: "#000000",
            opacity: "0.5",
            overflow: "hidden"
        });
        a("#close_box").css({
            position: "absolute",
            right: "15px",
            top: "15px",
            width: "11px",
            height: "11px",
            cursor: "pointer",
            "text-shadow": "none",
            backgroundImage: "url(css/box_del.gif)",
            "-khtml-opacity": "0.7",
            opacity: "0.7"
        });
        a("#close_box").hover(function() {
            a(this).css({
                "-khtml-opacity": "0.9",
                opacity: "0.9"
            })
        }, function() {
            a(this).css({
                "-khtml-opacity": "0.7",
                opacity: "0.7"
            })
        });
        "" != b.url && a.ajax({
            type: "POST",
            url: b.url,
            data: b.param,
            success: function(b) {
                a("#q_box").html(b)
            }
        });
        "" != b.data && a("#q_box").html(b.data);
        a("#title_box").html(b.title);
        d = a(window);
        var e = document.documentElement;
        d.scrollTop();
        var c = a("#q_content");
        0 == b.height ? a("#q_box").css("height", c.height() + "px") : a("#q_box").css("height", b.height + "px");
        a("#q_box").css("width", b.width + "px");
        "" !== b.minHeight && a("#q_box").css("min-height", b.minHeight + "px").css("height", "auto");
        a("#overlay").css("display", "block");
        a("#overlay").css({
            height: e.clientHeight
        });
        a("#overlay").css({
            width: d.width()
        });
        a("#overlay").css("top", 0);
        a("#close_box").click(function() {
            c.fadeOut(b.fadespeed, function() {
                a("#q_content").remove();
                a("#q_box").remove();
                a("#title_box").remove();
                a("#close_box").remove();
                a("#box_bg").remove();
                a("#overlay").remove()
            });
            return !1
        });
        c.css({
            left: (a(window).width() - c.outerWidth()) / 2 - 8
        }).css({
            top: 100 + 'px'
        });
        c.fadeIn(b.fadespeed, function() {
            c.show()
        })
    }
})(jQuery);

function box_close() {
    $("#q_box").remove();
    $("#title_box").remove();
    $("#close_box").remove();
    $("#box_bg").remove();
    $("#q_content").remove();
    $("#overlay").remove()
};