% FILE. . . . . ~hak/Teaching/97.3/cmpt.384/notes/threepart.sty
% EDIT BY . . . Hassan Ait-Kaci
% ON MACHINE. . Chaumes.Cs.Sfu.Ca
% STARTED ON. . Mon Nov  3 17:54:16 1997

% Last modified on Mon Nov 03 21:20:58 1997 by hak

% Identification
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{threepart}

\addtolength{\headheight}{2mm}

\newcommand{\headrule}{\vspace*{2mm}\hrule}%
\newcommand{\footrule}{\hrule\vspace*{2mm}}%

\newcommand{\@topheadings}[3]{%
  \vbox{\hbox to\textwidth{\rlap{#1}\hfil{#2}\hfil\llap{#3}}%
	\headrule}}
\newcommand{\@botheadings}[3]{%
  \vbox{\footrule%
        \hbox to\textwidth{\rlap{#1}\hfil{#2}\hfil\llap{#3}}}}

\newcommand{\@lehead}{} \newcommand{\@lohead}{}
\newcommand{\@cehead}{} \newcommand{\@cohead}{}
\newcommand{\@rehead}{} \newcommand{\@rohead}{}

\newcommand{\lehead}{\renewcommand{\@lehead}}
\newcommand{\lohead}{\renewcommand{\@lohead}}
\newcommand{\cehead}{\renewcommand{\@cehead}}
\newcommand{\cohead}{\renewcommand{\@cohead}}
\newcommand{\rehead}{\renewcommand{\@rehead}}
\newcommand{\rohead}{\renewcommand{\@rohead}}

\newcommand{\lhead}[1]{\lehead{#1}\lohead{#1}}
\newcommand{\chead}[1]{\cehead{#1}\cohead{#1}}
\newcommand{\rhead}[1]{\rehead{#1}\rohead{#1}}

\newcommand{\@lefoot}{} \newcommand{\@lofoot}{}
\newcommand{\@cefoot}{} \newcommand{\@cofoot}{}
\newcommand{\@refoot}{} \newcommand{\@rofoot}{}

\newcommand{\lefoot}{\renewcommand{\@lefoot}}
\newcommand{\lofoot}{\renewcommand{\@lofoot}}
\newcommand{\cefoot}{\renewcommand{\@cefoot}}
\newcommand{\cofoot}{\renewcommand{\@cofoot}}
\newcommand{\refoot}{\renewcommand{\@refoot}}
\newcommand{\rofoot}{\renewcommand{\@rofoot}}

\newcommand{\lfoot}[1]{\lefoot{#1}\lofoot{#1}}
\newcommand{\cfoot}[1]{\cefoot{#1}\cofoot{#1}}
\newcommand{\rfoot}[1]{\refoot{#1}\rofoot{#1}}

\newcommand{\ps@threepart}{%
  \renewcommand{\@oddhead}{%
    \@topheadings{\@lohead}{\@cohead}{\@rohead}}%
  \renewcommand{\@evenhead}{%
    \@topheadings{\@lehead}{\@cehead}{\@rehead}}%
  \renewcommand{\@oddfoot}{%
    \@botheadings{\@lofoot}{\@cofoot}{\@rofoot}}%
  \renewcommand{\@evenfoot}{%
    \@botheadings{\@lefoot}{\@cefoot}{\@refoot}}}
\ps@threepart
