--- loncom/interface/lonhtmlcommon.pm	2010/08/07 19:23:50	1.281
+++ loncom/interface/lonhtmlcommon.pm	2010/08/08 02:00:38	1.282
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.281 2010/08/07 19:23:50 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.282 2010/08/08 02:00:38 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -121,7 +121,7 @@ sub dragmath_button {
     my ($textarea,$helpicon) = @_;
     my $help_text; 
     if ($helpicon) {
-        $help_text = &Apache::loncommon::help_open_topic('Authoring_Math_Editor');
+        $help_text = &Apache::loncommon::help_open_topic('Authoring_Math_Editor',undef,undef,undef,undef,'mathhelpicon_'.$textarea);
     }
     my $buttontext=&mt('Edit Math');
     return <<ENDDRAGMATH;
@@ -1231,22 +1231,6 @@ ENDJQUERY
 
 # ----------------------------------------------------------------- Preferences
 
-sub disablelink {
-    my @fields=@_;
-    if (defined($#fields)) {
-	unless ($#fields>=0) { return ''; }
-    }
-    return '<a href="'.&HTML::Entities::encode('/adm/preferences?action=set_wysiwyg&wysiwyg=off&returnurl=','<>&"').&escape($ENV{'REQUEST_URI'}).'">'.&mt('Disable WYSIWYG Editor').'</a>';
-}
-
-sub enablelink {
-    my @fields=@_;
-    if (defined($#fields)) {
-	unless ($#fields>=0) { return ''; }
-    }
-    return '<a href="'.&HTML::Entities::encode('/adm/preferences?action=set_wysiwyg&wysiwyg=on&returnurl=','<>&"').&escape($ENV{'REQUEST_URI'}).'">'.&mt('Enable WYSIWYG Editor').'</a>';
-}
-
 # ------------------------------------------------- lang to use in html editor
 sub htmlarea_lang {
     my $lang='en';
@@ -1265,7 +1249,7 @@ sub htmlareaselectactive {
               .'// <![CDATA['."\n";
     my $lang = &htmlarea_lang();
     my $fullpage = 'false';
-    my $dragmath_prefix;
+    my ($dragmath_prefix,$dragmath_helpicon,$dragmath_whitespace);
     if (ref($args) eq 'HASH') {
         if (exists($args->{'lang'})) {
             if ($args->{'lang'} ne '') {
@@ -1280,6 +1264,8 @@ sub htmlareaselectactive {
         if (exists($args->{'dragmath'})) {
             if ($args->{'dragmath'} ne '') {
                 $dragmath_prefix = $args->{'dragmath'};
+                $dragmath_helpicon=&Apache::loncommon::lonhttpdurl("/adm/help/help.png");
+                $dragmath_whitespace=&Apache::loncommon::lonhttpdurl("/adm/lonIcons/transparent1x1.gif");
             }
         }
     }
@@ -1383,6 +1369,16 @@ sub htmlareaselectactive {
              return;
          }
          mathele.style.display = value;
+         var mathhelpicon = "'.$dragmath_prefix.'helpicon'.'_"+id;
+         mathhelpiconele = document.getElementById(mathhelpicon);
+         if (mathhelpiconele == null) {
+             return;
+         }
+         if (value == "none") {
+             mathhelpiconele.src = "'.$dragmath_whitespace.'";
+         } else {
+             mathhelpiconele.src = "'.$dragmath_helpicon.'";
+         }
      }
 ';