Index: Dev/trunk/js/sequencerScripts.js
===================================================================
--- Dev/trunk/js/sequencerScripts.js	(revision 152)
+++ Dev/trunk/js/sequencerScripts.js	(revision 153)
@@ -51,31 +51,20 @@
 function selectStep(uid) {
     document.getElementById(uid).addClass("selected");
-    document.sequencer.controls.selectedStep.value = uid;
+    var selectedInfo = document.getElementById("selectedStepField");
+    if (selectedInfo == null) {     // This is the first time a step is selected after a reload of the page, therefore a hidden input field is not yet present.
+        selectedInfo = document.createElement("input")
+        selectedInfo.setAttribute("type","hidden");
+        selectedInfo.setAttribute("id","selectedStepField");
+        selectedInfo.setAttribute("value",uid);
+        var hiddenInputFields = document.getElementById("hiddenInputs");
+        hiddenInputFields.appendChild(selectedInfo);
+    }
+    else {      // There already exists a hidden input field with id selectedStepField, therefore we only change the value of this field.
+        var hiddenInput = document.getElementById("selectedStepField");
+        hiddenInput.value = uid;
+    }
 }
                                                                             
                                                                             
-/*
- * ajaxStepRequest gets  the markup for displaying a step in the sequencer from returnStep.php
- * Using ajax principle allows for editing of pipeline without constantly refreshing the page.
- */
-
-function ajaxStepRequest(UID) {
-    var c = "uid="+UID;
-    var u = "returnStep.php";
-    newAjaxRequest(c, u, function(result) {
-        var newDiv = result.responseText;
-        document.getElementById("seqContent").appendChild(newDiv);
-    });
-}
-
-function ajaxInfoRequest(id, el) {
-    var uid = id;
-    var c = "uid="+uid;
-    var u = "getInfo.php";
-    newAjaxRequest(c, u, function(result) {
-        el.innerHTML = result.responseText;
-    });
-}
-
 /*
  * This function allows for simple use of AJAX requests.
@@ -133,26 +122,56 @@
     xml.send(contentString);
 }
+
+/*
+ * ajaxStepRequest gets  the markup for displaying a step in the sequencer from returnStep.php
+ * Using ajax principle allows for editing of pipeline without constantly refreshing the page.
+ */
+
+function ajaxStepRequest(UID) {
+    var c = "uid="+UID;
+    var u = "returnStep.php";
+    newAjaxRequest(c, u, function(result) {
+        var newDiv = document.createElement("div");
+        newDiv.innerHTML = result.responseText;
+        document.getElementById("seqContent").appendChild(newDiv);
+    });
+}
+
+function ajaxInfoRequest(id, el) {
+    var uid = id;
+    var c = "uid="+uid;
+    var u = "getInfo.php";
+    newAjaxRequest(c, u, function(result) {
+        el.innerHTML = result.responseText;
+    });
+}
                             
 
+
+
+
+
+
 function drawSteps() {
-    var sequencer = document.getElementById("sequencer");
-    var seqContent = document.getElementById("seqContent");
-                
-    // first delete all current children of seqContent (to reset the sequencer).
-    while (seqContent.childNodes.length > 0) {
-        var step = seqContent.childNodes[0];
-        step.parentNode.removeChild(step);
-    }
-                
-    // get pipeline contents from hidden form inputs.
-    var pipeline = sequencer.controls.pipeline.value;
-    var pipeline = pipeline.split(", ");
-                
+    var content = document.getElementById("seqContent");
+    var pipeline = document.getElementById("pipelineStringField").value;
+    var copy = pipeline;
+    pipeline = copy.split(",");
+    
     // then do an xmlhttp request for each step to be added to the sequencer
     var numberOfSteps = pipeline.length;
-    for (var i = 0; i > numberOfSteps; i++) {
+    for (var i = 0; i < numberOfSteps; i++) {
         ajaxStepRequest(pipeline[i]);
+        if (i < (numberOfSteps-1)) {
+            ajaxStepRequest("divider");
+        }
     }
+    
                 
 }
 
+function updatePipelineHidden (pipelineString) {
+    
+}
+
+
