window.onload = init;
var c = 1;
var start = 1;

function disp_img(w){
	if(c == 10){
      c = 1;
    }

	if(start ==1){
		start =0;
		c=2;
	}
   var img_src = "/img/rotations/AnimationSeq.E.Crop." + c + ".jpg";
	setOpacity(document.ani, 0);
	document.ani.src = img_src;
	fadeIn("ani",0);
	
   c++;
}
function setOpacity(obj, opacity) {
  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 (opacity <= 100) {
      setOpacity(obj, opacity);
      opacity += 10;
      window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100);
    }
  }
}
function init(){
	

	/* Preloading images */
	var image1 = new Image();
	image1.src = "/img/rotations/AnimationSeq.E.Crop.1.jpg";
	var image2 = new Image();
	image2.src = "/img/rotations/AnimationSeq.E.Crop.2.jpg";
	var image3 = new Image();
	image3.src = "/img/rotations/AnimationSeq.E.Crop.3.jpg";
	var image4 = new Image();
	image4.src = "/img/rotations/AnimationSeq.E.Crop.4.jpg";
	var image5 = new Image();
	image5.src = "/img/rotations/AnimationSeq.E.Crop.5.jpg";
	var image6 = new Image();
	image6.src = "/img/rotations/AnimationSeq.E.Crop.6.jpg";
	var image7 = new Image();
	image7.src = "/img/rotations/AnimationSeq.E.Crop.7.jpg";
	var image8 = new Image();
	image8.src = "/img/rotations/AnimationSeq.E.Crop.8.jpg";
	var image9 = new Image();
	image9.src = "/img/rotations/AnimationSeq.E.Crop.9.jpg";

	
	t = setInterval("disp_img(c)", 5000);
}