var cWindow_Popup_Incoming = {
    open: function(modal, opener)
    {
        windows[this.name + '_tabs'].setActiveTab(0);

        this.pm = cWindow_Popup.open;
        this.pm(modal, opener);

        window.windows[this.name + '_tab_login'].init();
        window.windows[this.name + '_tab_rpassword'].init();
        window.windows[this.name + '_tab_rconfirm'].init();

        window.windows[this.name + '_tab_login'].setEventListener(this.window_incoming_event_listener);
        window.windows[this.name + '_tab_rconfirm'].setEventListener(this.window_incoming_event_listener);
        window.windows[this.name + '_tab_rpassword'].setEventListener(this.window_incoming_event_listener);
    }
}

function Window_Popup_Incoming(data)
{
    this.position = null;

    this.pc = Window_Popup;
    this.pc(data);

    for (var f in cWindow_Popup_Incoming) {
        this[f] = cWindow_Popup_Incoming[f];
    }

    var _this = this;
    this.window_incoming_event_listener = {
        startSend: function()
        {
            _this.showProcessingAnimation();
        },

        doneSend: function()
        {
            _this.hideProcessingAnimation();
        },

        cancelSend: function()
        {
            _this.close();
        }
    };

    if (data.outside) {
        this.open();
        windows[this.name + '_tabs'].setActiveTab(data.outside_tab);
    }

}
