jQuery.fn.ie6BugDialog = function(p_gb, p_options) {
    var opts = $.extend({}, $.ie6BugDialog.defaults, p_options);

    this.each(function() {
        if ("show" == p_gb)
        {
            //$.ie6BugDialog.show(opts, this);
            $.ie6BugDialog.show(opts, this);
        }
        else if ("close" == p_gb)
        {
            //$.ie6BugDialog.close(opts, this);
            $.ie6BugDialog.close(opts, this);
        }
    });

    return this;
}

jQuery.ie6BugDialog = {
    defaults: {
        parent: $("body")
    },
    show: function(p_opts, p_this) {
        var wdgtFrame = null;
        if ($.browser.msie && parseFloat($.browser.version) < 7.0)
        {
            // we put a styled iframe behind the calendar so HTML SELECT elements don't show through
            wdgtFrame = $("<iframe></iframe>")
                                .attr("id", $(p_this).attr("id") + "_frame")
                                .attr("border", 0)
                                .attr("frameborder", 0)
                                .attr("src", "about:blank")
                                .css({
                                        position: "absolute",
                                        top: 0,
                                        left: 0,
                                        zIndex: -1
                                     });

            $(p_this).append(wdgtFrame);
        }

        p_opts.parent.append($(p_this));
        if (wdgtFrame != null)
        {
            wdgtFrame.css({
                            width: $(p_this).outerWidth()-2,
                            height: $(p_this).outerHeight()-2
                          });
        }
    },
    close: function(p_opts, p_this) {
        var wdgtFrame = $("#" + $(p_this).attr("id") + "_frame");

        $(p_this).remove();
        if (0 < wdgtFrame.length)
        {
            wdgtFrame.remove();
        }
    }
}
