Index: /extensions/Autosize/autosize.inc.php
===================================================================
--- /extensions/Autosize/autosize.inc.php	(revision 7193)
+++ /extensions/Autosize/autosize.inc.php	(revision 7193)
@@ -0,0 +1,269 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// | Autosize                                                              |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2010      cljosse                                        |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+if (!defined('AUTOSIZE_PATH'))
+define('AUTOSIZE_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
+
+class autosize_controler {
+	/*
+	*
+	*/
+	static public function cl_autosize_affiche()
+	{
+		global $user, $picture, $template,$page;
+		global $content, $element_info;   
+		global $infos_message,$erreur_message;
+		global  $conf,$lang ,$user,$userdata;
+		$image['width']="1200";
+				  $asp['image_name'] = $image['name'];
+		  $asp['width'] = $image['width'];
+		  $asp['height'] = $image['height'];
+		
+
+		load_language('lang', AUTOSIZE_PATH);
+		$my_path = dirname(__FILE__).'/';
+		if ( $page['body_id']=='thePicturePage'  ) {
+			if ( isset($picture['current'])){
+				
+				$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(
+						array('autosize_content'=> $my_path.'template/autosize.tpl')
+					);
+					
+				return $template->parse( 'autosize_content', false);
+			}
+      
+		}
+	} //public function cl_autosize_affiche
+	/*
+	*
+	*/
+	static public function cl_autosize_admin($menu)
+		{
+		global  $lang ;
+		array_push($menu, array('NAME' => 'Autosize',
+		'URL' => get_admin_plugin_menu_link(AUTOSIZE_PATH . 'admin/admin_autosize.php')));
+		return $menu;
+	} //function cl_autosize_admin
+	/*
+	*
+	*/
+	static public function cl_autosize_aff_infos_plus()
+		{
+		 global $template,$infos_message,$erreur_message, $user ;
+		global  $conf,$lang ;
+
+		 //==============================================================
+		  if (isset($erreur_message))
+				{	
+				if ($erreur_message <> "")
+					{
+						$erreur_message=str_replace("\n",'<br />',$erreur_message) ;
+   						$template->assign('errors',$erreur_message);
+						$erreur_message="";
+					}
+  				}
+		  if (isset($infos_message))
+				{	
+		
+				if ($infos_message <> "")
+					{
+						$infos_message=str_replace("\n",'<br />',$infos_message) ;
+   						$template->assign('infos',$infos_message);
+						$infos_message="";
+					}
+  				}
+				//=============================================================
+		return;		 
+		
+		} // function cl_autosize_aff_infos_plus
+
+
+
+ /*
+ * conflit =============================================
+ */
+	static public function cl_autosize_script()
+	{
+	   global  $template,$user,$conf ;
+
+ 
+		$my_path = dirname(__FILE__).'/';
+		$template->set_filenames(
+		     array('autosize_cl_init'=> $my_path.'template/cl_conflit.tpl')
+		      );
+		 
+  		$template->assign(
+  						array(
+						'AUTOSIZE_PATH' => $my_path,
+
+											)
+						 );
+
+		   return $template->parse( 'autosize_cl_init', false);
+
+       
+	}// function cl_autosize_script
+	/*
+	*
+	*/
+	static public function cl_ajuste_data($content, $image){
+ 
+	   global  $template,$user,$conf ;
+	   		$my_path = dirname(__FILE__).'/';
+			$template->set_filenames(
+		     array('autosize_cl_init'=> $my_path.'template/cl_conflit.tpl')
+		      );
+ /*
+	 $userdata=$user;
+	 $fields = array( 'maxwidth', 'maxheight' );
+	 $ThePicture = $template->get_template_vars('current'); 
+
+			$data = array();
+			$data['maxheight'] = $ThePicture['scaled_height'];
+			$data['maxwidth'] = $ThePicture['scaled_width'];
+			$data['user_id'] = $userdata['id'];
+	   foreach ($fields as $field)
+      {
+        if (isset($_POST[$field]))
+        {
+          $data[$field] = $_POST[$field];
+        }
+      }
+	
+	if($data['maxwidth'] != "" )
+{
+        
+       mass_updates(USER_INFOS_TABLE,
+                   array('primary' => array('user_id'), 'update' => $fields),
+                   array($data));
+	
+}
+
+   */
+
+ $template->assign(
+  						array(
+						'AUTOSIZE_PATH' => $my_path,
+
+											)
+						 );
+ 
+		$template->parse( 'autosize_cl_init', false);
+	return $content;
+
+
+										 
+	 }
+
+} // class
+
+
+	/*
+	*
+	*/
+ function cl_autosize_Get_Options()
+  {
+  global $conf,$autosize_parametres; 
+  
+       $autosize_parametres =  unserialize($conf['cl_autosize']);
+      $autosize_parametres =  cl_autosize_Set_Options();
+      return $autosize_parametres;
+  }
+	/*
+	*
+	*/
+function cl_autosize_Set_Options()
+  {
+  global $autosize_parametres;
+//=============================================================================
+$autosize_parametres->webmaster_height =(isset($_POST['webmaster_height'])) ? $_POST['webmaster_height'] : ((isset($autosize_parametres->webmaster_height )) ? $autosize_parametres->webmaster_height : '100%' ) ;
+$autosize_parametres->webmaster_width=(isset($_POST['webmaster_width']))? $_POST['webmaster_width']: ((isset($autosize_parametres->webmaster_width)) ? $autosize_parametres->webmaster_width:  '90%') ;
+
+$autosize_parametres->admin_height =(isset($_POST['admin_height'])) ? $_POST['admin_height'] : ((isset($autosize_parametres->admin_height )) ? $autosize_parametres->admin_height : '90%' ) ;
+$autosize_parametres->admin_width=(isset($_POST['admin_width']))? $_POST['admin_width']: ((isset($autosize_parametres->admin_width)) ? $autosize_parametres->admin_width:  '90%') ;
+
+$autosize_parametres->generic_height =(isset($_POST['generic_height'])) ? $_POST['generic_height'] : ((isset($autosize_parametres->generic_height )) ? $autosize_parametres->generic_height : '100%' ) ;
+$autosize_parametres->generic_width=(isset($_POST['generic_width']))? $_POST['generic_width']: ((isset($autosize_parametres->generic_width)) ? $autosize_parametres->generic_width:  '90%') ;
+
+$autosize_parametres->guest_height =(isset($_POST['guest_height'])) ? $_POST['guest_height'] : ((isset($autosize_parametres->guest_height )) ? $autosize_parametres->guest_height : '100%' ) ;
+$autosize_parametres->guest_width=(isset($_POST['guest_width']))? $_POST['guest_width']: ((isset($autosize_parametres->guest_width)) ? $autosize_parametres->guest_width:  '90%') ;
+
+$autosize_parametres->normal_height =(isset($_POST['normal_height'])) ? $_POST['normal_height'] : ((isset($autosize_parametres->normal_height )) ? $autosize_parametres->normal_height : '100%' ) ;
+$autosize_parametres->normal_width=(isset($_POST['normal_width']))? $_POST['normal_width']: ((isset($autosize_parametres->normal_width)) ? $autosize_parametres->normal_width:  '90%') ;
+
+
+$autosize_parametres->mini_height =(isset($_POST['mini_height'])) ? $_POST['mini_height'] : ((isset($autosize_parametres->mini_height )) ? $autosize_parametres->mini_height : '150' ) ;
+$autosize_parametres->mini_width=(isset($_POST['mini_width']))? $_POST['mini_width']: ((isset($autosize_parametres->mini_width)) ? $autosize_parametres->mini_width:  '300') ;
+
+$autosize_parametres->echelle_max=(isset($_POST['echelle_max']))? $_POST['echelle_max'] : ((isset($autosize_parametres->echelle_max)) ? $autosize_parametres->echelle_max :  '1.2'); 
+$autosize_parametres->marge_basse=(isset($_POST['marge_basse']))? $_POST['marge_basse']: ((isset($autosize_parametres->marge_basse)) ? $autosize_parametres->marge_basse :  '50');
+//===============================================================================	
+
+if ( isset($_POST['submit'] ) && $_POST['submit'] == l10n('cl_autosize_save') )  {  
+
+ 	$autosize_parametres->check_auto_w = isset($_POST['check_auto_w']) ? $_POST['check_auto_w'] : "off" ;
+	 }else{
+   $autosize_parametres->check_auto_w = isset($_POST['check_auto_w']) ? $_POST['check_auto_w'] : ( ( isset($autosize_parametres->check_auto_w) ) ? $autosize_parametres->check_auto_w :   'off') ; ;
+   }
+
+return $autosize_parametres;
+}
+	/*
+	*
+	*/
+function cl_autosize_sauve_options_inf()
+{
+global $options,$infos_message,$conf,$autosize_parametres  ;
+$infos_message .=l10n("cl_autosize_save_config")."<br>";
+ $autosize_parametres=cl_autosize_Set_Options();
+
+ if ( isset($autosize_parametres) )
+ 	{
+ 
+		$query = '
+    		UPDATE '.CONFIG_TABLE.'
+    		SET value="'.addslashes(serialize($autosize_parametres)).'"
+    		WHERE param = "cl_autosize"
+    		LIMIT 1';
+ 			pwg_query($query);
+	  }
+	 
+ }
+
+
+
+?>
Index: /extensions/Autosize/include/affiche.php
===================================================================
--- /extensions/Autosize/include/affiche.php	(revision 7192)
+++ /extensions/Autosize/include/affiche.php	(revision 7193)
@@ -1,5 +1,6 @@
 <?php  
 
-$visible=(isset($visible))?$visible:true;
+$visible=(isset($visible))?$visible:false;
+
 $img_width=isset($picture['current']['width'])?$picture['current']['width']:480;
 $img_height=isset($picture['current']['height'])?$picture['current']['height']:320;
Index: /extensions/Autosize/js/Affiche_script.js
===================================================================
--- /extensions/Autosize/js/Affiche_script.js	(revision 7192)
+++ /extensions/Autosize/js/Affiche_script.js	(revision 7193)
@@ -28,12 +28,64 @@
 */
 
- var d1 = 0;
- var init_tb = 0;
-
- function set_autosize() {
-     visible = !visible;
-
+
+var img_top = "0";
+var cl_visible = true;
+
+  function Toggle_bp()
+ { 
+ cl_visible = !cl_visible ;
+   if (cl_visible) src=src1 ;
+  else src=src2 ;
+     if (cl_visible)  src_info=src3 ;
+  else src_info=src4 ;
+  
+        jQuery('#bp_cla').attr('alt',src_info);
+        jQuery('#bp_cla').attr('title', src_info);
+
+        jQuery('#bp_img_cla').get(0).src=src ;
+        jQuery('#bp_img_cla').attr('alt',src_info);
+        jQuery('#bp_img_cla').attr('title',src_info);
+        jQuery('#bp_cla').attr('Stitle', src_info);
+        jQuery('#bp_cla').attr('Stip'," ");
+        old_w = 0;
+        jQuery(window).resize();
+    }
+    //=========================================================
+    var old_w = 0;
+     function wait_Timer() {
+         old_w = 0
+         jQuery(window).resize();
+           info_pamoorama_outter = jQuery("#pamoorama_outter").info();
+           if (info_pamoorama_outter.width == 0)
+                setTimeout("wait_Timer()", 100);
+
+    }
+
+ function cl_Timer() {
+ //   if (!jQuery.browser.msie) { jQuery(function () { alert(jQuery.browser.version); }); }
+     if (jQuery.browser.msie && parseInt(jQuery.browser.version) < 8)
+         alert(jQuery.browser.version);
+     panoramaContainer = jQuery(".panorama-container");
+     n = document.scripts[6];//12--14affiche_script ;
+     t = n.src;
+
+     currentPosition = 0 - parseInt(jQuery(panoramaContainer).css('margin-left'));
+     if (currentPosition > 1000) 
+     jQuery(panoramaContainer).css('margin-left',"0px")
+     setTimeout("cl_Timer()", 500);
  }
-
+ function onPropertyChange(e) {
+     var el = e.srcElement;
+     ID = el.id;
+     Prop = e.propertyName.split(".");
+     Property = Prop[1];
+
+     Valeur =parseInt( el.currentStyle[Property]);
+     if (Valeur < -1000) {
+      //  jQuery( el).css(Property, 500+"px");
+         return;
+     }
+     return;
+ }
 /* ready
 *
@@ -56,12 +108,13 @@
             var TheImg = null;
             jQuery(myobj).each(function (i) {
-                w0 = this.width;
-                h0 = this.height;
+                w0 = img_reelle.width;
+                h0 = img_reelle.height;
                 if (h0 > w0) w0 = h0;
                 if (w0 > w00) {
-                    if (!this.nameProp.match(RegExp(thumbnail, "g"))) {
-                        TheImg = this;
-                        w00 = w0;
-                    }
+                    if (!this.src.match(RegExp(".png", "g")))
+                        if (!this.src.match(RegExp(thumbnail, "g"))) {
+                            TheImg = this;
+                            w00 = w0;
+                        }
 
                 }
@@ -69,4 +122,17 @@
             return TheImg;
         }
+
+
+        var init_taille_thumblink = { height: 0, width: 0 };
+        if (init_taille_thumblink.height == 0)
+            init_taille_thumblink = {
+                height: jQuery(".thumbLink").height(),
+                width: jQuery(".thumbLink").width()
+            };
+        //===================================================================	
+ 
+        var old_h = 0;
+        var rapport = -1;
+
         /*
         * Get_val_int
@@ -74,47 +140,58 @@
         * return: valeur entiere
         */
-        function Get_Val_int(myObj, Maxi_val) {
+        function Get_Val_int(myObj, Maxi_val, Obj) {
             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
+            Maxi_val = parseInt(Maxi_val || "0");
+
+            /*
+            - numérique suivie de px ou % ou pt ou em, 
+            - thin, bordure mince, 
+            - medium, bordure moyenne (valeur par défaut), 
+            - thick, bordure épaisse, 
+            - inherit, hérite de son parent (css2).
+            */
+
+            if (!myObj) {
+                return Maxi_val;
+            }
+            if (typeof (myObj) == "string") {
+                switch (myObj) {
+                    case 'thin':
+                        return 1;
+                        break;
+                    case 'medium':
+                        return 2;
+                        break;
+                    case 'thick':
+                        return 4;
+                        break;
+                    case 'inherit':
+
+
+                        break;
+
+                    default:
+
+
+                        break;
+                }
+
+
+
+                if (myObj == "none") return Maxi_val;
+                if (myObj == "auto") return Maxi_val;
+
+                if (myObj.match(reg1)) val = myObj * Maxi_val / 100;
                 val = parseInt(myObj);
+
+            } else
+                val = parseInt(myObj);
+
+
             if (typeof (val) == "NaN") return Maxi_val;
             return val;
         }
 
-        /*
-        * 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
@@ -122,17 +199,17 @@
         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;
-            }
+            if (!cl_visible) return;
+
+            //==========================================================================
+            var winwidth = jQuery(window).width();
+            var winheight = jQuery(window).height();
+            if (old_w == winwidth && old_h == winheight) return;
+
+            if (old_w != winwidth)
+            { old_w = winwidth; }
+            else
+            { if (old_h != winheight) old_h = winheight; }
+            //===========================================================================
+            Cadre = jQuery("#theImage").get(0);
             var Type_Img = "";
             //====== détection du type d'images ======
@@ -147,5 +224,5 @@
             } else if (jQuery("#Panorama").length) {
                 Type_Img = "panorama";
-            } else if (jQuery("#theImage").find("img").length > 0) {
+            } else if (jQuery(Cadre).find("img").length > 0) {
                 Type_Img = "img";
             } else if (jQuery("img").length > 0) {
@@ -156,35 +233,94 @@
             }
 
-            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");
+
+            //===============  Information cadre ======
+
+            var info_Cadre = jQuery(Cadre).info();
+
+            if (info_Cadre.position != "static") {
+                /* Si LLGBO met le cadre en relative  */
+                if (theme.match(RegExp("gally", "g"))) {
+                    //--- passage absolute ==> static ===/
+                    jQuery(Cadre).css("position", "static");
+                    info_Cadre = jQuery(Cadre).info();
+
+                }
+            }
+
+            jQuery("#imageToolBar").css("position", "relative");
+            jQuery("#imageHeaderBar").css("position", "relative");
+            jQuery("#imageToolBar").css("top", 0 + "px");
+            jQuery("#imageHeaderBar").css("top", "0px");
+            //=============================================================================
+            var info_HeaderBar = jQuery("#imageHeaderBar").info();
+            var info_imageInfoBar = jQuery("#imageInfoBar").info();
+            var info_content = jQuery("#content").info();
+            var info_ToolBar = jQuery("#imageToolBar").info();
+
+            var info_titrePage = jQuery("#titrePage").info();
+
+            var marge_right = 0;
+            var marge_left = 0;
+            if (info_content.width > 100) {
+                var marge_right = Get_Val_int(info_imageInfoBar.margin.left) + Get_Val_int(info_imageInfoBar.margin.right);
+                winwidth = info_content.width;
+                marge_right = info_imageInfoBar.width + marge_right;
+            }
+            else
+                winwidth = info_ToolBar.width - 2;
+            var marge_top = info_ToolBar.top + info_ToolBar.height;
+
+            //======================================================================
+
+            if (Type_Img == "pamoorama") {
+                var info_pamoorama = jQuery("#pamoorama").info();
+                var info_pamoorama = jQuery("#pamoorama_outter").info();
+                var info_pamoorama = jQuery("#pamoorama_inner").info();
+
+                TheImg = jQuery("#pamoorama");
+
+                /*
+                pamoorama_outter
+                pamoorama_inner
+                pamoorama_footer
+                pamoorama_caption
+                pamoorama_thumb
+                pamoorama_frame
+                */
+            } else {
+                //==== récupère Img la plus grande  =====
+                if (jQuery("#theImg")) IMG = "#theImg";
+                else IMG = Cadre;
+
+                TheImg2 = Get_Img_Maxi(IMG + " img");
+                //=================================================================
+                if (TheImg2 == null) {
+                    if (jQuery(Cadre).find("img").length > 0) {
+                        IMG = Cadre;
+                        TheImg = Get_Img_Maxi("#theImage img");
+                    }
+                } else {
+                    TheImg = TheImg2  //luciano ?
+
+                }
+            }
             //=================================================================
-            if (TheImg2 == null) {
-                if (jQuery("#theImage").find("img").length > 0) {
-                    IMG = "#theImage";
-                    TheImg = Get_Img_Maxi("#theImage img");
-                }
-            } else {
-                TheImg = TheImg2
-
-            }
-
-            //=================================================================
+
+
             switch (Type_Img) {
                 case "map":
-
-                    jQuery("#content").height(winheight);
-
+                    var info_image = jQuery("#mapPicture").info();
+                    marge_left = info_image.width;
+
+                    if (theme.match(RegExp("gally", "g"))) {
+                        jQuery("#map").css("top", "30px");
+                    }
+                    jQuery("#map").css("left", info_image.width + "px");
                     var TheImg = jQuery("#map").get(0);
-                    pos_image = jQuery("#map").position();
-                    pos_page = jQuery("#the_page").position();
-
+                    info_image = jQuery("#map").info();
+
+
+                    pos_page = jQuery("#the_page").info();
+                    ;
 
                     break
@@ -203,6 +339,6 @@
                     });
 
-                    pos_image = jQuery(TheImg).position();
-                    pos_page = jQuery("#the_page").position();
+                    pos_image = jQuery(TheImg).info();
+                    pos_page = jQuery("#the_page").info();
 
                     break
@@ -210,6 +346,6 @@
 
                     if (!TheImg) return;
-                    pos_image = jQuery(TheImg).position();
-                    pos_page = jQuery("#the_page").position();
+                    pos_image = jQuery(TheImg).info();
+                    pos_page = jQuery("#the_page").info();
 
 
@@ -225,14 +361,15 @@
                     //
 
-                    var TheImg = jQuery("#theImage").find("embed");
-
-                    pos_image = jQuery("#theImage").position();
+                    var TheImg = jQuery(Cadre).find("embed");
+
+                    pos_image = jQuery(Cadre).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);
+                        img_height = parseInt(jQuery(TheImg).outerHeight());
+                        img_width = parseInt(jQuery(TheImg).outerWidth());
+
+                        img_reelle.height = img_height;
+                        img_reelle.width = img_width;
+
                     }
 
@@ -241,5 +378,5 @@
 
                     var TheImg = jQuery('#charlie object').get(0);
-                    pos_image = jQuery("#theImage").position();
+                    pos_image = jQuery(Cadre).position();
                     pos_page = jQuery("#the_page").position();
                     if (rapport < 0) {
@@ -257,13 +394,15 @@
                     var Image = jQuery("#pamoorama").find("img");
 
-                    pos_image = jQuery("#pamoorama").position();
-                    pos_page = jQuery("#the_page").position();
+                    pos_image = jQuery("#pamoorama").info();
+                    pos_page = jQuery("#the_page").info();
                     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);
@@ -273,4 +412,6 @@
 
             img_reelle.width = parseInt(img_reelle.width);
+
+
             if (img_reelle.width < mini_width) return;
 
@@ -279,11 +420,14 @@
             //==================================================================================   
             if (rapport < 0) {
-                img_init.height = parseInt(img_height || TheImg.height);
-                img_init.width = parseInt(img_width || TheImg.width);
+
+                img_init.height = parseInt(img_height);
+                img_init.width = parseInt(img_width);
+
                 rapport = img_width / img_height;
+
                 if (Type_Img != "map")
                     rapport = (img_init.width / img_init.height);
                 else
-                    rapport = -1;
+                    rapport = 0;
 
             }
@@ -291,74 +435,121 @@
 
             //=============== Zone d'affichage ============================
-            zone_affichage.width = winwidth - 0 - (pos_page.left * 2) - 5;
-            zone_affichage.height = winheight - 0 - pos_page.top;
+            borderW = jQuery("#theImage").css("borderWidth");
+            borderW = Get_Val_int(borderW, 2);
+
+            zone_affichage.width = winwidth - (borderW * 2);
+            zone_affichage.height = winheight - marge_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")
-
+
+
+
+
+            if (info_ToolBar.height > 0) {
+                Bandeau = info_ToolBar.bottom;
+
+            }
+            else {
+
+                Bandeau = info_HeaderBar.bottom;
+            }
+
+
+            //==================================================================================
             jQuery("#theImage #theImg IMG").css("marginTop", "0px")
-
-
-
-            var lmt = 0;
+            var Lmt = 0;
+
+            var h = 15;
+            if (theme.match(RegExp("sobre", "g"))) {
+                h += 0; //??
+            } else if (theme.match(RegExp("Pure", "g"))) {
+                h += 0; //??
+            } else if (theme.match(RegExp("luciano", "g"))) {
+                h += 0; //??
+            } else if (theme.match(RegExp("simple", "g"))) {
+                h += 0; //??
+            } else if (theme.match(RegExp("gally", "g"))) {
+                h += 0; //??
+
+            }
+
+
+            if (Type_Img != "map") {
+                //=============== Description ================
+                Parent = "theImage";
+                if (jQuery("#" + Parent + " br").length > 0) {
+                    jQuery("#" + Parent + " br").remove();
+                }
+                //=============================================
+                var Description = jQuery("#" + Parent + " p");
+                jQuery(Description).each(function (i) {
+                    t = jQuery(this).text();
+                    p0 = jQuery(this).parent().get(0);
+                    if (p0.id == Parent || p0.nodeName == "TD") {
+                        if (jQuery(this).text() == "")
+                            jQuery(this).remove();
+                        else {
+                            h += 10;
+                            h += jQuery(this).info().height;
+                        }
+
+
+                    }
+
+                });
+                //================ Licence  ========================
+
+                var Licence = jQuery(".licencetag");
+                if (Licence.length > 0) {
+                    var info_licence = jQuery(".licencetag").info();
+                    h += info_licence.height;
+                    jQuery(".licencetag").css("padding", "0px");
+                    jQuery(".licencetag img").css("position", "static");
+
+                    Licence = Licence.parent();
+
+
+                    //====================================================================
+
+
+
+                }
+
+
+
+                //  zone_affichage.height -= h;
+            }
+
+            info_img = jQuery(TheImg).info();
+            info_licence = jQuery(".licencetag").info();
+            Lmt = info_licence.top - info_img.bottom
+            var Bandeau_bas = h;
+
+            //=========================================================================
+            img_top = Bandeau;
+            //============ Padding image ? ===============
+
+            img_padding_top = Get_Val_int(info_img.padding.top);
+            img_padding_top += Get_Val_int(info_img.padding.bottom);
+            img_padding_top += Get_Val_int(info_img.borderwidth.top);
+            img_padding_top += Get_Val_int(info_img.borderwidth.bottom);
+
+            margin_top = Get_Val_int(info_Cadre.margin.top);
+            padding_top = Get_Val_int(info_Cadre.padding.top);
+            padding_top += Get_Val_int(info_Cadre.padding.bottom);
+
+            Marge_Basse = parseInt(marge_basse || 0); // hors bandeau
+            //==========================================================================
             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;
-
+            zone_affichage.height = winheight - Bandeau - Marge_Basse - h - margin_top - padding_top;
+            var Image_height = zone_affichage.height - Bandeau_bas - img_padding_top;
+
+            //=============================================================
             var height_user = eval(user_status + "_height");
 
-            //=============================================================
+
             var reg1 = new RegExp("%", "g");
             if (height_user.match(reg1))
@@ -372,11 +563,22 @@
 
             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);
+            if (rapport > 0)
+                var Image_width = parseInt(Image_height * rapport);
+
+            else if (Type_Img == "map") {
+                var Image_width = zone_affichage.width - marge_left - marge_right;
+
+                if (theme.match(RegExp("gally", "g"))) {
+                    Image_height -= "30";
+                }
+
+            } else {
+                var Image_width = zone_affichage.width;
+            }
+
+
             //===============================================================
-
             align_auto = "center";
             if (jQuery("#theImg").css("textAlign"))
@@ -394,13 +596,15 @@
                     widthmin = parseInt(width_user);
 
-                if (Image_Width > widthmin) {
-                    //   Image_Width largeur à atteindre 
+                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 (rapport > 0) Image_height = parseInt(Image_Width / rapport);
+                    Image_width = parseInt(img_reelle.width * echelle_w);
+                    if (rapport > 0)
+                        Image_height = parseInt(Image_width / rapport);
+                }
+
+
 
             }
@@ -411,29 +615,36 @@
             zoom = echelle;
 
-            if (TheImg.src) {
-                w_init = TheImg.width;
-                h_init = TheImg.height;
-            }
             //  zone_affichage.height *= zoom;
             //  zone_affichage.width *= zoom;
             //=============LLGBO2 ===========================
             marges = 0;
-
+            t1 = { top: 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();
+                marges = jQuery(llgboframe).outerWidth() - jQuery("#gbo div:last").outerWidth();
+
+                m1 = jQuery(llgboframe).outerHeight();
                 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");
+                    marge_top = t1.top - img_top;
+                    Image_height -= marge_top;
+                    Image_width = Image_height * rapport;
+                    if ((winwidth) < Image_width) {
+                        _width = twidth;
+                    } else {
+                        _width = Image_width;
+                    }
+
+
+                    jQuery("#gbo").outerWidth(_width);
+                    jQuery("#gbo").outerHeight(Image_height);
+                    jQuery("#gbo").css("width", (_width) + "px");
+                    jQuery("#gbo").css("height", (Image_height) + "px");
+
+                    Image_height -= marges;
+                    Image_width -= marges;
+
                 } else {
 
@@ -447,6 +658,22 @@
 
 
-                if (jQuery("#prevnext")) {
-                    areas = jQuery("area");
+                if (jQuery("area").length > 0) {
+                    jQuery("area").each(function (i) {
+
+                        obj1 = this.rel;
+                        obj2 = this.coords;
+                        if (obj1 == "up")
+                            this.coords = (Image_width / 3) + "," + 0 + "," + (Image_width * 2 / 3) + "," + Image_height;
+                        else if (obj1 == "prev")
+                            this.coords = 0 + "," + 0 + "," + (Image_width / 3) + "," + Image_height;
+                        else if (obj1 == "next")
+                            this.coords = (Image_width * 2) / 3 + "," + 0 + "," + (Image_width * 3 / 3) + "," + Image_height;
+
+                    });
+
+
+
+
+
 
                 }
@@ -456,16 +683,30 @@
 
             //=========================================================
-            zone_affichage.height = (Image_height + marges)
+            //     jQuery(Cadre).css("position", "relative");
+
+            jQuery(Cadre).css("top", "0px");
+            jQuery("#standard").css("top", 0 + "px");
+            jQuery("#comments").css("top", 0 + "px");
+
+
+            //jQuery("#copyright").css("top", 0 + "px");
+
+
             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);
+            //  Image_height, Image_width = valeur a atteindre.
+            if (theme.match(RegExp("luciano", "g"))) {
+                zone_affichage.height -= Bandeau_bas;
+            }
+
+            jQuery(Cadre).height(zone_affichage.height);
+            jQuery(Cadre).width(zone_affichage.width);
             //==============================================================
+
             img_finale.height = Image_height;
-            img_finale.width = Image_Width;
+            img_finale.width = Image_width;
             //==============================================================
+
 
             if (Type_Img == "charlie") {
@@ -473,77 +714,62 @@
                 /**/
                 pdf = 2 * parseInt(jQuery(".none_2").css("paddingRight"));
-                jQuery("#charlie").css("width", Image_Width + pdf);
+                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("width", Image_width + 100 + "px");
                 jQuery("#player").css("height", Image_height);
 
-                jQuery("#embedplayer").css("width", Image_Width);
+                jQuery("#embedplayer").css("width", Image_width);
                 jQuery("#embedplayer").css("height", Image_height);
 
 
-                jQuery("object").width(Image_Width);
+                jQuery("object").width(Image_width);
                 jQuery("object").height(Image_height);
             } 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(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");
-                */
+
+                jQuery(".panorama-viewport").css("left", "2px");
+                jQuery(".panorama-viewport").css("width", "auto");
+                //   setTimeout("cl_Timer()", 500);
 
             } else if (Type_Img == "pamoorama") {
-
-
+                marge_left += 0;
+                new_width = zone_affichage.width - marge_right - marge_left;
+                jQuery("#pamoorama").css("margin", 0 + "px");
+                jQuery("#pamoorama").css("left", marge_left + "px");
                 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").css("width", new_width + "px");
+                jQuery("#pamoorama").width(new_width);
+
+
+                jQuery("#pamoorama_outter").css("left", marge_left + "px");
 
                 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");
+
+                jQuery("#pamoorama_outter").css("width", (new_width) + "px");
+                jQuery("#pamoorama_outter").width(new_width);
+
+
+                jQuery("#pamoorama_footer").width((zone_affichage.width - marge_right - marge_left));
+                jQuery("#pamoorama_footer").css('width', (zone_affichage.width - marge_right - marge_left) + "px");
                 zoom = Image_height / img_height;
-
-                h_frame = jQuery("#pamoorama_frame").height();
-                h_width = jQuery("#pamoorama_frame").width();
-                jQuery(TheImg).css("zoom", zoom);
-
+                info_pamoorama_outter = jQuery("#pamoorama_outter").info();
+
+                h_frame = jQuery("#pamoorama").width();
+                if (old_w == jQuery(window).width() && old_h == jQuery(window).height()) {
+                     
+                     if (info_pamoorama_outter.width == 0)
+                         setTimeout("wait_Timer()", 100);
+                    //     jQuery(TheImg).css("zoom", zoom);
+                }
 
 
@@ -559,4 +785,6 @@
                 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");
             }
 
@@ -564,9 +792,11 @@
             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");
+                    //    setTimeout("cl_Timer()", 100);
+
+                } else {
+
+                    jQuery("#imageToolBar").css("position", "static");
                 }
             } catch (e) {
@@ -574,16 +804,20 @@
             }
             //  
+            if (!pos) pos = jQuery("#copyright").position();
+            if (pos != jQuery("#copyright").position())
+                pos = jQuery("#copyright").position();
+            if (pos.top > 100) jQuery("#the_page").height(pos.top);
+
+            if (old_w == jQuery(window).width() && old_h == jQuery(window).height()) return;
             jQuery(window).resize();
             return;
         });
-
+        var pos;
         //===================================================================	  
-
-
         jQuery(window).resize();
-        jQuery(window).resize();
+
 
     } // function
-);                   // ready
+);                                                                                                                                                                                                        // ready
 
 /* Extension
Index: /extensions/Autosize/js/conflit.js
===================================================================
--- /extensions/Autosize/js/conflit.js	(revision 7192)
+++ /extensions/Autosize/js/conflit.js	(revision 7193)
@@ -1,45 +1,57 @@
 ﻿//==== remplace $(... avec jQuery( ====
+var d1 = 0;
+var init_tb = 0;
  
-(function () {
-    
-})();
-
-
-
 function $(element, nc) {
     //============== détection framework ==================
-    jq = jQuery(element).selector;
+   
 
     var tp1 = typeof (MooTools);
+    var MooTools_version = "0";
+
     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 (MooTools.version == "1.2.4") {
+            MooTools_version = "Luciano"; // luciano
+            ret_Luciano = jQuery().$Luciano(element, nc);
+        }
+
+    if (MooTools.version == "1.11") {
+        MooTools_version = "pamoorama"; //pamoorama
+        try {
+            
+        } catch (e) {
+        
+        };
+        }
+
+
+    }
+
+    tp1 = typeof (Prototype);
+   var Prototype_Version = '0';
+   if (tp1 != "undefined") {
        if (Prototype.Version == '1.6.0.2') {
-           var Prototype_Version = '1602';
+           Prototype_Version = '1602';
+         
        } else if (Prototype.Version == '1.6.1') {
-           var Prototype_Version = '161';
+          Prototype_Version = '161';
+         
        } else if (Prototype.Version == '1.0.0.0') {
-           var Prototype_Version = '1';
+          Prototype_Version = '1';
+       
        }
    }
-    //===================================================
+     //===================================================
+   var  jq = jQuery(element).selector;
+   var  new_element = jQuery(element);
+
     if ( Prototype_Version=="0" && MooTools_version == "0") {
-      return jQuery(element);
+        return new_element;
     }
 //=======================================================================================
-   if (arguments.caller) {
+    if (arguments.caller && arguments.caller.length>0 ) {
         if (arguments.caller.length > 1) {
             if (element == "pamoorama") {
-                return jQuery().$Pamoorama(element);
+                return jQuery().$Pamoorama(element) ;
             }
 
@@ -50,11 +62,31 @@
                 case "dom:loaded":
                     return element;
-                    return jQuery().$Protype1602(element);
+                    return jQuery().$Protype(element);
                     break;
                 case "load":
-                    return jQuery().$Protype1602(element); ;
+                    return jQuery().$Protype(element); 
                     break;
                 case "unload":
-                    return jQuery().$Protype1602(element); ;
+                    return jQuery().$Protype(element);
+                    break;
+                case "prototype_event_registry":
+
+                    try {
+                        new_element = jQuery().$Protype(element);
+                    } catch (e) {
+                        new_element = null;
+                    }
+
+                   
+                    return new_element;
+                    break;
+                case "readystatechange":
+                    try {
+                        new_element = jQuery().$Protype(element);
+                    } catch (e) {
+                        new_element = null;
+                    }
+
+                    return new_element; 
                     break;
             }
@@ -66,7 +98,13 @@
                 switch (arg) {
                     case "bottom":
-                        return jQuery().$Pamoorama(element);
+                        return jQuery().$Pamoorama(element) ;
                         break;
                     case "left":
+                        return jQuery().$Pamoorama(element) ;
+                        break;
+                    case "prototype_event_registry":
+                        return jQuery().$Pamoorama(element) ;
+                        break;
+                    case "readystatechange":
                         return jQuery().$Pamoorama(element);
                         break;
@@ -108,5 +146,5 @@
                             }
                         //=======================================================
-                        return jQuery(element);
+                            return new_element;
                         break;
 
@@ -115,5 +153,5 @@
              { //=========== options luciano =================================== 
                  //=== theme Luciano ====
-                 return jQuery().$Luciano(element, nc);
+                 return ret_Luciano;
              }
         }
@@ -122,6 +160,5 @@
      //==================================================
      tpe = typeof (element);
-    new_element = jQuery(element);
-  
+    
     //========== test jQuery ? ==============
 
@@ -143,6 +180,6 @@
     //=========== options pamoorama ===================================  
     {
-    tp1=typeof (element) ;
-    if (tp1=="string")
+     
+    if (tpe=="string")
         switch (jq) {
             case "ie_ready":
@@ -156,5 +193,5 @@
                 break;
 
-        }else if(tp1=="boolean")
+        }else if(tpe=="boolean")
         {
             return jQuery().$Pamoorama(element);
@@ -164,8 +201,26 @@
         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 (el == "BODY") {
+            try { return jQuery().$Pamoorama(element) } catch (e) {
+  return jQuery(element);
+            };
+          
+        }
+        if (element == window)
+            return new_element;
+       jQuery().$Pamoorama(element);
+    }
+    obj_panorama = jQuery("#Panorama");
+    if (obj_panorama.length > 0 && jq != "rateForm" && jq != "order" && jq != "themeSelect") {
+        if (tpe == "object")
+            if (Prototype_Version != '0') {
+                //=== rvmaps ===
+                try { elem_retour=jQuery().$Protype(element);
+                    return elem_retour;
+                } catch (e) {
+                     
+                }
+            }
+
         if (new_element.length < 2) return new_element;
         if (new_element.length == 2) return jQuery(element).get(1);
@@ -188,5 +243,5 @@
         if (new_element.context.loaded) {
     //=== theme Luciano ====
-        if (MooTools_version == "Luciano")  return jQuery().$Luciano(element, nc);
+        if (MooTools_version == "Luciano")  return ret_Luciano;
         //=== theme gally ? ====
             return new_element;
@@ -198,5 +253,5 @@
         if (MooTools_version == "Luciano") {
             //=== theme Luciano ====
-            new_element = jQuery().$Luciano(element, nc);
+            new_element = ret_Luciano;
             tp = new_element.nodeName + new_element.nodeType;
             if (tp == "DIV1") return new_element;
@@ -214,6 +269,9 @@
     if (Prototype_Version != '0') {
         //=== rvmaps ===
-
-        return jQuery().$Protype1602(element);
+        try {
+            return jQuery().$Protype(element);
+        } catch (e) {
+            return jQuery(element);
+        }
     }
     return jQuery(element);
@@ -222,4 +280,33 @@
 
 //=========================================================
+(function ($) {
+              $.fn.panorama2 =
+              function (height, width) {
+               
+           var src =jQuery(this);
+
+          return ;
+
+$("#theImage img").eq(0).removeAttr("style").attr({width:width,height:height});
+retour= jQuery('a.panorama-control-left').click();
+panoramaContainer=jQuery('panorama-container');
+
+            /*
+                $(panoramaContainer).stop();
+                op=options;
+                settings.direction = 'right';
+                panoramaContainer.panorama_animate(panoramaContainer, elemWidth, settings);
+             */  
+                
+
+                           
+
+
+              } 
+
+
+})(jQuery);
+
+
 jQuery.fn.extend({
     //---------------- luciano -------------------------------
@@ -253,5 +340,5 @@
     },
     //===================================================
-    $Protype1602: function (element) {
+    $Protype: function (element) {
         //======== prototype.js =====================
         if (arguments.length > 1) {
Index: /extensions/Autosize/js/jquery.dimensions.min.js
===================================================================
--- /extensions/Autosize/js/jquery.dimensions.min.js	(revision 7193)
+++ /extensions/Autosize/js/jquery.dimensions.min.js	(revision 7193)
@@ -0,0 +1,194 @@
+/* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
+ * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
+ * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
+ *
+ * $LastChangedDate: 2007-12-20 08:43:48 -0600 (Thu, 20 Dec 2007) $
+ * $Rev: 4257 $
+ *
+ * Version: 1.2
+ *
+ * Requires: jQuery 1.2+
+ */
+(function (jQuery) {
+    jQuery.dimensions = { version: '1.3' };
+    /*
+    * Interception Height, Width
+    */
+    jQuery.each(['Height', 'Width'],
+            function (i, name) {
+                jQuery.fn['inner' + name] = function () {
+                    if (!this[0]) return;
+                    var torl = name == 'Height' ? 'Top' : 'Left',
+                        borr = name == 'Height' ? 'Bottom' : 'Right';
+                    return this.is(':visible') ? this[0]['client' + name] : num(this, name.toLowerCase()) + num(this, 'padding' + torl) + num(this, 'padding' + borr);
+                };
+
+                jQuery.fn['outer' + name] = function (options) {
+                    if (!this[0]) return;
+                    var torl = name == 'Height' ? 'Top' : 'Left',
+                        borr = name == 'Height' ? 'Bottom' : 'Right';
+                    options = jQuery.extend({ margin: false },
+                                                options || {});
+                    var val = this.is(':visible') ? this[0]['offset' + name] :
+                        num(this,
+                        name.toLowerCase()) +
+                        num(this, 'border' + torl + 'Width') +
+                        num(this, 'border' + borr + 'Width') +
+                        num(this, 'padding' + torl) +
+                        num(this, 'padding' + borr);
+                    return val + (options.margin ? (num(this, 'margin' + torl) + num(this, 'margin' + borr)) : 0);
+                };
+            });
+    /*
+    *
+    */
+    jQuery.each(['Left', 'Top'],
+      function (i, name) {
+          jQuery.fn['scroll' + name] = function (val) {
+              if (!this[0]) return;
+              return val != undefined ? this.each(function () {
+                  this == window || this == document ? window.scrollTo(name == 'Left' ? val : $(window)['scrollLeft'](),
+           name == 'Top' ? val : $(window)['scrollTop']()) : this['scroll' + name] = val;
+              }) : this[0] == window || this[0] == document ? self[(name == 'Left' ? 'pageXOffset' : 'pageYOffset')] || jQuery.boxModel && document.documentElement['scroll' + name] || document.body['scroll' + name] : this[0]['scroll' + name];
+          };
+
+      });
+    jQuery.fn.extend({
+
+        info: function () {
+            var width = 0, height = 0;
+            var left = 0, top = 0, elem = this[0], offset, parentOffset, offsetParent, results;
+            var borderwidth = { width: "0 0 0 0",
+                top: 0,
+                left: 0,
+                right: 0,
+                bottom: 0
+            }
+            var padding = { padding: "0 0 0 0",
+                top: 0,
+                left: 0,
+                right: 0,
+                bottom: 0
+            };
+            var margin = { margin: "0 0 0 0",
+                top: 0,
+                left: 0,
+                right: 0,
+                bottom: 0
+            };
+            //=====================================================================
+            results = {
+                position: jQuery(elem).css("position"),
+                top: 0,
+                left: 0,
+                width: 0,
+                height: 0,
+                right: 0,
+                bottom: 0,
+                borderwidth: borderwidth,
+                padding: padding,
+                margin: margin
+            };
+            ;
+            if (elem) {
+                Position = jQuery(elem).position();
+                left = Position.left;
+                top = Position.top;
+                width = jQuery(elem).outerWidth();
+                height = jQuery(elem).outerHeight();
+
+
+                borderwidth.left = jQuery(elem).css("borderLeftWidth");
+                borderwidth.right = jQuery(elem).css("borderRightWidth");
+                borderwidth.top = jQuery(elem).css("borderTopWidth");
+                borderwidth.bottom = jQuery(elem).css("borderBottomWidth");
+                try {
+                    borderwidth.width = jQuery(elem).css("borderWidth");
+                } catch (e) {
+                    borderwidth.width = '"' + borderwidth.left + ' ' + borderwidth.top + ' ' + borderwidth.right + ' ' + borderwidth.bottom + '"';
+                }
+
+
+                margin.left = jQuery(elem).css("marginLeft");
+                margin.right = jQuery(elem).css("marginRight");
+                margin.top = jQuery(elem).css("marginTop");
+                margin.bottom = jQuery(elem).css("marginBottom");
+                try {
+                    margin.margin = jQuery(elem).css("margin");
+                } catch (e) {
+                    margin.margin = '"' + margin.left + ' ' + margin.top + ' ' + margin.right + ' ' + margin.bottom + '"';
+                }
+
+                padding.left = jQuery(elem).css("paddingLeft");
+                padding.right = jQuery(elem).css("paddingRight");
+                padding.top = jQuery(elem).css("paddingTop");
+                padding.bottom = jQuery(elem).css("paddingBottom");
+                try { padding.padding = jQuery(elem).css("padding"); } catch (e) {
+                    padding.padding = '"' + padding.left + ' ' + padding.top + ' ' + padding.right + ' ' + padding.bottom + '"';
+                }
+
+                results = {
+                    position: jQuery(elem).css("position"),
+                    top: top,
+                    left: left,
+                    width: width,
+                    height: height,
+                    right: left + width,
+                    bottom: top + height,
+                    borderwidth: borderwidth,
+                    margin: margin,
+                    padding: padding
+                };
+
+                return results
+            } return results;
+        },
+        /*
+        * Position de l'object elem
+        */
+        position: function () {
+            var left = 0, top = 0, elem = this[0], offset, parentOffset, offsetParent, results;
+            if (elem) {
+                offsetParent = this.offsetParent();
+                offset = this.offset();
+                if (offsetParent) {
+                    if (typeof (offsetParent.offset) != "undefined")
+                        parentOffset = offsetParent.offset();
+                    else
+                        parentOffset = { top: 0, left: 0 };
+
+                    offset.top -= num(elem, 'marginTop');
+                    offset.left -= num(elem, 'marginLeft');
+
+                    if (offsetParent.length > 0) {
+                        parentOffset.top += num(offsetParent, 'borderTopWidth');
+                        parentOffset.left += num(offsetParent, 'borderLeftWidth');
+                    } else {
+                        parentOffset = { top: 0, left: 0 };
+
+                    }
+                } else {
+                    parentOffset = { top: 0, left: 0 };
+                }
+                results = {
+                    top: offset.top - parentOffset.top, left: offset.left - parentOffset.left
+                };
+            } return results;
+        },
+        /*
+        * offsetParent
+        */
+        offsetParent: function () {
+            var offsetParent = this[0].offsetParent;
+            while (offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static'))
+                offsetParent = offsetParent.offsetParent;
+            return jQuery(offsetParent);
+        }
+    });
+    /*
+    *
+    */
+    function num(el, prop) {
+        return parseInt(jQuery.curCSS(el.jquery ? el[0] : el, prop, true)) || 0;
+    };
+})(jQuery);
Index: /extensions/Autosize/main.inc.php
===================================================================
--- /extensions/Autosize/main.inc.php	(revision 7192)
+++ /extensions/Autosize/main.inc.php	(revision 7193)
@@ -2,5 +2,5 @@
 /*
 Plugin Name: AutoSize
-Version: 1.1.22
+Version: 1.2.0
 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
@@ -11,172 +11,16 @@
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 if (!defined('AUTOSIZE_PATH')) 
-define(
-  'AUTOSIZE_PATH',
-   PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'
-);
+define(  'AUTOSIZE_PATH',   PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/' );
 
-add_event_handler('loc_end_picture', 'cl_autosize_affiche',EVENT_HANDLER_PRIORITY_NEUTRAL+10);
-function cl_autosize_affiche()
-{
-    global $user, $picture, $template,$page;
-    global $content, $element_info;   
-    global $infos_message,$erreur_message;
-    global  $conf,$lang ,$user;
-  load_language('lang', AUTOSIZE_PATH);
+include_once(AUTOSIZE_PATH.'autosize.inc.php');
 
-    if ( $page['body_id']=='thePicturePage'  ) {
-   if ( isset($picture['current'])){
-    $my_path = dirname(__FILE__).'/';
-    $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(
-        array('autosize_content'=> $my_path.'template/autosize.tpl')
-    );
-
-       return $template->parse( 'autosize_content', false);
-       }
-       }
-}
+$autosize_controler = new autosize_controler();
+add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_affiche'), 95 );
+add_event_handler('get_admin_plugin_menu_links', array(&$autosize_controler,'cl_autosize_admin')  );
 
 
-//=====================================================================
-add_event_handler('get_admin_plugin_menu_links', 'cl_autosize_admin_menu_test');
-function cl_autosize_admin_menu_test($menu)
-{
-global  $lang ;
-    array_push($menu, array('NAME' => 'Autosize',
-      'URL' => get_admin_plugin_menu_link(AUTOSIZE_PATH . 'admin/admin_autosize.php')));
-    return $menu;
-}
-//===================================================================
-function cl_autosize_aff_infos_plus()
-{
- global $template,$infos_message,$erreur_message, $user ;
-global  $conf,$lang ;
-
- //==============================================================
-  if (isset($erreur_message))
-		{	
-		if ($erreur_message <> "")
-			{
-			    $erreur_message=str_replace("\n",'<br />',$erreur_message) ;
-   				$template->assign('errors',$erreur_message);
-				$erreur_message="";
-			}
-  		}
-  if (isset($infos_message))
-		{	
-		
-		if ($infos_message <> "")
-			{
-				$infos_message=str_replace("\n",'<br />',$infos_message) ;
-   				$template->assign('infos',$infos_message);
-				$infos_message="";
-			}
-  		}
-		//=============================================================
-return;		 
-		
-}
-
-//===================================================================================
-function cl_autosize_Get_Options()
-  {
-  global $conf,$autosize_parametres; 
-  
-       $autosize_parametres =  unserialize($conf['cl_autosize']);
-      $autosize_parametres =  cl_autosize_Set_Options();
-      return $autosize_parametres;
-  }
-  //===============================================================================
-function cl_autosize_Set_Options()
-  {
-  global $autosize_parametres;
-//=============================================================================
-$autosize_parametres->webmaster_height =(isset($_POST['webmaster_height'])) ? $_POST['webmaster_height'] : ((isset($autosize_parametres->webmaster_height )) ? $autosize_parametres->webmaster_height : '100%' ) ;
-$autosize_parametres->webmaster_width=(isset($_POST['webmaster_width']))? $_POST['webmaster_width']: ((isset($autosize_parametres->webmaster_width)) ? $autosize_parametres->webmaster_width:  '90%') ;
-
-$autosize_parametres->admin_height =(isset($_POST['admin_height'])) ? $_POST['admin_height'] : ((isset($autosize_parametres->admin_height )) ? $autosize_parametres->admin_height : '90%' ) ;
-$autosize_parametres->admin_width=(isset($_POST['admin_width']))? $_POST['admin_width']: ((isset($autosize_parametres->admin_width)) ? $autosize_parametres->admin_width:  '90%') ;
-
-$autosize_parametres->generic_height =(isset($_POST['generic_height'])) ? $_POST['generic_height'] : ((isset($autosize_parametres->generic_height )) ? $autosize_parametres->generic_height : '100%' ) ;
-$autosize_parametres->generic_width=(isset($_POST['generic_width']))? $_POST['generic_width']: ((isset($autosize_parametres->generic_width)) ? $autosize_parametres->generic_width:  '90%') ;
-
-$autosize_parametres->guest_height =(isset($_POST['guest_height'])) ? $_POST['guest_height'] : ((isset($autosize_parametres->guest_height )) ? $autosize_parametres->guest_height : '100%' ) ;
-$autosize_parametres->guest_width=(isset($_POST['guest_width']))? $_POST['guest_width']: ((isset($autosize_parametres->guest_width)) ? $autosize_parametres->guest_width:  '90%') ;
-
-$autosize_parametres->normal_height =(isset($_POST['normal_height'])) ? $_POST['normal_height'] : ((isset($autosize_parametres->normal_height )) ? $autosize_parametres->normal_height : '100%' ) ;
-$autosize_parametres->normal_width=(isset($_POST['normal_width']))? $_POST['normal_width']: ((isset($autosize_parametres->normal_width)) ? $autosize_parametres->normal_width:  '90%') ;
+ add_event_handler('load_profile_in_template', array(&$autosize_controler,'cl_autosize_script'),50 );
 
 
-$autosize_parametres->mini_height =(isset($_POST['mini_height'])) ? $_POST['mini_height'] : ((isset($autosize_parametres->mini_height )) ? $autosize_parametres->mini_height : '150' ) ;
-$autosize_parametres->mini_width=(isset($_POST['mini_width']))? $_POST['mini_width']: ((isset($autosize_parametres->mini_width)) ? $autosize_parametres->mini_width:  '300') ;
-
-$autosize_parametres->echelle_max=(isset($_POST['echelle_max']))? $_POST['echelle_max'] : ((isset($autosize_parametres->echelle_max)) ? $autosize_parametres->echelle_max :  '1.2'); 
-$autosize_parametres->marge_basse=(isset($_POST['marge_basse']))? $_POST['marge_basse']: ((isset($autosize_parametres->marge_basse)) ? $autosize_parametres->marge_basse :  '50');
-//===============================================================================	
-
-if ( isset($_POST['submit'] ) && $_POST['submit'] == l10n('cl_autosize_save') )  {  
-
- 	$autosize_parametres->check_auto_w = isset($_POST['check_auto_w']) ? $_POST['check_auto_w'] : "off" ;
-	 }else{
-   $autosize_parametres->check_auto_w = isset($_POST['check_auto_w']) ? $_POST['check_auto_w'] : ( ( isset($autosize_parametres->check_auto_w) ) ? $autosize_parametres->check_auto_w :   'off') ; ;
-   }
-
-return $autosize_parametres;
-}
-//========================================================================	
-function cl_autosize_sauve_options_inf()
-{
-global $options,$infos_message,$conf,$autosize_parametres  ;
-$infos_message .=l10n("cl_autosize_save_config")."<br>";
- $autosize_parametres=cl_autosize_Set_Options();
-
- if ( isset($autosize_parametres) )
- 	{
- 
-		$query = '
-    		UPDATE '.CONFIG_TABLE.'
-    		SET value="'.addslashes(serialize($autosize_parametres)).'"
-    		WHERE param = "cl_autosize"
-    		LIMIT 1';
- 			pwg_query($query);
-	  }
-	 
- }
- //=======================================================================
- add_event_handler('loc_end_section_init', 'cl_autosize_script', 60 );
-  
- 
-function cl_autosize_script()
-{
-    $my_path = dirname(__FILE__).'/';
-
-   global  $template;
-  
-    $template->set_filenames(
-        array('autosize_cl_init'=> $my_path.'template/cl_conflit.tpl')
-    );
-  	$template->assign(
-  					array(
-                    'AUTOSIZE_PATH' => AUTOSIZE_PATH
-                                        )
-                     );
-       return $template->parse( 'autosize_cl_init', false);
-       
-}
 
 ?>
Index: /extensions/Autosize/maintain.inc.php
===================================================================
--- /extensions/Autosize/maintain.inc.php	(revision 7192)
+++ /extensions/Autosize/maintain.inc.php	(revision 7193)
@@ -24,6 +24,5 @@
  if (!defined('AUTOSIZE_PATH')) 
 define(
-  'AUTOSIZE_PATH',
-   PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'
+  'AUTOSIZE_PATH', PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'
 );
  
Index: /extensions/Autosize/template/autosize.tpl
===================================================================
--- /extensions/Autosize/template/autosize.tpl	(revision 7192)
+++ /extensions/Autosize/template/autosize.tpl	(revision 7193)
@@ -1,7 +1,8 @@
  {* $Id: autosize/template/picture.tpl  *}
  <!-- autosize/template/picture.tpl  -->   
- 
+
   {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"}
+   {known_script id="dimensions" src=$AUTOSIZE_PATH|@cat:"js/jquery.dimensions.min.js"}
 {*jQuery is always available by default*} 
  <script type="text/javascript">
@@ -34,9 +35,6 @@
     var check_auto_w = '{$check_auto_w}';
      </script>
-    <style type="text/css">
-         #theImage p{ldelim}
-  height:auto;
-}
-     </style>
+
+
 
  <!--  << autosize/template/picture.tpl   --> 
Index: /extensions/Autosize/template/cl_conflit.tpl
===================================================================
--- /extensions/Autosize/template/cl_conflit.tpl	(revision 7192)
+++ /extensions/Autosize/template/cl_conflit.tpl	(revision 7193)
@@ -14,2 +14,5 @@
 <!---FIN auto/cl_confilt.tpl (before) --->	
 {/html_head} 
+ 
+
+    
Index: /extensions/Autosize/template/picture.tpl
===================================================================
--- /extensions/Autosize/template/picture.tpl	(revision 7192)
+++ /extensions/Autosize/template/picture.tpl	(revision 7193)
@@ -1,30 +1,25 @@
- <a><input id="bp_cla" 
-    type="image" 
-    style=" float:right;border:0px;"
-    src="{$cl_autosize_button.ICON}" 
-    onclick = " Toggle_bp()  "  
+ <style type="text/css">
+         #bp_cla {ldelim}
+  cursor:pointer;
+}
+navThumb{ldelim}
+    height:auto
+}
+body{ldelim} overflow:visible; overflow-x:visible; overflow-y:visible
+}
+     </style>
+ <a onclick = "Toggle_bp()"  id="bp_cla" 
     title="{'cl_autosize_info_2'|@translate}"
     alt="{'cl_autosize_info_2'|@translate}" />
- </a> 
+    <img class="button" id="bp_img_cla" alt="{'cl_autosize_info_2'|@translate}"  src="{$cl_autosize_button.ICON}"  complete="complete"/>
+  </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 src1="{$cl_autosize_button.ICON}";
+ var src2="{$cl_autosize_button.ICON2}";
+ var src3="{'cl_autosize_info_2'|@translate}";
+ var src4="{'cl_autosize_info'|@translate}";
 
- function Toggle_bp()
- {ldelim}
- visible = !visible ;
-   if (visible) src=src1 ;
-  else src=src2 ;
-     if (visible)  src_info=src3 ;
-  else src_info=src4 ;
 
-    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>
  
