Index: /main/trunk/model-sites-dev/respooled/collect/popup-video-respooled/js/audiosynth.view.js
===================================================================
--- /main/trunk/model-sites-dev/respooled/collect/popup-video-respooled/js/audiosynth.view.js	(revision 29887)
+++ /main/trunk/model-sites-dev/respooled/collect/popup-video-respooled/js/audiosynth.view.js	(revision 29888)
@@ -221,5 +221,8 @@
 		    thisKey.appendChild(label);
 		    thisKey.setAttribute('ID', 'KEY_' + n + ',' + i);
-		    thisKey.addEventListener(evtListener[0], (function(_temp) { return function() { fnPlayKeyboard({keyCode:_temp}); } })(reverseLookup[n + ',' + i]));
+		    thisKey.addEventListener(evtListener[0], (function(_temp) { return function() { 
+			console.log("**** bespoke evtListener for mousedown, away to call fnPlayKeyboard()");
+			fnPlayKeyboard({keyCode:_temp}); } })(reverseLookup[n + ',' + i]));
+
 		    visualKeyboard[n + ',' + i] = thisKey;
 		    visualKeyboard.appendChild(thisKey);
@@ -282,4 +285,12 @@
 
     var fnPlayKeyboard = function(e) {
+	console.log("***### fnPlayKeyboard() e=" + e); //JSON.stringify(e));
+
+	// check to see if any modal dialogs are open
+	var active_modal_dialogs = $('.ui-widget-overlay:visible');
+	if (active_modal_dialogs.length>0) {
+	    return false;
+	}
+
 
 	if (e.ctrlKey) {
@@ -289,7 +300,9 @@
 	}
 
-	if (e.key == " ") {
+	console.log("**** testing keyboard event key: '" + e.key + "' keycode = " + e.keyCode);
+
+	if (e.keyCode == 32) { // <space-bar>
 	    togglePlayPause();
-	    e.preventDefault();
+	    //e.preventDefault();
 	    return false;
 	}
@@ -442,4 +455,5 @@
 	    while(i--) {
 		keys.unshift(reverseLookup[arr[0][0][i]]);
+		console.log("**** In fnPlaySong(), away to call fnPlayKeyboard()");
 		fnPlayKeyboard({keyCode:keys[0]});
 		}
Index: /main/trunk/model-sites-dev/respooled/collect/popup-video-respooled/js/game-on.js
===================================================================
--- /main/trunk/model-sites-dev/respooled/collect/popup-video-respooled/js/game-on.js	(revision 29887)
+++ /main/trunk/model-sites-dev/respooled/collect/popup-video-respooled/js/game-on.js	(revision 29888)
@@ -1,13 +1,20 @@
 "use strict";
 
-var paper_x_dim = 920;
-var paper_y_dim = 445;
+var goDocStorage = null;
+
+var goPaper = null;
+
+var go_paper_x_dim = 920;
+var go_paper_y_dim = 445;
 
 var gameOnCurrentTimeXPos = 0;
 var gameOnCurrentTimelineRect = null;
 
+var num_midi_pitches = 128;
+
+
 function updateGameOnCurrentTimeline()
 {
-    gameOnCurrentTimeXPos = (mediaPlayer.currentTime / mediaPlayer.duration) *  paper_x_dim;
+    gameOnCurrentTimeXPos = (mediaPlayer.currentTime / mediaPlayer.duration) *  go_paper_x_dim;
     //console.log("*** x pos = " + gameOnCurrentTimeXPos);
 
@@ -15,89 +22,150 @@
 }
 
-function initGameOn()
-{
-    console.log("initGameOn()");
-
-    var gmp_x_dim = $('#gameOnPaper').width();
-    var gmp_y_dim = $('#gameOnPaper').height();
-
-    console.log("*** gmp_x_dim = " + gmp_x_dim);
-    console.log("*** gmp_y_dim = " + gmp_y_dim);
-
-    var paper_x_dim = 920;
-    var paper_y_dim = 445;
-
-    var num_midi_pitches = 128;
-
-    //var paper = Raphael("gameOnPaper",gmp_x_dim,gmp_y_dim);
-    var paper = Raphael("gameOnPaper",paper_x_dim,paper_y_dim);
-    paper.canvas.style.backgroundColor = '#FFFFFF';
-
-    console.log("*** hasLocalStorage = " + hasLocalStorage);
-
-    if (hasLocalStorage) {
-	var docOID = gs.cgiParams.d;
+function getDocStorage(docOID)
+{
+    var docStorage = null;
+
+    if (hasLocalStorage) {
+
+	if (goDocStorage == null) {
+	    var docStorageStr = localStorage.getItem(docOID);
+	    //console.log("***docStorageStr = " + docStorageStr);
 	
-	var docStorageStr = localStorage.getItem(docOID);
-
-	var docStorage = (docStorageStr != null) ? eval("("+docStorageStr+")") : {palTracks:{}, popTracks:{}};
+	    //var docStorage = (docStorageStr != null) ? eval("("+docStorageStr+")") : {palTracks:{}, popTracks:{}};
+	    docStorage = eval("("+docStorageStr+")") || {palTracks:{}, popTracks:{}};
+	    goDocStorage = docStorage;
+	}
+	else {
+	    docStorage = goDocStorage;
+	}
+    }
+
+    return docStorage;
+}
+
+function getActiveTrackLayers(opt_field)
+{
+    var field = opt_field || "name";
+
+    var palActiveLayers = [];
+    $('#palForm input:checked').each(function() {
+        palActiveLayers.push(this[field]);
+    });
+
+    return palActiveLayers;
+}
+
+function populatePalList(docStorage)
+{
+    // populate pal List
+    if (hasLocalStorage) {
 
 	var palTracks = docStorage.palTracks || {};
 
-	// 'palTracks' for the form:
+	//console.log("*** palTracks = " + JSON.stringify(palTracks));
+	var palListKeys = Object.keys(palTracks).sort();
+
+	for (var i=0; i<palListKeys.length; i++) {
+	    var key = palListKeys[i];
+	    var track = palTracks[key];
+	    var name = key;
+	    var cb_name = name.replace(/[ -]/g,"");
+	    var cb_value = name;
+
+	    var opt_checked = (i==0) ? ' checked="checked"' : "";
+
+	    $('#palList').append('<div id="pal'+cb_name+'"><input type="checkbox" '
+				 + '" name="'+cb_name+'" value="' + cb_value + '"'
+				 + opt_checked + '>' 
+				 + name + '</div>');
+	}
+    }
+    else {
+	// Put in some fake data for now
+	$('#palList').append('<input type="checkbox" id="palPianoHero"    name="PianoHero" value="Piano Hero" checked="checked"/>Piano Hero<br />');
+	$('#palList').append('<input type="checkbox" id="palDrumbeatHero" name="DrumbeatHero"  value="Drum-beat Hero" />Drum-beat Hero<br />');
+    }
+}
+
+function displayActiveTrackLayers(docStorage)
+{
+    console.log("displayActiveTrackLayers()");
+
+    goPaper.clear();
+
+    if (hasLocalStorage) {
+
+	// 'palTracks' have the form:
 	//    palTracks[save_name] = [ { name: "my recording 1", baseCTime: 123.3, events: [ .... ] } ]
 
-	var my_recording = palTracks['My Recording'];
-
-	if (my_recording != null) {
-	    var total_duration = mediaPlayer.duration;
-	    console.log("*** total duration = " + total_duration);
-
-	    var min_midi_pitch = num_midi_pitches-1;
-	    var max_midi_pitch = 0;
-
-	    // calculate range of midi pitches present
-	    for (var b=0; b<my_recording.length; b++) {
-		var track_block = my_recording[b];
-		var base_ctime = track_block.baseCTime;
-		var block_events = track_block.events;
-
-		for (var ne=0; ne<block_events.length; ne++) {
-		    var midi_pitch = block_events[ne].midiPitch;
-		    if (midi_pitch < min_midi_pitch) {
-			min_midi_pitch = midi_pitch;
-		    }
-		    if (midi_pitch > max_midi_pitch) {
-			max_midi_pitch = midi_pitch;
+	var palTracks = docStorage.palTracks || {};
+
+	var total_duration = mediaPlayer.duration;
+	//console.log("*** total duration = " + total_duration);
+
+	var atl = getActiveTrackLayers("value");
+	//console.log("*** atl = " + JSON.stringify(atl));
+
+	var min_midi_pitch = num_midi_pitches-1;
+	var max_midi_pitch = 0;
+
+	for (var i=0; i<atl.length; i++) {
+	    var storage_name = atl[i];
+	    var track = palTracks[storage_name];
+
+	    if (track != null) {
+
+		// calculate range of midi pitches present
+		for (var b=0; b<track.length; b++) {
+		    var track_block = track[b];
+		    var base_ctime = track_block.baseCTime;
+		    var block_events = track_block.events;
+
+		    for (var ne=0; ne<block_events.length; ne++) {
+			var midi_pitch = block_events[ne].midiPitch;
+			if (midi_pitch < min_midi_pitch) {
+			    min_midi_pitch = midi_pitch;
+			}
+			if (midi_pitch > max_midi_pitch) {
+			    max_midi_pitch = midi_pitch;
+			}
 		    }
 		}
 	    }
-	    console.log("*** max pitch = " + max_midi_pitch + ", min pitch = " + min_midi_pitch);
-
-	    var raw_midi_range = max_midi_pitch - min_midi_pitch;
-	    var midi_range = Math.max(4,raw_midi_range); 
-
-	    var midi_y_dim_spacing = paper_y_dim / midi_range;
-
-	    for (var b=0; b<my_recording.length; b++) {
-
-		var track_block = my_recording[b];
-		var base_ctime = track_block.baseCTime;
-
-		var block_events = track_block.events;
-
-		for (var ne=0; ne<block_events.length; ne++) {
-
-		    var note_event = block_events[ne];
+	}
+	//console.log("*** max pitch = " + max_midi_pitch + ", min pitch = " + min_midi_pitch);
+	
+	var raw_midi_range = max_midi_pitch - min_midi_pitch;
+	var midi_range = Math.max(4,raw_midi_range); 
+	
+	var midi_y_dim_spacing = go_paper_y_dim / midi_range;
+
+	for (var i=0; i<atl.length; i++) {
+	    var storage_name = atl[i];
+	    var track = palTracks[storage_name];
+
+	    if (track != null) {
+
+		for (var b=0; b<track.length; b++) {
+
+		    var track_block = track[b];
+		    var base_ctime = track_block.baseCTime;
 		    
-		    var startPercTime = (base_ctime + note_event.startCurrentTime)/total_duration;
-		    var rx_org = startPercTime * paper_x_dim;
-		    var ry_org = paper_y_dim - ((note_event.midiPitch - min_midi_pitch) * midi_y_dim_spacing);
+		    var block_events = track_block.events;
 		    
-		    var rx_dim = (note_event.duration/1000)/total_duration * paper_x_dim;
-		    var ry_dim = midi_y_dim_spacing;
-		    
-		    var rect = paper.rect(rx_org,ry_org,rx_dim,ry_dim);
-		    rect.attr({stroke:"black",fill:"#2E52A4"});
+		    for (var ne=0; ne<block_events.length; ne++) {
+			
+			var note_event = block_events[ne];
+			
+			var startPercTime = (base_ctime + note_event.startCurrentTime)/total_duration;
+			var rx_org = startPercTime * go_paper_x_dim;
+			var ry_org = go_paper_y_dim - ((note_event.midiPitch - min_midi_pitch) * midi_y_dim_spacing);
+			
+			var rx_dim = (note_event.duration/1000)/total_duration * go_paper_x_dim;
+			var ry_dim = midi_y_dim_spacing;
+			
+			var rect = goPaper.rect(rx_org,ry_org,rx_dim,ry_dim);
+			rect.attr({stroke:"black",fill:"#2E52A4"});
+		    }
 		}
 	    }
@@ -105,20 +173,109 @@
     }
 
-    gameOnCurrentTimelineRect = paper.rect(-2,0,1,paper_y_dim);
-    console.log("*** gameOnCurrentTimelineRect = " + gameOnCurrentTimelineRect);
-    
+    gameOnCurrentTimelineRect = goPaper.rect(-2,0,1,go_paper_y_dim);
     gameOnCurrentTimelineRect.attr({fill: "red", stroke: "red"});
-    
-}
-
-function pamDelete()
-{
-    //var pamActiveLayers = $('input[type=checkbox]:checked', '#pamForm');
-
-    var pamActiveLayers = [];
-    $('#pamForm input:checked').each(function() {
-        pamActiveLayers.push({name: this.name, value: this.value});
-    });
-
-    return false;
-}
+}
+
+function initGameOn()
+{
+    console.log("initGameOn()");
+
+    goDocStorage = getDocStorage(gs.cgiParams.d);
+
+    //var gmp_x_dim = $('#gameOnPaper').width();
+    //var gmp_y_dim = $('#gameOnPaper').height();
+
+    //console.log("*** gmp_x_dim = " + gmp_x_dim);
+    //console.log("*** gmp_y_dim = " + gmp_y_dim);
+
+
+    //var goPaper = Raphael("gameOnPaper",gmp_x_dim,gmp_y_dim);
+    goPaper = Raphael("gameOnPaper",go_paper_x_dim,go_paper_y_dim);
+    goPaper.canvas.style.backgroundColor = '#FFFFFF';
+
+    console.log("Browser supports LocalStorage: " + hasLocalStorage);
+
+    populatePalList(goDocStorage);
+    displayActiveTrackLayers(goDocStorage);
+}
+
+
+function palDeleteConfirmed()
+{
+    //var palActiveLayers = $('input[type=checkbox]:checked', '#palForm');
+
+    var palActiveLayersID   = getActiveTrackLayers("name");
+    var palActiveLayersValue = getActiveTrackLayers("value");
+
+    var palTracks = goDocStorage.palTracks || {};
+
+    for (var i=0; i<palActiveLayersID.length; i++) {
+	var id = palActiveLayersID[i];
+	$('#pal'+id).remove();
+
+	var value = palActiveLayersValue[i];
+	delete palTracks[value]; 
+    }
+}
+
+
+function palDelete()
+{
+    $('#delete-recording-popup').dialog('open');
+
+    return false;  // no need to process the event any further
+}
+
+function palDisplay()
+{
+    displayActiveTrackLayers(goDocStorage);
+
+    return false;  // no need to process the event any further
+}
+
+function palSave()
+{
+    var palTracks = goDocStorage.palTracks || {};
+
+    var json_edit_str = trackEditor.getSession().getValue();
+    console.log("**** json edit str = " + json_edit_str);
+
+    var json_edit = eval("("+json_edit_str+")");
+
+    for (var key in json_edit){
+	if (json_edit.hasOwnProperty(key)) {
+	    //console.log("*** key = " + key);
+	    var val = json_edit[key];
+	    console.log("**** Saving under key[ " + key + "]: " + JSON.stringify(val));
+	    palTracks[key] = val;	    
+	}
+    }
+
+    if (hasLocalStorage) {
+	var docOID = gs.cgiParams.d;
+	console.log("Saving in Browser localStorage track data for '" + docOID + "'");
+	localStorage.setItem(docOID,JSON.stringify(goDocStorage));
+    }
+}
+
+function palEdit()
+{
+    var palTracks = goDocStorage.palTracks || {};
+
+    var palActiveLayers = getActiveTrackLayers("value");
+
+    var edit_json = {};
+
+    for (var i=0; i<palActiveLayers.length; i++) {
+	var track_name = palActiveLayers[i];
+	edit_json[track_name] = palTracks[track_name];
+    }
+
+    trackEditor.setValue(JSON.stringify(edit_json,null,'\t'));
+    trackEditor.clearSelection();
+
+    $('#edit-recording-popup').dialog('open');
+
+    return false;  // no need to process the event any further
+}
+
Index: /main/trunk/model-sites-dev/respooled/collect/popup-video-respooled/js/in-the-groove.js
===================================================================
--- /main/trunk/model-sites-dev/respooled/collect/popup-video-respooled/js/in-the-groove.js	(revision 29887)
+++ /main/trunk/model-sites-dev/respooled/collect/popup-video-respooled/js/in-the-groove.js	(revision 29888)
@@ -5,8 +5,8 @@
 var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
 
-if( 'webkitAudioContext' in window) {
-    console.log("*** Web Audio found in webkit namespace");
-    audioCtx = new webkitAudioContext();
-}
+//if( 'webkitAudioContext' in window) {
+//    console.log("*** Web Audio found in webkit namespace");
+//    audioCtx = new webkitAudioContext();
+//}
 
 var InTheGroove = false;
@@ -15,8 +15,4 @@
 //var bufferSize = 4096;
 var bufferSize = 512;
-
-
-//window.addEventListener('load', onLoad, false);
-
 
 var prev_input = [0,0];
@@ -32,5 +28,5 @@
 	// Feed the HTMLMediaElement into it
 	var source = audioCtx.createMediaElementSource(this);
-	console.log("**** video source = " + source);
+	//console.log("**** video source = " + source);
 
 	// connect the AudioBufferSourceNode to the tinnyEffectNode
Index: /main/trunk/model-sites-dev/respooled/collect/popup-video-respooled/js/media-player.js
===================================================================
--- /main/trunk/model-sites-dev/respooled/collect/popup-video-respooled/js/media-player.js	(revision 29887)
+++ /main/trunk/model-sites-dev/respooled/collect/popup-video-respooled/js/media-player.js	(revision 29888)
@@ -28,4 +28,5 @@
 
 var hasLocalStorage = (typeof(Storage) !== "undefined");
+var trackEditor = null;
 
 function initialiseMediaPlayer() {
@@ -86,6 +87,10 @@
 
 function togglePlayPause() {
+    //e = e || window.event;
     // If the mediaPlayer is currently paused or has ended
     console.log("togglePlayPause()");
+
+    //console.log("**** event e = " + e);
+
     //console.log("*** mediaPlayer (paused,ended): (" + mediaPlayer.paused + "," + mediaPlayer.ended + ")");
     //console.log("*** currentTime = " + mediaPlayer.currentTime);
@@ -129,4 +134,9 @@
 	    console.log("*** mediaPlayedNotes = " + JSON.stringify(mediaPlayedNotes));
 	}
+
+    // Loose keyboard focus so space-bar for global pause doesn't cause a focused play-button event
+    $('#play-pause-button').blur();
+
+
 }
 
@@ -312,6 +322,16 @@
 	    var docOID = gs.cgiParams.d;
 
-	    var docStorageStr = localStorage.getItem(docOID);
-	    var docStorage = (docStorageStr != null) ? eval("("+docStorageStr+")") : {palTracks:{}, popTracks:{}};
+
+	    // Force reset of what has been stored for this item
+	    //localStorage.setItem(docOID, JSON.stringify(null));
+
+	    var docStorage = getDocStorage(docOID);
+
+	    //var docStorageStr = localStorage.getItem(docOID);
+	    //console.log("*** retrived docStorageStr: " + JSON.stringify(docStorage));
+
+	    //// var docStorage = (docStorageStr != null) ? eval("("+docStorageStr+")") : {palTracks:{}, popTracks:{}};
+	    //var docStorage = eval("("+docStorageStr+")") || {palTracks:{}, popTracks:{}};
+	    //console.log("*** set up docStorage: " + JSON.stringify(docStorage));
 
 	    var palTracks = docStorage.palTracks;
@@ -343,4 +363,12 @@
 	}
 
+	var cb_name = save_name.replace(/[ -]/g,"");
+	var cb_value = save_name;
+	var name     = save_name;
+
+	$('#palList').append('<div id="pal'+cb_name+'"><input type="checkbox" '
+			     + '" name="'+cb_name+'" value="' + cb_value + '"'
+			     + ' checked="checked">' 
+			     + name + '</div>');
 
 	var $dialog = $('#save-recording-popup');
@@ -363,9 +391,9 @@
 	show: {
             effect: "blind",
-            duration: 1000
+            duration: 800
 	},
 	hide: {
             effect: "blind",
-            duration: 500
+            duration: 300
 	},
 
@@ -387,4 +415,68 @@
  
 
+    var delete_dialog = $('#delete-recording-popup').dialog({
+	resizable: false,
+	autoOpen: false, 
+	width: 500,
+	height:200,
+	modal: true,
+
+	show: {
+            effect: "blind",
+            duration: 800
+	},
+	hide: {
+            effect: "blind",
+            duration: 300
+	},
+
+	buttons: {
+            "Delete selected items": function() {
+		// call delete
+		palDeleteConfirmed();
+		$( this ).dialog( "close" );
+            },
+            Cancel: function() {
+		$( this ).dialog( "close" );
+            }
+	}
+    });
+
+
+    var edit_dialog = $('#edit-recording-popup').dialog({
+	resizable: true,
+	autoOpen: false, 
+	width: 800,
+	height:600,
+	modal: true,
+
+	show: {
+            effect: "blind",
+            duration: 800
+	},
+	hide: {
+            effect: "blind",
+            duration: 300
+	},
+
+	buttons: {
+            "Save": function() {
+		// call delete
+		palSave();
+		$( this ).dialog( "close" );
+            },
+            Cancel: function() {
+		$( this ).dialog( "close" );
+            }
+	}
+    });
+
+    trackEditor = ace.edit("trackEditor");
+    trackEditor.getSession().setMode("ace/mode/json");
+    trackEditor.getSession().setUseSoftTabs(false);
+    var UndoManager = require("ace/undomanager").UndoManager;
+    trackEditor.getSession().setUndoManager(new UndoManager());
+
+
 });
 
Index: /main/trunk/model-sites-dev/respooled/collect/popup-video-respooled/style/media-player.css
===================================================================
--- /main/trunk/model-sites-dev/respooled/collect/popup-video-respooled/style/media-player.css	(revision 29887)
+++ /main/trunk/model-sites-dev/respooled/collect/popup-video-respooled/style/media-player.css	(revision 29888)
@@ -108,6 +108,12 @@
     height: 100%;
     width: 100%;
-    opacity: 0.2;
-    filter: Alpha(Opacity=20);
-    background-color: black;
+    opacity: 0.4;
+    filter: Alpha(Opacity=40);
+    /*background-color: black; */
+    /*background: #AAA url("images/ui-bg_flat_0_aaaaaa_40x100.png") repeat scroll 50%  */
+
+    background-color: #AAA;
+    background-repeat: repeat;
+    background-attachment: scroll;
+    background-position: 50%;
 }
Index: /main/trunk/model-sites-dev/respooled/collect/popup-video-respooled/transform/pages/document.xsl
===================================================================
--- /main/trunk/model-sites-dev/respooled/collect/popup-video-respooled/transform/pages/document.xsl	(revision 29887)
+++ /main/trunk/model-sites-dev/respooled/collect/popup-video-respooled/transform/pages/document.xsl	(revision 29888)
@@ -1399,4 +1399,21 @@
 	 </div>
 
+         <div id="delete-recording-popup" title="Delete Tracks">
+	   <p>Are you sure you want to delete the selected tracks?</p>
+ 	 </div>
+
+
+         <div id="edit-recording-popup" title="Edit Tracks">
+	   <style>
+	     #trackEditor {
+	       position: absolute;
+	       top: 0; right: 0; bottom: 0; left: 0;
+	     }
+	   </style>
+	   <div id="trackEditor"><xsl:comment>Track Editor Area</xsl:comment></div>
+ 	 </div>
+
+
+
           <div style="color: white;">
 
@@ -1483,26 +1500,31 @@
 
 
-	    <form id="pamForm" style="width: 99%; margin-top: 10px; margin-bottom: 10px; ">
+	    <form id="palForm" style="width: 99%; margin-top: 10px; margin-bottom: 10px; ">
 	      <fieldset>
-		<legend id="pam-legend">Play Along Layers: Game On!</legend>
-		<input type="checkbox" name="PianoHero" value="PianoHero" />Piano Hero<br />
-		<input type="checkbox" name="DrumHero"  value="DrumHero" />Drum-beat Hero<br />
+		<legend id="pal-legend">Play Along Layers: Game On!</legend>
+		<div id="palList"><xsl:comment>play along list</xsl:comment></div>
 		
 		<div style="padding: 8px;">
-		  <button id="pam-display-overlay" style="background-color:#2E52A4; color:#CCC; width:19%; text-align: center; margin-right: 8px;">
+		  <button id="pal-display-overlay" 
+			  style="background-color:#2E52A4; color:#CCC; width:19%; text-align: center; margin-right: 2px;"
+			  onclick="return palDisplay()">
 		    Display Selected
 		  </button>
-		  <button id="pam-merge-overlay"   style="background-color:#2E52A4; color:#CCC; width:19%; text-align: center; margin-right: 8px;">
+		  <button id="pal-merge-overlay"   
+			  style="background-color:#2E52A4; color:#CCC; width:19%; text-align: center; margin-right: 2px;">
 		    Merge Selected
 		  </button>
-		  <button id="pam-split-overlay"   style="background-color:#2E52A4; color:#CCC; width:19%; text-align: center; margin-right: 8px;">
+		  <button id="pal-split-overlay"   
+			  style="background-color:#2E52A4; color:#CCC; width:19%; text-align: center; margin-right: 2px;">
 		    Split Selected
 		  </button>
-		  <button id="pam-edit-overlay"    style="background-color:#2E52A4; color:#CCC; width:19%; text-align: center; margin-right: 8px;">
+		  <button id="pal-edit-overlay"    
+			  style="background-color:#2E52A4; color:#CCC; width:19%; text-align: center; margin-right: 2px;"
+			  onclick="return palEdit()">
 		  Edit Selected
 		  </button>
-		  <button id="pam-delete-overlay"  
+		  <button id="pal-delete-overlay"  
 			  style="background-color:#2E52A4; color:#CCC; width:19%; text-align: center;"
-			  onclick="return pamDelete()">
+			  onclick="return palDelete()">
 		  Delete Selected
 		  </button>
