What about:

    if (markerIndex < 0) markerIndex = markers.length -1;
    if (markerIndex >= markers.length) markerIndex = 0;

So that the 'goto next marker' keys wrap?