Index: extensions/Autosize/autosize.inc.php
===================================================================
--- extensions/Autosize/autosize.inc.php	(revision 7819)
+++ extensions/Autosize/autosize.inc.php	(revision 7820)
@@ -145,11 +145,11 @@
 if ( !empty($content) )   {  return $content;  }	
 if ($ThePicture['is_picture'] <> 1 )  	{  return $content;  ; }	
- $tpls=' {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js" now=1}'; 
-	 $autosizejs = '<script type="text/javascript" charset="utf-8"  src="'.$ROOT_URL;
+
+	 $autosizejs = '<script type="text/javascript" charset="utf-8"  src="';
 	      $autocss =   $autosizejs.'themes/default/js/jquery.packed.js"></script>'."\n"; 
 		  $template->append('head_elements',$autocss);
 
-$autocss="<script type='text/javascript'>
-jQuery('#theImage').css({opacity:'0.1'});
+		$autocss="<script type='text/javascript'>
+jQuery('#theImage').css({opacity:'0.0'});
 </script>";
 
@@ -186,21 +186,20 @@
 	   global  $template,$user,$conf,$picture ,$page;
 	   //userDefManage ??
-	   	$my_path =  basename(dirname(__FILE__)).'/' ;
-	    $my_path = dirname(__FILE__).'/';
+			$my_path =  basename(dirname(__FILE__)).'/' ;
+			$my_path = dirname(__FILE__).'/';
 			$debug = isset($conf['debug']) ? $conf['debug'] : false ; 
 			$cl_conflit =  isset($conf['cl_conflit']) ? $conf['cl_conflit'] : 'true' ;
-		  	  $theme=$user['theme'];
-			  	$template->assign(
-  						array('ma_page' =>	$page['body_id'],
-						'cl_conflit' => $cl_conflit  ,
-						'theme' => $theme  ,
-						'DEBUG' => $debug   ,
-						'AUTOSIZE_PATH' => AUTOSIZE_PATH)
-						 );
+			$theme=$user['theme'];
+			$template->assign(
+  					array('ma_page' =>	$page['body_id'],
+					'cl_conflit' => $cl_conflit  ,
+					'theme' => $theme  ,
+					'DEBUG' => $debug   ,
+					'AUTOSIZE_PATH' => AUTOSIZE_PATH)
+						);
 						 
 $autoscript="<script type='text/javascript'>
 if (typeof (save_framework) == 'function')
 save_framework('".$page['body_id']."');
-
 </script>";
 			 $template->append('footer_elements',$autoscript);  
Index: extensions/Autosize/js/Affiche_script.js
===================================================================
--- extensions/Autosize/js/Affiche_script.js	(revision 7819)
+++ extensions/Autosize/js/Affiche_script.js	(revision 7820)
@@ -23,28 +23,40 @@
    
 }
-//=================================================================================================
- function Wait_Pamoorama() {
+ 
+//==========================================================================
+function Wait_Affichage() {
+   if (jQuery("#pamoorama").length) {
+               jQuery().newResize() ;
                mypanorama = window.myPamoorama;
-               if (!mypanorama) setTimeout("Wait_Pamoorama()", 500);
-                 if ( mypanorama.skipInit==false) setTimeout("Wait_Pamoorama()", 500);
+               if (!mypanorama){ 
+                    setTimeout("Wait_Affichage()", 500);
+                    return false ;
+               }
+                 if ( mypanorama.skipInit==false) { 
+                    setTimeout("Wait_Affichage()", 500);
+                    return false ;
+               }
                      info_pamoorama = jQuery("#pamoorama").infos();
                     new_width= info_pamoorama.width ;
-              if(! jQuery().newResize()) setTimeout("Wait_Pamoorama()", 500);
-                 if (  myPamoorama.options.width!= new_width ) return 
-                 jQuery("#theImage").css(
-                         { opacity: 1 } 
-                        );
-                         
-}
-function Wait_Affichage() {
-                if(!jQuery().newResize()) {
+               
+                 if (  Math.abs(new_width - myPamoorama.options.width)>10  ) {
                  setTimeout("Wait_Affichage()", 500);
-                 }
+                 return false ;
+                 }
+         
+
+     }else  if(!jQuery().newResize()) {
+                 setTimeout("Wait_Affichage()", 500);
+                 return 
+    }
+
+
       fade_in = parseInt(fade_in);
             if (fade_in==0 )
                  {
                  jQuery("#theImage").css({
-                         opacity: 1,
-                         filter: 'alpha(opacity:100)'}
+                         opacity: 1
+                         
+                         }
                  )
 				 }else{
@@ -55,7 +67,4 @@
 
 
-                 jQuery("#theImage").css(
-                         { opacity: 1 } 
-                        );
                          
 } 
@@ -342,5 +351,7 @@
 
              jQuery(window).resize(
-               function (event, ui) {        
+               function (event, ui) {    
+               return ;
+                   
                event = event || window.event;
 
@@ -409,56 +420,7 @@
            return ;
 
-                 if(jQuery.browser.msie)
-                 {    var el = e.srcElement;
-                        ID = el.id;                
-                        Prop = e.propertyName.split(".");
-                        if(Prop.length < 2) return ;                      
-                          Property = Prop[1];
-                 }
-                 else
-                 {ID =this.id ;
-                     Prop = e.attrName ;
-                     Property = e.newValue  ;
-                 }
-           jQuery().affiche_debug({ Dragg: {texte:"onPropertyChange : " + ID,
-                     css:{
-                         opacity: 0.5,
-                         filter: 'alpha(opacity:50)',
-                         position: "absolute",
-                         width: "500px",
-                         border: "solid 1px green",
-                         top: 130 + "px"}
-                     }
-                     });
-                  mypanorama = window.myPamoorama;
-                 if (Property.match("width","gi")) {
-                   
-                 
-                if(!mypanorama) 
-                  setTimeout("wait_Pamoorama()", 500); 
-                   
-
-
-               if(jQuery("#pamoorama_outter").length == 0)
-               {
-               elem=jQuery("#pamoorama").get(0);
-                 type="propertychange";
-            handle=jQuery().onPropertyChange;
-
-                     if (elem.addEventListener) {// Firefox, Opera, Google Chrome and Safari
-                            elem.addEventListener('DOMAttrModified', handle, false);
-                        } else if (elem.attachEvent) {
-                            elem.attachEvent("on" + type, handle);
-                        }
-                  setTimeout("wait_Timer()", 600); 
-                  }
-               else if( jQuery("#pamoorama_footer").length == 0)
-                   setTimeout("wait_Pamoorama()", 600); 
-                else if( jQuery("#pamoorama_frame").length == 0)
-                    setTimeout("wait_Pamoorama()", 600); 
-                 }
-                 return;
+
              },
-                     /*
+             /*
              * recherche la plus grande image (hauteur ou largeur)
              */
@@ -592,5 +554,5 @@
 
                      if (myPamoorama.skipInit == false) {
-                            setTimeout("Wait_Pamoorama()", 500);
+                            
                             return false;
                      }
Index: extensions/Autosize/main.inc.php
===================================================================
--- extensions/Autosize/main.inc.php	(revision 7819)
+++ extensions/Autosize/main.inc.php	(revision 7820)
@@ -2,5 +2,5 @@
 /*
 Plugin Name: AutoSize
-Version: 1.3.5
+Version: 1.3.7
 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
