// **************************************************
// Defines Array.push method if necessary
// Required for ie5.0x and ie5 mac
// **************************************************

if (!Array.prototype.push) {
	Array.prototype.push = function() {
		var startLength = this.length;
		for (var i = 0; i < arguments.length; i++)
			this[startLength + i] = arguments[i];
		return this.length;
	}
}

// **************************************************
// Defines Array.pop method if necessary
// Required for ie5.0x and ie5 mac
// **************************************************

if (!Array.prototype.pop) {
	Array.prototype.pop = function() {
		var len = this.length;
		if (len == 0) return null;
		var last = this[len - 1];
		this.length = len - 1;
		return last;
	}
}

// **************************************************
// Defines Array.shift method if necessary
// Required for ie5.0x and ie5 mac
// **************************************************

if (!Array.prototype.shift) {
	Array.prototype.shift = function() {
		this.reverse();
		var entry = this.pop();
		this.reverse();
		return entry;
	}
}

// **************************************************
// Defines Array.unshift method if necessary
// Required for ie5.0x and ie5 mac
// **************************************************

if (!Array.prototype.unshift) {
	Array.prototype.unshift = function() {
		this.reverse();
		for (var i = 0; i < arguments.length; i++)
			this.push(arguments[i]);
		this.reverse();
		return this.length;
	}
}

