/***************************** Fenêtres en PopUp ******************************/

//----- Fenêtre PopUp -----
var FenPop='';
var Redim='yes';
function FenPopUp(URL,Loc,Scrol,Largeur,Hauteur,Gauche,Sommet,Admin)
{
 if (Admin!='O')
 FermePopUp(FenPop);
 if ((Largeur+Gauche)>screen.width) // si la fenêtre sort de l'écran en largeur
 {
  Gauche=0;
  if (Largeur>screen.width) Largeur=screen.width;
 }
 var HtTot=Hauteur+Sommet;
 if ((HtTot)>screen.height)  // si la fenêtre sort de l'écran en hauteur
 {
  Sommet=0;
  if (Hauteur>screen.height) Hauteur=screen.height-75;
 }
 if (Loc==0) Adr='no'; else Adr='yes';
 switch (Scrol)
 {
  case 0:Asc='no';break;
  case 1:Asc='yes';break;
  case 2:Asc='auto';break;
 }
 FenPop=window.open(URL,'',"toolbar=no,location="+Adr+",directories=no,status=no,menubar=no,scrollbars="+Asc+",resizable="+Redim+",copyhistory=no,width="+Largeur+",height="+Hauteur+",left="+Gauche+",top="+Sommet);
}

function PopUpFixe(URL,Loc,Scrol,Largeur,Hauteur,Gauche,Sommet,Admin)
{
 if (Admin!='O')
 FermePopUp(FenPop);
 if ((Largeur+Gauche)>screen.width) // si la fenêtre sort de l'écran en largeur
 {
  Gauche=0;
  if (Largeur>screen.width) Largeur=screen.width;
 }
 var HtTot=Hauteur+Sommet;
 if ((HtTot)>screen.height)  // si la fenêtre sort de l'écran en hauteur
 {
  Sommet=0;
  if (Hauteur>screen.height) Hauteur=screen.height-75;
 }
 if (Loc==0) Adr='no'; else Adr='yes';
 switch (Scrol)
 {
  case 0:Asc='no';break;
  case 1:Asc='yes';break;
  case 2:Asc='auto';break;
 }
 FenPop=window.open(URL,'',"toolbar=no,location="+Adr+",directories=no,status=no,menubar=no,scrollbars="+Asc+",resizable=no,copyhistory=no,width="+Largeur+",height="+Hauteur+",left="+Gauche+",top="+Sommet);
}
//----- Fermeture de PopUp avec variable "Fenetre" -----
function FermePopUp(Fenetre) 
{
 if (Fenetre) 
 Fenetre.close();
 Fenetre=null;
}

//----- Fenêtre PopUp pour image -----
var FenImage='';
function Fen_Image(TitreImage,URLImage,Loc,Scrol,Redim,Largeur,Hauteur,Gauche,Sommet) 
{
 FermePopUp(FenImage);
 Adr='no';
 if (Loc==0) Adr='no'; else Adr='yes';
 if (Scrol==0) Asc='no'; else Asc='yes';
 if (Redim==0) Siz='no'; else Siz='yes';
 FenImage=window.open ("","","toolbar=no,location="+Adr+",directories=no,status=no,menubar=no,scrollbars="+Asc+",resizable="+Siz+",copyhistory=no,width="+Largeur+",height="+Hauteur+",left="+Gauche+",top="+Sommet);
 FenImage.document.open ();
 FenImage.document.writeln('<html>');
 FenImage.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">');
 FenImage.document.writeln('<title>'+TitreImage+'</title>');
 FenImage.document.writeln('<body bgcolor="#FFFFFF" style="margin:0 0 0 0;">');
 FenImage.document.writeln('<table bgcolor="#FFFFFF" border="0" height="100%" width="100%" cellspacing="0" cellpadding="0">');
 FenImage.document.writeln('<tr><td align=Center valign=Middle>\n<img src="'+URLImage+'" border="0" height="'+Hauteur+'" width="'+Largeur+'" align="middle" alt="'+TitreImage+'">\n</td></tr>');
 FenImage.document.writeln('</table>');
 FenImage.document.writeln('</body>');
 FenImage.document.write  ('</html>');
 FenImage.document.close ();
}

//----- Fenêtre PopUp pour un texte avec image -----
var FentxtImg='';
function Fen_Texte_Image(Titre,Texte,URL,Loc,Scrol,Redim,Largeur,Hauteur,Gauche,Sommet) 
{
 FermePopUp(FentxtImg);
 Adr='no';
 if (Loc==0) Adr='no'; else Adr='yes';
 if (Scrol==0) Asc='no'; else Asc='yes';
 if (Redim==0) Siz='no'; else Siz='yes';
 FentxtImg=window.open ("","","toolbar=no,location="+Adr+",directories=no,status=no,menubar=no,scrollbars="+Asc+",resizable="+Siz+",copyhistory=no,width="+Largeur+",height="+Hauteur+",left="+Gauche+",top="+Sommet);
 FentxtImg.document.open ();
 FentxtImg.document.writeln('<html>');
 FentxtImg.document.writeln('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">');
 FentxtImg.document.writeln('<title>'+Titre+'</title>');
 FentxtImg.document.writeln('<body bgcolor="#FFFFFF" style="margin:0 0 0 0;">');
 FentxtImg.document.writeln('<table bgcolor="#FFFFFF" border="0" height="100%" width="100%" cellspacing="0" cellpadding="0">');
 FentxtImg.document.writeln(' <tr>');
 FentxtImg.document.writeln('  <td align="left" valign="middle">');
 FentxtImg.document.writeln('   <img src="'+URL+'" border="0" align="middle" alt="'+Titre+'" style="">');
 FentxtImg.document.writeln('  </td>');
 FentxtImg.document.writeln('  <td align="center" style="font-family:Arial,helvetica;padding-left:12px;padding-right:12px;text-align:justify;" valign="middle">');
 FentxtImg.document.writeln('   '+Texte);
 FentxtImg.document.writeln('  </td>');
 FentxtImg.document.writeln('</tr>');
 FentxtImg.document.writeln('</table>');
 FentxtImg.document.writeln('</body>');
 FentxtImg.document.write  ('</html>');
 FentxtImg.document.close ();
}

//-- Fenêtre de lexique --
var FenLexique='';
function Lexique(Rep,id){
 FermePopUp(FenLexique);
 var FichierLexique=Rep+'LexicPopUp.php?id_lexique='+id;
 FenLexique=window.open (FichierLexique,"",",status=no,toolbar=no,location=no,directories=no,menuBar=no,scrollbars=no,resizable=yes,width=650,height=350,left=100,top=100");
}// Fin Lexique

