if (typeof(effectInProgress)=="undefined") var effectInProgress = {};
if (typeof(Footnotes)=="undefined") var Footnotes = (function () {
    var despamEffect = function (id,effectType,duration) {
      if ((effectInProgress[id]) || (typeof(Effect)=="undefined") || (typeof(Effect[effectType])=="undefined")) return;
      new Effect[effectType](id);
      effectInProgress[id]=true;
      setTimeout('effectInProgress[\"'+id+'\"]=false;',duration*1000);
    };
    var oldFootnoteId = '';
    var footnoteHighlight = function(id,pulsateNum,marker) {
      if (oldFootnoteId!='') document.getElementById('Footnote'+oldFootnoteId).style['borderStyle'] = 'none';
      oldFootnoteId = id;
      document.getElementById('Footnote'+id).style['borderStyle'] = 'solid';
      // update the return link to return to where we came from, important for duplicates
      if (typeof(marker)!='undefined') {
        var myhtml = document.getElementById('FootnoteNum'+id).href;
        myhtml = myhtml.replace(/FootnoteMarker[0-9-]*$/, 'FootnoteMarker'+id+'-'+marker);
        document.getElementById('FootnoteNum'+id).href = myhtml;
      }
      despamEffect('Footnote'+id,'Highlight',1)
      if (pulsateNum) despamEffect('FootnoteNum'+id,'Pulsate',3)
    }
    var footnoteMarkerHighlight = function(element) {
      if (oldFootnoteId!='') document.getElementById('Footnote'+oldFootnoteId).style['borderStyle'] = 'none';
      // use the return link to get the id to pulsate
      var id = element.href.match(/[0-9]+-[0-9]+/)[0]
      oldFootnoteId = '';
      despamEffect('FootnoteMarker'+id,'Pulsate',3)
    }
    return {footnoteHighlight:footnoteHighlight, footnoteMarkerHighlight:footnoteMarkerHighlight};
})();