window.onload = function() {
	 window.setTimeout("initImage()", 1000);
}

function initImage() {
  imageId = 'photo1';
  goahead(imageId);
}

function initImage2() {
  imageId = 'photo2';
  goahead(imageId);
}

function initImage3() {
  imageId = 'photo3';
  goahead(imageId);
}

function initImage4() {
  imageId = 'photo4';
  goahead(imageId);
}

function initImage5() {
  imageId = 'photo5';
  goahead(imageId);
}

function initImage6() {
  imageId = 'photo6';
  goahead(imageId);
}

function initImage7() {
  imageId = 'photo7';
  goahead(imageId);
}

function initImage8() {
  imageId = 'photo8';
  goahead(imageId);
}

function goahead(imageId) {
  image = document.getElementById(imageId);
  setOpacity(image, 0);
  image.style.visibility = 'visible';
  fadeIn(imageId,0);
}


function setOpacity(obj, opacity, objId) {
  opacity = (opacity == 100)?99.999:opacity;
  
  // Internet Explorer / Windows
  obj.style.filter = "alpha(opacity:"+opacity+")";
  
  // Safari < v1.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;

	if (opacity == 60) {
		switch(objId) {
		case "photo1":
			initImage2();
		break;
		case "photo2":
			initImage3();
		break;
		case "photo4":
			initImage5();
		break;
		case "photo5":
			initImage6();
		break;
		case "photo7":
			initImage8();
		break;
		}
	} else if (opacity == 80)
	{
		switch(objId) {
		case "photo3":
			initImage4();
		break;
		case "photo6":
			initImage7();
		break;
		}
	}
}

function fadeIn(objId,opacity) {
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if (opacity <= 100) {
      setOpacity(obj, opacity, objId);
      opacity += 20;
      window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 10);
    }
		if (opacity = 100) {
			
		}
  }
}
