var blnOk=true;
var decal=16;       // distance du haut de page à la première ligne du menu
var distance=2;     // distance entre item du menu principal
var nmenu;

function Chargement(nmenu)
{

    if(document.body.style.backgroundColor!="") { blnOk=false; }
    if(document.body.style.color!="") { blnOk=false; }
    if(document.body.style.marginTop!="") { blnOk=false; }
    if(document.getElementById)
    {
        with(document.getElementById("texte").style)
        {
            if(position!="") { blnOk=false; }
            if(top!="") { blnOk=false; }
            if(left!="") { blnOk=false; }
            if(width!="") { blnOk=false; }
            if(height!="") { blnOk=false; }
            if(zIndex!="") { blnOk=false; }
            if(margin!="") { blnOk=false; }
            if(padding!="") { blnOk=false; }
            if(visibility!="") { blnOk=false; }
        }
    }
    else
    {
        blnOk=false;
    }

    if(blnOk)
    {
        with(document.body.style)
        {
            //backgroundColor="#C0E4E2";
            backgroundColor="#FFFFFF";
            //color="#FFF";
            marginLeft="14em";
        }
        /*
        with(document.getElementById("titre").style) {
        backgroundColor=couleurfondtitre;
        //color="#FFF";
        //marginLeft="12.2em";
        }
        */
        with(document.getElementById("logo").style)
        {
            position="absolute";
            top="1em";
            left="1em";
            width="12em";
            margin="0";
        }

        with(document.getElementById("access").style)
        {
            position="absolute";
            top=(decal+(1+nmenu)*2)+"em";
            left="1em";
            width="10em";
            margin="0";
        }

        with(document.getElementById("texte").style)
        {
            margin="0";
            padding="1em";
            //backgroundColor="#FFF";
            //color="#333";
        }

        for(i=1;i<=nmenu;i++)
        {
            with(document.getElementById("menu"+i).style)
            {
                position="absolute";
                top=decal+(((i-1)*distance)+1)+"em";
                left="0.5em";
                width="12.5em";  // largeur du menu principal
                height="1.4em";
                textAlign="center";
                margin="1";
                padding="2";
                zIndex="2";
            }
        }

        for(i=1;i<=nmenu;i++)
        {
            with(document.getElementById("ssmenu"+i).style)
            {
                position="absolute";
                top=decal+(((i-1)*distance)+1.5)+"em";
                left="11.2em";
                width="13em"; // largeur des sous-menus
                margin="0";
                padding="2";
                zIndex="9";
            }
        }

        with(document.getElementById("copy").style)
        {
            backgroundColor="#E1F2F1";
            //color="#FFF";
        }

        CacherMenus();
    }
}

function MontrerMenu(strMenu)
{
    if(blnOk)
    {
        CacherMenus();
        document.getElementById(strMenu).style.visibility="visible";
    }
}

function CacherMenus()
{
    if(blnOk)
    {
        for(i=1;i<=nmenu;i++)
        {
            with(document.getElementById("ssmenu"+i).style)
            {
                visibility="hidden";
            }
        }
    }
}

