(* Creating the end of HTML - list of examples *)
ofile = "index.htm";
of = OpenAppend[ofile,
      FormatType -> OutputForm,
      PageWidth -> Infinity];
o[string_] := Write[of, string];
"
</TABLE>\n
<!--\n
<P><A HREF=\"../transit.pdf\">Explanations of computations</A>\n
-->\n
\n
<P><IMG SRC=\"../../../iconz/mathemat.gif\" WIDTH=\"17\" HEIGHT=\"16\" BORDER=\"0\" ALIGN=\"TOP\"><IMG SRC=\"../../../blank.gif\" WIDTH=8 HEIGHT=1 BORDER=0 ALIGN=\"TOP\">Mathematica programs\n
<UL>\n
<LI><A HREF=\"math/examples.m\">List of examples<A>\n
<LI><A HREF=\"math/potplots.m\">Plot of potentials<A>\n
<LI><A HREF=\"math/mapping.m\">Mapping (y,t) &ndash;&gt; (qx,qy)<A>\n
<LI>Printing <A HREF=\"math/indexhead.m\">the head<A>, <A HREF=\"math/indexline.m\">a row<A>,
 and <A HREF=\"math/indextail.m\">the tail<A> of the table\n
<LI><A HREF=\"math/index.m\">Printing results for each example<A>\n
</UL>\n
\n
<BR><HR>\n
\n
<TABLE><TR ALIGN=\"CENTER\"><TD ALIGN=\"CENTER\" VALIGN=\"TOP\"><IMG SRC=\"../../../iconz/hurric32.gif\" WIDTH=32 HEIGHT=32 ALT=\"Tulane\" ALIGN=\"ABSMIDDLE\"></TD>\n
<TD ALIGN=\"CENTER\" VALIGN=\"CENTER\"><A HREF=\"../index.htm\">Results of work at Tulane University with M. Herman</A></TD></TR></TABLE>\n
\n
<TABLE><TR ALIGN=\"CENTER\"><TD ALIGN=\"CENTER\" VALIGN=\"TOP\"><IMG SRC=\"../../../iconz/moretrsh.gif\" WIDTH=60 HEIGHT=36 ALT=\"Waste icons\" ALIGN=\"ABSMIDDLE\"></TD>\n
<TD ALIGN=\"CENTER\" VALIGN=\"CENTER\">More <A HREF=\"../../reports.htm\">Unpublished reports</A></TD></TR></TABLE>\n
\n
<P><FONT SIZE=\"-2\">Designed by <A HREF=\"../../../index.htm\">A. Sergeev</A></FONT>.</P>\n
</BODY>\n
</HTML>\n
" // o;
(* Copy program files *)
dirmath = "C:\\sergeev\\tulane\\math\\twodim\\examples";
dirhtmlmath = "C:\\html\\files\\tulane\\twodim\\math";
If[FileType[dirmath]=!=Directory,
   Print["Warning: directory ",dirmath," does not exist. Mathematica packages will not be copied to HTML-directory!"],
If[FileType[dirhtmlmath]=!=Directory,
   Print["Warning: directory ",dirhtmlmath," does not exist. Mathematica packages will not be copied to HTML-directory!"],
filesold = FileNames[ToFileName[dirhtmlmath, "*.m"]];
Print["Deleting old math-package files: ", filesold];
DeleteFile[filesold];
SetDirectory[dirmath];
filesnew = FileNames["*.m"];
Print["Copying new math-package files: ", filesnew];
CopyFile[#, ToFileName[dirhtmlmath, #]] & /@ filesnew; 
ResetDirectory[];
]];

Close[of];
