Index: /extensions/Juza/Juzabar.tpl
===================================================================
--- /extensions/Juza/Juzabar.tpl	(revision 4659)
+++ /extensions/Juza/Juzabar.tpl	(revision 4659)
@@ -0,0 +1,14 @@
+<table cellspacing="0" class="juzabar">
+<tbody><tr>
+<td>HOME PAGE</td>
+<td>PORTFOLIO</td>
+<td><a title="Gallery home" href="{''|make_index_url}"><strong>GALLERIES</strong></a></td>
+<td><a title="Available tags" href="{$ROOT_URL}tags.php"><strong>TAGS</strong></a></td>
+<td>ABOUT JUZA</td>
+<td>E-MAIL</td>
+<td>JUZA FORUM</td>
+{if !empty($blocks)}
+<td class="JS_active"><a class="Juza_menu hidden" title="Display menu" href="#"><strong>MENU</strong></a></td>
+{/if}
+</tr>
+</tbody></table>
Index: /extensions/Juza/include/Juzaconfig.tpl
===================================================================
--- /extensions/Juza/include/Juzaconfig.tpl	(revision 4659)
+++ /extensions/Juza/include/Juzaconfig.tpl	(revision 4659)
@@ -0,0 +1,44 @@
+<div id="JuzaShade"></div>
+<div id="JuzaBox">
+  <div id="JuzaWrap">
+    <div id="JuzaCloseBox">X</div>
+    <form id="Juza_config" method="post" class="properties" action="index.php">
+    <fieldset id="Juza_config_fs">
+      <legend><span class="legend">{'Juza Theme Configuration'|@translate}</span></legend>
+      <ul>
+        <li>
+          <span class="property">
+            <label for="Juza_width">{'Index picture max-width'|@translate}</label>
+          </span>
+          <input type="text" size="4" maxlength="4" name="Juza_width" id="Juza_width" value="{$Juza_width}">
+          <span class="range">{'[300:885]'|@translate}</span>
+        </li>
+        <li>
+          <span class="property">
+            <label for="Juza_height">{'Index picture cropping-height'|@translate}</label>
+          </span>
+          <input type="text" size="4" maxlength="4" name="Juza_height" id="Juza_height" value="{$Juza_height}">
+           <span class="range">{'[110:400]'|@translate}</span>
+       </li>
+        <li>
+          <span class="property">
+            <label for="Juza_shift">{'Index picture top-shift'|@translate}</label>
+          </span>
+          <input type="text" size="4" maxlength="4" name="Juza_shift" id="Juza_shift" value="{$Juza_shift}">
+          <span class="range">{'[-320:0]'|@translate}</span>
+        </li>
+        <li>
+          <label>
+            <span class="property">{'Auto cropping and shifting'|@translate}</span>
+            <input type="checkbox" name="Juza_Auto_CS" {$Juza_Auto_CS}>
+            <span class="range">{'Inactive, maintain picture width &lt; 900px (Height is free)'|@translate}</span>
+          </label>
+        </li>
+      </ul>
+    </fieldset>
+    <input type="hidden" value="true" name="Juza_conf">
+    <input class="submit" type="submit" name="Juza_submit" value="{'Juza_Submit'|@translate}">
+    <input class="submit" type="submit" name="Juza_reset" value="{'Juza_Reset'|@translate}">
+    </form>
+  </div>
+</div>
Index: /extensions/Juza/include/functions.inc.php
===================================================================
--- /extensions/Juza/include/functions.inc.php	(revision 4658)
+++ /extensions/Juza/include/functions.inc.php	(revision 4659)
@@ -3,6 +3,13 @@
   global $template;
   Juza_update();
-  $template->set_filenames(array('juza' => 'theme/Juza/script.tpl'));
+  $template->set_filenames(array(
+    'juza' => 'theme/Juza/script.tpl',
+    'juzabar' => 'theme/Juza/Juzabar.tpl',
+    'juzaconfig' => 'theme/Juza/include/Juzaconfig.tpl',
+  ));
+  include_once(PHPWG_ROOT_PATH.'include/menubar.inc.php');
   $template->parse('juza');
+  $template->parse('juzabar');
+  $template->parse('juzaconfig');
 }
 
@@ -44,4 +51,39 @@
 }
 
+function Juza_common_tags($max_tags)
+{
+   $query = '
+SELECT t.*, count(*) AS counter
+  FROM '.IMAGE_TAG_TABLE.'
+    INNER JOIN '.TAGS_TABLE.' t ON tag_id = id
+  GROUP BY tag_id
+  ORDER BY counter DESC
+  LIMIT 0,' . $max_tags . ';';
+  $result = pwg_query($query);
+  $tags = array();
+  while($row = mysql_fetch_assoc($result)) {
+    array_push($tags, $row);
+  }
+  usort($tags, 'tag_alpha_compare');
+  return $tags;
+}
+
+function Juza_tags( $ref_back ) {
+  $menu = & $ref_back[0];
+  $block = $menu->get_block( 'mbTags' );
+  if ( count($block->data) > 0 ) return;
+  $tags = Juza_common_tags(10);
+  $tags = add_level_to_tags($tags);
+  foreach ($tags as $tag) {
+    $block->data[] = array_merge( str_replace('&nbsp;', ' ', $tag),
+        array(
+          'URL' => make_index_url( array( 'tags' => array($tag) ) ),
+          'U_ADD' => make_index_url( array( 'tags' => array($tag) ) ),
+          )
+      );
+  }
+  $block->template = 'menubar_tags.tpl';
+}
+
 function remove_AkBookStyle_handlers() {
   global $public_content;
@@ -57,5 +99,4 @@
   if (isset($conf['Juza Config'])) $conf_Juza = array_merge($conf_Juza, unserialize($conf['Juza Config']));
   if (isset($_POST['Juza_submit'])) {
-    $conf_Juza['Juza_handlers'] = isset($_POST['Juza_handlers']) ? true:false;
     $conf_Juza['Juza_width'] = isset($_POST['Juza_width']) ? (integer)$_POST['Juza_width'] : 885;
     $conf_Juza['Juza_width'] = ($conf_Juza['Juza_width'] > 885) ? 885 : $conf_Juza['Juza_width'];
@@ -84,15 +125,7 @@
     pwg_query($query);
   }
-  $conf['Juza_active'] = (!isset($conf_Juza['Juza_handlers'])) ? true:$conf_Juza['Juza_handlers'];
 
-  if ( is_admin() ) {
-    $template->append('footer_elements', '<form method="post" name="JuzaTC"  action="' . make_index_url() . '">
-<input name="Juza_config" type="submit" value="'. l10n('Juza Theme Configuration') .'" class="conf" />
-<input type="hidden" value="true" name="Juza_conf" />
-</form>');
-  }
-  if ( isset($_POST['Juza_conf']) ) $template->assign('Juza_config', true);
-  if ($conf['Juza_active']) $template->assign('Juza_active', true);
-  if ($conf_Juza['Juza_handlers']) $template->assign('Juza_handlers', 'checked="checked"');
+  $template->assign('Juza_config', true);
+
   $user["expand"] = true;
   $template->assign('Juza_cats', get_categories_menu());
@@ -106,11 +139,7 @@
   $template->assign('Juza_shift3', -(12+$conf_Juza['Juza_height']));
   if ($conf_Juza['Juza_Auto_CS']) $template->assign('Juza_Auto_CS', 'checked="checked"');
-  if (isset($_POST['Juza_close'])) {
-    redirect(make_index_url());
-  }
 }
 function Juza_default() {
   return array(
-    'Juza_handlers' => true,
     'Juza_width'    => 885,
     'Juza_height'   => 240,
Index: /extensions/Juza/js/juzascript.js
===================================================================
--- /extensions/Juza/js/juzascript.js	(revision 4658)
+++ /extensions/Juza/js/juzascript.js	(revision 4659)
@@ -11,4 +11,6 @@
 	$('.thumbnailCategories li').addClass('Juza-cat');
 	$('.description li').removeClass('Juza-cat');
+	$('.thumbnailCategory div.description').addClass('Juza-desc');
+	$('td.JS_active').show();
   $nav = $('#content .navigationBar').html();
 	if ($nav == null) $nav = '';
@@ -43,5 +45,25 @@
 	  $('#menubar').toggleClass('displayed');
 	});
-	//$('span#updateRate').parent('table').eq(0).show().children('td').hide();
-	//$('span#updateRate').parent('td').eq(0).show();
+
+  var $c = $('#Juza_call').html();
+  $('#menubar a[href*="admin.php"]').parent('li').eq(0).after('<li>'+$c+'</li>');
+  $('#menubar form#Juza_action input.Juza_conf').hide();
+  $('#menubar form#Juza_action').hide();
+  $('#menubar a.Juza_conf').show();
+
+  $('a.Juza_conf').click(function(){
+		$('#menubar').toggleClass('displayed');
+		$('#JuzaBox').fadeIn('fast'); 
+		if($('body').height() > $('body').offset().height){
+				var sH = $('body').height();
+			}else{
+				var sH = $('body').offset().height;
+		} 
+		$('#JuzaShade').css( {height:sH+'px'}).css('z-index',9998).fadeIn('fast');
+
+		$('#JuzaCloseBox').click(function(){
+			$('#JuzaBox').fadeOut('fast');
+			$('#JuzaShade').fadeOut('fast').css('z-index',-9998);
+		});
+	});
 });
Index: /extensions/Juza/language/en_UK/lang.php
===================================================================
--- /extensions/Juza/language/en_UK/lang.php	(revision 4658)
+++ /extensions/Juza/language/en_UK/lang.php	(revision 4659)
@@ -10,7 +10,6 @@
 $lang['[-320:0]'] = '[-320:0] ';
 $lang['Auto cropping and shifting'] = 'Auto cropping and shifting ';
-$lang['Recommended medium width &lt; 900px'] = 'Recommended medium width &lt; 900px ';
+$lang['Inactive, maintain picture width &lt; 900px (Height is free)'] = 'Inactive, maintain picture width &lt; 900px (Height is free)';
 $lang['Juza_Submit'] = 'Submit';
 $lang['Juza_Reset'] = 'Reset';
-$lang['Juza_Close'] = 'Close';
 ?>
Index: /extensions/Juza/language/fr_FR/lang.php
===================================================================
--- /extensions/Juza/language/fr_FR/lang.php	(revision 4658)
+++ /extensions/Juza/language/fr_FR/lang.php	(revision 4659)
@@ -10,7 +10,6 @@
 $lang['[-320:0]'] = '[-320:0] ';
 $lang['Auto cropping and shifting'] = 'Décalage et découpe automatiques ';
-$lang['Recommended medium width &lt; 900px'] = 'La largeur des images doit rester &lt; 900px ';
+$lang['Inactive, maintain picture width &lt; 900px (Height is free)'] = 'Désactivé, la largeur des images doit rester &lt; 900px ';
 $lang['Juza_Submit'] = 'Enregister';
 $lang['Juza_Reset'] = 'Annuler';
-$lang['Juza_Close'] = 'Fermer';
 ?>
Index: /extensions/Juza/language/it_IT/lang.php
===================================================================
--- /extensions/Juza/language/it_IT/lang.php	(revision 4658)
+++ /extensions/Juza/language/it_IT/lang.php	(revision 4659)
@@ -10,7 +10,6 @@
 $lang['[-320:0]'] = '[-320:0] ';
 $lang['Auto cropping and shifting'] = 'Offset e taglio automatico ';
-$lang['Recommended medium width &lt; 900px'] = 'La larghezza dell\'immagine deve rimanere &lt; 900px';
+$lang['Inactive, maintain picture width &lt; 900px (Height is free)'] = 'Inattivi, mantenere la larghezza dell\'immagine deve rimanere &lt; 900px';
 $lang['Juza_Submit'] = 'Salvare';
 $lang['Juza_Reset'] = 'Cancellare';
-$lang['Juza_Close'] = 'Chiudere'; 
 ?>
Index: /extensions/Juza/script.tpl
===================================================================
--- /extensions/Juza/script.tpl	(revision 4658)
+++ /extensions/Juza/script.tpl	(revision 4659)
@@ -1,88 +1,49 @@
-{if isset($Juza_active)}
-	{known_script id="jquery" src=$ROOT_URL|@cat:"template-common/lib/jquery.packed.js"}
-	{known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.core.packed.js"}
-	{assign var=JUZA value=$ROOT_URL|@cat:"template/"|@cat:$themeconf.template|@cat:"/theme/"|@cat:$themeconf.theme}
-	{known_script id="juza" src=$JUZA|@cat:"/js/juzascript.js"}
-	{html_head}
-	<script type="text/javascript">
-	  $('img.bigImg').each(function() {ldelim}
-	    $h = $(this).height()
-			if ($h < {$Juza_height}) {ldelim}
-				$(this).parent('.maxIllustration a').eq(0).css('height', $h+'px');
-				$(this).parent('li.Juza-cat').eq(0).css('height', (55+$h)+'px');
-				$(this).parent('li.Juza-cat').eq(0).css('min-height', (55+$h)+'px');
-				$(this).parent('li.Juza-cat').children('.description').eq(0).css('height', (325+$h)+'px');
-				$(this).parent('li.Juza-cat').children('.description').eq(0).css('top', (-(12+$h))+'px');
-			}
-		});
-	</script>
-	{if isset($Juza_Auto_CS)} {* Auto Cropping and Shifting *}
-		<style type="text/css">
+  {*known_script id="jquery" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"*}
+  {known_script id="jquery" src=$ROOT_URL|@cat:"template-common/lib/jquery.packed.js"}
+  {known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.core.packed.js"}
+  {assign var=JUZA value=$ROOT_URL|@cat:"template/"|@cat:$themeconf.template|@cat:"/theme/"|@cat:$themeconf.theme}
+  {known_script id="juza" src=$JUZA|@cat:"/js/juzascript.js"}
+  {html_head}
+<style type="text/css">
 .maxIllustration a {ldelim} max-height: {$Juza_height}px; height: {$Juza_height}px; width:{$Juza_width}px; }
 .bigImg {ldelim} top:{$Juza_shift}px; width:{$Juza_width}px !important; }
 #imageToolBar {ldelim} top:{$Juza_shift2}px; }
-.content ul.thumbnailCategories li.Juza-cat {ldelim} height:{$Juza_height2}px; min-height:{$Juza_height2}px; }
-		</style>
-	{else}
-	<script type="text/javascript">
-	  $('img.bigImg').each(function() {ldelim}
-	    $h = $(this).height()
-			$(this).parent('.maxIllustration a').eq(0).css('height', $h+'px');
-			$(this).parent('li.Juza-cat').eq(0).css('height', (55+$h)+'px');
-			$(this).parent('li.Juza-cat').eq(0).css('min-height', (55+$h)+'px');
-			$(this).parent('li.Juza-cat').children('.description').eq(0).css('height', (325+$h)+'px');
-			$(this).parent('li.Juza-cat').children('.description').eq(0).css('top', (-(12+$h))+'px');
-			$(this).after('--'+$h+'px --');
-		});
-	</script>
-	{/if}
-	<style type="text/css">
-.content div.thumbnailCategory div.description {ldelim} height:{$Juza_height3}px !important; top:{$Juza_shift3}px; }
-#copyright {ldelim} margin-top: {$Juza_width}px; }
-table.juzabar td {ldelim} width: 155px; }
-	</style>
-<noscript>
-	<style type="text/css">
-.maxIllustration a {ldelim} max-height: auto; height: auto; width:auto; }
-.bigImg {ldelim} top:0px; width:auto !important; }
-#imageToolBar {ldelim} top:0px; }
-.content ul.thumbnailCategories li.Juza-cat {ldelim} height:auto; min-height:auto; }
-.content div.thumbnailCategory div.description {ldelim} height:auto !important; top:0px; }
-#copyright {ldelim} margin-top: 0px; }
-.content ul.thumbnailCategories li {ldelim} width:49.7%; }
-	</style>
-</noscript>
+.content ul.thumbnailCategories li.Juza-cat {ldelim} height:{$Juza_height2}px; min-height:{$Juza_height2}px; width: 100%; }
+.content div.thumbnailCategory div.Juza-desc {ldelim} height:{$Juza_height3}px !important; top:{$Juza_shift3}px; }
+</style>
 
-	{/html_head}
-{else}
-	{html_head}
-	<style type="text/css">
-.content ul.thumbnailCategories li {ldelim} width:49.7%; }
-	</style>
-	{/html_head}
-{/if}
-<table cellspacing="0" class="juzabar">
-<tbody><tr>
-<td>HOME PAGE</td>
-<td>PORTFOLIO</td>
-<td><a title="Gallery home" href="{''|make_index_url}"><strong>GALLERIES</strong></a></td>
-<td><a title="Available tags" href="{$ROOT_URL}tags.php"><strong>TAGS</strong></a></td>
-<td>ABOUT JUZA</td>
-<td>E-MAIL</td>
-<td>JUZA FORUM</td>
-{if !empty($blocks)}
-<td><a class="Juza_menu hidden" title="Display menu" href="#"><strong>MENU</strong></a></td>
-{/if}
-</tr>
-</tbody></table>
-{if isset($thumbnails) and isset($Juza_active)}
+<script type="text/javascript">
+$().ready(function() {ldelim}
+  $('div.illustration a img').each(function() {ldelim}
+    $(this).ready(function() {ldelim}
+      var $h = $(this).height();
+      {if isset($Juza_Auto_CS)}if ($h  < {$Juza_height}) /* Kill Auto crop */ {/if} {literal} {
+        var $i = ($h + 55)+'px';
+        var $j = ($h + 325)+'px';
+        var $k = ($h + 12)+'px';
+        var $h = $h+'px';
+        $(this).css('top', '0px');
+        $(this).parents('li').eq(0).addClass('Juza-cat').css('height', $i).css('min-height', $i).css('width','100%');
+        $(this).parents('li.Juza-cat').eq(0).find('.description').eq(0).css('height' , $j).css('top', '-'+$k).find('li').css('width','100%');
+        $(this).parents('.maxIllustration a').eq(0).css('height', $h);
+      };{/literal}
+    });
+  });
+  var $h = $('#jquery_local_img #relTag').height() + 50 + {$Juza_width};
+  $('#copyright').css('margin-top', $h+'px');
+});
+</script>
+  {/html_head}
+
+{if isset($thumbnails)}
 <div id="ix-desc" style="display:none">
 {foreach from=$thumbnails item=thumbnail}
   <div title="{$thumbnail.FILE_DESC|@htmlspecialchars}" class="Thumb-{$thumbnail.ID}" alt="{$thumbnail.FILE_WIDTH}"></div>
-	 <div title="{$thumbnail.FILE_PATH}" class="Medium-{$thumbnail.ID}" alt="{$thumbnail.FILE_HEIGHT}"></div>
+   <div title="{$thumbnail.FILE_PATH}" class="Medium-{$thumbnail.ID}" alt="{$thumbnail.FILE_HEIGHT}"></div>
 {/foreach}
 </div>
 {/if}
-{if isset($category_thumbnails) and isset($Juza_active)}
+
+{if isset($category_thumbnails)}
 <div id="ix-cat" style="display:none">
 {foreach from=$category_thumbnails item=cat}
@@ -91,4 +52,5 @@
 </div>
 {/if}
+
 {if isset($Juza_cats)}
 <div id="menu-cat" style="display:none">
@@ -96,52 +58,11 @@
 </div>
 {/if}
-{if isset($Juza_config)}
-<form id="Juza_config" method="post" class="properties" action="index.php">
-<fieldset id="Juza_config_fs">
-  <legend><span class="legend">{'Juza Theme Configuration'|@translate}</span></legend>
-  <ul>
-    <li>
-      <label>
-        <span class="property">{'Activate Juza handlers'|@translate}</span>
-        <input type="checkbox" name="Juza_handlers" {$Juza_handlers} />
-        <span class="range">{'Unselected => like Javascript inactive'|@translate}</span>
-     </label>
-    </li>
-    <li>
-      <span class="property">
-        <label for="Width">{'Index picture max-width'|@translate}</label>
-      </span>
-      <input type="text" size="4" maxlength="4" name="Juza_width" id="Juza_width" value="{$Juza_width}" />
-      <span class="range">{'[300:885]'|@translate}</span>
-    </li>
-    <li>
-      <span class="property">
-        <label for="Height">{'Index picture cropping-height'|@translate}</label>
-      </span>
-      <input type="text" size="4" maxlength="4" name="Juza_height" id="Juza_height" value="{$Juza_height}" />
-       <span class="range">{'[110:400]'|@translate}</span>
-   </li>
-    <li>
-      <span class="property">
-        <label for="Shift">{'Index picture top-shift'|@translate}</label>
-      </span>
-      <input type="text" size="4" maxlength="4" name="Juza_shift" id="Juza_shift" value="{$Juza_shift}" />
-      <span class="range">{'[-320:0]'|@translate}</span>
-    </li>
-    <li>
-      <label>
-        <span class="property">{'Auto cropping and shifting'|@translate}</span>
-        <input type="checkbox" name="Juza_Auto_CS" {$Juza_Auto_CS} />
-        <span class="range">{'Recommended medium width &lt; 900px'|@translate}</span>
-      </label>
-    </li>
-  </ul>
-</fieldset>
-  
-    <input type="hidden" value="true" name="Juza_conf" />
-    <input class="submit" type="submit" name="Juza_submit" value="{'Juza_Submit'|@translate}" />
-    <input class="submit" type="submit" name="Juza_reset" value="{'Juza_Reset'|@translate}" />
-    <input class="submit" type="submit" name="Juza_close" value="{'Juza_Close'|@translate}" />
-  
-</form>
+
+{if is_admin()}
+<div id="Juza_call" style="display:none"><a class="Juza_conf" href="#" alt="">{'Juza Theme Configuration'|@translate}</a>
+</div>
 {/if}
+
+{$MENUBAR}
+{assign var=MENUBAR value=''}
+
Index: /extensions/Juza/tags_menu.php
===================================================================
--- /extensions/Juza/tags_menu.php	(revision 4659)
+++ /extensions/Juza/tags_menu.php	(revision 4659)
@@ -0,0 +1,197 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2009 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// +-----------------------------------------------------------------------+
+// |                             functions                                 |
+// +-----------------------------------------------------------------------+
+
+function counter_compare($a, $b)
+{
+  if ($a['counter'] == $b['counter'])
+  {
+    return id_compare($a, $b);
+  }
+
+  return ($a['counter'] < $b['counter']) ? +1 : -1;
+}
+
+function id_compare($a, $b)
+{
+  return ($a['id'] < $b['id']) ? -1 : 1;
+}
+
+// +-----------------------------------------------------------------------+
+// |                           initialization                              |
+// +-----------------------------------------------------------------------+
+
+define('PHPWG_ROOT_PATH','./');
+include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
+
+check_status(ACCESS_GUEST);
+
+// +-----------------------------------------------------------------------+
+// |                       page header and options                         |
+// +-----------------------------------------------------------------------+
+
+$title= l10n('Tags');
+$page['body_id'] = 'theTagsPage';
+
+$template->set_filenames(array('tags'=>'tags.tpl'));
+
+$page['display_mode'] = $conf['tags_default_display_mode'];
+if (isset($_GET['display_mode']))
+{
+  if (in_array($_GET['display_mode'], array('cloud', 'letters')))
+  {
+    $page['display_mode'] = $_GET['display_mode'];
+  }
+}
+
+foreach (array('cloud', 'letters') as $mode)
+{
+  $template->assign(
+    'U_'.strtoupper($mode),
+    get_root_url().'tags.php'. ($conf['tags_default_display_mode']==$mode ? '' : '?display_mode='.$mode)
+    );
+}
+
+$template->assign( 'display_mode', $page['display_mode'] );
+
+// find all tags available for the current user
+$tags = get_available_tags();
+
+// +-----------------------------------------------------------------------+
+// |                       letter groups construction                      |
+// +-----------------------------------------------------------------------+
+
+if ($page['display_mode'] == 'letters') {
+  // we want tags diplayed in alphabetic order
+  usort($tags, 'tag_alpha_compare');
+
+  $current_letter = null;
+  $nb_tags = count($tags);
+  $current_column = 1;
+  $current_tag_idx = 0;
+
+  $letter = array(
+    'tags' => array()
+    );
+
+  foreach ($tags as $tag)
+  {
+    $tag_letter = strtoupper(substr($tag['url_name'], 0, 1));
+
+    if ($current_tag_idx==0) {
+      $current_letter = $tag_letter;
+      $letter['TITLE'] = $tag_letter;
+    }
+
+    //lettre precedente differente de la lettre suivante
+    if ($tag_letter !== $current_letter)
+    {
+      if ($current_column<$conf['tag_letters_column_number']
+          and $current_tag_idx > $current_column*$nb_tags/$conf['tag_letters_column_number'] )
+      {
+        $letter['CHANGE_COLUMN'] = true;
+        $current_column++;
+      }
+
+      $letter['TITLE'] = $current_letter;
+
+      $template->append(
+        'letters',
+        $letter
+        );
+
+      $current_letter = $tag_letter;
+      $letter = array(
+        'tags' => array()
+        );
+    }
+
+    array_push(
+      $letter['tags'],
+      array_merge(
+        $tag,
+        array(
+          'URL' => make_index_url(
+            array(
+              'tags' => array($tag),
+              )
+            ),
+          )
+        )
+      );
+
+    $current_tag_idx++;
+  }
+
+  // flush last letter
+  if (count($letter['tags']) > 0)
+  {
+    unset($letter['CHANGE_COLUMN']);
+    $letter['TITLE'] = $current_letter;
+    $template->append(
+      'letters',
+      $letter
+      );
+  }
+}
+
+// +-----------------------------------------------------------------------+
+// |                        tag cloud construction                         |
+// +-----------------------------------------------------------------------+
+
+// we want only the first most represented tags, so we sort them by counter
+// and take the first tags
+usort($tags, 'counter_compare');
+$tags = array_slice($tags, 0, $conf['full_tag_cloud_items_number']);
+
+// depending on its counter and the other tags counter, each tag has a level
+$tags = add_level_to_tags($tags);
+
+// we want tags diplayed in alphabetic order
+usort($tags, 'tag_alpha_compare');
+
+// display sorted tags
+foreach ($tags as $tag)
+{
+  $template->append(
+    'tags',
+    array_merge(
+      $tag,
+      array(
+        'URL' => make_index_url(
+          array(
+            'tags' => array($tag),
+            )
+          ),
+        )
+      )
+    );
+}
+
+include(PHPWG_ROOT_PATH.'include/page_header.php');
+$template->pparse('tags');
+include(PHPWG_ROOT_PATH.'include/page_tail.php');
+?>
Index: /extensions/Juza/theme.css
===================================================================
--- /extensions/Juza/theme.css	(revision 4658)
+++ /extensions/Juza/theme.css	(revision 4659)
@@ -4,9 +4,9 @@
 html body * {background-color: transparent; margin:0;padding:0; outline:0;}
 html body {background-color: #0; margin:0;padding:0;}
-html body #the_page { background-color: #292929 !important; width:1240px;margin:10px auto; height: 100%; border: 1px solid #fff !important; }
+html body #the_page { background-color: #292929 !important; width:1240px;margin:10px auto; min-height: 100%; height: 100%; border: 1px solid #fff !important; }
 body, h1, h2, h3, dt, #menubar dt, .throw, INPUT.rateButtonSelected {color:#ddffdd;}
-#content .pageNumberSelected {color: #52ff97; color: #72ffb7;}
+#content .pageNumberSelected { color: #72ffb7; }
 .content div.titrePage ul.categoryActions { display: none; } 
-.content div.thumbnailCategory div.description { position:relative; width:100%; z-index:10; overflow: hidden; }
+.content div.thumbnailCategory div.description { position:relative; width:100%; z-index:10; overflow: hidden; height:auto; top:0px;}
 .content ul.thumbnails span, .content ul.thumbnails label, .content div.thumbnailCategory div.illustration { width:135px; }
 .content { margin:0 3em !important; font-family:Verdana,Arial,Helvetica,sans-serif; font-size:10pt; }
@@ -14,37 +14,48 @@
 .content div.thumbnailCategory div.description h3 { position:relative; top:10px; z-index:11; }
 .content div.thumbnailCategory div.description ul { margin: 10px 5px 5px 30px; }
-.content ul.thumbnailCategories li { width:100%; }
-.content ul.thumbnailCategories li.Juza-cat { margin:0 0 20px; }
+/* .content ul.thumbnailCategories li { width:100%; }  Let user choice in case of noscript */
+.content ul.thumbnailCategories li.Juza-cat { margin:0 0 20px; height:auto; min-height:auto; }
 .content ul.thumbnails span.wrap1 { background-color: #000 !important; width: 140px; height: 140px; min-width: 140px; min-height: 140px; max-width: 140px; max-height: 140px; margin:0 2px 2px 0; border: 1px solid #444; }
 .content ul.thumbnails span.wrap1 .thumbLegend { display: none !important; }
 .content ul.thumbnails span.wrap2 { -moz-border-radius: 0; border-radius: 0; }
 .content ul.thumbnails span.wrap2 img.thumbnail { margin:auto; border: 1px solid #111; }
+#copyright { margin-top: 0px; }
 #copyright * { color: #383838; }
 form.filter fieldset label textarea { display:block; margin:0.5em auto; color: #ddffdd; }
 fieldset { margin:1em !important; padding:1em !important; }
+fieldset#Juza_config_fs { border: 0px; }
 #content UL.thumbnails LI SPAN.wrap1 SPAN.wrap2:hover { background-color: #181818; }
 div.illustration { overflow: hidden; }
 div.illustration img { border: 0; margin-left: 0px; }
-.bigImg { position:relative; }
+.bigImg { position:relative; top:0px; width:auto; }
 img.icon[alt="(!)"] { display: none; }
-input.conf, a { color: #FB9700 !important }
-input.conf:hover, a:hover { color: #ef5810 !important }
-input[type="submit"].conf { border:0;margin-top: 7; margin-bottom: 0;background-color: transparent !important; font-weight:normal; }
+input.Juza_conf, a { color: #FB9700 !important }
+input.Juza_conf:hover, a:hover { color: #ef5810 !important }
+input[type="submit"].Juza_conf { border:0;margin-top: 7; margin-bottom: 0;background-color: transparent !important; font-weight:normal; }
 input[type="text"], input[type="password"], input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] {
   background-color:#D3D3D3 !important; }
 #content, #content *,.content, .content *, .titrePage, #content div.thumbnailCategory { background-color: transparent; }
-#menubar { display:none; background-color: #222; position: absolute; right: 2%; z-index: 9999; }
+#menubar { display:none; background-color: #222; position: absolute; right: 2%; z-index: 9999; top: 135px; }
 #menubar.displayed { display: block; }
 #menubar *, #menubar dt, #menubar dl { background-color: #222; }
+#menubar #menuTagCloud span { white-space:normal; }
 select, textarea { color:#ddffdd; background-color:#222 !important; }
 #imageToolBar, .header_notes { background-color: transparent; }
 #jquery_local_img { text-align: center; margin-top: 5px; min-height: 600px; height: 600px; /* linked to Area Mapping */ }
+a.Juza_conf { display: none; }
 #Juza_config input[type="text"], #Juza_config input[type="checkbox"] { float:left; margin:6px auto auto 4px; }
 #Juza_config input[type="submit"] { margin:10px auto 15px;  }
 #Juza_config .range { text-align: left; float: left; margin-left: 10px; font-style:italic; }
+#JuzaBox {width:100%; margin:50px 0px; text-align:center; display:none;}
+#JuzaWrap {width:800px; background-color:#292929; border:3px #6DAA37 solid; margin:auto; margin-left:20%; color:#ddffdd; position:fixed;  z-index:9999; top: 115px;}
+#JuzaShade {width:100%; height:100%; position:absolute; top:0px; left:0px; background:#000; -moz-opacity:0.5; -khtml-opacity:0.5; opacity:0.5; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50); display:none; z-index:9998;}
+#JuzaCloseBox { width:16px; height:16px; line-height:15px; background-color:#6DAA37; position:absolute; top:5px; right:10px; cursor:pointer;}
+#jquery_local_img #relTag dt { display:none; }
 .juzabar { margin: 12pt 0 6pt; font-size: 10pt; width: 100%; background-color: #353735 !important; text-align: center; }
+.juzabar td.JS_active { display: none; }
+table.juzabar td { width: 155px; }
 legend .legend { padding: 0 10px; }
 .maxIllustration { left:20px; margin-bottom:35px; max-width:100% !important; position:relative; top:30px; width:100% !important; }
-.maxIllustration a { overflow: hidden; display: block; position:relative; z-index:12; float:right; }
+.maxIllustration a { overflow: hidden; display: block; position:relative; z-index:12; float:right; max-height: auto; height: auto; width:auto; }
 .middle_block h2, h2 { color: #6daa37; font-size:16px; text-align: center; } 
 .middle_block * { font-family:Verdana,Arial,Helvetica,sans-serif; font-size:11pt; text-align:left; }
@@ -63,3 +74,4 @@
 #theHeader h1 { font-family:Verdana,Arial,Helvetica,sans-serif; font-size:60px; font-style:normal; font-weight:normal; line-height:0.89em; color: #fff;}
 #theHeader p { font-family:Verdana,Arial,Helvetica,sans-serif; font-size:20px; letter-spacing:5px; line-height:2.1em; colour: #fff; }
-#the_page #imageToolBar { top:-90px; }
+#the_page #imageToolBar { top:0px; }
+#theNotificationPage #menubar dl, #thePopuphelpPage #menubar dl { margin:0; }
Index: /extensions/Juza/themeconf.inc.php
===================================================================
--- /extensions/Juza/themeconf.inc.php	(revision 4658)
+++ /extensions/Juza/themeconf.inc.php	(revision 4659)
@@ -29,4 +29,5 @@
   include_once(JUZA_PATH.'include/functions.inc.php');
   add_event_handler('loc_after_page_header', 'Juza_hook', 20);
+  add_event_handler('blockmanager_apply', 'Juza_tags');
   /* add_event_handler('init', 'remove_AkBookStyle_handlers', 50); */
 }
