Index: Dev/trunk/js/sequencerScripts.js
===================================================================
--- Dev/trunk/js/sequencerScripts.js	(revision 188)
+++ Dev/trunk/js/sequencerScripts.js	(revision 200)
@@ -73,5 +73,5 @@
         // settings fields first
         initSequencer();
-        
+        debugger;
         switch (sequencer.settings.content.contentType.toLowerCase()) {
             case "session":
@@ -230,4 +230,5 @@
         requestString = "args="+JSON.stringify(args);
         newAjaxRequest(requestString, "returnObjectDisplay.php", function(result){
+            console.log(result.responseText);
             insertNewObjects(result.responseText, needsUpdating);
         }, true);
@@ -290,5 +291,4 @@
 
         // This means that one or more steps are being added, not an entire pipeline's worth of them
-        debugger;
         needsUpdating = new Array();
         args = [];
@@ -305,4 +305,5 @@
         requestString = "args="+JSON.stringify(args);
         newAjaxRequest(requestString, "returnObjectDisplay.php", function(result){
+            //console.log(result.responseText);
             insertNewObjects(result.responseText, needsUpdating);
         }, true);
@@ -388,4 +389,5 @@
 
 function insertNewObjects(responseText, needsUpdating) {
+    //console.log(responseText);
     // Container function that calls different insertNewX() functions depending on content type. Called from updateSequencer().
     var response = JSON.parse(responseText);
@@ -520,4 +522,9 @@
     // Loop through returned question objects
     for (var i = 0; i < response.length; i++) {
+        
+        /*
+         * The following block of code defines the layout and composition of the question display
+         */
+        
         // Define the outer frame
         var frameDiv = ce("div");
@@ -570,6 +577,10 @@
         frameDiv.appendChild(controlsDiv);
         
+        /* 
+         * This is where the layout code ends
+         * We proceed to insertion of the created DIV into the document
+         */ 
+        
         // We now have a full question display DIV contained in the frameDiv variable. We should now add this to the sequencer content.
-        debugger;
         for (var j = needsUpdating.length - 1; j >= 0; j--) {
             if (needsUpdating[j][1] != response[i].uid) continue;
@@ -587,4 +598,33 @@
     
     sequencer.state.updating = false;   //re-enable user commands
+}
+
+function saveSurvey(confirmSave) {
+    // Sends an AJAX request to the PHP server that saves the current object.
+    var answer = (confirmSave == true) ? confirm("Save changes?") : true;
+    if (answer == false) return;
+    
+    // Check for object type being edited, adjust requestString and target URL to this information.
+    var request = new Object(), url, requestString;
+    switch (sequencer.settings.content.contentType.toLowerCase()) {
+        case "survey":
+            url = "saveSurvey.php";
+            request.title = sequencer.survey.title;
+            request.uid = sequencer.survey.uid;
+            request.description = sequencer.survey.description;
+            request.questions = new Object();
+            request.questions.uids = sequencer.survey.questions.uids;
+            requestString = "args="+JSON.stringify(request);
+            console.log(request);
+            newAjaxRequest(requestString, url, function(result){
+                console.log(result.responseText);
+            }, true);
+            break;
+        case "blaaaat":
+            url = "savesession.php";
+            request.pipeline.uids = sequencer.session.pipeline.uids;
+            request.pipeline.types = sequencer.session.pipeline.types;
+            break;
+    }
 }
 
@@ -648,14 +688,5 @@
 }
 
-function ajaxInfoRequest(uid, el, type) {
-    // Info panel update.
-    
-    var c = "uid="+uid;
-    c += "&type="+type;
-    var u = "getInfo.php";
-    newAjaxRequest(c, u, function(result) {
-        el.innerHTML = result.responseText;
-    }, true);
-}
+
 
 function savePipeline (confirmSave) {
@@ -784,4 +815,5 @@
 
 // Temp function that creates a dummy question to test the insertNewQuestions function.
+// NOTE: CAN BE REMOVED!
 function debug_addQuestion() {
     // Derp, natuurlijk werkt de addQuestion call niet twee keer. Hij creeert twee keer exact hetzelfde object. Bottom line: het werkt. Nu de editing code voor deze questions gaan schrijven!
@@ -803,4 +835,5 @@
 
 // Temp function that articially switches content type when the page is already loaded, to easily test layout changes and content flow.
+// NOTE: CAN BE REMOVED!
 function debug_switchType() {
     var content = ge("seqContent");
