
function boutondyn ( nom_bout, src_inact, src_actif, src_clicque )
{
    // Donnees membres

    this.instance = nom_bout;
    this.nom = 'b'+nom_bout;
    this.bord = 0;
    this.style = 0;
    this.src_inact = src_inact;
    this.src_actif = src_actif;
    this.src_clicque = src_clicque;

    this.img_inact = new Image(); this.img_inact.src = this.src_inact;
    this.img_actif = new Image(); this.img_actif.src = this.src_actif;
    
    if (this.src_clicque)
    {
        this.img_clicque = new Image(); this.img_clicque.src = this.src_cliqcue;
    }

    // Methodes

    this.set_style = set_style;
    this.affich = affich;
    this.inact = inact;
    this.actif = actif;
    this.clicque = clicque;

}

function set_style(style_attrs)
{
    if (style_attrs)
    {
        this.style = 'style="' + style_attrs + '"';
    }
}


function affich (a_lien)
{
    if (a_lien)
    {
        lien = a_lien;
    }
    else
    {
        lien = '#';
    }

    style = '';

    if (this.style)
    {
        style = this.style;
    }

    actions = " onMouseOver=\""+this.instance+".actif();\" "+
              " onMouseOut=\""+this.instance+".inact();\" ";
    if (this.src_clicque)
        actions = actions + " onClick=\""+this.instance+".clicque();\" ";

    //alert ("<a href="+lien+actions+"><img border="+this.bord+" src="+this.src_inact+" name=\""+this.nom+"\" "+style+"></a>");
    document.write ("<a href="+lien+actions+"><img border="+this.bord+" src="+this.src_inact+" name=\""+this.nom+"\" "+style+"></a>");
}

function inact()
{
    document.images[this.nom].src = this.img_inact.src;
}

function actif()
{
    document.images[this.nom].src = this.img_actif.src;
}

function clicque()
{
    document.images[this.nom].src = this.img_clicque.src;
}


