% Copyright 2006 Konstantin Korikov <lostclus@ua.fm>
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2003/12/01 or later.
%
% This work has the LPPL maintenance status "maintained".
% 
% This Current Maintainer of this work is Konstantin Korikov.
%
% This work consists of all files listed in manifest.txt.
%

%
% This is automaticaly generated file, do not edit it.
%

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{espdtitle}[2010/01/14 v0.98 Title GOST 2.105]

\RequirePackage{espdstamp}
\RequirePackage{espdlang}
\RequirePackage{espdinfo}
\RequirePackage{espdtotal}
\RequirePackage{espdtitlebase}
\RequirePackage{ifthen}

\newcommand{\ESPD@title@split@field}[2]{%
  \parbox[t]{.4\hsize}{\raggedright#1}\hfill
  \parbox[t]{.4\hsize}{\raggedright#2}}

\renewcommand{\ESPDtheTitleFieldI}{%
  \ESPDtheDepartment\par\ESPDtheCompany}

\def\ESPDtheTitleFieldIIl{}
\renewcommand{\ESPDtheTitleFieldIIl}{%
  \ESPDtheClassCode}
\def\ESPDtheTitleFieldIIr{}
\renewcommand{\ESPDtheTitleFieldIIr}{}
\renewcommand{\ESPDtheTitleFieldII}{%
  \ESPD@title@split@field{\ESPDtheTitleFieldIIl}{\ESPDtheTitleFieldIIr}}

\def\ESPDtheTitleFieldIIIl{}
\renewcommand{\ESPDtheTitleFieldIIIl}{%
  \ifx\ESPD@title@approving@sheet\@undefined
    \expandafter\ifx\csname ESPD@title@agreed@name@1\endcsname\relax\else
      \text{\MakeUppercase{\ESPDagreedName}}\\
      \ESPD@title@make@stamp{agreed}{1}
    \fi
  \else
    \textrm{\MakeUppercase{\ESPDapprovedName}}\\
    \ESPD@title@approving@sheet
  \fi}
\def\ESPDtheTitleFieldIIIr{}
\renewcommand{\ESPDtheTitleFieldIIIr}{%
  \ifx\ESPD@title@approving@sheet\@undefined
    \expandafter\ifx\csname ESPD@title@approved@name@1\endcsname\relax\else
      \text{\MakeUppercase{\ESPDapprovingName}}\\
      \ESPD@title@make@stamp{approved}{1}
    \fi
  \fi}
\renewcommand{\ESPDtheTitleFieldIII}{%
  \ESPD@title@split@field{\ESPDtheTitleFieldIIIl}{\ESPDtheTitleFieldIIIr}}

\renewcommand{\ESPDtheTitleFieldIV}{%
    {\MakeUppercase{\ESPDtheTitle}\par\ESPDtheDocName}%
}

\renewcommand{\ESPDtheTitleFieldV}{}

\renewcommand{\ESPDtheTitleFieldVI}{%
  \MakeUppercase{\ESPDtheSignature}}

\renewcommand{\ESPDtheTitleFieldVIa}{%
  {\ESPDtheFileName}}

%\renewcommand{\ESPDtheTitleFieldVII}{}
\renewcommand{\ESPDtheTitleFieldVII}{\normalfont\cyr\CYRL\cyri\cyrs\cyrt\cyro\cyrv\ \ESPDtotal{page}}

\def\ESPDtheTitleFieldVIIIl{}
\renewcommand{\ESPDtheTitleFieldVIIIl}{%
  \ifx\ESPD@title@approving@sheet\@undefined
    \ESPD@tmpcnta = 1
    \loop
    \ifnum \ESPD@tmpcnta < \ESPD@title@agreed@cnt
      \advance \ESPD@tmpcnta 1
      \ESPD@title@make@stamp{agreed}{\number\ESPD@tmpcnta}
      \par\vspace{5mm}
    \repeat
  \fi}
\def\ESPDtheTitleFieldVIIIr{}
\renewcommand{\ESPDtheTitleFieldVIIIr}{%
  \ifx\ESPD@title@approving@sheet\@undefined
    \ESPD@tmpcnta = 0
    \loop
    \ifnum \ESPD@tmpcnta < \ESPD@title@designed@cnt
      \advance \ESPD@tmpcnta 1
      \ESPD@title@make@stamp{designed}{\number\ESPD@tmpcnta}
      \par\vspace{5mm}
    \repeat
  \fi}
\renewcommand{\ESPDtheTitleFieldVIII}{%
  \ESPD@title@split@field{\ESPDtheTitleFieldVIIIl}{\ESPDtheTitleFieldVIIIr}}

\renewcommand{\ESPDtheTitleFieldX}{\ESPDtheYear}
\renewcommand{\ESPDtheTitleFieldXI}{\cyr\CYRL\cyri\cyrt\cyre\cyrr\cyra}

\renewcommand{\ESPDtitleFontI}{\ESPDfontV}
\renewcommand{\ESPDtitleFontII}{\ESPDfontV}
\renewcommand{\ESPDtitleFontIII}{\ESPDfontV}
\renewcommand{\ESPDtitleFontIV}{\ESPDfontV}
\renewcommand{\ESPDtitleFontV}{\ESPDfontV}
\renewcommand{\ESPDtitleFontVI}{\ESPDfontV}
\renewcommand{\ESPDtitleFontVIa}{\ESPDfontV}
\renewcommand{\ESPDtitleFontVII}{\ESPDfontV}
\renewcommand{\ESPDtitleFontVIII}{\ESPDfontV}
\renewcommand{\ESPDtitleFontX}{\ESPDfontV}
\renewcommand{\ESPDtitleFontXI}{\ESPDfontV}

\renewcommand{\maketitle}{%
  \begin{ESPDtitlePage}
  \setlength{\topsep}{0mm}
  \noindent
  \parbox[c][.28\vsize][t]{\hsize}{%
%    \vspace{5mm \@plus 15mm \@minus 3mm}
%    \begin{center}\ESPDtitleFontI\bfseries\ESPDtheTitleFieldI\end{center}
%    \vspace{5mm \@plus 15mm \@minus 3mm}
%    \begin{center}\ESPDtitleFontII\ESPDtheTitleFieldII\end{center}}
    \vspace{5mm \@plus 15mm \@minus 3mm}
	\begin{center}\ESPDtitleFontIII\ESPDtheTitleFieldIII\end{center}}
  \par\vspace{10mm \@plus 2mm \@minus 4mm}\noindent
  \parbox[c][.30\vsize][t]{\hsize}{%
    \ifthenelse{\equal{\ESPDtheTitleFieldIV}{}}{}
	{\begin{center}\ESPDtitleFontIV\ESPDtheTitleFieldIV\end{center}}
    \ifthenelse{\equal{\ESPDtheTitleFieldV}{}}{}
    {\begin{center}\ESPDtitleFontV\ESPDtheTitleFieldV\end{center}}
    \ifthenelse{\equal{\ESPDtheTitleFieldVI}{}}{}
    {\begin{center}\ESPDtitleFontVI\ESPDtheTitleFieldVI\end{center}}
    \ifthenelse{\equal{\ESPDtheTitleFieldVIa}{}}{}
    {\begin{center}\ESPDtitleFontVI\ESPDtheTitleFieldVIa\end{center}}
    \ifthenelse{\equal{\ESPDtheTitleFieldVII}{}}{}
    {\begin{center}\ESPDtitleFontVII\ESPDtheTitleFieldVII\end{center}}}
  \par\vspace{4mm \@plus 2mm \@minus 2mm}\noindent
  \begin{center}\ESPDtitleFontVIII\ESPDtheTitleFieldVIII\end{center}
  \vfill
  \begin{center}\ESPDtitleFontX\ESPDtheTitleFieldX\end{center}
  \begin{flushright}\ESPDtitleFontXI\ESPDtheTitleFieldXI\hspace{20mm}\enspace\end{flushright}% Литера
  \end{ESPDtitlePage}}

