// Copyright 2008
// All Rights Reserved.

/**
 * @fileoverview base class for system javascript code
 * @author mail@richgossweiler.com (Rich Gossweiler)
 */

/**
 * Fade the page in using a cross-browser function.
 */
function fadeIn(opacity) {
  if (opacity < 1) {
    opacity += 0.05;
    setOpacity(document.body, opacity);
    setTimeout('fadeIn(' + opacity + ')', 50);
  } else {
    opacity = 1;
    setOpacity(document.body, opacity);
  }
}


/**
 * Sets the opacity of the element to the given value (between 0 and 1).
 */
function setOpacity(element, opacity) {
  element.style.filter = 'alpha(opacity=' + Math.round(opacity*100) + ')';
  element.style.opacity = opacity;
}


/**
 * Create the copyright for the page and add it to the bottom.
 */
function addCopyright() {
  var ele = document.getElementById('copyright');
  var theDate = new Date();
  ele.innerHTML = '&copy; ' + theDate.getFullYear() + ' Rich Gossweiler';
}
