You're going to need to create the marker, and then place the listener on the created marker. e.g.
var theMarker;
var icon2 = "imageB.png";
var originalIcon;
switch(mark + ' ' + style)
{
case 'blue one':
theMarker = new google.maps.Marker({
position: new google.maps.LatLng(lat,lng),
map:map,
icon:'blue1.png'
});
originalIcon = 'blue1.png';
break;
case 'blue two':
theMarker = new google.maps.Marker({
position: new google.maps.LatLng(lat,lng),
map:map,
icon:'blue2.png'
});
originalIcon = 'blue2.png';
}
google.maps.event.addListener(theMarker, 'mouseover', function()
{
theMarker.setIcon(icon2);
});
google.maps.event.addListener(theMarker, 'mouseout', function()
{
theMarker.setIcon(originalIcon );
});