// Constructor
extransit.RadialItemFactory = function(parent, items) {

    this.setupDone = false;
};

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

// Constants


// Public functions

extransit.RadialItemFactory.prototype.initItem = function(item) {

    if (!this.setupDone) {

        this.iX = this.parentNode.offsetLeft;
        this.iY = this.parentNode.offsetTop;

        this.y = 0;
        this.dY = Math.PI * 2 / this.items.length;

        this.setupDone = true;
    }

    // Calculate target position
    var tX = 700 + Math.sin(this.y) * 200;
    var tY = 300 + Math.cos(this.y) * 100;

    this.y += this.dY;

    item.x = this.iX;        // Item current X location
    item.y = this.iY;        // Item current Y location
    item.iX = this.iX;       // Item initial X location
    item.iY = this.iY;       // Item initial Y location
    item.tX = tX;       // Item target X location
    item.tY = tY;       // Item target Y location
};

