Index: main/trunk/greenstone3/web/interfaces/oran/js/format_util.js
===================================================================
--- main/trunk/greenstone3/web/interfaces/oran/js/format_util.js	(revision 24900)
+++ main/trunk/greenstone3/web/interfaces/oran/js/format_util.js	(revision 24907)
@@ -2,5 +2,5 @@
 console.log("Loading format_util.js\n");
 
-// Ensures that a change to a text field is remembered
+/* Ensures that a change to a text field is remembered */
 function onTextChange(item, text)
 {
@@ -9,5 +9,5 @@
 }
 
-// Ensures that a change to a select field is remembered
+/* Ensures that a change to a select field is remembered */
 function onSelectChange(item)
 {
@@ -24,4 +24,6 @@
 }
 
+
+/* Get substring */
 function getSubstring(str, first, last)
 {
@@ -34,6 +36,4 @@
     var substring = str.substring(first_index, last_index);
 
-    console.log(substring);
-
     return substring;
 }
@@ -41,28 +41,22 @@
 function getXSLT(classname)
 {
+    console.log("*** Function getXSLT ***");
     var myurl = document.URL;
 
-    //var collection_name = getSubstring(myurl, "&c", "&");
     var document_id = getSubstring(myurl, "&d", "&");
     var document_type = getSubstring(myurl, "&dt", "&");
-    var prev_action = getSubstring(myurl, "&p.a", "&");
-    console.log("Prev action: "+ prev_action);
-    var prev_service = getSubstring(myurl, "&p.s", "&");
-    console.log("Prev service: "+ prev_service);
-
-    //var post_url = "http://localhost:8383/greenstone3/dev?a=d&c=" + collection_name + "&d=" + document_id + "&dt=" + document_type + "&p.a=" + prev_action + "&p.s=" + prev_service + "&o=skinandlib";
+
     var post_url = host_info.pre_URL +"?a=d&c=" + host_info.collection_name + "&d=" + document_id + "&dt=" + document_type + "&o=skinandlib";
 
-    $.post(post_url, {data: classname}, function(data) {
-            console.log("Success, we have received data");
-            console.log(data);
+    $.post(post_url, function(data) {
+            console.log("Success, we have received the XSLT for the relevant page part");
             classname = "." + classname;
-            console.log(classname); 
-            var content = $(data).find(classname);
-            console.log(content.innerXHTML());
-            console.log(content.xml());
-            console.log(content);
+            /* There seemed to be a problem with MIME types for the data received from the post. */ 
+            /* The best fix for now is to set the data type to text and then reparse as xml */
+            xml = $.parseXML(data);
+            var content = $( xml ).find(classname);
+            /* The xml() function is provided by jquery.xml.js (included by formatmanager.xsl) */
             $("#XSLTcode").val(content.xml());
-            }, 'xml');
+            }, 'text');
 }
 
@@ -162,7 +156,4 @@
     CURRENT_SELECT_VALUE = ""; //global - gets set by ui.draggable
 
-    console.log(gs.xsltParams.interface_name);
-    console.log(gs.collectionMetadata.httpPath);
-    console.log(document.URL);
     var r = /(https?:\/\/)?([\da-z\.-]+):(\d+)\/([\da-z]+)\/([\da-z]+)\?.*&c=([\da-z\.-]+).*/;
     var s = document.URL;
@@ -184,23 +175,4 @@
     host_info.pre_URL = "http://" + host_info.host_name + ":" + host_info.port + "/" + host_info.library + "/" + host_info.servlet;
     console.log("Pre URL: " + host_info.pre_URL);
-
-    /*
-	var collection = "";
-	
-	var regex = new RegExp("[?&]c=");
-	var matches = regex.exec(document.URL);
-	if(matches != null)
-	{
-		var startIndex = matches.index;
-		var endIndex = document.URL.indexOf("&", startIndex + 1);
-		
-		if(endIndex == -1)
-		{
-			endIndex = document.URL.length;
-		}
-		
-		collection = document.URL.substring(startIndex, endIndex);
-	}
-    */
 
     /*
Index: main/trunk/greenstone3/web/interfaces/oran/transform/layouts/formatmanager.xsl
===================================================================
--- main/trunk/greenstone3/web/interfaces/oran/transform/layouts/formatmanager.xsl	(revision 24900)
+++ main/trunk/greenstone3/web/interfaces/oran/transform/layouts/formatmanager.xsl	(revision 24907)
@@ -22,10 +22,16 @@
         <!-- Sam2's div code -->
 
-        <script type="text/javascript" src="interfaces/oran/js/jquery-1.4.2.js"><xsl:text> </xsl:text></script>
+        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"><xsl:text> </xsl:text></script>
+        <!--<script type="text/javascript" src="interfaces/oran/js/jquery-1.4.2.js"><xsl:text> </xsl:text></script>-->
+        <!-- XML parsing doesn't seem to work properly jquery so jquery.xml.js is a fix for this -->
+        <script type="text/javascript" src="interfaces/oran/js/jquery.xml.js"><xsl:text> </xsl:text></script>
         <script type="text/javascript" src="interfaces/oran/js/jquery-ui-1.8.15/ui/jquery-ui-1.8.15.custom.js"><xsl:text> </xsl:text></script>
         <script type="text/javascript" src="interfaces/oran/js/jquery.selectboxes.js"><xsl:text> </xsl:text></script>
         <script type="text/javascript" src="interfaces/oran/js/innerxhtml.js"><xsl:text> </xsl:text></script>
-        <script type="text/javascript" src="interfaces/oran/js/jquery.xml.js"><xsl:text> </xsl:text></script>
-        <script type="text/javascript" src="interfaces/oran/js/gui_div.js"><xsl:text> </xsl:text></script>
+        <!--<script type="text/javascript" src="interfaces/oran/js/gui_div.js"><xsl:text> </xsl:text></script>-->
+        <script type="text/javascript" src="interfaces/oran/js/format_browse.js"><xsl:text> </xsl:text></script>
+        <script type="text/javascript" src="interfaces/oran/js/format_document.js"><xsl:text> </xsl:text></script>
+        <script type="text/javascript" src="interfaces/oran/js/format_util.js"><xsl:text> </xsl:text></script>
+        <script type="text/javascript" src="interfaces/oran/js/format_jquery_prototypes.js"><xsl:text> </xsl:text></script>
        
         <xsl:call-template name="xml-to-gui-templates">
Index: main/trunk/greenstone3/web/interfaces/oran/transform/layouts/header.xsl
===================================================================
--- main/trunk/greenstone3/web/interfaces/oran/transform/layouts/header.xsl	(revision 24900)
+++ main/trunk/greenstone3/web/interfaces/oran/transform/layouts/header.xsl	(revision 24907)
@@ -27,7 +27,7 @@
 		<link rel="stylesheet" href="interfaces/{$interface_name}/style/core.css" type="text/css"/>
 		<link rel="shortcut icon" href="favicon.ico"/> 
-		<script type="text/javascript" src="interfaces/{$interface_name}/js/direct-edit.js"><xsl:text> </xsl:text></script>
-		
-		<xsl:call-template name="init-seaweed"/>
+		<!--<script type="text/javascript" src="interfaces/{$interface_name}/js/direct-edit.js"><xsl:text> </xsl:text></script>-->
+		
+		<!--<xsl:call-template name="init-seaweed"/>-->
 		<xsl:call-template name="setup-gs-variable"/>
 		<xsl:call-template name="additionalHeaderContent"/>
Index: main/trunk/greenstone3/web/interfaces/oran/transform/layouts/xml-to-gui-templates.xsl
===================================================================
--- main/trunk/greenstone3/web/interfaces/oran/transform/layouts/xml-to-gui-templates.xsl	(revision 24900)
+++ main/trunk/greenstone3/web/interfaces/oran/transform/layouts/xml-to-gui-templates.xsl	(revision 24907)
@@ -45,4 +45,6 @@
 
     <!-- ********** GSF:METADATA ********** -->
+    <!-- This element is now created on-the-fly in javascript -->
+    <!--    
         <xsl:variable name="metadata">
         <div class="gsf_metadata css_gsf_metadata block leaf" title="gsf:metadata">
@@ -61,5 +63,5 @@
             gsf_metadata_element = <xsl:text disable-output-escaping="yes">'</xsl:text><xsl:copy-of select="$metadata"/><xsl:text disable-output-escaping="yes">';</xsl:text> 
         </script>
-
+   -->
 
     <!-- ********** GSF:LINK ********** -->
