﻿function FadeText(sId, nIn, nCol)
{
    if(nCol == undefined) nCol = (nIn == 1)? 240 : 0;
    
    if(nIn == 1) nCol-=11;// increase color darkness
    else nCol+=11;// decrease color darkness
    if(nCol >= 0 && nCol <= 240)
    {
        //hex-=11; // increase color darkness
        document.getElementById(sId).style.color = "rgb("+nCol+","+nCol+","+nCol+")";
        setTimeout("FadeText('" + sId + "'," + nIn + "," + nCol + ")",20); 
    }
}

function ShowNextNew(id)
{
    var LoNode = document.getElementById(LsId);
    while(LoNode.firstChild != null)
        LoNode.removeChild(LoNode.firstChild);
    LoNode.appendChild(document.createTextNode(LaNews[id]));
    LoNode.setAttribute("href","/NewsContent.aspx?Id=" + LaIds[id]);
    FadeText(LsId, 1);
    id++;
    if(id >= LaNews.length) id = 0;
    setTimeout("FadeText(\"" + LsId + "\", 0)", (LnTransition - 800));
    setTimeout("ShowNextNew(" + id +")",LnTransition); 
}