//验证数字
function IsDigits(value) {

    if (value)
        return !isNaN(value);


    return true;
}


(function($) {

    //验证数字
    $.IsDigits = function(value) {

        if (value)
            return !isNaN(value);


        return true;
    };

    //定位
    $.getPostion = function(obj) {
        var actualTop = obj.offsetTop;
        var actualLeft = obj.offsetLeft;

        var current = obj.offsetParent;

        while (current !== null) {
            actualTop += current.offsetTop;
            actualLeft += current.offsetLeft;
            current = current.offsetParent;
        }

        return { left: actualLeft, right: actualLeft + obj.offsetWidth, top: actualTop, bottom: actualTop + obj.offsetHeight };

    };

    $.extend(Array.prototype, {


        remove: function(eqfunction) {

            var $tempA = [];

            if (!eqfunction) {
                eqfunction = function() { return true };
            }

            while (pitem = this.pop()) {

                if (eqfunction(pitem))
                    break
                $tempA.push(pitem)
            }

            while (ptemp = $tempA.pop()) {
                this.push(ptemp);
            }


            //            for (var q = 0; q < this.length; q++) {
            //                alert(this[q].Name);
            //            }


        },

        isExist: function(eqfunction) {

            var isExist = false;

            if (!eqfunction)
                eqfunction = function() { return false };

            for (var i = 0; i < this.length; i++) {

                if (eqfunction(this[i])) {
                    var isExist = true;
                    break;
                }

            }

            return isExist;

        }
    });

} (jQuery));

