Index: extensions/Autosize/include/affiche.php
===================================================================
--- extensions/Autosize/include/affiche.php	(revision 18325)
+++ extensions/Autosize/include/affiche.php	(revision 18716)
@@ -6,31 +6,24 @@
 $cl_visible=isset($conf['cl_auto']) ? $conf['cl_auto'] : 
 (isset($_GET['cl_visible'])?$_GET['cl_visible']:'true'); 
-//==============================================================================
-$DEBUG_autosize = isset($_POST['cl_debug']) ? $_POST['cl_debug'] : "false" ;
-$DEBUG_autosize = isset($_GET['cl_debug']) ? $_GET['cl_debug'] : $DEBUG_autosize ;
-$DEBUG_autosize = isset($conf['cl_debug']) ? $conf['cl_debug'] : $DEBUG_autosize ; 
 //===========================================================================
 $cookies="' x '"; 
+global $imgSizeWH ;
+$windowHeight=$_COOKIE['windowHeight'];
+$windowWidth=$_COOKIE['windowWidth'];
+global $size ;
 
-$img_width=isset($imgScaledWH)?$imgSizeWH[0]:"480";
-$img_height=isset($imgScaledWH)?$imgSizeWH[1]:"320";
-
-$img_scaled_width=isset($imgScaledWH)?$imgScaledWH[0]:"480";
-$img_scaled_height=isset($imgScaledWH)?$imgScaledWH[1]:"320";
+if(!isset($imgSizeWH)){
+ $imgSizeWH[0]=100;
+$imgSizeWH[1]=100;
+}
  
-$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($_SESSION['windowHeight'])?$_SESSION['windowHeight']: $img_scaled_height ;
-$window_width= isset($_SESSION['windowWidth'])?$_SESSION['windowWidth']: $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
+            'src_img_h' => $imgSizeWH[1],
+            'src_img_w' => $imgSizeWH[0],
+            'window_height' =>$windowHeight,
+            'window_width' => $windowWidth
           );
-        
+   
+       
   $my_path = AUTOSIZE_PATH_ABS;
   $theme=$user['theme'];
@@ -49,4 +42,5 @@
 
 //=== type possible ===
+ $defined_types = array_keys(ImageStdParams::get_defined_type_map());     
 if(isset($defined_types))
     foreach ($defined_types as $type_size){
@@ -54,13 +48,22 @@
       $options[$value] = $type_size;    
     }  
-
+ $autosize_parametres = cl_autosize_Get_Options();
  //===========================================
+$COOKIE_PATH= cookie_path() ;
+ global $DEBUG_autosize;
+     
   	$template->assign(
   					array(  
-            'select_type' =>$select_type,
-            'select_map' =>$select_type,
-            'pictureDeriv' =>$pictureDeriv ,
-            'maxi_img' =>$maxi_img ,
-            'ratio' =>$img_scaled_width/$img_scaled_height ,     
+            'has_pamoorama' => $has_pamoorama,
+            'pictureMap' =>   $pictureDeriv ,
+            'pictureDeriv' =>   $pictureDeriv ,
+            'pictureSelType' => $pictureSelType,
+
+            'SRC_IMG' => $SRC_IMG,
+            'liste_type' => $liste_type ,
+            'COOKIE_PATH' =>  $COOKIE_PATH  ,
+             
+            'ratio' =>$imgSizeWH[0]/$imgSizeWH[1] ,   
+              
             'webmaster_type' => array(
                                             'OPTIONS' => $options,
@@ -83,4 +86,5 @@
                                             'SELECTED' => $autosize_parametres->normal_type
                                             ),
+
             'DEBUG_autosize' =>  $DEBUG_autosize   ,
             'cl_visible' =>  $cl_visible,
@@ -94,12 +98,12 @@
             'theme' => $theme,
 
-            'windowHeight' => $window_height,
-            'windowWidth' =>  $window_width,
+            'windowHeight' => $windowHeight,
+            'windowWidth' =>  $windowWidth,
 
-            'SCALED_WIDTH' => $img_scaled_width,
-            'SCALED_HEIGHT' => $img_scaled_height,      
+            'SCALED_WIDTH' => $imgSizeWH[0],
+            'SCALED_HEIGHT' => $imgSizeWH[1],      
                           
-            'IMG_WIDTH' 	=> $img_width,
-            'IMG_HEIGHT'	=> $img_height,
+            'theImageWidth' 	=> isset($_COOKIE['theMainImageWidth'])?$_COOKIE['theMainImageWidth']: $imgSizeWH[0],
+            'theImageHeight'	=> isset($_COOKIE['theMainImageHeight'])?$_COOKIE['theMainImageHeight']:$imgSizeWH[1],
                     
             'MINI_HEIGHT' => $autosize_parametres->mini_height,
@@ -115,5 +119,5 @@
             'check_icon_v' => ($autosize_parametres->check_icon_v == 'on') ? 'checked="checked"'  : ''  ,
             'check_desc_v' => ($autosize_parametres->check_desc_v == 'on') ? 'checked="checked"'  : '' ,
-
+            'defaut_type' => ($autosize_parametres->defaut_type == 'on') ? 'checked="defaut_type"'  : '' ,
 
             'webmaster_enabled' => ($autosize_parametres->webmaster_enabled == 'on') ? 'checked="checked"'  : '' ,
@@ -124,6 +128,5 @@
 
             'user_status'   => get_user_status($user_status)  ,
-            'SRC_IMG' => $SRC_IMG,
-            'liste_type' => $liste_type ,
+
             'Size' => $size        
 					
