Index: trunk/webapps/einotebook/scripts/Event.js
===================================================================
--- trunk/webapps/einotebook/scripts/Event.js	(revision 364)
+++ trunk/webapps/einotebook/scripts/Event.js	(revision 418)
@@ -33,4 +33,5 @@
 	this.highlight = highlight;
 	this.unhighlight = unhighlight;
+    this.normalize = normalize;
 	this.focus = focus;
 	
@@ -184,4 +185,7 @@
 		events.doc.getElementById(this.eventHeaderID).style.borderColor = "blue";
 		events.doc.getElementById(this.eventHeaderID).style.backgroundColor = "yellow";
+		events.doc.getElementById(this.eventHeaderID).style.color = "black";
+		events.doc.getElementById(this.dataID).style.color = "black";
+        events.doc.getElementById(this.dataID).style.backgroundColor = incidentColor[this.incident.number];
 		
 		// IF this event is expanded THEN
@@ -194,5 +198,5 @@
 			events.doc.getElementById(this.dataID).style.border = "none";
 		}
-		
+	
 	}
 	
@@ -211,4 +215,18 @@
 		events.doc.getElementById(this.dataID).style.color = "gray";
 	}
+	/**
+	 * Normalize this Event: provide normal background and text colors.
+	 */
+	function normalize()
+	{
+        var myColor = incidentColor[this.incident.number];
+		events.doc.getElementById(this.eventHeaderID).style.backgroundColor = "white";
+		events.doc.getElementById(this.eventHeaderID).style.borderColor = "black";
+		events.doc.getElementById(this.eventHeaderID).style.color = "black";
+		events.doc.getElementById(this.dataID).style.color = "black";
+        events.doc.getElementById(this.dataID).style.backgroundColor = myColor;
+		events.doc.getElementById(this.eventHeaderID).style.backgroundColor = myColor;
+    }		
+
 	
 	/**
Index: trunk/webapps/einotebook/scripts/Events.js
===================================================================
--- trunk/webapps/einotebook/scripts/Events.js	(revision 415)
+++ trunk/webapps/einotebook/scripts/Events.js	(revision 418)
@@ -25,4 +25,5 @@
 events.expandAllProperties = events_expandAllProperties;
 events.expandAllEvaluations = events_expandAllEvaluations;
+events.setEmphasis = events_setEmphasis;
 events.expandAll = events_expandAll;
 events.collapseAll = events_collapseAll;
@@ -300,4 +301,27 @@
 	events.expandAllEvents();	
 }
+
+/** Set emphasis for all events.  
+    Change color of text of expired events so they appear disabled, and future 
+    events appear normal.
+  */
+function events_setEmphasis()
+{
+    var currentTime = readCookie("time");
+    // FOR each Event 
+    for (var i = 0; i < this.length - 1; i++)
+    {
+	  // Change color of those before current time 
+      if (this[i].time.getSeconds() <= currentTime) 
+      {
+	      this[i].unhighlight();
+      }
+      else
+      {
+	      this[i].normalize(); // normal colors for everything else
+      }          
+   }
+}
+
 
 /**
Index: trunk/webapps/einotebook/script/script.js
===================================================================
--- trunk/webapps/einotebook/script/script.js	(revision 415)
+++ trunk/webapps/einotebook/script/script.js	(revision 418)
@@ -35,47 +35,11 @@
 function highlightLatestEvent() 
 {
-	var currentEventArray = Script.events.getLastExecutedEvent(readCookie("time"));
+    Script.events.setEmphasis();  // Set text colors on all events
 
-	// IF the old event is has not been set THEN
-	if (typeof highlightLatestEvent.oldEventArray == 'undefined')
-	{
-		highlightLatestEvent.oldEventArray = []; /* set up array of old events */
-		var currentEvent = new Object(); 
-		highlightLatestEvent.oldEventArray.push(currentEvent);
-		highlightLatestEvent.oldEventArray[0].id = Event.invalidID;
-	}
-
-	// IF a current event exists THEN
-	if (currentEventArray !== null)
-	{
-		var found = false; /* check if a current event is found in the old event array */
-
-		/* traverse the array of current event to check 
-		if there is event already in the old event array */
-		// IF there is a new current event THEN	
-		for (j=0; j<highlightLatestEvent.oldEventArray.length; j++) {
-			var oldEvent = highlightLatestEvent.oldEventArray[j];
-			found = false;
-			for (i=0; i<currentEventArray.length; i++) {
-				var currentEvent = currentEventArray[i];
-				if (oldEvent.id === currentEvent.id)
-				{
-					found = true;	
-					break;		
-				} 
-			}
-			/* unhighlight all the events that are no longer current */
-			if (!found && oldEvent.id !== Event.invalidID) {
-				oldEvent.unhighlight();
-			}		
-		}
-
-		/* highlight the current event in the array */
-		for (i=0; i<currentEventArray.length; i++) {
-			currentEventArray[i].highlight();
-		}
-
-		/* update the old events array with current event array */
-		highlightLatestEvent.oldEventArray = currentEventArray;
+    var currentEventArray = Script.events.getLastExecutedEvent(readCookie("time"));
+	/* highlight the items in the current event array */
+    for (i=0; i<currentEventArray.length; i++) 
+    {
+		currentEventArray[i].highlight();
 	}
 
