function displayMsgBox(psGaId, psGaLogin, piContent)
{
    var oBox = document.getElementById("msgBox");
    if(oBox)
    {
        if(oBox.getAttribute("work"))
            return;
        if(psGaId)
            document.getElementById("msgDest").value=psGaId;
        if(psGaLogin)
            document.getElementById("destItem").firstChild.data = psGaLogin;

        if( oBox.getAttribute("sH")!="0" )
            return;
        
        document.getElementById("msgSub").value="";
        document.getElementById("msgContent").value = "";
        if (piContent)
            document.getElementById("msgContent").value = psGaLogin+":\n"+document.getElementById("MsgContent"+piContent).innerHTML.replace(/<br>/gi,"");
        var iSpace = 190;
        oBox.setAttribute("work", "true");
        oBox.setAttribute("mH", "245");
        if( typeof( window.innerWidth ) == 'number' )
        {
            iwidth = window.innerWidth;
            iSpace = 201;
        }
        else if( document.documentElement &&
          ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
            iwidth = document.documentElement.clientWidth;
        else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
            iwidth = document.body.clientWidth;

        left = Math.round(( iwidth-800 )/2)+iSpace;
        oBox.style.left = left;
        if ("MozOpacity" in oBox.style)
            oBox.style.MozOpacity = "0";
        else
        oBox.filters.alpha.opacity= 0 ;
        window.setTimeout("addHeightMsgBox()",5);
    }
}

//Utiliser pour afficher la fenetre avec les utilisateurs connectés
function displayConnectedBox(evt)
{
//
    var oBox = document.getElementById("connectList");
    if(oBox)
    {
        if(oBox.getAttribute("work"))
            return;

        var iSpace = 630;

        oBox.setAttribute("work", "true");

        oBox.setAttribute("mH", "130");
        if( typeof( window.innerWidth ) == 'number' )
        {
            iwidth = window.innerWidth;
            iSpace = 621;
        }
        else if( document.documentElement &&
          ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
            iwidth = document.documentElement.clientWidth;
        else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
            iwidth = document.body.clientWidth;

        left = Math.round(( iwidth-800 )/2)+iSpace;
        oBox.style.left = left;
        if ("MozOpacity" in oBox.style)
            oBox.style.MozOpacity = "0";
        else
        oBox.filters.alpha.opacity= 0 ;

        if( oBox.getAttribute("sH")!="0" )
            window.setTimeout("removeHeightBox()",10);
        else
            window.setTimeout("addHeightBox()",5);
    }
}

function addHeightBox()
{
    var oBox = document.getElementById("connectList");
    oBox.style.display="block";
    var curHeight = Number(oBox.getAttribute("sH")) + 2 ;
    var curTop = Number(oBox.getAttribute("cT")) - 1 ;
    oBox.style.height = curHeight + "px";
    oBox.setAttribute("sH", curHeight);
    
    Mh = Number(oBox.getAttribute("mH"));
    iOpacity = (100 / Mh) * curHeight; 
    if ("MozOpacity" in oBox.style)
        oBox.style.MozOpacity = (iOpacity-20)/100;
    else
        oBox.filters.alpha.opacity= iOpacity-20 ;

    if(curHeight == oBox.getAttribute("mH") )
    {
        oBox.removeAttribute("work");
        return;
    }
    window.setTimeout("addHeightBox()",5);

}

function addHeightMsgBox()
{
    var oBox = document.getElementById("msgBox");
    oBox.style.display="block";
    var curHeight = Number(oBox.getAttribute("sH")) + 8 ;
    var curTop = Number(oBox.getAttribute("cT")) - 1 ;
    oBox.style.height = curHeight + "px";
    oBox.setAttribute("sH", curHeight);
    
    Mh = Number(oBox.getAttribute("mH"));
    iOpacity = (100 / Mh) * curHeight; 
    if ("MozOpacity" in oBox.style)
        oBox.style.MozOpacity = (iOpacity-2)/100;
    else
        oBox.filters.alpha.opacity= iOpacity-2 ;

    if(curHeight >= oBox.getAttribute("mH") )
    {
        oBox.removeAttribute("work");
        return;
    }
    window.setTimeout("addHeightMsgBox()",5);

}

function removeMsgBox()
{
    var oBox = document.getElementById("msgBox");
    var curHeight = Number(oBox.getAttribute("sH")) - 8 ;
    oBox.setAttribute("sH", curHeight);
    Mh = Number(oBox.getAttribute("mH"));
    iOpacity = (100 / Mh) * curHeight; 
    if ("MozOpacity" in oBox.style)
        oBox.style.MozOpacity = (iOpacity-2)/100;
    else
        oBox.filters.alpha.opacity= iOpacity-2 ;
    if(curHeight == 0)
    {
        oBox.removeAttribute("work");
        oBox.style.display = "none";
        return;
    }
    window.setTimeout("removeMsgBox()",10);

}

function removeHeightBox()
{
    var oBox = document.getElementById("connectList");
    var curHeight = Number(oBox.getAttribute("sH")) - 10 ;
    oBox.setAttribute("sH", curHeight);
    Mh = Number(oBox.getAttribute("mH"));
    iOpacity = (100 / Mh) * curHeight; 
    if ("MozOpacity" in oBox.style)
        oBox.style.MozOpacity = (iOpacity-10)/100;
    else
        oBox.filters.alpha.opacity= iOpacity-2 ;
    if(curHeight == 0)
    {
        oBox.removeAttribute("work");
        oBox.style.display = "none";
        return;
    }
    window.setTimeout("removeHeightBox()",10);

}

function OverSpan(spanElt)
{
    if (spanElt.getAttribute("select"))
        return;
    var classVal = spanElt.className;
    classVal += "Sel";
    spanElt.className = classVal;
}

function OutSpan(spanElt)
{
    if (spanElt.getAttribute("select"))
        return;
    var classVal = spanElt.className;
    classVal = classVal.substring(0,classVal.length-3);
    spanElt.className = classVal;
}


var sSubActif, sSubInActif;
var iWidthInAct, g_dispSub;
var iWidthAct
function displaySubmenu(poSpan, psSub)
{
    try
    {
        if(poSpan)
        {
            aSpan = poSpan.parentNode.getElementsByTagName("div");
            for (var i=0; i<aSpan.length; i++)
            {
                aSpan[i].className = "menuitems";
                aSpan[i].removeAttribute("select");
            }
            poSpan.className="menuitemSel";
            poSpan.setAttribute("select","true");
        }

        if (psSub)
        {
            var oMenu = document.getElementById("menuFoot");
            aSpan = oMenu.getElementsByTagName("div");
            for (var i=0; i<aSpan.length; i++)
            {
                aSpan[i].className = "menuitems";
                aSpan[i].removeAttribute("select");
                if (aSpan[i].getAttribute("sub") ==psSub)
                {
                    aSpan[i].className = "menuitemSel";
                    aSpan[i].setAttribute("select","true");
                }
            }
        }

        if (!psSub)
            var sSub = poSpan.getAttribute("sub");
        else
            var sSub = psSub;
        if (sSubActif)
        {
            if (sSubActif==sSub)
                return;
            sSubInActif = sSubActif;
            document.getElementById(sSubInActif).style.display = "none";
        }

        var oDivSub = document.getElementById(sSub);
        oDivSub.style.display="block";
        g_dispSub = true;
        sSubActif = sSub;
        iWidthAct = 0;
        displaySub();
    }
    catch(e)
    {
        alert("Error displaySubmenu :\n" + e)
    }
}

function displaySub()
{
    try
    {
        var oDiv = document.getElementById(sSubActif);
        if (iWidthAct>=14)
        {
            return;
        }
        iWidthAct += 1;
        oDiv.style.height = iWidthAct;
        setTimeout("displaySub();",30);
    }
    catch(e)
    {
        alert("Error displaySub :\n" + e)
    }
}

function removeSubMenu()
{
    try
    {
        var oDiv = document.getElementById(sSubInActif);
        oDiv.style.height =0;
        oDiv.style.display = "none";
    }
    catch(e)
    {
        alert("Error removeSubMenu :\n" + e)
    }
}



