\RequirePackage{pdf}

\ifpdf
  \RequirePackage[pdftex]{graphicx}
\else
  \RequirePackage[dvips]{graphicx}
\fi

\newcommand{\posfig}[4][width=\textwidth]
{%
  \ifx\flabelprefix\undefined\def\flabelprefix{figure}\fi
  \begin{figure*}[#2]%
    \centering%
    \includegraphics[#1]{#3}%
    \caption{#4}%
    \label{\flabelprefix:#3}%
  \end{figure*}%
}

\newcommand{\fig}[3][width=\textwidth] {\posfig[#1]{tbp}{#2}{#3}}
