Index: /extensions/Autosize/admin/template/admin.tpl
===================================================================
--- /extensions/Autosize/admin/template/admin.tpl	(revision 7123)
+++ /extensions/Autosize/admin/template/admin.tpl	(revision 7124)
@@ -1,7 +1,12 @@
 {html_head} 
  <script type="text/javascript">
+     var thumbnail = '{$thumbnail}';
      var theme = '{$theme}';
+     var version = '{$version}';
+     var scaled_width = '{$SCALED_WIDTH}'; // valeur par defaut
+     var scaled_height = '{$SCALED_HEIGHT}'; // valeur par defaut
      var img_width = '{$IMG_WIDTH }';
      var img_height = '{ $IMG_HEIGHT }';
+
      var marge_basse = '{ $MARGE_BASSE }';
      var echelle_max = '{ $ECHELLE_MAX }';
Index: /extensions/Autosize/include/affiche.php
===================================================================
--- /extensions/Autosize/include/affiche.php	(revision 7123)
+++ /extensions/Autosize/include/affiche.php	(revision 7124)
@@ -2,6 +2,6 @@
 
 $visible=(isset($visible))?$visible:true;
-$img_width=isset($picture['current']['width'])?$picture['current']['width']:200;
-$img_height=isset($picture['current']['height'])?$picture['current']['height']:200;
+$img_width=isset($picture['current']['width'])?$picture['current']['width']:480;
+$img_height=isset($picture['current']['height'])?$picture['current']['height']:320;
 $version=isset($version)?$version:"";
 $theme=$user['theme'];
@@ -10,10 +10,11 @@
   	$template->assign(
   					array(
+					'thumbnail' => $conf['prefix_thumbnail'],
                     'visible' => $visible,
                     'version' => $version,
                     'AUTOSIZE_PATH' => AUTOSIZE_PATH,
                     'theme' => $theme,
-					 'SCALED_WIDTH' 				=> $picture['current']['scaled_width'],
-					 'SCALED_HEIGHT' 			=> $picture['current']['scaled_height'],                    
+					 'SCALED_WIDTH' => $picture['current']['scaled_width'],
+					 'SCALED_HEIGHT' => $picture['current']['scaled_height'],                    
                     'IMG_WIDTH' 	=> $img_width,
                     'IMG_HEIGHT'	=> $img_height,
Index: /extensions/Autosize/js/Affiche_script.js
===================================================================
--- /extensions/Autosize/js/Affiche_script.js	(revision 7123)
+++ /extensions/Autosize/js/Affiche_script.js	(revision 7124)
@@ -1,431 +1,640 @@
-
-//==== remplace $(... avec jQuery( ====
- var ov_map;
+/*
+var thumbnail= '{$thumbnail}';
+var theme = '{$theme}';
+var version = '{$version}';
+var scaled_width = '{$SCALED_WIDTH}'; // valeur par defaut
+var scaled_height = '{$SCALED_HEIGHT}'; // valeur par defaut
+var img_width = '{$IMG_WIDTH }'; 
+var img_height = '{ $IMG_HEIGHT }';$picture['current']['height']
+
+var marge_basse = '{ $MARGE_BASSE }';
+var echelle_max = '{ $ECHELLE_MAX }';
+var mini_width = '{ $MINI_WIDTH   }';
+var mini_height = '{ $MINI_HEIGHT   }';
+
+var webmaster_width = '{$webmaster_width   }';
+var webmaster_height = '{ $webmaster_height   }';
+var admin_width = '{ $admin_width   }';
+var admin_height = '{ $admin_height   }';
+var generic_width = '{ $generic_width   }';
+var generic_height = '{ $generic_height   }';
+var guest_width = '{ $guest_width   }';
+var guest_height = '{$guest_height}';
+var normal_width = '{$normal_width}';
+var normal_height = '{$normal_height}';
+var user_status = '{$user_status}';
+var user_status = '{$user_status}';
+var check_auto_w = '{$check_auto_w}';
+*/
+
  var d1 = 0;
-   var init_tb = 0;
- function $(element) {
-  //========== test jQuery ===============
-     new_element = jQuery(element);
-     jq = new_element.selector;
-     if (jQuery("#Panorama").length) {
-
-         return new_element;
-     }
-     afq = jQuery(document).data("initialized") ; //2
-     if (element == window && afq != 1)
-         if (init_tb==1) {
-             init_tb = 2;
-             return new_element;
-         }
-
-         if (new_element.context && afq!=1 && afq != undefined ) {
-           if (init_tb != 2) init_tb = 1;
-            return new_element;
+ var init_tb = 0;
+
+ function set_autosize() {
+     visible = !visible;
+
+ }
+
+/* ready
+*
+*
+*/
+ jQuery(document).ready(
+
+    function (jQuery) {
+        /* jQuery */
+        var img_init = { height: img_height, width: img_width };  // taille initiale
+        var img_defaut = { height: scaled_height, width: scaled_width };
+        var img_reelle = { height: img_height, width: img_width };
+        var img_finale = { height: 0, width: 0 };
+        var zone_affichage = { height: 0, width: 0 };
+        /*
+        * recherche la plus grande image (hauteur ou largeur)
+        */
+        function Get_Img_Maxi(myobj) {
+            var w00 = 0;
+            var TheImg = null;
+            jQuery(myobj).each(function (i) {
+                w0 = this.width;
+                h0 = this.height;
+                if (h0 > w0) w0 = h0;
+                if (w0 > w00) {
+                    if (!this.nameProp.match(RegExp(thumbnail, "g"))) {
+                        TheImg = this;
+                        w00 = w0;
+                    }
+
+                }
+            });
+            return TheImg;
         }
-        if (new_element.context)
-          if (new_element.context.loaded) {
-            return new_element;
+        /*
+        * Get_val_int
+        * params: element,valeur maxi
+        * return: valeur entiere
+        */
+        function Get_Val_int(myObj, Maxi_val) {
+            var val = 0;
+            var reg1 = new RegExp("%", "g")
+            Maxi_val = parseInt(Maxi_val || 400);
+
+            if (!myObj) return Maxi_val;
+            if (myObj == "none") return Maxi_val;
+            if (myObj == "auto") return Maxi_val;
+            if (myObj.match(reg1))
+                val = myObj * Maxi_val / 100;
+            else
+                val = parseInt(myObj);
+            if (typeof (val) == "NaN") return Maxi_val;
+            return val;
         }
-        init_tb = 0;
-        tp1 = typeof(MooTools);
-        if (tp1 != "undefined") {
-  //==== mootools prototype ====
-            if (MooTools.version == "1.2.4") {
-                return jQuery(element).get(0);
-
-            }else if( MooTools.version == "1.11") {
-            B = element;
-                if (!B) { 
-   			if (typeof (B) == "boolean") return null;
-                	return jQuery(); 
-		 }
-                if (B.htmlElement) {
-                    return Garbage.collect(B);
-
+
+        /*
+        * Marge_haute
+        * params: element,boolean ajoute_h(ajoute la hauteur de l'element)
+        * return: valeur margin+padding+[hauteur]
+        */
+        function Marge_haute(myObj, ajoute_h) {
+            Mon_obj = jQuery(myObj);
+            if (Mon_obj.length == 0) return 0;
+
+            if (ajoute_h) h_p = parseInt(jQuery(myObj).height());
+            else h_p = 0;
+
+            if (jQuery(myObj).css("marginTop"))
+                if (jQuery(myObj).css("marginTop") != "auto") h_p += parseInt(jQuery(myObj).css("marginTop"));
+            if (jQuery(myObj).css("marginBottom"))
+                if (jQuery(myObj).css("marginBottom") != "auto") h_p += parseInt(jQuery(myObj).css("marginBottom"));
+            if (jQuery(myObj).css("paddingTop"))
+                if (jQuery(myObj).css("paddingTop") != "auto") h_p += parseInt(jQuery(myObj).css("paddingTop"));
+            if (parseInt(jQuery(myObj).css("paddingBottom")))
+                if (jQuery(myObj).css("paddingBottom") != "auto") h_p += parseInt(jQuery(myObj).css("paddingBottom"));
+            return h_p;
+        }
+        //===================================================================	
+        var old_w = 0;
+        var old_h = 0;
+        var rapport = -1;
+        var init_taille_thumblink = { height: 0, width: 0 };
+        /*
+        * window .resize
+        */
+        jQuery(window).resize(function (event, ui) {
+            if (typeof (event) == 'undefined') return;
+
+            w1 = jQuery(window).width();
+            h1 = jQuery(window).height();
+
+
+            if (!visible) return;
+            if (old_w == w1 && old_h == h1) return;
+
+            if (old_w != w1) {
+                old_w = w1;
+            } else {
+                if (old_h != h1) old_h = h1;
+            }
+            var Type_Img = "";
+            //====== détection du type d'images ======
+            if (jQuery("#charlie").length > 0) {
+                Type_Img = "charlie";
+            } else if (jQuery("#pamoorama").length) {
+                Type_Img = "pamoorama";
+            } else if (jQuery("#theImage embed").length > 0) {
+                Type_Img = "embed";
+            } else if (jQuery("#map").length) {
+                Type_Img = "map";
+            } else if (jQuery("#Panorama").length) {
+                Type_Img = "panorama";
+            } else if (jQuery("#theImage").find("img").length > 0) {
+                Type_Img = "img";
+            } else if (jQuery("img").length > 0) {
+                Type_Img = "img_autre";
+                return;
+            } else {
+                return;
+            }
+
+            var winwidth = old_w;
+            var twidth = jQuery("#imageHeaderBar").width();
+            var twidth1 = jQuery("#imageToolBar").width();
+
+            var winheight = old_h;
+            //==== récupère Img la plus grande  =====
+            if (jQuery("#theImg")) IMG = "#theImg";
+            else IMG = "#theImage";
+
+            TheImg2 = Get_Img_Maxi(IMG + " img");
+            //=================================================================
+            if (TheImg2 == null) {
+                if (jQuery("#theImage").find("img").length > 0) {
+                    IMG = "#theImage";
+                    TheImg = Get_Img_Maxi("#theImage img");
                 }
-                if ([window, document].contains(B)) { return B; }
-                var A = $type(B);
-                if (A == "string") { B = document.getElementById(B); A = (B) ? "element" : false; }
-                if (A != "element") {
-                    return null;
+            } else {
+                TheImg = TheImg2
+
+            }
+
+            //=================================================================
+            switch (Type_Img) {
+                case "map":
+
+                    jQuery("#content").height(winheight);
+
+                    var TheImg = jQuery("#map").get(0);
+                    pos_image = jQuery("#map").position();
+                    pos_page = jQuery("#the_page").position();
+
+
+                    break
+
+
+                case "panorama":
+
+                    var w00 = 0;
+                    jQuery("#Panorama img").each(function (i) {
+                        w0 = this.width;
+                        if (w0 > w00) {
+                            TheImg = this;
+                            n = TheImg.nameProp;
+                            w00 = w0;
+                        }
+                    });
+
+                    pos_image = jQuery(TheImg).position();
+                    pos_page = jQuery("#the_page").position();
+
+                    break
+                case "img":
+
+                    if (!TheImg) return;
+                    pos_image = jQuery(TheImg).position();
+                    pos_page = jQuery("#the_page").position();
+
+
+                    break
+                case "img_autre":
+                    if (!TheImg) return;
+                    pos_image = jQuery(TheImg).position();
+                    pos_page = jQuery("#the_page").position();
+
+
+                    break
+                case "embed":
+                    //
+
+                    var TheImg = jQuery("#theImage").find("embed");
+
+                    pos_image = jQuery("#theImage").position();
+                    pos_page = jQuery("#the_page").position();
+                    if (rapport < 0) {
+                        img_height = parseInt(TheImg.height);
+                        img_width = parseInt(TheImg.width);
+
+                        img_reelle.height = parseInt(TheImg.height);
+                        img_reelle.width = parseInt(TheImg.width);
+                    }
+
+                    break
+                case "charlie":
+
+                    var TheImg = jQuery('#charlie object').get(0);
+                    pos_image = jQuery("#theImage").position();
+                    pos_page = jQuery("#the_page").position();
+                    if (rapport < 0) {
+                        img_height = parseInt(TheImg.height);
+                        img_width = parseInt(TheImg.width);
+
+                        img_reelle.height = parseInt(TheImg.height);
+                        img_reelle.width = parseInt(TheImg.width);
+                    }
+
+                    break
+                case "pamoorama":
+                    //=========================================================
+                    var Images = jQuery("#pamoorama img");
+                    var Image = jQuery("#pamoorama").find("img");
+
+                    pos_image = jQuery("#pamoorama").position();
+                    pos_page = jQuery("#the_page").position();
+                    break
+                    return;
+
+            }
+            //=============== Vérification taille minimale  autorizée ======================
+            miniWidth = Get_Val_int(jQuery(TheImg).css("min-width"), mini_width);
+            miniHeight = Get_Val_int(jQuery(TheImg).css("min-height"), mini_height);
+            maxWidth = Get_Val_int(jQuery(TheImg).css("max-width"), winwidth);
+            maxHeight = Get_Val_int(jQuery(TheImg).css("max-height"), winheight);
+
+            mini_width = parseInt(miniWidth);
+            mini_height = parseInt(miniHeight);
+
+            img_reelle.width = parseInt(img_reelle.width);
+            if (img_reelle.width < mini_width) return;
+
+            img_reelle.height = parseInt(img_reelle.height);
+            if (img_reelle.height < parseInt(mini_height)) return;
+            //==================================================================================   
+            if (rapport < 0) {
+                img_init.height = parseInt(img_height || TheImg.height);
+                img_init.width = parseInt(img_width || TheImg.width);
+                rapport = img_width / img_height;
+                if (Type_Img != "map")
+                    rapport = (img_init.width / img_init.height);
+                else
+                    rapport = -1;
+
+            }
+
+
+            //=============== Zone d'affichage ============================
+            zone_affichage.width = winwidth - 0 - (pos_page.left * 2) - 5;
+            zone_affichage.height = winheight - 0 - pos_page.top;
+
+
+            //===========================================================================  
+            var sel0 = { top: 0 };
+            sel0.top += Marge_haute("#theHeader", true);
+
+            sel0.top += Marge_haute("#imageHeaderBar", true);
+            if (!theme.match(RegExp("gally", "g"))) {
+                sel0.top += Marge_haute("#imageToolBar", true);
+            } else {
+                sel0.top += Marge_haute(TheImg, false);
+            }
+            if (jQuery("#theImage").css("marginTop"))
+                if (jQuery("#theImage").css("marginTop") != "auto")
+                    sel0.top += parseInt(jQuery("#theImage").css("marginTop"));
+            if (jQuery("#theImage").css("paddingTop"))
+                if (jQuery("#theImage").css("paddingTop") != "auto")
+                    sel0.top += parseInt(jQuery("#theImage").css("paddingTop"));
+
+            img_top = 0;
+            if (jQuery("#theImage").css("position") != "absolute")
+                zone_affichage.height -= sel0.top;
+
+            if (theme.match(RegExp("gally", "g"))) { img_top = sel0.top }
+            jQuery("#theImage").css("top", img_top + "px")
+
+            jQuery("#theImage #theImg IMG").css("marginTop", "0px")
+
+
+
+            var lmt = 0;
+            h = 0;
+            //================ Licence  ========================
+            var Licence = jQuery("#theImage span");
+            if (Licence.length > 0) {
+                jQuery("#theImage span").css("background", "blue");
+                t1 = jQuery("#theImage span").position();
+                h = jQuery("#theImage span").height();
+            }
+            //==== paragraphe supplèmentaire ===
+            if (jQuery("#theImage table")) {
+                jQuery("#theImage table").css("background", "yellow");
+                t1 = jQuery("#theImage table").position();
+            }
+
+            if (jQuery("#theImage p")) {
+                jQuery("#theImage p").css("background", "red");
+                t1 = jQuery("#theImage p").position();
+                h += jQuery("#theImage p").height();
+            }
+            if (jQuery("#theImage br")) {
+
+
+            }
+
+
+
+            lmt = jQuery("#theImage span").height() - jQuery("#theImage p").height();
+
+            //==========================================================================
+            Marge_Basse = parseInt(marge_basse || 0);
+            zone_affichage.height = zone_affichage.height - Marge_Basse;
+
+            var Image_height = zone_affichage.height - h;
+
+            var height_user = eval(user_status + "_height");
+
+            //=============================================================
+            var reg1 = new RegExp("%", "g");
+            if (height_user.match(reg1))
+                Image_height = Image_height * parseInt(height_user) / 100;
+            else
+                Image_height = parseInt(height_user);
+
+            //============================================================
+            echelle_max = parseFloat(echelle_max, '3');
+            var echelle = parseFloat(Image_height / img_reelle.height, 3);
+
+            if (echelle > echelle_max) { echelle = echelle_max; }
+
+            Image_height = parseInt(img_reelle.height * echelle);
+
+            if (rapport > 0) var Image_Width = parseInt(Image_height * rapport);
+            else var Image_Width = parseInt(img_reelle.width * echelle);
+            //===============================================================
+
+            align_auto = "center";
+            if (jQuery("#theImg").css("textAlign"))
+                align_auto = jQuery("#theImg").css("textAlign");
+
+            if (check_auto_w == 'checked="checked"') {
+                // if (Type_Img != "pamoorama" && Type_Img != "panorama" ) {
+                //==== largeur à atteindre ===
+                var width_user = eval(user_status + "_width");
+                // Largeur maximale en fonction du statut
+                if (width_user.match(reg1))
+                // pourcentage
+                    widthmin = twidth * parseInt(width_user) / 100;
+                else
+                    widthmin = parseInt(width_user);
+
+                if (Image_Width > widthmin) {
+                    //   Image_Width largeur à atteindre 
+                    //  Calcul du rapport d'agrandissement 
+                    var echelle_w = parseFloat(widthmin / img_reelle.width, 3);
+                    if (echelle_w > echelle_max) { echelle_w = echelle_max; }
+                    Image_Width = parseInt(img_reelle.width * echelle_w);
                 }
-                if (B.htmlElement) { return Garbage.collect(B); }
-                if (["object", "embed"].contains(B.tagName.toLowerCase())) { return B; }
-                $extend(B, Element.prototype);
-                B.htmlElement = function () { };
-                return Garbage.collect(B);
-            }
-           // 
-        }
-        tp1 = typeof(Prototype);
-        if (tp1 == "undefined") { return jQuery(element); }
-        if (Prototype.Version != '1.6.0.2') {
-            return jQuery(element);
-        }
-
-     //======== prototype.js =====================
-     if (arguments.length > 1) {
-         for (var i = 0, elements = [], length = arguments.length; i < length; i++)
-             elements.push($(arguments[i]));
-         new_element= elements;
-     }
-     if (typeof(element)=="string")
-         element = jQuery("#" + element).get(0);
-     try {
-         new_element = Element.extend(element);
-     } catch (e) {
-         return new_element;
-     }
-     //==================================================
-     if (typeof (new_element) == "undefined") {
-         jQuery(document).data("initialized", 1);
-         return jQuery();
-     }
-      return new_element;
-    
-}
-
-jQuery(document).ready(
-function (jQuery) {
-
-    function Marge_haute(myObj, ajoute_h) {
-        Mon_obj = jQuery(myObj);
-        if (Mon_obj.length == 0) return 0;
-
-        if (ajoute_h) h_p = parseInt(jQuery(myObj).height());
-        else h_p = 0;
-
-        if (jQuery(myObj).css("marginTop"))
-            if (jQuery(myObj).css("marginTop") != "auto") h_p += parseInt(jQuery(myObj).css("marginTop"));
-        if (jQuery(myObj).css("marginBottom"))
-            if (jQuery(myObj).css("marginBottom") != "auto") h_p += parseInt(jQuery(myObj).css("marginBottom"));
-        if (jQuery(myObj).css("paddingTop"))
-            if (jQuery(myObj).css("paddingTop") != "auto") h_p += parseInt(jQuery(myObj).css("paddingTop"));
-        if (parseInt(jQuery(myObj).css("paddingBottom")))
-            if (jQuery(myObj).css("paddingBottom") != "auto") h_p += parseInt(jQuery(myObj).css("paddingBottom"));
-        return h_p;
-    }
-    //===================================================================	
-
-    jQuery(window).resize(function (event, ui) {
-        if (typeof (event) == 'undefined') return;
-        t = event.type;
-        var Type_Img = "";
-        //====== détection du type d'images ======
-        var Image = jQuery("#theImage").find("embed");
-        if (Image.length > 0) {
-            Type_Img = "embed";
-        } else if (jQuery("#map").length) {
-
-            Type_Img = "map";
-
-
-        } else if (jQuery("#pamoorama").length) {
-
-            Type_Img = "pamoorama";
-        } else if (jQuery("#Panorama").length) {
-
-            Type_Img = "panorama";
+
+                if (rapport > 0) Image_height = parseInt(Image_Width / rapport);
+
+            }
+
+
+            // }
+
+            zoom = echelle;
+
+            if (TheImg.src) {
+                w_init = TheImg.width;
+                h_init = TheImg.height;
+            }
+            //  zone_affichage.height *= zoom;
+            //  zone_affichage.width *= zoom;
+            //=============LLGBO2 ===========================
+            marges = 0;
+
+            if (jQuery("#gbo") && jQuery("#gbo div:first").length > 0) {
+                llgboframe = jQuery("#gbo div:first");
+                marges = jQuery(llgboframe).width() - jQuery("#gbo div:last").width();
+                cadre = {};
+                m1 = jQuery(llgboframe).height();
+                t1 = jQuery(llgboframe).position();
+
+
+                if (TheImg.src) {
+                    Image_height = Image_height - marges;
+                    Image_Width = Image_Width - marges;
+
+                    jQuery("#gbo").width(Image_Width + marges);
+                    jQuery("#gbo").height(Image_height + marges);
+                    jQuery("#gbo").css("width", Image_Width + marges + "px");
+                    jQuery("#gbo").css("height", Image_height + marges + "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")
+
+                }
+
+
+
+                if (jQuery("#prevnext")) {
+                    areas = jQuery("area");
+
+                }
+
+
+            }
+
+            //=========================================================
+            zone_affichage.height = (Image_height + marges)
+            jQuery("#linkNext").height(Image_height);
+            jQuery("#linkPrev").height(Image_height);
+            //================ Zone affichage =========================
+            //  Image_height, Image_Width = valeur a atteindre.
+            jQuery("#theImage").css("backgroundColor", "green");
+            jQuery("#theImage").height(zone_affichage.height);
+            jQuery("#theImage").width(zone_affichage.width);
+            //==============================================================
+            img_finale.height = Image_height;
+            img_finale.width = Image_Width;
+            //==============================================================
+
+            if (Type_Img == "charlie") {
+                t1 = jQuery("#charlie").position();
+                /**/
+                pdf = 2 * parseInt(jQuery(".none_2").css("paddingRight"));
+                jQuery("#charlie").css("width", Image_Width + pdf);
+                jQuery("#charlie").css("height", Image_height);
+                jQuery("#charlie").css("margin", "auto");
+
+
+                jQuery("#player").css("width", Image_Width + 100 + "px");
+                jQuery("#player").css("height", Image_height);
+
+                jQuery("#embedplayer").css("width", Image_Width);
+                jQuery("#embedplayer").css("height", Image_height);
+
+
+                jQuery("object").width(Image_Width);
+                jQuery("object").height(Image_height);
+            } else if (Type_Img == "panorama") {
+                jQuery(TheImg).height(img_finale.height);
+                jQuery(TheImg).width(img_finale.width);
+                jQuery("#Panorama div").height(Image_height);
+                //  class=simple_panorama
+                jQuery(TheImg).attr("id", "Img1");
+                var settings = {
+                    viewport_width: 600,
+                    speed: 20000,
+                    direction: 'left',
+                    control_display: 'auto',
+                    start_position: 0,
+                    auto_start: true,
+                    mode_360: true,
+                    loop_180: true
+                };
+                element = TheImg; //panorama_animate(element, elemWidth, settings);
+                n = $.fn;
+                pc = jQuery(TheImg)
+                options = pc.extend();
+
+                if (options) jQuery.extend(settings, options);
+
+
+                n = 1;
+                ;
+
+
+                /*
+                jQuery("DIV .panoramaContainer").css("background", "red");
+                jQuery("DIV .panoramaContainer").css("background", "red");
+                jQuery("DIV .panoramaViewport").css("background", "red");
+                jQuery("DIV .panoramaControl").css("background", "red");
+                */
+
+            } else if (Type_Img == "pamoorama") {
+
+
+                jQuery("#pamoorama").css("height", Image_height + "px");
+                jQuery("#pamoorama").css("width", twidth + "px");
+
+                jQuery("#pamoorama").height(Image_height);
+                jQuery("#pamoorama").width(twidth);
+
+
+
+                jQuery("#pamoorama_outter").height(Image_height);
+                jQuery("#pamoorama_outter").width(twidth);
+
+                jQuery("#pamoorama_outter").css("height", Image_height + "px");
+                jQuery("#pamoorama_outter").css("width", twidth + "px");
+                jQuery("#pamoorama_footer").width(twidth);
+                jQuery("#pamoorama_footer").css('width', twidth + "px");
+                zoom = Image_height / img_height;
+
+                h_frame = jQuery("#pamoorama_frame").height();
+                h_width = jQuery("#pamoorama_frame").width();
+                jQuery(TheImg).css("zoom", zoom);
+
+
+
+            } else if (TheImg.src) {
+                //--- background ?? ---
+                jQuery(TheImg).height(img_finale.height);
+                jQuery(TheImg).width(img_finale.width);
+                jQuery(TheImg).css("height", img_finale.height + "px");
+                jQuery(TheImg).css("width", img_finale.width + "px");
+
+            } else {
+
+                jQuery(TheImg).height(img_finale.height);
+                jQuery(TheImg).width(img_finale.width);
+            }
+
+
+            try {
+                if (theme.match(RegExp("gally", "g"))) {
+                    if (init_taille_thumblink.height == 0)
+                        init_taille_thumblink = { height: jQuery(".thumbLink").height(), width: jQuery(".thumbLink").height() };
+
+                    jQuery(".thumbLink").css("height", init_taille_thumblink.height + "px");
+                    jQuery(".thumbLink").css("width", init_taille_thumblink.width + "px");
+                }
+            } catch (e) {
+
+            }
+            //  
+            jQuery(window).resize();
             return;
-        } else if (jQuery("#theImage").find("img").length > 0) {
-            Type_Img = "img";
-        } else if (jQuery("img").length > 0) {
-            Type_Img = "img_autre";
-        } else {
-            return;
-        }
-        var winheight = jQuery(window).height();
-        var winwidth = jQuery(window).width();
-        //=================================================================
-        switch (Type_Img) {
-            case "map":
-
-
-                jQuery("#content").height(winheight);
-                var Image = jQuery("#map");
-                var TheImg = jQuery("#map").get(0);
-                position = jQuery("#map").position();
-                l2 = jQuery("#the_page").position();
-                img_height = winheight - position.top - l2.top;
-                img_width = winwidth - position.left - (l2.left * 2) - 5;
-
-
-                break
-            case "img":
-                var Image = jQuery("#theImage").find("img");
-                var TheImg = jQuery("#theImg").find("img").get(0);
-                if (!TheImg)
-                    TheImg = jQuery(Image).get(0);
-                break
-            case "img_autre":
-                var Image = jQuery("img");
-                var TheImg = jQuery(Image).get(0);
-                break
-            case "embed":
-                var Image = jQuery("#theImage").find("embed");
-                var TheImg = jQuery(Image).get(0);
-                img_height = TheImg.clientHeight;
-                img_width = TheImg.clientWidth;
-                break
-            case "pamoorama":
-                //=========================================================
-                var Images = jQuery("#pamoorama");
-                var Image = jQuery(Images).get(0);
-
-                var TheImg = jQuery("#pamoorama").get(0);
-                if (!TheImg) return;
-                TheImg = jQuery("#pamoorama_inner");
-                if (TheImg.length < 1) return;
-
-                break
-        }
-
-        //==================================================================================        
-
-        var sel0 = jQuery(TheImg).position();
-        jQuery("#theImage").css("top", sel0.top + "px")
-        jQuery().relativize("#theImage");
-        if (!sel0) return;
-        type_pos = jQuery(TheImg).css("position"); //static
-
-        sel0.top = 0;
-        sel0.top += Marge_haute("#theHeader", true);
-
-        sel0.top += Marge_haute("#imageHeaderBar", true);
-        if (!theme.match(RegExp("gally", "g"))) {
-            sel0.top += Marge_haute("#imageToolBar", true);
-        } else {
-            sel0.top += Marge_haute(TheImg, false);
-        }
-        if (jQuery("#theImage").css("marginTop"))
-            if (jQuery("#theImage").css("marginTop") != "auto")
-                sel0.top += parseInt(jQuery("#theImage").css("marginTop"));
-        if (jQuery("#theImage").css("paddingTop"))
-            if (jQuery("#theImage").css("paddingTop") != "auto")
-                sel0.top += parseInt(jQuery("#theImage").css("paddingTop"));
-
-        img_top = 0;
-
-        if (theme.match(RegExp("gally", "g"))) { img_top = sel0.top }
-        jQuery("#theImage").css("top", img_top + "px")
-
-
-        mini_width = parseInt(mini_width);
-        mini_height = parseInt(mini_height);
-
-        W0 = parseInt(img_width);
-        if (W0 < mini_width) return;
-
-        H0 = parseInt(img_height);
-        if (H0 < parseInt(mini_height)) return;
-        if (Type_Img != "map")
-            var rapport = (W0 / H0);
-        else
-            var rapport = -1;
-
-        //==========================================================================
-        var Licence = jQuery("#theImage").find(".licencetag");
-        if (Licence.length > 0) {
-            var lmt = jQuery(Licence.get(0)).height();
-            h_p = jQuery(Licence.get(0)).height();
-            jQuery(Licence.get(0)).css("position", "relative");
-
-            jQuery(Licence.get(0)).css("top", "0px");
-
-        } else {
-            var lmt = 0;
-
-        }
-        //==== paragraphe supplèmentaire ===
-        if (jQuery("#theImage").find("p")) {
-            h_p = 0;
-            Pars = jQuery("#theImage").find("p");
-
-            for (var i = 0; i < Pars.length; i++) {
-                P0 = Pars.get(i);
-                h_p += Marge_haute(P0, true);
-            }
-
-            //   n_t = (p_p.top - Image_height) + h_p;
-
-            lmt += h_p;
-            jQuery("#theImage").css("paddingBottom", 0 + "px");
-        }
-
-        //==========================================================================
-
-        var Image_height = (winheight - sel0.top) - parseInt(marge_basse) - lmt;
-        var height_user = eval(user_status + "_height");
-
-        //=============================================================
-        var reg1 = new RegExp("%", "g");
-        if (height_user.match(reg1))
-            Image_height = Image_height * parseInt(height_user) / 100;
-        else
-            Image_height = parseInt(height_user);
-
-        //============================================================
-        echelle_max = parseFloat(echelle_max, '3');
-        var echelle = parseFloat(Image_height / H0, 3);
-
-        if (echelle > echelle_max) {
-            echelle = echelle_max;
-            Image_height = parseInt(H0 * echelle);
-        }
-
-        if (rapport > 0)
-            var Image_Width = parseInt(Image_height * rapport);
-        else
-            var Image_Width = parseInt(W0);
-        //===============================================================
-        twidth = jQuery("#imageHeaderBar").width();
-        img_la = jQuery(TheImg).width(); //initiale 
-        offset = jQuery(TheImg).position();
-
-        var width_user = eval(user_status + "_width");
-        align_auto = "center";
-        if (check_auto_w == 'checked="checked"') {
-            if (Type_Img != "pamoorama") {
-                widthmin = (winwidth - offset.left);
-
-                if (Image_Width > widthmin) {
-                    //=============================================================
-                    if (width_user.match(reg1))
-                        Image_Width = Image_Width * parseInt(width_user) / 100;
-                    else
-                        Image_Width = parseInt(width_user);
-
-                    var echelle_w = parseFloat(winwidth / W0, 3);
-                    if (echelle_w > echelle_max) {
-                        echelle_w = echelle_max;
-                        Image_Width = parseInt(W0 * echelle_w);
-                    }
-                    Image_Width = parseInt(W0 * echelle_w);
-
-                    align_auto = "left";
-                } else {
-
-                    align_auto = "center";
-                }
-                Image_height = parseInt(Image_Width / rapport);
-
-            }
-
-
-        }
-        //=============================================================
-
-        if (Type_Img == "pamoorama") {
-
-
-            jQuery("#pamoorama").css("height", Image_height + "px");
-            jQuery("#pamoorama").css("width", twidth + "px");
-
-            jQuery("#pamoorama").height(Image_height + "px");
-            jQuery("#pamoorama").width(twidth + "px");
-
-
-
-            jQuery("#pamoorama_outter").height(Image_height + "px");
-            jQuery("#pamoorama_outter").width(twidth + "px");
-
-            jQuery("#pamoorama_outter").css("height", Image_height + "px");
-            jQuery("#pamoorama_outter").css("width", twidth + "px");
-
-            zoom = Image_height / img_height;
-
-            h_frame = jQuery("#pamoorama_frame").height();
-            h_width = jQuery("#pamoorama_frame").width();
-            jQuery(TheImg).css("zoom", zoom);
-
-
-
-        } else {
-
-
-            if (jQuery("#theImg").css("textAlign"))
-                jQuery("#theImg").css("textAlign", align_auto);
-
-            jQuery(TheImg).height(Image_height + "px");
-            jQuery(TheImg).width(Image_Width + "px");
-            jQuery(TheImg).css("height", Image_height + "px");
-            jQuery(TheImg).css("width", Image_Width + "px");
-
-        }
-        try {
-            if (theme.match(RegExp("gally", "g"))) {
-
-                m = jQuery("#theImg");
-                if (m.length > 0) initializeImageMode('resize');
-
-
-            } else if (theme.match(RegExp("luciano", "g"))) {
-                jQuery("#theImage").height(Image_height);
-            }
-        } catch (e) {
-
-        }
-        //  
-
-        return;
-    });
-
-    //===================================================================	  
-
-
-    jQuery(window).resize();
-    jQuery(window).resize();
-
-
-    /*  */
-
-
-});
+        });
+
+        //===================================================================	  
+
+
+        jQuery(window).resize();
+        jQuery(window).resize();
+
+    } // function
+);                   // ready
+
+/* Extension
+ * absolutize:
+ * relativize:
+ */
 //=========================================================
 jQuery.fn.extend({
-//-----------------------------------------------------------------
-  absolutize: function(element) {
-    element = jQuery(element).get(0);
-    if (element.getStyle('position') == 'absolute') return;
-    // Position.prepare(); // To be done manually by Scripty when it needs it.
-
-    var offsets = element.positionedOffset();
-    var top     = offsets[1];
-    var left    = offsets[0];
-    var width   = element.clientWidth;
-    var height  = element.clientHeight;
-
-    element._originalLeft   = left - parseFloat(element.style.left  || 0);
-    element._originalTop    = top  - parseFloat(element.style.top || 0);
-    element._originalWidth  = element.style.width;
-    element._originalHeight = element.style.height;
-
-    element.style.position = 'absolute';
-    element.style.top    = top + 'px';
-    element.style.left   = left + 'px';
-    element.style.width  = width + 'px';
-    element.style.height = height + 'px';
-    return element;
-  },
-
-  relativize: function(element) {
-    element = jQuery(element).get(0);;
-    if (jQuery(element).css('position') == 'relative') return;
-    // Position.prepare(); // To be done manually by Scripty when it needs it.
-    element._originalLeft =  parseFloat(element.style.left || 0);
-    element._originalTop =  parseFloat(element.style.top || 0);
-    element._originalWidth = element.style.width;
-    element._originalHeight = element.style.height;
-
-    element.style.position = 'relative';
-    var top  = parseFloat(element.style.top  || 0) - (element._originalTop || 0);
-    var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0);
-
-    element.style.top    = top + 'px';
-    element.style.left   = left + 'px';
-  //  element.style.height = element._originalHeight;
-   // element.style.width  = element._originalWidth;
-    return element;
-  }
-//=========================================================
- }); // fin extend
+    //-------------------------------------------------------
+    absolutize: function (element) {
+        element = jQuery(element).get(0);
+        if (element.getStyle('position') == 'absolute') return;
+        // Position.prepare(); // To be done manually by Scripty when it needs it.
+
+        var offsets = element.positionedOffset();
+        var top = offsets[1];
+        var left = offsets[0];
+        var width = element.clientWidth;
+        var height = element.clientHeight;
+
+        element._originalLeft = left - parseFloat(element.style.left || 0);
+        element._originalTop = top - parseFloat(element.style.top || 0);
+        element._originalWidth = element.style.width;
+        element._originalHeight = element.style.height;
+
+        element.style.position = 'absolute';
+        element.style.top = top + 'px';
+        element.style.left = left + 'px';
+        element.style.width = width + 'px';
+        element.style.height = height + 'px';
+        return element;
+    },
+
+    relativize: function (element) {
+        element = jQuery(element).get(0); ;
+        if (jQuery(element).css('position') == 'relative') return;
+        // Position.prepare(); // To be done manually by Scripty when it needs it.
+        element._originalLeft = parseFloat(element.style.left || 0);
+        element._originalTop = parseFloat(element.style.top || 0);
+        element._originalWidth = element.style.width;
+        element._originalHeight = element.style.height;
+
+        element.style.position = 'relative';
+        var top = parseFloat(element.style.top || 0) - (element._originalTop || 0);
+        var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0);
+
+        element.style.top = top + 'px';
+        element.style.left = left + 'px';
+        //  element.style.height = element._originalHeight;
+        // element.style.width  = element._originalWidth;
+        return element;
+    }
+    //=========================================================
+});   // fin extend
Index: /extensions/Autosize/js/conflit.js
===================================================================
--- /extensions/Autosize/js/conflit.js	(revision 7124)
+++ /extensions/Autosize/js/conflit.js	(revision 7124)
@@ -0,0 +1,275 @@
+﻿//==== remplace $(... avec jQuery( ====
+ 
+(function () {
+    
+})();
+
+
+
+function $(element, nc) {
+    //============== détection framework ==================
+    jq = jQuery(element).selector;
+
+    var tp1 = typeof (MooTools);
+    if (tp1 != "undefined") {
+        if (MooTools.version == "1.2.4") var  MooTools_version = "Luciano"; // luciano
+        if (MooTools.version == "1.11") var MooTools_version  = "pamoorama"; //pamoorama
+
+    } else {
+        var MooTools_version  = "0";
+    }
+
+   tp1 = typeof (Prototype);
+   if (tp1 == "undefined") {
+       var Prototype_Version = '0';
+
+   } else {
+       if (Prototype.Version == '1.6.0.2') {
+           var Prototype_Version = '1602';
+       } else if (Prototype.Version == '1.6.1') {
+           var Prototype_Version = '161';
+       } else if (Prototype.Version == '1.0.0.0') {
+           var Prototype_Version = '1';
+       }
+   }
+    //===================================================
+    if ( Prototype_Version=="0" && MooTools_version == "0") {
+      return jQuery(element);
+    }
+//=======================================================================================
+   if (arguments.caller) {
+        if (arguments.caller.length > 1) {
+            if (element == "pamoorama") {
+                return jQuery().$Pamoorama(element);
+            }
+
+            //=========== options rv_maps prototype.js ===================================   
+            arg = arguments.caller[1];
+            if (Prototype_Version != '0')
+            switch (arg) {
+                case "dom:loaded":
+                    return element;
+                    return jQuery().$Protype1602(element);
+                    break;
+                case "load":
+                    return jQuery().$Protype1602(element); ;
+                    break;
+                case "unload":
+                    return jQuery().$Protype1602(element); ;
+                    break;
+            }
+
+            if (MooTools_version == 'pamoorama')
+            //=========== options pamoorama ===================================  
+            {
+                var reg1 = new RegExp("pamoorama", "g");
+                switch (arg) {
+                    case "bottom":
+                        return jQuery().$Pamoorama(element);
+                        break;
+                    case "left":
+                        return jQuery().$Pamoorama(element);
+                        break;
+
+                    default:
+                        if (arg.area) {
+                            return jQuery().$Pamoorama(element);
+                        } else
+                            if (arg.velocity) {
+                                return jQuery().$Pamoorama(element);
+                            } else if (arg.src) {
+                                return jQuery().$Pamoorama(element);
+                            } else if (arg.modifiers) {
+                                return jQuery().$Pamoorama(element);
+                            } else if (arg.limit) {
+                                return jQuery().$Pamoorama(element);
+                            } else if (arg.duration) {
+                                return jQuery().$Pamoorama(element);
+                            } else if (arg.id) {
+                                switch (arg.id) {
+                                    case "pamoorama_footer":
+                                        return jQuery().$Pamoorama(element);
+                                        break;
+                                    case "pamoorama_outter":
+                                        return jQuery().$Pamoorama(element);
+                                        break;
+                                    case "pamoorama_inner":
+                                        return jQuery().$Pamoorama(element);
+                                        break;
+
+                                    default:
+                                        return jQuery().$Pamoorama(element);
+                                        break;
+
+                                }
+                            } else if (arg.src) {
+                                return jQuery().$Pamoorama(element);
+
+                            }
+                        //=======================================================
+                        return jQuery(element);
+                        break;
+
+                }
+            }else if (MooTools_version=='Luciano')
+             { //=========== options luciano =================================== 
+                 //=== theme Luciano ====
+                 return jQuery().$Luciano(element, nc);
+             }
+        }
+    }
+
+     //==================================================
+     tpe = typeof (element);
+    new_element = jQuery(element);
+  
+    //========== test jQuery ? ==============
+
+    if (jq.match(RegExp("^#", "g")) || jq == "html") {
+        return new_element;
+    }
+     if (tpe == "undefined") {
+        return jQuery();
+    }
+    //==== mootools ==== 
+    if (MooTools_version == "Luciano" && tpe=="string") {
+        //=== theme Luciano ====
+        new_element = jQuery().$Luciano(element, nc);
+        return new_element;
+
+    }
+
+    if (MooTools_version == 'pamoorama')
+    //=========== options pamoorama ===================================  
+    {
+    tp1=typeof (element) ;
+    if (tp1=="string")
+        switch (jq) {
+            case "ie_ready":
+                return jQuery().$Pamoorama(element);
+                break;
+            case "pamoorama":
+                return jQuery().$Pamoorama(element);
+                break;
+            case ".tab a":
+                return jQuery(element);
+                break;
+
+        }else if(tp1=="boolean")
+        {
+            return jQuery().$Pamoorama(element);
+        }
+        el = element.nodeName;
+        if (el == "DIV") return jQuery().$Pamoorama(element);
+        if (el == "IMG") return jQuery().$Pamoorama(element);
+        if (el == "#document") return jQuery(element) ;
+         jQuery().$Pamoorama(element);
+    }
+  
+    if (jQuery("#Panorama").length > 0 && jq != "rateForm" && jq != "order" && jq != "themeSelect") {
+        if (new_element.length < 2) return new_element;
+        if (new_element.length == 2) return jQuery(element).get(1);
+        if (new_element.length == 3) return jQuery(element).get(2);
+
+    }
+    afq = jQuery(document).data("initialized"); //2
+    if (element == window && afq != 1)
+        if (init_tb == 1) {
+            init_tb = 2;
+            return new_element;
+        }
+
+    if (new_element.context && afq != 1 && afq != undefined) {
+        if (init_tb != 2) init_tb = 1;
+        return new_element;
+    }
+    //==========================================================
+    if (new_element.context)
+        if (new_element.context.loaded) {
+    //=== theme Luciano ====
+        if (MooTools_version == "Luciano")  return jQuery().$Luciano(element, nc);
+        //=== theme gally ? ====
+            return new_element;
+        }
+    init_tb = 0;
+    //================================================================
+
+        //==== mootools ==== 
+        if (MooTools_version == "Luciano") {
+            //=== theme Luciano ====
+            new_element = jQuery().$Luciano(element, nc);
+            tp = new_element.nodeName + new_element.nodeType;
+            if (tp == "DIV1") return new_element;
+            tp = element.nodeName + element.nodeType;
+            return new_element;
+
+        } else if (MooTools_version == "pamoorama") {
+            //=== paMOOramics ===
+            // ie_ready,undefined
+            return jQuery().$Pamoorama(element);
+        }
+
+    //=================================================================
+
+    if (Prototype_Version != '0') {
+        //=== rvmaps ===
+
+        return jQuery().$Protype1602(element);
+    }
+    return jQuery(element);
+
+}
+
+//=========================================================
+jQuery.fn.extend({
+    //---------------- luciano -------------------------------
+    $Luciano: function (el, nc) {
+        return document.id(el, nc, this.document);
+    },
+    //=============== PaMOOramics ===========================
+    $Pamoorama: function (B) {
+        if (!B) {
+            if (typeof (B) == "boolean") return null;
+            return jQuery();
+        }
+        if (B.htmlElement) {
+            return Garbage.collect(B);
+
+        }
+        if ([window, document].contains(B)) { return B; }
+        var A = $type(B);
+        if (A == "string") { B = document.getElementById(B); A = (B) ? "element" : false; }
+        if (A != "element") {
+            return null;
+        }
+        if (B.htmlElement) { return Garbage.collect(B); }
+        if (["object", "embed"].contains(B.tagName.toLowerCase())) { return B; }
+        $extend(B, Element.prototype);
+        B.htmlElement = function () { };
+       try{ return Garbage.collect(B);}catch(e){
+       return ;
+       }
+
+    },
+    //===================================================
+    $Protype1602: function (element) {
+        //======== prototype.js =====================
+        if (arguments.length > 1) {
+            for (var i = 0, elements = [], length = arguments.length; i < length; i++)
+                elements.push($(arguments[i]));
+            return elements;
+        }
+        if (typeof element == "string")
+            element = document.getElementById(element);
+
+          return Element.extend(element);
+
+        try {
+            new_element = Element.extend(element);
+        } catch (e) {
+            return new_element;
+        }
+        return new_element;
+    }
+    //=========================================================
+});   // fin extend
Index: /extensions/Autosize/language/en_UK/lang.php
===================================================================
--- /extensions/Autosize/language/en_UK/lang.php	(revision 7123)
+++ /extensions/Autosize/language/en_UK/lang.php	(revision 7124)
@@ -1,5 +1,6 @@
 <?php
 global $lang;
-
+$lang['cl_autosize_info_2'] = "No resizing Display.";
+$lang['cl_autosize_info'] = 'Allows automatic resizing of the display with respect to explorer window.';
 $lang['cl_autosize_Howto'] = 'Display management';
 
Index: /extensions/Autosize/language/fr_FR/description.txt
===================================================================
--- /extensions/Autosize/language/fr_FR/description.txt	(revision 7123)
+++ /extensions/Autosize/language/fr_FR/description.txt	(revision 7124)
@@ -1,1 +1,1 @@
-Permet d'ajuster automatiquement l'affichage en fonction de la fenêtre de l'explorateur.
+﻿Permet d'ajuster automatiquement l'affichage en fonction de la fenêtre de l'explorateur.
Index: /extensions/Autosize/language/fr_FR/lang.php
===================================================================
--- /extensions/Autosize/language/fr_FR/lang.php	(revision 7123)
+++ /extensions/Autosize/language/fr_FR/lang.php	(revision 7124)
@@ -1,4 +1,6 @@
 <?php
 global $lang;
+$lang['cl_autosize_info'] = "Permet d'ajuster automatiquement l'affichage en fonction de la fenêtre de l'explorateur.";
+$lang['cl_autosize_info_2'] = "Affichage fixe.";
 $lang['cl_autosize_Howto'] = "Gestion affichage";
 
Index: /extensions/Autosize/main.inc.php
===================================================================
--- /extensions/Autosize/main.inc.php	(revision 7123)
+++ /extensions/Autosize/main.inc.php	(revision 7124)
@@ -2,5 +2,5 @@
 /*
 Plugin Name: AutoSize
-Version: 1.1.21
+Version: 1.1.22
 Description: Ajuste l'affichage des photos en fonction de la hauteur de la fenetre de navigation
 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=448
@@ -23,4 +23,6 @@
     global $infos_message,$erreur_message;
     global  $conf,$lang ,$user;
+  load_language('lang', AUTOSIZE_PATH);
+
     if ( $page['body_id']=='thePicturePage'  ) {
    if ( isset($picture['current'])){
@@ -28,4 +30,16 @@
     $autosize_parametres = cl_autosize_Get_Options();
     include (AUTOSIZE_PATH."include/affiche.php"); 	 	
+    
+    $template->assign('cl_autosize_button', array(
+    'cl_autosize_info' => 'cl_autosize_info' ,
+    'cl_autosize_info_2' => 'cl_autosize_info_2' ,
+    
+    'URL' => $_SERVER['REQUEST_URI'] ,
+     'ICON2' => AUTOSIZE_PATH . 'icons/button-maximize.png',
+    'ICON' => AUTOSIZE_PATH . 'icons/button-minimize.png'
+    ));
+ 
+$template->set_filenames(array('cl_bp' => $my_path. '/template/picture.tpl'));
+$template->concat('PLUGIN_PICTURE_ACTIONS', $template->parse('cl_bp', true));
 
     $template->set_filenames(
@@ -131,5 +145,5 @@
 $infos_message .=l10n("cl_autosize_save_config")."<br>";
  $autosize_parametres=cl_autosize_Set_Options();
- 
+
  if ( isset($autosize_parametres) )
  	{
@@ -145,15 +159,13 @@
  }
  //=======================================================================
-//add_event_handler('render_element_content', 'cl_autosize_script', 98, 2 );
+ add_event_handler('loc_end_section_init', 'cl_autosize_script', 60 );
+  
+ 
+function cl_autosize_script()
+{
+    $my_path = dirname(__FILE__).'/';
 
-function cl_autosize_script($content, $image)
-{
-   global $user, $picture, $template,$page;
+   global  $template;
   
-    global  $element_info;   
-    global $infos_message,$erreur_message;
-    global  $conf,$lang ,$user;
-
-    $my_path = dirname(__FILE__).'/';
     $template->set_filenames(
         array('autosize_cl_init'=> $my_path.'template/cl_conflit.tpl')
@@ -164,5 +176,5 @@
                                         )
                      );
-       return  $content;
+       return $template->parse( 'autosize_cl_init', false);
        
 }
Index: /extensions/Autosize/template/autosize.tpl
===================================================================
--- /extensions/Autosize/template/autosize.tpl	(revision 7123)
+++ /extensions/Autosize/template/autosize.tpl	(revision 7124)
@@ -3,32 +3,38 @@
  
   {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js" now=1} 
+  {known_script id="conflit_script" src=$AUTOSIZE_PATH|@cat:"js/conflit.js"}
 {*jQuery is always available by default*} 
  <script type="text/javascript">
-     var theme = '{$theme}';
-        var img_width='{$IMG_WIDTH }';
-        var img_height='{ $IMG_HEIGHT }';
-        var marge_basse='{ $MARGE_BASSE }';
-        var echelle_max='{ $ECHELLE_MAX }';
-        var mini_width='{ $MINI_WIDTH   }';
-        var mini_height = '{ $MINI_HEIGHT   }';
+    var thumbnail = '{$thumbnail}';
+    var theme = '{$theme}';
+    var visible = '{$visible}';
+    var version = '{$version}';
+    var scaled_width =  '{$SCALED_WIDTH}'; // valeur par defaut
+    var scaled_height = '{$SCALED_HEIGHT}'; // valeur par defaut
+    var img_width='{$IMG_WIDTH }';
+    var img_height = '{ $IMG_HEIGHT }';
 
-        var webmaster_width='{$webmaster_width   }';
-        var webmaster_height='{ $webmaster_height   }';
-        var admin_width='{ $admin_width   }';
-        var admin_height='{ $admin_height   }';
-        var generic_width='{ $generic_width   }';
-        var generic_height='{ $generic_height   }';
-        var guest_width='{ $guest_width   }';
-        var guest_height='{$guest_height}';
-        var normal_width='{$normal_width}';
-        var normal_height='{$normal_height}';
-        var user_status='{$user_status}';
-        var user_status = '{$user_status}';
-        var check_auto_w = '{$check_auto_w}';
+    var marge_basse='{ $MARGE_BASSE }';
+    var echelle_max='{ $ECHELLE_MAX }';
+    var mini_width='{ $MINI_WIDTH   }';
+    var mini_height = '{ $MINI_HEIGHT   }';
+
+    var webmaster_width='{$webmaster_width   }';
+    var webmaster_height='{ $webmaster_height   }';
+    var admin_width='{ $admin_width   }';
+    var admin_height='{ $admin_height   }';
+    var generic_width='{ $generic_width   }';
+    var generic_height='{ $generic_height   }';
+    var guest_width='{ $guest_width   }';
+    var guest_height='{$guest_height}';
+    var normal_width='{$normal_width}';
+    var normal_height='{$normal_height}';
+    var user_status='{$user_status}';
+    var user_status = '{$user_status}';
+    var check_auto_w = '{$check_auto_w}';
      </script>
     <style type="text/css">
          #theImage p{ldelim}
   height:auto;
- 
 }
      </style>
@@ -39,5 +45,4 @@
 {known_script id="Affiche_script" src=$AUTOSIZE_PATH|@cat:"js/Affiche_script.js"}
  <!--  << autosize/template/picture.tpl body  -->
- 
- {html_head}
+ {html_head}  
   {/html_head}  
Index: /extensions/Autosize/template/cl_conflit.tpl
===================================================================
--- /extensions/Autosize/template/cl_conflit.tpl	(revision 7124)
+++ /extensions/Autosize/template/cl_conflit.tpl	(revision 7124)
@@ -0,0 +1,15 @@
+
+{html_head}
+<!--- autosize/cl_confilt.tpl (head) --->
+
+<script type="text/javascript">
+
+</script>
+<!---FIN auto/cl_confilt.tpl  --->
+
+
+<!--- autosize/cl_confilt.tpl (before) ---> 
+{known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js" } 
+{known_script id="conflit_script" src=$AUTOSIZE_PATH|@cat:"js/conflit.js"}
+<!---FIN auto/cl_confilt.tpl (before) --->	
+{/html_head} 
Index: /extensions/Autosize/template/picture.tpl
===================================================================
--- /extensions/Autosize/template/picture.tpl	(revision 7123)
+++ /extensions/Autosize/template/picture.tpl	(revision 7124)
@@ -1,36 +1,30 @@
- {* $Id: autosize/template/picture.tpl  *}
- <!-- autosize/template/picture.tpl  -->   
- {html_head}
-  {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js" now=1} 
-{*jQuery is always available by default*} 
- <script type="text/javascript">
-	//test
-        var img_width='{$IMG_WIDTH }';
-        var img_height='{ $IMG_HEIGHT }';
-        var marge_basse='{ $MARGE_BASSE }';
-        var echelle_max='{ $ECHELLE_MAX }';
-        var mini_width='{ $MINI_WIDTH   }';
-        var mini_height = '{ $MINI_HEIGHT   }';
+ <a><input id="bp_cla" 
+    type="image" 
+    style=" float:right;border:0px;"
+    src="{$cl_autosize_button.ICON}" 
+    onclick = " Toggle_bp()  "  
+    title="{'cl_autosize_info_2'|@translate}"
+    alt="{'cl_autosize_info_2'|@translate}" />
+ </a> 
+ <script language=javascript type="text/javascript">
+ src1="{$cl_autosize_button.ICON}";
+ src2="{$cl_autosize_button.ICON2}";
+ src3="{'cl_autosize_info_2'|@translate}";
+ src4="{'cl_autosize_info'|@translate}";
 
-        var webmaster_width='{$webmaster_width   }';
-        var webmaster_height='{ $webmaster_height   }';
-        var admin_width='{ $admin_width   }';
-        var admin_height='{ $admin_height   }';
-        var generic_width='{ $generic_width   }';
-        var generic_height='{ $generic_height   }';
-        var guest_width='{ $guest_width   }';
-        var guest_height='{ $guest_height   }';
-        var normal_width='{ $normal_width   }';
-        var normal_height='{ $normal_height   }';
-        var user_status='{ $user_status   }';
+ function Toggle_bp()
+ {ldelim}
+ visible = !visible ;
+   if (visible) src=src1 ;
+  else src=src2 ;
+     if (visible)  src_info=src3 ;
+  else src_info=src4 ;
 
-     </script>
-    <style type="text/css">
-         #theImage p{ldelim}
-  height:auto;
+    jQuery('#bp_cla').get(0).src=src ;
+    jQuery('#bp_cla').attr('alt',src_info);
+    jQuery('#bp_cla').attr('title',src_info);
+      old_w = 0;
+    jQuery(window).resize();
+    }
+ </script>
  
-}
-     </style>
- {known_script id="Affiche_script" src=$AUTOSIZE_PATH|@cat:"js/Affiche_script.js"}
- <!--  << autosize/template/picture.tpl   --> 
-{/html_head} 
