--- loncom/interface/loncommon.pm	2005/02/25 04:56:05	1.251
+++ loncom/interface/loncommon.pm	2005/02/25 05:54:01	1.252
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.251 2005/02/25 04:56:05 albertel Exp $
+# $Id: loncommon.pm,v 1.252 2005/02/25 05:54:01 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2632,6 +2632,13 @@ a:focus { color: red; background: yellow
 <body bgcolor="$pgbg" text="$font" alink="$alink" vlink="$vlink" link="$link"
 style="margin-top: 0px;$addstyle" $addentries>
 END
+    if ($ENV{'environment.texengine'} eq 'jsMath') {
+	$bodytag.='<script type="text/javascript">
+                     function NoFontMessage () {}
+                   </script>'."\n".
+	    '<script src="/adm/jsMath/jsMath.js"></script>'."\n";
+    }
+
     my $upperleft='<img src="http://'.$ENV{'HTTP_HOST'}.':'.
                    $lonhttpdPort.$img.'" alt="'.$function.'" />';
     if ($bodyonly) {
@@ -2776,6 +2783,10 @@ Returns: A uniform footer for LON-CAPA w
 
 sub endbodytag {
     my $endbodytag='</body>';
+    if ($ENV{'environment.texengine'} eq 'jsMath') {
+	$endbodytag='<script type="text/javascript">jsMath.Process()</script>'.
+	    "\n".$endbodytag;
+    }
     return $endbodytag;
 }