--- loncom/interface/lonhtmlcommon.pm	2012/05/09 19:46:30	1.313
+++ loncom/interface/lonhtmlcommon.pm	2012/05/28 13:09:17	1.314
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.313 2012/05/09 19:46:30 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.314 2012/05/28 13:09:17 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1370,7 +1370,9 @@ sub htmlareaselectactive {
     #   is used to determine when the countdown timer turns red to warn the user
     #   to think about submitting.
 
-    my $dueDateLayout = '<b>' .  &mt('Due in: {dn} {dl} {hnn}{sep}{mnn}{sep}{snn} - Submit early!') . '</b>';
+    my $dueDateLayout = &mt('Due in: {dn} {dl} {hnn}{sep}{mnn}{sep}{snn} [_1]',"<span id='submitearly'></span>");
+    my $early = '- <b>'.&mt('Submit Early').'</b>';
+    my $pastdue = '- <b>'.&mt('Past Due').'</b>';
     $output .= <<JAVASCRIPT;
 
     var documentReadyTime;
@@ -1382,6 +1384,12 @@ sub htmlareaselectactive {
          layout: "$dueDateLayout",
          onTick: function (periods) {
 	    var latencyEstimate = (documentReadyTime - clientTime) * 2;
+            if(\$.countdown.periodsToSeconds(periods) < (300 + latencyEstimate)) {
+               \$("#submitearly").html("$early");
+               if (\$.countdown.periodsToSeconds(periods) < 1) {
+                    \$("#submitearly").html("$pastdue");
+               }
+            }
             if(\$.countdown.periodsToSeconds(periods) < (60 + latencyEstimate)) {
                \$(this).css("color", "red");   //Highlight last minute.
             }
@@ -1568,7 +1576,8 @@ returns: nothing
     my %tools = ();
     
     sub breadcrumbs {
-        my ($component,$component_help,$menulink,$helplink,$css_class,$no_mt, $CourseBreadcrumbs) = @_;
+        my ($component,$component_help,$menulink,$helplink,$css_class,$no_mt, 
+            $CourseBreadcrumbs) = @_;
         #
         $css_class ||= 'LC_breadcrumbs';
 
@@ -1643,10 +1652,6 @@ returns: nothing
         $links .= &htmltag( 'li', htmltag($CourseBreadcrumbs ? 'b' : 'h1',
                 $lasttext), {title => $lasttext});
 
-        unless ($CourseBreadcrumbs) {
-            $links .=   '<li> <span id="duedatecountdown"></span></li>';
-        }
-
         my $icons = '';
         $faq  = $last->{'faq'}  if (exists($last->{'faq'}));
         $bug  = $last->{'bug'}  if (exists($last->{'bug'}));
@@ -1724,7 +1729,7 @@ Currently there are 3 possible values fo
 left of breadcrumbs line
 
 =item tools 
-right of breadcrumbs line
+remaining items in right of breadcrumbs line
 
 =item advtools 
 advanced tools shown in a separate box below breadcrumbs line