
\newif\ifbeamer@jaifat@showhooks
\beamer@jaifat@showhookstrue

\DeclareOptionBeamer{hooks}[true]{\csname beamer@jaifat@showhooks#1\endcsname}
\ProcessOptionsBeamer

\mode<presentation>

\defbeamertemplate*{headline}{jaifat theme}
{%
    \begin{beamercolorbox}[wd=\paperwidth,colsep=1.5pt]{upper separation line head}
    \end{beamercolorbox}

    \begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex,%
      leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}
      \usebeamerfont{title in head/foot}\textbf{\insertshorttitle}
    \end{beamercolorbox}

    \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@jaifat@showhooks
        \setbox\beamer@tempbox=\hbox{\insertsectionhead}%
        \ifdim\wd\beamer@tempbox>1pt%
          \hskip2pt\raise1.9pt\hbox{ \color{black} \vrule width0.6pt height1.6ex\vrule width 5pt height0.6pt}%
          \hskip2pt%
        \fi%
      \else%
        \hskip6pt%
      \fi%
      \textbf{\insertsectionhead}
    \end{beamercolorbox}

    \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@jaifat@showhooks
        \setbox\beamer@tempbox=\hbox{\insertsubsectionhead}%
        \ifdim\wd\beamer@tempbox>1pt%
          \hskip9.4pt\raise1.9pt\hbox{ \color{black} \vrule width0.6pt height1.6ex\vrule width 5pt height0.6pt}%
          \hskip2pt%
        \fi%
      \else%
        \hskip12pt%
      \fi%
      \textbf{\insertsubsectionhead}
    \end{beamercolorbox}

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

\defbeamertemplate*{frametitle}{jaifat}
{%
  \begin{beamercolorbox}[wd=\paperwidth,ht=1.2cm]{frametitle}
    \usebeamerfont*{frametitle}\hspace{3mm}\raisebox{4mm}{\insertframetitle}
      % \hfill\raisebox{-0.6ex}{}
      % \par\vskip-.8ex{\usebeamerfont*{framesubtitle}{\usebeamercolor[fg]{framesubtitle}\insertframesubtitle}\strut\par}%
  \end{beamercolorbox}%
  % \begin{beamercolorbox}[wd=\paperwidth,ht=.5ex,dp=0ex]{empty}
  %   \pgfuseshading{beamer@belowframetitle}%
  % \end{beamercolorbox}%
}

\defbeamertemplate*{footline}{jaifat}
{
  \leavevmode%
  \hbox{\hspace{.8\paperwidth}
    \begin{beamercolorbox}[wd=.2\paperwidth,ht=2.25ex,dp=1ex,right]{footer_color}%
      % \hspace*{3em}
      \insertframenumber{} / \inserttotalframenumber\hspace*{3ex}
    \end{beamercolorbox}
  }%
  \vskip0pt%
}

%% remove the navigation bar
\usenavigationsymbolstemplate{}

\mode
<all>
