

function init() {
  Lightbox.init();
  if ($('front')) {
    var bottom = 43;
    window.onresize = function() {
      $('footer').setStyle('top', Window.getScrollHeight()-bottom+'px');
    }
    window.onresize();
  }
  var scroll = new Fx.Scroll(window, {
    wait: false,
    duration: 1000,
    transition: Fx.Transitions.Quad.easeInOut
  });
  var path = "#"+document.body.id+" #navigation ."+document.body.id;
  if ($E(path)) {
	  var elements = $$(path + " a").extend($$('a.top'));
	  elements.each(function(element) {
        var toId = element.href.substring(element.href.lastIndexOf('#')+1);
        if ($(toId)) {
  	      element.addEvent('click', function(event) {
	        event = new Event(event).stop();
		  	  scroll.toElement(toId);
	      });
	    }    
	  });
  }
  if (window.ie) {
    $ES('#navigation li').each(function(item) {
      item.onmouseover = function() {
        var el = $E('a', item).getNext();
        if (el) {
          el.setStyle('visibility', 'visible');
          el.setStyle('left', this.offsetLeft);
        }
        return false;
      }
      item.onmouseout = function() {
        var el = $E('a', item).getNext();
        if (el) {
          el.setStyle('visibility', 'hidden');
        }
        return false;
      }
    });
  }
}
