\catcode`@11
\newcounter{algorithm}[chapter]
\def\fps@algorithm{tbp}
\def\ftype@algorithm{2}
\def\ext@algorithm{lot}
\def\fnum@algorithm{Algorithm \thealgorithm}
\def\algorithm{\@float{algorithm}}
\let\endalgorithm\end@float
\@namedef{algorithm*}{\@dblfloat{algorithm}}
\@namedef{endalgorithm*}{\end@dblfloat}

\newcounter{boxfloat}[chapter]
\def\fps@boxfloat{tbp}
\def\ftype@boxfloat{2}
\def\ext@boxfloat{lot}
\def\fnum@boxfloat{Box \theboxfloat}
\def\boxfloat{\@float{boxfloat}}
\let\endboxfloat\end@float
\@namedef{boxfloat*}{\@dblfloat{boxfloat}}
\@namedef{endboxfloat*}{\end@dblfloat}

%%% Added by Suresh Kumar 04/04 %%%%%%%%%%% but does not work
% make all floats share a common counter
\newcounter{floatseq}[chapter]

% DOES NOT WORK because the object ``\thetable'' is used many times (eg in the table of contents entry), and you
%   only want the number to be incremented once per new caption.
%\renewcommand \thefigure{\protect\refstepcounter{floatseq}\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@floatseq} 
%\renewcommand \thetable{\protect\refstepcounter{floatseq}\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@floatseq} 
%\def\thealgorithm{\protect\refstepcounter{floatseq}\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@floatseq}

\renewcommand \thefigure{\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@floatseq} 
\renewcommand \thetable{\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@floatseq} 
\def\thealgorithm{\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@floatseq}
\def\theboxfloat{\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@floatseq}

% my fix.
% This fix requires that every fig, tab, alg should have a caption,
% because the counter gets incremented whatever.

\renewenvironment{figure}
               {\stepcounter{algorithm}\stepcounter{table}\stepcounter{floatseq}\stepcounter{boxfloat}\@float{figure}}
               {\end@float}
\renewenvironment{table}
               {\stepcounter{figure}\stepcounter{algorithm}\stepcounter{boxfloat}\stepcounter{floatseq}\@float{table}}
               {\end@float}
\renewenvironment{algorithm}
               {\stepcounter{figure}\stepcounter{table}\stepcounter{boxfloat}\stepcounter{floatseq}\@float{algorithm}}
               {\end@float}
\renewenvironment{boxfloat}
               {\stepcounter{figure}\stepcounter{algorithm}\stepcounter{table}\stepcounter{floatseq}\@float{boxfloat}}
               {\end@float}

\catcode`@12



