Iterator = function(array) {
var _array = array;
var _current = 0;
this.setArray = function(array) {
_array = array;
if (_current > (_array.length - 1)) {
_current = _array.length;
}
};
this.get = function() {
return _array[_current];
};
this.current = function() {
return _current;
};
this.next = function() {
return (_current != (_array.length - 1)) ? _current++ : false;
};
this.prev = function() {
return (_current != 0) ? _current-- : false;
};
this.reset = function() {
_current = arguments[0] ? parseInt(arguments[0]) : 0;
};
this.slice = function(from /*, to*/) {
return _array.slice(from, arguments[1]);
};
};