Index: /other-projects/nz-flag-design/trunk/main-form/choose-palette.html
===================================================================
--- /other-projects/nz-flag-design/trunk/main-form/choose-palette.html	(revision 29981)
+++ /other-projects/nz-flag-design/trunk/main-form/choose-palette.html	(revision 29982)
@@ -115,4 +115,8 @@
 	        if (typeof flagCanvasSettings !== 'undefined') {
                   flagCanvasSettings.backgroundColor = colour.toHexString();
+		    if (window.localStorage) {					
+		        console.log("*** storing bacgkground flag color = " + 	   flagCanvasSettings.backgroundColor);
+			 window.localStorage.setItem("flagBackgroundColor",flagCanvasSettings.backgroundColor);
+		    }
 	        }
             }
Index: /other-projects/nz-flag-design/trunk/main-form/enter-name.html
===================================================================
--- /other-projects/nz-flag-design/trunk/main-form/enter-name.html	(revision 29981)
+++ /other-projects/nz-flag-design/trunk/main-form/enter-name.html	(revision 29982)
@@ -13,5 +13,5 @@
     <!--
      <script>
-     
+
     if (jQuery.mobile) {
 	$(document).on("pagebeforeshow", "enter-name", function(event,data) { 
@@ -91,6 +91,12 @@
 
 	      <div style="padding-top: 20px; padding-left: 10px; padding-right: 10px">
-		<input id="mySubmit" type="submit" value="Submit Flag Design" disabled="disabled" />
+		<input id="mySubmit" type="submit" value="Submit Flag Design" disabled="disabled" >
 	      </div>
+
+
+	      <div style="padding-top: 20px; padding-left: 10px; padding-right: 10px; font-size: 140%;">
+	      <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.
+	      </dvi>
+
 	    </form>
 
@@ -262,7 +268,74 @@
 
 
-              // The following supresses the "unsaved changes, are you sure" popup
-		window.addEventListener('beforeunload', function(e) {
-			return; });
+/*
+$('#publish-data').validate({
+    rules: {
+        myFlagName: {
+            required: true
+        },
+        myName: {
+            required: true
+        },
+        myEmail: {
+            required: true
+        },
+        myDesc: {
+            required: true
+        }
+
+    },
+    messages: {
+        myFlagName: {
+            required: "Please enter a name for your flag."
+        },
+        myName: {
+            required: "Please enter your name."
+        },
+        myEmail: {
+            required: "Please enter your email."
+        },
+        myDesc: {
+            required: "Please describe your flag design."
+        }
+
+    },
+    errorPlacement: function (error, element) {
+        error.appendTo(element.parent().prev());
+    },
+    submitHandler: function (form) {
+        var pubName = $('#myFlagName').val();
+        var pubNameNoQuotes = pubName.replace(/"/g,"");
+	console.log("*** pubName stripped of quotes: " + pubNameNoQuotes);
+
+	$('#myFlagName').val(pubNameNoQuotes);
+        return true;
+
+//        $(':mobile-pagecontainer').pagecontainer('change', '#success', {
+//            reload: false
+//        });
+//        return false;
+
+
+    }
+});
+*/
+
+/*
+	      $('#myFlagName').on('submit', function(e){
+	           //e.preventDefault();
+  	           var pubName = $('#myFlagName').val();
+		   var pubNameNoQuotes = pubName.replace(/"/g,"");
+		   console.log("*** pubName stripped of quotes: " + pubNameNoQuotes);
+
+		   $('#myFlagName').val(pubNameNoQuotes);
+		   this.submit();
+	      });
+*/
+
+
+              // The following (hopefully) supresses the "unsaved changes, are you sure" popup
+	      //window.addEventListener('beforeunload', function(e) {
+	      //		return; });
+
 
 							     
Index: /other-projects/nz-flag-design/trunk/main-form/iterative-design-jsp.html
===================================================================
--- /other-projects/nz-flag-design/trunk/main-form/iterative-design-jsp.html	(revision 29981)
+++ /other-projects/nz-flag-design/trunk/main-form/iterative-design-jsp.html	(revision 29982)
@@ -198,4 +198,12 @@
                     var canvasWidth = svgCanvas.getResolution().w;
                     var canvasHeight = svgCanvas.getResolution().h;
+
+		    if (window.localStorage) {						   
+			 var flagBackgroundColor = window.localStorage.getItem("flagBackgroundColor");
+			 console.log("**** falg background color = " + flagBackgroundColor);
+			 if (flagBackgroundColor != null) {
+			     settings.backgroundColor = flagBackgroundColor;
+			   }
+		     }
 
                     var userBackground = settings.backgroundColor;
Index: /other-projects/nz-flag-design/trunk/main-form/my-design.jsp
===================================================================
--- /other-projects/nz-flag-design/trunk/main-form/my-design.jsp	(revision 29981)
+++ /other-projects/nz-flag-design/trunk/main-form/my-design.jsp	(revision 29982)
@@ -22,5 +22,24 @@
     <script src="lib-slider/js/jquery.mobile-1.3.0.js"></script> 
 
-
+    <script>
+     window.addEventListener("beforeunload", function (event) {
+	console.log("beforeunload() called");
+	//var design_frame = document.getElementById('design-2d-iframe')
+        //var svgEditor = design_frame.contentWindow.svgEditor;
+
+	//var name = 'svgedit-' + svgEditor.curConfig.canvasName;
+	var name = 'svgedit-' + "default";
+
+	if (window.localStorage) {
+	   console.log("Removing stored SVG picture");
+	   window.localStorage.removeItem(name);
+	   window.localStorage.removeItem("flagBackgroundColor");
+	}
+
+        event.preventDefault();
+	return;
+     });
+
+    </script>
 
   <%@ page import="java.io.*,java.util.*,java.awt.image.*,javax.imageio.*,javax.xml.bind.DatatypeConverter,java.nio.file.*,org.json.*" %>
@@ -134,6 +153,16 @@
 
 	 BufferedWriter bw = new BufferedWriter(new FileWriter(full_pub_json_file));
-         bw.write("{ \"name\": \"" + name + "\", \"email\": \"" + email + "\", \"desc\": \"" + desc + "\"}");
+
+
+	 JSONObject obj = new JSONObject();
+	 obj.append("pubName",pub_name);
+	 obj.append("name",name);
+	 obj.append("email",email);
+	 obj.append("desc",desc);
+
+	 obj.write(bw);
+         // bw.write("{ \"pubName\": \"" + pub_name + "\", \"name\": \"" + name + "\", \"email\": \"" + email + "\", \"desc\": \"" + desc + "\"}");
          bw.close();
+
        }
        catch (Exception e) {
@@ -203,10 +232,31 @@
 
        JSONObject obj = new JSONObject(everything);
-       name  = obj.getString("name");
-       email = obj.getString("email");
-       desc  = obj.getString("desc");
-     }
-
-     
+       try {
+           name  = obj.getString("name");
+       }
+       catch (Exception e) {
+           name  = obj.getJSONArray("name").getString(0);
+       }
+
+       try {
+           email = obj.getString("email");
+       }
+       catch (Exception e) {
+           email = obj.getJSONArray("email").getString(0);
+       }
+
+       try {
+           desc  = obj.getString("desc");
+       }
+       catch (Exception e) {
+           desc  = obj.getJSONArray("desc").getString(0);
+       }
+     }
+
+     // For use in Javascript
+     pub_name = pub_name.replace("\"","\\\"");
+     name  = name.replace("\"","\\\"");
+     email = email.replace("\"","\\\"");
+     desc  = desc.replace("\"","\\\"");     
    %>
 
@@ -224,12 +274,28 @@
 
   <body>
+
+  <%     
+     //String action = request.getParameter("action");
+     // only add FB like ability if visiting the item after it has been published
+
+     if (action == null) {
+  %>
+
 <div id="fb-root"></div>
 <script>(function(d, s, id) {
-  var js, fjs = d.getElementsByTagName(s)[0];
-  if (d.getElementById(id)) return;
-  js = d.createElement(s); js.id = id;
-  js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3&appId=538218162984944";
-  fjs.parentNode.insertBefore(js, fjs);
+
+    var js, fjs = d.getElementsByTagName(s)[0];
+    if (d.getElementById(id)) return;
+    js = d.createElement(s); js.id = id;
+    //js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3&appId=538218162984944";
+    js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3&appId=1612166589021423";
+
+    fjs.parentNode.insertBefore(js, fjs);
+
 }(document, 'script', 'facebook-jssdk'));</script>
+
+  <% 
+      }
+  %>
 
     <div data-role="page" id="innovation-story-01" class="demo-page">
@@ -256,5 +322,5 @@
 	      <div style="display: inline-block; position: relative">
 	        <div>
-		  <a id="myflag-svg" data-ajax="false" ><img id="myflag-png" height="200" style="border: none;"/></a>
+		  <a id="myflag-svg" data-ajax="false" ><img id="myflag-png" title="Click on the image to see a larger SVG (Scalable Vector Graphic) version" height="200" style="border: none;"/></a>
 	        </div>
 
@@ -274,5 +340,5 @@
 <script type="text/javascript">
 
-var published_id = "<%= request.getParameter("pub-name") %>";
+var published_id = "<%= pub_name %>";
 var name  = "<%= name %>";
 var email = "<%= email %>";
@@ -281,5 +347,5 @@
 document.write("  <div style=\"width: 500px; background: #181818; padding: 5px; margin: 10px;\">");
 document.write("    <p>Designer: " + name + "<p/>");
-document.write("    <p>Email: " + email + "<p/>");
+//document.write("    <p>Email: " + email + "<p/>");
 document.write("    <p>Description: " + desc + "<p/>");
 document.write("  </div>");
@@ -291,5 +357,5 @@
 var base_url = location.protocol + '//' + location.host + location.pathname;
 
-a2a_config.linkurl = base_url + "?pub-name=" + published_id
+a2a_config.linkurl = base_url + "?pub-name=" + published_id.replace(/ /g,"+");
 
 </script>
@@ -326,4 +392,15 @@
 
     <center>
+    <p style="font-size: 220%;">
+      <i>
+	Or else view other flags designed at Fieldays through
+	<a target="_blank" href="http://www.greenstone.org/greenstone3/flag-library/collection/fieldays/page/about">
+	  this link
+	</a>
+     </i>
+    </p>	
+    </center>
+
+    <center>
     <p style="font-size: 200%;">
       <i>
