\newif\ifpdf
\ifx\pdfoutput\undefined
  \pdffalse % nie sme v pdfLaTeXu
\else
  \pdfoutput=1 % sme v PDFLaTeX
  \pdftrue
\fi

\ifpdf
  \usepackage[pdftex]{graphicx}
  \DeclareGraphicsRule{*}{eps}{*}{}
\else
  \usepackage[xdvi]{graphicx}
\fi

\makeatletter

\def\@ustav{�stav informatiky}
\newcommand{\ustav}[1]{\def\@ustav{#1}}

%podakovanie
\def\@podakovanie{\@latex@error{Neboli zadane udaje pre \noexpand\podakovanie}\@ehc} 
\newcommand{\podakovanie}[1]{\def\@podakovanie{#1}}

%vyhlasenie
\long\def\@vyhlasenie{
Vyhlasujem, �e som t�to diplomov� pr�cu
vypracoval samostatne, na z�klade vedomost�
z�skan�ch �t�diom a s pomocou uvedenej literat�ry.
} 
\newcommand{\vyhlasenie}[1]{\def\@vyhlasenie{#1}}

\renewcommand\maketitle{%
\begin{titlepage}
  \newpage
  \null
  \vspace*{-20mm}
  \begin{center}
  {\large \sffamily 
  Pr�rodovedeck� fakulta Univerzity Pavla Jozefa �af�rika v Ko�iciach

  \@ustav{}\\[-0.4cm]
  \rule{\textwidth}{1pt}

  }
  \vspace*{6cm}
  %{\Large \sffamily #1}
  {\Large \sffamily \slshape \@author}

  \vspace*{1cm}
  {\Huge \sffamily \bfseries \@title\\[0.2cm]}
  {\Large \sffamily \bfseries diplomov� pr�ca}       
  \vfill

  \ifpdf
    \includegraphics[scale=.7]{upjs.pdf}
  \else
    \includegraphics[scale=.7]{upjs.eps}            
  \fi

  \vfill

  {\sffamily \bfseries \@date}

  \end{center}
\end{titlepage} 
% dalsia strana ide pre podakovanie
\newpage\thispagestyle{empty}
\par
\null
\vfill
\par
\begin{center}
\begin{minipage}{15cm}
\centerline{{\large\bfseries Po�akovanie}}\par\bigskip
\@podakovanie
\par
\end{minipage}
\end{center}
\vskip2cm
% a dalsia strana ide pre vyhlasenie
\newpage\thispagestyle{empty}
\par
\null
\vfill
\begin{center}
\begin{minipage}{15cm}
\centerline{{\large\bfseries Vyhl�senie}}\par\bigskip
\@vyhlasenie
\par
\bigskip
\null\hfill
\hbox{%
  \vbox{%
    \hbox to5cm {\leaders\hrule\hfil}\par
    \hbox to5cm{\hfil\@author\hfil}
  }%
}  
\end{minipage}
\end{center}
}

%----------------------redefine \chapter and \chapter*
\newlength{\textwidthni}
%\@makechapterhead used on numbered chapters (see classes.dtx)
\def\@makechapterhead#1{%
  \hbox to \textwidth{%
  \leaders\hrule height8pt depth-7pt \hfil \ \ \Huge{\textbf{\thechapter}}
  \leaders\hrule height8pt depth-7pt \hskip1cm
  }
  \par
  \vskip3\bigskipamount    
  {%
    \textwidthni = \textwidth
    \advance\textwidthni by -\parindent
    \parbox{\textwidthni}{%
      \baselineskip=1.7\baselineskip
      \rightskip = 0pt plus 1fill
      \exhyphenpenalty=10000
      \hyphenpenalty=10000
      {\huge \bfseries #1}
    }%
  }%
  \par
  \vskip6\bigskipamount  
}
%\@makeschapterhead used on unnumbered chapters
\def\@makeschapterhead#1{%
  \hbox to \textwidth{%
  \leaders\hrule height8pt depth-7pt \hfil
  }
  \par
  \bigskip
  \bigskip  
  {%        
    \textwidthni = \textwidth
    \advance\textwidthni by -\parindent
    \parbox{\textwidthni}{%
      \baselineskip=1.7\baselineskip
      \rightskip = 0pt plus 1fill
      \exhyphenpenalty=10000
      \hyphenpenalty=10000
      {\huge \bfseries #1}
    }%
  }%
  \par
  \vskip6\bigskipamount  
}

\makeatother
