function coeffsno=sel3dcoeff(handles,coeffs)
ResultSel=get(handles.popupmenu6,'String');
CurrentResult=ResultSel{get(handles.popupmenu6,'Value')};
IndApprox = strfind(CurrentResult, 'approx');
IndDetail = strfind(CurrentResult, 'detail');
if ~isempty(IndApprox)
    coeffsno=1;
elseif ~isempty(IndDetail)
    TypeLev=sscanf(CurrentResult,'%*s %*s %d %*s %d',[1,Inf]);
    Type=TypeLev(1); Lev=TypeLev(2);
    if length(coeffs)==8
        coeffsno=Type+1;
    elseif (length(coeffs)==15 && Lev==2)
        coeffsno=Type+1;
    elseif (length(coeffs)==15 && Lev==1)
        coeffsno=Type+8;
    elseif (length(coeffs)==22 && Lev==3)
        coeffsno=Type+1;
    elseif (length(coeffs)==22 && Lev==2)
        coeffsno=Type+8;
    elseif (length(coeffs)==22 && Lev==1)
        coeffsno=Type+15;
    end
end