if (typeof jQuery !== "undefined" && jQuery) {
    jQuery.iframeDecorateDiv = function(divObj) {
        if (jQuery.browser.msie && jQuery.browser.version < 7) {
            var div = jQuery(divObj);
            div.find("iframe[id*=_iframeDecorateDiv_]").each(function() {
                jQuery(this).remove();
            });
            var divIframe = jQuery('<iframe/>');
            divIframe.attr("id", "_iframeDecorateDiv_" + new Date().getTime());
            divIframe.attr("border", "0");
            divIframe.attr("frameborder", "no");
            divIframe.css("position", "absolute");
            divIframe.css("display", "block");
            divIframe.css("src", "about:blank");
            divIframe.css("z-index", "-1");
            divIframe.css("border", "0px solid");
            divIframe.css("top", (div.innerHeight() - div.outerHeight()) / 2);
            divIframe.css("left", (div.innerWidth() - div.outerWidth()) / 2);

            try {
                divIframe.css("width", div.outerWidth());
                divIframe.css("height", div.outerHeight());
            } catch(e) {
            }
            divIframe.css("filter", "mask(color=#a09261)");
            div.append(divIframe);
        }
    };

    jQuery.createStyle = function(style) {
        var styleEl = document.createElement("style");
        styleEl.type = "text/css";

        var head = document.getElementsByTagName("head")[0];
        head.appendChild(styleEl);

        if (styleEl.styleSheet) {
            styleEl.styleSheet.cssText = style;
        } else {
            styleEl.appendChild(document.createTextNode(style));
        }
    };

    jQuery.isDate = function(date) {
        return ((typeof date == "object") && (date.constructor == Date) && !isNaN(date));
    };

    jQuery.isArray = function(array) {
        return ((typeof array == "object") && (array.constructor == Array));
    };

    jQuery.isInputText = function(inputText) {
        return ((typeof inputText == "object") && (jQuery(inputText).attr("tagName") && jQuery(inputText).attr("tagName").toUpperCase() == 'INPUT') && jQuery(inputText).attr("type").toUpperCase() == 'TEXT');
    };

    jQuery.isBoolean = function(boolean) {
        return (typeof boolean == "boolean");
    };

    jQuery.formatYMD = function(date) {
        if (jQuery.isDate(date)) {
            date.setHours(0);
            date.setMinutes(0);
            date.setSeconds(0);
            date.setMilliseconds(0);
        }
    };

    jQuery.parseDate = function(d) {
        return new Date(d.replace(/-/g, '/'));
    }

    jQuery.oneDayTime = 24 * 60 * 60 * 1000;

    jQuery.date2String = function(date) {
        if (jQuery.isDate(date)) {
            var y = date.getFullYear();
            var m = date.getMonth() + 1;
            var d = date.getDate();
            return '' + y + "-" + (m < 10 ? '0' + m : m) + '-' + (d < 10 ? '0' + d : d);
        } else {
            return null;
        }
    }

    jQuery.mouseXY = {X:0,Y:0};
    jQuery(document).mousemove(function(e) {
        jQuery.mouseXY = {X:(e.pageX || e.clientX),Y:(e.pageY || e.clientY)};
    });

    jQuery.fn.floating = function(obj) {
        var me = this;

        this.css("position", "absolute");
        this.css("zIndex", 9999999);
        this.css("top", jQuery(obj).offset().top + jQuery(obj).outerHeight() - document.body.scrollTop);
        this.css("left", jQuery(obj).offset().left - document.body.scrollLeft);
    };

    jQuery.fn.mask = function() {
        try {
            var me = jQuery(this);
            var mask = jQuery("<div style='filter:alpha(opacity = 0);opacity:0;-moz-opacity:0;'></div>");
            mask.appendTo(jQuery("body"));
            mask.css("position", "absolute");
            mask.css("zIndex", 9999999);
            mask.css("background-color", "#000");

            mask.css("top", jQuery(me).offset().top);
            mask.css("left", jQuery(me).offset().left);
            mask.width(jQuery(me).width());
            mask.height(jQuery(me).height());

            jQuery.iframeDecorateDiv(mask);
        } catch(e) {
            alert(e.message);
        }
    };
}

/*
 * 作者：顾燕兵
 * 版本：0.1.0
 * */

