checkCompletion = function() {
            if (successes + failures === expected) {
                if (successes) {
                    if (_this._firstOpen || !_this.preserveViewport) {
                        _this.viewport.goHome( true );
                        _this.viewport.update();
                    }

                    _this._firstOpen = false;

                    var source = tileSources[0];
                    if (source.tileSource) {
                        source = source.tileSource;
                    }

                    // Global overlays
                    if( _this.overlays && !_this.preserveOverlays ){
                        for ( var i = 0; i < _this.overlays.length; i++ ) {
                            _this.currentOverlays[ i ] = getOverlayObject( _this, _this.overlays[ i ] );
                        }
                    }

                    _this._drawOverlays();
                    _this._opening = false;

                    /**
                     * Raised when the viewer has opened and loaded one or more TileSources.
                     *
                     * @event open
                     * @memberof OpenSeadragon.Viewer
                     * @type {object}
                     * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.
                     * @property {OpenSeadragon.TileSource} source - The tile source that was opened.
                     * @property {?Object} userData - Arbitrary subscriber-defined object.
                     */
                    // TODO: what if there are multiple sources?
                    _this.raiseEvent( 'open', { source: source } );
                } else {
                    _this._opening = false;

                    /**
                     * Raised when an error occurs loading a TileSource.
                     *
                     * @event open-failed
                     * @memberof OpenSeadragon.Viewer
                     * @type {object}
                     * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.
                     * @property {String} message - Information about what failed.
                     * @property {String} source - The tile source that failed.
                     * @property {?Object} userData - Arbitrary subscriber-defined object.
                     */
                    _this.raiseEvent( 'open-failed', failEvent );
                }
            }
        }
Open tiled images into the viewer, closing any others.
To get the TiledImage instance created by open, add an event listener for
{@link OpenSeadragon.Viewer.html#.event:open}, which when fired can be used to get access
to the instance, i.e., viewer.world.getItemAt(0).
@function
@param {Array|String|Object|Function} tileSources - This can be a TiledImage
specifier, a TileSource specifier, or an array of either. A TiledImage specifier
is the same as the options parameter for {@link OpenSeadragon.Viewer#addTiledImage},
except for the index property; images are added in sequence.
A TileSource specifier is anything you could pass as the tileSource property
of the options parameter for {@link OpenSeadragon.Viewer#addTiledImage}.
@param {Number} initialPage - If sequenceMode is true, display this page initially
for the given tileSources. If specified, will overwrite the Viewer's existing initialPage property.
@returns {OpenSeadragon.Viewer} Chainable.
@fires OpenSeadragon.Viewer.event:open
@fires OpenSeadragon.Viewer.event:open-failed