This question already has an answer here:
Looking for a way that allow change the product image based on the attribute selected for the configurable product.
Configurable Product With Color Options : 1) Red 2) Green
If the Red is selected by user is should change the main image on the details page with the one from associated products.
Requirement: Is this available in default magento version Or should i use extension?