// -----------------------------------------------------------------------------------

//
// CLAGNUT.COM Sandbox Image Fades without Flash ahead - modified
//

document.write("<style type='text/css'>#theiconbar1 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#theiconbar2 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#theiconbar3 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#theiconbar4 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#theiconbar5 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#theiconbar6 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#theiconbar7 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#theiconbar8 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#theiconbar9 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#theiconbar10 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#theiconbar11 {visibility:hidden;}</style>");
document.write("<style type='text/css'>#theiconbar12 {visibility:hidden;}</style>");

document.write("<style type='text/css'>#theteaser {visibility:hidden;}</style>");

function initImage(imageId) {
  image = document.getElementById(imageId);
  if (image) {
	  setOpacity(image, 0);
  	image.style.visibility = 'visible';
  	fadeIn(imageId,0);
  }
}

function setOpacity(obj, opacity) {
	if (obj) {
		opacity = (opacity == 100)?99.999:opacity;
  		// IE/Win  
 		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 fadeIn(objId,opacity) {
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if (obj) {
  	  if (opacity <= 100) {
 	     setOpacity(obj, opacity);
 	     opacity += 10;
  	    window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100);
 	   }
    }
  }
}

function initTeaser() {
	initImage("theteaser");
}

function initIconbar() {
	window.setTimeout("initImage('theiconbar1')", 0);
	window.setTimeout("initImage('theiconbar2')", 100);
	window.setTimeout("initImage('theiconbar3')", 200);
	window.setTimeout("initImage('theiconbar4')", 300);
	window.setTimeout("initImage('theiconbar5')", 400);
	window.setTimeout("initImage('theiconbar6')", 500);
	window.setTimeout("initImage('theiconbar7')", 600);
	window.setTimeout("initImage('theiconbar8')", 700);
	window.setTimeout("initImage('theiconbar9')", 800);
	window.setTimeout("initImage('theiconbar10')", 900);
	window.setTimeout("initImage('theiconbar11')", 1000);
	window.setTimeout("initImage('theiconbar12')", 1100);
}

function initAll() {
	initIconbar();
	initTeaser();
	PreloadImages();
}

window.onload = function() { initAll() }
