

Array.prototype.unshift = Array.prototype.unshift || function(){

	var nieuw, i;
	
	nieuw = [];

	for(i = 0; i < arguments.length; i++){ nieuw[nieuw.length] = arguments[i];}
	for(i = 0; i < this.length; i++){ nieuw[nieuw.length] = this[i];}

	this.length = 0;

	for(i = 0; i < nieuw.length; i++){ this[i] = nieuw[i];}

	return this.length;
};

Array.prototype.shift = Array.prototype.shift || function(){

	var nieuw, eerste_item, i;

	if(this.length == 0){ return null;}

	nieuw = [];
	eerste_item = this[0];

	for(i = 1; i < this.length; i++){ nieuw[nieuw.length] = this[i];}
	
	this.length = 0;

	for(i = 0; i < nieuw.length; i++){ this[i] = nieuw[i];};

	return eerste_item;
};

Array.prototype.splice = Array.prototype.splice || function(){

	var nieuw, verwijderd, i;

	verwijderd = [];
	nieuw = [];

	for(i = arguments[0]; i < arguments[0] + arguments[1]; i++){ verwijderd[verwijderd.length] = this[i];}
	for(i = 0; i < arguments[0]; i++){ nieuw[nieuw.length] = this[i];}
	for(i = 2; i < arguments.length; i++){ nieuw[nieuw.length] = arguments[i];}
	for(i = arguments[0] + arguments[1]; i < this.length; i++){ nieuw[nieuw.length] = this[i];}

	this.length = 0;

	for(i = 0; i < nieuw.length; i++){ this[i] = nieuw[i];}

	return verwijderd;
};

Array.prototype.push = Array.prototype.push || function(){

	for(var i = 0; i < arguments.length; i++){
		this[this.length] = arguments[i];
	}

	return this.length;
};

Array.prototype.pop = Array.prototype.pop || function(){

	var nieuw, laatste_item, i;

	if(this.length == 0){ return null;}

	nieuw = [];
	laatste_item = this[this.length - 1];

	for(i = 0; i < this.length - 1; i++){ nieuw[nieuw.length] = this[i];}
	
	this.length = 0;

	for(i = 0; i < nieuw.length; i++){ this[i] = nieuw[i];}

	return laatste_item;
};

