% Copyright 2003 by Till Tantau <tantau@users.sourceforge.net>
%
% This program can be redistributed and/or modified under the terms
% of the GNU Public License, version 2.

\mode<presentation>

\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{etoolbox}

\pgfdeclareimage[width=\paperwidth]{titlebackground}{master.jpg}
\pgfdeclareimage[width=\paperwidth]{background}{secondary.jpg}

\setbeamertemplate{background canvas}{%
    \ifnum\c@framenumber=1%
    \begin{picture}(0,0)
 \put(0,-273){%
                \pgfuseimage{titlebackground}
            }
            %\put(0,-130.7){%
         
                %\begin{minipage}[b][45mm][t]{\textwidth}%{226mm}
                %\begin{center}
                   % \usebeamerfont{title}{\MakeTextUppercase{\inserttitle}\par}
                    %\vspace{2ex}
                     %\usebeamerfont{author}{\insertauthor}
                  %   \end{center}
                %\end{minipage}
            %}
            \end{picture}
        % On title page
    \else%
            % Other frames background
            \begin{picture}(0,0)
 \put(0,-273){%
                \pgfuseimage{background}
            }
           \end{picture}
    \fi%
}


\setbeamertemplate{title page}{
\vspace{40pt}
\begin{center}
\usebeamerfont{title} {\huge \inserttitle}\par
\vspace{4ex}
\usebeamerfont{author} {
    \insertauthor 
}\par
\vspace{2ex}
\usebeamerfont{institute}{
    \insertinstitute
} \par
\vspace{2ex}
\usebeamerfont{date}{
    \insertdate
}
\end{center}
}


\setbeamertemplate{frametitle}[default][center]
\setbeamertemplate{frametitle}{
  \makeatletter
  \regexpatchcmd{\insertframetitle}
    {(\c{usebeamertemplate}.*)\c{fi}}
    {\c{NoCaseChange}\cB\{\1\cE\}\c{fi}}
    {}{}%
  \makeatother
  \vskip1ex
  \insertframetitle
}

% Here we define what appears at the bottom of each slide: the "footline".
\setbeamertemplate{footline}{%
  \leavevmode%

  % Horizontal line dividing the rest of the slide from the footer?
  % hrule goes all the way across...
  % \hrule height.3pt%
  % With \rule, you can specify the thickness
  % \rule[raise-height]{width}{thickness}
 % \hspace{.025\textwidth}\rule{.95\textwidth}{.5pt}

  \hbox{%
  \ifnum \thepage>1
    % On the left half of the footer, insert the TACC of
    \begin{minipage}{.2\textwidth}%
      \hskip .05\textwidth%Give horizontal space else this will set on the left edge of the slide!
     % \includegraphics[width=.8\textwidth]{figures/TACC_logo.png}
    \end{minipage}
    
 
    \begin{minipage}{\textwidth}%
     % \vskip .023\textheight%
      \raggedleft%
      \setlength{\rightskip}{\textwidth}
      \hbox{%
      	\begin{beamercolorbox}[wd=0.7\textwidth,ht=2.25ex,dp=1ex,left]{author in head/foot}%
	         \insertshorttitle{} \hskip .01\textwidth | \hskip .01\textwidth \insertdate{} \hskip .01\textwidth  | \hskip .01\textwidth  \insertframenumber{}
  			\end{beamercolorbox}%
			}
		
      %
      % If we are not on the first page, insert a page number
      % For some reason, insertframenumber is buggy when you have fragile
      % slides with verbatim environments in them... it tends to skip numbers
      % for some reason!  On the other hand, the pagenumber is incremented
      % for *every* slide, including transition slides...
        %   \hfill\includegraphics[width=\textwidth]{figures/tacc_ut.png}
    \end{minipage}%
    \begin{minipage}{.05\textwidth}%
    \end{minipage}%
    \fi %\thepage>1
  }%
  \vskip .023\textheight%
   
}




\ifTACCheadernav

\usesectionheadtemplate
{\hfill\insertsectionhead}
{\hfill\color{fg!50!bg}\insertsectionhead}

% Head
\ifbeamer@compress

% Here we define how the top of the frame looks, the "headline".
\setbeamertemplate{headline}
{%
  \ifnum \thepage>1
    \leavevmode%
    \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex]{%
        section in head/foot}%
      \insertsectionnavigationhorizontal{.5\paperwidth}{\hskip0pt plus1filll}{}%
    \end{beamercolorbox}%
    \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex]{%
        subsection in head/foot}%
      \insertsubsectionnavigationhorizontal{%
        .5\paperwidth}{}{\hskip0pt plus1filll}%
    \end{beamercolorbox}%
  \fi %\thepage>1
}

\else% Not compressed

\setbeamertemplate{headline}
{%
  \ifnum \thepage>1
    \leavevmode%
    \@tempdimb=2.4375ex%
    \ifnum\beamer@subsectionmax<\beamer@sectionmax%
      \multiply\@tempdimb by\beamer@sectionmax%
    \else%
      \multiply\@tempdimb by\beamer@subsectionmax%
    \fi%
    \ifdim\@tempdimb>0pt%
      \advance\@tempdimb by 1.125ex%
      \begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{%
          section in head/foot}%
        \vbox to\@tempdimb{\vfil\insertsectionnavigation{.5\paperwidth}\vfil}%
      \end{beamercolorbox}%
      \begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{%
          subsection in head/foot}%
        \vbox to\@tempdimb{\vfil\insertsubsectionnavigation{.5\paperwidth}\vfil}%
      \end{beamercolorbox}%
    \fi%
  \fi % \thepage>1
}

\fi % end if compressed
\fi % TACCheadernav


\ifTACCheadertree

\setbeamertemplate{headline}
{
 \begin{beamercolorbox}[wd=\paperwidth,colsep=1.5pt]{upper separation line head}
 \end{beamercolorbox}
 %
 % Place short title
 %
  \begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex,%
    leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}
    \usebeamerfont{title in head/foot}\insertshorttitle
  \end{beamercolorbox}

 %
 % Place section
 %
  \begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex,%
    leftskip=.3cm,rightskip=.3cm plus1fil]{section in head/foot}
   \usebeamerfont{section in head/foot}%
   %\ifbeamer@tree@showhooks
   \setbox\beamer@tempbox=\hbox{\insertsectionhead}%
   \ifdim\wd\beamer@tempbox>1pt%
   \hskip2pt\raise1.9pt\hbox{\vrule width0.4pt height1.875ex\vrule width 5pt height0.4pt}%
   \hskip1pt%
   \fi
   \insertsectionhead
  \end{beamercolorbox}

%
% Place subsection
%
\begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex,%
  leftskip=.3cm,rightskip=.3cm plus1fil]{subsection in head/foot}
  \usebeamerfont{subsection in head/foot}%
  %\ifbeamer@tree@showhooks
  \setbox\beamer@tempbox=\hbox{\insertsubsectionhead}%
  \ifdim\wd\beamer@tempbox>1pt%
  \hskip9.4pt\raise1.9pt\hbox{\vrule width0.4pt height1.875ex\vrule width 5pt height0.4pt}%
  \hskip1pt%
  \fi
  \insertsubsectionhead
\end{beamercolorbox}

%
% Place final separation box
%
 \begin{beamercolorbox}[wd=\paperwidth,colsep=1.5pt
   ]{lower separation line head}
 \end{beamercolorbox}

 %
 % Another matching rule which helps to frame the content
 %
 \hspace{.025\textwidth}\rule{.95\textwidth}{.5pt}
}
\fi % TACCheadertree


% The following command suppresses all navigation symbols.  This is
% necessary in the TACC theme, since it overlaps where we want the
% logo to be.
\setbeamertemplate{navigation symbols}{}


\mode
<all>
