function fade(target) { if (target) fadeIn(target); } function fadeIn(target, opacity) { if (!opacity) opacity = 0; target.style.visibility = "visible"; if (opacity <= 100) { if (typeof target.style.MozOpacity !== 'undefined') target.style.MozOpacity = (opacity/100)-.001; else if (typeof target.style.opacity !== 'undefined') target.style.opacity = (opacity/100)-.001; else if (typeof target.style.filter !== 'undefined') target.style.filter = "alpha(opacity="+opacity+")"; opacity += 10; window.setTimeout(function(){fadeIn(target, opacity);}, 50); } }