Index: /extensions/Autosize/autosize.inc.php
===================================================================
--- /extensions/Autosize/autosize.inc.php	(revision 11960)
+++ /extensions/Autosize/autosize.inc.php	(revision 11961)
@@ -91,4 +91,22 @@
  			if ($ma_page=='thePiwiShackControllerPage') return ;
 			
+$img_width=isset($picture['current']['width'])?$picture['current']['width']:480;
+$img_height=isset($picture['current']['height'])?$picture['current']['height']:320;
+
+$img_scaled_width=isset($picture['current']['scaled_width'])?$picture['current']['scaled_width']:480;
+$img_scaled_height=isset($picture['current']['scaled_height'])?$picture['current']['scaled_height']:320;
+$src_img_h=isset($_POST['src_img_h'])?$_POST['src_img_h']: $img_width               ;
+$src_img_w= isset($_POST['src_img_w'])?$_POST['src_img_w']:$img_height              ;
+$window_height= isset($_POST['window_height'])?$_POST['window_height']: $img_scaled_height ;
+$window_width= isset($_POST['window_width'])?$_POST['window_width']: $img_scaled_width    ;
+
+
+$size=array(
+            'src_img_h' => $src_img_h,
+            'src_img_w' => $src_img_w,
+            'window_height' =>$window_height,
+            'window_width' => $window_width
+          );
+
 			$template->assign(
   					array(
@@ -99,5 +117,7 @@
 					'theme' => $theme  ,
 					'DEBUG_autosize' => $DEBUG_autosize   ,
-					'AUTOSIZE_PATH' => AUTOSIZE_PATH
+					'AUTOSIZE_PATH' => AUTOSIZE_PATH,
+          'Size' => $size
+
 					)
 						);
@@ -109,10 +129,5 @@
 			</script>";
           
-            $autoscript .="<input id='ret_autosize'  type='hidden' value='' />";
-            $autoscript .="<input id='src_img_h'  type='hidden' value='' />";
-            $autoscript .="<input id='src_img_w'   type='hidden' value='' />";
-            $autoscript .="<input id='window_height'  type='hidden' value='' />";
-            $autoscript .="<input id='window_width'   type='hidden' value='' />";
-             $autoscript .='<div id="Debug6"  align=center style="display:none"></div>';
+
 		$template->append('footer_elements',$autoscript);  
 		return ; 
@@ -237,4 +252,5 @@
 	static public function cl_ajuste_data($content){
 		global  $template,$user,$conf,$picture ;
+      global $size;
 		$AUTOSIZE_PATH = realpath(AUTOSIZE_PATH .'/');
 		$userdata=$user;
@@ -245,6 +261,6 @@
 	 return $content;
 
-		$data['maxwidth'] = '1200';
-		$data['maxheight'] ='250';
+		$data['maxwidth'] = $size['src_img_w'];
+		$data['maxheight'] =$size['src_img_h'];
 		$data['user_id'] = $userdata['id'];
 		foreach ($fields as $field)
@@ -268,14 +284,85 @@
 		 }
 
+
+/****************************************
+*
+****************************************/
+function Get_Options(&$parametres,$str_index){
+    global $conf ;
+    $m_options=  $conf[$str_index];
+     if(isset($m_options))
+       if ( preg_match("|s:(.*)|", $m_options, $val) )
+        $parametres =  unserialize($conf[$str_index]);
+       else{
+         $parametres=explode(",",$_options);
+        }     
+        //====== par defaut =======================
+         $new_val=false;
+         $def_para=Array();
+
+    $def_para['query'] = 'Qt'  ;
+    $def_para['type'] = 'Ty' ;
+    $def_para['webmaster_height'] = '100%' ;
+    $def_para['webmaster_width'] = '100%' ;
+    $def_para['admin_height'] = '100%'  ;
+    $def_para['admin_width'] =  '100%' ;
+    $def_para['generic_height'] = '100%'  ;
+    $def_para['generic_width'] =  '100%' ;
+
+    $def_para['guest_height'] = '100%'  ;
+    $def_para['guest_width'] =  '100%' ;
+
+    $def_para['normal_height']  =  '100%'  ;
+    $def_para['normal_width'] =  '100%' ;
+
+
+    $def_para['mini_height'] =  '150' ;
+    $def_para['mini_width'] = '300' ;
+
+    $def_para['mini_height2'] =  '150' ;
+    $def_para['mini_width2'] =   '300' ;
+
+    $def_para['echelle_max'] =  '1.0'; 
+    $def_para['marge_basse'] =  '0';
+    $def_para['fade_in'] =   '0';
+    //==================================================
+    $def_para['check_desc_v'] =  "off" ;
+    $def_para['check_icon_v'] =  "off" ;
+    $def_para['check_auto_w'] =   "off" ;
+    $def_para['webmaster_enabled'] =   "off" ;
+    $def_para['admin_enabled'] =   "off" ;
+    $def_para['generic_enabled'] =   "off" ;
+    $def_para['guest_enabled'] =   "off" ;
+    $def_para['normal_enabled'] =   "off" ;
+    //===================================================
+   $para=$def_para;   
+    foreach ($para as $key => $value) {   
+      if( isset($parametres->$key) ){
+         $value=$parametres->$key;         
+      } 
+    if($def_para[$key] =="on" ||$def_para[$key] =="off" ){
+       $val_pg=(isset($_POST[$key]))? ($_POST[$key]=="off"||$_POST[$key]=="on")?$_POST[$key]:"on" : "off" ;
+       $value =(isset($_POST[$key]))? $val_pg : $value ; 
+       $val_pg=(isset($_GET[$key]))? ($_GET[$key]=="off"||$_GET[$key]=="on")?$_GET[$key]:"on" : "off" ;
+       $value =(isset($_GET[$key]))? $val_pg  : $value ;  
+     }else{
+        $value =(isset($_POST[$key]))? $_POST[$key] : $value ; 
+        $value =(isset($_GET[$key]))? $_GET[$key] : $value ;  
+      }
+        unset( $parametres->$key) ;
+        $parametres->$key = $value ;            
+     }   
+    return $parametres ;
+  }
 } // class
 
-
-	/*
+/*************************************
 	*
-	*/
+ *************************************/
  function cl_autosize_Get_Options()
   {
 		global $conf,$autosize_parametres; 
   		$autosize_parametres =  unserialize($conf['cl_autosize']);
+      // $autosize_parametres = autosize_controler::Get_Options($autosize_parametres,'cl_autosize');
 		$autosize_parametres =  cl_autosize_Set_Options();
 		return $autosize_parametres;
@@ -284,10 +371,9 @@
 	*
 	*/
-function cl_autosize_Set_Options()
-  {
-
+function cl_autosize_Set_Options() {
   global $autosize_parametres;
 //=============================================================================
 $my_para=$autosize_parametres;
+
 
 $my_para->query =(isset($_POST['query'])) ? $_POST['query'] : ((isset($my_para->query )) ? $my_para->query : 'Qt' ) ;
Index: /extensions/Autosize/css/autosize.css
===================================================================
--- /extensions/Autosize/css/autosize.css	(revision 11960)
+++ /extensions/Autosize/css/autosize.css	(revision 11961)
@@ -62,2 +62,27 @@
 }
 
+#_Comment{
+ 
+}
+#_Comment2{
+ 
+}
+#charlie div div{
+ 
+}
+#charlie div { 
+ 
+}
+#charlie a h1 {
+}
+#charlie {
+
+}
+#form_autosize_picture {
+ 
+  z-index: 0;
+  display: none;
+  visibility: hidden;
+}
+.Image {
+}
Index: /extensions/Autosize/include/affiche.php
===================================================================
--- /extensions/Autosize/include/affiche.php	(revision 11960)
+++ /extensions/Autosize/include/affiche.php	(revision 11961)
@@ -1,13 +1,11 @@
 <?php  
 $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;
-
-$img_scaled_width=isset($picture['current']['scaled_width'])?$picture['current']['scaled_width']:480;
-$img_scaled_height=isset($picture['current']['scaled_height'])?$picture['current']['scaled_height']:320;
 
 $cl_version=isset($cl_version)?$cl_version:"";
 $cl_plugin=isset($cl_plugin)?$cl_plugin:"";
-$cl_visible=isset($conf['cl_auto']) ? $conf['cl_auto'] : 'true' ; 
+$cl_visible=isset($conf['cl_auto']) ? $conf['cl_auto'] : 
+(isset($_GET['cl_visible'])?$_GET['cl_visible']:'true')
+
+ ; 
 //=================================================================================================
 $DEBUG_autosize = isset($_POST['cl_debug_conflit']) ? $_POST['cl_debug_conflit'] : "false" ;
@@ -15,4 +13,22 @@
 $DEBUG_autosize = isset($conf['cl_debug_conflit']) ? $conf['cl_debug_conflit'] : $DEBUG_autosize ; 
 //=================================================================================================
+
+$img_width=isset($picture['current']['width'])?$picture['current']['width']:"480";
+$img_height=isset($picture['current']['height'])?$picture['current']['height']:"320";
+$img_scaled_width=isset($picture['current']['scaled_width'])?$picture['current']['scaled_width']:"480";
+$img_scaled_height=isset($picture['current']['scaled_height'])?$picture['current']['scaled_height']:"320";
+
+$src_img_h=isset($_POST['src_img_h'])?$_POST['src_img_h']: $img_height            ;
+$src_img_w= isset($_POST['src_img_w'])?$_POST['src_img_w']:  $img_width               ;
+$window_height= isset($_POST['window_height'])?$_POST['window_height']: $img_scaled_height ;
+$window_width= isset($_POST['window_width'])?$_POST['window_width']: $img_scaled_width    ;
+global $size ;
+$size=	array(
+            'src_img_h' => $src_img_h,
+            'src_img_w' => $src_img_w,
+            'window_height' =>$window_height,
+            'window_width' => $window_width
+          );
+
   $my_path = AUTOSIZE_PATH_ABS;
   $theme=$user['theme'];
@@ -77,5 +93,7 @@
             'normal_enabled' => ($autosize_parametres->normal_enabled == 'on') ? 'checked="checked"'  : '' ,
 
-            'user_status'   => get_user_status($user_status)  
+            'user_status'   => get_user_status($user_status)  ,
+'Size' => $size 
+          
 					
 				 )
Index: /extensions/Autosize/js/Affiche_script.js
===================================================================
--- /extensions/Autosize/js/Affiche_script.js	(revision 11960)
+++ /extensions/Autosize/js/Affiche_script.js	(revision 11961)
@@ -2,4 +2,11 @@
 function Toggle_bp() {
     cl_visible = !cl_visible;
+  set_cl();
+  jQuery().newResize();
+  Wait_Affichage();
+}
+  function set_cl(){
+  if (typeof cl_visible == "undefined") return;
+
     if (cl_visible) src = src1;
     else src = src2;
@@ -10,10 +17,16 @@
     jQuery('#bp_cla').attr('title', src_info);
 
-    jQuery('#bp_img_cla').get(0).src = src;
+    jQuery('#bp_cla').attr('Stitle', src_info);
+    jQuery('#bp_cla').attr('Stip', " ");
+
+    bp_scr = jQuery('#bp_img_cla');
+
+    if (bp_scr.length > 0) {
+      bp_scr.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', " ");
-    jQuery().newResize();
+    }
+
+   
 
 }
@@ -53,11 +66,18 @@
 //==========================================================================
 function Wait_Affichage() {
+  href = location.href;
+
+  jQuery.post(href, function (data) { });
+   // alert("Data Loaded: " + data);  
+  if (typeof fade_in == "undefined") fade_in = 1000;
     fade_in = parseInt(fade_in);
+    /*
     if (!jQuery().newResize()) {
         setTimeout("Wait_Affichage()", 500);
         return
     }
+    */
     nu_img++;
-
+  if (typeof fade_in == "undefined") fade_in = 0;
     if (fade_in == 0) {
         jQuery(Parent).css({ opacity: "1" });
@@ -78,10 +98,14 @@
     }
     //   if (nu_img > 1) return;
-
-
+  if (typeof theImg == "undefined") return true;
+  if (theImg == null) return;
+
+  if (jQuery(theImg).length > 0) {
+
+
+ stb.stop().fadeTo(3500, 0);
 
     img_h = jQuery(theImg).height();
     img_w = jQuery(theImg).width();
-
     jQuery("#src_img_h").val(img_h);
     jQuery("#src_img_w").val(img_w);
@@ -101,14 +125,12 @@
         window_width: Window_Affichage.width
     });
-
-
+  }
+ 
 }
 
 //=====================================================================
-
+    old_window = { width: 0, height: 0 };
 List_autosize = new Array();
 function Autosize_resize(Obj) {
-    if (typeof cl_visible != "undefined") return;
-
 
     conf = jQuery(Obj).get(0).conf;
@@ -127,5 +149,4 @@
             conf.MargeHaute
     );
-
     info_Obj = jQuery(Obj).infos();
     h1_left = jQuery(Obj).absoluteLeft();
@@ -136,14 +157,10 @@
     else
         h1 = (myWindow.height - marge_basse);
-
-
     rap = info_Obj.height / info_Obj.width;
     w2 = parseInt(h1 / rap);
-
     if (w2 < info_Obj.width)
         marginLeft = info_Obj.left + parseInt((info_Obj.width - w2) / 2) + "px";
     else
         marginLeft = "auto";
-
     jQuery(Obj).css({ width: "auto", marginTop: marge_top,
         marginLeft: "auto", marginBottom: 0 + "px",
@@ -151,39 +168,74 @@
     });
     jQuery(Obj).height(h1);
-
     //=============================================================
-    if (conf.ResizePicture != "true") {
-
-    } else
-        imgs = jQuery(Obj).find("img");
+  if (conf.ResizePicture == "true")
+    imgs = jQuery(Obj).find("img");
+  else
+    imgs = jQuery(Obj).find("img");
+  Parent = Obj;
+
     Obj_w = jQuery(Obj).width();
     Obj_h = jQuery(Obj).height();
-
+  if (imgs.length>0) {
     jQuery(imgs).each(function (i) {
         img = jQuery(this);
-
-        info_img = { width: conf.width[i], height: conf.height[i] };
+      h1_top = jQuery(img).absoluteTop() - h1_top; 
+      h1_bottom =  Obj_h  - h1_top;
+      info_img = { width: conf.width[i], height: conf.height[i] }; //origine 
         img_rap = conf.rap[i];
-
         if (info_img.width > Obj_w) h1 = parseInt(Obj_w / img_rap);
-        else w2 = parseInt(Obj_h * img_rap);
+      h1 -= h1_top;
+      if (h1 > Obj_h - h1_top) {
+        h1 = Obj_h-h1_top;        
+      }
+      w2 = parseInt(h1 * img_rap);
         if (w2 > 0 && h1 > 0 && img.length > 0) {
             img.height(h1);
             img.width(w2);
         }
-
     });
-
-
-
+  }else{
+  imgs = jQuery(Obj).children();
+  jQuery(imgs).each(function (i) {  
+    if (this.height > 0) {
+      h1_top = jQuery(this).absoluteTop() - h1_top;
+      h1_bottom = Obj_h - h1_top;
+      info_img = { width: conf.width[i], height: conf.height[i] }; //origine 
+      img_rap = conf.rap[i];
+      if (info_img.width > Obj_w) h1 = parseInt(Obj_w / img_rap);
+      h1 -= h1_top;
+      if (h1 > Obj_h - h1_top) {
+        h1 = Obj_h - h1_top;
+      }
+      w2 = parseInt(h1 * img_rap);
+      if (w2 > Obj_w ) {
+        w2 = Obj_w;
+      }
+
+      if (w2 > 0 && h1 > 0 ) {
+        this.height=(h1);
+        this.width=(w2);
+      }
+
+    }
+    name = this.name;
+    });
+
+
+
+  }
 
 }
+    //===============================================
+// Extend expression
+    //===============================================
 jQuery.extend(jQuery.expr[':'], {
     // Nom du sélecteur personnalisé
     Autosize: function (a) {
+    nd = a.nodeName;
         n1 = a.className;
         // personal_block
         if (n1.match(RegExp("autosize", "gi"))) {
-            //   autoresize = "MargeBasse:30px; ResizePicture:false"
+      //   autosize = "MargeBasse:30px; ResizePicture:false"
             infconf = jQuery(a).attr("autosize");
             n1 = typeof infconf;
@@ -201,4 +253,5 @@
                 width = new Array();
                 height = new Array();
+        if (imgs.length > 0)
                 jQuery(imgs).each(function (i) {
                     img = jQuery(this);
@@ -207,4 +260,17 @@
                     height.push(img.height());
                 });
+        else {
+          imgs = jQuery(a).children();
+          jQuery(imgs).each(function (i) {
+            if (this.height>0) {
+              rap.push(this.width / this.height);
+              width.push(this.width);
+              height.push(this.height);
+            }
+            name = this.name;
+
+
+          });
+        }
 
                 conf['rap'] = rap;
@@ -213,14 +279,94 @@
 
                 List_autosize.push({ obj: a, conf: conf });
-                jQuery(a).css({ opacity: 1 });
+        jQuery(a).css({ opacity:0 });
             }
         }
         //  Css = jQuery(a).getStyles(a);
-
         return false;
 
+    },
+    Set_Class: function (a) {
+    nd = a.nodeName;
+    if (nd == "DIV") {
+    XBrowserAddHandler(a,'onpropertychange', onPropertyChange);
+    //jQuery(a).find("img:nth-child(1)").css("border","Solid 5px green");
+    img = jQuery(a).children("img");
+    if (img.length == 0) img = jQuery(a).find("a").children("img");
+    if (img.length > 0)
+    if (img.length == 1) {
+    if (img[0].src.match(RegExp(".png", "g")))
+    return;
+   // img[0].attachEvent('onpropertychange', onPropertyChange);
+    XBrowserAddHandler(img[0],'onpropertychange', onPropertyChange);
+    jQuery(img).addClass("Image");
+    //jQuery(img).attr("autosize", "MargeBasse:0px; ResizePicture:true");
+    }
+    }
     }
 });
-
+function XBrowserAddHandler(target,eventName,handlerName){
+      if ( target.addEventListener )
+          target.addEventListener(eventName, handlerName, false);
+      else if ( target.attachEvent )
+          target.attachEvent("on" + eventName, handlerName);
+       else
+          target["on" + eventName] = handlerName;
+ }
+/*
+ var y = 3; 
+ var txtTestBox = document.getElementById('testBox');
+ XBrowserAddHandler(txtTestBox, 'keyup', function() {
+  myFunctionRef(y) 
+  });
+ var myFunctionRef = function myFunction(x, e) {
+ var keyCode; 
+ if (!e && window.event)
+ e = window.event; 
+ if (e)
+ keyCode = (window.Event) ? e.which : e.keyCode; 
+ alert('You pressed: ' + keyCode + '. Event object is :' + e + '. x is: ' + x);
+ }
+*/
+function onPropertyChange(e) {
+    var el = e.srcElement;
+    attributs = el.attributes;
+    if (attributs.id) id = attributs.id.value;
+    if (attributs.style) style = attributs.style.value;
+    /* Image */
+    if (attributs.src) {
+      src = attributs.src.value;
+      if (attributs.width) width = attributs.width.value;
+      if (attributs.height) height = attributs.height.value;
+    }
+         switch (e.propertyName) {
+           case "style.opacity":
+
+             break;
+           case "style.transform":
+             
+             break;
+           case "style.display":
+            
+             break;
+           case "style.color":
+
+             break;
+           case "style.width":
+            width= el.style.width;
+             break;
+           case "style.height":
+             height = el.style.height;
+             break;
+
+           case 'width':
+ 
+             break;
+           case 'height':
+
+             el.style.height = el.attributes.height.nodeValue + 'px';
+             el.firstChild.style.height = el.clientHeight + 'px';
+             break;
+         }
+       }
 
 function List_autosize_resize(event, ui) {
@@ -234,4 +380,5 @@
     }
     wait_resize = false;
+    return true;
 
 }
@@ -240,14 +387,17 @@
      function (jQuery) {
        jQuery(':Autosize');
-
        jQuery(window).unload(function () {
          try {
-           if (theImg) {
+           if (typeof theImg != "undefined") {
              jQuery.cookie('img', theImg.src); // créer un cookie avec une valeur
+
              jQuery.cookie('img_h', jQuery(theImg).height());
              jQuery.cookie('img_w', jQuery(theImg).width());
+
+             if (typeof Window_Affichage != "undefined") {
              jQuery.cookie('window_height', Window_Affichage.height);
              jQuery.cookie('window_width', Window_Affichage.width);
            }
+           }
          } catch (r) {
 
@@ -256,16 +406,15 @@
        });
 
-
-
+       /********************************************
+       *  window LOAD
+       ********************************************/
        jQuery(window).load(function () {
+         jQuery(':Set_Class');
          if (typeof img_width == "undefined") {
            if (List_autosize.length == 0) return;
-           for (i = 0; i < List_autosize.length; i++) {
-             Autosize_resize(jQuery(List_autosize[i]));
-           }
-           return;
+           wait_resize = false;
+           if (List_autosize_resize()) Wait_Affichage();
+           return true;
          }
-
-
          //=========================================================
          if (typeof (options) == "undefined") {
@@ -303,5 +452,5 @@
 
          Parent = "#theImage";
-
+         var info_theImage = jQuery(Parent).infos();
          Zone_Affichage = jQuery(Parent).infos();
          //
@@ -314,18 +463,9 @@
          if (typeof Bandeau_bas != "undefined") Bandeau = Bandeau_bas.top;
          else Bandeau = 0;
-         old_window = { width: 0, height: 0 };
-         jQuery("#theImage").trigger('ON');
 
          old_window = { width: 0, height: 0 };
          jQuery().newResize();
-
-         //===================================================================
-         /*
-         * window .resize
-         */
-         jQuery(window).resize(
-               function (event, ui) {
-                 jQuery().newResize();
-               });
+         jQuery("#theImage").trigger('ON');
+
 
          //============== initialisation ===================
@@ -337,18 +477,19 @@
        }); // window.onload
 
-       /* Extension
-       * affiche_debug
-
-       * resize
-       * :
-       */
-       //=========================================================
+
+       /***********************************************************
+       *  RESIZE 
+       ***********************************************************/
        old_window = { width: 0, height: 0 };
        jQuery(window).resize(
                function (event, ui) {
                  List_autosize_resize(event, ui);
-                 jQuery().newResize();
+                 if (jQuery().newResize())
+                   Wait_Affichage();
                });
 
+       /************************************
+       * Extend 
+       ************************************/
        jQuery.fn.extend({
          //==========================================================
@@ -359,6 +500,6 @@
          //=============================================================
          onPropertyChange: function (e) {
+
            return;
-
 
          },
@@ -376,5 +517,6 @@
          newResize: function () {
            //
-          if (typeof options != undefined)
+           set_cl();
+           if (typeof options != "undefined")
              if (options.imageAutosize)
                return true; //stripped
@@ -388,5 +530,5 @@
              jQuery(bp1).trigger('ON');
            }
-           if (typeof cl_visible == "undefined") return;
+           if (typeof cl_visible == "undefined") return true;
            if (!cl_visible == true) { return true; }
            var chk = eval(user_status + "_enabled");
@@ -407,8 +549,7 @@
 
            jQuery(Parent).width(winwidth);
-           //  jQuery(Parent).height(winheight);
 
            var Cadre = jQuery(Parent).get(0);
-           var info_theImage = jQuery(Cadre).infos();
+       
            //===============  Information cadre ======
            var info_the_page = jQuery("#the_page").infos();
@@ -425,4 +566,29 @@
            var marge_right = 0;
            var marge_left = 0;
+
+           var Licence = jQuery(".licencetag");
+           info_Licence = jQuery(".licencetag").infos();
+
+           if (typeof Type_Img == 'undefined') {
+
+           }
+
+
+           // jQuery(".licencetag").addClass('imageComment');
+
+           hd_click = jQuery("#theImage a[href]");
+           if (hd_click.length > 0) {
+             hd_click = hd_click[0];
+             if (hd_click.href.match(RegExp("phpWGOpenWindow", "gi"))) {
+
+               hd_click = jQuery("#theImage p");
+               jQuery(hd_click).addClass('imageComment');
+               jQuery(hd_click).wrapAll('<div id="_Comment2"  />');
+             }
+           }
+
+           if(jQuery('#_Comment, ').length==0)
+             jQuery('.imageComment, ').wrapAll('<div id="_Comment"  />');
+
            if (theme.match(RegExp("simple", "g"))) {
              if (info_ToolBar.width > 0)
@@ -463,11 +629,4 @@
            marge_left += Zone_Affichage.borderwidth.left;
            winwidth -= (marge_right + marge_left);
-           //---------------------------------------------
-           /*
-           jQuery(Parent).width(winwidth); // 1.6.2
-           jQuery(Parent).css({ height: "auto" }); //1.6.2
-           */
-           //  jQuery(Parent).height(Zone_Affichage.height);
-           //---------------------------------------------
 
            if (Type_Img == "pamoorama") {
@@ -525,12 +684,18 @@
 
              case "panorama":
-               //  return;
+               //  return true;
 
                //the theMainImage ??
+               if (!theImg) {
                theImg = jQuery("#theMainImage");
+               if (theImg.length > 0)
+                 return;
+               theImg = jQuery().Get_Img_Maxi("#Panorama img[alt]");
+                 // return;
                if (theImg.length > 0)
                  theImg = theImg[0];
                else
                  theImg = jQuery().Get_Img_Maxi("#Panorama img[alt]");
+               }
                info_theImage = jQuery(theImg).infos();
                info_the_page = jQuery("#the_page").infos();
@@ -589,5 +754,4 @@
                  img_reelle.width = parseInt(info_img.width);
                }
-
                break
              case "pamoorama":
@@ -693,5 +857,5 @@
            info_Licence = jQuery(".licencetag").infos();
 
-           jQuery(Parent + " #theImg IMG").css("marginTop", "0px")
+           jQuery(Parent + " #theImg IMG").css("marginTop", "0px");
            //========== Correction en fonction du thème =============================
            var correction = 0;
@@ -725,5 +889,4 @@
 
            h = (Zone_Affichage.padding.bottom + Zone_Affichage.padding.top + Zone_Affichage.margin.top + Zone_Affichage.margin.bottom);
-
            if (typeof Bandeau_t != "undefined") Bandeau = Bandeau_t.img_top|0;
            Zone_Affichage.height = winheight - Bandeau - Marge_Basse - correction - h;
@@ -735,5 +898,5 @@
            //=========================================================================
            if (typeof (Bandeau_bas) != "undefined") {            
-              Zone_Affichage.height -= (Bandeau_bas.height + Bandeau_bas.marge.top|0 + Bandeau_bas.marge.bottom|0);
+             if (Bandeau_bas.height < Zone_Affichage.height) Zone_Affichage.height -= (Bandeau_bas.height + Bandeau_bas.marge.top + Bandeau_bas.marge.bottom);
                         } else {
            }
@@ -833,6 +996,4 @@
              }
              if (theImg.src) {
-
-
                wingbo = img_finale.width;
                heightgbo = img_finale.height;
@@ -901,5 +1062,5 @@
                  jQuery("area[rel=next]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" });
                }
-               jQuery("#theImage").height(heightgbo + marges_llgbo / 2);
+               //    jQuery("#theImage").height(heightgbo + marges_llgbo / 2);
              }
            }
@@ -916,10 +1077,5 @@
            img_finale.width = parseInt(img_finale.width);
            //=========================================================================
-           if (jQuery("#slideshow").infos().width > 0) {
-
-
-           } else {
-
-           }
+
            //=== cadre = theImage
            jQuery(Cadre).css({ marginLeft: "auto" });
@@ -930,5 +1086,5 @@
              img_finale.height = info_theImage.height;
              Zone_Affichage.height = img_finale.height;
-             jQuery(Cadre).height(Zone_Affichage.height);
+
            }
 
@@ -973,4 +1129,11 @@
              jQuery("#embedplayer").css("height", img_finale.height);
 
+             jQuery("embed").css("height", img_finale.height);
+
+             jQuery("video").height(img_finale.height);
+             jQuery("video").width(img_finale.width);
+
+             jQuery("video").css({ height: img_finale.height+"px" });
+             jQuery("object").css({ height: img_finale.height+"px" });
 
              jQuery("object").width(img_finale.width);
@@ -981,25 +1144,18 @@
 
              jQuery(Cadre).css("height", "auto");  
+           } else if (Type_Img == "embed") {
+
+             jQuery(Cadre).css("height", "auto");
+             jQuery("embed").css("height", img_finale.height);
+             jQuery("object").css({ height: img_finale.height + "px" });
+
+             jQuery("object").width(img_finale.width);
+             jQuery("object").height(img_finale.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);
-             //  n = jQuery.fn.panorama();
-             // jQuery("#Panorama div").height(img_finale.height);
-             //  class=simple_panorama
-             // jQuery("#Panorama div").height(img_finale.height);
              if (typeof asp_options != "undefined")
                n = asp_options;
              n1 = jQuery("#Panorama div").width();
-             // asp_options.viewport_width = winwidth;
-             //n =n.panorama_animate();
-             //jQuery("#panoramaContainer").stop(); ;
-             // n = jQuery(theImg).panorama(asp_options);
-
-             //jQuery("#Panorama div").width(asp_options.viewport_width);
-
              jQuery(".panorama-viewport").css("margin", "auto");
-
              n = info_imageToolBar;
 
@@ -1059,5 +1215,4 @@
              info_frame = jQuery(myPamoorama.frame).infos();
 
-             zoom = img_finale.height / img_height;
 
 
@@ -1073,8 +1228,4 @@
            } else {
              //===map ? luciano ===
-
-        // jQuery(Cadre).height(Zone_Affichage.height + Bandeau_bas.height); //??
-              //     jQuery(Cadre).height(img_finale.height + Bandeau_bas.height); //??
-         jQuery(Cadre).css("height","auto"); //??
              jQuery(theImg).height(img_finale.height);
              jQuery(theImg).width(img_finale.width);
@@ -1149,4 +1300,10 @@
 
            }
+           zoom = img_finale.height / img_height;
+
+           zoom = parseInt(zoom * 100);
+           jQuery('#zoom ').val(zoom);
+           jQuery('#bp_cla').text(zoom + "%");
+
            //  --- réglage de la hauteur de page en fonction du copyright-----------
            if (typeof (pos_copyright) == "undefined") pos_copyright = jQuery("#copyright").infos();
@@ -1156,7 +1313,5 @@
              if (TitleBox.length != 0) TitleBox.css("width", img_finale.width + "px");
            } else {
-             if (pos_copyright.top > 100) {
-               // jQuery("#the_page").height(pos_copyright.top);
-             }
+
            }
 
@@ -1171,5 +1326,4 @@
            info_frame = jQuery(Cadre).infos();
            if (theme.match(RegExp("stripped", "gi"))) {
-             pos = "absolute";
              info_theImageBox = jQuery("#theImageAndTitle").infos();
              p1 = jQuery(".randomButtons").infos();
@@ -1216,9 +1370,4 @@
 
            return true;
-
-
-
-
-
            //_____________________________________________________
          } // Resize();
@@ -1254,4 +1403,5 @@
                 if (!this.src.match(RegExp(thumbnail, "g"))) {
                     myImg = this;
+           jQuery( myImg).addClass("Image");
                     w00 = w0;
                 }
@@ -1270,5 +1420,5 @@
 
     info_imageToolBar = jQuery("#imageToolBar").infos();
-    if (typeof (marge_top) != "undefined") return info_imageToolBar;
+    if (typeof (marge_top) != "undefined") return result;
 
     if (info_imageToolBar.position == "absolute") {
@@ -1282,15 +1432,10 @@
 
     jQuery("#" + "theImgContainer").css("marginTop", "0px");
+    info_thePicturePage = jQuery("#thePicturePage").infos();
     info_theImage = jQuery(Parent).infos();
-    info_thePicturePage = jQuery("#thePicturePage").infos();
-
-
     if (theme.match(RegExp("stripped", "gi"))) {
-
         info_theImageAndTitle = jQuery("#theImageAndTitle").infos();
         info_theImageBox = jQuery("#theImageBox").infos();
-
         optiontop = (marges_llgbo / 2) + info_theImageAndTitle.margin.top;
-
     }
 
@@ -1317,4 +1462,5 @@
 
     img_top = Math.ceil(info_theImage.top +
+                        info_theImage.padding.top +
                         info_theImage.borderwidth.top +
                         info_thePicturePage.margin.top + optiontop);
@@ -1326,6 +1472,12 @@
     //=== Afficher le titre de l'image sur le cadre ===
     llgboh2 = jQuery("#gboh2").infos();
-    result.img_top += llgboh2.height;
-
+    llgbo = jQuery("#gbo").infos();
+
+    if (llgboh2.top > 0)
+      result.img_top = llgboh2.top - (llgboh2.height * 2);
+    else if (marges_llgbo > 0)
+      result.img_top -= (8);
+
+  
     return result;
 
@@ -1338,11 +1490,17 @@
 //====================================================
 function Info_Description_f(Parent) {
-
-
     jQuery(Parent).css({ display: "block" });
     //====== détection du type d'images ======
     if (jQuery("#charlie").length > 0) {
         Type_Img = "charlie";
-
+      jQuery("#charlie").css({
+        paddingTop: "0px",
+        marginTop: "0px",
+        paddingBottom: "10px",
+        marginBottom: "0px"
+      });
+
+      } else if (jQuery("#Panorama").length) {
+        Type_Img = "panorama";
     } else if (jQuery("#pamoorama").length) {
         Type_Img = "pamoorama";
@@ -1386,7 +1544,7 @@
     }
 
-    Bandeau_t = Info_entete(Parent)
+      Bandeau_t = Info_entete(Parent);
+
     Bandeau = Bandeau_t.img_top;
-
     info_theImgContainer = jQuery("#" + "theImgContainer").infos();
     info_description = jQuery("#" + "description").infos();
@@ -1428,5 +1586,5 @@
 
       } else if (jQuery("#charlie").length > 0) {
-   
+      info_charlie = jQuery("#charlie").infos();
      if (jQuery("object").attr("type") == 'application/x-shockwave-flash') {
           jQuery("#charlie").css({
@@ -1447,9 +1605,11 @@
         info_img = jQuery(theImg).infos();
  
+ 
     } else if (jQuery(Parent + " embed").length > 0) {
 
         theImg = jQuery(Parent + " embed");
+     
         info_img = jQuery(theImg).infos();
-
+           jQuery(Parent + " embed").width({ width: info_img.width+"px", height: info_img.height + "px" });
 
 
@@ -1474,5 +1634,4 @@
         if (theImg.length > 1)
           {theImg = theImg[0];
-
           }
 
@@ -1547,6 +1706,6 @@
           info_description.marge.top = -2;
         }
-        info_description.bottom = info_theImage.bottom;
-        info_description.top = info_img.height + info_theImage.top;
+        info_description.bottom = info_theImage.bottom; //482
+        info_description.top = info_img.height + info_theImage.top ; //410+62
         // info_description.bottom -= info_img.top;
     }
@@ -1640,13 +1799,18 @@
     jQuery('#pamoorama').live('ON', function (e) {
         jQuery(jQuery('.debug').get(1)).trigger('ON');
+    if (typeof Bandeau_bas=="undefined" || Bandeau_bas.width == 0) {
         Bandeau_bas = Info_Description_f(Parent);
         Bandeau = Bandeau_bas.top;
         old_window = { width: 0, height: 0 };
-        Wait_Affichage();
+      jQuery(window).resize();
+
+    }
+
+       // Wait_Affichage();
     });
 
     jQuery(Parent).live('ON', function (e) {
         jQuery(jQuery('.debug').get(1)).trigger('ON');
-        Wait_Affichage();
+    Wait_Affichage();
     });
 
Index: /extensions/Autosize/js/JScript.js
===================================================================
--- /extensions/Autosize/js/JScript.js	(revision 11960)
+++ /extensions/Autosize/js/JScript.js	(revision 11961)
@@ -1,69 +1,97 @@
-﻿jQuery(document).ready(
-function (jQuery) {
-  var stt = jQuery('#scrolltobottom');
-  var stb = jQuery('#scrolltotop');
+﻿function getScrollMaxY() {
+  var innerh;
+  if (window.innerHeight) {
+    innerh = window.innerHeight;
+  } else {
+    innerh = document.body.clientHeight;
+  }
+  if (window.innerHeight && window.scrollMaxY) {
+    // Firefox     
+    yWithScroll = window.innerHeight + window.scrollMaxY;
+  } else if (
+     document.body.scrollHeight > document.body.offsetHeight) {
+    // all but Explorer Mac    
+    yWithScroll = document.body.scrollHeight;
+  } else {
+    // works in Explorer 6 Strict, Mozilla (not FF) and Safari   
+    yWithScroll = document.body.offsetHeight;
+  }
+  return yWithScroll - innerh;
+}
+
+jQuery(document).ready(function (jQuery) {
+  jQuery(window).load(function () {
+    if (jQuery("#scrolltotop").length == 0)
+      jQuery('#scrolltobottom').before('<div id="scrolltotop" ><a title="Revenir en haut de la page" href="#"></a></div>');
+
+  stb = jQuery('#scrolltobottom');
+  stt = jQuery('#scrolltotop');
+  stt.css('opacity', 1 )
+    stb.css('opacity', 1)
+
+    jQuery('#scrolltotop').height(100);
+    jQuery('#scrolltobottom').height(100);
+    jQuery('#scrolltotop').css({
+  });
+  jQuery('#scrolltobottom').css({
+});
+jQuery(window).resize(
+               function (event, ui) {
+                 jQuery(window).scroll();
+               });
+
+               wmax = jQuery("body").height() - jQuery(window).height();
+               scrollTop = jQuery(window).scrollTop();
+               pourcent = (scrollTop / wmax);
+               jQuery(stt).css({ opacity: pourcent });
+               jQuery(stb).css({ opacity: 1 - pourcent });
+           
+//=================================================== 		
+jQuery(window).scroll(function () {
+  maxi = getScrollMaxY();
+  wmax = jQuery("body").height() - jQuery(window).height();
+  scrollTop = jQuery(window).scrollTop();
+    pourcent = (scrollTop / wmax)  ;
 
 
-  stt.css('opacity', 1);
-  var scrollBottom = 0;
+  jQuery(stt).css({ opacity:pourcent });
+  jQuery(stb).css({ opacity:  1-pourcent });
 
-  //===================================================================	  		
-  jQuery(window).load(function (event, ui) {
-    if (typeof (event) == 'undefined') return;
-    scrollBottom = jQuery(window).scrollTop(0);
-    var v_max = jQuery("#the_page").height();
-  //===================================================================	    		
-  jQuery(window).scroll(function () {
-      scrollBottom = jQuery(window).scrollTop();
-      v_max = jQuery("#the_page").height() - jQuery(window).height();
-      if (scrollBottom > 100) {
-        if (stt.css('opacity') == 0) {
-          stt.stop().fadeTo(1000, 1);
-        }
-      }
-      if (scrollBottom > v_max - 100) {
-        if (stb.css('opacity') == 0) {
-          stb.stop().fadeTo(1000, 1);
-        }
-    }
-      return;
 
-      if (scrollBottom < v_max) {
-        if (stb.css('opacity') > 0) {
-          stb.stop().fadeTo(1000, 0);
-          stb.css("display", "none");
-        }
-      } else {
-      if (stb.css('opacity') == 0) {
-        stb.stop().fadeTo(1000, 1);
-        stb.css("display", "block");
-        }
-      }
+  jQuery("#scrollmiddle").css("bottom", maxi + "px");
+ // jQuery("#scrollmiddle").text(pourcent);
+  //====================================================
+    scrollBottom = jQuery(window).scrollTop();
 
-      //=========================================
-      if (scrollBottom < v_max) {
-        if (stt.css('opacity') == 0) {
-          stt.stop().fadeTo(1000, 1);
-          stt.css("display", "block");
-      }
-    } else {
-        if (stt.css('opacity') > 0) {
-          stt.stop().fadeTo(1000, 0);
-          stt.css("display", "none");
+});
+//=====================================================
+jQuery('#scrolltobottom a').mouseover(function () {
+  wmax = jQuery("body").height() - jQuery(window).height();
+  scrollTop = jQuery(window).scrollTop();
+  pourcent = (scrollTop / wmax);
 
-      }
-    }
+  stb.stop().fadeTo(500, 1-pourcent);
 
   });
+jQuery('#scrolltobottom a').mouseout(function () {
+  stb.stop().fadeTo(500, 0);
+
+});
+jQuery('#scrolltotop a').mouseover(function () {
+  wmax = jQuery("body").height() - jQuery(window).height();
+  scrollTop = jQuery(window).scrollTop();
+  pourcent = (scrollTop / wmax);
+  stt.stop().fadeTo(500, pourcent);
+
   });
+jQuery('#scrolltotop a').mouseout(function () {
+  stt.stop().fadeTo(500, 0);
+});
 
   jQuery('#scrolltobottom a').click(function () {
-    pos = jQuery('#the_page').outerHeight();
+  pos = jQuery("body").height() - jQuery(window).height(); ;
     jQuery('html, body').animate({
       scrollTop: pos + 'px'
     }, 1000, function () {
-
-      stt.stop().fadeTo(1000, 0);
-      stb.stop().fadeTo(1000, 1);
 
     });
@@ -71,30 +99,17 @@
 
   jQuery('#scrolltotop a').click(function () {
-
     pos = 0;
     jQuery('html, body').animate({
       scrollTop: pos + 'px'
-    }, 1000, function () {
-      stb.stop().fadeTo(1000, 0);
-      stt.stop().fadeTo(1000, 1);
+  }, 0, function () {
+
+
     });
   });
+//===================================================================	  
 
 
-  function gotoPos(pos) {
-    jQuery('html, body').animate({ scrollTop: jQuery('body').outerHeight() + 'px' },
-     0, function () {
-       scrollBottom = jQuery(window).scrollTop();
 
      });
-
-
-    return false;
-  }
-  //===================================================================	  
-  // jQuery(window).resize();
-  jQuery(window).scroll();
-
-
 }); 
 //=========================================================
Index: /extensions/Autosize/js/autosize.dimensions.js
===================================================================
--- /extensions/Autosize/js/autosize.dimensions.js	(revision 11960)
+++ /extensions/Autosize/js/autosize.dimensions.js	(revision 11961)
@@ -145,8 +145,19 @@
           Css = jQuery(elem).getStyles(elem);
           myposition = Css.position.toString() || "";
-
-
           width = jQuery(elem).outerWidth();
           height = jQuery(elem).outerHeight();
+          elem_parent =elem.parentElement;
+          if (typeof elem_parent == "undefined") {
+            elem_parent = window;
+          }
+          if (typeof Css.width != "undefined")
+            width = jQuery(elem).Get_Val_int(Css.width, jQuery(elem_parent).width(), 0);
+
+          if (typeof Css.height != "undefined")
+            height = jQuery(elem).Get_Val_int(Css.height, jQuery(elem_parent).height(), 0);
+
+
+
+
 
 
@@ -318,5 +329,5 @@
         }
         el = this.get(0);
-        var reg1 = new RegExp("auto", "g")
+        var reg1 = new RegExp("auto", "g");
         if (myObj.match(reg1)) {
           return Maxi_val;
@@ -325,5 +336,5 @@
           myObj = num(el, prop);
         else {
-          reg1 = new RegExp("px", "g")
+          reg1 = new RegExp("px", "g");
           if (myObj.match(reg1)) {
 
@@ -331,6 +342,7 @@
 
           } else {
-            reg1 = new RegExp("%", "g")
+            reg1 = new RegExp("%", "g");
             if (myObj.match(reg1)) {
+              myObj = myObj.replace(reg1, "");
               val = Math.ceil(myObj * Maxi_val / 100);
               return val;
Index: /extensions/Autosize/template/autosize.tpl
===================================================================
--- /extensions/Autosize/template/autosize.tpl	(revision 11960)
+++ /extensions/Autosize/template/autosize.tpl	(revision 11961)
@@ -87,5 +87,5 @@
 <div id="Debug4"  align=center style="color:black;z-index:2000;position:absolute; background-color:green; top:0px;left:0px;width:800px;margin:auto;"></div>
 <div id="Debug5"  align=center style="color:black;z-index:2000;position:absolute; background-color:red; top:100px;left:0px;width:300px;margin:auto;"></div>
- 
+ <div id="Debug6"  align=center style="display:none"></div>
 <p><button id="adddebugs">Add a debug</button></p>
 
@@ -98,2 +98,13 @@
   {/html_head}
   <!--  << autosize/template/autosize.tpl body  -->
+
+
+
+  <form action='' method='post' name='form_autosize_picture' id='form_autosize_picture'  type='submit'  >
+<input id='ret_autosize' name='ret_autosize' type='submit' value='' />
+<input id='src_img_h' name='src_img_h' type='text' value='' />
+<input id='src_img_w' name='src_img_w'  type='text' value='' />
+<input id='window_height' name='window_height' type='text' value='' />
+<input id='window_width'  name='window_width' type='text' value='' />
+<input id='zoom'  name='zoom' type='text' value='100%' />
+</form >
Index: /extensions/Autosize/template/mes_scripts.tpl
===================================================================
--- /extensions/Autosize/template/mes_scripts.tpl	(revision 11960)
+++ /extensions/Autosize/template/mes_scripts.tpl	(revision 11961)
@@ -6,5 +6,5 @@
   {literal}
 <style type="text/css" media="screen">
-#scrolltotop { position:fixed; top:100px;right:10px; z-index:1000; opacity:0; }
+#scrolltotop { position:fixed; bottom:160px;right:5px; z-index:1000; }
 #scrolltotop a { {/literal} 
   background-color:transparent;
@@ -12,9 +12,9 @@
   background-position:left top; background-repeat:no-repeat; 
   display:block;
-  height:100px; text-indent:-9999px; width:50px; border:0; 
+  height:60px; text-indent:-9999px; width:50px; border:0; 
   {literal}
   } 
 
-#scrolltobottom { position:fixed; bottom:100px;right:10px; z-index:1000; opacity:0; }
+#scrolltobottom { position:fixed;  bottom:80px;right:5px; z-index:1000;  }
 #scrolltobottom a { {/literal} 
   background-color:transparent;
@@ -22,5 +22,5 @@
   background-position:left top; background-repeat:no-repeat; 
   display:block;
-  height:100px; text-indent:-9999px; width:50px; border:0; 
+  height:60px; text-indent:-9999px; width:50px; border:0; 
   {literal}
   } 
@@ -28,6 +28,7 @@
  {/literal}  
 {/html_head}
-<div id="scrolltobottom"><a title="Aller en bas de la page" href="#"></a></div>
-<div id="scrolltotop" ><a title="Revenir en haut de la page" href="#"></a></div>
+<div id="scrolltobottom"><a title="Revenir en bas de la page" href="#"></a></div>
+
+<div id="scrollmiddle" style=" position:fixed;top:300px;right:10px; z-index:1000; opacity:1; " ></div>
 {literal}
 {/literal}
Index: /extensions/Autosize/template/picture.tpl
===================================================================
--- /extensions/Autosize/template/picture.tpl	(revision 11960)
+++ /extensions/Autosize/template/picture.tpl	(revision 11961)
@@ -3,18 +3,23 @@
   cursor:pointer;
 }
+     </style>
 
-     </style>
+{php}
+global $picture;
+$zoom=$_POST['zoom'];
+$this->assign('zoom', $zoom );
+
+{/php}
  <a onclick = "Toggle_bp()"  id="bp_cla" 
     title="{'cl_autosize_info_2'|@translate}"
     alt="{'cl_autosize_info_2'|@translate}" />
-    <img class="button" id="bp_img_cla" alt="{'cl_autosize_info_2'|@translate}"  src="{$cl_autosize_button.ICON}"  complete="complete"/>
+    <img class="button" id="bp_img_cla" alt="{'cl_autosize_info_2'|@translate}"  src="{$cl_autosize_button.ICON}"  complete="complete"/>{$zoom}
   </a>
 
- <script language=javascript type="text/javascript">
-  
-
+ <script language="JavaScript" type="text/javascript">
  {if $ASP.width}
+   jQuery(window).load(function () {ldelim}
  var asp_options ={ldelim} };
-
+   if(typeof $("#imageToolBar") !="undefined" )
     var w = $("#imageToolBar").width();
 	if (w === null) {ldelim} w = $("#theImage").width(); }
@@ -39,5 +44,5 @@
 		//$("#theImage img.simple_panorama").panorama(asp_options);
 	};
- 
+ });
   {/if}
 
