Have you learned jQuery?
You will need to link the jQuery library in your main html file in between the Head tags
http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js
jQuery allows you to select the class selector and apply the action you want to it.
You are asking to combine 2 actions.
1) Grab an element
2) Apply a click action to that element.
jQuery makes this easy.
jQuery's format is: $('element').effect();
So to answer your question:
$('.over').click();
Note: It would be best to rename your class to associate the color with that .png image, so later on you would know which you were referring to. You have the classname 'over' repeated for several .png images. So the jQuery will select every element with the class 'over' and apply that action to it.
You can also now apply any function to that click event.
So for example:
var color = $('.blue').click(function(){
if(color === blue){
return blue;
}