Japanese firm to buy Intelligroup