\def\booktitle{\mbox{}}

\def\reffont{}
\renewcommand{\reffont}{\bf}
\setlength{\codeindent}{0pt}

\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}

%	Paragraph layout

\parskip .7em   % Extra vertical space between paragraphs.
\parindent 0pt  % Width of paragraph indentation.
\itemsep 0em    % Extra vertical space, in addition to
 		% \parskip, added between list items.
\topsep 0pt     % Extra vertical space, in addition to 
                % \parskip, added above and below list and
                % paragraphing environments.
\partopsep 0pt  % Extra vertical space, in addition to 
                % \parskip and \topsep, added when user
                % leaves blank line before environment.

\let\oldobeylines=\obeylines
\def\obeylines{\oldobeylines\parskip 0pt}

%\setlength{\topmargin}{1cm - 1in}
%\setlength{\oddsidemargin}{3.8cm - 1in}
%\setlength{\evensidemargin}{2.8cm - 1in}
%\textheight 19cm
%\textwidth 11.5cm
%\headheight 14pt
%\setlength{\headsep}{1cm - \headheight}
%\setlength{\footskip}{1.5cm -\baselineskip}

\providecommand{\setupfancyplain}{%
    \renewcommand{\chaptermark}[1]{\markboth{\thechapter:\ ##1}{\thechapter:\ ##1}}%
    \renewcommand{\sectionmark}[1]{\markright{\thesection:\ ##1}}}

\lhead[\fancyplain{}{\bf\thepage}]{\fancyplain{}{\bf\rightmark}}
\rhead[\fancyplain{}{\bf\leftmark}]{\fancyplain{}{\bf\thepage}}
\lfoot[\bf \runningtitle]{\bf User's Guide}
\rfoot[\bf User's Guide]{\bf \runningtitle}

\footrulewidth 0pt
\headrulewidth 0pt

%----------------------------------------------------------------------
%  Chapters
%----------------------------------------------------------------------

\def\@makechapterhead#1{             % Heading for \chapter command
  \vspace*{0pt}                      % Space at top of text page.
  { \parindent 0pt \raggedright 
    \ifnum \c@secnumdepth >\m@ne     % IF secnumdepth > -1 THEN
    \begin{minipage}{\headwidth}
      \rule[0pt]{\headwidth}{2pt}
      \par\vskip 4pt
      \parbox[b]{\headwidth}{\centering
        \baselineskip .33in {\Huge\bf\thechapter: \MakeUppercase{#1}}}
      \par\vskip -3pt
      \rule[0pt]{\headwidth}{2pt}
    \end{minipage}
    \fi
    \vskip 20pt
    \nobreak                         % TeX penalty to prevent pagebreak.
  } } 

\def\@makeschapterhead#1{	     % Heading for \chapter* command
  \vspace*{0pt}                      % Space at top of page.
  \markboth{\booktitle}{#1}
  { \parindent 0pt \raggedright 
    \begin{minipage}{\headwidth}
      \rule[0pt]{\headwidth}{2pt}
      \par\vskip 4pt
      \parbox[b]{\headwidth}{\centering
        {\Huge\bf\MakeUppercase{#1}}}
      \par\vskip -3pt
      \rule[0pt]{\headwidth}{2pt}
    \end{minipage}
    \nobreak                         % TeX penalty to prevent page break.
    \vskip 30pt                      % Space between title and text.
 }}

% Put a line under each section header ...

%\let\@ld@sect\@sect
%\let\@ld@ssect\@ssect
%\def\@sect#1#2#3#4#5#6[#7]#8{\@ld@sect{#1}{#2}{#3}{#4}{#5}{#6}[#7]{#8}%
%   \unskip\strut\par \nobreak\vskip .5ex \hrule}
%\def\@ssect#1#2#3#4#5{\@ld@ssect{#1}{#2}{#3}{#4}%
%   {#5\unskip\strut\par \nobreak\vskip .5ex \hrule}}

\let\@qpxsect=\@xsect
\def\@xsect#1{%
  \@tempskipa #1\relax
  \ifdim \@tempskipa>\z@
%    \nopagebreak\vskip-3ex\rule[0pt]{\linewidth}{1.5pt}%
    \nopagebreak\vskip0.5ex\hrule height 1.5pt%
  \fi
  \@qpxsect{#1}}
\def\@seccntformat#1{\csname the#1\endcsname:\enskip}
