var pElement;
var stopShade;
var restingShade;
var currentShade;
var destString;
    
function doCalloutFadeIn(pID, newString) {
    destString = newString;
    pElement = document.getElementById(pID);
    stopShade = 255;
    restingShade = 102;
    currentShade = restingShade;
    
    phaseFadeOut();
}

function phaseFadeOut() {
    currentShade += 5;
    if(currentShade < stopShade) { setTimeout('phaseFadeOut();', 10); }
    else {
        currentShade = stopShade;
        pElement.innerHTML = destString;
        setTimeout('phaseFadeIn();', 10);
    }
    pElement.style.color = 'rgb(' + currentShade + ', ' + currentShade + ', ' + currentShade + ')';
}

function phaseFadeIn() {
    currentShade -= 5;
    if(currentShade > restingShade) { setTimeout('phaseFadeIn();', 10); }
    else { currentShade = restingShade; }
    pElement.style.color = 'rgb(' + currentShade + ', ' + currentShade + ', ' + currentShade + ')';
}
