window.addEvent(
  'domready',
  function()
  {
    slider = new DivFader('top-teaser');
  }
);

window.addEvent(
  'load',
  function()
  {
    if($('popup'))
    {
      var popup = $('popup'),
          a = window.getSize(),
          b = popup.getElement('img').getSize(),
          img = popup.getElement('img');

      if(Cookie.read(img.src) == null)
      {
        popup.getChildren('h3')[0].setStyles({
          'width': (b.x - 20) + 'px'
        });

        popup.getFirst().getNext().setStyles({
          'width': b.x + 'px',
          'height': b.y + 'px'
         })

        popup.setStyles({
          'top': Math.round((a.y - b.y) / 2),
          'left': Math.round((a.x - b.x) / 2),
          'visibility': 'visible',
          'width': b.x + 'px',
          'height': (b.y + 31) + 'px'
        });

        Cookie.write(img.src, '1', {duration: 1});
      }
    }
  }

);
