
function flipGreen(imageObj)
{
  imageObj.src = "img/red.gif";
  
  if(imageObj.style)
  { 
    imageObj.style.cursor = "default";
  }
}

function preloadImages()
{
  varRedImage = new Image();
  varRedImage.src = "img/red.gif";

  varFisheyeFotoSrcs = new Array();
  
  for(var i=0; i < fisheyeFotos.length; i++)
  {  
    varFisheyeFotoSrcs[i] = new Image();
    varFisheyeFotoSrcs[i].src = fisheyeFotos[i];
  }
}

function doFisheyeTimer()
{
  // ensure DOM is supported
  if(!document.getElementById) return;

 
  // if the interval function exists, flip the fisheye on interval
  if(window.setTimeout && window.setInterval)
  {
    var evalStr = "nextFisheye();window.setInterval('nextFisheye();', fisheyeInterval);";
    window.setTimeout(evalStr, fisheyeFirstInterval);
  }
}

function nextFisheye()
{
  // check if the fisheye src object can be found
  if(!document.getElementById('fisheyeFoto')) return;
  
  document.getElementById('fisheyeFoto').src = fisheyeFotos[fisheyeList[fisheyeIndex]];

  fisheyeIndex = (fisheyeIndex+1) % fisheyeList.length;
}