ie8 compatibility, replace indexOf by using $.inArray

ie 8