
function Fade(objID,CurrentAlpha,TargetAlpha,steps){

	var obj = document.getElementById(objID);
	if (obj == null || obj == "" || obj == 'undefined') {
	  return;
	}

  // SET visibility aan
  obj.style.visibility='visible';

	if (obj.style.opacity=='') {
		obj.style.opacity=0.9999
	}

	CurrentAlpha = parseInt(CurrentAlpha);
	if (isNaN(CurrentAlpha)){
		CurrentAlpha = parseInt(obj.style.opacity*100);
		if (isNaN(CurrentAlpha))CurrentAlpha=100;
	}

	var DeltaAlpha=parseInt((CurrentAlpha-TargetAlpha)/steps);
	var NewAlpha = CurrentAlpha - DeltaAlpha;

	if (NewAlpha == 100 && (navigator.userAgent.indexOf('Gecko') != -1 && navigator.userAgent.indexOf('Safari') == -1)) NewAlpha = 99.99;

	obj.style.opacity = (NewAlpha / 100);
	obj.style.MozOpacity = obj.style.opacity;
	obj.style.KhtmlOpacity = obj.style.opacity;
	obj.style.filter = 'alpha(opacity='+NewAlpha+')';

	if (steps>1){
		setTimeout('Fade("'+objID+'",'+NewAlpha+','+TargetAlpha+','+(steps-1)+')', 50);
	}
}


