var image = document.getElementsByClassName("image");
image[0].onmouseover = function() {slide(0)};
image[1].onmouseover = function() {slide(1)};
image[2].onmouseover = function() {slide(2)};
image[3].onmouseover = function() {slide(3)};
image[4].onmouseover = function() {slide(4)};
image[5].onmouseover = function() {slide(5)};
image[6].onmouseover = function() {slide(6)};
image[7].onmouseover = function() {slide(7)};
function slider(i) {...}