Replace Array.indexOf() with jQuery.inArray() for older browsers (IE<9)