procedure Recuadro(X1,Y1,X2,Y2,Plano,Fondo : byte);
 var
  I : byte;
  S : char;
 Begin
  TextColor(Plano);
  TextBackground(Fondo);
  S := #205;
  for I := (X1+1) to (X2-1) do
   begin
    GotoXY(I,Y1);
    Write(S);
    GotoXY(I,Y2);
    Write(S);
   end;
  S := #186;
  for I := (Y1+1) to (Y2-1) do
   begin
    GotoXY(X1,I);
    Write(S);
    GotoXY(X2,I);
    Write(S);
   end;
  S := #201;
  GotoXY(X1,Y1);
  Write(S);
  S := #187;
  GotoXY(X2,Y1);
  Write(S);
  S := #200;
  gotoXY(X1,Y2);
  Write(S);
  S := #188;
  GotoXY(X2,Y2);
  Write(S);
 End;
 
procedure Ventana(X1,Y1,X2,Y2,Plano,Fondo,PlanoRecuadro,FondoRecuadro : byte);
 Begin
  Window(X1,Y1,X2,Y2);
  Recuadro(1,1,X2-X1,Y2-Y1,PlanoRecuadro,FondoRecuadro);
  Window(X1+1,Y1+1,X2-2,Y2-2);
  Textcolor(Plano);
  TextBackground(Fondo);
  ClrScr;
 End;