Index: trunk/webapps/einotebook/notebook.js
===================================================================
--- trunk/webapps/einotebook/notebook.js	(revision 415)
+++ trunk/webapps/einotebook/notebook.js	(revision 468)
@@ -1,27 +1,2 @@
-/*
-function loadXMLDoc()
-{
-  if (window.XMLHttpRequest)
-  {
-    xmlhttp = new XMLHttpRequest();
-  }
-  else
-  {
-    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
-  }
-
-  xmlhttp.onreadystatechange=function()
-  {
-    if (xmlhttp.readyState==4 && xmlhttp.status==200)
-    {
-      document.getElementById("myDiv").innerHTML = xmlhttp.responseText;
-    }
-  }
-  
-  xmlhttp.open("GET", "ajax_info.txt", true);
-  xmlhttp.send("");
-}
-*/
-
 /**
  * Sets the selected tab to the summary tab and loads the summary page.
@@ -31,84 +6,44 @@
 {
    console.log("setupNotebook() starting");
-   changeTab('summaryTab');
+   changeTab('summaryTab');  // Initially show Summary tab
    showContent('summaryPageContent')
-   loadSummary();
+   loadSummaryPage();
+   loadPages();
    setCookie("time", "0");
    setCookie("scriptScrollY", 0);
    setCookie("summaryScrollY", 0);
+   run();  // start the script scrolling
 }
 
 /**
- * Runs the script.
+ * Loads the summary tab page;
+ */
+function loadSummaryPage()
+{	   
+    incidents.doc = getDocumentFromFrame('summaryTabPage');
+    window.frames[0].loadSummary(incidents); 
+}
+
+/**
+ * Loads content of the pages for Simulation Script and Current Event
+ */
+function loadPages()
+{
+   window.frames[1].loadScript(events, incidents);
+   window.frames[2].loadScript(events, incidents);
+}
+
+/**
+ * Start scrolling the script in an infinite loop.
  */
 function run()
 {
 	run.initialDelay = 1000;
-	
 	setTimeout("run.run()", run.initialDelay);
 	
 	run.run = function()
 	{
-//	    document.getElementById("simulationStatus").innerHTML = "RUNNING";                 
 		setTime();
-		updateStatus();
 	};
-}
-
-/**
- * Displays fading text alerts in the status box (left-top corner).
- */
-function updateStatus()
-{
-	// IF last event if it has not been set before THEN
-    if (typeof updateStatus.lastEvent == 'undefined')
-    {
-    	updateStatus.lastEvent = null;
-    }
-   
-    var latestEvent = events.getLastExecutedEvent(readCookie("time"));
-    
-    
-    // IF a new event executed THEN
-    if (updateStatus.lastEvent != latestEvent)
-    {
-      var i;
-      for (i=0; i<latestEvent.length; i++) {
-          // IF the new event has evaluations THEN
-        if (latestEvent[i].evaluations.evaluations.length == 0)
-        {
-  //    		document.getElementById('updateStatus').innerHTML = "New Event";
-        }
-        else
-        {
-  //    		document.getElementById('updateStatus').innerHTML = "New Evaluation";
-        }
-      }
-		
-    	
-		// fades the text
-		updateStatus.fade = function fade()
-		{
-			// IF the fade color is not black yet THEN
-    		if (fade.hex < 255)
-    		{
-    			fade.hex += 5;
-//    			document.getElementById('updateStatus').style.color = 
-    				"rgb(" + fade.hex + ", " + fade.hex + ", " + fade.hex + ")";  
-    			setTimeout("updateStatus.fade()", 100);	
-    		}
-    		else
-    		{
-//    			document.getElementById('updateStatus').style.color = "white";
-    		}
-
-		};
-        
-		updateStatus.fade.hex = 0;
-		updateStatus.fade();
-    	updateStatus.lastEvent = latestEvent;
-    }
-    
-    setTimeout("updateStatus();", 1000);
 }
 
@@ -129,5 +64,5 @@
             setTime.time = seconds;
 	        // increment time by one second (or initialize it if it has not been set before)
-    //	    setTime.time = (typeof setTime.time == 'undefined') ? 0 : ++setTime.time;
+            //	    setTime.time = (typeof setTime.time == 'undefined') ? 0 : ++setTime.time;
 
             setCookie("time", "" + setTime.time);
@@ -152,23 +87,9 @@
     document.getElementById("summaryTab").className = "notActive";
     document.getElementById("scriptTab").className = "notActive";
-    document.getElementById("CADTab").className = "notActive";
+    document.getElementById("currentTab").className = "notActive";
     document.getElementById("mapsTab").className = "notActive";
 
     /* Set the selected tab to being active */
     document.getElementById(id).className = "activeTab";
-}
-
-/**
- * Loads the script tab page;
- */
-function loadScript()
-{
-}
-
-/**
- * Loads the summary tab page;
- */
-function loadSummary()
-{	   
 }
 
@@ -204,5 +125,5 @@
     hideContent('summaryPageContent');
     hideContent('scriptPageContent');
-    hideContent('cadPageContent');
+    hideContent('currentEventPageContent');
     hideContent('mapsPageContent');    
     document.getElementById(d).style.display = "block"; 
