/*****************************************************
 *  Picture Alpha Fader (Internet Explorer 5.0+ only *
 *****************************************************/

// highlight object (image), i.e. start fading
function imgHi(obj)
{
  object = obj;
  fadingImage = setInterval("fadeImage(object)", 50);
}

// called from onMouseOut - stops fading and restores alpha value (transparency)
function imgLo(obj, startAlpha)
{
  clearInterval(fadingImage)

  if (obj.style.MozOpacity)
    obj.style.MozOpacity = startAlpha / 100.;
  else if (obj.filters)
    obj.filters.alpha.opacity = startAlpha;
}

// increase alpha.opacity until picture is completely solid
function fadeImage(obj)
{
  if (obj.style.MozOpacity < 1)
    obj.style.MozOpacity = parseFloat(obj.style.MozOpacity) + 0.05;
  else if (obj.filters && obj.filters.alpha.opacity < 100)
    obj.filters.alpha.opacity += 5;
  else if (window.fadingImage)
    clearInterval(fadingImage);
}
