Array.prototype.in_array = function(p_val){ for(var i = 0;i < this.length;i++) { if(this[i] == p_val) { return true; } } return false; }