Index: Dev/trunk/js/sequencerScripts.js
===================================================================
--- Dev/trunk/js/sequencerScripts.js	(revision 185)
+++ Dev/trunk/js/sequencerScripts.js	(revision 188)
@@ -145,6 +145,7 @@
         case "survey":
             sequencer.settings.content.orientation = "vertical";
-            sequencer.settings.content.width = 800;
-            sequencer.settings.content.height = "auto";
+            sequencer.settings.content.width = 650;     //guesstimated
+            var roomH = screen.availHeight;
+            sequencer.settings.content.height = roomH - 200;
             content.style.width = sequencer.settings.content.width+"px";
             content.style.height = sequencer.settings.content.height+"px";
@@ -179,10 +180,4 @@
             break;
     }
-    
-    
-    
-    
-    //console.log(sequencer);
-    sequencer.state.updating = false;   // Re-enable new actions
 }
 
@@ -258,5 +253,5 @@
 // THIS NEEDS SOME WORK! A LOT OF IT ACTUALLY!
 function updateSequencer_Survey() {
-    //debugger;
+    
     var content = ge("seqContentWrapper");
     var requestString, needsUpdating, args;
@@ -283,7 +278,7 @@
         requestString = "args="+JSON.stringify(args);
         newAjaxRequest(requestString, "returnObjectDisplay.php", function(result){
-            //debugger;
             content.removeChild(loadingGif);
             insertNewObjects(result.responseText, needsUpdating);
+            sequencer.state.loaded = true;
         }, true);
         sequencer.state.loaded = false;
@@ -293,14 +288,16 @@
     }
     else {
+
         // This means that one or more steps are being added, not an entire pipeline's worth of them
+        debugger;
         needsUpdating = new Array();
         args = [];
         // Add steps that need updating to the needsUpdating array (index, uid, type).
-        for (var i = 0; i < sequencer.session.pipeline.uids.length; i++) {
-            if (sequencer.session.pipeline.upToDate[i] == true) continue;
-            needsUpdating.push(new Array(i, sequencer.session.pipeline.uids[i], sequencer.session.pipeline.types[i]));
+        for (var i = 0; i < sequencer.survey.questions.uids.length; i++) {
+            if (sequencer.survey.questions.upToDate[i] == true) continue;
+            needsUpdating.push(new Array(i, sequencer.survey.questions.uids[i], "Question"));
             args.push({
-                uid: sequencer.session.pipeline.uids[i],
-                type: sequencer.session.pipeline.types[i]
+                uid: sequencer.survey.questions.uids[i],
+                type: "Question"
             });        
         }
@@ -326,5 +323,7 @@
         updateDividers();
     // End optional
-    }
+        
+    }
+        
 }
 
@@ -363,4 +362,7 @@
         }
     }
+    
+    // Because updateDividers is always called last, we set updating to false here, so the user can again issue commands to the pipeline
+    sequencer.state.updating = false;   // Re-enable new actions
 }
 
@@ -387,5 +389,4 @@
 function insertNewObjects(responseText, needsUpdating) {
     // Container function that calls different insertNewX() functions depending on content type. Called from updateSequencer().
-    debugger;
     var response = JSON.parse(responseText);
     // For now I assume that only one type of element can be displayed in the editor at one time. Therefore, the type of response[0] is the type of all elements of response.
@@ -394,5 +395,5 @@
             insertNewSteps(response, needsUpdating);
             break;
-        case "question":
+        case "survey":
             insertNewQuestions(response, needsUpdating);
             break;
@@ -411,5 +412,4 @@
         
     newAjaxRequest(c, u, function(result) {
-        debugger;
         sequencer.survey.questions.uids.push(removeNL(result.responseText));
         sequencer.survey.questions.upToDate.push(false);
@@ -517,5 +517,4 @@
 function insertNewQuestions(response, needsUpdating) {
     //Code that inserts or replaces new object displays in the sequencer. Question version.
-    
     var content = ge("seqContentWrapper");
     // Loop through returned question objects
@@ -566,18 +565,26 @@
         controlsDiv.appendChild(editButton);
         controlsDiv.appendChild(removeButton);
+        frameDiv.addEventListener("click", function(){
+            clickStep(this.id);
+        }, false);
         frameDiv.appendChild(controlsDiv);
         
         // 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;
             if (needsUpdating[j][0] > sequencer.state.numSteps-1) {
                 content.appendChild(frameDiv);
+                sequencer.state.numSteps++;
             }
             else {
                 content.replaceChild(frameDiv, content.childNodes[needsUpdating[j][0]*2]);
             }
-            sequencer.state.numSteps++;
-        }
-    }
+            sequencer.survey.questions.upToDate[needsUpdating[j][0]] = true;
+            
+        }
+    }
+    
+    sequencer.state.updating = false;   //re-enable user commands
 }
 
@@ -609,6 +616,17 @@
     if (element) {
         addClass(element, "selected");
-        var type = sequencer.session.pipeline.types[sequencer.session.pipeline.uids.indexOf(uid)];
-        ajaxInfoRequest(uid, ge("infoPanelContent"), type);
+        var type;
+        switch (sequencer.settings.content.contentType.toLowerCase()) {
+            case "session":
+                type = sequencer.session.pipeline.types[sequencer.session.pipeline.uids.indexOf(uid)];
+                break;
+            case "survey":
+                type = "Question";
+                break;
+            default:
+                //Dunno
+                break;
+        }
+        (type != "survey") ? ajaxInfoRequest(uid, ge("infoPanelContent"), type) : type=type /*This does nothing*/;
         sequencer.state.selectedObject.uid = uid;
         sequencer.state.selectedObject.index = null;  //Don't know how to do this yet.
