In a large saucepan combine vinegar, white sugar, brown sugar, cinnamon, ground ginger, allspice, cloves, nutmeg, chile peppers and salt. Bring to a boil; boil for 1/2 hour.
Stir in onions, garlic, golden raisins, raisins and ginger and boil for another 1/2 hour.
Stir in mangos (and almonds if using), reduce heat to low and simmer for 1/2 hour. Pour mixture into sterilized jars, to 1/2 inch below lid level, and seal.