\RequirePackage{vmargin}
\RequirePackage{palatino}
\RequirePackage{latexsym}
\RequirePackage{ifthen}
\RequirePackage{czech}

\pagestyle{empty}

\setpapersize{A4}
% \setmarginsrb{leftmargin}{topmargin}{rightmargin}{bottommargin}% 
%              {headheight}{headsep}{footheight}{footskip}
\setmarginsrb{1in}{1in}{1in}{1in}
             {0pt}{0pt}{0pt}{0pt}

\renewcommand{\thefootnote}{\fnsymbol{footnote}}

\newcommand{\vs}[1][1]{%
    \vskip #1\baselineskip}

\newcommand{\titul}[1]{%
    \begin{center}\scshape
        \large #1\\[1ex]
        \small Fakulta Informatiky, Masarykova Universita v~Brn�
    \end{center}}

\newcommand{\cast}[2]{%
    \vs
    \hrule height 1.5mm
    \medskip
    \leftline{\normalsize\textbf{#1}}%
    \ifthenelse{\equal{#2}{}}{}{%
        \footnotesize\noindent\ignorespaces #2\par}\normalsize
    \vs}

\newcommand{\polozka}[4][l]{\footnotesize
    \vtop{%
        \hbox{#4}
        \vs[.5]
        \hrule width #2
        \vs[.5]
        \hbox{%
            \ifthenelse{\equal{#1}{l}}{}{\hss}%
            \ignorespaces #3
            \ifthenelse{\equal{#1}{r}}{}{\hss}}
    \vs}}

\newcommand{\id}[3]{
    \cast{Identifika�n� �daje}{}
    \hbox to \linewidth{%
        \polozka[l]{.4\linewidth}{P��jmen�}{\large #1}
        \polozka[l]{.4\linewidth}{Jm�no}{\large #2}}
    \hbox to \linewidth{%
        \polozka[l]{.4\linewidth}{�koln� rok}{\large #3}
        \hss}}

\newcommand{\idram}[8]{
    \cast{Identifika�n� �daje}{}
    \hbox to \linewidth{%
        \polozka[l]{.45\linewidth}{P��jmen�}{\large #1}
        \polozka[l]{.45\linewidth}{Jm�no}{\large #2}}
    \hbox to \linewidth{%
        \polozka[l]{.45\linewidth}{�kolitel}{\large #3}
        \polozka[l]{.45\linewidth}{Konzultant}{\large #4}}
    \hbox to \linewidth{%
	\polozka[1]{\linewidth}{Obor PGS}{\large #5}}
    \hbox to \linewidth{%
	\polozka[1]{.25\linewidth}{Studium zah�jeno dne}{\large #6}
	\hspace{5mm}
	\polozka[1]{.25\linewidth}{Studium ukon�eno dne}{\large #7}
	\hss
	\polozka[1]{.25\linewidth}{Forma studia}{\large #8}}
%        \hss}
    }

\newcommand{\idstip}[4]{
    \cast{Identifika�n� �daje}{}
    \hbox to \linewidth{%
        \polozka[l]{.45\linewidth}{P��jmen�}{\large #1}
        \polozka[l]{.45\linewidth}{Jm�no}{\large #2}}
    \hbox to \linewidth{%
        \polozka[l]{.45\linewidth}{Rodn� ��slo}{\large #3}
        \polozka[l]{.45\linewidth}{Ro�n�k studia}{\large #4}}
        %\hss}
    }

\newcommand{\preruseni}[4]{
    \vs
    \leftline{\normalsize\textbf{P�eru�en� studia}}
    \vs
    \hbox to \linewidth{%
        \polozka[l]{.22\linewidth}{Studium p�eru�eno od}{\large #1}
	\hspace{5mm}
        \polozka[l]{.18\linewidth}{do}{\large #2}
	\hss
        \polozka[l]{.22\linewidth}{Studium p�eru�eno od}{\large #3}
	\hspace{5mm}
        \polozka[l]{.18\linewidth}{do}{\large #4}}
    }

\newcommand{\pgsid}[4]{
    \cast{Identifika�n� �daje}{}
    \hbox to \linewidth{%
        \polozka[l]{.4\linewidth}{P��jmen�}{\large #1}
        \polozka[l]{.4\linewidth}{Jm�no}{\large #2}}
    \hbox to \linewidth{%
        \polozka[l]{.4\linewidth}{�koln� rok}{\normalsize #3}
        \polozka[l]{.4\linewidth}{�kolitel}{\normalsize #4}}}

\newcommand{\podpisy}[3]{
    \cast{Podpisy}{}
    \hbox to \linewidth{%
        \polozka[l]{.3\linewidth}{V Brn� dne}{\normalsize #1}
        \polozka[l]{.3\linewidth}{Podpis studenta}{#2}}
    \hbox to \linewidth{%
        \hss
        \polozka[l]{.3\linewidth}{Podpis �kolitele}{#3}}}

\newcommand{\podpisyram}[4]{
    \cast{Podpisy}{}
    \hbox to \linewidth{%
        \polozka[l]{.3\linewidth}{Podpis studenta}{#1}
        \polozka[l]{.3\linewidth}{Podpis �kolitele}{#2}}
    \hbox to \linewidth{%
        \polozka[l]{.3\linewidth}{Schv�leno oborovou radou dne}{#3}
        \polozka[l]{.3\linewidth}{Podpis p�edsedy oborov� rady}{#4}}}

\newcommand{\pgspodpis}[1]{
    \cast{}{}
    \hbox to \linewidth{%
        \polozka[l]{.3\linewidth}{Datum}{\normalsize #1}
        \polozka[l]{.3\linewidth}{Podpis �kolitele}{}}
    }

\newcommand{\predmet}[6][]{%
    \vs[.5]
    \ifthenelse{\equal{#1}{text}}{%
        \hbox to \linewidth{%
            \polozka[l]{.4\linewidth}{P�edm�t (k�d)}{#2} \hss
            \polozka[l]{10mm}{Kredity}{#3} \hss
            \polozka[l]{15mm}{Ukon�en�}{#4} \hss
            \polozka[l]{10mm}{\textbf{Datum}}{#5} \hss
            \polozka[l]{15mm}{V�sledek\footnotemark}{#6}}}{%
        \hbox to \linewidth{%
            \polozka[l]{.4\linewidth}{}{#2} \hss
            \polozka[l]{10mm}{}{#3} \hss
            \polozka[l]{15mm}{}{#4} \hss
            \polozka[l]{10mm}{}{#5} \hss
            \polozka[l]{15mm}{}{#6}}}}

\newcommand{\aktivita}[2]{%
    \medskip
    \leftline{\bf #1}
    \ifthenelse{\equal{#2}{}}{}{%
        \indent\ignorespaces #2\par\smallskip}}
