/*
** Gestion d'une fenetre "popup"
 */

var ObjFenetre = 0;

function FenPopup ( iNomInstance )
{
    // Donnees membres

    this._NomInstance = iNomInstance;
    this._Nom = 'fp'+ iNomInstance;

    this._Largeur = 600;
    this._Hauteur = 400;

    this._Ancre = "";
    this._Url = "";
    this._IdFenetre = "";

    // Methodes

    this.SetUrl = SetUrl;
    this.SetIdFenetre = SetIdFenetre;
    this.SetDimensions = SetDimensions;
    this.SetAncre = SetAncre;
    this.AppendAncre = AppendAncre;
    this.InsertAncre = InsertAncre;
    this.AffichePopup = AffichePopup;
}

function SetAncre (iAncre)
{
    this._Ancre = iAncre;
}

function AppendAncre(iAncre)
{
    this._Ancre += iAncre;
}

function SetIdFenetre (iIdFenetre)
{
    this._IdFenetre = iIdFenetre;
}

function SetDimensions (iLargeur, iHauteur)
{
    this._Largeur = iLargeur;
    this._Hauteur = iHauteur;
}


function SetUrl (iUrl)
{
    this._Url = iUrl;
}

function InsertAncre()
{
    document.write ("<span onclick=\"" + this._NomInstance + ".AffichePopup();\" class=\"textebl\" style=\"cursor: pointer;\">");
    document.write (this._Ancre);
    document.write ('</span>');
}

function AffichePopup()
{

    if (ObjFenetre != 0)
    {
        ObjFenetre.close();
    }

    ObjFenetre = window.open(this._Url, this._IdFenetre,
                             'toolbar=1,location=0,directories=0,status=0,height='+this._Hauteur+',width='+this._Largeur+',resizable,scrollbars');
    ObjFenetre.focus();
}


