Index: trunk/webapps/einotebook/script/scrollframe.js
===================================================================
--- trunk/webapps/einotebook/script/scrollframe.js	(revision 468)
+++ trunk/webapps/einotebook/script/scrollframe.js	(revision 548)
@@ -11,2 +11,56 @@
 	events = theEvents;
 }
+
+function collectRatings() 
+{
+    // Consider each event in the incident script
+    for (var evtidx = 0; evtidx < events.length; evtidx++)
+    {
+        // Does this event have any evaluations?
+        if (events[evtidx].evaluations.evaluations.length > 0)
+        {
+            // Examine each evaluation contained in this event
+            for (var rating=0; rating<events[evtidx].evaluations.evaluations.length; rating++ )
+            {
+                // Extract the rating assigned to this item
+                var item = events[evtidx].evaluations.evaluations[rating];
+                // If it not the default value we want to save it
+                if (item.rating > 0)
+                {
+                    console.log("collecting event"+evtidx + " at " + events[evtidx].time.format() +" "+item.type + " " + item.rating)
+                }
+            }
+        }
+    }
+}
+
+/* This is an alternative way to collect the ratings values by reading them directly from the radio buttons 
+function collectRadios()
+{
+    var radios = document.getElementsByTagName('input');
+    var count = 0;
+    for (var j=0; j<radios.length; j++)
+    {
+        if (radios[j].type == 'radio') 
+        {
+            count++;
+            if (radios[j].checked) 
+            {
+                console.log(radios[j].name + " checked " + radios[j].value)                        
+            }
+        }
+    }
+    alert("counted " + count + " radios");
+}
+*/
+
+// TODO
+function submitRatings()
+{
+        // Using POST to send the data 
+        var xhr = new XMLHttpRequest();
+        xhr.open("POST", "../../cgi-bin/saveRatings.py", true);
+        xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
+        // send the collected data
+        xhr.send("msg="+outString);
+}
