function clboptLine

global Line
global ButtonBackColor

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

