Procura de valores em array

function in_array(needle, haystack, strict) {
// Checks if the given value exists in the array
//
// version: 810.114

// + original by: Kevin van Zonneveld
// * example 1: in_array('van', ['Kevin', 'van', 'Zonneveld']);
// * returns 1: true
var found = false, key, strict = !!strict;

for (key in haystack) {
if ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle)) {
found = true;
break;
}
}

return found;
}