function HBArray(name) { //初始化属性
    this.name = name;      //对象名称
    this.list_par = []; //选择的图片ID列表
}
//返回数数
HBArray.prototype.SetArray = function(newarray) {
    this.list_par = newarray;
}
//返回数数
HBArray.prototype.GetArray = function() {
    return this.list_par;
}
//清理数数
HBArray.prototype.ClearArray = function() {
    this.list_par = new Array();
}
//返回数数
HBArray.prototype.GetArrayToString = function() {
    return this.list_par.toString();
}
//返回数数
HBArray.prototype.GetArrayLength = function() {
    return this.list_par.length;
}
//返回数数
HBArray.prototype.GetArrayIndex = function(i_) {
    if (this.list_par.length > i_) {
        return this.list_par[i_];
    }
    return null;
}
//返回数数
HBArray.prototype.GetIndex = function(obj_) {
    if (this.list_par.length > 0) {
        for (var i = 0; i < this.list_par.length; i++) {
            if (this.list_par[i] == obj_) {
                return i;
            }
        }
    }
    return null;
}

//判断是否存在于列表中
HBArray.prototype.InArray = function(obj_) {
    obj_ = this.GetObj(obj_);
    var rtf_ = false;
    if (this.list_par.length > 0) {
        for (var i = 0; i < this.list_par.length; i++) {
            if (this.list_par[i] == obj_) {
                rtf_ = true;
                break;
            }
        }
    }
    return rtf_;
}
//返回参数的小写
HBArray.prototype.GetObj = function(obj_) {
    if (typeof (obj_) == "string") {
        return obj_.toLowerCase();
    }
    return obj_;
}
//将图片添加到列表中
HBArray.prototype.AddArray = function(obj_) {
    obj_ = this.GetObj(obj_);
    if (this.list_par.length > 0) {
        var inimg_ = false;
        for (var i = 0; i < this.list_par.length; i++) {
            if (this.list_par[i] == obj_) {
                inimg_ = true;
                break;
            }
        }

        if (!inimg_) {
            this.list_par.push(obj_); //添加
        }
    }
    else {
        this.list_par.push(obj_); //添加
    }
}
//将图片从列表中删除
HBArray.prototype.DelArray = function(obj_) {
    obj_ = this.GetObj(obj_);
    if (this.list_par.length > 0) {
        if (this.list_par.length == 1 && this.list_par[0] == obj_) {
            this.ClearArray();
        }
        else {
            var inimg_ = -1;
            for (var i = 0; i < this.list_par.length; i++) {
                if (this.list_par[i] == obj_) {
                    inimg_ = i;
                    break;
                }
            }

            if (inimg_ != -1) {
                this.list_par.splice(inimg_, 1); //删除数组项
            }
        }
    }
}
//删除数组里的项
HBArray.prototype.DelIndex = function(index_) {
    if (this.list_par.length > 0 && index_ < this.list_par.length) {
        this.list_par.splice(inimg_, 1); //删除数组项
    }
}