Index: /extensions/AMetaData/admin/amd_metadata_display.tpl
===================================================================
--- /extensions/AMetaData/admin/amd_metadata_display.tpl	(revision 5087)
+++ /extensions/AMetaData/admin/amd_metadata_display.tpl	(revision 5088)
@@ -51,4 +51,9 @@
       }
     );
+
+    if($("#iGroups li").length == 1)
+    {
+      manageGroup('1', 'y');
+    }
   }
 
Index: /extensions/AMetaData/admin/amd_metadata_select.tpl
===================================================================
--- /extensions/AMetaData/admin/amd_metadata_select.tpl	(revision 5087)
+++ /extensions/AMetaData/admin/amd_metadata_select.tpl	(revision 5088)
@@ -3,4 +3,41 @@
 
   var globalTagId;
+
+  function init()
+  {
+    computedWidth=$("#content").get(0).clientWidth;
+    computedHeight=$("#content").get(0).clientHeight;
+    $("#dialogViewDetail")
+    .dialog(
+      {
+        autoOpen: false,
+        resizable: false,
+        width:computedWidth,
+        height:computedHeight,
+        modal: true,
+        draggable:false,
+        title: '{/literal}{"g003_metadata_detail"|@translate}{literal}',
+        overlay:
+        {
+          backgroundColor: '#000',
+          opacity: 0.5
+        },
+        open: function(event, ui)
+        {
+          bH=$("div.ui-dialog-buttonpane").get(0).clientHeight;
+          $("#dialogViewDetail").css('height', (this.clientHeight-bH)+"px");
+          $("#iListImages").css('height', (this.clientHeight-bH-$("#iListImagesNb").get(0).clientHeight-$("#iHeaderListImages").get(0).clientHeight)+"px");
+        },
+        buttons:
+        {
+          '{/literal}{"g003_ok"|@translate}{literal}':
+            function()
+            {
+              $(this).dialog('close');
+            }
+        }
+      }
+    );
+  }
 
   function loadTagList()
@@ -11,4 +48,6 @@
     unusedTag=($("#iExcludeUnusedTagList").get(0).checked)?"y":"n";
     selectedOnly=($("#iSelectedTagOnly").get(0).checked)?"y":"n";
+
+    displayTagListOrder();
 
     $("#iListTags").html(
@@ -23,4 +62,27 @@
       "{/literal}{'g003_number_of_filtered_metadata'|@translate}{literal} "+$("#iListTags table tr").length
     );
+
+    //onclick="updateTagSelect('iNumId{$data.numId}', '')"
+    $("input.cbiListTags")
+      .bind('click',
+        function(event)
+        {
+          event.stopPropagation();
+          updateTagSelect($(this).get(0).id, '');
+        }
+      );
+
+    $("a.cbiListTags")
+      .bind('click',
+        function(event)
+        {
+          event.stopPropagation();
+          loadTagDetail($(this).get(0).id.substr(7));
+        }
+      );
+
+
+
+
     $("body").css("cursor", "default");
   }
@@ -28,4 +90,6 @@
   function loadTagDetail(tag)
   {
+    $("#dialogViewDetail").dialog('open');
+
     globalTagId=tag;
     order=$('#iSelectOrderImageList').val();
@@ -51,7 +115,13 @@
   }
 
-  function updateTagSelect(numId)
+  function updateTagSelect(numId, mode)
   {
     $("body").css("cursor", "wait");
+
+    if(mode=='switch')
+    {
+      $("#"+numId).get(0).checked=!$("#"+numId).get(0).checked;
+    }
+
     selected=($("#"+numId).get(0).checked)?"y":"n";
 
@@ -67,4 +137,46 @@
   }
 
+  function sortTagList(by)
+  {
+    $("#iSelectOrderTagList").val(by);
+    displayTagListOrder();
+    loadTagList();
+  }
+
+  function sortTagDetail(by, tag)
+  {
+    $("#iSelectOrderImageList").val(by);
+    displayTagDetailOrder();
+    loadTagDetail(tag);
+  }
+
+  function displayTagListOrder()
+  {
+    if($("#iSelectOrderTagList").val()=="tag")
+    {
+      $("#iHLTOrderTag").html("&#8593;");
+      $("#iHLTOrderNum").html("");
+    }
+    else
+    {
+      $("#iHLTOrderTag").html("");
+      $("#iHLTOrderNum").html("&#8593;");
+    }
+  }
+
+  function displayTagDetailOrder()
+  {
+    if($("#iSelectOrderImageList").val()=="value")
+    {
+      $("#iHLIOrderValue").html("&#8593;");
+      $("#iHLIOrderNum").html("");
+    }
+    else
+    {
+      $("#iHLIOrderValue").html("");
+      $("#iHLIOrderNum").html("&#8593;");
+    }
+  }
+
 
 </script>
@@ -75,10 +187,5 @@
 
 <form>
-  <label>{'g003_order'|@translate}
-    <select id="iSelectOrderTagList" onchange="loadTagList();">
-      <option value="tag" {if $datas.config_GetListTags_OrderType=="tag"}selected{/if}>{'g003_tagOrder'|@translate}</option>
-      <option value="num" {if $datas.config_GetListTags_OrderType=="num"}selected{/if}>{'g003_numOrder'|@translate}</option>
-    </select>
-  </label>
+  <input type="hidden" id="iSelectOrderTagList" value="{$datas.config_GetListTags_OrderType}"/>
 
   <label>{'g003_filter'|@translate}
@@ -104,7 +211,7 @@
 <table id='iHeaderListTags' class="littlefont">
   <tr>
-    <th style="width:35%;min-width:340px;">{'g003_TagId'|@translate}</th>
+    <th style="width:35%;min-width:340px;"><span id="iHLTOrderTag"></span><a onclick="sortTagList('tag');">{'g003_TagId'|@translate}</a></th>
     <th>{'g003_TagLabel'|@translate}</th>
-    <th width="80px">{'g003_NumOfImage'|@translate}</th>
+    <th width="80px"><span id="iHLTOrderNum"></span><a onclick="sortTagList('num');">{'g003_NumOfImage'|@translate}</a></th>
     <th width="40px">{'g003_Pct'|@translate}</th>
     <th width="110px">&nbsp;</th>
@@ -116,29 +223,28 @@
 
 
-<form>
-  <label>{'g003_order'|@translate}
-    <select id="iSelectOrderImageList" onchange="loadTagDetail(globalTagId);">
-      <option value="value"  {if $datas.config_GetListImages_OrderType=="value"}selected{/if}>{'g003_valueOrder'|@translate}</option>
-      <option value="num"  {if $datas.config_GetListImages_OrderType=="num"}selected{/if}>{'g003_numOrder'|@translate}</option>
-    </select>
-  </label>
-</form>
-
-<table id='iHeaderListImages' class="littlefont">
-  <tr>
-    <th>{'g003_Value'|@translate}&nbsp;<span id="iHeaderListImagesTagName"></span></th>
-    <th width="80px">{'g003_NumOfImage'|@translate}</th>
-    <th width="40px">{'g003_Pct'|@translate}</th>
-    <th width="110px">&nbsp;</th>
-  </tr>
-</table>
-
-<div id='iListImages'>
-  <div style="width:100%;text-align:center;padding-top:20px;">{'g003_no_items_selected'|@translate}</div>
+<div id="dialogViewDetail">
+  <form>
+    <input type="hidden" id="iSelectOrderImageList" value="{$datas.config_GetListImages_OrderType}"/>
+  </form>
+
+  <table id='iHeaderListImages' class="littlefont">
+    <tr>
+      <th><span id="iHLIOrderValue"></span><a onclick="sortTagDetail('value', globalTagId);">{'g003_Value'|@translate}</a>&nbsp;<span id="iHeaderListImagesTagName"></span></th>
+      <th width="80px"><span id="iHLIOrderNum"></span><a onclick="sortTagDetail('num', globalTagId);">{'g003_NumOfImage'|@translate}</a></th>
+      <th width="40px">{'g003_Pct'|@translate}</th>
+      <th width="110px">&nbsp;</th>
+    </tr>
+  </table>
+
+  <div id='iListImages'>
+    <div style="width:100%;text-align:center;padding-top:20px;">{'g003_no_items_selected'|@translate}</div>
+  </div>
+  <div id="iListImagesNb"></div>
 </div>
-<div id="iListImagesNb"></div>
 
 
 <script type="text/javascript">
+  init();
   loadTagList();
+  displayTagDetailOrder();
 </script>
Index: /extensions/AMetaData/admin/amd_metadata_select_iListTags.tpl
===================================================================
--- /extensions/AMetaData/admin/amd_metadata_select_iListTags.tpl	(revision 5087)
+++ /extensions/AMetaData/admin/amd_metadata_select_iListTags.tpl	(revision 5088)
@@ -1,6 +1,9 @@
 <table class="littlefont">
   {foreach from=$datas key=name item=data}
-  <tr onclick="loadTagDetail('{$data.tagId}');">
-    <td style="width:35%;min-width:340px;"><input type="checkbox" id="iNumId{$data.numId}" onclick="updateTagSelect('iNumId{$data.numId}')" {$data.tagChecked}>&nbsp;{$data.tagId}</td>
+  <tr onclick="updateTagSelect('iNumId{$data.numId}', 'switch');">
+    <td style="width:35%;min-width:340px;">
+      <a id="iNumIdA{$data.tagId}" class="cbiListTags" >[&nbsp;?&nbsp;]</a>&nbsp;
+      <input type="checkbox" id="iNumId{$data.numId}" class="cbiListTags" {$data.tagChecked}>&nbsp;{$data.tagId}
+    </td>
     <td>{$data.label}</td>
     <td width="80px">{$data.nb}</td>
Index: /extensions/AMetaData/amd.css
===================================================================
--- /extensions/AMetaData/amd.css	(revision 5087)
+++ /extensions/AMetaData/amd.css	(revision 5088)
@@ -10,10 +10,11 @@
       #iprogressbar_fg { color:#FF3363; width:100%; text-align:center; display: block; z-index:200; position:relative; top:-18px;  }
       #iHeaderListTags { width:100%; border:1px solid; border-collapse: collapse; margin-top:3px; }
-      #iListTags, #iListImages { width:100%; border:1px solid; height:120px; border-top:0px; overflow:auto;}
-      #iListTagsNb, #iListImagesNb { width:100%; text-align:right; margin-bottom:20px; padding:2px; font-size:80%; }
+      #iListTags { width:100%; border:1px solid; height:280px; border-top:0px; overflow:auto;}
+      #iListImages { width:100%; border-bottom:1px solid; overflow:auto;}
+      #iListTagsNb, #iListImagesNb { width:99%; text-align:right; margin-bottom:8px; padding:2px; font-size:80%; }
       #iListTags table, #iListImages table, table.listTags { width:100%; text-align:left; border-collapse: collapse; }
       #iListTags table tr:hover { cursor:pointer; background:#303030; }
       #iListImages table tr:hover, table.listTags tr:hover { background:#303030; cursor:default; }
-      #iHeaderListImages { width:100%; border:1px solid; margin-top:3px; }
+      #iHeaderListImages { width:100%; border-bottom:1px solid; }
       .warning { color:#dd0000; border:1px solid #dd0000; margin-bottom:8px; margin-top:8px; padding:8px; }
       .warning p { margin-top:0.5em; margin-bottom:0em; }
Index: /extensions/AMetaData/amd_root.class.inc.php
===================================================================
--- /extensions/AMetaData/amd_root.class.inc.php	(revision 5087)
+++ /extensions/AMetaData/amd_root.class.inc.php	(revision 5088)
@@ -90,10 +90,11 @@
       #iprogressbar_fg { color:#FF3363; width:100%; text-align:center; display: block; z-index:200; position:relative; top:-18px;  }
       #iHeaderListTags { width:100%; border:1px solid; border-collapse: collapse; margin-top:3px; }
-      #iListTags, #iListImages { width:100%; border:1px solid; height:120px; border-top:0px; overflow:auto;}
-      #iListTagsNb, #iListImagesNb { width:100%; text-align:right; margin-bottom:20px; padding:2px; font-size:80%; }
+      #iListTags { width:100%; border:1px solid; height:280px; border-top:0px; overflow:auto;}
+      #iListImages { width:100%; border-bottom:1px solid; overflow:auto;}
+      #iListTagsNb, #iListImagesNb { width:99%; text-align:right; margin-bottom:8px; padding:2px; font-size:80%; }
       #iListTags table, #iListImages table, table.listTags { width:100%; text-align:left; border-collapse: collapse; }
       #iListTags table tr:hover { cursor:pointer; background:#303030; }
       #iListImages table tr:hover, table.listTags tr:hover { background:#303030; cursor:default; }
-      #iHeaderListImages { width:100%; border:1px solid; margin-top:3px; }
+      #iHeaderListImages { width:100%; border-bottom:1px solid; }
       .warning { color:#dd0000; border:1px solid #dd0000; margin-bottom:8px; margin-top:8px; padding:8px; }
       .warning p { margin-top:0.5em; margin-bottom:0em; }
