Index: /extensions/Autosize/js/Affiche_script.js
===================================================================
--- /extensions/Autosize/js/Affiche_script.js	(revision 11276)
+++ /extensions/Autosize/js/Affiche_script.js	(revision 11277)
@@ -1,3 +1,5 @@
 Parent = "#theImage";
+ 
+
 function Toggle_bp() {
     cl_visible = !cl_visible;
@@ -81,6 +83,6 @@
 
 
-    img_h = jQuery(TheImg).height();
-    img_w = jQuery(TheImg).width();
+    img_h = jQuery(theImg).height();
+    img_w = jQuery(theImg).width();
 
     jQuery("#src_img_h").val(img_h);
@@ -96,5 +98,5 @@
     jQuery("#ret_autosize").trigger('ON', { width: img_w,
         height: img_h,
-        theImage: TheImg,
+        theImage: theImg,
         src_img: src_img,
         window_height: Window_Affichage.height,
@@ -243,8 +245,8 @@
        jQuery(window).unload(function () {
          try {
-           if (TheImg) {
-             jQuery.cookie('img', TheImg.src); // créer un cookie avec une valeur
-             jQuery.cookie('img_h', jQuery(TheImg).height());
-             jQuery.cookie('img_w', jQuery(TheImg).width());
+           if (theImg) {
+             jQuery.cookie('img', theImg.src); // créer un cookie avec une valeur
+             jQuery.cookie('img_h', jQuery(theImg).height());
+             jQuery.cookie('img_w', jQuery(theImg).width());
              jQuery.cookie('window_height', Window_Affichage.height);
              jQuery.cookie('window_width', Window_Affichage.width);
@@ -272,4 +274,6 @@
            return;
          }
+
+
          //=========================================================
          if (typeof (options) == "undefined") {
@@ -295,6 +299,7 @@
          //=============================================================
          Type_Img = "";
-         TheImg = null;
+         theImg = null;
          nopano = false;
+
 
          Zone_Affichage = { height: 0, width: 0 };
@@ -372,4 +377,5 @@
          newResize: function () {
            //
+
            if (typeof options != undefined)
              if (options.imageAutosize)
@@ -459,10 +465,5 @@
            marge_left += Zone_Affichage.borderwidth.left;
            winwidth -= (marge_right + marge_left);
-           //---------------------------------------------
-           jQuery(Parent).width(winwidth);
-           jQuery(Parent).css({ height: "auto" });
-
-           //  jQuery(Parent).height(Zone_Affichage.height);
-           //---------------------------------------------
+
 
            if (Type_Img == "pamoorama") {
@@ -485,6 +486,6 @@
              var info_pamoorama_footer = jQuery("#pamoorama_footer").infos();
              var info_pamoorama_frame = jQuery("#pamoorama_frame").infos();
-             TheImg = jQuery("#pamoorama");
-             obj = TheImg.get(0);
+             theImg = jQuery("#pamoorama");
+             obj = theImg.get(0);
 
            } else {
@@ -520,9 +521,13 @@
 
              case "panorama":
-               // return;
-
-
-               TheImg = jQuery().Get_Img_Maxi("#Panorama img");
-               info_theImage = jQuery(TheImg).infos();
+               //  return;
+
+               //the theMainImage ??
+               theImg = jQuery("#theMainImage");
+               if (theImg.length > 0)
+                 theImg = theImg[0];
+               else
+                 theImg = jQuery().Get_Img_Maxi("#Panorama img[alt]");
+               info_theImage = jQuery(theImg).infos();
                info_the_page = jQuery("#the_page").infos();
 
@@ -530,9 +535,9 @@
              case "img":
 
-               if (!TheImg) return true;
+               if (!theImg) return true;
                if (theme.match(RegExp("luciano", "g"))) {
-                 TheImg = jQuery("#the_page #theImg");
-               }
-               info_theImage = jQuery(TheImg).infos();
+                 theImg = jQuery("#the_page #theImg");
+               }
+               info_theImage = jQuery(theImg).infos();
                info_the_page = jQuery("#the_page").infos();
 
@@ -540,10 +545,10 @@
                break
              case "img_autre":
-               if (!TheImg) {
-                 if (DEBUG_autosize == "true") alert("TheImg=null");
+               if (!theImg) {
+                 if (DEBUG_autosize == "true") alert("theImg=null");
                  return true;
 
                }
-               info_theImage = jQuery(TheImg).infos();
+               info_theImage = jQuery(theImg).infos();
                info_the_page = jQuery("#the_page").infos();
 
@@ -589,5 +594,5 @@
 
 
-               TheImg = myPamoorama.image;
+               theImg = myPamoorama.image;
                info_theImage = jQuery("#pamoorama").infos();
                info_theImage.height = img_reelle.height;
@@ -600,29 +605,31 @@
 
            }
-           MinWidth = jQuery(TheImg).css("minWidth");
+           //================= Vérification taille image ==================
+           MinWidth = jQuery(theImg).css("minWidth");
            if (MinWidth == "0px")
              MinWidth = mini_width;
-           MinHeight = jQuery(TheImg).css("minHeight");
+           MinHeight = jQuery(theImg).css("minHeight");
            if (MinHeight == "0px")
              MinHeight = mini_height;
 
-           MaxWidth = jQuery(TheImg).css("maxWidth");
+           MaxWidth = jQuery(theImg).css("maxWidth");
            if (MaxWidth == "0px")
              MaxWidth = winwidth;
-           MaxHeight = jQuery(TheImg).css("maxHeight");
+           MaxHeight = jQuery(theImg).css("maxHeight");
            if (MaxHeight == "0px")
              MaxHeight = mwinheight;
 
            //=============== Vérification taille minimale  autorizée ======================
-           var miniWidth = jQuery(TheImg).Get_Val_int(MinWidth, mini_width);
-           var miniHeight = jQuery(TheImg).Get_Val_int(MinHeight, mini_height);
+           var miniWidth = jQuery(theImg).Get_Val_int(MinWidth, mini_width);
+           var miniHeight = jQuery(theImg).Get_Val_int(MinHeight, mini_height);
            if (winwidth < mini_width2) mini_width2 = winwidth;
 
-           var miniWidth2 = jQuery(TheImg).Get_Val_int(MinWidth, mini_width2);
-           var miniHeight2 = jQuery(TheImg).Get_Val_int(MinHeight, mini_height2);
-
-
-           var maxWidth = jQuery(TheImg).Get_Val_int(MaxWidth, winwidth, "0");
-           maxHeight = jQuery(TheImg).Get_Val_int(MaxHeight, winheight, "0");
+           var miniWidth2 = jQuery(theImg).Get_Val_int(MinWidth, mini_width2);
+           var miniHeight2 = jQuery(theImg).Get_Val_int(MinHeight, mini_height2);
+
+
+           var maxWidth = jQuery(theImg).Get_Val_int(MaxWidth, winwidth, "0");
+           maxHeight = jQuery(theImg).Get_Val_int(MaxHeight, winheight, "0");
+
 
 
@@ -631,7 +638,9 @@
 
            img_reelle.width = parseInt(img_reelle.width);
-           jQuery(Cadre).width(mini_width);
+           // jQuery(Cadre).width(mini_width);
+
+
            if (img_reelle.width < mini_width) {
-             jQuery(Cadre).width(mini_width);
+             //jQuery(Cadre).width(mini_width);
              return true;
 
@@ -639,6 +648,13 @@
 
            img_reelle.height = parseInt(img_reelle.height);
-           if (img_reelle.height < parseInt(mini_height)) return true;
+           if (img_reelle.height < parseInt(mini_height))
+             return true;
            //==================================================================================
+           //---------------------------------------------
+           //  jQuery(Parent).width(winwidth);
+           //  jQuery(Parent).css({ height: "auto" });
+           //  jQuery(Parent).height(Zone_Affichage.height);
+           //---------------------------------------------
+
            if (rapport < 0) {
 
@@ -798,11 +814,11 @@
              //=============LLGBO2 ===========================
              t1 = llgboframe;
-             if (!TheImg.src) {
-               TheImg = jQuery(TheImg).find("img").get(0)
-               if (!TheImg.src) {
-                 TheImg = jQuery(Parent).find("div").get(0)
+             if (!theImg.src) {
+               theImg = jQuery(theImg).find("img").get(0)
+               if (!theImg.src) {
+                 theImg = jQuery(Parent).find("div").get(0)
                }
              }
-             if (TheImg.src) {
+             if (theImg.src) {
 
 
@@ -945,16 +961,30 @@
 
            } else if (Type_Img == "panorama") {
-
-             // -----     jQuery(TheImg).panorama2(img_finale.height, img_finale.width);
-             // jQuery(TheImg).height(img_finale.height);
-             // jQuery(TheImg).width(img_finale.width);
-             jQuery("#Panorama div").height(img_finale.height);
+             // -----     jQuery(theImg).panorama2(img_finale.height, img_finale.width);
+             //  jQuery(theImg).height(img_finale.height);
+             //   jQuery(theImg).width(img_finale.width);
+             //  n = jQuery.fn.panorama();
+             // jQuery("#Panorama div").height(img_finale.height);
              //  class=simple_panorama
-
-             jQuery(".panorama-viewport").css("left", "2px");
-             jQuery(".panorama-viewport").css("width", "auto");
+             // jQuery("#Panorama div").height(img_finale.height);
+             if (typeof asp_options != "undefined")
+               n = asp_options;
+             n1 = jQuery("#Panorama div").width();
+             // asp_options.viewport_width = winwidth;
+             //n =n.panorama_animate();
+             //jQuery("#panoramaContainer").stop(); ;
+             // n = jQuery(theImg).panorama(asp_options);
+
+             //jQuery("#Panorama div").width(asp_options.viewport_width);
+
+             jQuery(".panorama-viewport").css("margin", "auto");
+
+             n = info_imageToolBar;
 
 
            } else if (Type_Img == "pamoorama") {
+
+
+
              info_theImage.height = Zone_Affichage.height;
              img_height = myPamoorama.imageHeight
@@ -964,4 +994,6 @@
              new_width = Zone_Affichage.width - marge_right - marge_left;
              new_width = Zone_Affichage.width - (info_theImage.borderwidth.right + info_theImage.borderwidth.left);
+             if (new_width > myPamoorama.imageWidth)
+               new_width = myPamoorama.imageWidth;
 
 
@@ -987,8 +1019,8 @@
              jQuery("#pamoorama_outter").width(new_width);
 
-
+             jQuery("#pamoorama_thumb").width(200 / zoom);
              // commenter sinon outter augmente à chaque resize
              //  jQuery("#pamoorama_outter").height(info_pamoorama.height - info_pamoorama_footer.height);
-
+             // pamoorama_frame
 
 
@@ -1008,9 +1040,9 @@
 
 
-           } else if (TheImg.src) {
+           } 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).height(img_finale.height);
+             jQuery(theImg).width(img_finale.width);
+             jQuery(theImg).css({ height: img_finale.height + "px ",
                width: img_finale.width + "px "
              });
@@ -1019,7 +1051,7 @@
            } else {
              //===map ? luciano ===
-             jQuery(TheImg).height(img_finale.height);
-             jQuery(TheImg).width(img_finale.width);
-             jQuery(TheImg).css({ height: img_finale.height + "px ",
+             jQuery(theImg).height(img_finale.height);
+             jQuery(theImg).width(img_finale.width);
+             jQuery(theImg).css({ height: img_finale.height + "px ",
                width: img_finale.width + "px "
              });
@@ -1116,8 +1148,8 @@
              info_theImageBox = jQuery("#theImageAndTitle").infos();
              p1 = jQuery(".randomButtons").infos();
-             p2=jQuery("#imageHeaderBar").infos();
+             p2 = jQuery("#imageHeaderBar").infos();
              jQuery("#theImage").width("width", info_theImageBox.width + "px");
              jQuery("#theImageAndTitle").css("position", "relative");
-             jQuery("#theImageAndTitle").css({marginTop: "0px",
+             jQuery("#theImageAndTitle").css({ marginTop: "0px",
                paddingTop: (p1.top) + "px"
              });
@@ -1184,4 +1216,8 @@
     var w00 = 0;
     var myImg = null;
+    img = jQuery(myobj);
+
+    img = jQuery('img[alt]');
+
     jQuery(myobj).each(function (i) {
         w0 = img_reelle.width;
@@ -1208,4 +1244,6 @@
     if (typeof (marge_top) != "undefined") return result;
     info_imageToolBar = jQuery("#imageToolBar").infos();
+
+
     if (info_imageToolBar.position == "absolute") {
         jQuery("#imageToolBar").css("position", "relative");
@@ -1213,4 +1251,5 @@
     }
     optiontop = 0;
+
 
     info_imageInfoBar = jQuery("#imageInfoBar").infos();
@@ -1255,6 +1294,6 @@
                         info_thePicturePage.margin.top + optiontop);
     result = info_imageToolBar;
-    result.width = "20%";
-    result.left = "40%";
+   // result.width = "20%";
+   // result.left = "40%";
     result.marge_top = marge_top;
     result.img_top = img_top;
@@ -1339,6 +1378,6 @@
     if (theme.match(RegExp("luciano", "g"))) {
         jQuery("#imageContainer").css({ height: "auto" });
-        TheImg = jQuery(Parent + " #theImg img");
-        info_img = jQuery(TheImg).infos();
+        theImg = jQuery(Parent + " #theImg img");
+        info_img = jQuery(theImg).infos();
 
 
@@ -1356,6 +1395,6 @@
         });
 
-        TheImg = jQuery("#map");
-        info_img = jQuery(TheImg).infos();
+        theImg = jQuery("#map");
+        info_img = jQuery(theImg).infos();
 
 
@@ -1365,6 +1404,6 @@
 
         });
-        TheImg = jQuery("#charlie")
-        info_img = jQuery(TheImg).infos();
+        theImg = jQuery("#charlie")
+        info_img = jQuery(theImg).infos();
 
 
@@ -1372,6 +1411,6 @@
     } else if (jQuery(Parent + " embed").length > 0) {
 
-        TheImg = jQuery(Parent + " embed");
-        info_img = jQuery(TheImg).infos();
+        theImg = jQuery(Parent + " embed");
+        info_img = jQuery(theImg).infos();
 
 
@@ -1382,15 +1421,23 @@
             return
         }
-        TheImg = jQuery("#pamoorama");
-        info_img = jQuery(TheImg).infos();
+        theImg = jQuery("#pamoorama");
+        info_img = jQuery(theImg).infos();
         info_footer = jQuery("#pamoorama_footer").infos();
         info_img.height = parseInt(img_reelle.height) + parseInt(info_footer.height);
 
     } else {
-        TheImg = jQuery(Parent + " img");
-
-        TheImg = Get_Img_Maxi(TheImg);
-        if (!TheImg) TheImg = jQuery(Parent);   // sans img ??
-        info_img = jQuery(TheImg).infos();
+        theImg = jQuery(Parent + " img[alt]");
+
+        //theImg = Get_Img_Maxi(theImg);
+        //theMainImage
+      
+        if (!theImg)
+            theImg = jQuery(Parent);   // sans img ??
+        if (theImg.length > 1)
+          {theImg = theImg[0];
+
+          }
+
+        info_img = jQuery(theImg).infos();
     }
     //=====================================================================================
Index: /extensions/Autosize/js/autosize.dimensions.js
===================================================================
--- /extensions/Autosize/js/autosize.dimensions.js	(revision 11276)
+++ /extensions/Autosize/js/autosize.dimensions.js	(revision 11277)
@@ -145,5 +145,5 @@
           Css = jQuery(elem).getStyles(elem);
           myposition = Css.position.toString() || "";
-         
+
 
           width = jQuery(elem).outerWidth();
@@ -188,5 +188,5 @@
         }
         if (elem == window) {
-          Cl_Position = { Top: 0, Left: 0 };
+          Cl_Position = { top: 0, left: 0 };
         } else {
           Cl_Position = jQuery(elem).d_position();
@@ -218,5 +218,5 @@
     d_position: function () {
       var left = 0, top = 0, elem = this[0], offset, parentOffset, offsetParent, results;
-
+      l1 = jQuery(elem).css("left");
       if (elem) {
         offsetParent = this.offsetParent();
Index: /extensions/Autosize/js/conflit.js
===================================================================
--- /extensions/Autosize/js/conflit.js	(revision 11276)
+++ /extensions/Autosize/js/conflit.js	(revision 11277)
@@ -64,12 +64,7 @@
 nbpa = 0;
 var Fn;
-if (typeof MooTools == "undefined" && typeof Prototype == "undefined") {
-
-} else {
-  $mootools = $;
-}
-//====================================================
 function conflit(element, nc) {
-     //--- cl_conflit
+  if(typeof DEBUG != "boolean") DEBUG = false ;
+    //--- cl_conflit
     if (typeof MooTools == "undefined" && typeof Prototype == "undefined") {
         ret_element = jQuery(element);
@@ -210,6 +205,6 @@
         jQuery("#icon_gmaps").bind('click', function () {
           //jQuery("#iGMapsIconContent").dialog("open");
-          if (Version_pwg > '2.2.0')
-            return;
+          if (Version_pwg > '2.2.0' )
+          return;
           jQuery('html,body').stop().scrollTop(0);
           jQuery('html,body').stop().scrollLeft(0);
Index: /extensions/Autosize/js/conflit_2.js
===================================================================
--- /extensions/Autosize/js/conflit_2.js	(revision 11276)
+++ /extensions/Autosize/js/conflit_2.js	(revision 11277)
@@ -1,17 +1,18 @@
-﻿
-//=== ajout des fonctions jQuery ===
-if (typeof MooTools == "undefined" && typeof Prototype == "undefined") {
-  $mootools = window.$;
-} else {
-  if (typeof jQuery != 'undefined') {
-    if (typeof $mootools != 'undefined') {
-      if (typeof (gmaps) != "undefined") {
+﻿if (typeof Type_Img ) {
+  //=== ajout des fonctions jQuery ===
+  if (typeof MooTools == "undefined" && typeof Prototype == "undefined") {
+    $mootools = window.$;
+  } else {
+    if (typeof jQuery != 'undefined') {
+      if (typeof $mootools != 'undefined') {
+        if (typeof (gmaps) != "undefined") {
+        }
+        $ = jQuery.fn.$;
+        jQuery.extend($, $mootools);
+        jQuery.extend($, jQuery.fn);
+      } else {
+        $ = jQuery.fn.$;
+        jQuery.extend($, jQuery.fn);
       }
-      $ = jQuery.fn.$;
-      jQuery.extend($, $mootools);
-      jQuery.extend($, jQuery.fn);
-    } else {
-      $ = jQuery.fn.$;
-      jQuery.extend($, jQuery.fn);
     }
   }
Index: /extensions/Autosize/main.inc.php
===================================================================
--- /extensions/Autosize/main.inc.php	(revision 11276)
+++ /extensions/Autosize/main.inc.php	(revision 11277)
@@ -2,5 +2,5 @@
 /*
 Plugin Name: AutoSize
-Version: auto
+Version: 1.6.3a
 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
Index: /extensions/Autosize/template/header_2_2.tpl
===================================================================
--- /extensions/Autosize/template/header_2_2.tpl	(revision 11276)
+++ /extensions/Autosize/template/header_2_2.tpl	(revision 11277)
@@ -1,9 +1,8 @@
 {if not empty($pamoorama)}
-
- <script  id="pamoorama0.3" src="plugins/paMOOramics/js/pamoorama0.3.js" type="text/jscript"></script>
-<script id="mootools" src="plugins/paMOOramics/js/mootools.js" type="text/jscript"></script>
+  <script  id="pamoorama0.3" src="plugins/paMOOramics/js/pamoorama0.3.js" type="text/jscript"></script>
+  <script id="mootools" src="plugins/paMOOramics/js/mootools.js" type="text/jscript"></script>
 {else}
 {/if}
-{* au ou jquery non défini  *}
+{* au cas ou jquery non défini  *}
 {combine_script id="jquery" load="header" path = "themes/default/js/jquery.min.js"}
 {combine_script id="conflit_script0" load="header" path = $AUTOSIZE_PATH|@cat:"js/conflit_2.js" require="jquery" }
Index: /extensions/Autosize/template/picture.tpl
===================================================================
--- /extensions/Autosize/template/picture.tpl	(revision 11276)
+++ /extensions/Autosize/template/picture.tpl	(revision 11277)
@@ -1,2 +1,5 @@
+ 
+
+
  <style type="text/css">
          #bp_cla {ldelim}
@@ -12,4 +15,34 @@
 
  <script language=javascript type="text/javascript">
+  
+
+ {if $ASP.width}
+ var asp_options ={ldelim} };
+
+    var w = $("#imageToolBar").width();
+	if (w === null) {ldelim} w = $("#theImage").width(); }
+	if (w < {$ASP.min_viewport_width}) {ldelim} w = .75 * $("#theImage").width(); }
+	var m = w;
+	w = w * ( Math.min( Math.max({$ASP.viewport_width} / 100, .5) , 1 ));
+	w = Math.round(Math.min( {$ASP.max_viewport_width} , Math.max( {$ASP.min_viewport_width}, w) ));
+	var s = (100 - {$ASP.speed}) * 2000;
+	var p = Math.round(Math.min(Math.max({$ASP.width} * ( {$ASP.start_position} / 100 ), 0), {$ASP.width}));
+	if ({$ASP.width} > w) {ldelim}
+		$("#theImage img").eq(0).removeAttr("style").attr({ldelim}width:{$ASP.width},height:{$ASP.height}}).addClass("simple_panorama");
+		asp_options = {ldelim}
+					 viewport_width: w,
+					 speed: s,
+					 direction: '{$ASP.direction}',
+					 control_display: '{$ASP.control_display}',
+					 start_position : p,
+					 auto_start : {$ASP.auto_start},
+					 mode_360 : {$ASP.mode_360},
+					 loop_180 : {$ASP.loop_180}
+			 };
+		//$("#theImage img.simple_panorama").panorama(asp_options);
+	};
+ 
+  {/if}
+
  var src1="{$cl_autosize_button.ICON}";
  var src2="{$cl_autosize_button.ICON2}";
