ie8 compatibility fix

indexOf method not supported by ie8, replaced by $.inArray()