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.!forum/google-maps-api!forum/google-maps-js-api-v3