var animationManager = new AnimationManager();
var lightColor = new Color( 0xff, 0xff, 0xff );
var darkColor = new Color( 0x66, 0x66, 0x66 );

// light foreground color (short name to reduce code size in wall)
function f( element )
{
  light( element.style, "color", lightColor );
}

// darken foreground color (short name to reduce code size in wall)
function g( element )
{
  darken( element.style, "color", darkColor, 500 );
}

function light( object, propertyName, lightColor )
{
  object[ propertyName ] = lightColor.toString();
}

function darken( object, propertyName, darkColor, durationMilliseconds )
{
  var lightColor = ( ( object[ propertyName ] != null ) && ( object[ propertyName ] != "" ) ) ? Color.parse( object[ propertyName ] ) : new Color( 0xff, 0xff, 0xff );

  var darkenAnimation = new Animation( object, propertyName, lightColor, darkColor, durationMilliseconds );
  animationManager.addAnimation( darkenAnimation );
}

function makePleaseWaitButton( button )
{
    button.style.backgroundColor = "#ccc";
    button.disabled = true;
    button.value = "Please Wait...";
    return true;
}