

  /* flash headers */
  
  //growth 
  
  flashHeaders.add({
    fontPath:'GillSans_light.swf',
    cssSelectors:['body.growth h1 span.chapter-subtitle'],
    size:18,
    color:'888888',
    lineHeights:[25,45,66,87,107]
  });
  
  flashHeaders.add({
    leading:-5,
    fontPath:'GillSans_light.swf',
    cssSelectors:['body.growth div#content blockquote'],
    size:38,
    color:'888888',
    lineHeights:[48,86,125,164,202,241]
  });
  
  flashHeaders.add({
    fontPath:'GillSans.swf',
    cssSelectors:['body.growth div#block-blog h3'],
    size:16,
    color:'888888',
    lineHeights:[23,41,60]
  });
  
  flashHeaders.add({
    leading:-2,
    fontPath:'GillSans.swf',
    cssSelectors:['body.growth div#block-blog blockquote'],
    size:19,
    color:'FF6600',
    lineHeights:[26,46,66,86,106,126]
  });
  
  flashHeaders.add({
    leading:-2,
    fontPath:'GillSans.swf',
    cssSelectors:['body.growth div#block-blog blockquote'],
    size:19,
    color:'FF6600',
    lineHeights:[26,46,66,86,106,126]
  });
  
  flashHeaders.add({
    leading:-5,
    fontPath:'GillSans_light.swf',
    cssSelectors:['body.growth h1 span.chapter-title'],
    size:38,
    color:'000000',
    underline:1,
    lineHeights:[48,86,125,164]
  });

  //growth-overview
  
  flashHeaders.add({
    leading:-5,
    fontPath:'GillSans.swf',
    cssSelectors:['body.growth-overview h1 span.chapter-title'],
    size:32,
    color:'888888',
    paddingLeft:-3,
    lineHeights:[41,73]
  });
  
  flashHeaders.add({
    leading:-5,
    fontPath:'GillSans_light.swf',
    cssSelectors:['body.growth-overview h1 span.chapter-subtitle'],
    size:40,
    color:'000000',
    paddingTop:-5,
    paddingLeft:-3,
    lineHeights:[45,86,127]
  });
  
  flashHeaders.add({
    leading:-5,
    fontPath:'GillSans.swf',
    cssSelectors:['body.growth-overview div.person blockquote'],
    size:26,
    color:'FF6600',
    paddingTop:-5,
    lineHeights:[29,54,80,105]
  });
  
  
  //facts, responsibility, downloads, sitemap

  flashHeaders.add({
    leading:-5,
    fontPath:'GillSans.swf',
    cssSelectors:[
      'body.facts h1 span.chapter-subtitle',
      'body.responsibility h1 span.chapter-subtitle',
      'body.downloads h1 span.chapter-subtitle',
      'body.sitemap h1 span.chapter-subtitle'
    ],
    size:38,
    color:'888888',
    paddingLeft:-4,
    lineHeights:[48,87,126]
  });
  
  flashHeaders.add({
    leading:-5,
    fontPath:'GillSans_light.swf',
    cssSelectors:[
      'body.facts h1 span.chapter-title',
      'body.responsibility h1 span.chapter-title',
      'body.downloads h1 span.chapter-title',
      'body.sitemap h1 span.chapter-title'
    ],
    size:40,
    color:'000000',
    paddingTop:-5,
    paddingLeft:-4,
    lineHeights:[45,86,127,168]
  });
  
  
  //home
  
  flashHeaders.add({
    leading:-5,
    fontPath:'GillSans.swf',
    cssSelectors:['body.home h1 span.chapter-title'],
    size:35,
    color:'888888',
    paddingLeft:-4,
    lineHeights:[45,80,116]
  });
  
  flashHeaders.add({
    leading:-5,
    fontPath:'GillSans_light.swf',
    cssSelectors:['body.home h1 span.chapter-subtitle'],
    size:40,
    color:'000000',
    paddingTop:-5,
    paddingLeft:-4,
    lineHeights:[45,86,127,168]
  });
  
  // Pad kan  relatief zijn en wordt daarom soms binnen de pagina geregeld.
  if (window.pathToFlashHeaders == undefined){
    pathToFlashHeaders = '_swf/';
  }
  
  //start it up
  flashHeaders.start({
    path: pathToFlashHeaders
  });
  
  
  /* background cache hack */
  if (browser.winIE6Down) try {document.execCommand("BackgroundImageCache", false, true);} catch(e){};


/**
 *  Toggle between stylesheets
 *
 *  @param  title   String: linktagtitle of the other stylesheet
 */
function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") !== -1) {
      if(a.getAttribute("title"))
        a.disabled = true;
      if(a.getAttribute("title")
         && a.getAttribute("title") == title) {
        a.disabled = false;
      }
    }
  }
}
  


/**
 *  Get currently used stylesheet
 */
function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("title")
       && !a.disabled)
     return a.getAttribute("title");
  }
  return null;
}
  


/**
 *  Setting up stylesheet togglecontrols
 */
function setupSizeSetters() {
  // Start with last chosen stylesheet
  var cookie = getCookie("style");
  var title = cookie ? cookie : getPreferredStyleSheet();
  setActiveStyleSheet(title);

  // Render sizesetters
  var sizeSetters = '';
  sizeSetters += '<li id="size-setters">';
  sizeSetters += '  <a href="#css_small" class="small">A</a>';
  sizeSetters += '  <a href="#css_default" class="default">A</a>';
  sizeSetters += '  <a href="#css_large" class="large">A</a>';
  sizeSetters += '</li>';
  var genericNavigation = getEl('generic-navigation');
  if(typeof genericNavigation !== 'undefined') {
    genericNavigation = genericNavigation.getElementsByTagName('ul')[0];
    genericNavigation.innerHTML += sizeSetters;
  }
  // Attach toggleevents
  var sizeSettersContainer = getEl('size-setters');
  if(sizeSettersContainer !== null
     && typeof sizeSettersContainer !== 'undefined') {
    var sizeSetters = sizeSettersContainer.getElementsByTagName('a');
    for(i=0; i < sizeSetters.length; i++) {
      addEvent(sizeSetters[i],'click', function() {
        if(typeof this.className !== 'undefined')
          setActiveStyleSheet(this.className);
        return false;
      });
    }
  }
}
  


/**
 *  Getting the preferred stylesheet
 */
function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title"))
      return a.getAttribute("title");
  }
  return null;
}



/* Functions to be initiated at startup */
/* Setting up sizesetters */
addEvent(window,'DOMContentLoaded',setupSizeSetters);
/* create all flash objects */
addEvent(window,'DOMContentLoaded',createFlashObjects);




window.onunload = function(e) {
  var title = getActiveStyleSheet();
  setCookie("style", title, 365);
}