// JavaScript Document
window.onload = function() {startUpRotation()}
var imageLocations = new Array("1.jpg");
var currentImg = 0;
var sImage="";
function callFadeOut () {
	window.setTimeout("fadeOut(\"mainImage\",100)",5500);
} // end function
function startUpRotation() {
	imageId = 'mainImage';
	tempHeight=0;
	try{
	tImage=sImage.substr(sImage.indexOf("/uploaded_images"));
	tImage=tImage.replace(/%20/g," ");
	tempHeight=allPicHeights[tImage];
	tempHeight=(tempHeight-312)/2;
	}catch(err){}
	document.getElementById("photoHolder").innerHTML="<div id=\"imageInsideHolder\" style=\"top:-"+tempHeight+"px\"><nobr style=\"margin-bottom:auto; margin-top:auto;\"><img src='"+sImage+"' border='0' alt='Photo' name=\"mainImage\" id='mainImage' style=\"filter:alpha(opacity=0);-moz-opacity:0; \" /></nobr></div>";
	currentImg++;
	if (currentImg>=imageLocations.length) {currentImg=0}
//	window.setTimeout("startUpRotation()", 7100);
//	callFadeOut ()
	initImage();
} // end function
function initImage() {
  imageId = 'mainImage';
  image = document.getElementById(imageId);
  setOpacity(image, 0);
  image.style.visibility = 'visible';
  fadeIn(imageId,0);
}
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 += 5;
      window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 25);
    }
  }
}
function fadeOut(objId,opacity) {
  if (document.getElementById) {
    obj = document.getElementById(objId);
    if (opacity > 0) {
      setOpacity(obj, opacity);
      opacity -= 10;
      window.setTimeout("fadeOut('"+objId+"',"+opacity+")", 25);
    }
	else {
      startUpRotation();
	}
  }
}