/*jshint
asi: true,
unused: true,
boss: true,
loopfunc: true,
eqnull: true
*/
/*!
* Legacy browser support
*/
// Map array support
if ( ![].map ) {
Array.prototype.map = function ( callback, self ) {
var array = this, len = array.length, newArray = new Array( len )
for ( var i = 0; i < len; i++ ) {
if ( i in array ) {
newArray[ i ] = callback.call( self, array[ i ], i, array )
}
}
return newArray
}
}
// Filter array support
if ( ![].filter ) {
Array.prototype.filter = function( callback ) {
if ( this == null ) throw new TypeError()
var t = Object( this ), len = t.length >>> 0
if ( typeof callback != 'function' ) throw new TypeError()
var newArray = [], thisp = arguments[ 1 ]
for ( var i = 0; i < len; i++ ) {
if ( i in t ) {
var val = t[ i ]
if ( callback.call( thisp, val, i, t ) ) newArray.push( val )
}
}
return newArray
}
}
// Index of array support
if ( ![].indexOf ) {
Array.prototype.indexOf = function( searchElement ) {
if ( this == null ) throw new TypeError()
var t = Object( this ), len = t.length >>> 0
if ( len === 0 ) return -1
var n = 0
if ( arguments.length > 1 ) {
n = Number( arguments[ 1 ] )
if ( n != n ) {
n = 0
}
else if ( n !== 0 && n != Infinity && n != -Infinity ) {
n = ( n > 0 || -1 ) * Math.floor( Math.abs( n ) )
}
}
if ( n >= len ) return -1
var k = n >= 0 ? n : Math.max( len - Math.abs( n ), 0 )
for ( ; k < len; k++ ) {
if ( k in t && t[ k ] === searchElement ) return k
}
return -1
}
}
/*!
* Cross-Browser Split 1.1.1
* Copyright 2007-2012 Steven Levithan