if (typeof AH1N1 == "undefined") {
  var AH1N1 = {};
}
AH1N1.ie6 = false;
/*@cc_on

AH1N1.ie6 = (@_jscript_version == 5.6 || (@_jscript_version == 5.7 && !window.XMLHttpRequest));

@*/

/*
* Really easy field validation with Prototype
* http://tetlaw.id.au/view/javascript/really-easy-field-validation
* Andrew Tetlaw
* Version 1.5.4.1 (2007-01-05)
* 
* Copyright (c) 2007 Andrew Tetlaw
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* 
*/
var Validator = Class.create();

Validator.prototype = {
  initialize : function(className, error, test, options) {
    if(typeof test == 'function'){
      this.options = $H(options);
      this._test = test;
    } else {
      this.options = $H(test);
      this._test = function(){return true};
    }
    this.error = error || 'Validation failed.';
    this.className = className;
  },
  test : function(v, elm) {
    return (this._test(v,elm) && this.options.all(function(p){
      return Validator.methods[p.key] ? Validator.methods[p.key](v,elm,p.value) : true;
    }));
  }
}
Validator.methods = {
  pattern : function(v,elm,opt) {return Validation.get('IsEmpty').test(v) || opt.test(v)},
  minLength : function(v,elm,opt) {return v.length >= opt},
  maxLength : function(v,elm,opt) {return v.length <= opt},
  min : function(v,elm,opt) {return v >= parseFloat(opt)}, 
  max : function(v,elm,opt) {return v <= parseFloat(opt)},
  notOneOf : function(v,elm,opt) {return $A(opt).all(function(value) {
    return v != value;
  })},
  oneOf : function(v,elm,opt) {return $A(opt).any(function(value) {
    return v == value;
  })},
  is : function(v,elm,opt) {return v == opt},
  isNot : function(v,elm,opt) {return v != opt},
  equalToField : function(v,elm,opt) {return v == $F(opt)},
  notEqualToField : function(v,elm,opt) {return v != $F(opt)},
  include : function(v,elm,opt) {return $A(opt).all(function(value) {
    return Validation.get(value).test(v,elm);
  })}
}

var Validation = Class.create();

Validation.prototype = {
  initialize : function(form, options){
    this.options = Object.extend({
      onSubmit : true,
      stopOnFirst : false,
      immediate : false,
      focusOnError : true,
      useTitles : false,
      onFormValidate : function(result, form) {},
      onElementValidate : function(result, elm) {}
    }, options || {});
    this.form = $(form);
    if(this.options.onSubmit) Event.observe(this.form,'submit',this.onSubmit.bind(this),false);
    if(this.options.immediate) {
      var useTitles = this.options.useTitles;
      var callback = this.options.onElementValidate;
      Form.getElements(this.form).each(function(input) { // Thanks Mike!
        Event.observe(input, 'blur', function(ev) {
          Validation.validate(Event.element(ev), {
            useTitle : useTitles,
            onElementValidate : callback
          });
        });
      });
    }
  },
  onSubmit :  function(ev){
    if(!this.validate()) Event.stop(ev);
  },
  validate : function() {
    var result = false;
    var useTitles = this.options.useTitles;
    var callback = this.options.onElementValidate;
    if(this.options.stopOnFirst) {
      result = Form.getElements(this.form).all(function(elm) {
        return Validation.validate(elm, {
          useTitle :
          useTitles, onElementValidate : callback
        });
      });
    } else {
      result = Form.getElements(this.form).collect(function(elm) {
        return Validation.validate(elm, {
          useTitle : useTitles,
          onElementValidate : callback
        });
      }).all();
    }
    if(!result && this.options.focusOnError) {
      Form.getElements(this.form).findAll(function(elm) {
        return $(elm).hasClassName('validation-failed')
      }).first().focus();
    }
    this.options.onFormValidate(result, this.form);
    return result;
  },
  reset : function() {
    Form.getElements(this.form).each(Validation.reset);
  }
}

Object.extend(Validation, {
  validate : function(elm, options){
    options = Object.extend({
      useTitle : false,
      onElementValidate : function(result, elm) {}
    }, options || {});
    elm = $(elm);
    var cn = elm.classNames();
    return result = cn.all(function(value) {
      var test = Validation.test(value,elm,options.useTitle);
      options.onElementValidate(test, elm);
      return test;
    });
  },
  test : function(name, elm, useTitle) {
    var v = Validation.get(name);
    var prop = '__advice'+name.camelize();
    try {
    if(Validation.isVisible(elm) && !v.test($F(elm), elm)) {
      if(!elm[prop]) {
        var advice = Validation.getAdvice(name, elm);
        if(advice == null) {
          var errorMsg = useTitle ? ((elm && elm.title) ? elm.title : v.error) : v.error;
          advice = '<div class="validation-advice" id="advice-' + name + '-' + Validation.getElmID(elm) +'" style="display:none">' + errorMsg + '</div>'
          switch (elm.type.toLowerCase()) {
            case 'checkbox':
            case 'radio':
              var p = $(elm.parentNode);
              if (p) {
                new p.insert(advice);
              } else {
                new Insertion.Before(elm, advice);
              }
              break;
            default:
              new Insertion.Before(elm, advice);
            }
          advice = Validation.getAdvice(name, elm);
        }
        if(typeof Effect == 'undefined') {
          advice.style.display = 'block';
        } else {
          new Effect.Appear(advice, {
            duration : 1
          });
        }
      }
      elm[prop] = true;
      $A([
        elm,
        (elm.parentNode.tagName.toUpperCase() == 'LABEL' ? elm.parentNode : null)
      ]).compact()
      .invoke('removeClassName', 'validation-passed')
      .invoke('addClassName', 'validation-failed');
      return false;
    } else {
      var advice = Validation.getAdvice(name, elm);
      if(advice != null) advice.hide();
      elm[prop] = '';
      $A([
        elm,
        (elm.parentNode.tagName.toUpperCase() == 'LABEL' ? elm.parentNode : null)
      ]).compact()
      .invoke('removeClassName', 'validation-failed')
      .invoke('addClassName', 'validation-passed');
      return true;
    }
    } catch(e) {
      throw(e)
    }
  },
  isVisible : function(elm) {
    while(elm.tagName != 'BODY') {
      if (!$(elm).visible()) { return false; }
      elm = elm.parentNode;
    }
    return true;
  },
  getAdvice : function(name, elm) {
    return $('advice-' + name + '-' + Validation.getElmID(elm)) || $('advice-' + Validation.getElmID(elm));
  },
  getElmID : function(elm) {
    return elm.id ? elm.id : elm.name;
  },
  reset : function(elm) {
    elm = $(elm);
    var cn = elm.classNames();
    cn.each(function(value) {
      var prop = '__advice'+value.camelize();
      if (elm[prop]) {
        var advice = Validation.getAdvice(value, elm);
        advice.hide();
        elm[prop] = '';
      }
      elm.removeClassName('validation-failed');
      elm.removeClassName('validation-passed');
    });
  },
  add : function(className, error, test, options) {
    var nv = {};
    nv[className] = new Validator(className, error, test, options);
    Object.extend(Validation.methods, nv);
  },
  addAllThese : function(validators) {
    var nv = {};
    $A(validators).each(function(value) {
      nv[value[0]] = new Validator(value[0], value[1], value[2], (value.length > 3 ? value[3] : {}));
    });
    Object.extend(Validation.methods, nv);
  },
  get : function(name) {
    return  Validation.methods[name] ? Validation.methods[name] : Validation.methods['_LikeNoIDIEverSaw_'];
  },
  methods : {
    '_LikeNoIDIEverSaw_' : new Validator('_LikeNoIDIEverSaw_','', {})
  }
});

Validation.add('IsEmpty', '', function(v) {
  return  ((v == null) || (v.length == 0)); // || /^\s+$/.test(v));
});

Validation.addAllThese([
  ['required', 'Detta fält kan inte vara tomt.', function(v) {
    return !Validation.get('IsEmpty').test(v);
  }],
  ['validate-email', 'Fyll i en korrekt epost-adress', function (v) {
    return Validation.get('IsEmpty').test(v) || /\w{1,}[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/.test(v)
  }]
]);

// Simple utility methods for working with the DOM
DOM = {};

// DOMBuilder for prototype
DOM.Builder = {
  tagFunc : function(tag) {
    return function() {
      var attrs, children; 
      if (arguments.length>0) { 
        if (arguments[0].nodeName || 
          typeof arguments[0] == "string") 
          children = arguments; 
        else { 
          attrs = arguments[0]; 
          children = Array.prototype.slice.call(arguments, 1); 
        };
      }
      return DOM.Builder.create(tag, attrs, children);
    };
  },
  create : function(tag, attrs, children) {
    attrs = attrs || {}; children = children || []; tag = tag.toLowerCase();
    var el = new Element(tag, attrs);
    
    for (var i=0; i<children.length; i++) {
      if (typeof children[i] == 'string') 
        children[i] = document.createTextNode(children[i]);
      el.appendChild(children[i]);
    }
    return $(el);
  }
};

// Automatically create node builders as $tagName.
(function() { 
  var els = ("p|div|span|strong|em|img|table|tr|td|th|thead|tbody|tfoot|pre|code|" + 
             "h1|h2|h3|h4|h5|h6|ul|ol|li|form|input|textarea|legend|fieldset|" + 
             "select|option|blockquote|cite|br|hr|dd|dl|dt|address|a|button|abbr|acronym|" +
             "script|link|style|bdo|ins|del|object|param|col|colgroup|optgroup|caption|" + 
             "label|dfn|kbd|samp|var").split("|");
  var el, i=0;
  while (el = els[i++]) {
    window['$' + el] = DOM.Builder.tagFunc(el);
  }
})();

DOM.Builder.fromHTML = function(html) {
  var root;
  if (!(root = arguments.callee._root))
    root = arguments.callee._root = document.createElement('div');
  root.innerHTML = html;
  return root.childNodes[0];
};

AH1N1.namespace = function() {
  var a=arguments, o=null, i, j, d;
  for (i=0; i<a.length; i=i+1) {
    d = a[i].split(".");
    o = window;
    for (j=0; j<d.length; j=j+1) {
      o[d[j]]=o[d[j]] || {};
      o=o[d[j]];
    }
  }
  return o;
};

AH1N1.root = function() {
  if (!this._root) {
    this._root = $$('body').first();
  }
  return this._root
};

/*
  parseUri 1.2.1
  (c) 2007 Steven Levithan <stevenlevithan.com>
  MIT License
*/

AH1N1.parseUri = function(str) {
  var o = AH1N1.parseUri.options,
  m   = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
  uri = {},
  i   = 14;

  while (i--) {
    uri[o.key[i]] = m[i] || "";
  }

  uri[o.q.name] = {};
  uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {
    if ($1) uri[o.q.name][$1] = $2;
  });

  return uri;
};

AH1N1.parseUri.options = {
  strictMode: false,
  key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],
  q:   {
    name:   "queryKey",
    parser: /(?:^|&)([^&=]*)=?([^&]*)/g
  },
  parser: {
    strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
    loose:  /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
  }
};

AH1N1.getPageSize = function() {
        
  var xScroll, yScroll;
  
  if (window.innerHeight && window.scrollMaxY) {  
    xScroll = window.innerWidth + window.scrollMaxX;
    yScroll = window.innerHeight + window.scrollMaxY;
  } else if (document.body.scrollHeight > document.body.offsetHeight) {
    xScroll = document.body.scrollWidth;
    yScroll = document.body.scrollHeight;
  } else {
    xScroll = document.body.offsetWidth;
    yScroll = document.body.offsetHeight;
  }
  
  var windowWidth, windowHeight;
  
  if (self.innerHeight) {
    if(document.documentElement.clientWidth){
      windowWidth = document.documentElement.clientWidth; 
    } else {
      windowWidth = self.innerWidth;
    }
    windowHeight = self.innerHeight;
  } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
    windowWidth = document.documentElement.clientWidth;
    windowHeight = document.documentElement.clientHeight;
  } else if (document.body) {
    windowWidth = document.body.clientWidth;
    windowHeight = document.body.clientHeight;
  }  
  
  if (yScroll < windowHeight){
    pageHeight = windowHeight;
  } else { 
    pageHeight = yScroll;
  }

  if (xScroll < windowWidth){  
    pageWidth = xScroll;    
  } else {
    pageWidth = windowWidth;
  }

  return [pageWidth, pageHeight];
};

AH1N1.Key = Class.create({
  initialize: function(code) {
    this.code = parseInt(code);
    this.key = this.keys.detect(function(key) {
      return key[1].include(this.code);
    }.bind(this)) || ['unknown'];
    this.name = this.key[0];
  },
  
  keys: $H({
    'command'     : [91, 224, 17],
    'space'       : [32],
    'escape'      : [27],
    'delete'      : [46, 8],
    'arrow_left'  : [37],
    'arrow_up'    : [38],
    'arrow_right' : [39],
    'arrow_down'  : [40]
  }),
  
  isArrowKey: function() {
    return this.arrowKeys().include(this.code);
  },
  
  arrowKeys: function() {
    if (this._arrow_keys) {
      return this._arrow_keys;
    }
    this._arrow_keys = $A([
      this.keys.get('arrow_left'),
      this.keys.get('arrow_up'),
      this.keys.get('arrow_right'),
      this.keys.get('arrow_down')
    ]).flatten();
    return this.arrowKeys();
  }
  
});

AH1N1.namespace('AH1N1.LightBox');

AH1N1.LightBox.Targets = [];

AH1N1.LightBox.Instances = $H({});
Object.extend(AH1N1.LightBox.Instances, {
  active: function() {
    return this.values().find(function(value) {
      return value.active;
    }) || false;
  }
});

AH1N1.LightBox.Instance = Class.create({
  initialize: function(content, options) {
    this.options = Object.extend({
      afterOpen: Prototype.emptyFunction,
      afterCollapse: Prototype.emptyFunction
    }, options || {});
    this.content = content;
    this.inner_element = $div({
      'class' : 'inner'
    }, this.content);
    this.content.show();
    this.background = $div({
      'class' : 'background',
      'style' : 'display:none;'
    });
    this.element = this.createElement();
    AH1N1.root().insert(this.element);
    this.active = false;
    $(document).observe('keydown', function(event) {
      if (!this.active) { return; }
      var key = new AH1N1.Key(event.keyCode);
      if (key.name == 'escape') {
        this.collapse();
      }
    }.bind(this));
    
    if (AH1N1.LightBox.filters[content.id]) {
      AH1N1.LightBox.filters[content.id].call(this);
    }
    AH1N1.LightBox.Instances.set(this.content.identify(), this);
  },
      
  open: function() {
    var active_instance = AH1N1.LightBox.Instances.active();
    if (active_instance) {
      this.inner_element.setStyle({
        'top' : active_instance.inner_element.getStyle('top')
      });
      active_instance.collapse();
    } else {
      this.inner_element.setStyle({
        'top' : document.viewport.getScrollOffsets()[1] + (document.viewport.getHeight() / 10) + 'px'
      });
    }
    new Effect.Appear(this.element, {
      duration:0.4,
      queue: {
        position: 'end',
        scope: 'light_boxes'
      },
      afterFinish: function() {
        var page_size = AH1N1.getPageSize();
        this.background.setStyle({
          'width'  : page_size[0] + 'px',
          'height' : page_size[1] + 'px'
        });
        new Effect.Appear(this.background, {
          duration : 0.3,
          to       : 0.8,
          queue: {
            position: 'end',
            scope: 'light_boxes'
          }
        });
      }.bind(this)
    });
    this.active = true;
    this.options.afterOpen.call(this);
  },
  
  collapse: function() {
    new Effect.Fade(this.background, {
      duration : 0.3,
      queue: {
        position: 'end',
        scope: 'light_boxes'
      },
      afterFinish: function() {
        this.element.hide();
      }.bind(this)
    });
    this.active = false;
    this.options.afterCollapse.call(this);
  },
  
  createElement: function() {
    var close_link = $a({
      'href' : '#close',
      'class' : 'close_me'
    }, 'Stäng');
    close_link.observe('click', function(event) {
      this.collapse();
      event.stop();
    }.bind(this));
    this.inner_element.insert(close_link);
    return $div({
      'id'    : 'light_box',
      'style' : 'display:none;'
    }, $div({
      'class' : 'proxy'
    }, this.inner_element), this.background);
  }
  
});


AH1N1.LightBox.filters = {
  
  'email' : function() {
    new Validation('email', {
      immediate : false
    });
    this.content.select('input[type="text"]').each(function(input) {
      input.store('original_value', input.getValue());
      input.observe('focus', function(event) {
        if (input.getValue() == input.retrieve('original_value')) {
          input.setValue('');
        }
      }).observe('blur', function() {
        if (input.getValue().blank()) {
          input.setValue(input.retrieve('original_value'));
        }
      });  
    });
  },
  
  'email_2' : function() {
    new Validation('email_2_form', {
      immediate : false
    });
    $$('#email_2_form input[type="text"]').each(function(input) {
      input.store('original_value', input.getValue());
      input.observe('focus', function(event) {
        if (input.getValue() == input.retrieve('original_value')) {
          input.setValue('');
          event.stop();
        }
      }).observe('blur', function(event) {
        if (input.getValue().blank()) {
          input.setValue(input.retrieve('original_value'));
        }
        event.stop();
        
      });  
    });
  }
  
};

AH1N1.PopTargets = [];

AH1N1.PopBox = Class.create({
  initialize: function(trigger, content) {
    this.trigger_element = trigger;
    if (!this.trigger_element || !content) { return; }
    this.element = this.createElement(content);

    Element.insert(AH1N1.root(), {
      'bottom' : this.element
    });
    this.trigger_element.observe('mouseenter', this.appear.bindAsEventListener(this));
    this.trigger_element.observe('mouseleave', this.collapse.bindAsEventListener(this));
    this.trigger_element.setStyle({
      'display' : 'inline'
    });
  },
  
  appear: function(event) {
    var positions = this.trigger_element.cumulativeOffset();
    this.element.setStyle({
      'left' : positions[0] - 40 + 'px',
      'top'  : positions[1] - this.element.getHeight() - 10 + 'px'
    });
    new Effect.Appear(this.element, {
      duration : 0.2,
      queue: {
        position: 'end',
        scope: this.element.identify() + '_scope'
      }
    });
  },
  
  collapse: function(event) {
    new Effect.Fade(this.element, {
      duration : 0.3,
      delay: 0.3,
      queue: {
        position: 'end',
        scope: this.element.identify() + '_scope'
      }
    });
  },
  
  createElement: function(content) {
    return $div({
      'class' : 'pop_box',
      'style' : 'display:none;'
    }, $div({
      'class' : 'content'
    }, content.show()), $div({
      'class' : 'background'
    }));
  }
  
});

AH1N1.trackShareClick = function(event) {
  var link = event.element();
  if (typeof AH1N1.root().retrieve('answer') == 'undefined') {
    var answer = 0;
  } else {
    var answer = parseInt(AH1N1.root().retrieve('answer'));
  }
  
  if (link.descendantOf('help_out')) {
    var place = 'Main page';
  } else if (link.descendantOf('share')) {
    var place = 'Badge lightbox';
  } else if (link.descendantOf('answer_box')) {
    var place = 'Answer lightbox';
  } else {
    var place = 'Unknown';
  }

  pageTracker._trackEvent('Share link', place, link.innerHTML, answer);
};

AH1N1.externalLinks = function(element) {
  var links = element ? $(element).select('a[rel="external"]') : $$('a[rel="external"]');
  links.each(function(link) {
    link.writeAttribute('target', '_blank');
  });
}

AH1N1.selectAndDisable = function(_element) {
  if (!(element = $(_element))) {
    return;
  }
  element.observe('click', function() {
    element.select();
  });
};

document.observe("dom:loaded", function() {

  if (!AH1N1.ie6) {
    $$('#vaccine .pop_it').each(function(link) {
      var target = $(link.readAttribute('href').replace(/#/,''));
      if (target) {
        target.hide();
        AH1N1.PopTargets.push([$(link), target]);
      }
    });
  }

  $$('a.open').each(function(link) {
    var target = $(link.readAttribute('href').replace(/#/,''));
    if (target) {
      target.hide();
      AH1N1.LightBox.Targets.push([$(link), target]);
    }
  });

  (function() {
    var key = AH1N1.parseUri(window.location.toString()).queryKey['v'];
    var match = AH1N1.LightBox.Targets.detect(function(pair) {
      return pair[1].identify() == key;
    });
    if (typeof match != 'undefined') {
      var box = AH1N1.LightBox.Instances.keys().include(match[1].identify()) ? AH1N1.LightBox.Instances.get(match[1].identify()) : new AH1N1.LightBox.Instance(match[1]);
      box.open();
    }
  })();

  (function() {
    var container = $('vaccine');
    container.select('input').invoke('wrap', 'span', {
      'class' : 'check_wrapper'
    }).invoke('insert', '<span class="check"></span>');
    container.select('span.check').each(function(span) {
      var checkbox = span.adjacent('input').first();
      span.observe('click', function(event) {
        checkbox.checked = !checkbox.checked;
        checkbox.checked ? span.addClassName('checked') : span.removeClassName('checked');
        event.stop();
      });
      if (checkbox.checked) {
        span.addClassName('checked');
      }
    });
    $('send').observe('click', function(event) {
      new Ajax.Request(container.readAttribute('action'), {
        method : 'post',
        parameters : container.serialize(),
        onCreate: function() {
        },
        onComplete: function(response) {
          var answer = response.responseText;
          var content = $div({
            'class' : 'answer'
          }, answer);
          content.innerHTML = answer;
          var share = new AH1N1.LightBox.Instance(content, {
            afterCollapse: function() {
              this.element.remove();
            }
          });
          share.open();
          if (typeof pageTracker != 'undefined') {
            var answer_heading = share.inner_element.select('> h2').first();
            if (typeof answer_heading != 'undefined') {
              AH1N1.root().store('answer', parseInt(answer_heading.id.replace(/([A-z]|\_|\-)*/i,'')) + 1);
            }
            share.inner_element.select('ul.share_links a, ul.main a').invoke('observe', 'click', AH1N1.trackShareClick);
          }
          
          AH1N1.externalLinks(share.inner_element);
          AH1N1.selectAndDisable('answer_embed');
          
          $('open_email_2').observe('click', function(event) {
            event.stop();
            var box = new AH1N1.LightBox.Instance($('email_2'), {
              afterCollapse: function() {
                this.element.remove();
              }
            });
            box.open();
          });
          container.select('span.check').invoke('removeClassName', 'checked');
          container.reset();
        }
      });
      event.stop();
      event.element().blur();
    });
  })();
  
  go.delay(0.01);

  function go() {
  
    AH1N1.PopTargets.each(function(pair) {
      new AH1N1.PopBox(pair[0], pair[1]);
    });
    AH1N1.LightBox.Targets.each(function(pair) {
      pair[0].observe('click', function(event) {
        var link = event.element(); 
        var box = AH1N1.LightBox.Instances.keys().include(pair[1].identify()) ? AH1N1.LightBox.Instances.get(pair[1].identify()) : new AH1N1.LightBox.Instance(pair[1]);
        box.open();
        event.stop();
      });
    });
  
    (function() { 
      var drops = $$('div.drop').invoke('addClassName', 'dropped');
      drops.each(function(drop) {
        var trigger = $span({ 'class' : 'trigger' });
        drop.firstDescendant().insert(trigger);
        trigger.observe('click', function(event) {
          drop.toggleClassName('open-drop');
          trigger.toggleClassName('open-trigger');
        });
        document.observe('click', function(event) {
          el = event.element();
          if (el != drop && !el.ancestors().include(drop)) {
            drop.removeClassName('open-drop');
            trigger.removeClassName('open-trigger');
          }
        });
      });
    })();
  
    if (typeof pageTracker != 'undefined') {
      $$('ul.share_links a, ul.main a').invoke('observe', 'click', AH1N1.trackShareClick);
    }
    
    AH1N1.externalLinks();
    AH1N1.selectAndDisable('share_embed');
  }
    
});