Index: Dev/trunk/js/sequencerScripts.js
===================================================================
--- Dev/trunk/js/sequencerScripts.js	(revision 166)
+++ Dev/trunk/js/sequencerScripts.js	(revision 167)
@@ -70,5 +70,5 @@
 
 function selectStep(uid) {
-    var nodes = document.getElementById("seqContent").childNodes;
+    var nodes = document.getElementById("seqContentWrapper").childNodes;
     for (var i = 0; i < nodes.length; i++) {     //loop through childNodes. Skip first node (whitespace)
         if (hasClass(nodes[i], "displayStep")) {    //check if current childNode is a displayStep, not divider or text.
@@ -144,5 +144,5 @@
     var u = "returnStep.php";
     newAjaxRequest(c, u, function(result) {
-        document.getElementById("seqContent").innerHTML = result.responseText;
+        document.getElementById("seqContentWrapper").innerHTML = result.responseText;
     }, true);
 }
@@ -157,6 +157,6 @@
 }
 
-function drawSteps() {
-    var content = document.getElementById("seqContent");
+function drawSteps2() {
+    var content = document.getElementById("seqContentWrapper");
     var pipeline = document.getElementById("pipelineStringField").value;
     var pipelineTypes = document.getElementById("pipelineTypeField").value;
@@ -169,4 +169,8 @@
 }
 
+function drawSteps() {
+    
+}
+
 function updateSequencer() {
     var plString = document.getElementById("pipelineStringField").value;
@@ -186,5 +190,5 @@
         if (plUpdated[i] == "0") {   // if the element is not up to date
             // first remove the step representation from the sequencer
-            var seqContent = document.getElementById("seqContent");
+            var seqContent = document.getElementById("seqContentWrapper");
             var element = document.getElementById(pl[i]);
             if (element == null) {
@@ -246,5 +250,5 @@
 
 function updateDividers (element) {
-    var seqContent = document.getElementById("seqContent");
+    var seqContent = document.getElementById("seqContentWrapper");
     
     if (element.nextSibling){
@@ -284,6 +288,13 @@
 
 
-function savePipeline() {
-    var answer = confirm("Save changes to pipeline?");
+function savePipeline (confirmSave) {
+    if (confirmSave==true) {
+        var answer = confirm("Save changes to pipeline?");
+    }
+    else {
+        var answer = true;
+    }
+    
+    
     if (answer) {
         var pipeline = document.getElementById("pipelineStringField").value;
@@ -293,5 +304,5 @@
         var session = document.getElementById("sessionField").value;
         var requestString = "uids="+pipeline+"&types="+types+"&sessionUid="+session;
-        //console.log(requestString);
+        console.log(requestString);
         
         
@@ -350,2 +361,61 @@
     return s;
 }
+
+
+function editStep() {
+    // eerst saven, dan de object type zoeken in de typelist, dan redirecten naar de goede pagina
+    savePipeline(false);
+    debugger;
+    var pipeline = document.getElementById("pipelineStringField").value;
+    var pipelineTypes = document.getElementById("pipelineTypeField").value;
+    var selectedStep = document.getElementById("selectedStepField").value;
+    pipeline = stringToArray(pipeline, ",");
+    pipelineTypes = stringToArray(pipelineTypes, ",");
+    var stepType = pipelineTypes[pipeline.indexOf(selectedStep)];
+    
+    var postForm = document.createElement("form");
+    postForm.action = stepType.toLowerCase()+"Editor.php";
+    postForm.method = "POST";
+    var objectUid = document.createElement("input");
+    objectUid.type = "hidden";
+    objectUid.value = selectedStep;
+    postForm.appendChild(objectUid);
+    postForm.submit();
+}
+
+
+
+function moveStep (direction) {
+    // misschien maar eens een loadhiddenfields functie maken voor deze meuk?
+    debugger;
+    var selectedStep = document.getElementById("selectedStepField").value;
+    
+    if (selectedStep != undefined && selectedStep != "") {
+        var pipeline = stringToArray(document.getElementById("pipelineStringField").value, ",");
+        var pipelineTypes = stringToArray(document.getElementById("pipelineTypeField").value, ",");
+        var updated = stringToArray(document.getElementById("pipelineUpdatedField").value, ",");
+    }
+    else {
+        alert("No step selected! Unable to move");
+        return;
+    }
+    
+    var id = pipeline.indexOf(selectedStep);
+    // Dit werkt niet, hij replaced dingen de verkeerde kant op. Lelijke versie met placeholder variables maar weer doen?
+    pipeline[id] = pipeline.splice(pipeline[id+direction], 1, pipeline[id])[0];
+    pipelineTypes[id] = pipelineTypes.splice(pipelineTypes[id+direction], 1, pipelineTypes[id])[0];
+    updated[id] = "0";
+    updated[id+direction] = "0";
+    
+    pipeline = arrayToString(pipeline, ",");
+    pipelineTypes = arrayToString(pipelineTypes, ",");
+    updated = arrayToString(updated, ",");
+    
+    document.getElementById("pipelineStringField").value = pipeline;
+    document.getElementById("pipelineTypeField").value = pipelineTypes;
+    document.getElementById("pipelineUpdatedField").value = updated;
+    updateSequencer();
+    
+    
+    
+}
