Index: /extensions/AMenuManager/admin/amm_randompicconfig.tpl
===================================================================
--- /extensions/AMenuManager/admin/amm_randompicconfig.tpl	(revision 3689)
+++ /extensions/AMenuManager/admin/amm_randompicconfig.tpl	(revision 3690)
@@ -43,5 +43,5 @@
     $("#iamm_rp_pc_slider").slider(
       {
-        min:0, 
+        min:0,
         max:60000,
         steps:120,
@@ -49,8 +49,18 @@
         slide: function(event, ui) { formatDelay(ui.value); }
       });
+
+    formatHeight({/literal}{$datas.height}{literal});
+    $("#iamm_rp_height_slider").slider(
+      {
+        min:99,
+        max:300,
+        steps:201,
+        startValue:affectHeight({/literal}{$datas.height}{literal}),
+        slide: function(event, ui) { formatHeight(ui.value); }
+      });
   }
 
   function formatDelay(delay)
-  { 
+  {
     $("#iamm_randompicture_periodicchange").val(delay);
     if(delay==0)
@@ -62,4 +72,25 @@
       $("#iamm_rp_pc_display").html((delay/1000).toFixed(2)+"s");
     }
+  }
+
+  function formatHeight(height)
+  {
+    (height==99)?vheight=0:vheight=height;
+
+    $("#iamm_randompicture_height").val(vheight);
+    if(vheight==0)
+    {
+      $("#iamm_rp_height_display").html("{/literal}{'g002_setting_randompic_height_auto'|@translate}{literal}");
+    }
+    else
+    {
+      $("#iamm_rp_height_display").html(vheight+"px");
+    }
+  }
+
+  function affectHeight(height)
+  {
+    if(height==0)
+    {return(0);}else{return(height);}
   }
 
@@ -110,5 +141,5 @@
       <tr>
         <td>{'g002_setting_block_title'|@translate}</td>
-        <td>
+        <td colspan="2">
           <input type="text" id="iamm_randompicture_title" value="" maxlength="50" onkeyup="apply_changes('iamm_randompicture_title');" onblur="apply_changes('iamm_randompicture_title');"/>
           <select onchange="change_lang();" id="islang">
@@ -119,8 +150,20 @@
       <tr>
         <td></td>
-        <td style="font-size:80%;">
+        <td style="font-size:80%;" colspan="2">
           <a style="cursor:pointer;" onclick="do_translation()">{'g002_translate'|@translate}</a>
         </td>
       </tr>
+
+      <tr>
+        <td>{'g002_setting_randompic_height'|@translate}</td>
+        <td>
+          <input type="hidden" name="famm_randompicture_height" id="iamm_randompicture_height" value="{$datas.height}">
+          <div id="iamm_rp_height_slider"></div>
+        </td>
+        <td width="90px">
+          <div id="iamm_rp_height_display"></div>
+        </td>
+      </tr>
+
 
     </table>
Index: /extensions/AMenuManager/amm2.css
===================================================================
--- /extensions/AMenuManager/amm2.css	(revision 3689)
+++ /extensions/AMenuManager/amm2.css	(revision 3690)
@@ -3,10 +3,25 @@
   font-size:85%;
   float:none;
-  width:100%;
+  margin-right:auto;
+  margin-left:auto;
+  max-width:180px;
+  position:relative;
+  padding:10px;
+}
+
+.ammillustrationc{
+  margin:0px 10px 10px 10px;
 }
 
 #menubar dd.randompicdd {
-  /*min-height:180px;*/
-  margin:10px;
   display:block;
+  margin-left:0px;
 }
+
+#irandompicinner {
+  width:100%;
+  overflow:hidden;
+  float:none;
+}
+
+
Index: /extensions/AMenuManager/amm_aip.class.inc.php
===================================================================
--- /extensions/AMenuManager/amm_aip.class.inc.php	(revision 3689)
+++ /extensions/AMenuManager/amm_aip.class.inc.php	(revision 3690)
@@ -467,4 +467,5 @@
   protected function action_randompic_modify_config()
   {
+    $this->my_config['amm_randompicture_height']=$_POST['famm_randompicture_height'];
     $this->my_config['amm_randompicture_periodicchange']=$_POST['famm_randompicture_periodicchange'];
     $this->my_config['amm_randompicture_showname']=$_POST['famm_randompicture_showname'];
@@ -529,4 +530,5 @@
       'showcomment_selected' => $this->my_config['amm_randompicture_showcomment'],
       'periodic_change' => $this->my_config['amm_randompicture_periodicchange'],
+      'height' => $this->my_config['amm_randompicture_height'],
       'lang_selected' => $user['language'],
       'fromlang' => substr($user['language'],0,2)
Index: /extensions/AMenuManager/amm_pip.class.inc.php
===================================================================
--- /extensions/AMenuManager/amm_pip.class.inc.php	(revision 3689)
+++ /extensions/AMenuManager/amm_pip.class.inc.php	(revision 3690)
@@ -3,6 +3,6 @@
   Plugin     : Advanced Menu Manager
   Author     : Grum
-    email    : grum@grum.dnsalias.com
-    website  : http://photos.grum.dnsalias.com
+    email    : grum@piwigo.org
+    website  : http://photos.grum.fr
     PWG user : http://forum.phpwebgallery.net/profile.php?id=3706
 
@@ -78,5 +78,9 @@
     {
       $block->set_title(  base64_decode($this->my_config['amm_randompicture_title'][$user['language']]) );
-      $block->data = array("delay" => $this->my_config['amm_randompicture_periodicchange']);
+      $block->data = array(
+        "delay" => $this->my_config['amm_randompicture_periodicchange'],
+        "blockHeight" => $this->my_config['amm_randompicture_height'],
+        "firstPicture" => $this->ajax_amm_get_random_picture()
+      );
       $block->template = dirname(__FILE__).'/menu_templates/menubar_randompic.tpl';
     }
Index: /extensions/AMenuManager/amm_root.class.inc.php
===================================================================
--- /extensions/AMenuManager/amm_root.class.inc.php	(revision 3689)
+++ /extensions/AMenuManager/amm_root.class.inc.php	(revision 3690)
@@ -47,4 +47,5 @@
       'amm_randompicture_showcomment' => 'n',   //n:no, o:over, u:under
       'amm_randompicture_periodicchange' => 0,   //0: no periodic change ; periodic change in milliseconds
+      'amm_randompicture_height' => 0,           //0: automatic, otherwise it's the fixed height in pixels
       'amm_randompicture_title' => array(),
       'amm_sections_modspecials' => array(
Index: /extensions/AMenuManager/language/de_DE/plugin.lang.php
===================================================================
--- /extensions/AMenuManager/language/de_DE/plugin.lang.php	(revision 3689)
+++ /extensions/AMenuManager/language/de_DE/plugin.lang.php	(revision 3690)
@@ -90,4 +90,6 @@
 $lang['g002_setting_randompic_periodicchange_delay'] = "Frist";
 $lang['g002_setting_randompic_periodicchange_deactivated'] = "Deaktiviert";
+$lang['g002_setting_randompic_height'] = "Höhe der Block Menü";
+$lang['g002_setting_randompic_height_auto'] = "Auto";
 
 ?>
Index: /extensions/AMenuManager/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/AMenuManager/language/en_UK/plugin.lang.php	(revision 3689)
+++ /extensions/AMenuManager/language/en_UK/plugin.lang.php	(revision 3690)
@@ -89,5 +89,6 @@
 $lang['g002_setting_randompic_periodicchange_delay'] = "Delay";
 $lang['g002_setting_randompic_periodicchange_deactivated'] = "Disabled";
-
+$lang['g002_setting_randompic_height'] = "Height of menu block";
+$lang['g002_setting_randompic_height_auto'] = "Automatic";
 
 ?>
Index: /extensions/AMenuManager/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/AMenuManager/language/fr_FR/plugin.lang.php	(revision 3689)
+++ /extensions/AMenuManager/language/fr_FR/plugin.lang.php	(revision 3690)
@@ -89,4 +89,5 @@
 $lang['g002_setting_randompic_periodicchange_delay'] = "Délai";
 $lang['g002_setting_randompic_periodicchange_deactivated'] = "Désactivé";
-
+$lang['g002_setting_randompic_height'] = "Hauteur du bloc de menu";
+$lang['g002_setting_randompic_height_auto'] = "Automatique";
 ?>
Index: /extensions/AMenuManager/language/it_IT/plugin.lang.php
===================================================================
--- /extensions/AMenuManager/language/it_IT/plugin.lang.php	(revision 3689)
+++ /extensions/AMenuManager/language/it_IT/plugin.lang.php	(revision 3690)
@@ -88,5 +88,7 @@
 $lang['g002_setting_randompic_periodicchange'] = "Cambiamento periodico dell\'immagine";
 $lang['g002_setting_randompic_periodicchange_delay'] = "Ritardo";
-$lang['g002_setting_randompic_periodicchange_deactivated'] = "Disattivato";
+$lang['g002_setting_randompic_periodicchange_deactivated'] = "Disabili";
+$lang['g002_setting_randompic_height'] = "Altezza blocco del menu";
+$lang['g002_setting_randompic_height_auto'] = "Automatico";
 
 ?>
Index: /extensions/AMenuManager/main.inc.php
===================================================================
--- /extensions/AMenuManager/main.inc.php	(revision 3689)
+++ /extensions/AMenuManager/main.inc.php	(revision 3690)
@@ -2,5 +2,5 @@
 /*
 Plugin Name: Advanced Menu Manager
-Version: 2.1.0
+Version: 2.1.1
 Description: Gestion avancée du menu / Advanced management of menu
 Plugin URI: http://piwigo.org
@@ -32,4 +32,14 @@
 |         |            |   (cf. post:107877 on french forum)
 |         |            |   (cf. topic:14374 on french forum)
+| 2.1.1   | 2009/07/27 | * random picture is preloaded before the first ajax call
+|         |            |   assuming the display of a thumbnail even if javascript
+|         |            |   is disabled on the browser
+|         |            |   (cf. post:116807 on french forum)
+|         |            | * give the possibility to choose between an automatic
+|         |            |   and a fixed height for the block menu
+|         |            |   (cf. post:116804 on french forum)
+|         |            | * compatibility with Sylvia theme
+|         |            |   (cf. post:116800 on french forum)
+|         |            |
 |         |            |
 |         |            |
@@ -60,5 +70,5 @@
 define('AMM_PATH' , PHPWG_PLUGINS_PATH . AMM_DIR . '/');
 
-define('AMM_VERSION' , '2.1.0'); // => ne pas oublier la version dans l'entête !!
+define('AMM_VERSION' , '2.1.1'); // => ne pas oublier la version dans l'entête !!
 
 global $prefixeTable, $page;
Index: /extensions/AMenuManager/menu_templates/menubar_randompic.tpl
===================================================================
--- /extensions/AMenuManager/menu_templates/menubar_randompic.tpl	(revision 3689)
+++ /extensions/AMenuManager/menu_templates/menubar_randompic.tpl	(revision 3690)
@@ -6,17 +6,27 @@
 {literal}
 <script type="text/javascript">
-//var divnum = 1;
-//var divprec = 0;
+var fixedHeight = {/literal}{$block->data.blockHeight}{literal};
 
   function init()
   {
-    $("#iamm_ill0").hide();
-    //$("#iamm_ill1").hide();
+    {/literal}
+    {if $block->data.blockHeight>0}
+      $("#irandompicinner").height(fixedHeight);
+      {literal}$("#iammrpic").load( function () { computePositionTop(); } );{/literal}
+    {else}
+      {literal}
+      $("#iammrpic").load( function () { $("#irandompicinner").animate({height: ($("#iamm_ill0").innerHeight())+"px"}, "normal"); } );
+      {/literal}
+    {/if}
+    {literal}
+  }
+
+  function computePositionTop()
+  {
+    $("#iamm_ill0").css({top:(fixedHeight-$("#iamm_ill0").innerHeight())/2});
   }
 
   function getRandomPicture()
   {
-    //divprec=divnum;
-    //divnum=1-divnum;
     $.get("./index.php", {ajaxfct:"randompic"},
       function (data)
@@ -25,27 +35,47 @@
         {
           $("#iamm_ill0").html(data);
-          $("#iammrpic").load( function () {
-            $("#irandompicdd").animate({height: ($("#iamm_ill0").height())+"px"}, "normal", function ()
-            {
-              $("#iamm_ill0").fadeTo('slow', 1, function ()
+
+          {/literal}
+          {if $block->data.blockHeight>0}
+            {literal}
+            $("#iammrpic").load( function () {
+              computePositionTop();
+              $("#iamm_ill0").fadeTo('slow', 1);
+            } );
+            {/literal}
+          {else}
+            {literal}
+            $("#iammrpic").load( function () {
+              $("#irandompicinner").animate({height: ($("#iamm_ill0").innerHeight())+"px"}, "normal", function ()
               {
-                $("#irandompicdd").animate({height: this.clientHeight+"px"}, "normal");
+                $("#iamm_ill0").fadeTo('slow', 1, function ()
+                {
+                  $("#irandompicinner").animate({height: this.clientHeight+"px"}, "normal");
+                });
               });
-            });
-          } );
+            } );
+            {/literal}
+          {/if}
+          {literal}
+
         } );
       }
     );
   }
+
+
 </script>
 {/literal}
 
 <dd id="irandompicdd" class="randompicdd">
-  <div id="iamm_ill0" class="illustration ammillustration"></div>
-  <!--<div id="iamm_ill1" class="illustration ammillustration"></div>-->
+  <div id="irandompicinner" class="illustration">
+    <div class="ammillustrationc">
+      <div id="iamm_ill0" class="ammillustration">{$block->data.firstPicture}</div>
+    </div>
+  </div>
 </dd>
 
 <script type="text/javascript">
-  getRandomPicture();
+  init();
   {if $block->data.delay > 0 }
     var vIntervalID = window.setInterval(getRandomPicture, {$block->data.delay});
