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() {
                $(this).remove();
            });
            var divIframe = $('<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.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", $(obj).offset().top + $(obj).outerHeight() - document.body.scrollTop);
        this.css("left", $(obj).offset().left - document.body.scrollLeft);
    };

    jQuery.getByteLength = function(s) {
        var totalLength = 0;
        var i;
        var charCode;
        for (i = 0; i < s.length; i++) {
            charCode = s.charCodeAt(i);
            if (charCode < 0x007f) {
                totalLength = totalLength + 1;
            } else if ((0x0080 <= charCode) && (charCode <= 0x07ff)) {
                totalLength += 2;
            } else if ((0x0800 <= charCode) && (charCode <= 0xffff)) {
                totalLength += 2;
            }
        }
        return totalLength;
    }
}

/*
 * 作者：顾燕兵
 * 版本：0.1.0
 * */

