%%
%% This is file `aeblayers.def',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% aeb_pro.dtx  (with options: `copyright,aeblayers')
%% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% aeb_pro.sty package,                  2006-9-08      %%
%% Copyright (C) 2006  D. P. Story                      %%
%%   dpstory@acrotex.net                                %%
%%                                                      %%
%% This program can redistributed and/or modified under %%
%% the terms of the LaTeX Project Public License        %%
%% Distributed from CTAN archives in directory          %%
%% macros/latex/base/lppl.txt; either version 1 of the  %%
%% License, or (at your option) any later version.      %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newif\ifaeb@ocOn \aeb@ocOntrue
\ifaeb@ocOn
\AtBeginDocument{%
\headerps@out{%
{/OCProcSet /ProcSet findresource} stopped not
{/initialize get exec}
{
/BeginOC /pop load def
/EndOC {} def
/SimpleOC /pop load def
/SetOCGInitState {pop pop} bind def
/OCEndPage {} def
/SetOCGIntent {pop pop} bind def
/SetOCGUsage {pop pop} bind def
/AddASEvent {pop pop pop} bind def
}
ifelse
}
}\fi
\ifaeb@ocOn
    \AtEndDocument{\literalps@out{{/OCProcSet /ProcSet findresource
    /terminate get exec} stopped pop}}
\fi
\begin{insDLJS}[getxBld]{aebocg}{AeB Pro: OCG Support}
var ocgs = this.getOCGOrder();
var xBlds = new Array();
console.println("Reindexing ocgs and creating xBlds");
if ( ocgs != null ) {
    var l = ocgs.length;
    for ( i=0; i<l; i++ ) {
        if (ocgs[0].name.substring(0,3) == "xb." )
            xBlds.push(ocgs.shift());
        else ocgs.push(ocgs.shift());
    }
}
var assocxLayers = new Array();
if ( xBlds != null ) {
    for ( var i=0; i<xBlds.length; i++)
        assocxLayers[xBlds[i].name]=i;
}
function getxBld (name) {
    var i = assocxLayers["xb."+name];
    return ( i == undefined ) ? null : xBlds[i];
}
function toggleHelp (name)
{
    var o = getxBld(name);
    if ( o != null ) o.state = (event.name.indexOf("Enter") != -1);
}
function toggleSetThisLayer(name, bState) {
    var oLayer = getxBld(name);
    if ( oLayer != null )
        oLayer.state = (arguments.length > 1) ? bState : !oLayer.state;
}
function getLayerState(name) {
    var oLayer = getxBld(name);
    return ( oLayer != null ) ? oLayer.state : null;
}
\end{insDLJS}
\newsavebox{\aebsavehelp}
\newcommand{\texHelpIndicator}[1]{#1\thinspace${}^{\mbox
    {\footnotesize\negthinspace\ding{109}}\raisebox{.225ex}
    {\llap{\color{webblue}\tiny?\hspace{1.3ex}}}}$}
\newcommand{\texHelp}[2]{%
    \sbox{\aebsavehelp}{\texHelpIndicator{#2}}%
    \makebox[0pt][l]{\pushButton[\S{S}\BG{}\BC{}\H{N}
    \AA{\AAMouseEnter{\JS{toggleHelp("#1")}}%
    \AAMouseExit{\JS{toggleHelp("#1");}}}]{#1}{\wd\aebsavehelp}{11bp}}%
    \usebox{\aebsavehelp}%
}
\newcommand{\pdfHelpIndicator}[1]{#1\thinspace${}^{\mbox
    {\footnotesize\negthinspace\ding{109}}%
    \raisebox{.225ex}{\llap{\color{webblue}\tiny?\hspace{1.3ex}}}}$}
\newcommand{\pdfHelp}[3]{%
    \sbox{\aebsavehelp}{\pdfHelpIndicator{#3}}%
    \makebox[0pt][l]{\makespecialJS\pushButton[\S{S}\BG{}\BC{}\H{N}
    \TU{#2}]{#1}{\wd\aebsavehelp}{11bp}}\usebox{\aebsavehelp}%
}
\newif\ifaeb@SimpleOCOn \aeb@SimpleOCOnfalse
\newcommand{\@SOC}[2][false]{\global\aeb@SimpleOCOntrue%
    \ifaeb@ocOn\literalps@out{(#2) SimpleOC (#2) #1 SetOCGInitState}\fi}
\newcommand{\b@OC}[2][false]{\ifaeb@SimpleOCOn\@aebSimpleNesterror\fi
    \ifaeb@ocOn\literalps@out{(#2) BeginOC (#2) #1 SetOCGInitState}\fi}
\newcommand{\e@OC}{\ifaeb@ocOn\literalps@out{EndOC}\fi}
\newcommand{\xBld}[2][false]{\b@OC[#1]{xb.#2}}
\let\eBld=\e@OC
\def\@aebSimpleNesterror{\PackageWarning{aeb}
{The scope of the last \string\Bld\space command
\MessageBreak includes the scope of the nested Bld.
\MessageBreak Executing \protect\ocOff\space to correct this.
\MessageBreak The problem occurs}\ocOff}
\long\def\defineRC#1#2{\expandafter\def\csname RC#1\endcsname{#2}}
\def\insertRC#1{\csname RC#1\endcsname}
\@ifundefined{ifeqforpaper}{\newif\ifeqforpaper \eqforpaperfalse}{}
\@ifundefined{ifeq@proofing}{\newif\ifeq@proofing \eq@proofingfalse}{}
\ifeqforpaper
    \ifeq@proofing
        \includecomment{rollover}
        \includecomment{printRollover}
        \let\definePR\defineRC
        \long\def\definePR#1#2{%
            \expandafter\def\csname PR#1\endcsname{#2}}
        \def\insertPR#1{\csname PR#1\endcsname
            \expandafter\let\csname PR#1\endcsname\relax}
    \else
        \includecomment{printRollover}
        \excludecomment{rollover}
        \let\definePR\defineRC
        \long\def\definePR#1#2{%
            \expandafter\def\csname PR#1\endcsname{#2}}
        \def\insertPR#1{\csname PR#1\endcsname
            \expandafter\let\csname PR#1\endcsname\relax}
    \fi
\else
    \ifeq@proofing
        \includecomment{rollover}
        \includecomment{printRollover}
        \let\definePR\defineRC
        \long\def\definePR#1#2{%
            \expandafter\def\csname PR#1\endcsname{#2}}
        \def\insertPR#1{\csname PR#1\endcsname
            \expandafter\let\csname PR#1\endcsname\relax}
    \else
        \excludecomment{printRollover}
        \includecomment{rollover}
        \let\definePR\relax
        \let\insertPR\@gobble
    \fi
\fi
\def\texPrintHelp#1#2{%
    \ifeqforpaper
        \ifeq@proofing
            \texHelp{#1}{#2}\marginpar{#1}%
        \else
            #2%
        \fi
    \else
        \texHelp{#1}{#2}\ifeq@proofing\marginpar{#1}\fi
    \fi
}
\newcommand{\animeBld}[1][false]{\stepcounter{ocSeq}%
    \xBld[#1]{\animBldName}}
\newcounter{ocSeq}
\newcommand{\DeclareAnime}[3]
{%
    \setcounter{ocSeq}{0}%
    \gdef\animBaseName{#1}%
    \gdef\animSpeed{#2}%
    \gdef\nFrames{#3}%
    \gdef\animBldName{\animBaseName\#\theocSeq}%
}
\newcommand{\backAnimeBtn}[3][]
{%
    \pushButton[\textFont{Wingdings3}\CA{Å}\TU{Reverse}#1\A{\JS{%
        aebAnimeLayersBackward(\animSpeed,\nFrames,"\animBaseName");
    }}]{\animBaseName BtnBack}{#2}{#3}%
}
\newcommand{\clearAnimeBtn}[3][]
{%
    \pushButton[\textFont{Wingdings}\CA{n}\TU{Clear}#1\A{\JS{%
        aebAnimeLayersClear(\animSpeed,\nFrames,"\animBaseName");
    }}]{\animBaseName BtnClear}{#2}{#3}%
}
\newcommand{\forwardAnimeBtn}[3][]
{%
    \pushButton[\textFont{Wingdings3}\CA{Æ}\TU{Graph It!}#1\A{\JS{%
        aebAnimeLayersForward(\animSpeed,\nFrames,"\animBaseName");
    }}]{\animBaseName BtnForward}{#2}{#3}%
}
\begin{insDLJS}[_animeLayers]{animelayers}{AeB Pro: JS in Support of Anime}
var _animeLayers = true;
var aebAnimeTimeOutF = new Object();
var aebAnimeTimeOutB = new Object();
var aebAnimeTimeOutC = new Object();
function aebAnimeLayersForward(animSpeed,nFrames,baseName)
{
    var timeinterval = animSpeed;
    aebAnimeTimeOutF = app.setInterval("aebAnimeTimeOutF.count++;"
        + "if (aebAnimeTimeOutF.count > " + nFrames +" ) app.clearInterval(aebAnimeTimeOutF);\r"
        + "else { if (aebAnimeTimeOutF.count == 1 ) getxBld('"+baseName+"\#1').state=true;\t"
        + "else { getxBld('"+baseName+"\#'+(aebAnimeTimeOutF.count-1)).state=false;\t"
        + "getxBld('"+baseName+"\#'+aebAnimeTimeOutF.count).state=true;}}", timeinterval);
    aebAnimeTimeOutF.start = 1;
    aebAnimeTimeOutF.count=0;
}
function aebAnimeLayersBackward(animSpeed,nFrames,baseName)
{
    var timeinterval = animSpeed;
    aebAnimeTimeOutB = app.setInterval("aebAnimeTimeOutB.count++;\r"
        + "if (aebAnimeTimeOutB.count > "+nFrames+") app.clearInterval(aebAnimeTimeOutB);\r"
        + "else { if (aebAnimeTimeOutB.count == "+nFrames+") getxBld('"+baseName+"\#1').state=false;\r"
        + "else { getxBld('"+baseName+"\#'+(aebAnimeTimeOutB.start-aebAnimeTimeOutB.count+1)).state=false;\r"
        + "getxBld('"+baseName+"\#'+(aebAnimeTimeOutB.start-aebAnimeTimeOutB.count)).state=true;}}", timeinterval);
    aebAnimeTimeOutB.start = nFrames;
    aebAnimeTimeOutB.count=0;
}
function aebAnimeLayersClear(animSpeed,nFrames,baseName)
{
    var timeinterval = animSpeed;
    aebAnimeTimeOutC = app.setInterval("aebAnimeTimeOutC.count++;\r"
        + "if (aebAnimeTimeOutC.count > "+nFrames+") app.clearInterval(aebAnimeTimeOutC);\r"
        + "else { getxBld('"+baseName+"\#'+(aebAnimeTimeOutC.start-aebAnimeTimeOutC.count+1)).state=false;}", timeinterval);
    aebAnimeTimeOutC.start = nFrames;
    aebAnimeTimeOutC.count=0;
}
\end{insDLJS}
\endinput
%%
%% End of file `aeblayers.def'.
