<!--

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) oldonload();
      func();
    }
  }
}

var dbgAlerts=false;
function changeSheets(whichSheet) {
  if (parseInt(whichSheet) < 1) whichSheet = 1;
  if (retrieveCookie('fontstyle') != whichSheet) {
    setCookie('fontstyle',whichSheet,'','/','.ap3.be');
  }
  whichSheet = whichSheet - 1;
  docsheets = document.styleSheets;
  if (docsheets) {
    var c = docsheets.length;
    if (dbgAlerts) alert('Change to Style '+whichSheet);
    for (var i=0;i<c;i++) {
      cursheet = docsheets[i];
      // cross-browser stuff!!!
      mediaText = typeof cursheet.media.mediaText !== 'undefined' ? cursheet.media.mediaText : cursheet.media;
      if (dbgAlerts) alert('Style '+i+' media: '+mediaText);
      if (mediaText != 'print') {
        if (i != whichSheet) {
          if (dbgAlerts) alert('Style '+i+': disabled!');
          cursheet.disabled = true;
        } else {
          if (dbgAlerts) alert('Style '+i+': enabled!');
          cursheet.disabled = false;
        }
      } else {
        if (dbgAlerts) alert('Style '+i+': enabled!');
        cursheet.disabled = false;
      }
    }
  }
}

function initSheets() {
  whichSheet = retrieveCookie('fontstyle');
  if (whichSheet == null) whichSheet = 1;
  changeSheets(whichSheet);
}
//-->

