Index: trunk/webapps/einotebook/script/script.js
===================================================================
--- trunk/webapps/einotebook/script/script.js	(revision 359)
+++ trunk/webapps/einotebook/script/script.js	(revision 401)
@@ -51,5 +51,5 @@
 			
 			// IF there was previously a current event THEN
-			if (highlightLatestEvent.oldEvent.id != Event.invalidID)
+			if (highlightLatestEvent.oldEvent.id != Event.invalidID && currentEvent.id != 0)
 			{
 				highlightLatestEvent.oldEvent.unhighlight();
@@ -64,4 +64,22 @@
 }
 
+
+/** Change color of text of expired events so they appear disabled.
+  * @param events The list of events
+  * @param currEvent The current event
+  */
+function greyOldEvents(events, currEvent)
+{
+	  // Examine all events
+   for (var evtNum = 0; evtNum < events.length; evtNum++)
+   {
+		// Change color of those before current time and Event
+      if (events[evtNum].time.compareTo(currEvent.time) < 0 && currEvent.id != events[evtNum].id) 
+      {
+			events[evtNum].unhighlight();
+      }
+	}
+}
+
 /**
  * Loads the the script tab for the given document.
@@ -83,6 +101,6 @@
 		// add the Event's html
 		html += Script.events[i].html();
-        //console.log(Script.events[i].html());
-	}
+	}
+       
 	
 	// display events in iframe
@@ -97,4 +115,5 @@
 	Script.events.win.scrollTo(0, readCookie('scriptScrollY'));
 	
+	greyOldEvents(Script.events, Script.events.getLastExecutedEvent(readCookie("time")));
 	highlightLatestEvent();
 
