Index: main/trunk/greenstone3/web/interfaces/oran/js/gui_div.js
===================================================================
--- main/trunk/greenstone3/web/interfaces/oran/js/gui_div.js	(revision 22829)
+++ main/trunk/greenstone3/web/interfaces/oran/js/gui_div.js	(revision 22933)
@@ -35,5 +35,5 @@
 
     $(".element_type_text").draggable({
-            connectToSortable: '.gsf_otherwise',
+            connectToSortable: '.gsf_otherwise, .gsf_link',
             helper: 'clone',
             revert: 'invalid'
@@ -41,5 +41,5 @@
     
     $(".element_type_gsf_choose_metadata").draggable({
-            connectToSortable: '.gsf_template',
+            connectToSortable: '.td-div',
             helper: 'clone',
             revert: 'invalid'
@@ -53,5 +53,5 @@
 
     $(".element_type_gsf_link").draggable({
-            connectToSortable: '.gsf_template',
+            connectToSortable: '.td-div',
             helper: 'clone',
             revert: 'invalid'
@@ -60,5 +60,5 @@
     // switch, when, otherwise, icon
     $(".element_type_gsf_switch").draggable({
-            connectToSortable: '.gsf_template',
+            connectToSortable: '.td-div',
             helper: 'clone',
             revert: 'invalid'
@@ -88,4 +88,5 @@
     /******************************************/
 
+    bind_td_sortable();
     bind_all_sortables();
 
@@ -183,5 +184,5 @@
 function replace_with(item, me)
 {
-    console.log('function replace_with(item, me)');
+    //console.log('function replace_with(item, me)');
     item.replaceWith(me); //'<div class="element element-txt">This text box has been added!</div>');
 
@@ -193,5 +194,5 @@
 function resize_tables(item)
 {
-    console.log('function resize_tables(item)');
+    //console.log('function resize_tables(item)');
     var max_height = 0;
     (item.parents('.table')).each(function(index) {
@@ -213,8 +214,8 @@
 function bind_template_sortable()
 {
-    console.log('function bind_template_sortable()');
+    //console.log('function bind_template_sortable()');
     $('.gsf_template').sortable({
             'cursor':'pointer',
-            'items':'.table, .gsf_choose_metadata, .gsf_metadata',
+            'items':'.table', //.gsf_choose_metadata, .gsf_metadata',
             'placeholder':'placeholder',
             //'nested':'.gsf:metadata'
@@ -238,10 +239,10 @@
 function bind_td_sortable()
 {
-    console.log('function bind_td_sortable()');
+    //console.log('function bind_td_sortable()');
     $('.td-div').sortable({
             'cursor':'pointer',
-            'tolerance': 'pointer',
             'items':'.gsf_metadata, .gsf_choose_metadata, .gsf_link, .gsf_switch',
             'placeholder':'placeholder',
+            'connectWith':'.td-div',
             //'nested':'.gsf:metadata'
             receive: function(event, ui) { alert("Attempted to receive"); },
@@ -254,5 +255,5 @@
 
     $('.td-div').click(function () {    
-         console.log('td class click');
+         //console.log('td class click');
          return true;
     });
@@ -265,13 +266,13 @@
 function bind_choose_metadata_sortable()
 {
-    console.log('function bind_choose_metadata_sortable()');
+    //console.log('function bind_choose_metadata_sortable()');
     $('.gsf_choose_metadata').sortable({
             'cursor':'pointer',
-            'tolerance': 'fit',
-            'items':'.gsf_metadata',
+            'items':'.gsf_metadata, .gsf_default',
             'placeholder':'placeholder',
             'connectWith':'.gsf_choose_metadata',
             //'nested':'.gsf:metadata'
             stop: function(event, ui) {
+                //alert("STOP");
                 if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('element_type_gsf_metadata')) { replace_with(ui.item, gsf_metadata_element); }
             }
@@ -281,9 +282,9 @@
 function bind_link_sortable()
 {
-    console.log('function bind_link_sortable()');
+    //console.log('function bind_link_sortable()');
     $('.gsf_link').sortable({
             'cursor':'pointer',
-            'tolerance': 'fit',
-            'items':'.gsf_icon',
+            'tolerance': 'pointer',
+            'items':'.gsf_icon, .gsf_text',
             'placeholder':'placeholder',
             'connectWith':'.gsf_link',
@@ -291,4 +292,5 @@
             stop: function(event, ui) {
                 if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('element_type_gsf_icon')) { replace_with(ui.item, gsf_icon_element); }
+                if (ui.item.hasClass("ui-draggable") && ui.item.hasClass('element_type_text')) { replace_with(ui.item, "<input type=\"text\" name=\"rawtextinput\" size=\"10\"/>"); }
             }
     });
@@ -297,5 +299,5 @@
 function bind_switch_sortable()
 {
-    console.log('function bind_switch_sortable()');
+    //console.log('function bind_switch_sortable()');
     $('.gsf_switch').sortable({
             'cursor':'pointer',
@@ -303,4 +305,5 @@
             'items':'.gsf_metadata, .gsf_when, .gsf_otherwise',
             'placeholder':'placeholder',
+            'connectWith':'.gsf_switch',
             //'nested':'.gsf:metadata'
             stop: function(event, ui) {
@@ -313,5 +316,5 @@
 function bind_when_sortable()
 {
-    console.log('function bind_when_sortable()');
+    //console.log('function bind_when_sortable()');
     $('.gsf_when').sortable({
             'cursor':'pointer',
@@ -328,5 +331,5 @@
 function bind_otherwise_sortable()
 {
-    console.log('function bind_otherwise_sortable()');
+    //console.log('function bind_otherwise_sortable()');
     $('.gsf_otherwise').sortable({
             'cursor':'pointer',
@@ -344,5 +347,5 @@
 function bind_block_mouseover()
 {
-    console.log('function bind_block_mouseover()');
+    //console.log('function bind_block_mouseover()');
     $(".block").mouseover(function()
     {
@@ -364,5 +367,5 @@
 
 var removeContent = (function () {
-    console.log('var removeContent = (function ()');
+    //console.log('var removeContent = (function ()');
         // this -> a -> td -> tr -> tbody -> table -> div
         $(this).parent().parent().parent().parent().parent().remove();
@@ -372,5 +375,5 @@
 var toggleContent = function(e)
 {
-    console.log('var toggleContent = function(e)');
+    //console.log('var toggleContent = function(e)');
     console.log('parent: ' + $(this).html());
     if ($(this).html() == '[+]'){ //targetContent.css('display') == 'none') {
@@ -395,5 +398,5 @@
 
 function equalHeights(item, height) {
-    console.log('function equalHeights(item, height)');
+    //console.log('function equalHeights(item, height)');
     (item.parents('.table')).each(function(index) {
         $(this).children().children().children().each(function() {
Index: main/trunk/greenstone3/web/interfaces/oran/transform/layouts/main.xsl
===================================================================
--- main/trunk/greenstone3/web/interfaces/oran/transform/layouts/main.xsl	(revision 22829)
+++ main/trunk/greenstone3/web/interfaces/oran/transform/layouts/main.xsl	(revision 22933)
@@ -37,5 +37,5 @@
                 <!-- <script type="text/javascript" src="interfaces/oran/js/jquery-ui-1.8.2.custom.min.js"><xsl:text> </xsl:text></script> -->
                 <script type="text/javascript" src="interfaces/oran/js/jquery-ui-1.8rc1/ui/jquery-ui.js"><xsl:text> </xsl:text></script>
-                <!-- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.js"><xsl:text> </xsl:text></script> -->
+                <!-- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.js"><xsl:text> </xsl:text></script> -->
                 <!-- <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"><xsl:text> </xsl:text></script> -->
                 <!-- <script type="text/javascript" src="interfaces/oran/js/jquery-ui-1.8rc1/jquery-1.4.1.js"><xsl:text> </xsl:text></script> -->
Index: main/trunk/greenstone3/web/interfaces/oran/transform/layouts/xml-to-gui.xsl
===================================================================
--- main/trunk/greenstone3/web/interfaces/oran/transform/layouts/xml-to-gui.xsl	(revision 22829)
+++ main/trunk/greenstone3/web/interfaces/oran/transform/layouts/xml-to-gui.xsl	(revision 22933)
@@ -311,5 +311,5 @@
         <xsl:param name="metadataSets"/>
 
-        <div class="block" title="gsf:default">
+        <div class="block gsf_default" title="gsf:default">
                 <table class="header"><tbody><tr><td>DEFAULT</td><td><a href="#" class="minmax ui-icon ui-icon-minusthick" title="Click me to expand">[-]</a></td><td><a href="[myhref]" class="ui-icon ui-icon-closethick"/></td></tr></tbody></table>
                 <xsl:apply-templates mode="xml-to-gui">
@@ -326,5 +326,5 @@
         <xsl:param name="metadataSets"/>
         
-        <div class="block leaf" title="gsf:text">
+        <div class="block leaf gsf_text" title="gsf:text">
                 <xsl:variable name="rawtext"><xsl:value-of select="."/></xsl:variable>
                 <table class="header"><tbody><tr><td><input type="text" name="rawtextinput" size="10" value="{$rawtext}"/></td><td><a href="[myhref]" class="ui-icon ui-icon-closethick"/></td></tr></tbody></table>
