Index: /extensions/Autosize/js/Affiche_script.js
===================================================================
--- /extensions/Autosize/js/Affiche_script.js	(revision 16588)
+++ /extensions/Autosize/js/Affiche_script.js	(revision 16589)
@@ -145,7 +145,9 @@
       Zone_image = Calcul_Image(nds == "none");
 
+      jQuery("#theImage").width(Zone_image.container.width);
+      jQuery("#theImage").height(Zone_image.image.height + 5);
 
       jQuery(theMainImage_obj).width(Zone_image.image.width);
-
+      jQuery(theMainImage_obj).height(Zone_image.image.height);
 
 
@@ -165,4 +167,5 @@
       test_w = window.myPamoorama.autoSlideFx.to;
       test_w = window.myPamoorama.autoScrollFx.to;
+      jQuery("#pamoorama_thumb img").height(47);
     });
 
@@ -172,4 +175,5 @@
       test_w = window.myPamoorama.autoSlideFx.to;
       test_w = window.myPamoorama.autoScrollFx.to;
+      jQuery("#pamoorama_thumb img").height(47);
 
     });
@@ -219,4 +223,5 @@
     //=====================================================================
     jQuery("#infoSwitcher").click(function () {
+
       jQuery("#llgbo").trigger("ON");
       jQuery("#theImage").css({ textAlign: "center" });
@@ -270,8 +275,8 @@
 
             wx = parseInt(nw[0]);
-            //wh = parseInt(wx / rapport);
+            wh = parseInt(wx / rapport);
             //jQuery("#theImage").css("height", wh + "px");
             jQuery(theImg).width(wx);
-            // jQuery(theImg).height(wh);
+            jQuery(theImg).height(wh);
           }
         }
@@ -279,5 +284,5 @@
 
     });  // fin click #derivativeSwitchBox a
-    //==========================================================
+
     //=========================================================================
     Autosize_init = function (name, value) {
@@ -313,12 +318,12 @@
       Zone_Affichage = jQuery("#theImage").infos();
 
-      jQuery.cl_cookie('path', cookie_path, { path: cookie_path });
-      typeMap = jQuery.cl_cookie('picture_map');
-      typeSave = jQuery.cl_cookie('picture_deriv');
-      old_img = jQuery.cl_cookie('img');
-      old_img_h = jQuery.cl_cookie('img_h');
-      old_img_w = jQuery.cl_cookie('img_w');
-      old_window_height = jQuery.cl_cookie('window_height');
-      old_window_width = jQuery.cl_cookie('window_width');
+      jQuery.cookie('path', cookie_path, { path: cookie_path });
+      typeMap = jQuery.cookie('picture_map');
+      typeSave = jQuery.cookie('picture_deriv');
+      old_img = jQuery.cookie('img');
+      old_img_h = jQuery.cookie('img_h');
+      old_img_w = jQuery.cookie('img_w');
+      old_window_height = jQuery.cookie('window_height');
+      old_window_width = jQuery.cookie('window_width');
       //============================================================
       img_init = { height: img_height, width: img_width };  // taille initiale
@@ -337,5 +342,5 @@
     //===========================================================================
     Autosize_resize = function (force, parametres) {
-
+      if (typeof rapport == "undefined") return;
       if (force && force == true) old_window.width = 0;
       id_map = jQuery(theMainImage_obj).attr("usemap");
@@ -367,7 +372,7 @@
       //=============================================================
       if (Type_Img == "pamoorama") {
-        if (theMainImage_obj == "#pamoorama") {
+        theMainImage_obj = "#pamoorama"
           Set_Pamoorama();
-        }
+
       }
       if (Type_Img == "map") {
@@ -493,5 +498,5 @@
           img_reelle.height = img_height;
           img_reelle.width = Zone_Affichage.width;
-          if (myPamoorama) theMainImage_obj = myPamoorama.image;
+          if (typeof myPamoorama != "undifened") theMainImage_obj = myPamoorama.image;
           infos_theImage = jQuery("#pamoorama").infos();
           infos_theImage.height = infos_theImage.height;
@@ -1085,14 +1090,14 @@
         if (typeof theMainImage_obj != "undefined") {
           var theImg = document.getElementById("theMainImage");
-          jQuery.cl_cookie('img', theImg.src, cookie_path); // créer un cookie avec une valeur
+          jQuery.cookie('img', theImg.src, cookie_path); // créer un cookie avec une valeur
           theImg.useMap = theImg.useMap || "autosize";
 
-          jQuery.cl_cookie('picture_map', theImg.useMap, { path: cookie_path });
-          jQuery.cl_cookie('img_h', jQuery(theMainImage_obj).height(), { path: cookie_path });
-          jQuery.cl_cookie('img_w', jQuery(theMainImage_obj).width(), { path: cookie_path });
+          jQuery.cookie('picture_map', theImg.useMap, { path: cookie_path });
+          jQuery.cookie('img_h', jQuery(theMainImage_obj).height(), { path: cookie_path });
+          jQuery.cookie('img_w', jQuery(theMainImage_obj).width(), { path: cookie_path });
 
           if (typeof Window_Affichage != "undefined") {
-            jQuery.cl_cookie('window_height', Window_Affichage.height, { path: cookie_path });
-            jQuery.cl_cookie('window_width', Window_Affichage.width, { path: cookie_path });
+            jQuery.cookie('window_height', Window_Affichage.height, { path: cookie_path });
+            jQuery.cookie('window_width', Window_Affichage.width, { path: cookie_path });
           }
         }
@@ -1207,6 +1212,6 @@
 
           document.cookie = 'picture_deriv=' + typeSave + ';path="' + cookie_path + '" ';
-          jQuery.cl_cookie('picture_deriv', typeSave, { path: cookie_path });
-          jQuery.cl_cookie('picture_map', typeMap, { path: cookie_path });
+        jQuery.cookie('picture_deriv', typeSave, { path: cookie_path });
+        jQuery.cookie('picture_map', typeMap, { path: cookie_path });
           theImg.src = url; // charge Image 
 
@@ -1977,17 +1982,4 @@
         }
 
-        jQuery("#pamoorama_inner1").css({
-          "transform": "scale(" + Zoom_pano + ")",
-          "-ms-transform": "scale(" + Zoom_pano + ")", /* IE 9 */
-          "-webkit-transform": "scale(" + Zoom_pano + ")", /* Safari and Chrome */
-          "-o-transform": "scale(" + Zoom_pano + ")", /* Opera */
-          "-moz-transform": "scale(" + Zoom_pano + ")", /* Firefox */
-          "transform-origin": "0 0",
-          "-ms-transform-origin": "0 0", /* IE 9 */
-          "-webkit-transform-origin": "0 0", /* Safari and Chrome */
-          "-moz-transform-origin": "0 0", /* Firefox */
-          "-o-transform-origin": "0 0", /* Opera */
-          "background-size": "100%"
-        });
         jQuery("#pamoorama_inner").css({ width: new_image.width, height: new_image.height, "background-size": "100%"
         });
@@ -2011,5 +2003,5 @@
 
         //  jQuery("#pamoorama_thumb").width(200 /  Zone_image.zoom);
-        jQuery("#pamoorama_thumb").css({ "width": "" });
+
         jQuery("#pamoorama_outter").css({
 
@@ -2024,6 +2016,4 @@
         });
 
-
-        jQuery("#pamoorama_thumb").width(200);
         window.myPamoorama.options.width = Math.ceil(Zone_image.container.width);
         //==================================================================
@@ -2041,14 +2031,5 @@
         window.myPamoorama.imageHeight = new_image.height;
 
-        //  200 = new_image.width
-        thumb_z = (Zone_image.container.width / window.myPamoorama.ratio);
-        thumb_h = (new_image.height / window.myPamoorama.ratio) * Zoom_pano;
-
-        jQuery("#pamoorama_frame").css({
-          width: thumb_z + "px"
-
-        });
-
-        window.myPamoorama.frame.setStyle('width', thumb_z);
+
       } // test img
     } // Set_Pamoorama
@@ -2079,7 +2060,12 @@
         src_infos_1 = src5;
       }
+      jQuery("#theMainImage").height(jQuery("#theMainImage").width() / rapport);
+
       Zone_image.zoom = (Zone_image.image.height / Zone_image.height_init);
+  
       zoom_cl = parseInt(100 * Zone_image.zoom);
+      zoom_cl = Zone_image.zoom;
       jQuery('#zoom ').val(zoom_cl);
+
       zoom_cl = jQuery('#zoom ').val();
       jQuery('#bp_cla').attr('alt', src_info);
@@ -2218,10 +2204,12 @@
         }
       }
-      retrait_h += (b * 2)
+      retrait_h += (b * 2) - 5;
+      retrait_img += 5;
+
       height_theImage = jQuery(window).height() - retrait_h;
       width_theImage -= retrait_w;
       //===============================================================
-      width_theMainImage = width_theImage - retrait_img;
-      height_theMainImage = parseInt(width_theImage / rapport) - (retrait_img);
+      width_theMainImage = (width_theImage - retrait_img);
+      height_theMainImage = parseInt(width_theImage / rapport);
 
       //===============================================================
@@ -2249,6 +2237,9 @@
       height_theImage += (b * 2);
       if (height_theImage > height_theMainImage + retrait_h) {
+        if (Type_Img != "pamoorama") {
         height_theImage = height_theMainImage + retrait_h;
       }
+      }
+      height_theMainImage = width_theMainImage / rapport;
 
       Zone_image = {
Index: /extensions/Autosize/js/autosize.cookie.js
===================================================================
--- /extensions/Autosize/js/autosize.cookie.js	(revision 16588)
+++ /extensions/Autosize/js/autosize.cookie.js	(revision 16589)
@@ -54,5 +54,5 @@
  * @author Klaus Hartl/klaus.hartl@stilbuero.de
  */
-jQuery.cl_cookie = function(name, value, options) {
+jQuery.cookie = function(name, value, options) {
     if (typeof value != 'undefined') { // name and value given, set cookie
         options = options || {};
@@ -96,3 +96,167 @@
     };
 
+    if (jQuery.cookie('picture-menu') == 'visible') {
+      jQuery("head").append("<style type=\"text/css\">#content.contentWithMenu, #the_page > .content {margin-left:240px;}</style>");
+    } else {
+      jQuery("head").append("<style type=\"text/css\">#the_page #menubar {display:none;} #content.contentWithMenu, #the_page > .content {margin-left:35px;}</style>");
+    }
  
+    function hideMenu(delay) {
+      var menubar = jQuery("#menubar");
+      var menuswitcher = jQuery("#menuSwitcher");
+      var content = jQuery("#the_page > .content");
+      var pcontent = jQuery("#content");
+
+      menubar.hide(delay);
+      menuswitcher.addClass("menuhidden").removeClass("menushown");
+      content.addClass("menuhidden").removeClass("menushown");
+      pcontent.addClass("menuhidden").removeClass("menushown");
+      jQuery.cookie('picture-menu', 'hidden', { path: "/" });
+
+    }
+
+    function showMenu(delay) {
+
+      var menubar = jQuery("#menubar");
+      var menuswitcher = jQuery("#menuSwitcher");
+      var content = jQuery("#the_page > .content");
+      var pcontent = jQuery("#content");
+
+      menubar.show(delay);
+      menuswitcher.addClass("menushown").removeClass("menuhidden");
+      content.addClass("menushown").removeClass("menuhidden");
+      pcontent.addClass("menushown").removeClass("menuhidden");
+      jQuery.cookie('picture-menu', 'visible', { path: "/" });
+
+    }
+
+    function hideInfo(delay) {
+
+      var imageInfos = jQuery("#imageInfos");
+      var infoswitcher = jQuery("#infoSwitcher");
+      var theImage = jQuery("#theImage");
+
+      imageInfos.hide(delay);
+      infoswitcher.addClass("infohidden").removeClass("infoshown");
+      theImage.addClass("infohidden").removeClass("infoshown");
+      jQuery.cookie('side-info', 'hidden', { path: "/" });
+
+    }
+
+    function showInfo(delay) {
+
+      var imageInfos = jQuery("#imageInfos");
+      var infoswitcher = jQuery("#infoSwitcher");
+      var theImage = jQuery("#theImage");
+
+      imageInfos.show(delay);
+      infoswitcher.addClass("infoshown").removeClass("infohidden");
+      theImage.addClass("infoshown").removeClass("infohidden");
+      jQuery.cookie('side-info', 'visible', { path: "/" });
+
+    }
+
+    jQuery("document").ready(function (jQuery) {
+
+      // side-menu show/hide
+
+      var sidemenu = jQuery.cookie('picture-menu');
+      var menubar = jQuery("#menubar");
+
+      if (menubar.length == 1) {
+
+        jQuery("#menuSwitcher").html("<div class=\"switchArrow\">&nbsp;</div>");
+
+        // if cookie says the menu is hiding, keep it hidden!
+        if (sidemenu == 'visible') {
+          showMenu(0);
+        } else {
+          hideMenu(0);
+        }
+
+        jQuery("#menuSwitcher").click(function () {
+          if (jQuery("#menubar").is(":hidden")) {
+            showMenu(0);
+            return false;
+          } else {
+            hideMenu(0);
+            return false;
+          }
+        });
+
+      }
+
+      // info show/hide
+
+      var sideinfo = jQuery.cookie('side-info');
+      var imageInfos = jQuery("#imageInfos");
+
+      if (imageInfos.length == 1) {
+
+        jQuery("#infoSwitcher").html("<div class=\"switchArrow\">&nbsp;</div>");
+
+        // if cookie says the menu is hiding, keep it hidden!
+        if (sideinfo == 'hidden') {
+          hideInfo(0);
+        } else {
+          showInfo(0);
+        }
+
+        jQuery("#infoSwitcher").click(function () {
+          if (jQuery("#imageInfos").is(":hidden")) {
+            showInfo(0);
+            return false;
+          } else {
+            hideInfo(0);
+            return false;
+          }
+        });
+
+      }
+
+      // comments show/hide
+
+      var commentsswicther = jQuery("#commentsSwitcher");
+      var comments = jQuery("#thePicturePage #comments");
+
+      commentsswicther.html("<div class=\"switchArrow\">&nbsp;</div>");
+
+      if (comments.length == 1) {
+        var comments_button = jQuery("#comments h3");
+
+        if (comments_button.length == 0) {
+          jQuery("#addComment").before("<h3>Comments</h3>");
+          comments_button = jQuery("#comments h3");
+        }
+
+        if (jQuery.cookie('comments') == 'visible') {
+          comments.addClass("commentsshown");
+          comments_button.addClass("comments_toggle").addClass("comments_toggle_off");
+        } else {
+          comments.addClass("commentshidden");
+          comments_button.addClass("comments_toggle").addClass("comments_toggle_on");
+        }
+
+        comments_button.click(function () { commentsToggle() });
+        commentsswicther.click(function () { commentsToggle() });
+
+      }
+
+
+    });
+
+    function commentsToggle() {
+      var comments = jQuery("#thePicturePage #comments");
+      var comments_button = jQuery("#comments h3");
+
+      if (comments.hasClass("commentshidden")) {
+        comments.removeClass("commentshidden").addClass("commentsshown");
+        comments_button.addClass("comments_toggle_off").removeClass("comments_toggle_on"); ;
+        jQuery.cookie('comments', 'visible', { path: "/" });
+      } else {
+        comments.addClass("commentshidden").removeClass("commentsshown");
+        comments_button.addClass("comments_toggle_on").removeClass("comments_toggle_off"); ;
+        jQuery.cookie('comments', 'hidden', { path: "/" });
+      }
+
+    }
Index: /extensions/Autosize/template/header_2_2.tpl
===================================================================
--- /extensions/Autosize/template/header_2_2.tpl	(revision 16588)
+++ /extensions/Autosize/template/header_2_2.tpl	(revision 16589)
@@ -12,5 +12,5 @@
 {combine_script id="jquery.cluetip" path = "themes/default/js/plugins/jquery.cluetip.js" require="jquery" }
 {combine_script id="autosize.dimensions" path = $AUTOSIZE_PATH|@cat:"js/autosize.dimensions.js" require="jquery"}
-{combine_script id="autosize.cookie" path = $AUTOSIZE_PATH|@cat:"js/autosize.cookie.js" require="jquery" }
+
 
 
Index: /extensions/Autosize/template/picture_2_2.tpl
===================================================================
--- /extensions/Autosize/template/picture_2_2.tpl	(revision 16588)
+++ /extensions/Autosize/template/picture_2_2.tpl	(revision 16589)
@@ -1,1 +1,3 @@
 {combine_script id="Affiche_script" path= $AUTOSIZE_PATH|@cat:"js/Affiche_script.js" require='jquery,conflit_script'  }
+{if $theme != "elegant"}{/if}
+{combine_script id="autosize.cookie" path = $AUTOSIZE_PATH|@cat:"js/autosize.cookie.js" require="jquery"  }
