function startFade(objId,x) {
  obj = document.getElementById(objId);
  if (x == 'in') {
  setOpacity(obj, 0);
  obj.style.visibility = 'visible';
  fadeIn(objId,0);
  }
  else if (x == 'out') {
  setOpacity(obj, 100);
  fadeOut(objId,100);
  }
  else {
  alert('You must set x to "in" or "out"');
  }
}

function setOpacity(obj, opacity) {
  opacity = (opacity == 100)?99.99999999999:opacity;
  
  // IE4,5,6,7
  obj.style.filter = "alpha(opacity:"+opacity+")";
  
  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;
  
  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;
  
  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
  
}

function fadeOut(objId,opacity) {
  if (document.getElementById) {
	obj = document.getElementById(objId);
    if (opacity >= 0) { //function calls itself if the opacity is not yet under zero
      setOpacity(obj, opacity);
      opacity -= 5; // the increment by which the opacity % changes. 
      window.setTimeout("fadeOut('"+objId+"',"+opacity+")", 50); //=> the opacity will change by the increment in the line above every X microseconds where X is the lenght of the setTimeout
    }
	else {
	obj.style.display = 'none';
	}
  }
}

startFade('white_div_big-pic','out');
window.setTimeout("startFade('white_div_promo_box','out');",1400);
window.setTimeout("startFade('white_div_navbar','out');",3400);
window.setTimeout("startFade('white_div_bottom_right','out');",3400);
window.setTimeout("startFade('white_div_bottom_left','out');",3400);
window.setTimeout("startFade('white_div_border_top','out');",3400);
window.setTimeout("startFade('white_div_border_right','out');",3400);
window.setTimeout("startFade('white_div_border_left','out');",3400);
window.setTimeout("startFade('white_div_border_bottom','out');",3400);
