%% $Id: esoform.cls,v 1.2 2004/02/17 10:14:47 ddorigo Exp $
%%
%% ESOFORM class file (ported from esoform.sty)
%% A M Chavan, ESO, 19-May-2003
%%
%% Copyright 1998-2003 by the European Southern Observatory

\ProvidesClass{esoform}
\LoadClass{article}
\RequirePackage{common2e}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%%      Page 1
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Macro: @MakePageOne
%%
%% Generate page 1 layout for normal programmes.
%%
\def\@MakePageOne{

        \begin{picture}(\@pageWidth,\@pageonelength)

        \makebox(\@pageWidth,\@pageonelength)[tl]{
                \vbox{
                        \MakeHeader
                        \MakeTitle
                        \MakeAbstract
                        \MakeRunsBox

                        \if@keyprg
                                \MakeInvestigator
                        \else
                                \MakeNightBox
                                \MakeSpecialRemarks
                                \MakeInvestigator
                                \MakeThesis
                        \fi     
                        \MakePageNumber
                }
        }

        \end{picture}
        \vfill
        \pagebreak
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%%      Pages 2 and 3
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Macro: @MakePageTwoAndThree
%%
%% Generate page 2 and 3 layout for normal programmes.
%%
\def\@MakePageTwoAndThree{

        \MakeDescriptionPages
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%%      Page 4
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Macro: @MakePageFour
%%
%% Generate page 4 layout for normal programmes.
%%
\def\@MakePageFour{

        \begin{picture}(\@pageWidth,\@pagetwolength)

        \makebox(\@pageWidth,\@pagetwolength)[tl]{
                \vbox{
                        \MakeNightLunarPhase
                        \MakeLastProgramme                      
                        \MakePublications                       
                        \MakePageNumber
                }
        }

        \end{picture}
        \vfill
        \pagebreak
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%%      Page 5
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Macro: @MakePageFive
%%
%% Generate page 5 layout for normal programmes.
%%
\def\@MakePageFive{

        \begin{picture}(\@pageWidth,\@pagetwolength)

        \makebox(\@pageWidth,\@pagetwolength)[tl]{
                \vbox{
                        \MakeTargets
                        \MakePageNumber
                }
        }

        \end{picture}
        \vfill
        \pagebreak
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%%      Page 6
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Macro: @MakePageSix
%%
%% Generate page 6 layout for normal programmes.
%%
\def\@MakePageSix{

        \begin{picture}(\@pageWidth,\@pagetwolength)

        \makebox(\@pageWidth,\@pagetwolength)[tl]{
                \vbox{
                        \MakeRequestedData
                        \MakeSchedulingReq
                        \MakeInstrumentConfBox
                        \MakePageNumber
                }
        }

        \end{picture}
        \vfill
        \pagebreak

        \if@DefAdonis 
                \@MakeAdonisPage 
        \fi

        \if@DefInterferometry
                \@MakeInterferometryPage 
        \fi             
        
}

%% Macro: @MakeAdonisPage
%%
%% Generate ADONIS page layout for normal programmes.
%%
\def\@MakeAdonisPage{

        \begin{picture}(\@pageWidth,\@pagetwolength)

        \makebox(\@pageWidth,\@pagetwolength)[tl]{
                \vbox{
                        \MakeAdonisBox
                        \MakePageNumber
                }
        }

        \end{picture}
        \vfill
        \pagebreak
}

%% Macro: @MakeInterferometryPage
%%
%% Generate Interferometry page layout for normal programmes.
%%
\def\@MakeInterferometryPage{

        \begin{picture}(\@pageWidth,\@pagetwolength)

        \makebox(\@pageWidth,\@pagetwolength)[tl]{
                \vbox{
                        \MakeInterferometryBox
                        \MakePageNumber
                }
        }

        \end{picture}
        \vfill
        \pagebreak
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%%      Visitor Page (Page 7)
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Macro: @MakeVisitorInstrumentPage
%%
%% Generate visitor page layout for normal programmes.
%%
\def\@MakeVisitorInstrumentPage{

        \begin{picture}(\@pageWidth,\@pagetwolength)

        \makebox(\@pageWidth,\@pagetwolength)[tl]{
                \vbox{
                        \MakeVisitorInstrumentBox
                        \MakePageNumber
                }
        }

        \end{picture}
        \vfill
        \pagebreak
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%%      Make all the document
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Macro: MakeProposal
%%
%% Generate all the document for normal programmes.
%%
\def\MakeProposal{

        \@MakePageOne
        \@MakePageTwoAndThree
        \@MakePageFour
        \@MakePageFive
        \@MakePageSix

        \ifx\@emptyValue\@pageVisitorInstrument
        \else
                \@MakeVisitorInstrumentPage
        \fi
}
