// javascript by posttoast, 2010 (http://www.posttoast.nl)

// Load js-enabled stylesheet
new Asset.css('_presentation/css/js-enabled.css', {id: 'jsEnabledStyle', title: 'jsEnabledStyle'});

// Site-engine class
var siteEngine = new Class({
  initialize: function(){
    this.warnIE6Users();
    this.setupBlocks();
    this.initThumbGalleries();
  },

  warnIE6Users: function(){
    if (Browser.Engine.trident && Browser.Engine.version <= 4){
      warningMessage = new Element('div', {id: 'browserupdate'});
      warningMessage.set('html', '<div id="browserupdate">U gebruikt een sterk verouderde versie van Microsoft Internet Explorer. Hierdoor loopt u mogelijk veiligheidsrisico\'s en worden webpagina\'s niet correct getoond.<br /><a href="http://www.microsoft.com/netherlands/windows/internet-explorer" target="_blank">Klik hier om de nieuwste versie te downloaden</a>.</div>');
      warningMessage.inject($(document.body), 'top');
    }
  },

  setupBlocks: function(){
    $$('.buttonBlockExpandOpen').addEvent('click', function(el){
      $$('.blockExpand').removeClass('active');
      this.getParent('div').getNext('.blockExpand').toggleClass('active');
      el.stop();
    });
    $$('.buttonBlockExpandClose').addEvent('click', function(el){
      this.getParent('.blockExpand').toggleClass('active');
      el.stop();
    });
  },
  
  initThumbGalleries: function(){
    $$('.thumbgallery').each(function(el){
      new thumbGallery({
        galleryElement : el
      });
    });
  },

});

Shadowbox.init();

window.addEvent('domready', function(){
  siteEngine = new siteEngine();
});
