Changing gmap marker icons while onclick

Is there any way to change gmap marker icon while onclick and get back its original icon while clicking another marker or map. Suppose, In my gmap, I'm showing events in different colors(icon's). while clicking a marker the icon should change to yellow and should get back its original color when clicking another marker on the map.

One of the Google Maps API groups may be able to help.

https://groups.google.com/forum/#!forum/google-maps-api https://groups.google.com/forum/#!forum/google-maps-js-api-v3