var step = 0;
timer = null;

function showLayerAlpha(id){
    document.getElementById(id).style.visibility = 'visible';
    step = 0;
    showAlpha(id);
}


function hideLayerAlpha(id){
    document.getElementById(id).style.visibility = 'hidden';
    clearTimeout(timer);
}


function showAlpha(id){
    // for Firefox
    document.getElementById(id).style.opacity = (step/100);

    // for IE
    document.getElementById(id).style.filter = 'Alpha(Opacity=' + step + ', FinishOpacity=100, Style=1, StartX=0, StartY=0, FinishX=0, FinishY=0)';
    document.getElementById(id).style.visibility = 'visible';

    if (step <=100) {
        step += 5;
        eval ("timer = setTimeout('showAlpha(\"" + id + "\")',10);");
    }
    else clearTimeout(timer);
}
