--- loncom/interface/lonhtmlcommon.pm	2007/11/02 23:41:01	1.168
+++ loncom/interface/lonhtmlcommon.pm	2008/01/15 03:42:35	1.172
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.168 2007/11/02 23:41:01 albertel Exp $
+# $Id: lonhtmlcommon.pm,v 1.172 2008/01/15 03:42:35 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -645,6 +645,8 @@ sub javascript_nothing {
 ##############################################
 ##############################################
 sub javascript_docopen {
+    my ($mimetype) = @_;
+    $mimetype ||= 'text/html';
     # safari does not understand document.open() and loads "text/html"
     my $nothing = "''";
     my $user_browser;
@@ -658,7 +660,7 @@ sub javascript_docopen {
     if ($user_browser eq 'safari' && $user_os =~ 'mac') {
         $nothing = "document.clear()";
     } else {
-	$nothing = "document.open('text/html','replace')";
+	$nothing = "document.open('$mimetype','replace')";
     }
     return $nothing;
 }
@@ -868,7 +870,7 @@ sub Create_PrgWin {
          function openpopwin () {
          popwin=open(\'\',\'popwin\',\'width=400,height=100\');".
         "popwin.document.writeln(\'".$start_page.
-              "<h4>$heading<\/h4>".
+              "<h4>".&mt("$heading")."<\/h4>".
               "<form action= \"\" name=\"popremain\" method=\"post\">".
               '<input type="text" size="'.$width.'" name="remaining" value="'.
 	      &mt('Starting').'" /><\\/form>'.$end_page.
@@ -887,8 +889,7 @@ sub Create_PrgWin {
 	}
 	if (!$inputname) {
 	    $prog_state{'inputname'}=&get_uniq_name();
-	    &r_print($r,$heading.' <input type="text" name="'.$prog_state{'inputname'}.
-		     '" size="'.$width.'" />');
+	    &r_print($r,&mt("$heading [_1]",' <input type="text" name="'.$prog_state{'inputname'}.'" size="'.$width.'" />'));
 	} else {
 	    $prog_state{'inputname'}=$inputname;
 	    
@@ -1234,16 +1235,19 @@ returns: nothing
 	if (!defined($menulink)) { $menulink=1; }
         if ($menulink) {
             my $description = 'Menu';
+            my $no_mt_descr = 0;
             if (exists($env{'request.course.id'}) && 
                 $env{'request.course.id'} ne '') {
                 $description = 
                     $env{'course.'.$env{'request.course.id'}.'.description'};
+                $no_mt_descr = 1;
             }
             unshift(@Crumbs,{
                     href   =>'/adm/menu',
                     title  =>'Go to main menu',
                     target =>'_top',
                     text   =>$description,
+                    no_mt  =>$no_mt_descr,
                 });
         }
         my $links .= 
@@ -1473,7 +1477,14 @@ sub course_select_row {
     my ($title,$formname,$totcodes,$codetitles,$idlist,$idlist_titles,
 	$css_class) = @_;
     my $output = &row_title($title,$css_class);
-    $output .= qq|
+    $output .= &course_selection($formname,$totcodes,$codetitles,$idlist,$idlist_titles);
+    $output .= &row_closure();
+    return $output;
+}
+
+sub course_selection {
+    my ($formname,$totcodes,$codetitles,$idlist,$idlist_titles) = @_;
+    my $output = qq|
 <script type="text/javascript">
     function coursePick (formname) {
         for  (var i=0; i<formname.coursepick.length; i++) {
@@ -1546,8 +1557,7 @@ sub course_select_row {
             $output .= '</tr></table><br />';
         }
     }
-    $output .= '<input type="radio" name="coursepick" value="specific" onclick="coursePick(this.form);opencrsbrowser('."'".$formname."'".','."'".'dccourse'."'".','."'".'dcdomain'."'".','."'".'coursedesc'."','','1'".')" />'.&mt('Pick specific course(s):').' '.$courseform.'&nbsp;&nbsp;<input type="text" value="0" size="4" name="coursetotal" /><input type="hidden" name="courselist" value="" />selected.<br />'."\n";
-    $output .= &row_closure();
+    $output .= '<input type="radio" name="coursepick" value="specific" onclick="coursePick(this.form);opencrsbrowser('."'".$formname."','dccourse','dcdomain','coursedesc','','1'".')" />'.&mt('Pick specific course(s):').' '.$courseform.'&nbsp;&nbsp;<input type="text" value="0" size="4" name="coursetotal" /><input type="hidden" name="courselist" value="" />selected.<br />'."\n";
     return $output;
 }