src/openseadragon.js
function( array, searchElement, fromIndex ) {
            if ( Array.prototype.indexOf ) {
                this.indexOf = function( array, searchElement, fromIndex ) {
                    return array.indexOf( searchElement, fromIndex );
                };
            } else {
                this.indexOf = function( array, searchElement, fromIndex ) {
                    var i,
                        pivot = ( fromIndex ) ? fromIndex : 0,
                        length;
                    if ( !array ) {
                        throw new TypeError( );
                    }

                    length = array.length;
                    if ( length === 0 || pivot >= length ) {
                        return -1;
                    }

                    if ( pivot < 0 ) {
                        pivot = length - Math.abs( pivot );
                    }

                    for ( i = pivot; i < length; i++ ) {
                        if ( array[i] === searchElement ) {
                            return i;
                        }
                    }
                    return -1;
                };
            }
            return this.indexOf( array, searchElement, fromIndex );
        }
function( array, searchElement, fromIndex ) {
            if ( Array.prototype.indexOf ) {
                this.indexOf = function( array, searchElement, fromIndex ) {
                    return array.indexOf( searchElement, fromIndex );
                };
            } else {
                this.indexOf = function( array, searchElement, fromIndex ) {
                    var i,
                        pivot = ( fromIndex ) ? fromIndex : 0,
                        length;
                    if ( !array ) {
                        throw new TypeError( );
                    }

                    length = array.length;
                    if ( length === 0 || pivot >= length ) {
                        return -1;
                    }

                    if ( pivot < 0 ) {
                        pivot = length - Math.abs( pivot );
                    }

                    for ( i = pivot; i < length; i++ ) {
                        if ( array[i] === searchElement ) {
                            return i;
                        }
                    }
                    return -1;
                };
            }
            return this.indexOf( array, searchElement, fromIndex );
        }
function ( array , searchElement , fromIndex ) { if ( Array . prototype . indexOf ) { this . indexOf = function ( array , searchElement , fromIndex ) { return array . indexOf ( searchElement , fromIndex ) ; } ; } else { this . indexOf = function ( array , searchElement , fromIndex ) { var i , pivot = ( fromIndex ) ? fromIndex : 0 , length ; if ( ! array ) { throw new TypeError ( ) ; } length = array . length ; if ( length === 0 || pivot >= length ) { return - 1 ; } if ( pivot < 0 ) { pivot = length - Math . abs ( pivot ) ; } for ( i = pivot ; i < length ; i ++ ) { if ( array [ i ] === searchElement ) { return i ; } } return - 1 ; } ; } return this . indexOf ( array , searchElement , fromIndex ) ; }
Find the first index at which an element is found in an array or -1
if not present.

Code taken and adapted from
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf#Compatibility

@function
@param {Array} array The array from which to find the element
@param {Object} searchElement The element to find
@param {Number} [fromIndex=0] Index to start research.
@returns {Number} The index of the element in the array.
Find the first index at which an element is found in an array or - 1 if not present .