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;
}
var gblFadeSeconds = .5;
var gblPhotoShufflerDivId = "rotatingImages";
var gblOpacity = 100;
function fadeOut() {
	var theimg = document.getElementById(gblPhotoShufflerDivId);
textDiv = document.getElementById("headlinesText");	 
	// determine delta based on number of fade seconds
	// the slower the fade the more increments needed
	var fadeDelta = 100 / (10*gblFadeSeconds);
 
	//if (gblImageRotations < 1) return;
      if(gblOpacity <0 ) { 
	  	  gblOpacity = 0;

		continueRight();
		fadeIn();
	  return;
	 }
		gblOpacity -= fadeDelta;
		setOpacity(theimg,gblOpacity);
		setOpacity(textDiv,gblOpacity);
		//setOpacity(sideT,gblOpacity);
		window.setTimeout("fadeOut()",10);  // 1/30th of a second
}

function fadeOutLeft() {
	var theimg = document.getElementById(gblPhotoShufflerDivId);
 textDiv = document.getElementById("headlinesText");	
	// determine delta based on number of fade seconds
	// the slower the fade the more increments needed
	var fadeDelta = 100 / (10*gblFadeSeconds);
 
	//if (gblImageRotations < 1) return;
      if(gblOpacity <0 ) { 
	  gblOpacity = 0;
		continueLeft();
		fadeIn();
	  return;
	 }
		gblOpacity -= fadeDelta;
		setOpacity(theimg,gblOpacity);
		setOpacity(textDiv,gblOpacity);
		//setOpacity(sideT,gblOpacity);
		window.setTimeout("fadeOutLeft()",10);  // 1/30th of a second
}

function fadeIn() {
	var theimg = document.getElementById(gblPhotoShufflerDivId);
textDiv = document.getElementById("headlinesText");	 
	// determine delta based on number of fade seconds
	// the slower the fade the more increments needed
	var fadeDelta = 100 / (10*gblFadeSeconds);
 
	//if (gblImageRotations < 1) return;
      if(gblOpacity >100 ) {
		gblOpacity = 100;
      	  return;
         }
		gblOpacity += fadeDelta;
		setOpacity(theimg,gblOpacity);
		setOpacity(textDiv,gblOpacity);
		
		//setOpacity(sideT,gblOpacity);
		window.setTimeout("fadeIn()",10);  // 1/30th of a second
}

