Your function changes all instances of the buttons and is called on each rollover. What you want is to create a generic function that toggles the rollover for each button individually. In your html, add a reference to the element:
<a onmouseover="mouseOver([COLOR="SeaGreen"]this[/COLOR]);num=8;slideshow(7);return false">...</a>
Then in your function you know what element you're mousing over at any given time:
function mouseOver(elm) {
var id = elm.id;
}
Of course, a better solution would be to use jQuery to handle your dom events so they are abstracted from the markup.