

// Constructor
extransit.MenuItemFactory = function() {
};

// Inherit
extransit.MenuItemFactory.prototype = new Object();

// Constants


// Public functions

extransit.MenuItemFactory.prototype.init = function(parent, items) {

    this.items = items;
    this.nextItem = 0;

    this.parentNode = jQuery('#' + parent).get(0);

    this.setupDone = false;
};


extransit.MenuItemFactory.prototype.hasNext = function() {

    return this.nextItem < this.items.length;
};


extransit.MenuItemFactory.prototype.initItem = function(item) {
};


extransit.MenuItemFactory.prototype.next = function() {

    var itemId = this.items[this.nextItem++];

    var node = jQuery('#' + itemId).get(0);

    var result = {id: itemId,  // Item identifier
        node: node   // DOM node representing this item
    };

    this.initItem(result);

    return result;
};

