// variables communes -----------------------------------------------
//topBgcolor='#C0C0C0';
topBgcolor='#FFFFFF';
Bgcolor="#000000"
posXmenu = 20;
posYmenu = 160;
menuWidth = 130;
totTopHeight = 100;
totMenuWidth = menuWidth+2*posXmenu;
totMenuHeight = 100 + posYmenu+2*posXmenu;
horiz = 0; // menu horizontal


// timer ----------------------------------------------
function hideMenu() {
    sknvert.visibility = "hidden";
}
menuTimer = null;
function startTimer() {
    menuTimer = setTimeout("hideMenu()", 1000);
}
function stopTimer() {
    clearTimeout(menuTimer);
}
 
// fonctions -----------------------------------------------
function kill()
{
    sknvert.visibility = "hidden";
}

function changeimage(imagename,objetimage) {
    window.document.images[imagename].src = objetimage.src;
}

function SousMenu(pname,plink) {
    this.name = pname;
    this.link = plink;
}

// cellule du sous-menu -----------------------------------------------
function appendcell(name,link) {
    tmpstr ="<TR><TD ALIGN=CENTER><a ";
    tmpstr +='onMouseOver="changeimage(' + "'" +name+ "'," +name+'_2);';
    tmpstr +='stopTimer()" ';
    
    tmpstr +='onMouseOut="changeimage(' + "'" +name+ "'," +name+'_1);';
    tmpstr +='startTimer()" ';
    
    tmpstr +='onMouseDown="changeimage(' + "'" +name+ "'," +name+'_3)" ';
    tmpstr +='href="'+link+'">';
    tmpstr +='<img name="'+name+'" src="'+repertory+name+'_1.gif" align="top" border="0">';
    tmpstr +='</a></TD></TR>';
    return tmpstr;
}

// popup du sous menu ----------------------------------------------
function pop(msg,pos,index) {
    sknvert.visibility = "hidden";
    sknvert.top = posYmenu+pos;
    if (horiz!=0) sknvert.left = posXmenu + (index*menuWidth);
    a=true
    if (msg.length==0) return;
    var content ="<TABLE BORDER=1 CELLPADDING=0 CELLSPACING=0 BGCOLOR=#C0C0C0 WIDTH='+menuWidth+'>";
    pass = 0
    while (pass < msg.length)
    {
        content += appendcell(msg[pass].name,msg[pass].link);
        pass++;
    }
    content += "</TABLE>";
    if (nava)
    {
        sknvert.document.write(content);
        sknvert.document.close();
        sknvert.visibility = "visible";
    }
    else if (dom)
    {
        document.getElementById("topdeckvert").innerHTML = content;
        sknvert.visibility = "visible";
    }
    else if (iex)
    {
        document.all("topdeckvert").innerHTML = content;
        sknvert.visibility = "visible";
    }
}

// menu ----------------------------------------------
function drawcell(islink,name,sousmenu,pos,link,index) {
    if (horiz==0) document.write('<TR><TD WIDTH='+menuWidth+'>');
    else document.write('<TD WIDTH='+menuWidth+'>');
    document.write('<a  ');
    
    document.write('onMouseOver="kill();');
    document.write('stopTimer();');
    if (sousmenu>=0)
        document.write('pop(zlien['+sousmenu+'],'+pos+','+index+');');
    document.write('changeimage(');
    document.write("'"+name+"',");
    document.write(name+'_2)" ')
    
    document.write('onMouseOut="');
    document.write('startTimer();');
    document.write('changeimage(');
    document.write("'"+name+"',");
    document.write(name+'_1) "');
    
    if (islink==1)
    {
        document.write('onMouseDown="changeimage(');
        document.write("'"+name+"',");
        document.write(name+'_3) "');
        document.write(' href="'+link+'">');
    }
    else
        document.write(' href="javascript:pop(zlien['+sousmenu+'],'+pos+')">');

    document.write('<b><img name="'+name+'" src="'+repertory+name+'_1.gif" align="top" border="0">');
    if (horiz==0) document.write('</b></a></TD></TR>');
    else document.write('</b></a></TD>')
}
