// Cette fonctions affiche une fenetre dimentionnable avec une URL ou du code HTML.
///////////////////////////////////////////////////////////////////////////////

function OpenNewWindow(type,urlorcomment,largeur,hauteur){
  // type : url ou text
  // urlorcomment : texte ou URL a afficher
  // largeur : largeur de la fenetre créée
  // hauteur : hauteur de la fenêtre créée
  var NewWindow=null;    		// contient le cadre ou la fenetre
  var argc=OpenNewWindow.arguments.length // nombre d'arguments composants l'appel de la fonction
  var buffer = ""; 			// contient le code HTML à injecter dans la fenêtre créée

  // si le nombre d'argument est incorrect on affiche un message
  if (argc!=4)	{
  	alert("Dans la fonction OpenNewWindow: le nombre d'arguements est incorrect ! ");
	return;
  }

  // On crée la fenêtre
  if (type == 'url')	{
     NewWindow=open(urlorcomment,"formulaire","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,left=150,top=250,width="+(""+largeur)+",height="+(""+hauteur));
     NewWindow.focus();
     // Indication de la fenetre "creator" bidon à reloader (décommenter la ligne necessaire)
     NewWindow.creator=top.window.frames[4];
     // NewWindow.creator=self;
}  else if (type == 'url2')	{
     NewWindow=open(urlorcomment,"popup","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,left=150,top=250,width="+(""+largeur)+",height="+(""+hauteur));
     NewWindow.focus();
     // Indication de la fenetre "creator" bidon à reloader (décommenter la ligne necessaire)
     NewWindow.creator=top.window.frames[4];
     // NewWindow.creator=self;
  } else if (type == 'screenshot')	{
     NewWindow=open(urlorcomment,"screenshot","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,left=0,top=0,width="+(""+largeur)+",height="+(""+hauteur));
     NewWindow.focus();
     // Indication de la fenetre "creator" bidon à reloader (décommenter la ligne necessaire)
     NewWindow.creator=top.window.frames[4];
     // NewWindow.creator=self;
  } else {
     NewWindow=open("","message","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width="+(""+largeur)+",height="+(""+hauteur));
     NewWindow.focus();
     // On prépare ce que l'on veut ecrire dans la fenetre
     buffer = "<HTML><HEAD><TITLE>Cadre</TITLE></HEAD><BODY BGCOLOR='#F5E296'  TEXT='#0000FF'>";
     buffer += "<DIV STYLE='text-align:justify;'<H6>"+urlorcomment+"</H6></DIV>";
     buffer += "</HTML></BODY>";
   
   
     // On affiche ce que l'on a préparé
     NewWindow.document.open();
     NewWindow.document.write(buffer);
     NewWindow.document.close();
  }
}
