/*
max by ProgramMax is licensed under a Creative Commons Attribution 3.0 Unported License:
http://creativecommons.org/licenses/by/3.0/

To learn more visit http://www.programmax.net/projects/max
*/

if( typeof max == "undefined" ) {
	var max = { };
}

if( typeof max.prototype == "undefined" ) {
	max.prototype = function( ) {

		var returning = { };

		if( typeof window.netscape != "undefined" ) { // window.netscape is available in all Gecko browsers
			returning.getArrayFromNodeList = function( parameters ) {
				max.common.checkParameters({
					"parameters.nodeList": {
							value: parameters.nodeList,
							type: Object
					}
				});

				return Array.prototype.slice.call( parameters.nodeList );
			}
		} else {
			returning.getArrayFromNodeList = function( parameters ) {
				max.common.checkParameters({
					"parameters.nodeList": {
							value: parameters.nodeList,
							type: Object
					}
				});

				elements = new Array( );

				var Length = parameters.nodeList.length;
				for( var i = 0; i < Length; ++i ) {
					elements.push( parameters.nodeList[ i ] );
				}

				return elements;
			}
		}

		return returning;

	}();

	if( ! Array.prototype.indexOf ) {
		Array.prototype.indexOf = function( elt /*, from*/ ) {
			var Length = this.length;

			for( var i = 0; i < Length; ++i ) {
				if( this[ i ] === elt ) {
					return i;
				}
			}

			return -1;
		};
	}
}
