﻿/// <copyright>Copyright 2006, Pointe Blank Solutions</copyright>
/// <developer>Mike Kiska</developer>
/// <created>11/30/2006</created>

function setOpac(opacity, ctlID, ms, backColor, opacStart, opacEnd)
{
  var ctlStyle = document.getElementById(ctlID).style
  ctlStyle.opacity = (opacity / 100); 
  ctlStyle.MozOpacity = (opacity / 100); 
  ctlStyle.KhtmlOpacity = (opacity / 100); 
  ctlStyle.filter = 'alpha(opacity=' + opacity + ')';
  //ctlStyle.backgroundColor = backColor;
    
  if ( opacStart > opacEnd && opacity > opacEnd )
    setTimeout('setOpac(' + (opacity-ms) + ', \'' + ctlID +'\', ' + ms + ', \'' + backColor + '\', ' + opacStart + ', ' + opacEnd + ');', ms);
  else if ( opacStart < opacEnd && opacity < opacEnd )
    setTimeout('setOpac(' + (opacity+ms) + ', \'' + ctlID +'\', ' + ms + ', \'' + backColor + '\', ' + opacStart + ', ' + opacEnd + ');', ms);
}

function FadeIn(ctlID, opacStart, opacEnd, ms, backColor)
{
  setOpac(opacStart, ctlID, ms/100, backColor, opacStart, opacEnd);
}