function clboptMarker

global Line
global ButtonBackColor

n=length(Line.Marker);
if Line.LastMarker.index == -1
    for i=1:n
        if get(Line.Marker(i).h,'Value') == 1
            Line.LastMarker.index = i;
            Line.LastMarker.h     = Line.Marker(i).h;
            Line.LastMarker.name  = Line.Marker(i).name;
            Line.LastMarker.tag   = Line.Marker(i).tag;
        end
    end
else
    nrActive = 0;
    for i=1:n
        if get(Line.Marker(i).h,'Value') == 1
            nrActive = nrActive + 1;
        end
    end
    if nrActive == 0
        set(Line.Marker(Line.LastMarker.index).h,'Value',1);
    else
        for i=1:n
            if get(Line.Marker(i).h,'Value') == 1 && Line.LastMarker.index == i
                set(Line.Marker(i).h,'Value',0);
            end
        end
        for i=1:n
            if get(Line.Marker(i).h,'Value') == 1
                Line.LastMarker.index = i;
                Line.LastMarker.h     = Line.Marker(i).h;
                Line.LastMarker.name  = Line.Marker(i).name;
                Line.LastMarker.tag   = Line.Marker(i).tag;
            end
        end
    end
end

