var circulateArray = function (array) {
this.array = Object.prototype.toString.call(array) === '[object Array]' ? array : [];
this.index = 0;
};
circulateArray.prototype.add = function (element) {
if (element !== undefined) this.array.push(element);
};
circulateArray.prototype.reset = function () {
this.index = 0;
};
circulateArray.prototype.hasMoreElement = function () {
return this.index < this.array.length;
};
circulateArray.prototype.nextElement = function () {
return this.array[this.index++];
};