Index: /extensions/Autosize/js/Affiche_script.js
===================================================================
--- /extensions/Autosize/js/Affiche_script.js	(revision 7457)
+++ /extensions/Autosize/js/Affiche_script.js	(revision 7458)
@@ -113,5 +113,5 @@
                                      info_theImage.borderwidth.top;
 
-              img_top = info_theImage.top + info_theImage.borderwidth.top ;
+              img_top = info_theImage.top + info_theImage.borderwidth.top;
               return { marge_top: marge_top, img_top: img_top };
 
@@ -124,18 +124,39 @@
               jQuery("#" + Parent + " p").css({ padding: "0px", margin: "0px "
               });
-            //  jQuery("#" + Parent + " p:not(:contains(' ')) ").remove();
-              var inter_ligne = jQuery("#" + Parent + " p").css("lineHeight");
-
-              jQuery("#" + Parent).css({ padding: "0px",
-               marginLeft: "auto",
-                  marginRight: "auto",
-                  marginTop: "0px",
-                  marginBottom: "0px"
-                });
-
+              //  jQuery("#" + Parent + " p:not(:contains(' ')) ").remove();
+
+
+
+              //=============================================================================
               var info_description = { top: 0, bottom: 0, height: 0 };
-              //=============================================================================
-              info_img = jQuery("#" + Parent + " img").info();
-              info_description.top = info_img.bottom;
+
+              if (theme.match(RegExp("simple", "gi"))) {
+                  jQuery("#" + Parent).css({ padding: "0px",
+                      marginLeft: "0px",
+                      marginRight: "auto",
+                      marginTop: "0px",
+                      marginBottom: "0px"
+                  });
+              } else {
+                  jQuery("#" + Parent).css({ padding: "0px",
+                      marginLeft: "auto",
+                      marginRight: "auto",
+                      marginTop: "0px",
+                      marginBottom: "0px"
+                  });
+              }
+
+              if (theme.match(RegExp("luciano", "g"))) {
+                  info_img = jQuery("#" + Parent + " #theImg").info();
+              } else {
+
+                  info_img = jQuery("#" + Parent + " img").info();
+              }
+
+              info_description.marge = { bottom: info_img.padding.bottom + info_img.margin.bottom + info_img.borderwidth.bottom,
+                  top: info_img.padding.top + info_img.borderwidth.top
+              }
+
+              info_description.top = info_img.bottom + info_img.margin.bottom + info_img.borderwidth.bottom;
               //=============================================================================
               info_gbo = jQuery("#gbo").info();
@@ -143,17 +164,36 @@
                   info_description.top = info_gbo.bottom;
               //=============================================================================
-
-              info_desc = jQuery("#" + Parent + " p:last").info();
-              info_description.bottom = info_desc.bottom;
+              info_desc = jQuery("#" + Parent + " p:first").info();
+              //  if (info_desc.top > info_img.bottom)
+              //     info_description.top = info_desc.top;
+
+
+              info_table = jQuery(".infoTable").info();
+
+              if (info_table.top > info_description.bottom)
+                  info_description.bottom = info_table.top;
+              //===========================================================================
 
               info_licencetag = jQuery(".licencetag").info();
 
 
-              if (info_licencetag.bottom > info_description.bottom) {
-                  jQuery(".licencetag").css("border", "solid 2px transparent");
-                  info_description.bottom = info_licencetag.bottom;
+              if (info_licencetag.bottom > 0) {
+                  jQuery(".licencetag").css("border", "solid 5px transparent");
+                  if (info_licencetag.bottom > info_licencetag.height)
+                      info_description.bottom = info_licencetag.bottom - 3;
+                  else
+                      info_description.bottom -= info_licencetag.padding.top + info_table.margin.top;
 
               }
               //=============================================================================
+              if (theme.match(RegExp("gally", "gi"))) {
+                  if (!theme.match(RegExp("lapis", "gi"))) {
+                      info_description.bottom = info_description.bottom
+                  }
+              }
+
+
+
+
 
               if (info_description.top < 1)
@@ -161,8 +201,62 @@
 
 
-              if (info_description.bottom < info_description.top)
-                  info_description.bottom = info_description.top = 1;
-
-              info_description.height = info_description.bottom - info_description.top ;
+              if (info_description.bottom < info_description.top) {
+                  info_description.bottom = info_description.top;
+
+                  info_desc = jQuery("#" + Parent + " p:last").info();
+
+                  if (info_desc.bottom > info_img.bottom)
+                      info_description.bottom = info_desc.bottom;
+              }
+
+
+              if (theme.match(RegExp("gally", "g"))) {
+                  if (!theme.match(RegExp("lapis", "gi"))) {
+                      info_copyright = jQuery("#copyright").info();
+                      info_description.bottom += info_copyright.height;
+                  }
+              }
+              info_description.height = info_description.bottom - info_description.top;
+
+              if (0) {
+                  /*  jQuery("#Debug").text(jQuery("#Debug").text() + user_status);    
+        
+                  jQuery("#Debug").hide();
+                  jQuery("#Debug1").hide();
+                  jQuery("#Debug2").hide(); 
+                  info_description.width = "800";
+                  */
+
+                  Bandeau_bas = info_description;
+
+                  jQuery("#Debug").css({
+                      filter: 'alpha(opacity:50)',
+                      position: "absolute",
+                      width: "800px",
+                      border: "solid 1px green",
+                      top: Bandeau + "px"
+                  });
+                  jQuery("#Debug").text("Debug:Bandeau : " + Bandeau);
+
+                  jQuery("#Debug1").css({
+                      filter: 'alpha(opacity:50)',
+                      position: "absolute",
+                      border: "solid 1px green",
+                      top: Bandeau_bas.top + "px",
+                      width: (200) + "px",
+                      height: Bandeau_bas.height + "px"
+                  });
+                  jQuery("#Debug1").text("Debug1:Bandeau_bas top : " + Bandeau_bas.top + " height:" + Bandeau_bas.height);
+
+                  jQuery("#Debug2").css({
+                      filter: 'alpha(opacity:50)',
+                      position: "absolute",
+                      left: '50px',
+                      width: (300) + "px",
+                      border: "solid 1px green", top: Bandeau_bas.bottom + "px"
+                  });
+                  jQuery("#Debug2").text("Debug2:Bandeau_bas bottom :" + Bandeau_bas.bottom);
+                  //  cl_visible = false;
+              }
 
               if (check_desc_v != 'checked="checked"') {
@@ -213,15 +307,7 @@
           var Bandeau_t = Info_entete("theImage")
           Bandeau = Bandeau_t.img_top;
-
-
           var Bandeau_bas = 0;
           Bandeau_bas = Info_description("theImage");
-
-
           //===================================================================	
-
-
-
-
           /*
           * window .resize
@@ -230,31 +316,8 @@
               if (typeof (event) == 'undefined') return;
               if (!cl_visible) return;
-               if (eval(user_status + "_enabled") == "") return;
+              if (eval(user_status + "_enabled") == "") return;
               var chk = eval(user_status + "_enabled");
-              /*  jQuery("#Debug").text(jQuery("#Debug").text() + user_status);
-               
-              jQuery("#Debug").hide();
-              jQuery("#Debug1").hide();
-              jQuery("#Debug2").hide();
-             
-              jQuery("#Debug").css({ position: "absolute", width: "200px", border: "solid 1px green", top: Bandeau + "px" });
-              jQuery("#Debug").text(Bandeau);
-
-              jQuery("#Debug1").css({ position: "absolute",
-              border: "solid 1px green",
-              top: Bandeau_bas.top + "px",
-              width: (Bandeau_bas.width / 5) + "px",
-              height: Bandeau_bas.height + "px"
-              });
-              jQuery("#Debug1").text(Bandeau_bas.top + " height:" + Bandeau_bas.height);
-
-              jQuery("#Debug2").css({ position: "absolute",
-              left: '200px',
-              border: "solid 1px green", top: Bandeau_bas.bottom + "px"
-              });
-              jQuery("#Debug2").text(Bandeau_bas.bottom);
-              
- */
-             
+
+
 
               //==========================================================================
@@ -309,5 +372,5 @@
               var info_titrePage = jQuery("#titrePage").info();
 
-               
+
               var Zone_Affichage = jQuery("#theImage").info();
 
@@ -316,9 +379,11 @@
               var info_theHeader = jQuery("#theHeader").info();
 
-              var marge = 0;
+              var marge = (Zone_Affichage.width - info_ToolBar.width) / 2;
 
               var marge_right = marge;
               var marge_left = marge;
+
               if (info_content.width > 100) {
+                  marge_left = 0;
                   marge_right = info_imageInfoBar.margin.left + info_imageInfoBar.margin.right;
                   winwidth = info_content.width;
@@ -330,5 +395,4 @@
               winwidth -= (marge_right + marge_left);
 
-              //======================================================================
 
 
@@ -378,9 +442,9 @@
 
                       var TheImg = jQuery("#map").get(0);
-                       img_reelle.height = info_image.height;
-                       img_reelle.width = winwidth - marge_right - marge_right;
+                      img_reelle.height = info_image.height;
+                      img_reelle.width = winwidth - marge_right - marge_right;
                       Bandeau_bas.height = 10;
                       marge_right = 10;
-                      
+
                       info_the_page = jQuery("#the_page").info();
                       ;
@@ -505,22 +569,28 @@
               Zone_Affichage.width = winwidth - borderW;
 
+
+
+              var Licence = jQuery(".licencetag");
+              info_Licence = jQuery(".licencetag").info();
               //==================================================================================
               jQuery("#theImage #theImg IMG").css("marginTop", "0px")
 
-              var h = 0;
+              var correction = 0;
               if (theme.match(RegExp("sobre", "g"))) {
-                  h += 0; //??
+
+                  correction = -info_Licence.padding.top;
+
               } else if (theme.match(RegExp("Pure", "g"))) {
-                  h += 0; //??
+                  correction += 0; //??
               } else if (theme.match(RegExp("luciano", "g"))) {
-                  h += 0; //??
+                  correction += 0; //??
               } else if (theme.match(RegExp("simple", "g"))) {
-                  h += 0; //??
+                  correction += 0; //??
               } else if (theme.match(RegExp("gally", "g"))) {
-                  h += 0; //??
+                  correction += 0; //??
 
               }
               //================ Licence  ========================
-              var Licence = jQuery(".licencetag");
+
               if (Licence.length > 0) {
                   jQuery(".licencetag").css("padding", "0px");
@@ -531,24 +601,13 @@
 
 
-              //=========================================================================
+
               img_top = Bandeau;
-              //============ Padding image ? ===============
-
-              img_padding_top = (info_img.padding.top);
-              img_padding_top += (info_img.padding.bottom);
-              img_padding_top += (info_img.borderwidth.top);
-              img_padding_top += (info_img.borderwidth.bottom);
-
-              margin_top = (info_Cadre.margin.top);
-              padding_top = (info_Cadre.padding.top);
-              padding_top += (info_Cadre.padding.bottom);
 
               Marge_Basse = parseInt(marge_basse || 0); // hors bandeau
               //==========================================================================
               h = 0;
-              Zone_Affichage.height = winheight - Bandeau - Marge_Basse;
-              var Image_height = Zone_Affichage.height - Bandeau_bas.height;
-
-              // jQuery("#Debug1").css("top", Image_height + "px");
+              Zone_Affichage.height = winheight - Bandeau - Marge_Basse - correction;
+              var Image_height = Zone_Affichage.height - Bandeau_bas.height - Bandeau_bas.marge.top - Bandeau_bas.marge.bottom;
+
               //=============================================================
               var height_user = eval(user_status + "_height");
@@ -612,4 +671,6 @@
 
               // }
+              //===================================================
+
 
 
@@ -617,5 +678,5 @@
               //=============LLGBO2 ===========================
 
-              t1 = { top: 0 };
+
               if (marges_llgbo > 0) {
 
@@ -625,53 +686,62 @@
                   if (TheImg.src) {
 
-
-                      if ((winwidth) < Image_width) {
-                          _width = maxWidth;
+                      Image_width -= marges_llgbo; // réduction frame
+                      Image_height -= marges_llgbo; // réduction frame
+                      if (rapport > 1) {
+                          jQuery("#gbo").outerWidth(Image_width);
+                          jQuery("#gbo").css("width", Image_width + "px");
+
+
+                          t1 = jQuery("#gbo div:last").info();
+
+                          Image_width = jQuery("#gbo div:last").innerWidth();
+                          Image_height = parseInt(Image_width / rapport);
+
+                          jQuery("#gbo").outerHeight(Image_height + marges_llgbo);
+                          jQuery("#gbo").css("height", (Image_height + marges_llgbo) + "px");
+                          if ( jQuery.browser.msie) {
+                              jQuery("#gbo").css("paddingBottom", 18 + "px");
+                          }
+
                       } else {
-                          _width = Image_width;
+                          Image_height -= 4;
+                          Image_width -= 4;
+                          jQuery("#gbo").css("height", (Image_height + marges_llgbo) + "px");
+                          jQuery("#gbo").css("width", Image_width + marges_llgbo + "px");
+
+                          Image_width = jQuery("#gbo div:last").innerWidth();
+                          Image_height = parseInt(Image_width / rapport);
+
                       }
-                      _width -= marges_llgbo; // réduction frame
-                      jQuery("#gbo").outerWidth(_width);
-                      jQuery("#gbo").css("width", (_width) + "px");
-
-
-
-                      Image_width = jQuery("#gbo div:last").innerWidth();
-                      Image_height = parseInt(Image_width / rapport);
-                      jQuery("#gbo").outerHeight(Image_height + marges_llgbo + 10);
-                      jQuery("#gbo").css("height", (Image_height + marges_llgbo + 10) + "px");
-
-                  } else {
-
-                      jQuery("#gbo").width(Zone_Affichage.width - marges);
-                      jQuery("#gbo").height(Image_height + marges)
-                      jQuery("#gbo").css("width", Zone_Affichage.width - marges + "px");
-                      jQuery("#gbo").css("height", Image_height - marges + "px")
+
+                      a1 = jQuery("area[rel=prev]");
+                      a2 = jQuery("area[rel=next]");
+
+                      if (a1.length == 0) {
+                          jQuery("area[rel=prev]").attr({ coords: "'" + 0 + ",0," + 0 + "," + 0 + "'" });
+                          jQuery("area[rel=up]").attr({ coords: "'" + 0 + ",0," + Image_width / 2 + "," + Image_height + "'" });
+                          jQuery("area[rel=next]").attr({ coords: "'" + Image_width / 2 + ",0," + (Image_width) + "," + Image_height + "'" });
+
+                      } else if (a2.length == 0) {
+                          jQuery("area[rel=prev]").attr({ coords: "'" + 0 + ",0," + (Image_width) / 2 + "," + Image_height + "'" });
+                          jQuery("area[rel=up]").attr({ coords: "'" + Image_width / 2 + ",0," + (Image_width * 2) / 2 + "," + Image_height + "'" });
+                          jQuery("area[rel=next]").attr({ coords: "'" + 0 + ",0," + 0 + "," + 0 + "'" });
+
+                      } else {
+
+                          jQuery("area[rel=prev]").attr({ coords: "'" + 0 + ",0," + (Image_width) / 3 + "," + Image_height + "'" });
+                          jQuery("area[rel=up]").attr({ coords: "'" + Image_width / 3 + ",0," + (Image_width * 2) / 3 + "," + Image_height + "'" });
+                          jQuery("area[rel=next]").attr({ coords: "'" + (Image_width * 2) / 3 + ",0," + (Image_width) + "," + Image_height + "'" });
+                      }
+
 
                   }
-
-
-
-                  if (jQuery("area").length > 0) {
-                      jQuery("area").each(function (i) {
-
-                          obj1 = this.rel;
-                          obj2 = this.coords;
-                          if (obj1 == "up")
-                              this.coords = (Image_width / 3) + "," + 0 + "," + (Image_width * 2 / 3) + "," + Image_height;
-                          else if (obj1 == "prev")
-                              this.coords = 0 + "," + 0 + "," + (Image_width / 3) + "," + Image_height;
-                          else if (obj1 == "next")
-                              this.coords = (Image_width * 2) / 3 + "," + 0 + "," + (Image_width * 3 / 3) + "," + Image_height;
-
-                      });
-
-
-
-
-
-
-                  }
-
+              }
+
+              //================ Zone affichage =========================
+              //  Image_height, Image_width = valeur a atteindre.
+              if (theme.match(RegExp("luciano", "g"))) {
+                  Zone_Affichage.height -= Bandeau_bas.height;
+                  jQuery(Cadre).height(Zone_Affichage.height);
 
               }
@@ -683,22 +753,18 @@
               jQuery("#comments").css("top", 0 + "px");
 
-              //================ Zone affichage =========================
-              //  Image_height, Image_width = valeur a atteindre.
-              if (theme.match(RegExp("luciano", "g"))) {
-                  Zone_Affichage.height -= Bandeau_bas;
-              }
-
 
               jQuery(Cadre).width(Zone_Affichage.width);
+
               //==============================================================
 
               img_finale.height = Image_height;
               img_finale.width = Image_width;
-              //==============================================================
+
+              //=========================================================================
+
 
               if (typeof (gmaps) != "undefined") {
                   Gmap_ = gmaps.maps[0];
-                  if (Gmap_.sizeMode == 'A')
-                  {
+                  if (Gmap_.sizeMode == 'A') {
                       jQuery("#iGMapsIcon").css({ width: old_w * 0.8 + "px", height: old_h * 0.8 + "px" });
 
@@ -790,8 +856,47 @@
               }
 
+              /*
+              jQuery("#Debug1").css({
+              position: "absolute",
+              top: Bandeau + "px",
+              textAlign: align_auto,
+              margin: "0px auto",
+
+
+              border: "solid 1px red",
+
+              width: Image_width + "px",
+              height: Image_height + "px"
+
+              });
+              //===================================================
+              jQuery("#Debug2").css({ position: "absolute",
+              left: Zone_Affichage.left + 'px',
+              border: "solid 1px green",
+              top: Zone_Affichage.top + "px",
+              width: Zone_Affichage.width / 2 + "px",
+              height: Zone_Affichage.height + "px"
+
+              });
+              jQuery("#Debug2").text(info_Cadre.bottom);
+              */
 
               try {
                   if (theme.match(RegExp("gally", "g"))) {
 
+                      //===========================================================================
+
+                      if (jQuery("#navThumbPrev").length > 0) {
+                          jQuery("#navThumbPrev").css({ height: info_img.height + "px",
+                              top: info_img.top 
+                          });
+                      }
+                      if (jQuery("#navThumbNext").length > 0) {
+                          jQuery("#navThumbNext").css({ height: info_img.height + "px",
+                              top: info_img.top 
+                          });
+                      }
+                      if (!theme.match(RegExp("lapis", "gi"))) { }
+                  } else if (theme.match(RegExp("simple", "g"))) {
 
                   } else {
@@ -841,5 +946,5 @@
 
       } // function
-);                                                                                                                                                                                                                                                                                                                                        // ready
+);                                                                                                                                                                                                                                                                                                                                                                                         // ready
     /*
 *
Index: /extensions/Autosize/main.inc.php
===================================================================
--- /extensions/Autosize/main.inc.php	(revision 7457)
+++ /extensions/Autosize/main.inc.php	(revision 7458)
@@ -8,5 +8,5 @@
 Author URI:http://cljosse.free.fr
 */
-
+/*| Ajoute l' option validation de l'autotaille en fonction du statut */
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 if (!defined('AUTOSIZE_PATH')) 
@@ -16,6 +16,5 @@
 
 add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_affiche'), 45 );
-//---- avant pamooramics ---
-//add_event_handler('render_element_content', array(&$autosize_controler, 'cl_autosize_aff_infos_plus'),40,2);
+
 
 add_event_handler('get_admin_plugin_menu_links', array(&$autosize_controler,'cl_autosize_admin')  );
