ie8 compatibility, replace indexOf by using $.inArray