I want to create a function so that someone can choose a different color of a product.

For am example of what I'm talking about is like Amazon's page: http://goo.gl/og7qji

When you click on a different color, it will automatically change the price and set that color to the one your want.

Not sure if this is created with PHP or javascript, so any help would be appreciated.