function promoteoverlay(fig)
%PROMOTEOVERLAY  Plot Editor helper function
%   Put the Scribe overlay axis back on top

%   Copyright 1984-2000 The MathWorks, Inc. 
%   $Revision: 1.12 $  $Date: 2000/06/01 02:52:04 $


axH=findall(fig,'type','axes');
if ~isempty(axH)
    overlay=double(find(handle(axH),'-class','graph2d.annotationlayer'));
    if isempty(overlay)
        overlay = findall(axH,'Tag','ScribeOverlayAxesActive');
    end
    
    if ~isempty(overlay)
        axes(overlay);
    end
end
