added isin function to test for membership in array, indexOf is not supported before ie9.