function GUIprace(akce)

if nargin < 1
    akce = 'init';
end

switch akce
    case 'init'
        sz = get(0,'ScreenSize');

        figure('position',[round(sz(3)/2), round(sz(4)/2), 300 150],...
               'tag','fig','WindowButtonMotionFcn','GUIprace(''pohyb'')');
        
        uicontrol('unit','normalized',...
                  'style','text',...
                  'position',[0.1 0.6, 0.8 0.25],...
                  'String','Jsi spokojeny se svoji praci?',...
                  'fontsize',12,...
                  'backgroundcolor',[0.8 0.8 0.8],...
                  'callback','GUIdemo(''ano'')',...
                  'tag','text');
        
        % tlacitko ano
        uicontrol('unit','normalized','style','pushbutton',...
                  'position',[0.05 0.2, 0.4 0.3],...
                  'String','ano','fontsize',12,...
                  'callback','GUIprace(''ano'')','tag','ano');
        
        % tlacitko ne
        uicontrol('unit','normalized','style','pushbutton',...
                  'position',[0.55 0.2, 0.4 0.3],...
                  'String','ne','fontsize',12,'tag','ne');
        
    case 'ano'
        set(findobj('tag','fig'),'WindowButtonMotionFcn','');
        set(findobj('tag','text'),'string','To je dobre! :-)','fontsize',16);
        set(findobj('tag','ano'),'visible','off');
        set(findobj('tag','ne'),'visible','off');
        pause(1);
        delete(gcf);
        
    case 'pohyb'
        fig = findobj('tag','fig');
        pos = get(fig,'position');
        xy = get(fig,'currentpoint');
        xy = [xy(1)/pos(3), xy(2)/pos(4)];
        if(abs(xy(1)-0.75) < 0.22 && abs(xy(2)-0.35) < 0.17)
            sz = get(0,'ScreenSize');
            set(fig,'position',[round(sz(3)/2)+sz(3)*(rand-0.5)/2,...
                        round(sz(4)/2)+sz(4)*(rand-0.5)/2, 300 150]);
        end
end