
 
// ------ Classe fenestre -----------

function fenestre(url,nom,opts) 
{
  this.url=url;
  this.nom=nom;
  if (! this.nom ) this.nom = "marguerite";
  this.opts = opts;
  if (! this.opts) 
	this.opts = "toolbar=1,location=1,directories=0,status=1,menuBar=1,scrollbars=1,resizable=1,width=600,height=400,left=120,top=35";
  this.fen;
  this.ouvrir = ouvrir_fen;
  this.fermer = fermer_fen;
  this.ouverte = fen_ouverte
} 
  
  function ouvrir_fen(url) 
{
	// nf indique s'il s'agit d'une nouvelle fenetre; djo indique si la fenetre est deja ouverte
	var nf,djo;
	if (url && (url != this.url)) nf = this.url = url;
	if (! this.url)  return 0;
	if (! this.ouverte()) 
      {this.fen = window.open (this.url,this.nom,this.opts);
		this.fen.focus(); djo=1 ;
	}
	if (nf && ! djo) this.fen = window.open (this.url,this.nom,this.opts);
	this.fen.focus();
  }
  
  function fermer_fen() 
{
    if (this.ouverte()) this.fen.close()
}

  function fen_ouverte() {
    return this.fen && ! this.fen.closed
}


