var _avpopup = null;

function ouvrepopup( url,xx,yy)
{
  if (( _avpopup == null) || (_avpopup.closed))
  {
    _avpopup = 
      window.open(url,'avpopup','toolbar=no,menubar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width='+xx+',height='+yy);
  }
}

function genStat( debUrl, type, id)
{
  if( arguments.length < 1)
    debUrl= "";
  if( arguments.length < 2)
    type= "";
  if( arguments.length < 3)
    id= "";

  if( type=="ent")
  {
    if( id != "")
      url= debUrl+"entreprises.php?_Act2=entStat&_IdEnt="+id+"&_Idss=";
    else
      url= debUrl+"entreprises.php?_Act2=listeStat&_IdEnt=&_Idss=";
      
    window.open( url, 'jvbas');
  }
  else if( type=="entMail" && id != "")
  {
    url= debUrl+"entreprises.php?_Act2=mail2Stat&_IdEnt="+id+"&_Idss=";
    window.open( url, 'jvbas');
  }
  else if( type=="vitr")
  {
    if( id != "")
      url= debUrl+"vitrines.php?_Act2=vitrStat&_IdVitrine="+id+"&_Idss=";
    else
      url= debUrl+"vitrines.php?_Act2=listeStat&_IdVitrine=&_Idss=";
    window.open( url, 'jvbas');
  }
  else if( type=="vitrMail" && id != "")
  {
    url= debUrl+"vitrines.php?_Act2=mail2Stat&_IdVitrine="+id+"&_Idss=";
    window.open( url, 'jvbas');
  }
  else if( type=="comm")
  {
    if( id != "")
      url= debUrl+"communautes.php?_Act2=commStat&_IdComm="+id+"&_Idss=";
    else
      url= debUrl+"communautes.php?_Act2=listeStat&_IdComm=&_Idss=";
    window.open( url, 'jvbas');
  }
  else if( type=="commMail" && id != "")
  {
    url= debUrl+"communautes.php?_Act2=mail2Stat&_IdComm="+id+"&_Idss=";
    window.open( url, 'jvbas');
  }
}