Removed indexOf polyfill in favor of jQuery's inArray method.