andom = 0, _weight, _newArr = [];
        for (var i = 0; i < arr.length; i++) {
            _weight = arr[i].weight ? parseInt(arr[i].weight) : 1;
            _newArr[i] = [];
            _newArr[i].push(_temp);
            _temp += _weight;
            _newArr[i].push(_temp);
        }
        _random = Math.ceil(_temp * Math.random());
        for (var i = 0; i < _newArr.length; i++) {
            if (_random > _newArr[i][0] && _random <= _newArr[i][1]) {
                return arr[i];
            }
    