ie8 compatibility fix

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