if (!Array.prototype.indexOf) {
	Array.prototype.indexOf = function(elt){
		var len = this.length;
		var from = Number(arguments[1]) || 0;
		from = (from < 0) ? Math.ceil(from) : Math.floor(from);
		if (from < 0){
			from += len;
		}
		for (; from < len; from++){
			if (from in this && this[from] === elt){
				return from;
			}
		}
		return -1;
	};
}
if(!Array.prototype.filter){
	Array.prototype.filter=function(func){
		var ret=new Array();
		if(typeof(func)!="function"){
			throw new TypeError();
		}
		var thisp=arguments[1];
		for(var i=0;i<this.length;i++){
			if(i in this){
				var val=this[i];
				if(func.call(thisp,val,i,this)){
					ret.push(this[i]);
				}
			}
		}
		return ret;
	};
}
if (!Array.prototype.map) {
	Array.prototype.map = function(fun /*, thisp*/) {
		var len = this.length;
		if (typeof fun != "function") throw new TypeError();
		var res = new Array(len);
		var thisp = arguments[1];
		for (var i = 0; i < len; i++) {
			if (i in this){
				res[i] = fun.call(thisp, this[i], i, this);
			}
		} 
		return res;
	};
}

