Index: extensions/Autosize/admin/template/admin.tpl
===================================================================
--- extensions/Autosize/admin/template/admin.tpl	(revision 16682)
+++ extensions/Autosize/admin/template/admin.tpl	(revision 16931)
@@ -1,7 +1,5 @@
-{if PHPWG_VERSION < 2.2 } 
-{include file=$AUTOSIZE_PATH_ABS|@cat:'admin/template/header_2_1.tpl'}
-{else} 
-{include file= $AUTOSIZE_PATH_ABS|@cat:'admin/template/header_2_2.tpl'}
-{/if} 
+
+{include file= $AUTOSIZE_PATH_ABS|@cat:'admin/template/header.tpl'}
+
 {html_head}
 {literal}
@@ -14,45 +12,45 @@
 {/literal}
 <script type="text/javascript">
-    var src_img = '{$SRC_IMG}';
-    var fade_in = '{$fade_in}';
-
-    var thumbnail = '{$thumbnail}';
-    var scaled_width =  '{$SCALED_WIDTH}'; // valeur par defaut
-    var scaled_height = '{$SCALED_HEIGHT}'; // valeur par defaut
-    var img_width='{$IMG_WIDTH }';
-    var img_height = '{ $IMG_HEIGHT }';
-
-    var marge_basse='{ $MARGE_BASSE }';
-    var echelle_max='{ $ECHELLE_MAX }';
-    var mini_width='{ $MINI_WIDTH   }';
-    var mini_height = '{ $MINI_HEIGHT   }';
-    var mini_width2 = '{ $MINI_WIDTH2 }';
-    var mini_height2 = '{ $MINI_HEIGHT2 }';
-
-    var webmaster_width='{$webmaster_width   }';
-    var webmaster_height = '{ $webmaster_height   }';
-    var webmaster_enabled = '{ $webmaster_enabled   }';
-
-    var admin_width='{ $admin_width   }';
-    var admin_height = '{ $admin_height   }';
-    var admin_enabled = '{ $admin_enabled   }';
-
-    var generic_width='{ $generic_width   }';
-    var generic_height = '{ $generic_height   }';
-    var generic_enabled = '{ $generic_enabled   }';
-
-    var guest_width='{ $guest_width   }';
-    var guest_height = '{$guest_height}';
-    var guest_enabled = '{ $guest_enabled   }';
-
-    var normal_width='{$normal_width}';
-    var normal_height = '{$normal_height}';
-    var normal_enabled = '{ $normal_enabled   }';
-
-    var user_status='{$user_status}';
-   
-    var check_auto_w = '{$check_auto_w}';
-     
-    var check_desc_v = ('{$check_desc_v}' == 'checked="checked"') ? true : false; 
+var  Autosize_options={ldelim}
+      DEBUG_autosize:'{$DEBUG_autosize}',
+     theme:'{$theme}',
+     src_img : '{$SRC_IMG}',
+     fade_in : '{$fade_in}',
+     cl_visible : "{$cl_visible}" =="true",
+     thumbnail : '{$thumbnail}',
+     scaled_width :  '{$SCALED_WIDTH}', // valeur par defaut
+     scaled_height : '{$SCALED_HEIGHT}', // valeur par defaut
+     img_width:'{$IMG_WIDTH }',
+     img_height : '{ $IMG_HEIGHT }',
+     cookie_width:'{$COOKIE_WIDTH }',
+     cookie_height : '{ $COOKIE_HEIGHT }',
+     marge_basse:'{ $MARGE_BASSE }',
+     echelle_max:'{ $ECHELLE_MAX }',
+     mini_width:'{ $MINI_WIDTH   }',
+     mini_height : '{ $MINI_HEIGHT   }',
+     mini_width2 : '{ $MINI_WIDTH2 }',
+     mini_height2 : '{ $MINI_HEIGHT2 }',
+
+     webmaster_type:'{$webmaster_type   }',
+     webmaster_enabled : '{ $webmaster_enabled   }',
+
+     admin_type:'{ $admin_type   }',     
+     admin_enabled : '{ $admin_enabled   }',
+
+     generic_type:'{ $generic_type   }',    
+     generic_enabled : '{ $generic_enabled   }',
+
+     guest_type:'{ $guest_type   }', 
+     guest_enabled : '{ $guest_enabled   }',
+
+     normal_type:'{$normal_type}',
+     normal_enabled : '{ $normal_enabled   }',
+
+     user_status:'{$user_status}',   
+  
+     check_desc_v :  '{$check_desc_v}' 
+    } ;
+
+ </script>
 </script>
  
@@ -85,9 +83,5 @@
   {assign var="visible" value="none"}
 {/if}
-{if $check_auto_w == true} 
-     {assign var="visible_w" value="visible"}
-  {else}
-     {assign var="visible_w" value="hidden"}
-{/if}
+
 <div class="titrePage">
 		<h2>{'Autosize'|translate} {'version'|translate} {$cl_version}</h2>
@@ -105,38 +99,66 @@
   	<legend class="cluetip" title="{'cl_autosize_config_title_1'|@translate}|{'cl_autosize_hlp_line1'|@translate}">{'cl_autosize_config_title_1'|@translate}</legend>
         <td class="td_autosize pluginBox">{'User status'|@translate}</td>
-        <td class="td_autosize pluginBox">{'cl_autosize_height'|@translate}</td>
-        <td class="td_autosize pluginBox">{'cl_autosize_width'|@translate}
-         <input type="checkbox" id="check_auto_w" name="check_auto_w" value="on"  {$check_auto_w}  /></td>
+         <td class="td_autosize pluginBox">{'Photo sizes'|@translate}</td>        
          <td class="td_autosize pluginBox">{'cl_autosize_enabled'|@translate}</td>
-
         <tr name="webmaster_enabled">
+
         <td>{'user_status_webmaster'|@translate}</td>
-        <td><input name="webmaster_height" id="Text7" type="text"  value ="{$webmaster_height}" /></td>
-        <td><input name="webmaster_width" id="webmaster_width" type="text" value="{$webmaster_width}" /></td>
+         <td> 
+         {if isset ($webmaster_type)}
+          <select name="webmaster_type">
+              {foreach from=$webmaster_type.OPTIONS item=type_size key=value}
+        <option value="{$value}" {if $value == $webmaster_type.SELECTED}selected="selected"{/if} {if is_numeric($value)}disabled="disabled"{/if}>{$type_size}</option>
+              {/foreach}
+        </select>
+        {/if}
+      </td>
          <td ><input name="webmaster_enabled" id="webmaster_enabled" type="checkbox"  value ="on" {$webmaster_enabled}  /></td>
         </tr>
+
         <tr name="admin_enabled">
         <td>{'user_status_admin'|@translate}</td>
-        <td><input name="admin_height" id="admin_height" type="text"  value ="{$admin_height}" /></td>
-        <td ><input name="admin_width" id="admin_width" type="text"  value ="{$admin_width}" /></td>
-        <td ><input name="admin_enabled" id="admin_enabled" type="checkbox"  value ="on" {$admin_enabled} /></td>
+        <td> {if isset ($admin_type)}
+          <select name="admin_type">
+              {foreach from=$admin_type.OPTIONS item=type_size key=value}
+        <option value="{$value}" {if $value == $admin_type.SELECTED}selected="selected"{/if} {if is_numeric($value)}disabled="disabled"{/if}>{$type_size}</option>
+              {/foreach}
+        </select>
+        {/if}
+        </td>
+         <td ><input name="admin_enabled" id="admin_enabled" type="checkbox"  value ="on" {$admin_enabled} /></td>
         </tr>
         <tr name="generic_enabled">
         <td>{'user_status_generic'|@translate}</td>
-        <td><input name="generic_height" id="Text1" type="text"  value ="{$generic_height}" /></td>
-        <td><input name="generic_width" id="generic_width" type="text"  value ="{$generic_width}" /></td>
-        <td ><input name="generic_enabled" id="generic_enabled" type="checkbox"  value ="on" {$generic_enabled} /></td>
+        <td>{if isset ($generic_type)}
+          <select name="generic_type">
+              {foreach from=$generic_type.OPTIONS item=type_size key=value}
+        <option value="{$value}" {if $value == $generic_type.SELECTED}selected="selected"{/if} {if is_numeric($value)}disabled="disabled"{/if}>{$type_size}</option>
+              {/foreach}
+        </select>
+        {/if}
+        </td>
+         <td ><input name="generic_enabled" id="generic_enabled" type="checkbox"  value ="on" {$generic_enabled} /></td>
         </tr>
         <tr name="guest_enabled">
         <td>{'user_status_guest'|@translate}</td>
-        <td><input name="guest_height" id="Text3" type="text"  value ="{$guest_height}" /></td>
-        <td><input name="guest_width" id="guest_width" type="text"  value ="{$guest_width}" /></td>
+        <td>{if isset ($guest_type)}
+          <select name="guest_type">
+              {foreach from=$guest_type.OPTIONS item=type_size key=value}
+        <option value="{$value}" {if $value == $guest_type.SELECTED}selected="selected"{/if} {if is_numeric($value)}disabled="disabled"{/if}>{$type_size}</option>
+              {/foreach}
+        </select>
+        {/if}</td>
          <td ><input name="guest_enabled" id="guest_enabled" type="checkbox"  value ="on" {$guest_enabled} /></td>
         </tr>
         <tr name="normal_enabled">
         <td>{'user_status_normal'|@translate}</td>
-        <td><input name="normal_height" id="Text5" type="text"  value ="{$normal_height}" /></td>
-        <td><input name="normal_width" id="normal_width" type="text"  value ="{$normal_width}" /></td>
-        <td ><input name="normal_enabled" id="normal_enabled" type="checkbox"  value ="on" {$normal_enabled} /></td>
+        <td>{if isset ($normal_type)}
+          <select name="normal_type">
+              {foreach from=$normal_type.OPTIONS item=type_size key=value}
+        <option value="{$value}" {if $value == $normal_type.SELECTED}selected="selected"{/if} {if is_numeric($value)}disabled="disabled"{/if}>{$type_size}</option>
+              {/foreach}
+        </select>
+        {/if}</td>
+         <td ><input name="normal_enabled" id="normal_enabled" type="checkbox"  value ="on" {$normal_enabled} /></td>
         </tr>
 
Index: extensions/Autosize/admin/template/header.tpl
===================================================================
--- extensions/Autosize/admin/template/header.tpl	(revision 16931)
+++ extensions/Autosize/admin/template/header.tpl	(revision 16931)
@@ -0,0 +1,6 @@
+{get_combined_scripts load='header'}
+{combine_script id="jquery" load="header" path = "themes/default/js/jquery.min.js"}
+{combine_script id="jquery.cluetip" path = "themes/default/js/plugins/jquery.cluetip.js" require="jquery" }
+{combine_script id="conflit_script" path = $AUTOSIZE_PATH|@cat:"js/conflit.js" require="jquery"}
+{combine_script id="dimensions" path = $AUTOSIZE_PATH|@cat:"js/autosize.dimensions.js" require="jquery"}
+
Index: extensions/Autosize/admin/template/help.tpl
===================================================================
--- extensions/Autosize/admin/template/help.tpl	(revision 16682)
+++ extensions/Autosize/admin/template/help.tpl	(revision 16931)
@@ -1,7 +1,5 @@
-{html_head} {if PHPWG_VERSION < 2.2 }
- {include file=$AUTOSIZE_PATH_ABS|@cat:'admin/template/header_2_1.tpl'}
-{else}
-{include file= $AUTOSIZE_PATH_ABS|@cat:'admin/template/header_2_2.tpl'}
-{/if}
+{html_head} 
+{include file= $AUTOSIZE_PATH_ABS|@cat:'admin/template/header.tpl'}
+
 {/html_head}
 <form action="" method="post">
Index: extensions/Autosize/autosize.inc.php
===================================================================
--- extensions/Autosize/autosize.inc.php	(revision 16682)
+++ extensions/Autosize/autosize.inc.php	(revision 16931)
@@ -37,17 +37,12 @@
     $ma_page=isset($page['body_id'])?$page['body_id']:"" ;
     if ($ma_page=='thePiwiShackControllerPage') return ;
-
-
-    if (PHPWG_VERSION < 2.2 ) 
-      $file =AUTOSIZE_PATH_ABS.'template/header_2_1.tpl' ;
-    else 
-      $file =AUTOSIZE_PATH_ABS.'template/header_2_2.tpl' ;
+      $file =AUTOSIZE_PATH_ABS.'template/header.tpl' ;
     $template->set_filenames(array('autosize_init_header'=> $file ));
     $template->set_filenames(array('autosize_init'=>AUTOSIZE_PATH_ABS. "template/conflit.tpl" ) );
-//=================================================================================================
+//================================================================
 $DEBUG_autosize = isset($_POST['cl_debug_conflit']) ? $_POST['cl_debug_conflit'] : "false" ;
 $DEBUG_autosize = isset($_GET['cl_debug_conflit']) ? $_GET['cl_debug_conflit'] : $DEBUG_autosize ;
 $DEBUG_autosize = isset($conf['cl_debug_conflit']) ? $conf['cl_debug_conflit'] : $DEBUG_autosize ; 
-//=================================================================================================
+//======================================================================
     $autosize_parametres =	 cl_autosize_Get_Options() ;			
     $theme=$user['theme'];
@@ -69,8 +64,8 @@
 		return $template->parse( 'autosize_init', false);
 	}// function cl_autosize_script_1
- //===========================================================
- /*
-  * cl_autosize_script_2()
- */
+
+ /*************************************
+ * cl_autosize_script_2()
+ **************************************/
  static public function cl_autosize_script_2()
  {
@@ -79,9 +74,9 @@
 
 			$AUTOSIZE_PATH = dirname(__FILE__).'/';
-//=================================================================================================
+//================================================================
 $DEBUG_autosize = isset($_POST['cl_debug_conflit']) ? $_POST['cl_debug_conflit'] : "false" ;
 $DEBUG_autosize = isset($_GET['cl_debug_conflit']) ? $_GET['cl_debug_conflit'] : $DEBUG_autosize ;
 $DEBUG_autosize = isset($conf['cl_debug_conflit']) ? $conf['cl_debug_conflit'] : $DEBUG_autosize ; 
-//=================================================================================================
+//=====================================================================
 
 
@@ -156,4 +151,68 @@
 		return $menu;
 	} //function cl_autosize_admin
+  //=====================================
+
+
+  // this is the default handler that generates the display for the element
+ static public function autosize_RenderContent($content, $element_info)
+{
+  global $conf;  
+  if ( !empty($content) )
+  {// someone hooked us - so we skip;
+    return $content;
+  }
+  if (isset($_COOKIE['picture_deriv']))
+  {
+    if ( array_key_exists($_COOKIE['picture_deriv'], ImageStdParams::get_defined_type_map()) )
+    {
+      pwg_set_session_var('picture_deriv', $_COOKIE['picture_deriv']);
+    }
+    setcookie('picture_deriv', false, 0, cookie_path() );
+  }
+  $deriv_type = pwg_get_session_var('picture_deriv', $conf['derivative_default_size']);
+  $selected_derivative = $element_info['derivatives'][$deriv_type];
+
+  $unique_derivatives = array();
+  $show_original = isset($element_info['element_url']);
+  $added = array();
+  foreach($element_info['derivatives'] as $type => $derivative)
+   $element_info['derivatives']['Autosize']=$derivative; // last
+
+  foreach($element_info['derivatives'] as $type => $derivative) {     
+  if ($type=='Autosize'){    
+       
+    $url = $derivative->get_url(); 
+    if (isset($added[$url]))
+      continue;
+    $added[$url] = 1;
+    $show_original &= !($derivative->same_as_source());
+    $unique_derivatives[$type]= $derivative;
+     }
+
+  }
+
+  global $page, $template;
+
+  if ($show_original)
+  {
+    $template->assign( 'U_ORIGINAL', $element_info['element_url'] );
+  }
+
+  $template->append('current', array(
+      'selected_derivative' => $selected_derivative,
+      'unique_derivatives' => $unique_derivatives,
+    ), true);    
+      $file =AUTOSIZE_PATH_ABS.'template/picture_content.tpl' ;
+  $template->set_filenames(
+    array('autosize_content'=> $file)
+    );
+
+  $template->assign( array(
+      'ALT_IMG' => $element_info['file'],
+      'COOKIE_PATH' => cookie_path(),
+      )
+    );
+   return $template->parse( 'autosize_content', false);
+ }
 
     //===============================================================
@@ -174,25 +233,19 @@
 				$autosize_parametres = cl_autosize_Get_Options();
 				include (AUTOSIZE_PATH."include/affiche.php"); 
-
-       if (PHPWG_VERSION < 2.2 ) 
-                $file =AUTOSIZE_PATH_ABS.'template/picture_2_1.tpl' ;
-        else 
-                $file =AUTOSIZE_PATH_ABS.'template/picture_2_2.tpl' ;
-
-
-
-        $template->set_filenames(array('autosize_content_header'=> $file ));  
-        $template->concat('autosize_content', $template->parse('autosize_content_header', true));   
-                        
+        $file =AUTOSIZE_PATH_ABS.'template/picture_1.tpl' ;
+        $template->set_filenames(array('autosize_content_header'=> $file )); 
+        $template->concat('autosize_content', $template->parse('autosize_content_header', true));                           
         $template->set_filenames(array('autosize_init_header'=> $file ));
-                           		
+        	$theme=$user['theme'];    
+          $deriv_type = pwg_get_session_var('picture_deriv', IMG_LARGE);                 		
 				if($autosize_parametres->check_icon_v == 'on'){				 
 						$template->assign('cl_autosize_button', 
 						array(	'cl_autosize_info' => 'cl_autosize_info' ,
-            'cl_autosize_info_1' => 'cl_autosize_info_' ,  
+                    'cl_autosize_info_1' => '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'
+								    'ICON' => AUTOSIZE_PATH . 'icons/button-minimize.png',
+                    'ICON1' => AUTOSIZE_PATH . 'icons/button-no.png'
 								)
 
@@ -202,5 +255,6 @@
 				}
 				 $template->set_filenames(
-						array('autosize_content'=> $AUTOSIZE_PATH.'template/autosize.tpl')
+						array('autosize_content'=> $AUTOSIZE_PATH.'template/autosize.tpl',
+             'theme' => $theme   )
 					);
 			$template->concat('autosize_content', $template->parse('autosize_content_header', true));		
@@ -216,7 +270,5 @@
 					
         $template->parse('mes_script');
-      }      
-        
-        
+      }     
         
         return $template->parse( 'autosize_content', false);
@@ -318,16 +370,11 @@
     $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['webmaster_type'] = 'Autosize' ; 
+    $def_para['admin_type'] = 'Autosize'  ; 
+    $def_para['generic_type'] = 'Autosize'  ;
+    $def_para['guest_type'] = 'Autosize'  ;
+    $def_para['normal_type']  =  'Autosize'  ;
+ 
 
 
@@ -344,5 +391,5 @@
     $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" ;
@@ -403,6 +450,4 @@
 //=============================================================================
 $my_para=$autosize_parametres;
-
-
   if (empty($my_para))
 $my_para = (object) '';
@@ -411,18 +456,16 @@
 $my_para->type=(isset($_POST['type']))? $_POST['type']: ((isset($my_para->type)) ? $my_para->type:  'Ty') ;
 
-$my_para->webmaster_height =(isset($_POST['webmaster_height'])) ? $_POST['webmaster_height'] : ((isset($my_para->webmaster_height )) ? $my_para->webmaster_height : '100%' ) ;
-$my_para->webmaster_width=(isset($_POST['webmaster_width']))? $_POST['webmaster_width']: ((isset($my_para->webmaster_width)) ? $my_para->webmaster_width:  '100%') ;
-
-$my_para->admin_height =(isset($_POST['admin_height'])) ? $_POST['admin_height'] : ((isset($my_para->admin_height )) ? $my_para->admin_height : '100%' ) ;
-$my_para->admin_width=(isset($_POST['admin_width']))? $_POST['admin_width']: ((isset($my_para->admin_width)) ? $my_para->admin_width:  '100%') ;
-
-$my_para->generic_height =(isset($_POST['generic_height'])) ? $_POST['generic_height'] : ((isset($my_para->generic_height )) ? $my_para->generic_height : '100%' ) ;
-$my_para->generic_width=(isset($_POST['generic_width']))? $_POST['generic_width']: ((isset($my_para->generic_width)) ? $my_para->generic_width:  '100%') ;
-
-$my_para->guest_height =(isset($_POST['guest_height'])) ? $_POST['guest_height'] : ((isset($my_para->guest_height )) ? $my_para->guest_height : '100%' ) ;
-$my_para->guest_width=(isset($_POST['guest_width']))? $_POST['guest_width']: ((isset($my_para->guest_width)) ? $my_para->guest_width:  '100%') ;
-
-$my_para->normal_height =(isset($_POST['normal_height'])) ? $_POST['normal_height'] : ((isset($my_para->normal_height )) ? $my_para->normal_height : '100%' ) ;
-$my_para->normal_width=(isset($_POST['normal_width']))? $_POST['normal_width']: ((isset($my_para->normal_width)) ? $my_para->normal_width:  '100%') ;
+$my_para->webmaster_type =(isset($_POST['webmaster_type'])) ? $_POST['webmaster_type'] : ((isset($my_para->webmaster_type )) ? $my_para->webmaster_type : 'Autosize' ) ;
+
+$my_para->admin_type =(isset($_POST['admin_type'])) ? $_POST['admin_type'] : ((isset($my_para->admin_type )) ? $my_para->admin_type : 'Autosize' ) ;
+
+$my_para->generic_type =(isset($_POST['generic_type'])) ? $_POST['generic_type'] : ((isset($my_para->generic_type )) ? $my_para->generic_type : 'Autosize' ) ;
+
+
+$my_para->guest_type =(isset($_POST['guest_type'])) ? $_POST['guest_type'] : ((isset($my_para->guest_type )) ? $my_para->guest_type : 'Autosize' ) ;
+
+
+$my_para->normal_type =(isset($_POST['normal_type'])) ? $_POST['normal_type'] : ((isset($my_para->normal_type )) ? $my_para->normal_type : 'Autosize' ) ;
+
 
 
@@ -442,5 +485,5 @@
 		$my_para->check_desc_v = isset($_POST['check_desc_v']) ? $_POST['check_desc_v'] : "off" ;
 		$my_para->check_icon_v = isset($_POST['check_icon_v']) ? $_POST['check_icon_v'] : "off" ;
- 		$my_para->check_auto_w = isset($_POST['check_auto_w']) ? $_POST['check_auto_w'] : "off" ;
+ 	
 
 		$my_para->webmaster_enabled = isset($_POST['webmaster_enabled']) ? $_POST['webmaster_enabled'] : "off" ;
@@ -453,5 +496,5 @@
 		$my_para->check_desc_v = isset($_POST['check_desc_v']) ? $_POST['check_desc_v'] : ( ( isset($my_para->check_desc_v) ) ? $my_para->check_desc_v :   'off') ;  
 		$my_para->check_icon_v = isset($_POST['check_icon_v']) ? $_POST['check_icon_v'] : ( ( isset($my_para->check_icon_v) ) ? $my_para->check_icon_v :   'off') ;  
-		$my_para->check_auto_w = isset($_POST['check_auto_w']) ? $_POST['check_auto_w'] : ( ( isset($my_para->check_auto_w) ) ? $my_para->check_auto_w :   'off') ;  
+
 
 
Index: extensions/Autosize/css/autosize.css
===================================================================
--- extensions/Autosize/css/autosize.css	(revision 16682)
+++ extensions/Autosize/css/autosize.css	(revision 16931)
@@ -3,5 +3,5 @@
     opacity: 100;
     filter: alpha(opacity:100);
-
+    
 }
 body{
@@ -30,18 +30,23 @@
 /**/
 #theImageAndInfos, #theImageAndTitle {
- /* background-color: #FFFF00;*/
+/*   background-color: #FF0000; */
+
 }
-#content {/*
-   border: 5px solid #00FF00; 
-   */
+#content {
+/* 
+  border: 5px solid #00FF00;
+padding:10px;
+ margin:15px
+ */
 }
-#theImage { 
-/* 
- border: 5px solid #f0FFf0;
-  padding: 10px;
-  margin: 10px;
-  background-color: #00FF00;  
-  */
-}
+#theImage {  
+ /*  padding: 10px;  margin: 10px;
+ border: 5px solid #0000F0;
+  background-color: #0000FF; 
+   background-image: url('../images/quadrille_100.gif');
+   */ }
+  
+
+
 #theMainImage {
 /*
@@ -58,6 +63,10 @@
   padding: 20px;
  
-  background-color: #FF0000; */
+ background-color: #FF0000; */
+}
+#thePicturePage{
+/* background-color: #FF0000;
+ border: 5px solid #FFfF00;*/
 }
 
-#theImageAndTitle {  z-index: 4; }
+
Index: extensions/Autosize/include/affiche.php
===================================================================
--- extensions/Autosize/include/affiche.php	(revision 16682)
+++ extensions/Autosize/include/affiche.php	(revision 16931)
@@ -12,13 +12,51 @@
 $DEBUG_autosize = isset($_GET['cl_debug_conflit']) ? $_GET['cl_debug_conflit'] : $DEBUG_autosize ;
 $DEBUG_autosize = isset($conf['cl_debug_conflit']) ? $conf['cl_debug_conflit'] : $DEBUG_autosize ; 
-//=================================================================================================
+//===========================================================================
+$cookies="' x '";
 
-$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";
+$current = $template->get_template_vars('current');
+if (isset($_COOKIE['picture_deriv']))
+  {
+  if (isset($_COOKIE['img_w']))
+  $cookies =  '"'.$_COOKIE['img_w']." x ".  $_COOKIE['img_h'] .'"';
 
-$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               ;
+    if ( array_key_exists($_COOKIE['picture_deriv'], ImageStdParams::get_defined_type_map()) )
+    {
+      pwg_set_session_var('picture_deriv', $_COOKIE['picture_deriv']);
+    }
+    setcookie('picture_deriv', false, 0, cookie_path() );
+  }
+  $deriv_type = pwg_get_session_var('picture_deriv', $conf['derivative_default_size']);
+
+if (isset($current)){
+ $derivative=$current['selected_derivative'] ;
+  $imgScaledWH=$derivative->src_image->get_size();
+	$imgSizeWH  =  $derivative->get_size();	
+  $img_type  =  $derivative->get_type();	
+  $img_url  = $derivative->get_url();
+  $img_all= $derivative->get_all($derivative->src_image);
+  $scaled_size=$derivative->get_size_hr(); //792 x 441
+   $scaled_size=$derivative->get_scaled_size_htm(); // width="792" height="441"
+   //================= taille mis a l'échelle 
+   $scaled_size=$derivative->get_scaled_size(100,100); // array([0]=>100,[1]=>55)
+  $src= $derivative->src_image ;
+     
+    }
+
+          $defined_types = array_keys(ImageStdParams::get_defined_type_map());      
+
+
+
+$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";
+
+
+ 
+$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    ;
@@ -41,8 +79,41 @@
 											)
 									);	
-                 
-if (!isset($conf['prefix_thumbnail'])) $conf['prefix_thumbnail']="TN_";                    	
+if (!isset($conf['prefix_thumbnail'])) $conf['prefix_thumbnail']="TN_";   
+
+
+//======================================================   
+
+$options['Autosize'] = ''.l10n('Autosize').''; 
+foreach ($defined_types as $type_size){
+  $value = $type_size;
+  $options[$value] = $type_size;   
+}  
+//======================================================     
+     	
   	$template->assign(
-  					array(
+  					array( 
+            'ratio' =>$img_scaled_width/$img_scaled_height ,
+            'cookies' =>  $cookies ,
+            'deriv_type' =>$deriv_type ,
+            'webmaster_type' => array(
+                                            'OPTIONS' => $options,
+                                            'SELECTED' => $autosize_parametres->webmaster_type
+                                            ),
+            'admin_type' => array(
+                                            'OPTIONS' => $options,
+                                            'SELECTED' => $autosize_parametres->admin_type
+                                            ),
+            'generic_type' => array(
+                                            'OPTIONS' => $options,
+                                            'SELECTED' => $autosize_parametres->generic_type
+                                            ),
+            'guest_type' => array(
+                                            'OPTIONS' => $options,
+                                            'SELECTED' => $autosize_parametres->guest_type
+                                            ),
+            'normal_type' => array(
+                                            'OPTIONS' => $options,
+                                            'SELECTED' => $autosize_parametres->normal_type
+                                            ),
             'DEBUG_autosize' =>  $DEBUG_autosize   ,
             'cl_visible' =>  $cl_visible,
@@ -56,5 +127,6 @@
             'theme' => $theme,
             'SCALED_WIDTH' => $img_scaled_width,
-            'SCALED_HEIGHT' => $img_scaled_height,                    
+            'SCALED_HEIGHT' => $img_scaled_height,      
+                          
             'IMG_WIDTH' 	=> $img_width,
             'IMG_HEIGHT'	=> $img_height,
@@ -68,26 +140,13 @@
             'ECHELLE_MAX' => $autosize_parametres->echelle_max,
 
-            'check_auto_w' => ($autosize_parametres->check_auto_w == 'on') ? 'checked="checked"'  : '' ,
-            'check_icon_v' => ($autosize_parametres->check_icon_v == 'on') ? 'checked="checked"'  : '' ,
+       
+            'check_icon_v' => ($autosize_parametres->check_icon_v == 'on') ? 'checked="checked"'  : ''  ,
             'check_desc_v' => ($autosize_parametres->check_desc_v == 'on') ? 'checked="checked"'  : '' ,
 
-            'webmaster_width' => $autosize_parametres->webmaster_width,
-            'webmaster_height' => $autosize_parametres->webmaster_height,
+
             'webmaster_enabled' => ($autosize_parametres->webmaster_enabled == 'on') ? 'checked="checked"'  : '' ,
-
-            'admin_width' => $autosize_parametres->admin_width,
-            'admin_height' => $autosize_parametres->admin_height,
             'admin_enabled' => ($autosize_parametres->admin_enabled == 'on') ? 'checked="checked"'  : '' ,
-
-            'generic_width' => $autosize_parametres->generic_width,
-            'generic_height' => $autosize_parametres->generic_height,
             'generic_enabled' => ($autosize_parametres->generic_enabled == 'on') ? 'checked="checked"'  : '' ,
-
-            'guest_width' => $autosize_parametres->guest_width,
-            'guest_height' => $autosize_parametres->guest_height,
-            'guest_enabled' => ($autosize_parametres->guest_enabled == 'on') ? 'checked="checked"'  : '' ,
-				 
-            'normal_width' => $autosize_parametres->normal_width,
-            'normal_height' => $autosize_parametres->normal_height,
+            'guest_enabled' => ($autosize_parametres->guest_enabled == 'on') ? 'checked="checked"'  : '' ,	
             'normal_enabled' => ($autosize_parametres->normal_enabled == 'on') ? 'checked="checked"'  : '' ,
 
Index: extensions/Autosize/js/Affiche_script.js
===================================================================
--- extensions/Autosize/js/Affiche_script.js	(revision 16682)
+++ extensions/Autosize/js/Affiche_script.js	(revision 16931)
@@ -3,1224 +3,499 @@
 // corriger   gmaps_pip.class.inc.php ajouter ligne 90 if ( !isset($_GET['slideshow']))
 //==============================================================
-(function (jQuery) {
-  jQuery(document).ready(function () {
-    //===================
-    // VARIABLES  
-    //===================
-    var theMainImage_obj = "#theMainImage";
-
-    type_src = "div";
-    old_window = { width: 0, height: 0 };
-    List_autosize = new Array();
+jQuery(document).ready(function (jQuery) {
+  //=============================================================
+  // REPONSE ACTION
+  //=============================================================
+  jQuery("#reset").click(function () {
+    location.reload();
+  });
+
+
+  //===========================================================
+  //  REPONSE TRIGGER 
+  //===========================================================
+  jQuery('#pamoorama').live('ON', function (e) {
+    jQuery(jQuery('.debug').get(1)).trigger('ON');
+    if (typeof Bandeau_bas == "undefined" || Bandeau_bas.width == 0) {
+      Bandeau_bas = infos_Description_f("#theImage");
+      Bandeau = Bandeau_bas.top;
+    }
+  });
+  //=============================================================
+  jQuery('#ret_autosize').live('ON', function (e) {
+    if (nu_img == "") nu_img = 8;
+    jQuery(jQuery('.debug').get(nu_img)).trigger('ON');
+
+  });
+
+  //==========================================================
+  jQuery("map area").mouseover(function (e) {
+    hok = this;
+
+  });
+
+  //==================================
+  // jQuery("#llgbo").trigger("ON");
+  //==================================
+  jQuery(llgbo_id).live('ON', function (e) {
+    n_id = this;
+    infos_llgbo = jQuery(llgbo_id).infos();
+    if (infos_llgbo.visible == false) return;
+
+    marges_llgbo = 0;
+    if (infos_llgbo.height > 0) {
+      infos_llgboframe1 = jQuery(llgbo_id + " div:last").infos();
+      infos_llgboframe31 = jQuery(llgbo_id + "  div:first").infos();
+      //=============================================
+      ll2 = infos_llgboframe1.width; // llgboframe1
+      ll1 = infos_llgboframe31.general.width; // llgboframe31
+      options.marges_llgbo = (ll1 - ll2);
+      infos_llgboh2 = jQuery("#llgboh2").infos();
+    }
+  });
+  //==============================
+  // jQuery("#mapPicture").trigger("ON");
+  //==============================
+  jQuery("#mapPicture").live('ON', function (e) {
+    p2 = jQuery("#infoSwitcher").infos();
+  });
+  //==============================
+  // jQuery("#map").trigger("ON");
+  //==============================
+  jQuery("#map").live('ON', function (e) {
+
+  });
+
+  //===================================
+  // jQuery("#theImage").trigger("ON");
+  //===================================
+  jQuery("#theImage").live('ON', function (e) {
+    target = e.target.id;
+
+    id = this.id;
+    theImage_init("#theImage");
+  });
+
+  /***********************
+  *
+  **********************/
+  jQuery("#theMainImage").error(function (e) {
+    alert(this.src + ' Image does not exist !!');
+  });
+
+  jQuery("#theMainImage,.preload, .next1 , ").load(function (e) {
+    if (init_img(this))
+      setTimeout(function () { Autosize_resize(true) }, 100);
     nu_img = 0;
-    tempo = 0;
-    //====================================================
-
-    var infos_theImageAndInfos = jQuery("#theImageAndInfos").infos();  // Cadre general
-    var infos_theImage = jQuery("#theImage").infos();                  // Container
-    var infos_theMainImage = jQuery(theMainImage_obj).infos();          // Image 
-    var infos_imageInfos = jQuery("#imageInfos").infos();              // Informations
-
-
-    var infos_the_page = jQuery("#the_page").infos();
-    var infos_content = jQuery("#content").infos();
-    var infos_titrePage = jQuery("#titrePage").infos();
-    var infos_imageInfoBar = jQuery("#imageInfoBar").infos();
-    var infos_theHeader = jQuery("#theHeader").infos();
-    var infos_imageToolBar = jQuery("#imageToolBar").infos();
-    var infos_body = jQuery("body").infos();
-    var infos_llgbo = jQuery("#llgbo").infos();
-    var infos_llgboh2 = jQuery("#llgboh2").infos();
-    if (typeof (options) == "undefined") {
-      options = { imageAutosize: false }
-    }
-
-    // jQuery(':Autosize');
-    old_window = { width: 0, height: 0 };
-
-    if (typeof (options) == "undefined") {
-      options = { imageAutosize: false }
-    }
-
-    var defaults = {
-      id_map: 'autosize',
-      imageAutosizeMargin: 0,
-      imageAutosize: false
-    };
-    options = jQuery.extend(defaults, options);
-
-    //=============================================================
-    // REPONSE ACTION
-    //=============================================================
-    jQuery("#reset").click(function () {
-      location.reload();
-    });
-
-    //===========================================================
-    //  REPONSE TRIGGER 
-    //===========================================================
-    jQuery('#pamoorama').live('ON', function (e) {
-      jQuery(jQuery('.debug').get(1)).trigger('ON');
-      if (typeof Bandeau_bas == "undefined" || Bandeau_bas.width == 0) {
-        Bandeau_bas = infos_Description_f("#theImage");
-        Bandeau = Bandeau_bas.top;
-      }
-    });
-    //=============================================================
-    jQuery('#ret_autosize').live('ON', function (e) {
-      if (nu_img == "") nu_img = 8;
-      jQuery(jQuery('.debug').get(nu_img)).trigger('ON');
-
-    });
-
-    //==================================
-    // jQuery("#llgbo").trigger("ON");
-    //==================================
-    jQuery("#llgbo").live('ON', function (e) {
-      infos_llgbo = jQuery("#llgbo").infos();
-      //llgboframe 
-      marges_llgbo = 0;
-
-      if (infos_llgbo.height > 0) {
-        ll2 = jQuery("#llgbo div:last").infos();
-        ll1 = jQuery("#llgbo div:first").infos();
-        ll2 = "";
-        jQuery("#llgbo div").each(function (i) {
-          if (this.id == "") return;
-          var llgbo_frame = document.getElementById(this.id);
-          this.removeAttribute("width");
-          this.removeAttribute("height");
-          ll2 = this;
-        });
-
-        ll2 = jQuery(ll2).infos();
-        ll1 = ll1.width;
-        ll2 = ll2.width - ll2.borderwidth.left - ll2.borderwidth.right;
-        marges_llgbo = (ll1 - ll2);
-        infos_llgbo.borderwidth.left = parseInt(marges_llgbo / 2);
-        infos_llgbo.borderwidth.right = parseInt(marges_llgbo / 2);
-        infos_llgbo.borderwidth.top = parseInt(marges_llgbo / 2);
-        infos_llgbo.borderwidth.bottom = parseInt(marges_llgbo / 2);
-        infos_llgboh2 = jQuery("#llgboh2").infos();
-      }
-    });
-    //==============================
-    // jQuery("#mapPicture").trigger("ON");
-    //==============================
-    jQuery("#mapPicture").live('ON', function (e) {
-      p2 = jQuery("#infoSwitcher").infos();
-    });
-    //==============================
-    // jQuery("#map").trigger("ON");
-    //==============================
-    jQuery("#map").live('ON', function (e) {
-
-    });
-
-    //===================================
-    // jQuery("#theImage").trigger("ON");
-    //===================================
-    jQuery("#theImage").live('ON', function (e) {
-      theImage_init("#theImage");
-    });
-
-    /***********************
-    *
-    **********************/
-    jQuery("#theMainImage").error(function (e) {
-      alert(this.src + ' Image does not exist !!');
-    });
-
-    jQuery("#theMainImage,.preload, .next1 , ").load(function (e) {
-      theImg = this;
-      name_src = theImg.src;
-      img_init.width = jQuery(this).width();
-      img_init.height = jQuery(this).height();
-      if (theImg.naturalWidth)
-        img_init.width = theImg.naturalWidth;
-      if (theImg.naturalHeight)
-        img_init.height = theImg.naturalHeight;
-      img_init.rapport = theImg.naturalWidth / theImg.naturalHeight;
-      nu_img = 0;
-      theMainImage_obj = "#theMainImage";
-      Autosize_resize(true);
-    });
-
-    //=================================================================
-    jQuery(document).live('gallyInterfaceReady', function (e) {
-      i = jQuery(this).text();
-      jQuery(this).trigger('ON');
-    }
+  });
+
+  //=================================================================
+  jQuery(document).live('gallyInterfaceReady', function (e) {
+    i = jQuery(this).text();
+    jQuery(this).trigger('ON');
+  }
 
           );
-    // jQuery("#theImage").trigger("OK");
-    jQuery("#theImage").live('Start_right', function (e) {
-      if (typeof Zone_image == "undefined") return
-      if (nu_img == "") nu_img = 7;
-      jQuery(jQuery('.debug').get(nu_img)).trigger('ON');
-      test_w = window.myPamoorama.autoSlideFx.to;
-      test_w = window.myPamoorama.autoScrollFx.to;
-      nf = jQuery("#pamoorama_thumb").height();
-      jQuery("#pamoorama_thumb img").width(200);
-      jQuery("#pamoorama_thumb img").height(nf);
-      // 200=window.myPamoorama.imageWidth 
-      // frame = Zone_image.container.width
-
+  // jQuery("#theImage").trigger("OK");
+  jQuery("#theImage").live('Start_right', function (e) {
+    if (typeof Zone_image == "undefined") return
+    if (nu_img == "") nu_img = 7;
+    jQuery(jQuery('.debug').get(nu_img)).trigger('ON');
+    test_w = window.myPamoorama.autoSlideFx.to;
+    test_w = window.myPamoorama.autoScrollFx.to;
+    nf = jQuery("#pamoorama_thumb").height();
+    jQuery("#pamoorama_thumb img").width(200);
+    jQuery("#pamoorama_thumb img").height(nf);
+    // 200=window.myPamoorama.imageWidth 
+    // frame = Zone_image.container.width
+    if (Zone_image.container)
       nw = (200 * Zone_image.container.width) / window.myPamoorama.imageWidth;
-      jQuery("#pamoorama_frame").width(nw);
-
-
-
-    });
-
-    jQuery("#theImage").live('Start_left', function (e) {
-      if (typeof Zone_image == "undefined") return
-      if (nu_img == "") nu_img = 7;
-      jQuery(jQuery('.debug').get(nu_img)).trigger('ON');
-      test_w = window.myPamoorama.autoSlideFx.to;
-      test_w = window.myPamoorama.autoScrollFx.to;
-      nf = jQuery("#pamoorama_thumb").height();
-      jQuery("#pamoorama_thumb img").width(200);
-      jQuery("#pamoorama_thumb img").height(nf);
-
-      nw = (200 * Zone_image.container.width) / window.myPamoorama.imageWidth;
-      jQuery("#pamoorama_frame").width(nw);
-
-    });
-
-    // Custom Event, ON to turn on a debug.
-    jQuery('.debug').live('ON', function (e) {
-
-      nu_img = jQuery(this).text();
-      jQuery('.debug').trigger('OFF');
-      jQuery(this).addClass('debugOn');
-
-    });
-
-    // On Click = debugs On
-    jQuery('.debug').live('click', function (e) {
-      i = jQuery(this).text();
-      jQuery(this).trigger('ON');
-    });
-
-    // Custom Event, Turn off a debug
-    jQuery('.debug').live('OFF', function (e) {
-      jQuery(this).removeClass('debugOn');
-    });
-
-    // on Double Click, remove the debug from the DOM
-    jQuery('.debug').live('dblclick', function () {
-      jQuery(this).fadeOut(function () { jQuery(this).remove() });
-    });
-
-    // Add another debug to the DOM
-    jQuery('#adddebugs').click(function () {
-      i = jQuery('.debug').length;
-      jQuery('<div>' + i + '</div>')
+    else
+      nw = (200 * infos_content.width) / window.myPamoorama.imageWidth;
+    jQuery("#pamoorama_frame").width(nw);
+
+
+
+  });
+
+  jQuery("#theImage").live('Start_left', function (e) {
+    if (typeof Zone_image == "undefined") return
+    if (nu_img == "") nu_img = 7;
+    jQuery(jQuery('.debug').get(nu_img)).trigger('ON');
+    test_w = window.myPamoorama.autoSlideFx.to;
+    test_w = window.myPamoorama.autoScrollFx.to;
+    nf = jQuery("#pamoorama_thumb").height();
+    jQuery("#pamoorama_thumb img").width(200);
+    jQuery("#pamoorama_thumb img").height(nf);
+
+    nw = (200 * Zone_image.container.width) / window.myPamoorama.imageWidth;
+    jQuery("#pamoorama_frame").width(nw);
+
+  });
+
+  // Custom Event, ON to turn on a debug.
+  jQuery('.debug').live('ON', function (e) {
+
+    nu_img = jQuery(this).text();
+    jQuery('.debug').trigger('OFF');
+    jQuery(this).addClass('debugOn');
+
+  });
+
+  // On Click = debugs On
+  jQuery('.debug').live('click', function (e) {
+    i = jQuery(this).text();
+    jQuery(this).trigger('ON');
+  });
+
+  // Custom Event, Turn off a debug
+  jQuery('.debug').live('OFF', function (e) {
+    jQuery(this).removeClass('debugOn');
+  });
+
+  // on Double Click, remove the debug from the DOM
+  jQuery('.debug').live('dblclick', function () {
+    jQuery(this).fadeOut(function () { jQuery(this).remove() });
+  });
+
+  // Add another debug to the DOM
+  jQuery('#adddebugs').click(function () {
+    i = jQuery('.debug').length;
+    jQuery('<div>' + i + '</div>')
           .addClass('debug')
           .appendTo('#debugsContainer');
-    });
-
-
-
-    //===========================================
-    // jQuery("#theImageAndInfos").trigger("ON");
-    //===========================================
-    jQuery("#theImageAndInfos").live('ON', function (e) {
-      infos_theImageAndInfos = jQuery("#theImageAndInfos").infos();
-
-
-    }); // fin click #theImageAndInfos ON
-
-    //==========================================
-    //
-    //==========================================
-    jQuery("#infoSwitcher, #menuSwitcher").click(function () {
-      jQuery("#llgbo").trigger("ON");
-      jQuery("#theImage").css({ textAlign: "center" });
-      nu_img = 0;
-      theImage_init("#theImage");
-      Autosize_resize(true);
-    }); // fin click infoSwitcher
-    //==================================
-    //
-    //===================================
-    jQuery('#derivativeCheckedAutosize').click(function () {
+  });
+
+
+  /*********************************
+  *
+  ********************************/
+  jQuery("#menuSwitcher,#infoSwitcher").click(function (e) {
+
+    setTimeout(function () { Autosize_resize(true) }, 10);
+    nu_img = 0;
+  });
+
+
+  //===========================================
+  // jQuery("#theImageAndInfos").trigger("ON");
+  //===========================================
+  jQuery("#theImageAndInfos").live('ON', function (e) {
+    infos_theImageAndInfos = jQuery("#theImageAndInfos").infos();
+    //   setTimeout(function () { Autosize_resize(true) }, 100);
+    nu_img = 0;
+  }); // fin click #theImageAndInfos ON
+  jQuery("#theImageAndInfos").resize(function (e) {
+
+    nu_img = 0;
+  });
+
+  //==================================
+  //
+  //===================================
+  jQuery('#derivativeCheckedAutosize').click(function () {
+    pathnames = jQuery(this).attr("href").split(":");
+    try {
+      eval(pathnames[1]);
+    } catch (e) {
+      n = false;
+    }
+  }); // fin click derivativeCheckedAutosize
+  //====================================================
+  jQuery("#derivativeSwitchBox a").click(function () {
+    var theImg = document.getElementById(theMainImage_Id.replace("#", ""));
+    if (theImg) {
       pathnames = jQuery(this).attr("href").split(":");
+
       try {
         eval(pathnames[1]);
+        n = true;
       } catch (e) {
         n = false;
       }
-    }); // fin click derivativeCheckedAutosize
-    //====================================================
-    jQuery("#derivativeSwitchBox a").click(function () {
-      var theImg = document.getElementById("theMainImage");
-      if (theImg) {
-        pathnames = jQuery(this).attr("href").split(":");
-
-        try {
-          eval(pathnames[1]);
-          n = true;
-        } catch (e) {
-          n = false;
-        }
-        n = false;
-        infos_theMainImage = jQuery(theMainImage_obj).infos();
-        infos_theImage = jQuery("#theImage").infos();
-        theImg.removeAttribute("width");
-        theImg.removeAttribute("height");
-        rapport = parseInt(img_init.width) / parseInt(img_init.height);
-        if (n == true) {
-          Autosize_resize(true);
-        } else {
-          var nw = "100% x 100%".split("x");
-          if (jQuery(this).text().match(RegExp("x", "gi"))) {
-            nw = jQuery(this).text().split("(")[1].split(")")[0];
-            nw = nw.split("x");
-            jQuery("#theImage").css({ marginRight: "auto", marginLeft: "auto", textAlign: "center" });
-
-            if (theImg.naturalWidth)
-              img_init.width = theImg.naturalWidth;
-            if (theImg.naturalHeight)
-              img_init.height = theImg.naturalHeight;
-
-            wx = parseInt(nw[0]);
-            wh = parseInt(wx / rapport);
-            //jQuery("#theImage").css("height", wh + "px");
-            jQuery(theImg).width(wx);
-            jQuery(theImg).height(wh);
-          }
-        }
-      }
-
-    });  // fin click #derivativeSwitchBox a
-
-    //=========================================================================
-    Autosize_init = function (name, value) {
-      // default configuration properties
-      var defaults = {
-        id_map: 'autosize'
-      };
-      options = jQuery.extend(defaults, options);
-      infos_theImageAndInfos = jQuery("#theImageAndInfos").infos(); // Cadre general
+
+      infos_theMainImage = jQuery(theMainImage_Id).infos();
       infos_theImage = jQuery("#theImage").infos();
-
-      infos_theMainImage = jQuery(theMainImage_obj).infos();         // Cadre general
-      if (infos_theMainImage.nodeName) {
-
-      }
-      if (infos_theMainImage.width == 0) {
-        infos_theMainImage = jQuery("#theImage img").infos();
-        if (infos_theMainImage.id == "")
-          jQuery("#theImage img").attr("id", "theMainImage");
-        infos_theMainImage = jQuery(theMainImage_obj).infos();
-      }
-      infos_imageInfos = jQuery("#imageInfos").infos();             // Cadre general
-      infos_the_page = jQuery("#the_page").infos();
-      infos_content = jQuery("#content").infos();
-      infos_titrePage = jQuery("#titrePage").infos();
-      infos_imageInfoBar = jQuery("#imageInfoBar").infos();
-      infos_theHeader = jQuery("#theHeader").infos();
-      infos_imageToolBar = jQuery("#imageToolBar").infos();
-      infos_imageHeaderBar = jQuery("#imageHeaderBar").infos();
-      Zone_Affichage = jQuery("#theImage").infos();
-
-      jQuery.cookie('path', cookie_path, { path: cookie_path });
-      typeMap = jQuery.cookie('picture_map');
-      typeSave = jQuery.cookie('picture_deriv');
-      old_img = jQuery.cookie('img');
-      old_img_h = jQuery.cookie('img_h');
-      old_img_w = jQuery.cookie('img_w');
-      old_window_height = jQuery.cookie('window_height');
-      old_window_width = jQuery.cookie('window_width');
-      //============================================================
-      img_init = { height: img_height, width: img_width };  // taille initiale
-      img_defaut = { height: scaled_height, width: scaled_width };
-      img_reelle = { height: img_height, width: img_width };
-      img_finale = { height: 0, width: 0 };
-      img_top = "0";
-      rapport = -1;
-      marges_llgbo = 0;
-      //=============================================================
-      Type_Img = "";
-      nopano = false;
-      rapport = parseInt(img_init.width) / parseInt(img_init.height);
-      old_window = { width: 0, height: 0 };
-    } // Autosize_init
-    //===========================================================================
-    Autosize_resize = function (force, parametres) {
-      if (typeof rapport == "undefined") return;
-      if (force && force == true) old_window.width = 0;
-      id_map = jQuery(theMainImage_obj).attr("usemap");
-      if (typeof id_map == "undefined") id_map = jQuery("#theImage").attr("usemap");
-      if (typeof id_map == "undefined") id_map = "Autosize";
-      if (options.id_map) {
-        //  id_map = options.id_map;
-      }
-      if (id_map) {
-        if (id_map.match(RegExp("#map", "gi")) || id_map.match(RegExp("original", "gi"))) {
-          return true;
-        }
-      }
-
-      if (options.imageAutosize) {
-        // Wait_Affichage();
-        return true; //stripped
-      }
-
-      if (typeof cl_visible == "undefined") return true;
-      if (!cl_visible == true) { return true; }
-      var chk = eval(user_status + "_enabled");
-      if (chk == "") { return true; }
-      //================================================================= 
-      var winwidth = infos_body.width;
-      var winheight = infos_body.height;
-      if (Type_Img == "pamoorama") {
-        theMainImage_obj = "#pamoorama";
-        Zone_image = Calcul_Image(infos_imageInfos.visible == false);
-      } else {
-        Zone_image = Calcul_Image(infos_imageInfos.visible == false);
-      }
-      //=================================================================
-      old_window = jQuery(window).infos();
-      //========= Récupération des informations =============       
-      var Licence = jQuery(".licencetag");
-      infos_Licence = jQuery(".licencetag").infos();
-      //=================================================================
-      switch (Type_Img) {
-        case "map":
-          Set_Map(true);
-          break
-        case "panorama":
-          if (!theMainImage_obj) {
-            theMainImage_obj = "#theMainImage";
-            if (theMainImage_obj.length > 0)
-              return;
-            theMainImage_obj = jQuery().Get_Img_Maxi("#Panorama img[alt]");
-
-            if (theMainImage_obj.length > 0)
-              theMainImage_obj = theMainImage_obj[0];
-            else
-              theMainImage_obj = jQuery().Get_Img_Maxi("#Panorama img[alt]");
-          }
-          infos_theImage = jQuery(theMainImage_obj).infos();
-          infos_the_page = jQuery("#the_page").infos();
-          jQuery("#theImage").height(infos_theImage.height);
-          img_finale.height = infos_theImage.height;
-          break
-        case "img":
-
-          if (!theMainImage_obj) return true;
-          if (theme.match(RegExp("luciano", "g"))) {
-            theMainImage_obj = "#the_page #The_MainImage";
-          }
-
-          infos_the_page = jQuery("#the_page").infos();
-
-
-          break
-        case "img_autre":
-          if (!theMainImage_obj) {
-            if (DEBUG_autosize == "true") alert("The_MainImage=null");
-            return true;
-
-          }
-          infos_theImage = jQuery(theMainImage_obj).infos();
-          infos_the_page = jQuery("#the_page").infos();
-
-
-          break
-        case "embed":
-          //
-          if (infos_img.width == 0)
-            infos_img = jQuery("#thePicturePage").infos();
-          if (infos_img.width == 0)
-            infos_img = jQuery("#the_page").infos();
-          infos_theImage = infos_img;
-          infos_the_page = jQuery("#the_page").infos();
-          Bandeau_bas.height = Bandeau_bas.top;
-
-          iph1 = jQuery("#theImage div").infos();
-          if ((winheight - iph1.bottom) > 0)
-            Bandeau_bas.height = (winheight - iph1.bottom) + 50;
-          else
-            Bandeau_bas.height = 50;
-
-
-          if (rapport < 0) {
-            img_height = infos_img.height;
-            img_width = infos_img.width;
-            img_reelle.height = img_height;
-            img_reelle.width = img_width;
-          }
-
-          break
-        case "charlie":
-          img_reelle = { height: img_height, width: img_width };
-          infos_img = jQuery(theMainImage_obj).infos(); ;
-          infos_the_page = jQuery("#the_page").infos();
-          if (rapport < 0) {
-            img_height = parseInt(infos_img.height);
-            img_width = parseInt(infos_img.width);
-            img_reelle.height = parseInt(infos_img.height);
-            img_reelle.width = parseInt(infos_img.width);
-          }
-          break
-
-
-        case "pamoorama":
-          img_reelle = { height: img_height, width: img_width };
-          //=========================================================
-          img_reelle.height = img_height;
-          img_reelle.width = Zone_Affichage.width;
-          if (typeof myPamoorama != "undefined") theMainImage_obj = myPamoorama.image;
-          infos_theImage = jQuery("#pamoorama").infos();
-          infos_theImage.height = infos_theImage.height;
-          infos_the_page = jQuery("#the_page").infos();
-          break
-      }
-      //================= Vérification Taille image minimun autorisée ========
-      MinWidth = jQuery(theMainImage_obj).css("minWidth");
-      if (MinWidth == "0px")
-        MinWidth = mini_width;
-      MinHeight = jQuery(theMainImage_obj).css("minHeight");
-      if (MinHeight == "0px")
-        MinHeight = mini_height;
-
-      MaxWidth = jQuery(theMainImage_obj).css("maxWidth");
-      if (MaxWidth == "0px")
-        MaxWidth = winwidth;
-      MaxHeight = jQuery(theMainImage_obj).css("maxHeight");
-      if (MaxHeight == "0px")
-        MaxHeight = mwinheight;
-
-      //=============== Vérification taille minimale  autorizée ======================
-      var miniWidth = jQuery(theMainImage_obj).Get_Val_int(MinWidth, mini_width);
-      var miniHeight = jQuery(theMainImage_obj).Get_Val_int(MinHeight, mini_height);
-      if (winwidth < mini_width2) mini_width2 = winwidth;
-
-      var miniWidth2 = jQuery(theMainImage_obj).Get_Val_int(MinWidth, mini_width2);
-      var miniHeight2 = jQuery(theMainImage_obj).Get_Val_int(MinHeight, mini_height2);
-
-
-      var maxWidth = jQuery(theMainImage_obj).Get_Val_int(MaxWidth, winwidth, "0");
-      maxHeight = jQuery(theMainImage_obj).Get_Val_int(MaxHeight, winheight, "0");
-
-      mini_width = parseInt(miniWidth);
-      mini_height = parseInt(miniHeight);
-      img_reelle.width = parseInt(img_reelle.width);
-      if (img_reelle.width < mini_width)
-        return true;
-      img_reelle.height = parseInt(img_reelle.height);
-      if (img_reelle.height < parseInt(mini_height))
-        return true;
-
-      //=============== Zone d'affichage ============================  
-      Zone_Affichage.width = Zone_image.container.width;
-      Zone_Affichage.height = Zone_image.container.height;
-
-      var Licence = jQuery(".licencetag");
-      infos_Licence = jQuery(".licencetag").infos();
-
-      //====================================================
-      if (options.imageAutosizeMargin > 0) Marge_Basse = options.imageAutosizeMargin;
-      else Marge_Basse = parseInt(marge_basse || 0); // hors bandeau
-      //==========================================================================
-
-
-
-      //=================================================
-      if (Zone_Affichage.height < mini_height2)
-        Zone_Affichage.height = mini_height2;
-      if (Zone_Affichage.width < mini_width2)
-        Zone_Affichage.width = mini_width2;
-      //=================================================
-      var height_user = eval(user_status + "_height");
-      var width_user = eval(user_status + "_width");
-      var reg1 = new RegExp("%", "g");
-      //=============================================================     
-      if (height_user.match(reg1))
-        Image_height = img_reelle.height * parseInt(height_user) / 100;
+      theImg.removeAttribute("width");
+      theImg.removeAttribute("height");
+
+      var nw = "100% x 100%".split("x");
+      if (jQuery(this).text().match(RegExp("x", "gi"))) {
+        nw = jQuery(this).text().split("(")[1].split(")")[0];
+        nw = nw.split("x");
+        init_img(theImg);
+        wx = parseInt(nw[0]);
+        wh = parseInt(wx / rapport);
+        //jQuery("#theImage").css("height", wh + "px");
+        jQuery(theImg).width(wx);
+        jQuery(theImg).height(wh);
+        set_cl(useMap == "#Autosize");
+        Set_llbgo();
+      }
+
+    }
+
+  });  // fin click #derivativeSwitchBox a
+
+  jQuery("input").click(function () {
+    if (this.name.match(RegExp("_enabled", "gi"))) {
+      sel = "[name*=" + this.name + "]";
+      obj = jQuery("tr" + sel);
+
+      if (this.checked)
+        obj.css({ backgroundColor: "green", color: "white" });
       else
-        Image_height = parseInt(height_user);
-      echelle_max = parseFloat(echelle_max, '3');
-      var echelle = parseFloat(Image_height / img_reelle.height, 3);
-
-      if (echelle > echelle_max) { echelle = echelle_max; }
-
-      Image_height = parseInt(img_reelle.height * echelle);
-      Image_width = parseInt(img_reelle.width * echelle);
-
-      if (check_auto_w == 'checked="checked"') {
-        //==== largeur à atteindre ===
-        var width_user = eval(user_status + "_width");
-        // Largeur maximale en fonction du statut
-        if (width_user.match(reg1))
-        // pourcentage
-          Image_width = Zone_image.container.width * parseInt(width_user) / 100;
-        else
-          Image_width = parseInt(width_user);
-
-      Image_height = parseInt(Image_width / rapport);
-      } else {
-      Image_width = parseInt(Image_height * rapport);
-      }
-      //====================================================
-      //  Zone_image.image.height = Image_height;
-      //  Zone_image.image.width = Image_width;
-      //======================================================================
-      set_cl();
+        obj.css({ backgroundColor: "red", color: "white" });
+
+      return;
+    }
+
+
+
+    return;
+
+
+
+
+  });
+
+  //====================================
+  Autosize_init = function (name, value) {
+    img_defaut = { height: options.scaled_height, width: options.scaled_width };
+    img_reelle = { height: options.img_height, width: options.img_width };
+    img_init = { height: options.img_height, width: options.img_width };  // taille initiale
+
+    img_finale = img_init;
+    rapport = parseInt(img_init.width) / parseInt(img_init.height);
+    useMap = infos_theMainImage.useMap; // #mapmedium
+    Type_Img = "";
+    nopano = false;
+
+    useMap = cookies.pictureMap; // #mapxxx
+    typeSave = cookies.typeSave; //picturederiv xxx
+
+
+    old_img = cookies.imgSrc;
+    old_window_height = cookies.windowHeight || jQuery(window).height();
+    old_window_width = cookies.windowWidth || jQuery(window).width();
+    old_img_h = cookies.imgHeight;
+    old_img_w = cookies.imgWidth;
+
+    var theImg = document.getElementById(theMainImage_Id.replace("#", ""));
+    theImg.useMap = useMap;
+
+
+  } // Autosize_init
+  //===========================================================================
+  Autosize_resize = function (force, parametres) {
+    theImage_init();
+
+    if (Get_dimensions(force, parametres)) {
+
+      jQuery(theMainImage_Id).height(Zone_image.image.height);
+      jQuery(theMainImage_Id).width(Zone_image.image.width);
+      jQuery("#theImageAndInfos").css({ height: "auto" });
+      jQuery("#theImage").css({ height: "auto" });
+      //  jQuery("#theImage").width(Zone_image.container.width);
+      // jQuery("#theImage").width("auto");
       Set_Pamoorama();
-      jQuery("#theImage").width(Zone_image.container.width);
-      jQuery("#theImage").height(Zone_image.container.height);
-      jQuery(theMainImage_obj).height(Zone_image.image.height);
-      jQuery(theMainImage_obj).width(Zone_image.image.width);
-      
-      return true;
-
-      //===============================================================
-      jQuery("#theImage").width(Zone_Affichage.width);
-      jQuery("#theImage").height(Zone_Affichage.height);
-      jQuery(theMainImage_obj).removeAttr("width");
-      jQuery(theMainImage_obj).css({ height: Image_height }); //image
-
-      //================================================================
-
-      align_auto = "center";
-      if (jQuery("#theImg").css("textAlign"))
-        align_auto = jQuery("#theImg").css("textAlign");
-
-
-      var marges = 0;
-
-      if (typeof (infos_img) != "undefined") {
-        widthmin -= infos_img.borderwidth.left || 0;
-        widthmin -= infos_img.borderwidth.right || 0;
-      }
-      widthmin -= marges;
-      if (typeof Bandeau_t != "undefined") {
-        widthmin -= (Bandeau_t.borderwidth.left + Bandeau_t.borderwidth.left);
-        Image_width -= (Bandeau_t.borderwidth.left + Bandeau_t.borderwidth.left);
-      } else {
-
-        jQuery.autosize.resize();
-      }
-      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);
-      }
-
-
-
-
-      //===================================================
-
-      img_finale.height = Image_height;
-      img_finale.width = Image_width;
-      if (theme.match(RegExp("stripped", "gi"))) {
-        img_finale.width -= (llgboframe.top * 2);
-        if (rapport > 0) img_finale.height = (img_finale.width / rapport);
-        else img_finale.height -= (llgboframe.top * 2);
-
-      }
-      zoom = echelle;
-      if (typeof (llgboframe) != "undefined" && llgboframe.height > 0) {
-        //=============LLGBO2 ===========================
-        t1 = llgboframe;
-        if (!theMainImage_obj.src) {
-          theMainImage_obj = jQuery("#llgbo").find("img").get(0)
-          if (!theMainImage_obj.src) {
-            theMainImage_obj = jQuery("#theImage").find("div").get(0)
-          }
-        }
-        if (theMainImage_obj.src) {
-          wingbo = img_finale.width;
-          heightgbo = img_finale.height;
-          if (Type_Img == "panorama") {
-            heightgbo = infos_theImage.height;
-            img_finale.height = infos_theImage.height;
-          }
-
-          img_finale.width -= marges_llgbo;
-          if (jQuery("#slideshow").infos().width > 0) {
-            img_finale.height -= (marges_llgbo * 1.5);
-          } else {
-            img_finale.height -= marges_llgbo
-          }
-
-
-          if (wingbo > winwidth) {
-            jQuery("#llgbo").width(winwidth);
-            jQuery("#llgbo").height(winheight);
-            jQuery("#llgbo").css("width", winwidth + "px");
-            jQuery("#llgbo").css("height", winheight + "px");
-          }
-          else {
-            jQuery("#llgbo").width(wingbo);
-            jQuery("#llgbo").height(heightgbo);
-            jQuery("#llgbo").css("width", wingbo + "px");
-            jQuery("#llgbo").css("height", heightgbo + "px");
-          }
-
-          a0 = jQuery("area[rel!=up][rel!=prev][rel!=next]");
-          a1 = jQuery("area[rel=prev]");
-          a2 = jQuery("area[rel=next]");
-          a3 = jQuery("area[rel=up]");
-          nb_zone = 3;
-          if (a1.length == 0) {
-            nb_zone -= 1;
-          }
-          if (a2.length == 0) {
-            nb_zone -= 1;
-          }
-
-
-          var Largeur_zone = (img_finale.width / nb_zone);
-          var Hauteur_zone = (img_finale.height);
-          var init_zone = 0;
-
-          if (a1.length > 0) {
-            coord = { x0: init_zone, y0: 0, x1: Largeur_zone, y1: Hauteur_zone };
-
-            jQuery("area[rel=prev]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" });
-            init_zone += Largeur_zone;
-          }
-
-          coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: img_finale.height };
-
-          if (a0.length > 0) {
-            jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1 / 2) + "'" });
-            jQuery(a0).attr({ coords: "'" + coord.x0 + "," + (coord.y1 / 2) + "," + coord.x1 + "," + (coord.y1) + "'" });
-          } else {
-            jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1) + "'" });
-          }
-          init_zone += Largeur_zone;
-
-          if (a2.length > 0) {
-            coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: img_finale.height };
-            jQuery("area[rel=next]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" });
-          }
-          //    jQuery("#theImage").height(heightgbo + marges_llgbo / 2);
-        }
-      }
-
-      //================ Zone affichage =========================
-
-      //  jQuery("#theImage").css("top", "0px");
-      jQuery("#standard").css("top", 0 + "px");
-      jQuery("#comments").css("top", 0 + "px");
-      //========== Image Remise à l'échelle =======================
-
-      img_finale.height = parseInt(img_finale.height);
-      img_finale.width = parseInt(img_finale.width);
-      //=========================================================================
-      //=== cadre = theImage
-      if (theme.match(RegExp("simple", "gi"))) {
-        jQuery("#theImage").width(Zone_Affichage.width); //centrer simple black
-        jQuery("#theImage").css({ width: Zone_Affichage.width + "px",
-          marginLeft: "auto"
-        });
-
-      } else if (theme.match(RegExp("sobre", "gi")) || theme.match(RegExp("hr_", "gi")) || theme.match(RegExp("Mont", "gi"))) {
-        jQuery("#theImage").css({ width: "auto", marginLeft: "auto" });
-      } else if (theme.match(RegExp("saruka", "gi"))) {
-
-        jQuery("#theImage").css({ width: Zone_Affichage.width + "px" });
-      } else if (theme.match(RegExp("elegant", "gi"))) {
-
-        // jQuery("#theImage").css("width", "auto");
-        jQuery("#theImage").css({ height: Zone_Affichage.height + "px", width: "auto" }); //conteneur
-
-      } else {
-        jQuery("#theImage").css("width", "auto");
-
-      }
-      // ;
-
-      if (Type_Img == "panorama" || Type_Img == "pamoorama") {
-        img_finale.height = infos_theImage.height;
-        Zone_Affichage.height = img_finale.height;
-
-      }
-
-      if (typeof (gmaps) != "undefined") {
-        Gmap_ = gmaps.maps[0];
-        if (Gmap_.sizeMode == 'A') {
-          jQuery("#iGMapsIcon").css({ width: old_window.width * 0.8 + "px", height: old_window.height * 0.8 + "px" });
-
-        }
-      }
-      //============= flv,mov,mpg  ok
-      /* wmv nok
-      * avi nok
-      //===========================================
-      */
-      if (Type_Img == "charlie") {
-        t1 = jQuery("#charlie").infos();
-
-        /**/
-
-        pdf = 0;
-        jQuery("#charlie div").each(function (i) {
-
-
-          p1 = jQuery(this).infos();
-          pdf += p1.padding.right + p1.padding.left;
-        });
-        img_finale.width -= pdf;
-
-        jQuery("#charlie").css({
-          width: img_finale.width + pdf + "px",
-          height: img_finale.height + "px",
-          marginLeft: "auto"
-        });
-
-
-        if (MainImage.length > 0) {
-          img_finale.height = parseInt(img_finale.width / rapport);
-          img_finale.height -= 30;
-          img_finale.width = rapport * img_finale.height;
-
-
-          MainImage.width(img_finale.width);
-          MainImage.height(img_finale.height);
-          jQuery("#embedplayer").width(300);
-          jQuery("#embedplayer").height(15);
-        } else {
-          jQuery("#player").css("width", img_finale.width + "px");
-          jQuery("#player").css("height", img_finale.height + "px");
-
-          jQuery("#embedplayer").css("width", img_finale.width + "px");
-          jQuery("#embedplayer").css("height", img_finale.height + "px");
-
-          jQuery("embed").css({ width: img_finale.width + "px",
-            height: img_finale.height + "px"
-          });
-          jQuery("object").css({ width: img_finale.width + "px",
-            height: img_finale.height + "px"
-          });
-          jQuery("video").css({ width: img_finale.width + "px",
-            height: img_finale.height + "px"
-          });
-
-
-
-          jQuery("video").height(img_finale.height);
-          jQuery("video").width(img_finale.width);
-
-          jQuery("object").width(img_finale.width);
-          jQuery("object").height(img_finale.height);
-          //jQuery("#theImage").height(img_finale.height + Bandeau_bas.height); //??             
-
-          jQuery(theMainImage_obj).height(img_finale.height);
-          jQuery("#theImage").css("height", "auto");
-        }
-
-
-      } else if (Type_Img == "embed") {
-
-        if (MainImage.length > 0) {
-          img_finale.height = parseInt(img_finale.width / rapport);
-          img_finale.height -= 30;
-          img_finale.width = rapport * img_finale.height;
-
-
-          MainImage.width(img_finale.width);
-          MainImage.height(img_finale.height);
-          jQuery("#embedplayer").width(300);
-          jQuery("#embedplayer").height(15);
-        } else {
-          jQuery("#theImage").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") {
-        if (typeof asp_options != "undefined")
-          n = asp_options;
-        n1 = jQuery("#Panorama div").width();
-        jQuery(".panorama-viewport").css("margin", "auto");
-        n = infos_imageToolBar;
-
-
-      } else if (Type_Img == "pamoorama") {
-        Set_Pamoorama();
-
-
-
-
-      } else if (theMainImage_obj != null && theMainImage_obj.src) {
-        //--- background ?? ---
-        jQuery(theMainImage_obj).height(img_finale.height);
-        jQuery(theMainImage_obj).width(img_finale.width);
-        jQuery(theMainImage_obj).css({ height: img_finale.height + "px ",
-          width: img_finale.width + "px "
-        });
-
-
-      } else {
-        //===map ? luciano ===
-        //   jQuery(theMainImage_obj).css({ height: img_finale.height + "px ",  width: img_finale.width + "px });
-        //   jQuery(theMainImage_obj).height(img_finale.height );
-        //   jQuery(theMainImage_obj).width(img_finale.width );
-        //   jQuery(theMainImage_obj).attr({ width: img_finale.width  });
-        h = img_finale.height;
-        h = Zone_Affichage.height - Zone_Affichage.borderwidth.top - Zone_Affichage.borderwidth.bottom;
-        h -= (infos_theImage.borderwidth.bottom + infos_theImage.borderwidth.top);
-
-        jQuery(theMainImage_obj).attr({ height: h - 3 }); //image
-        if (theme.match(RegExp("elegant", "gi"))) {
-          return true;
-
-        }
-        if (theme.match(RegExp("luciano", "g"))) {
-          imgl = 180;
-          l = Zone_Affichage.left;
-
-          jQuery(".imageNumber").css({ left: l + "px"
-
-          });
-          jQuery("#theImage" + " #theImg IMG").css({ height: img_finale.height + "px ",
-            width: (img_finale.width - imgl) + "px ", marginTop: "0px"
-          })
-        }
-
-      }
-
-      var theImg = document.getElementById("theMainImage");
-      if (theImg) {
-        theImg.removeAttribute("width");
-        theImg.removeAttribute("height");
-        jQuery(theMainImage_obj).css("width", img_finale.width + "px");
-      }
-
-      jQuery("#navThumbPrev").css({ overflow: "hidden" });
-      jQuery("#navThumbNext").css({ overflow: "hidden" });
-      n = typeof inittoolbar;
-      if (Type_Img == "map") {
-        jQuery("#navThumbNext").css({ display: 'none' });
-        jQuery("#navThumbPrev").css({ display: 'none' });
-        jQuery("#theImage").css({ marginTop: infos_imageToolBar.height + "px", marginLeft: "0px",
-          width: winwidth + "px",
-          height: winheight + "px"
-        });
-        //mapPicture 
-      }
-      try {
-        if (theme.match(RegExp("gally", "gi"))) {
-          if (typeof inittoolbar == "function") {
-            if (typeof (currentTab) == "undefined") inittoolbar();
-            else initializeImageMode("resize");
-          } else {
-            tp = gallyPP.getImageProp();
-            if (typeof (GallyPP) == "function")
-              gallyPP = new GallyPP();
-
-            iph = jQuery("#imageHeaderBar").infos();
-            jQuery("#imageToolBar").css({ top: iph.bottom + "px", position: "absolute" });
-            jQuery("#theImage").width(winwidth);
-          }
-          //===========================================================================
-          if (jQuery("#navThumbPrev").length > 0) {
-            jQuery("#navThumbPrevContainer").css({ left: "0px"
-            });
-          }
-          if (jQuery("#navThumbNext").length > 0) {
-            jQuery("#navThumbNextContainer").css({ left: "0px"
-            });
-          }
-          //=============================================================================
-          if (!theme.match(RegExp("lapis", "gi"))) {
-            if (typeof initializeImageMode == "function") {
-              initializeImageMode("resize");
-            }
-
-          }
-
-        } else if (theme.match(RegExp("simple", "g"))) {
-
-          jQuery("#imageToolBar").css({ position: "static" });
-
-          infos_imageInfoBar = jQuery("#imageInfoBar").infos();
-          if (infos_imageInfoBar.bottom < infos_img.bottom) {
-            //   jQuery("#imageInfoBar").height(infos_img.bottom);
-          }
-
-        } else {
-
-          //    jQuery("#imageToolBar").css("position", "static");
-        }
-      } catch (e) {
-
-      }
-      zoom = img_finale.height / img_height;
-      h0 = jQuery("#content").height();
-      if (h0 == null) {
-        h0 = winheight - Zone_Affichage.top;
-      }
-      h1 = (h0 - img_finale.height) / 2;
-      //  jQuery("#theImage").css({ marginTop: h1 + "px" });
-
-      zoom = parseInt(zoom * 100);
-      jQuery('#zoom ').val(zoom);
-      set_cl();
-
-
-      //  --- réglage de la hauteur de page en fonction du copyright-----------
-      if (typeof (pos_copyright) == "undefined") pos_copyright = jQuery("#copyright").infos();
-
-      if (theme.match(RegExp("stripped", "gi"))) {
-        var TitleBox = jQuery("#imageTitleContainer");
-        if (TitleBox.length != 0) TitleBox.css("width", img_finale.width + "px");
-      } else {
-
-      }
-
-
-      /*
-      if (!theme.match(RegExp("luciano", "gi"))) {
-      jQuery("#linkNext").css({ height: "80px", width: "200px", overflow: "hidden" });
-      jQuery("#linkPrev").css({ height: "80px", width: "200px", overflow: "hidden" });
-      jQuery(".navThumb img").css({ height: "80px", width: "", overflow: "hidden" });
-      }
-      */
-      infos_frame = jQuery("#theImage").infos();
-      if (theme.match(RegExp("stripped", "gi"))) {
-        /*
-        infos_theImageBox = jQuery("#theImageAndTitle").infos();
-        p1 = jQuery(".randomButtons").infos();
-        p2 = jQuery("#imageHeaderBar").infos();
-        p3 = infos_content.top;
-        p1 = options.imageAutosizeTitle;
-
-        jQuery("#theImage").width("width", infos_theImageBox.width + "px");
-        //jQuery("#theImageAndTitle").css("position", "relative");
-        jQuery("#content").css({ position: "relative", top: "10px", marginTop: "0px",
-        paddingTop: "0px", textAalign: "center", marginLeft: "auto"
-        });
-
-        jQuery("#theImageAndTitle").css({ position: "relative", top: "0px", marginTop: "0px",
-        paddingTop: "0px", marginLeft: "auto"
-        }); */
-        t1 = infos_theImageBox.top;
-        l1 = infos_theImageBox.left;
-        // infos_theImageBox = jQuery("#theImage").infos();
-
-      } else {
-
-        t1 = infos_frame.top;
-        l1 = infos_frame.left;
-        infos_theImageBox = jQuery("#theImage").infos(); //theImage
-      }
-      infos_theImageBox.margin.margin = infos_frame.margin.margin;
-      infos_theImageBox.top = t1;
-      infos_theImageBox.left = l1;
-      //  infos_theImageBox.position = "absolute";
-
-      Window_Affichage = infos_theImageBox;
-      if (DEBUG_autosize == "_true") {
-        //   jQuery("#theImage").css("border", "solid green");
-
-        jQuery("#Debug5").css({ background: "red",
-          position: "absolute",
-          border: "green solid 2px",
-          textAlign: align_auto,
-          margin: "auto",
-          top: Window_Affichage.top + "px",
-          left: Window_Affichage.left + "px",
-          width: Window_Affichage.width + "px",
-          height: Window_Affichage.height + "px"
-        }); //red
-        jQuery("#Debug4").css({ top: infos_frame.bottom - infos_description.height + "px" }); //green
-      }
-
-      //Wait_Affichage();
-
-      return true;
-      //_____________________________________________________   
-    }; // Autosize 
-
-
-
-    /********************************************
-    *  window unLOAD
-    ********************************************/
-    jQuery(window).unload(function () {
-      try {
-        if (typeof theMainImage_obj != "undefined") {
-          var theImg = document.getElementById("theMainImage");
-          jQuery.cookie('img', theImg.src, cookie_path); // créer un cookie avec une valeur
-          theImg.useMap = theImg.useMap || "autosize";
-
-          jQuery.cookie('picture_map', theImg.useMap, { path: cookie_path });
-          jQuery.cookie('img_h', jQuery(theMainImage_obj).height(), { path: cookie_path });
-          jQuery.cookie('img_w', jQuery(theMainImage_obj).width(), { path: cookie_path });
-
-          if (typeof Window_Affichage != "undefined") {
-            jQuery.cookie('window_height', Window_Affichage.height, { path: cookie_path });
-            jQuery.cookie('window_width', Window_Affichage.width, { path: cookie_path });
-          }
-        }
-      } catch (r) {
-
-      }
-
-    }); //unload
-
-    /********************************************
-    *  window LOAD
-    ********************************************/
-    jQuery(window).load(function () {
-      href = location.href;
-      var aff_ok = false;
-
-      DEBUG_autosize = (typeof DEBUG_autosize != "undefined") ? DEBUG_autosize : "false";
-      if (DEBUG_autosize == "true") {
-        for (var i = 0; i < 10; i++) {
-          jQuery('#adddebugs').click();
-        }
-        jQuery(jQuery('.debug').get(i - 1)).click();
-      }
-
-      /*
-      jQuery.post(href, function (data) {
-      nu_img--;
-      if (nu_img < 0) nu_img = 9;
-      jQuery(jQuery('.debug').get(nu_img)).trigger('ON');
-      //alert("Data Loaded: " + data);
-      Wait_Affichage();
+
+      set_cl(true);
+    } else {
+      Set_Pamoorama();
+      set_cl(false);
+    }
+    Set_llbgo(true);
+    return true;
+
+    //_____________________________________________________   
+  }; // Autosize 
+
+  Save_cookies = function (parametres) {
+    if (parametres.typeSave) document.cookie = 'picture_deriv=' + parametres.typeSave + ';path="' + "/" + '" ';
+    if (parametres.typeSave) jQuery.cookie('picture_deriv', parametres.typeSave, { path: "/" });
+    if (parametres.pictureMap) jQuery.cookie('picture_map', parametres.pictureMap, { path: "/" });
+    if (parametres.imgSrc) jQuery.cookie('img', parametres.imgSrc, { path: "/" });
+
+    if (parametres.imgHeight) jQuery.cookie('img_h', infos_theMainImage.height, { path: "/" });
+    if (parametres.imgWidth) jQuery.cookie('img_w', infos_theMainImage.width, { path: "/" });
+    if (parametres.windowHeight) jQuery.cookie('window_height', Window_Affichage.height, { path: "/" });
+    if (parametres.windowWidth) jQuery.cookie('window_width', Window_Affichage.width, { path: "/" });
+  }
+
+  Get_cookies = function () {
+    parametres = {
+      typeSave: jQuery.cookie('picture_deriv'),
+      pictureMap: jQuery.cookie('picture_map'),
+      imgSrc: jQuery.cookie('img'),
+
+      imgHeight: jQuery.cookie('img_h'),
+      imgWidth: jQuery.cookie('img_w'),
+      windowHeight: jQuery.cookie('window_height'),
+      windowWidth: jQuery.cookie('window_width')
+    }
+    return parametres;
+  }
+
+  /********************************************
+  *  window unLOAD
+  ********************************************/
+  jQuery(window).unload(function () {
+    try {
+      if (typeof theMainImage_Id != "undefined") {
+
+        useMap = options.useMap;
+        pictureMap = jQuery.cookie('picture_map');
+        typeSave = jQuery.cookie('picture_deriv');
+
+        old_img = jQuery.cookie('img');
+        old_window_height = jQuery.cookie('window_height');
+        old_window_width = jQuery.cookie('window_width');
+        old_img_h = jQuery.cookie('img_h');
+        old_img_w = jQuery.cookie('img_w');
+        set_cookies({
+
       });
-      */
-      //=========================================================       
-      if (typeof img_width == "undefined") {
-        if (List_autosize.length == 0) return;
-        wait_resize = false;
-        if (List_autosize_resize()) Wait_Affichage();
-        return true;
-      }
-      //============================================================
-      Autosize_init();
-      Bandeau_bas = infos_Description_f("#theImage");
-      if (typeof Bandeau_bas != "undefined") Bandeau = Bandeau_bas.top;
-      else Bandeau = 0;
-      Wait_Affichage();
-      Autosize_resize(true, { id_map: "autosize" });
-    }); // window.onload
-    /***********************************************************
-    *  RESIZE 
-    ***********************************************************/
-    jQuery(window).resize(
+
+      if (typeof Window_Affichage != "undefined") {
+        jQuery.cookie('window_height', Window_Affichage.height, { path: "/" });
+        jQuery.cookie('window_width', Window_Affichage.width, { path: "/" });
+      }
+    }
+  } catch (r) {
+
+  }
+
+}); //unload
+
+
+
+
+/********************************************
+*  window LOAD
+********************************************/
+jQuery(window).load(function () {
+  href = location.href;
+  var aff_ok = false;
+  if (DEBUG_autosize == "true") {
+    for (var i = 0; i < 10; i++) {
+      jQuery('#adddebugs').click();
+    }
+    jQuery(jQuery('.debug').get(i - 1)).click();
+  }
+
+  Autosize_init();
+  //=========================================================  
+
+  Bandeau_bas = infos_Description_f("#theImage");
+  if (typeof Bandeau_bas != "undefined") Bandeau = Bandeau_bas.top;
+  else Bandeau = 0;
+
+
+  if (!theImage_init("#theMainImage")) {
+    Autosize_resize(true, options);
+    Set_llbgo(true);
+    Wait_Affichage();
+  } else {
+    set_cl(options.useMap.match(RegExp("Autosize", "gi")));
+    Set_llbgo();
+  }
+
+
+
+
+  //=================================================================================
+}); // window.onload
+/***********************************************************
+*  RESIZE 
+***********************************************************/
+jQuery(window).resize(
                        function (event, ui) {
                          List_autosize_resize(event, ui);
-                         if (Autosize_resize(true))
-                           if (Autosize_resize(true));
+                         Autosize_resize(true, options);
                          Wait_Affichage();
                        });
 
-    /************************************
-    * Extend 
-    ************************************/
-    jQuery.fn.extend({
-      //==========================================================
-      infos_description: function (e) {
-        return infos_Description_f(e);
-      },
-      //=============================================================
-      on: function (e) {
-        return;
-      },
-      /*
-      * recherche la plus grande image (hauteur ou largeur)
-      */
-      Get_Img_Maxi: function (myobj) {
-        return Get_Img_Maxi(myobj);
-      },
-      //============================================================
-      affiche_debug: function (aff_infos) {
-        affiche_debug(aff_infos);
-      }
-
-
-    }); //  fin extend  
-    //=================================================================================
- 
-      /*****************
-      * changeImgSrc1
-      ******************/
-      changeImgSrc = function (url, typeSave, typeMap) {
-        var theImg = document.getElementById("theMainImage");
-        if (theImg) {
-          theImg.removeAttribute("width");
-          theImg.removeAttribute("height");
-          //  theImg.useMap = "#map" + typeMap;
-          if (typeMap == "Autosize") {
-            theImg.useMap = "#" + typeMap;
-          } else {
-            theImg.useMap = "#map" + typeSave;
-          }
-          jQuery('#derivativeSwitchBox .switchCheck').css('visibility', 'hidden');
-          jQuery('#derivativeChecked' + typeMap).css('visibility', 'visible');
-
-          document.cookie = 'picture_deriv=' + typeSave + ';path="' + cookie_path + '" ';
-        jQuery.cookie('picture_deriv', typeSave, { path: cookie_path });
-        jQuery.cookie('picture_map', typeMap, { path: cookie_path });
-          theImg.src = url; // charge Image 
-
-        }
-      }          //changeImgSrc1
-
-    Wait_pamoorama = function () {
-      if (jQuery("#pamoorama").length) {
-        mypanorama = window.myPamoorama;
-        if (!mypanorama) {
-          tempo = tempo + 1;
-          if (tempo > 10)
-            return true;
-          setTimeout("Wait_pamoorama()", 500);
-          return false;
-        }
-        if (mypanorama.skipInit == false) {
-          setTimeout("Wait_pamoorama()", 500);
-          return false;
-        }
-        //=============================================================
-        infos_pamoorama = jQuery("#pamoorama").infos();
-        if (Math.abs(infos_pamoorama.height) < 50) {
-          setTimeout("Wait_pamoorama()", 500);
-          return false;
-        }
-        nopano = true;
-        theMainImage_obj = "#pamoorama";
-
-      }
-    } // Wait_pamoorama
-    //====================================================================================
-    Wait_Affichage = function () {
-      if (typeof fade_in == "undefined") fade_in = 1000;
-      fade_in = parseInt(fade_in);
-      /*
-      if (!Autosize_resize()) {
-      setTimeout("Wait_Affichage()", 500);
-      return
-      }  
-      nu_img++;     
-      */
-      if (typeof fade_in == "undefined") fade_in = 0;
-      if (fade_in == 0) {
-        jQuery("#theImage").css({ opacity: "1" });
-        jQuery("#theImg").css({ opacity: "1" });
-        jQuery("#imageTitleContainer").css({ opacity: "1" });
-        jQuery("#theImageAndTitle").css({ opacity: "1" });
-      } else {
-        jQuery("#theImage").animate({ opacity: "1" },
+/*****************
+* changeImgSrc1
+******************/
+changeImgSrc = function (url, typeSave, useMap) {
+  var theImg = document.getElementById(theMainImage_Id.replace("#", ""));
+  if (theImg) {
+    theImg.removeAttribute("width");
+    theImg.removeAttribute("height");
+    //  theImg.useMap = "#map" + useMap;
+
+    jQuery('#derivativeSwitchBox .switchCheck').css('visibility', 'hidden');
+    jQuery('#derivativeChecked' + useMap.replace("#", "")).css('visibility', 'visible');
+    options.useMap = useMap;
+    if (useMap.match("Autosize")) {
+      pictureMap = "#" + "Autosize";
+    } else {
+      pictureMap = "#map" + typeSave;
+    }
+    theImg.src = url; // charge Image 
+    theImg.useMap = pictureMap;
+    infos_theMainImage = jQuery(theMainImage_Id).infos();
+    infos_theMainImage.useMap = theImg.useMap;
+    Save_cookies({
+      typeSave: typeSave,
+      pictureMap: pictureMap,
+      imgSrc: url
+    });
+    cookies = Get_cookies();
+
+  }
+
+
+}          //changeImgSrc1
+/************************************
+*
+************************************/
+Wait_pamoorama = function () {
+  if (jQuery("#pamoorama").length) {
+    mypanorama = window.myPamoorama;
+    if (!mypanorama) {
+      tempo = tempo + 1;
+      if (tempo > 10)
+        return true;
+      setTimeout("Wait_pamoorama()", 500);
+      return false;
+    }
+    if (mypanorama.skipInit == false) {
+      setTimeout("Wait_pamoorama()", 500);
+      return false;
+    }
+    //=============================================================
+    infos_pamoorama = jQuery("#pamoorama").infos();
+    if (Math.abs(infos_pamoorama.height) < 50) {
+      setTimeout("Wait_pamoorama()", 500);
+      return false;
+    }
+    nopano = true;
+    theMainImage_Id = "#pamoorama";
+
+  }
+} // Wait_pamoorama
+//====================================================================================
+Wait_Affichage = function () {
+
+  if (typeof fade_in == "undefined") fade_in = 1000;
+  fade_in = parseInt(fade_in);
+  /*
+  if (!Autosize_resize()) {
+  setTimeout("Wait_Affichage()", 500);
+  return
+  }  
+  nu_img++;     
+  */
+  if (typeof fade_in == "undefined") fade_in = 0;
+  if (fade_in == 0) {
+    jQuery("#theImage").css({ opacity: "1" });
+    jQuery("#theImg").css({ opacity: "1" });
+    jQuery("#imageTitleContainer").css({ opacity: "1" });
+    jQuery("#theImageAndTitle").css({ opacity: "1" });
+  } else {
+    jQuery("#theImage").animate({ opacity: "1" },
                                                  fade_in, "swing",
                                                  function (i) {
@@ -1241,120 +516,121 @@
                                                );
 
-      }
-      //   if (nu_img > 1) return;
-      if (typeof stb != "undefined")
-        stb.stop().fadeTo(3500, 0);
-      if (typeof theMainImage_obj == "undefined") return true;
-
-      if (theMainImage_obj.selector) {
-        theMainImage_obj = theMainImage_obj.selector;
-      }
-      // jQuery("#theImage").trigger("ON");
-      theImage_init("#theImage");
-
-      if (theMainImage_obj == null) return;
-      if (jQuery(theMainImage_obj).length > 0) {
-        if (typeof img_h == "undefined") {
-          img_h = jQuery(theMainImage_obj).height();
-          img_w = jQuery(theMainImage_obj).width();
+  }
+  //   if (nu_img > 1) return;
+  if (typeof stb != "undefined")
+    stb.stop().fadeTo(3500, 0);
+  if (typeof theMainImage_Id == "undefined") return true;
+
+  if (theMainImage_Id.selector) {
+    theMainImage_Id = theMainImage_Id.selector;
+  }
+  if (theMainImage_Id == null) return;
+
+  if (jQuery(theMainImage_Id).length > 0) {
+    if (typeof img_h == "undefined") {
+      img_h = jQuery(theMainImage_Id).height();
+      img_w = jQuery(theMainImage_Id).width();
+    }
+
+    jQuery("#src_img_h").val(img_h);
+    jQuery("#src_img_w").val(img_w);
+    jQuery("#ret_autosize").val(infos_theMainImage.src);
+    if (typeof Window_Affichage == "undefined") return;
+    jQuery("#window_height").val(Window_Affichage.height);
+    jQuery("#window_width").val(Window_Affichage.width);
+    jQuery("#ret_autosize").trigger('ON', {
+      width: img_w,
+      height: img_h,
+      theImage: theMainImage_Id,
+      src_img: infos_theMainImage.src,
+      window_height: Window_Affichage.height,
+      window_width: Window_Affichage.width
+    });
+  }
+} // Wait_affichage
+
+
+
+
+
+/***********************
+*
+**********************/
+init_img = function (theImg) {
+  name_src = theImg.src;
+  img_init = { width: jQuery(theImg).width(), height: jQuery(theImg).height() }
+
+  if (theImg.naturalWidth)
+    img_init.width = theImg.naturalWidth;
+  if (theImg.naturalHeight)
+    img_init.height = theImg.naturalHeight;
+
+  img_init.rapport = img_init.width / img_init.height;
+  Zone_image.height_init = img_init.height;
+  Zone_image.width_init = img_init.width;
+  Zone_image.rapport = img_init.rapport;
+
+  nu_img = 0;
+  theMainImage_Id = "#" + theImg.id;
+  if (typeof Zone_image.src == "undefined") return;
+  return name_src.match(Zone_image.src);
+}
+
+
+/*****************************************************
+* recherche la plus grande image (hauteur ou largeur)
+*****************************************************/
+Get_Img_Maxi = function (myobj) {
+  var w00 = 0;
+  var myImg = null;
+
+  img = jQuery(theMainImage_Id);
+  if (img != null) {
+    return;
+
+  }
+  img = jQuery(myobj);
+
+  img = jQuery('img[alt]');
+
+  jQuery(myobj).each(function (i) {
+    w0 = img_reelle.width;
+    h0 = img_reelle.height;
+    if (h0 > w0) w0 = h0;
+    if (w0 > w00) {
+      if (!this.src.match(RegExp(".png", "gi")))
+        if (!this.src.match(RegExp(thumbnail, "g"))) {
+          myImg = this;
+          jQuery(myImg).addClass("Image");
+          w00 = w0;
         }
-        jQuery("#src_img_h").val(img_h);
-        jQuery("#src_img_w").val(img_w);
-        jQuery("#ret_autosize").val(src_img);
-        if (typeof Window_Affichage == "undefined") {
-          Window_Affichage = { height: Zone_Affichage.height,
-            width: Zone_Affichage.width
-          };
-        }
-        jQuery("#window_height").val(Window_Affichage.height);
-        jQuery("#window_width").val(Window_Affichage.width);
-
-        jQuery("#ret_autosize").trigger('ON', {
-          width: img_w,
-          height: img_h,
-          theImage: theMainImage_obj,
-          src_img: src_img,
-          window_height: Window_Affichage.height,
-          window_width: Window_Affichage.width
-        });
-      }
-    } // Wait_affichage
-
-
-
-
-
-    /*****************************************************
-    * recherche la plus grande image (hauteur ou largeur)
-    *****************************************************/
-    Get_Img_Maxi = function (myobj) {
-      var w00 = 0;
-      var myImg = null;
-
-      img = jQuery(theMainImage_obj);
-      if (img != null) {
-        return;
-
-      }
-      img = jQuery(myobj);
-
-      img = jQuery('img[alt]');
-
-      jQuery(myobj).each(function (i) {
-        w0 = img_reelle.width;
-        h0 = img_reelle.height;
-        if (h0 > w0) w0 = h0;
-        if (w0 > w00) {
-          if (!this.src.match(RegExp(".png", "g")))
-            if (!this.src.match(RegExp(thumbnail, "g"))) {
-              myImg = this;
-              jQuery(myImg).addClass("Image");
-              w00 = w0;
-            }
-
-        }
-      });
-      return myImg;
-    } // Get_Img_Maxi
-
-
-    /*************************************************************
-    *
-    **************************************************************/
-    infos_entete = function () {
-      infos_imageToolBar = jQuery("#imageToolBar").infos();
-      if (typeof (marge_top) != "undefined") return result;
-
-      if (infos_imageToolBar.position == "absolute") {
-        jQuery("#imageToolBar").css("position", "relative");
-        jQuery("#imageToolBar").css("top", 0 + "px");
-      }
-      optiontop = 0;
-      infos_imageInfoBar = jQuery("#imageInfoBar").infos();
-      jQuery("#" + "theImgContainer").css("marginTop", "0px");
-      infos_thePicturePage = jQuery("#thePicturePage").infos();
-      infos_theImage = jQuery("#theImage").infos();
-      if (theme.match(RegExp("stripped", "gi"))) {
-        infos_theImageAndTitle = jQuery("#theImageAndTitle").infos();
-        infos_theImageBox = jQuery("#theImageBox").infos();
-        optiontop = (marges_llgbo / 2) + infos_theImageAndTitle.margin.top;
-      }
-
-      if (infos_theImage.position == "relative") {
-        //--- passage relative ==> static ===/
-        jQuery("#theImage").css("position", "static");
-        infos_theImage = jQuery("#theImage").infos();
-
-      } else {
-
-      }
-      if (infos_theImage.position == "absolute") {
-        //--- passage absolute ==> static ===/
-        jQuery("#theImage").css("position", "static");
-        infos_theImage = jQuery("#theImage").infos();
-
-      }
-
-      marge_top = Math.ceil(infos_the_page.top +
+
+    }
+  });
+  return myImg;
+} // Get_Img_Maxi
+
+
+/*************************************************************
+*
+**************************************************************/
+infos_entete = function () {
+  infos_imageToolBar = jQuery("#imageToolBar").infos();
+  if (typeof (marge_top) != "undefined") return;
+
+  optiontop = 0;
+  infos_imageInfoBar = jQuery("#imageInfoBar").infos();
+
+  infos_thePicturePage = jQuery("#thePicturePage").infos();
+  infos_theImage = jQuery("#theImage").infos();
+  if (theme.match(RegExp("stripped", "gi"))) {
+    infos_theImageAndTitle = jQuery("#theImageAndTitle").infos();
+    infos_theImageBox = jQuery("#theImageBox").infos();
+    optiontop = (marges_llgbo / 2) + infos_theImageAndTitle.margin.top;
+  }
+
+
+
+  marge_top = Math.ceil(infos_the_page.top +
                                              infos_the_page.borderwidth.top +
                                              infos_theImage.borderwidth.top +
@@ -1362,273 +638,273 @@
                                              );
 
-      img_top = Math.ceil(infos_theImage.top +
+  img_top = Math.ceil(infos_theImage.top +
                                 infos_theImage.padding.top +
                                 infos_theImage.borderwidth.top +
                                 infos_thePicturePage.margin.top + optiontop);
-      result = infos_imageToolBar;
-      // result.width = "20%";
-      // result.left = "40%";
-      result.marge_top = marge_top;
-      result.img_top = img_top;
-      //=== Afficher le titre de l'image sur le cadre ===
-
-
-      if (infos_llgboh2.top > 0) {
-        result.img_top = infos_llgboh2.top;
-
-      }
-      else if (marges_llgbo > 0) {
-        result.img_top -= (8);
-      }
-      return result;
-    } // infos_entete
-    /*************************************************
-    * Récupère les informations sur la description.
-    *
-    *************************************************/
-    infos_Description_f = function () {
-      // jQuery("#theImage").css({ display: "block" });
-      //====== détection du type d'images ======
-      if (jQuery("#charlie").length > 0) {
-        Type_Img = "charlie";
-      } else if (jQuery("#Panorama").length) {
-        Type_Img = "panorama";
-      } else if (jQuery("#pamoorama").length) {
-        Type_Img = "pamoorama";
-      } else if (jQuery("#map").length) {
-        Type_Img = "map";
-      } else if (jQuery("#Panorama").length) {
-        Type_Img = "panorama";
-      } else if ((jQuery("#theImage" + " iframe").length + jQuery("#theImage" + " object").length + jQuery("#theImage" + " embed").length) > 0) {
-
-        if (jQuery("#theImage" + " object").length > 0) {
-
-          type_src = "object";
-
-        } else if (jQuery("#theImage" + " embed").length > 0) {
-
-          type_src = "embed";
-
+  result = infos_imageToolBar;
+  // result.width = "20%";
+  // result.left = "40%";
+  result.marge_top = marge_top;
+  result.img_top = img_top;
+  //=== Afficher le titre de l'image sur le cadre ===
+
+
+  if (infos_llgboh2.top > 0) {
+    result.img_top = infos_llgboh2.top;
+
+  }
+  else if (marges_llgbo > 0) {
+    result.img_top -= (8);
+  }
+  return result;
+} // infos_entete
+/*************************************************
+* Récupère les informations sur la description.
+*
+*************************************************/
+infos_Description_f = function () {
+  // jQuery("#theImage").css({ display: "block" });
+  //====== détection du type d'images ======
+  if (jQuery("#charlie").length > 0) {
+    Type_Img = "charlie";
+  } else if (jQuery("#Panorama").length) {
+    Type_Img = "panorama";
+  } else if (jQuery("#pamoorama").length) {
+    Type_Img = "pamoorama";
+  } else if (jQuery("#map").length) {
+    Type_Img = "map";
+  } else if (jQuery("#Panorama").length) {
+    Type_Img = "panorama";
+  } else if ((jQuery("#theImage" + " iframe").length + jQuery("#theImage" + " object").length + jQuery("#theImage" + " embed").length) > 0) {
+
+    if (jQuery("#theImage" + " object").length > 0) {
+
+      type_src = "object";
+
+    } else if (jQuery("#theImage" + " embed").length > 0) {
+
+      type_src = "embed";
+
+    } else {
+
+      type_src = "iframe";
+    }
+    nbf = jQuery("#theImage" + " " + type_src).length;
+    frm1 = jQuery("#theImage" + " " + type_src).get(0);
+    Type_Img = "charlie";
+
+    //'fb - xfbml - like - button
+
+    objs = jQuery("#theImage" + " div").get(0);
+    if (jQuery(objs).length > 0) {
+      id_0 = jQuery(objs).attr("id");
+      if (id_0 == "") {
+        jQuery(objs).attr("id", "charlie");
+      } else {
+        if (nbf > 1) {
+          jQuery(frm1).attr("id", "charlie");
         } else {
-
-          type_src = "iframe";
+          Type_Img = "img";
         }
-        nbf = jQuery("#theImage" + " " + type_src).length;
-        frm1 = jQuery("#theImage" + " " + type_src).get(0);
-        Type_Img = "charlie";
-
-        //'fb - xfbml - like - button
-
-        objs = jQuery("#theImage" + " div").get(0);
-        if (jQuery(objs).length > 0) {
-          id_0 = jQuery(objs).attr("id");
-          if (id_0 == "") {
-            jQuery(objs).attr("id", "charlie");
-          } else {
-            if (nbf > 1) {
-              jQuery(frm1).attr("id", "charlie");
-            } else {
-              Type_Img = "img";
-            }
-          }
-        } else {
-          jQuery(frm1).attr("id", "charlie");
-        }
-
-
-      } else if (jQuery("#theImage").find("img").length > 0) {
-        Type_Img = "img";
-      } else if (jQuery("#theImage" + "Box").find("img").length > 0) {
-        Type_Img = "img";
-        Parent = Parent + "Box";
-      } else if (jQuery("img").length > 0) {
-        Type_Img = "img_autre";
-        return;
-      } else {
-        return;
-      }
-      //===============  CHARLIE ==============================
-      if (jQuery("#charlie").length > 0) {
-        jQuery("#charlie").css({
-          paddingTop: "0px",
-          marginTop: "0px",
-          paddingBottom: "0px",
-          marginBottom: "0px"
-        });
-
-      }
-      //================ LLGBO ======================
-      marges_llgbo = 0;
-      if (jQuery("#llgbo").length > 0) {
-        jQuery("#llgbo").trigger("ON");
-        if (infos_llgbo.height > 0) {
-          marges_llgbo = infos_llgbo.borderwidth.left * 2;
-        }
-      }
-
-      Bandeau_t = infos_entete();
-      Bandeau = Bandeau_t.img_top;
-      infos_theImgContainer = jQuery("#" + "theImgContainer").infos();
-      infos_description = jQuery("#" + "description").infos();
-      //=============================================================================
-      //   jQuery("#theImage" + " p").css({ padding: "0px", margin: "0px "    });
-      if (theme.match(RegExp("simple", "gi"))) {
-        jQuery("#theImage").css({ padding: "0px",
-          marginLeft: "0px",
-          marginRight: "auto",
-          marginTop: "0px",
-          marginBottom: "0px"
-
-        });
-      }
-
-
-      if (theme.match(RegExp("luciano", "g"))) {
-        jQuery("#imageContainer").css({ height: "auto" });
-        theMainImage_obj = "#theImage" + " #theImg img";
-        infos_img = jQuery(theMainImage_obj).infos();
-
-
-      } else if (Type_Img == "map") {
-
-        infos_map = jQuery("#mapPicture").infos();
-        marge_left = infos_map.width;
-
-        jQuery("#map").css({ left: marge_left + "px", padding: "0px",
-          marginLeft: "0px",
-          marginRight: "4px",
-          marginTop: "0px",
-          marginBottom: "0px",
-          position: "relative"
-        });
-
-        theMainImage_obj = "#map";
-        infos_img = jQuery(theMainImage_obj).infos();
-
-
-      } else if (jQuery("#charlie").length > 0) {
-        infos_charlie = jQuery("#charlie").infos();
-        obj_charlie = jQuery("object");
-        try {
-          tp = obj_charlie.attr();
-        } catch (e) {
-          tp = obj_charlie.prop();
-        }
-
-        if (tp != undefined) {
-          if (obj_charlie.length > 0)
-            tp = jQuery("object").attr("type") || jQuery("object").prop("type");
-          else
-            tp = jQuery("embed").attr("type") || jQuery("embed").prop("type");
-        }
-
-        if (tp == 'application/x-shockwave-flash') {
-          jQuery("#charlie").css({
-            paddingTop: "0px",
-            marginTop: "0px",
-            paddingBottom: "30px",
-            marginBottom: "0px"
-          });
-        } else {
-
-        }
-
-        var MainImage = jQuery(theMainImage_obj);
-
-        if (MainImage.length == 0) {
-          theMainImage_obj = "#charlie";
-          infos_img = jQuery(theMainImage_obj).infos();
-        } else {
-
-          infos_img = jQuery(theMainImage_obj).infos();
-
-        }
-
-
-      } else if (jQuery("#theImage" + " embed").length > 0) {
-        if (jQuery(theMainImage_obj).lenght == 0) {
-          theMainImage_obj = "#theImage" + " embed";
-          infos_img = jQuery(theMainImage_obj).infos();
-          jQuery("#theImage" + " embed").width({ width: infos_img.width + "px", height: infos_img.height + "px" });
-        } else {
-
-          infos_img = jQuery(theMainImage_obj).infos();
-          Type_Img == "charlie"
-          if (infos_img.width == 0) {
-
-            infos_img = jQuery(theMainImage_obj).infos();
-
-          }
-        }
-
-      } else if (Type_Img == "pamoorama") {
-        if (!nopano) {
-          Wait_pamoorama();
-          
-        }
-        infos_img = jQuery(theMainImage_obj).infos();
-        infos_footer = jQuery("#pamoorama_footer").infos();
-        infos_img.height += parseInt(infos_img.height) + parseInt(infos_footer.height);
-
-      } else {
-        var MainImage = jQuery(theMainImage_obj);
-
-        if (MainImage.length == 0) {
-          theMainImage_obj = "#theImage" + " img[alt]";
-        } else {
-
-        }
-
-
-        if (!theMainImage_obj)
-          theMainImage_obj = "#theImage";   // sans img ??
-
-        infos_img = jQuery(theMainImage_obj).infos();
-      }
-      //=====================================================================================
-
-      switch (infos_img.position) {
-        case "relative":
-          break;
-        case "static":
-          break;
-        case "absolute":
-          break;
-        case "":
-          break;
-        default:
-          break;
-      }
-
-      infos_description.marge = {
-        bottom: infos_img.padding.bottom + infos_img.margin.bottom + infos_img.borderwidth.bottom,
-        top: infos_img.padding.top + infos_img.borderwidth.top + infos_img.margin.top
-      }
-
-      if (infos_llgbo.height > 0) infos_img = infos_llgbo; // format de l'image+largeur du cadre
-
-      if (theme.match(RegExp("luciano", "g"))) {
-
-        infos_theImgContainer = jQuery("#imageContainer").infos();
-        infos_description.bottom = jQuery("#imageInfo").infos().top;
-        infos_description.top = infos_theImgContainer.bottom;
-        infos_slidshowToolBar = jQuery("#slidshowToolBar").infos();
-
-        if (infos_slidshowToolBar.height > 0) {
-          correction = (infos_slidshowToolBar.height);
-          infos_description.top = infos_img.bottom;
-          infos_description.bottom = jQuery("#copyright").infos().top;
-        }
-
-        //=========================================================
-      } else if (theme.match(RegExp("stripped", "gi"))) {
-        //options.imageAutosize
-        //options.imageMargin
-        jQuery("#content").css({ paddingTop: "5px" });
-        infos_content = jQuery("#content").infos();
-        if (options.imageAutosizeTitle == false) {
-          infos_description.top = infos_theImageBox.bottom;
-
-          infos_description.bottom = infos_HeaderBar.margin.top + infos_description.top +
+      }
+    } else {
+      jQuery(frm1).attr("id", "charlie");
+    }
+
+
+  } else if (jQuery("#theImage").find("img").length > 0) {
+    Type_Img = "img";
+  } else if (jQuery("#theImage" + "Box").find("img").length > 0) {
+    Type_Img = "img";
+    Parent = Parent + "Box";
+  } else if (jQuery("img").length > 0) {
+    Type_Img = "img_autre";
+    return;
+  } else {
+    return;
+  }
+  //===============  CHARLIE ==============================
+  if (jQuery("#charlie").length > 0) {
+    jQuery("#charlie").css({
+      paddingTop: "0px",
+      marginTop: "0px",
+      paddingBottom: "0px",
+      marginBottom: "0px"
+    });
+
+  }
+  //================ LLGBO ======================
+  marges_llgbo = 0;
+  options.marges_llgbo = 0;
+  if (jQuery(llgbo_id).length > 0) {
+    infos_llgbo = jQuery(llgbo_id).infos();
+    if (infos_llgbo.visible == true) {
+      if (infos_llgbo.height > 0) {
+        infos_llgboframe1 = jQuery(llgbo_id + " div:last").infos();
+        infos_llgboframe31 = jQuery(llgbo_id + "  div:first").infos();
+        //=============================================
+        ll2 = infos_llgboframe1.width; // llgboframe1
+        ll1 = infos_llgboframe31.general.width; // llgboframe31
+        options.marges_llgbo = (ll1 - ll2);
+        infos_llgboh2 = jQuery("#llgboh2").infos();
+      }
+    }
+    jQuery(llgbo_id).trigger("ON");
+    marges_llgbo = options.marges_llgbo;
+  }
+
+  //  Bandeau_t = infos_entete();
+  //  Bandeau = Bandeau_t.img_top;
+  infos_theImgContainer = jQuery("#" + "theImgContainer").infos();
+  infos_description = jQuery("#" + "description").infos();
+  //=============================================================================
+
+
+
+  if (theme.match(RegExp("luciano", "g"))) {
+
+
+
+
+  } else if (Type_Img == "map") {
+
+    infos_map = jQuery("#mapPicture").infos();
+    marge_left = infos_map.width;
+
+    jQuery("#map").css({ left: marge_left + "px", padding: "0px",
+      marginLeft: "0px",
+      marginRight: "4px",
+      marginTop: "0px",
+      marginBottom: "0px",
+      position: "relative"
+    });
+
+    theMainImage_Id = "#map";
+    infos_theMainImage = jQuery(theMainImage_Id).infos();
+
+
+  } else if (jQuery("#charlie").length > 0) {
+    infos_charlie = jQuery("#charlie").infos();
+    obj_charlie = jQuery("object");
+    try {
+      tp = obj_charlie.attr();
+    } catch (e) {
+      tp = obj_charlie.prop();
+    }
+
+    if (tp != undefined) {
+      if (obj_charlie.length > 0)
+        tp = jQuery("object").attr("type") || jQuery("object").prop("type");
+      else
+        tp = jQuery("embed").attr("type") || jQuery("embed").prop("type");
+    }
+
+    if (tp == 'application/x-shockwave-flash') {
+      jQuery("#charlie").css({
+        paddingTop: "0px",
+        marginTop: "0px",
+        paddingBottom: "30px",
+        marginBottom: "0px"
+      });
+    } else {
+
+    }
+
+    var MainImage = jQuery(theMainImage_Id);
+
+    if (MainImage.length == 0) {
+      theMainImage_Id = "#charlie";
+      infos_theMainImage = jQuery(theMainImage_Id).infos();
+    } else {
+
+      infos_theMainImage = jQuery(theMainImage_Id).infos();
+
+    }
+
+
+  } else if (jQuery("#theImage" + " embed").length > 0) {
+    if (jQuery(theMainImage_Id).lenght == 0) {
+      theMainImage_Id = "#theImage" + " embed";
+      infos_theMainImage = jQuery(theMainImage_Id).infos();
+      jQuery("#theImage" + " embed").width({ width: infos_theMainImage.width + "px", height: infos_theMainImage.height + "px" });
+    } else {
+
+      infos_theMainImage = jQuery(theMainImage_Id).infos();
+      Type_Img == "charlie"
+      if (infos_theMainImage.width == 0) {
+
+        infos_theMainImage = jQuery(theMainImage_Id).infos();
+
+      }
+    }
+
+  } else if (Type_Img == "pamoorama") {
+    if (!nopano) {
+      Wait_pamoorama();
+
+    }
+    infos_theMainImage = jQuery(theMainImage_Id).infos();
+    infos_footer = jQuery("#pamoorama_footer").infos();
+    infos_theMainImage.height += parseInt(infos_theMainImage.height) + parseInt(infos_footer.height);
+
+  } else {
+    if (jQuery(theMainImage_Id).length == 0) {
+      theMainImage_Id = "#theImage" + " img[alt]";
+    } else {
+
+    }
+
+
+    if (!theMainImage_Id)
+      theMainImage_Id = "#theImage";   // sans img ??
+
+
+  }
+  //=====================================================================================
+  infos_theMainImage = jQuery(theMainImage_Id).infos();
+
+  switch (infos_theMainImage.position) {
+    case "relative":
+      break;
+    case "static":
+      break;
+    case "absolute":
+      break;
+    case "":
+      break;
+    default:
+      break;
+  }
+
+  infos_description.marge = {
+    bottom: infos_theMainImage.padding.bottom + infos_theMainImage.margin.bottom + infos_theMainImage.borderwidth.bottom,
+    top: infos_theMainImage.padding.top + infos_theMainImage.borderwidth.top + infos_theMainImage.margin.top
+  }
+
+  if (infos_llgbo.height > 0) infos_theMainImage = infos_llgbo; // format de l'image+largeur du cadre
+
+  if (theme.match(RegExp("luciano", "g"))) {
+
+    infos_theImgContainer = jQuery(theImageAndInfos_id).infos();
+    infos_description.bottom = jQuery("#imageInfo").infos().top;
+    infos_description.top = infos_theImgContainer.bottom;
+    infos_slidshowToolBar = jQuery("#slidshowToolBar").infos();
+
+    if (infos_slidshowToolBar.height > 0) {
+      correction = (infos_slidshowToolBar.height);
+      infos_description.top = infos_theMainImage.bottom;
+      infos_description.bottom = jQuery("#copyright").infos().top;
+    }
+
+    //=========================================================
+  } else if (theme.match(RegExp("stripped", "gi"))) {
+    //options.imageAutosize
+    //options.imageMargin
+
+    infos_content = jQuery("#content").infos();
+    if (options.imageAutosizeTitle == false) {
+      infos_description.top = infos_theImageBox.bottom;
+
+      infos_description.bottom = infos_HeaderBar.margin.top + infos_description.top +
                                             infos_description.borderwidth.top +
                                             infos_description.borderwidth.bottom +
@@ -1636,44 +912,44 @@
                                             (marges_llgbo / 2) + 4;
 
-        } else {
-
-
-          infos_description.top = infos_theImageBox.bottom -
+    } else {
+
+
+      infos_description.top = infos_theImageBox.bottom -
                                 infos_content.top +
                                 options.imageAutosizeMargin * 2 +
                                 (marges_llgbo / 2)
                                         ;
-          infos_description.bottom = jQuery("#tabZone").infos().top +
+      infos_description.bottom = jQuery("#tabZone").infos().top +
                                 infos_theImageAndTitle.margin.top;
-          if (msie == true) infos_description.bottom -= 4;
-        };
-        check_desc_v = true;
-
-      } else {
-        if (theme.match(RegExp("sobre", "gi"))) {
-          infos_description.marge.top = -2;
-        }
-        infos_description.bottom = infos_theImage.bottom; //482
-        infos_description.top = infos_img.height + infos_theImage.top; //410+62
-        // infos_description.bottom -= infos_img.top;
-      }
-      //
-
-      infos_description.height = infos_description.bottom - infos_description.top;
-
-      if (check_desc_v == false) {
-        infos_description.height = 0;
-      }
-
-      Debug_pos();
-
-      //cl_visible=false ;
-      return infos_description;
-    } //infos_Description_f
-
-    //=======================================================================================
-    Debug_info = function (index, infos, nom) {
-      if (infos.height > 0) {
-        message = browser.browser + " -- > Info : " + nom + " " + infos.id + "\n" +
+      if (msie == true) infos_description.bottom -= 4;
+    };
+    check_desc_v = true;
+
+  } else {
+    if (theme.match(RegExp("sobre", "gi"))) {
+      infos_description.marge.top = -2;
+    }
+    infos_description.bottom = infos_theImage.bottom; //482
+    infos_description.top = infos_theMainImage.height + infos_theImage.top; //410+62
+    // infos_description.bottom -= infos_theMainImage.top;
+  }
+  //
+
+  infos_description.height = infos_description.bottom - infos_description.top;
+
+  if (options.check_desc_v == false) {
+    infos_description.height = 0;
+  }
+
+  Debug_pos();
+
+  //options.cl_visible=false ;
+  return infos_description;
+} //infos_Description_f
+
+//=======================================================================================
+Debug_info = function (index, infos, nom) {
+  if (infos.height > 0) {
+    message = browser.browser + " -- > Info : " + nom + " " + infos.id + "\n" +
                          "Info nodeName: " + infos.nodeName + "\n" +
                          "Info width: " + infos.width + "\n" +
@@ -1682,339 +958,346 @@
                          "Info left: " + infos.left + "\n" +
                          "Info position: " + infos.position + "\n";
-        myDebug = { id: "Debug" + index, texte: message,
-          css: {
-            color: "black",
-            opacity: "0.5",
-            position: "absolute",
-            height: infos.height || 100 + "px",
-            width: infos.width || 300 + "px",
-            left: infos.left || 0 + "px",
-            border: "solid 1px green",
-            top: infos.top + "px"
-          }
+    myDebug = { id: "Debug" + index, texte: message,
+      css: {
+        color: "black",
+        opacity: "0.5",
+        position: "absolute",
+        height: infos.height || 100 + "px",
+        width: infos.width || 300 + "px",
+        left: infos.left || 0 + "px",
+        border: "solid 1px green",
+        top: infos.top + "px"
+      }
+    }
+    return myDebug;
+  } else {
+    if (typeof old_messages == "undefined") {
+      old_messages = new Array();
+
+    }
+    if (infos != "" && infos != "undefined") {
+      nc0 = old_messages[index];
+
+      if (typeof nc0 != "undefined") {
+        nc0 = old_messages[index].toString().split("<br />");
+        if (nc0.length > 3) nc0.shift();
+
+        old_messages[index] = nc0.join("<br />");
+      }
+      old_messages[index] += " : " + nom + " -- > " + infos + "<br />";
+
+      message = browser.browser + old_messages[index];
+
+      myDebug = { id: "Debug" + index, texte: message,
+        css: {
+          color: "black",
+          opacity: "1.0",
+          position: "absolute",
+          align: "left",
+          height: 100 + "px",
+          width: 800 + "px",
+          left: 300 + "px",
+          border: "solid 1px green",
+          top: 0 + "px"
         }
-        return myDebug;
-      } else {
-        if (typeof old_messages == "undefined") {
-          old_messages = new Array();
-
-        }
-        if (infos != "" && infos != "undefined") {
-          nc0 = old_messages[index];
-
-          if (typeof nc0 != "undefined") {
-            nc0 = old_messages[index].toString().split("<br />");
-            if (nc0.length > 3) nc0.shift();
-
-            old_messages[index] = nc0.join("<br />");
-          }
-          old_messages[index] += " : " + nom + " -- > " + infos + "<br />";
-
-          message = browser.browser + old_messages[index];
-
-          myDebug = { id: "Debug" + index, texte: message,
-            css: {
-              color: "black",
-              opacity: "1.0",
-              position: "absolute",
-              align: "left",
-              height: 100 + "px",
-              width: 800 + "px",
-              left: 300 + "px",
-              border: "solid 1px green",
-              top: 0 + "px"
-            }
-          }
-        }
-
-        return myDebug;
-      }
-
-
-    }
+      }
+    }
+
+    return myDebug;
+  }
+
+
+}
+//====================================================
+function Debug_pos() {
+  return;
+  if (DEBUG_autosize == "true") {
+
+    jQuery("[id ^='Debug']").show();
+    /*
+    Debug2  background-color:yellow
+    Debug3 background-color:blue
+    Debug4 background-color:green
+    Debug5 background-color:red
+
+    */
+
+    affiche_debug({
+      Debug1: Debug_info(1, Bandeau_t, "Bandeau_t"),
+      Debug4: Debug_info(4, infos_description, "infos_description"),
+      Debug5: Debug_info(5, infos_theMainImage, "infos_theMainImage")
+    });
+  }
+}
+//==========================================================
+affiche_debug = function (aff_infos) {
+  jQuery(jQuery("[id ^='Debug']")).each(function (i) {
+    if (aff_infos[this.id]) {
+      if (aff_infos[this.id].css) {
+        jQuery("#" + this.id).css(aff_infos[this.id].css);
+        jQuery("#" + this.id).html(aff_infos[this.id].texte);
+      }
+    }
+  });
+  return;
+}
+//===========================================
+//
+//===========================================
+Set_Map = function (nds) {
+  p0 = jQuery("#map").position();
+  if (!p0) return;
+
+  infos_map = jQuery("#map").infos();
+  // if (infos_map.width == (Zone_image.container.width - p0.left))   return ;
+  nds = jQuery("#imageInfos").css("display");
+  if (nds != "none") {
+    p2 = jQuery("#infoSwitcher").infos();
+    p0.left += 35;
+  }
+  jQuery("#map").width(Zone_image.container.width - p0.left);
+  jQuery("#map").css({ position: "absolute", height: Zone_image.container.height + "px" });
+}
+
+jQuery("map [name='mapAutosize'] area").mouseover(function (e) {
+  return;
+});
+//=====================================
+//
+//=====================================
+theImage_init = function (Obj) {
+  if (jQuery("#derivativeSwitchBox").length > 0) {
+    id3 = jQuery("#derivativeCheckedAutosize");
+    var pi = jQuery("#derivativeSwitchBox > span ");
+    var px = jQuery(".derivativeSizeDetails ");
+    i = 0;
+    n = 0;
+    var pt = new Array();
+    jQuery("#derivativeSwitchBox a").each(function (i) {
+      href_path = jQuery(this).attr("href");
+      if (href_path.match(RegExp("auto", "gi"))) return true;
+      pt[i] = href_path.split("'");
+    });
+    Calcul_Image();
+    tw = Zone_image.container.width;
+    th = Zone_image.container.height;
+    n = 0;
+    jQuery(".derivativeSizeDetails").each(function (i) {
+      vn = jQuery(this).text().replace("(", "").replace(")", "").split("x");
+      h0 = parseInt(vn[1]);
+      w0 = parseInt(vn[0])
+      if (h0 > th) {
+        n = i;
+        return false;
+      }
+      if (w0 > tw) {
+        n = i;
+        return false;
+      }
+      n++;
+    });
+    if (n > pt.length - 1) n = pt.length - 1; // format le plus grand
+    if (n < 0) n = 0; // format le plus grand
+    imgSrc = pt[n][1];
+    last_map = pt[n][5];
+    var theImg = document.getElementById(theMainImage_Id.replace("#", ""));
+    if (theImg.useMap.match(RegExp("map", "gi"))) return;
+    if (theImg.src.match(RegExp(imgSrc, "gi"))) return;
+
+    href_path = "javascript:changeImgSrc('" + imgSrc + "', '" + last_map + "', '" + "#Autosize" + "')";
+    jQuery("#linkAutosize").attr("href", href_path);
+    changeImgSrc(imgSrc, last_map, "#Autosize");
+  }
+  return false;
+
+};
+
+//===============================================================
+//  Fonctions générales
+//===============================================================
+Set_llbgo = function (Force) {
+  if (Force)
+    if (typeof LlgboFr_Resize == "function") LlgboFr_Resize();
+  // if (typeof updateXY != "function")      return;
+  maps = jQuery("map[name^='map']");
+  maps = jQuery("map[name='Autosize']");
+  if (maps.length == 0) return;
+
+  nom_map = 'Autosize';
+  // nom_map = maps[0].name;
+  maps = jQuery("map[name='" + nom_map + "']  area");
+
+
+  nb_zone = maps.length;
+  infos_theMainImage = jQuery(theMainImage_Id).infos();          // Image 
+  var Largeur_zone = (infos_theMainImage.width / nb_zone);
+  var Hauteur_zone = (infos_theMainImage.height);
+  var init_zone = 0;
+  j = 0;
+  maps.each(function (e) {
+    init_zone = Largeur_zone * j;
+    rel = jQuery(this).attr("rel");
+    title = jQuery(this).attr("title");
+    alt = jQuery(this).attr("alt");
+    H = Hauteur_zone;
+    if (rel == "up") {
+      H = Hauteur_zone / 4;
+    }
+    coord = { x0: init_zone, y0: 0, x1: Math.ceil(init_zone + Largeur_zone), y1: Hauteur_zone };
+    jQuery(this).attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" });
+    j++;
+  });
+
+  return;
+}
+
+/*************************************************
+* correction pamoorama
+*************************************************/
+Set_Pamoorama = function () {
+  if (Type_Img == "pamoorama") {
+    if (typeof myPamoorama == "undefined") {
+      return;
+    }
+
+    Calcul_Image();
+    infos_pamoorama = jQuery("#pamoorama").infos();
+    infos_pamoorama_outter = jQuery("#pamoorama_outter").infos();
+    infos_pamoorama_inner = jQuery("#pamoorama_inner").infos();
+    infos_pamoorama_footer = jQuery("#pamoorama_footer").infos();
+    infos_pamoorama_frame = jQuery("#pamoorama_frame").infos();
+    infos_frame = jQuery(myPamoorama.frame).infos();
+
+
     //====================================================
-    function Debug_pos() {
-      return;
-      if (DEBUG_autosize == "true") {
-
-        jQuery("[id ^='Debug']").show();
-        /*
-        Debug2  background-color:yellow
-        Debug3 background-color:blue
-        Debug4 background-color:green
-        Debug5 background-color:red
-
-        */
-
-        affiche_debug({
-          Debug1: Debug_info(1, Bandeau_t, "Bandeau_t"),
-          Debug4: Debug_info(4, infos_description, "infos_description"),
-          Debug5: Debug_info(5, infos_img, "infos_img")
-        });
-      }
-    }
-    //==========================================================
-    affiche_debug = function (aff_infos) {
-      jQuery(jQuery("[id ^='Debug']")).each(function (i) {
-        if (aff_infos[this.id]) {
-          if (aff_infos[this.id].css) {
-            jQuery("#" + this.id).css(aff_infos[this.id].css);
-            jQuery("#" + this.id).html(aff_infos[this.id].texte);
-          }
-        }
-      });
-      return;
-    }
-    //===========================================
-    //
-    //===========================================
-    Set_Map = function (nds) {
-      p0 = jQuery("#map").position();
-      if (!p0) return;
-
-      infos_map = jQuery("#map").infos();
-      // if (infos_map.width == (Zone_image.container.width - p0.left))   return ;
-      nds = jQuery("#imageInfos").css("display");
-      if (nds != "none") {
-        p2 = jQuery("#infoSwitcher").infos();
-        p0.left += 35;
-      }
-      jQuery("#map").width(Zone_image.container.width - p0.left);
-      jQuery("#map").css({ position: "absolute", height: Zone_image.container.height + "px" });
-    }
-    //=====================================
-    //
-    //=====================================
-    theImage_init = function (Obj) {
-      if (jQuery("#derivativeSwitchBox").length > 0) {
-        id3 = jQuery("#derivativeCheckedAutosize");
-
-
-        var pi = jQuery("#derivativeSwitchBox > span ");
-        var px = jQuery(".derivativeSizeDetails ");
-
-        i = 0;
-        n = 0;
-        var pt = new Array();
-        jQuery("#derivativeSwitchBox a").each(function (i) {
-          href_path = jQuery(this).attr("href");
-          if (href_path.match(RegExp("auto", "gi"))) return true;
-          pt[i] = href_path.split("'");
-        });
-
-        th = jQuery(window).height();
-        tw = jQuery(window).width();
-
-        th = infos_body.height;
-        tw = infos_body.width;
-        infos_imageInfos
-
-        Zone_image = Calcul_Image(infos_imageInfos.visible == false);
-        n0 = 0;
-        n1 = 0;
-        t0 = 0;
-        tw = Zone_image.container.width;
-        th = Zone_image.container.height;
-        n = 0;
-
-        jQuery(".derivativeSizeDetails").each(function (i) {
-          vn = jQuery(this).text().replace("(", "").replace(")", "").split("x");
-          h0 = parseInt(vn[1]);
-          w0 = parseInt(vn[0])
-          if (h0 > th) {
-            n = i;
-            return false;
-          }
-          if (w0 > tw) {
-            n = i;
-            return false;
-          }
-          n++;
-        });
-        if (n > pt.length - 1) n = pt.length - 1; // format le plus grand
-        if (n < 0) n = 0; // format le plus grand
-        id_en_cours = pt[n][1];
-        last_map = pt[n][5];
-        var theImg = document.getElementById("theMainImage");
-        if (id3.length > 0) {
-          if (theImg.useMap.match(RegExp("map", "gi"))) return true;
-              changeImgSrc(id_en_cours, last_map, "Autosize");
-        } else {
-          new_html = '<br /><span class="switchCheck" id="derivativeCheckedAutosize" style="visibility:hidden" >&#x2714; </span>';
-          new_html += '<a href="javascript:changeImgSrc(\'' + id_en_cours + '\', \'' + last_map + '\', \'Autosize\') ">';
-          new_html += 'Autosize<span class="derivativeSizeDetails"> - Autosize</span>  </a>';
-          jQuery("#derivativeSwitchBox br:last").before(new_html);
-
-          theImg.useMap = typeMap;
-          if (theImg.useMap.match(RegExp("map", "gi"))) {
-            return true
-          };
-          jQuery('#derivativeSwitchBox .switchCheck').css('visibility', 'hidden');
-          jQuery('#derivativeCheckedAutosize').css('visibility', 'visible');
-
-          if (theImg) {
-            theImg.removeAttribute("width");
-            theImg.removeAttribute("height");
-            theImg.src = id_en_cours;
-            theImg.useMap = "Autosize";
-            return true;
-          }
-        }
-
-      }
-      return true;
-
-    };
-
-    //===============================================================
-    //  Fonctions générales
-    //===============================================================
-
-
-    /*************************************************
-    * correction pamoorama
-    *************************************************/
-    Set_Pamoorama = function () {
-      if (Type_Img == "pamoorama") {
-        if (typeof myPamoorama == "undefined") {
-          return;
-        }
-
-        Zone_image = Calcul_Image(infos_imageInfos.visible == false);
-        infos_pamoorama = jQuery("#pamoorama").infos();
-        infos_pamoorama_outter = jQuery("#pamoorama_outter").infos();
-        infos_pamoorama_inner = jQuery("#pamoorama_inner").infos();
-        infos_pamoorama_footer = jQuery("#pamoorama_footer").infos();
-        infos_pamoorama_frame = jQuery("#pamoorama_frame").infos();
-        infos_frame = jQuery(myPamoorama.frame).infos();
-
-
-        //====================================================
-        jQuery("#pamoorama").css({
-          marginLeft: "auto",
-          marginRight: "auto"
-          //  height: Zone_Affichage.height + "px" , sinon déclenchement panorama sur la hauteur;
-        });
-
-        infos_pamoorama_inner = jQuery("#pamoorama_inner").infos();
-        infos_pamoorama = jQuery("#pamoorama").infos();
-
-
-
-
-        marges_w = infos_pamoorama.borderwidth.left +
+    jQuery("#pamoorama").css({
+      marginLeft: "auto",
+      marginRight: "auto"
+      //  height: Zone_Affichage.height + "px" , sinon déclenchement panorama sur la hauteur;
+    });
+
+    infos_pamoorama_inner = jQuery("#pamoorama_inner").infos();
+    infos_pamoorama = jQuery("#pamoorama").infos();
+
+
+
+
+    marges_w = infos_pamoorama.borderwidth.left +
                           infos_pamoorama.margin.left +
                           infos_pamoorama.borderwidth.right +
                           infos_pamoorama.margin.right;
 
-        marges_h = 10 +
+    marges_h = 10 +
                           infos_pamoorama.borderwidth.top +
                           infos_pamoorama.margin.top +
                           infos_pamoorama.borderwidth.bottom +
                           infos_pamoorama.margin.bottom;
-        marges_h += infos_pamoorama_footer.borderwidth.top +
+    marges_h += infos_pamoorama_footer.borderwidth.top +
                           infos_pamoorama_footer.margin.top +
                           infos_pamoorama_footer.borderwidth.bottom +
                           infos_pamoorama_footer.margin.bottom;
 
-        jQuery("#pamoorama").css({
-          width: ""
-        });
-
-        outter_height = Zone_image.container.height - infos_pamoorama_footer.height - marges_h;
-        Zoom_pano = outter_height / Zone_image.height_init;
-
-        new_image = { height: Math.ceil(Zone_image.height_init * Zoom_pano),
-          width: Math.ceil(Zone_image.width_init * Zoom_pano)
-        }
-
-        jQuery("#pamoorama_inner").css({ width: new_image.width, height: new_image.height, "background-size": "100%"
-        });
-
-        //  jQuery("#pamoorama_inner").width(Zone_image.width_init * Zoom_pano);
-        //  jQuery("#pamoorama_inner").height(Zone_image.height_init * Zoom_pano);
-
-
-        //---------- test largeur image 
-        new_width = Zone_image.container.width;
-        if (new_width > new_image.width) {
-          new_width = new_image.width;
-          jQuery("#pamoorama_outter").css({
-            position: 'absolute',
-            align: "center",
-            margin: "auto"
-          });
-        }
-        outter_width = new_width;
-
-
-        //  jQuery("#pamoorama_thumb").width(200 /  Zone_image.zoom);
-
-        jQuery("#pamoorama_outter").css({
-
-          align: 'center',
-          margin: 'auto',
-          width: outter_width + "px",
-          height: outter_height + "px"
-        });
-        //============= Mise à l'echelle ==================
-        jQuery("#pamoorama_footer").css({
-          width: Zone_image.container.width + "px"
-        });
-
-        window.myPamoorama.options.width = Math.ceil(Zone_image.container.width);
-        //==================================================================
-        new_max_left = new_image.width - outter_width;
-        //   jQuery(window.myPamoorama.inner).width(Zone_image.width_init* Zoom_pano);
-        //    jQuery(window.myPamoorama.inner).height(Zone_image.height_init * Zoom_pano);
-
-
-        window.myPamoorama.outter.scrollTo(new_max_left, 0);
-
-        window.myPamoorama.autoScrollFx.to = new Array(new_max_left, 0);
-        window.myPamoorama.ratio = Math.ceil(new_image.width / 200);
-        window.myPamoorama.imageWidth = new_image.width;
-        window.myPamoorama.imageHeight = new_image.height;
-        nf = jQuery("#pamoorama_thumb").height();
-        jQuery("#pamoorama_thumb img").width(200);
-        jQuery("#pamoorama_thumb img").height(nf);
-        // 200=window.myPamoorama.width 
-        // frame = Zone_image.container.width
-
-        nw = (window.myPamoorama.image.width * Zone_image.container.width) / window.myPamoorama.imageWidth;
-        jQuery("#pamoorama_frame").width(nw);
-        jQuery("#pamoorama").css({
-        width:"auto",height:"auto"
+    jQuery("#pamoorama").css({
+      width: ""
+    });
+
+    outter_height = Zone_image.container.height - infos_pamoorama_footer.height - marges_h;
+    Zoom_pano = outter_height / Zone_image.height_init;
+
+    new_image = { height: Math.ceil(Zone_image.height_init * Zoom_pano),
+      width: Math.ceil(Zone_image.width_init * Zoom_pano)
+    }
+
+    jQuery("#pamoorama_inner").css({ width: new_image.width, height: new_image.height, "background-size": "100%"
+    });
+
+    //  jQuery("#pamoorama_inner").width(Zone_image.width_init * Zoom_pano);
+    //  jQuery("#pamoorama_inner").height(Zone_image.height_init * Zoom_pano);
+
+
+    //---------- test largeur image 
+    new_width = Zone_image.container.width;
+    if (new_width > new_image.width) {
+      new_width = new_image.width;
+      jQuery("#pamoorama_outter").css({
+        position: 'absolute',
+        align: "center",
+        margin: "auto"
       });
-
-      } // test img
-    } // Set_Pamoorama
-    /*********************************************************/
-
-    Toggle_bp = function () {
-      cl_visible = !cl_visible;
-      Autosize_resize();
-      Wait_Affichage();
-      set_cl();
-    }
-    //====================================
-    // 
-    //====================================
-    set_cl = function () {
-      if (typeof cl_visible == "undefined") return;
-      if (typeof src1 == "undefined") return;
-
-      if (cl_visible) src = src1;
-      else src = src2;
-
-      if (cl_visible) {
-        src_info = src3;
-        src_infos_1 = src3;
-      }
-      else {
-        src_info = src4;
-        src_infos_1 = src5;
-      }
-
+    }
+    outter_width = new_width;
+
+
+    //  jQuery("#pamoorama_thumb").width(200 /  Zone_image.zoom);
+
+    jQuery("#pamoorama_outter").css({
+
+      align: 'center',
+      margin: 'auto',
+      width: outter_width + "px",
+      height: outter_height + "px"
+    });
+    //============= Mise à l'echelle ==================
+    jQuery("#pamoorama_footer").css({
+      width: Zone_image.container.width + "px"
+    });
+
+    window.myPamoorama.options.width = Math.ceil(Zone_image.container.width);
+    //==================================================================
+    new_max_left = new_image.width - outter_width;
+    //   jQuery(window.myPamoorama.inner).width(Zone_image.width_init* Zoom_pano);
+    //    jQuery(window.myPamoorama.inner).height(Zone_image.height_init * Zoom_pano);
+
+
+    window.myPamoorama.outter.scrollTo(new_max_left, 0);
+
+    window.myPamoorama.autoScrollFx.to = new Array(new_max_left, 0);
+    window.myPamoorama.ratio = Math.ceil(new_image.width / 200);
+    window.myPamoorama.imageWidth = new_image.width;
+    window.myPamoorama.imageHeight = new_image.height;
+    nf = jQuery("#pamoorama_thumb").height();
+    jQuery("#pamoorama_thumb img").width(200);
+    jQuery("#pamoorama_thumb img").height(nf);
+    // 200=window.myPamoorama.width 
+    // frame = Zone_image.container.width
+
+    nw = (window.myPamoorama.image.width * Zone_image.container.width) / window.myPamoorama.imageWidth;
+    jQuery("#pamoorama_frame").width(nw);
+    jQuery("#pamoorama").css({
+      width: "auto", height: "auto"
+    });
+
+  } // test img
+} // Set_Pamoorama
+/*********************************************************/
+
+Toggle_bp = function () {
+  options.cl_visible = !options.cl_visible;
+  Autosize_resize();
+  Wait_Affichage();
+
+}
+//====================================
+// 
+//====================================
+set_cl = function (Valid) {
+  if (typeof Valid == "undefined") Valid = options.useMap.match(RegExp("Autosize", "gi")) || false;
+
+  if (typeof options.cl_visible == "undefined") return;
+  if (typeof src1 == "undefined") return;
+
+  if (options.cl_visible) src = src1;
+  else src = src2;
+
+  if (options.cl_visible) {
+    src_info = src3;
+    src_infos_1 = src3;
+  }
+  else {
+    src_info = src4;
+    src_infos_1 = src5;
+  }
+  if (Valid) {
+    if (typeof Zone_image.image != "undefined") {
       Zone_image.zoom = (Zone_image.image.height / Zone_image.height_init);
       zoom_cl = parseInt(100 * Zone_image.zoom);
@@ -2022,223 +1305,1054 @@
 
       zoom_cl = jQuery('#zoom ').val();
+
       jQuery('#bp_cla').attr('alt', src_info);
       jQuery('#bp_cla').attr('title', src_info);
       jQuery('#bp_cla').attr('Stitle', src_info);
       jQuery('#bp_cla').attr('Stip', zoom_cl + "%");
-
-      //jQuery('#bp_cla span').text(src_infos_1 +"    "+ zoom + "%");
       jQuery('#bp_cla span').text(zoom_cl + "%");
-      bp_scr = jQuery('#bp_img_cla');
-
-      if (bp_scr.length > 0) {
-        src_enc = bp_scr.attr("src");
-        if (!src_enc.match(src)) {
-          bp_scr.get(0).src = src;
-          jQuery('#bp_img_cla').attr('alt', src_info);
-          jQuery('#bp_img_cla').attr('title', src_info);
+      color_back = jQuery('#imageToolBar').css("backgroundColor");
+      if (color_back.match(new RegExp("rgb", "gi"))) {
+        color_back = color_back.split("(")[1].split(")")[0].split(",");
+        color_back = "rgb(" + Math.abs(255 - color_back[0]) + ","
+      + Math.abs(255 - color_back[1]) + ","
+      + Math.abs(255 - color_back[2]) + ")";
+
+      }
+      else if (color_back.match(new RegExp("#", "gi")))
+        color_back = Math.abs("#65536" - color_back);
+      else
+        color_back = jQuery('body').css("color");
+
+
+      jQuery('#bp_cla span').css("color", color_back);
+    }
+  } else {
+    src = src6;
+  }
+  if (Zone_image.image)
+    jQuery('#auto_details').text(" (" + Zone_image.image.width + " x " + Zone_image.image.height + ")");
+  bp_scr = jQuery('#bp_img_cla');
+
+  if (bp_scr.length > 0) {
+    src_enc = bp_scr.attr("src");
+    if (!src_enc.match(src)) {
+      bp_scr.get(0).src = src;
+      jQuery('#bp_img_cla').attr('alt', src_info);
+      jQuery('#bp_img_cla').attr('title', src_info);
+    }
+  }
+}
+//====================================
+// 
+//====================================
+Calcul_Image = function () {
+  // theImageAndInfos(jaune) -> theImage(vert) -> [llgbo] -> theMainImage
+  // + infos_imageInfos(red)
+  infos_window = jQuery(window).infos();
+  infos_body = jQuery("body").infos(); // thePicturePage
+  infos_the_page = jQuery("#the_page").infos();
+  // theHeader
+  // 
+  infos_menubar = jQuery("#menubar").infos();
+  infos_menubar_dl = jQuery("#menubar dl").infos();
+  infos_content = jQuery("#content").infos();
+  // imageHeaderBar
+  // imageToolBar imageInfoBar
+  infos_imageInfoBar = jQuery("#imageInfoBar").infos();
+  infos_imageToolBar = jQuery("#imageToolBar").infos();
+  //theImageAndTitle
+  infos_theImageAndInfos = jQuery("#theImageAndInfos").infos();
+  if (infos_theImageAndInfos.width == 0)
+    infos_theImageAndInfos = jQuery("#theImageAndTitle").infos();
+  infos_theImage = jQuery("#theImage").infos();
+  /****************************************
+  * marginl r 10 10,borderwidth 5 5, padding 10 10
+  * infos_theImage width 849 , (+padding) out 869,(+border) ext 879 ,(+marge) general 899
+  * general marges width 50 l25+r25,
+  ****************************************/
+
+  infos_imageInfos = jQuery("#imageInfos").infos();
+  infos_theMainImage = jQuery(theMainImage_Id).infos();         // Image
+  infos_theMainImage.src = jQuery(theMainImage_Id).attr("src");
+
+  // commentContent
+  // copyright 
+
+  pos_top = options.pos_top;
+  pos_top = options.pos_top + infos_llgbo.top
+
+  container = {
+    height: infos_window.height - pos_top,
+    width: infos_content.width
+  }
+  marge_left = infos_theImage.general.marges.left;
+  marge_right = infos_theImage.general.marges.right;
+  marge_top = infos_theImage.general.marges.top + infos_content.general.marges.top + 2;
+  marge_bottom = infos_theImage.general.marges.bottom + Math.ceil(options.marge_basse) + infos_content.general.marges.bottom; ;
+
+  //==========================================================
+  if (theme.match(RegExp("stripped", "gi"))) {
+    infos_the_page.margin.left = 20;  //taille fleche
+    infos_the_page.margin.right = 20;
+  }
+
+
+  if (theme.match(RegExp("elegant", "gi"))) {
+    jQuery("#imageInfos").css({ position: "absolute", right: 0, margin: "auto"
+      , top: 0
+    });
+
+
+    // marge_right += infos_content.general.marges.right;
+    if (infos_imageInfos.visible == true) {
+      marge_right += infos_imageInfos.width + 2;
+
+    } else {
+      marge_right += 15;
+
+    }
+    marge_left += 5;
+    marge_top += 20;
+
+  } else if (theme.match(RegExp("stripped", "gi"))) {
+
+  } else if (theme.match(RegExp("simple", "gi"))) {
+
+
+  } else if (theme.match(RegExp("OS", "gi"))) {
+
+  } else if (theme.match(RegExp("pur", "gi"))) {
+
+    marge_right += 25;
+
+  } else {
+    //   jQuery("#menuSwitcher").hide();
+
+    margeLeft = infos_content.margin.left;
+    if (infos_menubar_dl.visible == true) {
+      margeLeft += infos_body.general.marges.width + infos_menubar.general.width;
+    }
+    else
+
+      margeLeft += infos_thePicturePage.general.marges.width;
+    // container.width -= margeLeft;
+
+
+  }
+
+
+
+  //========== Format Image ==============  
+  retrait_img_h = Math.ceil(options.marges_llgbo || 0)
+      + infos_theMainImage.general.marges.height
+     ;
+  //===============================================================
+  retrait_img = Math.ceil(infos_theMainImage.general.marges.width);
+  retrait_img += Math.ceil(options.marges_llgbo || 0);
+  retrait_img += 0;
+
+  //================== Limite Format Image =====================
+  image_max = {
+    height: container.height - marge_top - marge_bottom - retrait_img_h,
+    width: container.width - marge_left - marge_right - retrait_img
+  }
+  //================================================================
+  if (typeof Zone_image.height_init == "undefined") {
+    init_img(theImg);
+    Zone_image.width_init = img_init.width;
+    Zone_image.height_init = img_init.height;
+    Zone_image.height_init = Math.ceil(img_init.height);
+    Zone_image.rapport_init = Math.ceil(img_init.width / Zone_image.height_init);
+    rapport = Zone_image.rapport_init;
+  }
+
+  theMainImage_str = theMainImage_Id.replace("#", "");
+  useMap_en_cours = jQuery(theMainImage_Id).attr("useMap");
+
+  var theImg = document.getElementById(theMainImage_str);
+  if (theImg) {
+    if (useMap_en_cours.match(RegExp("map", "gi"))) {
+      image_max.height = jQuery(theImg).height() - retrait_img_h;
+      image_max.width = jQuery(theImg).width() - retrait_img;
+      width_theMainImage = image_max.width;
+      height_theMainImage = image_max.height;
+    } else {
+      //=========================
+      // test débordement
+      //=========================
+      rapport = Zone_image.rapport_init;
+      width_theMainImage = Math.ceil(image_max.width);
+      height_theMainImage = Math.ceil(width_theMainImage / rapport);
+
+      container.height_interne = container.height - marge_top - marge_bottom;
+      container.width_interne = container.width - marge_left - marge_right;
+
+      if (height_theMainImage > container.height_interne) {
+        image_max.height = container.height_interne;
+        image_max.width = image_max.height * rapport;
+        width_theMainImage = Math.ceil(image_max.width);
+        height_theMainImage = Math.ceil(image_max.height);
+      }
+      if (width_theMainImage > container.width_interne) {
+        image_max.width = container.width_interne;
+        image_max.height = image_max.height / rapport;
+        width_theMainImage = Math.ceil(image_max.width);
+        height_theMainImage = Math.ceil(image_max.height);
+
+      } else if (width_theMainImage > container.width) {
+
+      } else {
+
+      }
+    }
+    //=============================================================== 
+  }
+  if (Type_Img != "pamoorama") {
+
+  }
+
+  //=================================================
+  rapport = Zone_image.rapport_init;
+
+  height_theMainImage = Math.ceil(width_theMainImage / rapport);
+  container.height = height_theMainImage + retrait_img_h + infos_theImage.general.marges.top + pos_top;
+
+  //================================================================
+  Zone_image.image = {
+    width: width_theMainImage,
+    height: height_theMainImage
+  };
+
+  Zone_image.container = {
+    width: container.width,
+    height: container.height
+
+  };
+  //=================================================================
+
+  Zone_image.src = jQuery(theMainImage_Id).attr("src");
+
+
+  Zone_image.zoom = Zone_image.image.height / Zone_image.height_init;
+
+}
+
+/*********************************************
+* Calcul l es dimensions.
+*********************************************/
+Get_dimensions = function (force, parametres) {
+  infos_theMainImage = jQuery(theMainImage_Id).infos();
+  Zone_image.src = infos_theMainImage.src;
+  if (typeof rapport == "undefined") return;
+  if (force && force == true) old_window.width = 0;
+
+
+  if (infos_theMainImage.useMap.match(RegExp("Autosize", "gi")))
+    infos_theMainImage.useMap = "#Autosize";
+
+  useMap = options.useMap;
+
+  if (theme.match("simple")) useMap = "#Autosize";
+  if (typeof useMap == "") useMap = "#Autosize";
+  if (options.useMap) {
+    //  useMap = options.useMap;
+  }
+  if (useMap) {
+    if (!useMap.match(RegExp("Autosize", "gi"))) {
+      return;
+    }
+  }
+
+  if (options.imageAutosize) {
+    return; //stripped
+  }
+
+  if (typeof options.cl_visible == "undefined") return;
+  if (!options.cl_visible == true) { return; }
+  //======================================================
+
+  var chk = eval("options." + user_status + "_enabled");
+  if (chk == "") { return; }
+
+  if (!options.useMap.match(RegExp("Autosize", "gi"))) {
+
+    return;
+  }
+
+  //================================================================= 
+  infos_widow = jQuery(window).infos();
+  var winwidth = infos_body.width;
+  var winheight = infos_body.height;
+  if (Type_Img == "pamoorama") {
+    theMainImage_Id = "#pamoorama";
+    Calcul_Image();
+  } else {
+    Calcul_Image();
+  }
+  img_finale = { width: Zone_image.image.width, height: Zone_image.image.height };
+  //=================================================================
+  old_window = jQuery(window).infos();
+  //========= Récupération des informations =============  
+  var Licence = jQuery(".licencetag");
+  infos_Licence = jQuery(".licencetag").infos();
+  //=================================================================
+  switch (Type_Img) {
+    case "map":
+      Set_Map(true);
+      break
+    case "panorama":
+      if (!theMainImage_Id) {
+        theMainImage_Id = "#theMainImage";
+        if (theMainImage_Id.length > 0)
+          return;
+        theMainImage_Id = jQuery().Get_Img_Maxi("#Panorama img[alt]");
+
+        if (theMainImage_Id.length > 0)
+          theMainImage_Id = theMainImage_Id[0];
+        else
+          theMainImage_Id = jQuery().Get_Img_Maxi("#Panorama img[alt]");
+      }
+      infos_theImage = jQuery(theMainImage_Id).infos();
+      infos_the_page = jQuery("#the_page").infos();
+      jQuery("#theImage").height(infos_theImage.height);
+      img_finale.height = infos_theImage.height;
+      break
+    case "img":
+
+      if (!theMainImage_Id) return;
+      if (theme.match(RegExp("luciano", "g"))) {
+
+      }
+
+      infos_the_page = jQuery("#the_page").infos();
+
+
+      break
+    case "img_autre":
+      if (!theMainImage_Id) {
+        if (DEBUG_autosize == "true") alert("The_MainImage=null");
+        return;
+
+      }
+      infos_theImage = jQuery(theMainImage_Id).infos();
+      infos_the_page = jQuery("#the_page").infos();
+
+
+      break
+    case "embed":
+      //
+      if (infos_theMainImage.width == 0)
+        infos_theMainImage = jQuery("#thePicturePage").infos();
+      if (infos_theMainImage.width == 0)
+        infos_theMainImage = jQuery("#the_page").infos();
+      infos_theImage = infos_theMainImage;
+      infos_the_page = jQuery("#the_page").infos();
+      Bandeau_bas.height = Bandeau_bas.top;
+
+      iph1 = jQuery("#theImage div").infos();
+      if ((winheight - iph1.bottom) > 0)
+        Bandeau_bas.height = (winheight - iph1.bottom) + 50;
+      else
+        Bandeau_bas.height = 50;
+
+
+      if (rapport < 0) {
+        img_height = infos_theMainImage.height;
+        img_width = infos_theMainImage.width;
+        img_reelle.height = img_height;
+        img_reelle.width = img_width;
+      }
+
+      break
+    case "charlie":
+      img_reelle = { height: img_height, width: img_width };
+      infos_theMainImage = jQuery(theMainImage_Id).infos(); ;
+      infos_the_page = jQuery("#the_page").infos();
+      if (rapport < 0) {
+        img_height = parseInt(infos_theMainImage.height);
+        img_width = parseInt(infos_theMainImage.width);
+        img_reelle.height = parseInt(infos_theMainImage.height);
+        img_reelle.width = parseInt(infos_theMainImage.width);
+      }
+      break
+
+
+    case "pamoorama":
+      img_reelle = { height: img_height, width: img_width };
+      //=========================================================
+      img_reelle.height = img_height;
+      img_reelle.width = Zone_Affichage.width;
+      if (typeof myPamoorama != "undefined") theMainImage_Id = myPamoorama.image;
+      infos_theImage = jQuery("#pamoorama").infos();
+      infos_theImage.height = infos_theImage.height;
+      infos_the_page = jQuery("#the_page").infos();
+      break
+  }
+
+  img_finale = { width: Zone_image.image.width, height: Zone_image.image.height };
+  return true;
+
+  //================= Vérification Taille image minimun autorisée ========
+  MinWidth = jQuery(theMainImage_Id).css("minWidth");
+  if (MinWidth == "0px")
+    MinWidth = options.mini_width;
+  MinHeight = jQuery(theMainImage_Id).css("minHeight");
+  if (MinHeight == "0px")
+    MinHeight = options.mini_height;
+
+  MaxWidth = jQuery(theMainImage_Id).css("maxWidth");
+  if (MaxWidth == "0px")
+    MaxWidth = winwidth;
+  MaxHeight = jQuery(theMainImage_Id).css("maxHeight");
+  if (MaxHeight == "0px")
+    MaxHeight = winheight;
+
+  //=============== Vérification taille minimale  autorizée ======================
+  var miniWidth = jQuery(theMainImage_Id).Get_Val_int(MinWidth, options.mini_width);
+  var miniHeight = jQuery(theMainImage_Id).Get_Val_int(MinHeight, options.mini_height);
+  if (winwidth < options.mini_width2) mini_width2 = winwidth;
+
+  var miniWidth2 = jQuery(theMainImage_Id).Get_Val_int(MinWidth, options.mini_width2);
+  var miniHeight2 = jQuery(theMainImage_Id).Get_Val_int(MinHeight, options.mini_height2);
+
+
+  var maxWidth = jQuery(theMainImage_Id).Get_Val_int(MaxWidth, winwidth, "0");
+  maxHeight = jQuery(theMainImage_Id).Get_Val_int(MaxHeight, winheight, "0");
+
+  mini_width = parseInt(miniWidth);
+  mini_height = parseInt(miniHeight);
+  img_reelle.width = parseInt(img_reelle.width);
+  if (img_reelle.width < mini_width)
+    return;
+  img_reelle.height = parseInt(img_reelle.height);
+  if (img_reelle.height < parseInt(mini_height))
+    return;
+
+
+
+
+  //=================================================
+  if (Zone_image.image.height < options.mini_height2)
+    Zone_image.image.height = options.mini_height2;
+  if (Zone_image.image.width < options.mini_width2)
+    Zone_image.image.width = options.mini_width2;
+  //==================================================
+  //   Image_width largeur à atteindre
+  //   Calcul du rapport d'agrandissement
+  echelle_max = parseFloat(options.echelle_max, '3');
+  if (Zone_image.zoom > echelle_max) {
+    Zone_image.zoom = echelle_max;
+    Zone_image.image.width = parseInt(Zone_image.width_init * Zone_image.zoom);
+    if (rapport > 0)
+      Zone_image.image.height = parseInt(Zone_image.width_init / rapport);
+  }
+  //=============================================================
+  var height_user = eval("options." + user_status + "_height");
+  var width_user = eval("options." + user_status + "_width");
+  var reg1 = new RegExp("%", "g");
+  //=============================================================     
+  if (height_user.match(reg1))
+    Image_height = Zone_image.height_init * parseInt(height_user) / 100;
+  else
+    Image_height = parseInt(height_user);
+  //==============================================================
+
+  Image_width = parseInt(Image_height * rapport);
+
+  //======================================================================
+  img_finale = { width: Zone_image.image.width, height: Zone_image.image.height };
+  return true;
+
+
+
+
+
+
+
+  //===================================================
+
+  img_finale.height = Image_height;
+  img_finale.width = Image_width;
+  if (theme.match(RegExp("stripped", "gi"))) {
+    img_finale.width -= (llgboframe.top * 2);
+    if (rapport > 0) img_finale.height = (img_finale.width / rapport);
+    else img_finale.height -= (llgboframe.top * 2);
+
+  }
+  zoom = echelle;
+  if (typeof (llgboframe) != "undefined" && llgboframe.height > 0) {
+    //=============LLGBO2 ===========================
+    t1 = llgboframe;
+    if (!theMainImage_Id.src) {
+      theMainImage_Id = jQuery(llgbo_id).find("img").get(0)
+      if (!theMainImage_Id.src) {
+        theMainImage_Id = jQuery("#theImage").find("div").get(0)
+      }
+    }
+    if (theMainImage_Id.src) {
+      wingbo = img_finale.width;
+      heightgbo = img_finale.height;
+      if (Type_Img == "panorama") {
+        heightgbo = infos_theImage.height;
+        img_finale.height = infos_theImage.height;
+      }
+
+
+
+
+      //    jQuery("#theImage").height(heightgbo + marges_llgbo / 2);
+    }
+  }
+
+  //================ Zone affichage =========================
+
+  //  jQuery("#theImage").css("top", "0px");
+  jQuery("#standard").css("top", 0 + "px");
+  jQuery("#comments").css("top", 0 + "px");
+  //========== Image Remise à l'échelle =======================
+
+  img_finale.height = parseInt(img_finale.height);
+  img_finale.width = parseInt(img_finale.width);
+  //=========================================================================
+  //=== cadre = theImage
+  if (theme.match(RegExp("simple", "gi"))) {
+    jQuery("#theImage").width(Zone_Affichage.width); //centrer simple black
+    jQuery("#theImage").css({ width: Zone_Affichage.width + "px",
+      marginLeft: "auto"
+    });
+
+  } else if (theme.match(RegExp("sobre", "gi")) || theme.match(RegExp("hr_", "gi")) || theme.match(RegExp("Mont", "gi"))) {
+    jQuery("#theImage").css({ width: "auto", marginLeft: "auto" });
+  } else if (theme.match(RegExp("saruka", "gi"))) {
+
+    jQuery("#theImage").css({ width: Zone_Affichage.width + "px" });
+  } else if (theme.match(RegExp("elegant", "gi"))) {
+
+    // jQuery("#theImage").css("width", "auto");
+    jQuery("#theImage").css({ height: Zone_Affichage.height + "px", width: "auto" }); //conteneur
+
+  } else {
+    jQuery("#theImage").css("width", "auto");
+
+  }
+  // ;
+
+  if (Type_Img == "panorama" || Type_Img == "pamoorama") {
+    img_finale.height = infos_theImage.height;
+    Zone_Affichage.height = img_finale.height;
+
+  }
+
+  if (typeof (gmaps) != "undefined") {
+    Gmap_ = gmaps.maps[0];
+    if (Gmap_.sizeMode == 'A') {
+      jQuery("#iGMapsIcon").css({ width: old_window.width * 0.8 + "px", height: old_window.height * 0.8 + "px" });
+
+    }
+  }
+  //============= flv,mov,mpg  ok
+  /* wmv nok
+  * avi nok
+  //===========================================
+  */
+  if (Type_Img == "charlie") {
+    t1 = jQuery("#charlie").infos();
+
+    /**/
+
+    pdf = 0;
+    jQuery("#charlie div").each(function (i) {
+
+
+      p1 = jQuery(this).infos();
+      pdf += p1.padding.right + p1.padding.left;
+    });
+    img_finale.width -= pdf;
+
+    jQuery("#charlie").css({
+      width: img_finale.width + pdf + "px",
+      height: img_finale.height + "px",
+      marginLeft: "auto"
+    });
+
+
+    if (MainImage.length > 0) {
+      img_finale.height = parseInt(img_finale.width / rapport);
+      img_finale.height -= 30;
+      img_finale.width = rapport * img_finale.height;
+
+
+      MainImage.width(img_finale.width);
+      MainImage.height(img_finale.height);
+      jQuery("#embedplayer").width(300);
+      jQuery("#embedplayer").height(15);
+    } else {
+      jQuery("#player").css("width", img_finale.width + "px");
+      jQuery("#player").css("height", img_finale.height + "px");
+
+      jQuery("#embedplayer").css("width", img_finale.width + "px");
+      jQuery("#embedplayer").css("height", img_finale.height + "px");
+
+      jQuery("embed").css({ width: img_finale.width + "px",
+        height: img_finale.height + "px"
+      });
+      jQuery("object").css({ width: img_finale.width + "px",
+        height: img_finale.height + "px"
+      });
+      jQuery("video").css({ width: img_finale.width + "px",
+        height: img_finale.height + "px"
+      });
+
+
+
+      jQuery("video").height(img_finale.height);
+      jQuery("video").width(img_finale.width);
+
+      jQuery("object").width(img_finale.width);
+      jQuery("object").height(img_finale.height);
+      //jQuery("#theImage").height(img_finale.height + Bandeau_bas.height); //??             
+
+      jQuery(theMainImage_Id).height(img_finale.height);
+      jQuery("#theImage").css("height", "auto");
+    }
+
+
+  } else if (Type_Img == "embed") {
+
+    if (MainImage.length > 0) {
+      img_finale.height = parseInt(img_finale.width / rapport);
+      img_finale.height -= 30;
+      img_finale.width = rapport * img_finale.height;
+
+
+      MainImage.width(img_finale.width);
+      MainImage.height(img_finale.height);
+      jQuery("#embedplayer").width(300);
+      jQuery("#embedplayer").height(15);
+    } else {
+      jQuery("#theImage").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") {
+    if (typeof asp_options != "undefined")
+      n = asp_options;
+    n1 = jQuery("#Panorama div").width();
+    jQuery(".panorama-viewport").css("margin", "auto");
+    n = infos_imageToolBar;
+
+
+  } else if (Type_Img == "pamoorama") {
+    Set_Pamoorama();
+
+
+
+
+  } else if (theMainImage_Id != null && theMainImage_Id.src) {
+    //--- background ?? ---
+    jQuery(theMainImage_Id).height(img_finale.height);
+    jQuery(theMainImage_Id).width(img_finale.width);
+    jQuery(theMainImage_Id).css({ height: img_finale.height + "px ",
+      width: img_finale.width + "px "
+    });
+
+
+  } else {
+    //===map ? luciano ===
+    //   jQuery(theMainImage_Id).css({ height: img_finale.height + "px ",  width: img_finale.width + "px });
+    //   jQuery(theMainImage_Id).height(img_finale.height );
+    //   jQuery(theMainImage_Id).width(img_finale.width );
+    //   jQuery(theMainImage_Id).attr({ width: img_finale.width  });
+    h = img_finale.height;
+    h = Zone_Affichage.height - Zone_Affichage.borderwidth.top - Zone_Affichage.borderwidth.bottom;
+    h -= (infos_theImage.borderwidth.bottom + infos_theImage.borderwidth.top);
+
+    jQuery(theMainImage_Id).attr({ height: h - 3 }); //image
+    if (theme.match(RegExp("elegant", "gi"))) {
+      return true;
+
+    }
+    if (theme.match(RegExp("luciano", "g"))) {
+      imgl = 180;
+      l = Zone_Affichage.left;
+
+      jQuery(".imageNumber").css({ left: l + "px"
+
+      });
+      jQuery("#theImage" + " #theImg IMG").css({ height: img_finale.height + "px ",
+        width: (img_finale.width - imgl) + "px ", marginTop: "0px"
+      })
+    }
+
+  }
+
+  var theImg = document.getElementById(theMainImage_Id.replace("#", ""));
+  if (theImg) {
+    theImg.removeAttribute("width");
+    theImg.removeAttribute("height");
+    jQuery(theMainImage_Id).css("width", img_finale.width + "px");
+  }
+
+  jQuery("#navThumbPrev").css({ overflow: "hidden" });
+  jQuery("#navThumbNext").css({ overflow: "hidden" });
+  n = typeof inittoolbar;
+  if (Type_Img == "map") {
+    jQuery("#navThumbNext").css({ display: 'none' });
+    jQuery("#navThumbPrev").css({ display: 'none' });
+    jQuery("#theImage").css({ marginTop: infos_imageToolBar.height + "px", marginLeft: "0px",
+      width: winwidth + "px",
+      height: winheight + "px"
+    });
+    //mapPicture 
+  }
+  try {
+    if (theme.match(RegExp("gally", "gi"))) {
+      if (typeof inittoolbar == "function") {
+        if (typeof (currentTab) == "undefined") inittoolbar();
+        else initializeImageMode("resize");
+      } else {
+        tp = gallyPP.getImageProp();
+        if (typeof (GallyPP) == "function")
+          gallyPP = new GallyPP();
+
+        iph = jQuery("#imageHeaderBar").infos();
+        jQuery("#imageToolBar").css({ top: iph.bottom + "px", position: "absolute" });
+        jQuery("#theImage").width(winwidth);
+      }
+      //===========================================================================
+      if (jQuery("#navThumbPrev").length > 0) {
+        jQuery("#navThumbPrevContainer").css({ left: "0px"
+        });
+      }
+      if (jQuery("#navThumbNext").length > 0) {
+        jQuery("#navThumbNextContainer").css({ left: "0px"
+        });
+      }
+      //=============================================================================
+      if (!theme.match(RegExp("lapis", "gi"))) {
+        if (typeof initializeImageMode == "function") {
+          initializeImageMode("resize");
         }
-      }
-    }
-    //====================================
-    // 
-    //====================================
-    Calcul_Image = function (all_width) {
-      // theImageAndInfos(jaune) -> theImage(vert) -> [llgbo] -> theMainImage
-      // + infos_imageInfos(red)
-      infos_body = jQuery("body").infos(); // thePicturePage
-      infos_the_page = jQuery("#the_page").infos();
-      // theHeader
-      // 
-      infos_menubar = jQuery("#menubar").infos();
-      infos_content = jQuery("#content").infos();
-      // imageHeaderBar
-      // imageToolBar imageInfoBar
+
+      }
+
+    } else if (theme.match(RegExp("simple", "g"))) {
+
+      jQuery("#imageToolBar").css({ position: "static" });
+
       infos_imageInfoBar = jQuery("#imageInfoBar").infos();
-      infos_imageToolBar = jQuery("#imageToolBar").infos();
-      //theImageAndTitle
-      infos_theImageAndInfos = jQuery("#theImageAndInfos").infos();
-      if (infos_theImageAndInfos.width == 0)
-        infos_theImageAndInfos = jQuery("#theImageAndTitle").infos();
-      infos_theImage = jQuery("#theImage").infos();
-      infos_imageInfos = jQuery("#imageInfos").infos();
-      infos_theMainImage = jQuery(theMainImage_obj).infos();         // Image
-      infos_theMainImage.src = jQuery(theMainImage_obj).attr("src");
-      //  infos_llgbo = jQuery("#llgbo").infos();
-      // commentContent
-      // copyright
-      pos_bottom = infos_content.bottom - infos_content.margin.bottom;
-      pos_left = infos_theImage.left;
-      x = infos_body.left;
-      imageInfos_width = jQuery("#imageInfos").css("width");
-
-      if (theme.match(RegExp("stripped", "gi"))) {
-        infos_the_page.margin.left = 20;  //taille fleche
-        infos_the_page.margin.right = 20;
-      }
-
-      retrait_w = Math.ceil(infos_theImage.general.marges.width
-
-                                );
-
-
-      retrait_w += Math.ceil(infos_the_page.general.marges.width
-
-                                );
-
-      retrait_w += Math.ceil(infos_body.general.marges.width);
-
-      retrait_w += Math.ceil(infos_content.general.marges.width);
-
-
-      pos_top = Math.ceil(infos_theImageAndInfos.top
-                     + infos_theImageAndInfos.general.marges.height
-);
-
-      retrait_h = Math.ceil(pos_top
-                         + infos_theImage.margin.top
-                                + infos_theImage.general.marges.height
-                                );
-
-
-
-      jQuery(theMainImage_obj).css({ margin: "auto"
-      });
-
-      retrait_img = Math.ceil(
-                      infos_theMainImage.general.marges.width
-                    );
-      retrait_img += Math.ceil(
-                       infos_llgbo.borderwidth.left
-                     + infos_llgbo.borderwidth.right
-                     );
-
-      retrait_img += Math.ceil(
-                                  infos_the_page.general.marges.width
-                                );
-
-
-
-      //  menuSwitcherwidth+padding
-
-
-      if (theme.match(RegExp("elegant", "gi"))) {
-        if (all_width != true) {
-          marge_right = infos_imageInfos.general.width;
-        } else {
-          marge_right = 0;
-        }
-
-        wx1 = infos_theImage.general.width;
-        width_theImage = (infos_body.width - marge_right - 1)
-
-
-      } else if (theme.match(RegExp("stripped", "gi"))) {
-        width_theImage = (jQuery(window).width());
-      } else if (theme.match(RegExp("simple", "gi"))) {
-        width_theImage = infos_imageInfoBar.left + infos_theImage.left - infos_imageInfoBar.margin.left - 5;
-
-
-      } else {
-        width_theImage = (infos_body.width);
-        marginLeft = infos_menubar.margin.left + 1;
-        marginLeft = infos_content.margin.left;
-        infos_menubar_dl = jQuery("#menubar dl").infos();
-        marginLeft = infos_menubar_dl.margin.left
-                    + infos_menubar_dl.left
-                    + infos_menubar_dl.width;
-        if (infos_menubar_dl.visible == "false")
-         if (!theme.match(RegExp("sylvia", "gi")))
-            marginLeft = 0;
-        jQuery("#content").css({ marginLeft: marginLeft+"px" });
-      }
-
-
-      b = 0;
-
-
-      if (infos_llgbo.top > 0) {
-        if ((infos_llgbo.top - retrait_h) > 0) {
-          b = infos_llgbo.top - retrait_h;
-        } else {
-          b = infos_llgbo.top;
-        }
-      }
-      retrait_h += (b * 2) - 5;
-      retrait_img += 5;
-
-
-      height_theImage = jQuery(window).height() - retrait_h;
-      width_theImage -= retrait_w;
-      //===============================================================
-      width_theMainImage = (width_theImage - retrait_img);
-      height_theMainImage = parseInt(width_theImage / rapport);
-
-      //===============================================================
-      // test débordement
-      if ((height_theMainImage) > height_theImage - (retrait_img + (b * 2))) {
-        height_theMainImage = height_theImage - (retrait_img);
-        width_theMainImage = parseInt(height_theMainImage * rapport);
-      } else {
-        width_theMainImage = width_theImage - (retrait_img);
-        height_theMainImage = parseInt(width_theMainImage / rapport);
-      }
-      //==================================================================
-      var theImg = document.getElementById("theMainImage");
-      if (theImg) {
-
-
-        if (theImg.useMap.match(RegExp("map", "gi"))) {
-          height_theMainImage = jQuery(theImg).height() - (retrait_img);
-          width_theMainImage = jQuery(theImg).width() - retrait_img;
-        }
-      }
-      width_theMainImage = parseInt(height_theMainImage * rapport);
-      height_theMainImage = parseInt(width_theMainImage / rapport);
-
-      height_theImage += (b * 2);
-      if (height_theImage > height_theMainImage + retrait_h) {
-        if (Type_Img != "pamoorama") {
-        height_theImage = height_theMainImage + retrait_h;
-      }
-      }
-      height_theMainImage = width_theMainImage / rapport;
-
-      Zone_image = {
-        image: { width: width_theMainImage,
-          height: height_theMainImage
-        },
-        container: {
-          width: width_theImage,
-          height: height_theImage
-        }
-      };
-      Zone_image.top = retrait_h;
-      Zone_image.marge = { width: retrait_w, height: retrait_h };
-
-      Zone_image.src = jQuery(theMainImage_obj).attr("src");
-
-
-      Zone_image.width_init = img_init.width;
-      Zone_image.height_init = img_init.height;
-
-      if (!Zone_image.height_init) {
-        Zone_image.height_init = parseInt(img_init.height);
-        Zone_image.rapport_init = parseInt(img_init.width) / Zone_image.height_init;
-      }
-
-      Zone_image.rapport_init = Zone_image.width_init / Zone_image.height_init;
-      Zone_image.zoom = Zone_image.image.height / Zone_image.height_init;
-
-      return Zone_image;
-    }
-
-
-
-    Autosize_resize(true);
-
-
-  });  // ready
-})(jQuery);
-
+      if (infos_imageInfoBar.bottom < infos_theMainImage.bottom) {
+        //   jQuery("#imageInfoBar").height(infos_theMainImage.bottom);
+      }
+
+    } else {
+
+      //    jQuery("#imageToolBar").css("position", "static");
+    }
+  } catch (e) {
+
+  }
+  zoom = img_finale.height / img_height;
+  h0 = jQuery("#content").height();
+  if (h0 == null) {
+    h0 = winheight - Zone_Affichage.top;
+  }
+  h1 = (h0 - img_finale.height) / 2;
+  //  jQuery("#theImage").css({ marginTop: h1 + "px" });
+
+  zoom = parseInt(zoom * 100);
+  jQuery('#zoom ').val(zoom);
+
+
+
+  //  --- réglage de la hauteur de page en fonction du copyright-----------
+  if (typeof (pos_copyright) == "undefined") pos_copyright = jQuery("#copyright").infos();
+
+  if (theme.match(RegExp("stripped", "gi"))) {
+    var TitleBox = jQuery("#imageTitleContainer");
+    if (TitleBox.length != 0) TitleBox.css("width", img_finale.width + "px");
+  } else {
+
+  }
+
+
+  /*
+  if (!theme.match(RegExp("luciano", "gi"))) {
+  jQuery("#linkNext").css({ height: "80px", width: "200px", overflow: "hidden" });
+  jQuery("#linkPrev").css({ height: "80px", width: "200px", overflow: "hidden" });
+  jQuery(".navThumb img").css({ height: "80px", width: "", overflow: "hidden" });
+  }
+  */
+  infos_frame = jQuery("#theImage").infos();
+  if (theme.match(RegExp("stripped", "gi"))) {
+    /*
+    infos_theImageBox = jQuery("#theImageAndTitle").infos();
+    p1 = jQuery(".randomButtons").infos();
+    p2 = jQuery("#imageHeaderBar").infos();
+    p3 = infos_content.top;
+    p1 = options.imageAutosizeTitle;
+
+    jQuery("#theImage").width("width", infos_theImageBox.width + "px");
+    //jQuery("#theImageAndTitle").css("position", "relative");
+    jQuery("#content").css({ position: "relative", top: "10px", marginTop: "0px",
+    paddingTop: "0px", textAalign: "center", marginLeft: "auto"
+    });
+
+    jQuery("#theImageAndTitle").css({ position: "relative", top: "0px", marginTop: "0px",
+    paddingTop: "0px", marginLeft: "auto"
+    }); */
+    t1 = infos_theImageBox.top;
+    l1 = infos_theImageBox.left;
+    // infos_theImageBox = jQuery("#theImage").infos();
+
+  } else {
+
+    t1 = infos_frame.top;
+    l1 = infos_frame.left;
+    infos_theImageBox = jQuery("#theImage").infos(); //theImage
+  }
+  infos_theImageBox.margin.margin = infos_frame.margin.margin;
+  infos_theImageBox.top = t1;
+  infos_theImageBox.left = l1;
+  //  infos_theImageBox.position = "absolute";
+
+  Window_Affichage = infos_theImageBox;
+  if (DEBUG_autosize == "_true") {
+    //   jQuery("#theImage").css("border", "solid green");
+
+    jQuery("#Debug5").css({ background: "red",
+      position: "absolute",
+      border: "green solid 2px",
+      textAlign: align_auto,
+      margin: "auto",
+      top: Window_Affichage.top + "px",
+      left: Window_Affichage.left + "px",
+      width: Window_Affichage.width + "px",
+      height: Window_Affichage.height + "px"
+    }); //red
+    jQuery("#Debug4").css({ top: infos_frame.bottom - infos_description.height + "px" }); //green
+  }
+
+  //Wait_Affichage();
+
+  return true;
+} // Get_dimensions
+
+
+//=========================================================
+theMainImage_Id = "#theMainImage";
+if (typeof (options) == "undefined") {
+  options = { imageAutosize: false }
+}
+options = jQuery.extend(Autosize_options, options);
+var defaults = {
+  useMap: '#Autosize',
+  imageAutosizeMargin: 0,
+  imageAutosize: false,
+  marge_basse: options.imageAutosizeMargin || 0,
+  DEBUG_autosize: false
+};
+
+options = jQuery.extend(defaults, options);
+jQuery("#form_autosize_picture").addClass("Autosize_margin");
+//===== marges suplémentaires en fonction theme ===
+options.marge_haute = jQuery(".Autosize_margin").Get_Val_int(jQuery(".Autosize_margin").css("top"));
+options.marge_basse = jQuery(".Autosize_margin").Get_Val_int(jQuery(".Autosize_margin").css("bottom"));
+options.marge_gauche = jQuery(".Autosize_margin").Get_Val_int(jQuery(".Autosize_margin").css("left"));
+options.marge_droite = jQuery(".Autosize_margin").Get_Val_int(jQuery(".Autosize_margin").css("right"));
+
+
+DEBUG_autosize = options.DEBUG_autosize;
+cookies = Get_cookies();
+
+//============= Gestion Maps ================
+nom_map = "Autosize";
+a_up = jQuery("map[name='" + nom_map + "'] area[rel=up]");
+a_prev = jQuery("map[name='" + nom_map + "'] area[rel=prev]");
+a_next = jQuery("map[name='" + nom_map + "'] area[rel=next]");
+
+new_html = '<map name="Autosize" >';
+
+var theme = options.theme;
+nb_zone = jQuery("div .navigationButtons a").length;
+var infos_theMainImage = jQuery(theMainImage_Id).infos();          // Image 
+var Largeur_zone = (infos_theMainImage.width / nb_zone);
+var Hauteur_zone = (infos_theMainImage.height);
+var init_zone = 0;
+j = 0;
+jQuery("div .navigationButtons a").each(function (e) {
+  Hauteur_zone = (infos_theMainImage.height);
+  title = jQuery(this).attr("title");
+  h_ref = jQuery(this).attr("href");
+  init_zone = Largeur_zone * j;
+  if (title.match(":")) {
+    if (j == 0)
+      rel = "prev";
+    else
+      rel = "next";
+  } else {
+    rel = "up";
+    Hauteur_zone = Hauteur_zone / 4;
+  }
+  coord = init_zone + "," + 0 + "," + Math.ceil(init_zone + Largeur_zone) + "," + Hauteur_zone;
+  new_html += '<area rel="' + rel + '" title="' + title + '" href="' + h_ref + '" shape="rect" coords="' + coord + '" alt="' + title + '" />';
+
+  j++;
+});
+new_html += '</map>';
+jQuery("#theImage map:last").after(new_html);
+
+//=================== Gestion liste photos size ============================
+us = 0;
+var user_status = options.user_status;
+var type_size = eval("options." + user_status + "_type"); //limite taille
+var type_size_maxi = eval("options." + user_status + "_type"); //limite taille
+
+n = 0;
+
+var pt = new Array();
+jQuery("#derivativeSwitchBox .switchCheck").css('visibility', 'hidden');
+jQuery("#derivativeSwitchBox a").css('visibility', 'hidden');
+
+jQuery("#derivativeSwitchBox a").each(function (i) {
+  href_path = jQuery(this).attr("href");
+  pt[i] = href_path.split("'");
+  tsz = pt[i][5];
+  jQuery(this).css('visibility', 'visible');
+  //--- recherche limite ---
+  if (tsz.match(RegExp(type_size_maxi, "gi"))) {
+    return false;
+  }
+  //--- type en cours ---
+  if (tsz.match(RegExp("^" + options.type_size, "gi"))) {
+    us = n;
+  }
+
+  n++;
+});
+
+jQuery("derivativeChecked" + options.type_size).css('visibility', 'visible');
+
+
+
+//===================
+// VARIABLES  
+//===================
+var theMainImage_Id = "#theMainImage";
+type_src = "div";
+old_window = { width: 0, height: 0 };
+List_autosize = new Array();
+nu_img = 0;
+tempo = 0;
+//====================================================
+var infos_thePicturePage = jQuery("#thePicturePage").infos();
+var infos_theImageAndInfos;
+
+var theImageAndInfos_id = "#theImageAndInfos";
+if (options.theme.match(RegExp("simple", "gi"))) {
+  theImageAndInfos_id = "#content";
+
+  jQuery(theMainImage_Id).attr("position", "static");
+
+
+} else {
+  infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre general
+  if (infos_theImageAndInfos.visible == true)
+    theImageAndInfos_id = "#theImageAndInfos";
+  else
+    theImageAndInfos_id = "#imageContainer";
+}
+
+infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre general
+
+var infos_theImage = jQuery("#theImage").infos();                  // Container
+infos_theMainImage = jQuery(theMainImage_Id).infos();          // Image 
+
+if (infos_theMainImage.width == 0) {
+  infos_theMainImage = jQuery("#theImage img").infos();
+  if (infos_theMainImage.id == "")
+    jQuery("#theImage img").attr("id", "theMainImage");
+  infos_theMainImage = jQuery(theMainImage_Id).infos();
+}
+
+var infos_imageInfos = jQuery("#imageInfos").infos();              // Informations
+
+
+var infos_the_page = jQuery("#the_page").infos();
+var infos_content = jQuery("#content").infos();
+var infos_titrePage = jQuery("#titrePage").infos();
+var infos_imageInfoBar = jQuery("#imageInfoBar").infos();
+var infos_theHeader = jQuery("#theHeader").infos();
+var infos_imageToolBar = jQuery("#imageToolBar").infos();
+var infos_imageHeaderBar = jQuery("#imageHeaderBar").infos();
+var infos_body = jQuery("body").infos();
+var llgbo_id = "#llgbo0";
+
+var infos_llgbo = jQuery(llgbo_id).infos();
+var infos_llgboh2 = jQuery("#llgboh2").infos();
+
+var marges_llgbo = 0;
+var Zone_image = {
+  width_init: options.img_width,
+  height_init: options.img_height,
+  rapport_init: options.img_width / options.img_height
+};
+
+var Type_Img = "";
+
+
+
+pos_top = jQuery(theImageAndInfos_id).position();
+pos_top = pos_top.top - infos_theImageAndInfos.general.marges.top;
+pos_top += infos_content.general.marges.top;
+pos_top += infos_theImage.general.marges.top;
+options.pos_top = pos_top;
+
+
+old_window = { width: 0, height: 0 };
+
+
+//==== en cours ============
+n = pt.length - 1;
+if (n >= 0) {
+  imgSrc = pt[n][1];
+  last_map = pt[n][5];
+
+  imgSrc = pt[us][1];
+  last_map = pt[us][5];
+
+  new_html = '<br /><span class="switchCheck" id="derivativeCheckedAutosize" style="visibility:visible" >&#x2714; </span>';
+  new_html += '<a id="linkAutosize" href="javascript:changeImgSrc(\'' + imgSrc + '\', \'' + last_map + '\', \'' + type_size + '\') ">';
+  new_html += 'Autosize<span class="derivativeSizeDetails" id="auto_details" > - Autosize</span>  </a>';
+  if (type_size.match(RegExp("Autosize", "gi"))) {
+    jQuery("#derivativeSwitchBox br:last").before(new_html);
+  }
+
+  useMap = cookies.pictureMap; // #mapxxx
+  if (useMap == "#Autosize" && type_size_maxi == "Autosize") {
+
+  } else {
+    useMap = last_map;
+  }
+
+  typeSave = cookies.typeSave; //picturederiv xxx
+  options.type_size = useMap.replace("#", "");
+
+  type_size = options.type_size;
+  cookies.pictureMap = useMap; // #mapxxx
+  cookies.typeSave = last_map; //picturederiv xxx
+  cookies.imgSrc = imgSrc;
+
+  changeImgSrc(imgSrc, last_map, type_size);
+
+
+}
+
+
+});                                                                                                                                                     // ready
 
   //=====================================================================
@@ -2291,7 +2405,7 @@
         h1_top = jQuery(img).absoluteTop() - h1_top;
         h1_bottom = Obj_h - h1_top;
-        infos_img = { width: conf.width[i], height: conf.height[i] }; //origine 
+        infos_theMainImage = { width: conf.width[i], height: conf.height[i] }; //origine 
         img_rap = conf.rap[i];
-        if (infos_img.width > Obj_w) h1 = parseInt(Obj_w / img_rap);
+        if (infos_theMainImage.width > Obj_w) h1 = parseInt(Obj_w / img_rap);
         h1 -= h1_top;
         if (h1 > Obj_h - h1_top) {
@@ -2310,7 +2424,7 @@
           h1_top = jQuery(this).absoluteTop() - h1_top;
           h1_bottom = Obj_h - h1_top;
-          infos_img = { width: conf.width[i], height: conf.height[i] }; //origine 
+          infos_theMainImage = { width: conf.width[i], height: conf.height[i] }; //origine 
           img_rap = conf.rap[i];
-          if (infos_img.width > Obj_w) h1 = parseInt(Obj_w / img_rap);
+          if (infos_theMainImage.width > Obj_w) h1 = parseInt(Obj_w / img_rap);
           h1 -= h1_top;
           if (h1 > Obj_h - h1_top) {
@@ -2336,194 +2450,24 @@
 
   }
-  //===============================================
-  // Extend expression jQuery(":Autozise") ;
-  //===============================================
-  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"))) {
-        //   autosize = "MargeBasse:30px; ResizePicture:false"
-        infconf = jQuery(a).attr("autosize");
-        n1 = typeof infconf;
-        conf = { MargeBasse: 0, NoPicture: false }
-        if (n1 == "undefined") {
-
-        } else {
-          tableau = infconf.split(";");
-          for (var i = 0; i < tableau.length; i++) {
-            tableau2 = tableau[i].split(":");
-            conf[jQuery.trim(tableau2[0])] = jQuery.trim(tableau2[1]);
-          }
-          imgs = jQuery(a).find("img");
-          rap = new Array();
-          width = new Array();
-          height = new Array();
-          if (imgs.length > 0)
-            jQuery(imgs).each(function (i) {
-              img = jQuery(this);
-              rap.push((img.width() / img.height()));
-              width.push(img.width());
-              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;
-          conf['width'] = width;
-          conf['height'] = height;
-          List_autosize.push({ obj: a, conf: conf });
-          jQuery(a).css({ opacity: 0 });
-        }
-      }
-      //  Css = jQuery(a).getStyles(a);
-      return false;
-    }, // jQuery.Autosize
-    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");
-          }
-      }
-    }  //jQuery().Set_Class
-
-
-  }); // Extend expression
-
-  /**************************************************
-  * TEST
-  **************************************************/
-
-  jQuery(document).ready(function () {
-  /*
-    var txtTestBox = document.getElementById('menubar');
-    XBrowserAddHandler(txtTestBox, 'propertychange', function () {
-      onPropertyChange(txtTestBox);
-  });
-   var txtTestBox2 = document.getElementById('imageInfos');
-   XBrowserAddHandler(txtTestBox2, 'propertychange', function () {
-      onPropertyChange(txtTestBox2);
-    });
-*/
-
-    /**/
-  /**************************************************
-  * XBrowserAddHandler
-  **************************************************/
-  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;
-
-    }
-
-    /**************************************************
-    *  onProperty
-    **************************************************/
-    function onPropertyChange(obj,e) {
-      if (!e && window.event)
-        e = window.event;
-      if (e)
-        keyCode = (window.Event) ? e.which : e.keyCode;     
-      var el = obj;
-      attributs = el.attributes;     
-      type_action = e.type;
-      style = "";
-      alt = "";
-      src = "";
-      if (attributs.id) id = attributs.id.value;
-      if (attributs.style) style = attributs.style.value;
-      if (attributs.alt) alt = attributs.alt.value;
-      /* Image */
-      if (attributs.src) {
-        src = attributs.src.value;
-        if (attributs.width) width = attributs.width.value;
-        if (attributs.height) height = attributs.height.value;
-      }
-      affiche_debug({
-        Debug1: Debug_info(1, type_action + " : " + src, id + " action ")
-
-      });
-
-
-      if (style)
-        switch (style) {
-        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;
-  }
-    }
-
-
-    /**************************************************
-    * TEST
-    **************************************************/
-
-  });
-
-  /********************************************************
-  * List_autosize_resize
-  ********************************************************/
-  function List_autosize_resize(event, ui) {
-    if (typeof wait_resize == "undefined") wait_resize = false;
-    if (wait_resize == true) return;
-    wait_resize = true;
-    if (List_autosize.length == 0) return;
-    for (i = 0; i < List_autosize.length; i++) {
-      Autosize_resize(jQuery(List_autosize[i]));
-    }
-    wait_resize = false;
-    return true;
-  }
+ 
+
+    /********************************************************
+    * List_autosize_resize
+    ********************************************************/
+    function List_autosize_resize(event, ui) {
+      if (typeof wait_resize == "undefined") wait_resize = false;
+      if (wait_resize == true) return;
+      wait_resize = true;
+      if (List_autosize.length == 0) return;
+      for (i = 0; i < List_autosize.length; i++) {
+        Autosize_resize(jQuery(List_autosize[i]));
+      }
+      wait_resize = false;
+      return true;
+    }
+
+
+
+
 
   /**/
Index: extensions/Autosize/js/autosize.cookie.js
===================================================================
--- extensions/Autosize/js/autosize.cookie.js	(revision 16682)
+++ extensions/Autosize/js/autosize.cookie.js	(revision 16931)
@@ -95,11 +95,6 @@
     }
     };
-
-    if (jQuery.cookie('picture-menu') == 'visible') {
-      jQuery("head").append("<style type=\"text/css\">#content.contentWithMenu, #the_page > .content {margin-left:240px;}</style>");
-    } else {
-      jQuery("head").append("<style type=\"text/css\">#the_page #menubar {display:none;} #content.contentWithMenu, #the_page > .content {margin-left:35px;}</style>");
-    }
- 
+   
+
     function hideMenu(delay) {
       var menubar = jQuery("#menubar");
@@ -160,8 +155,9 @@
 
       // side-menu show/hide
+      
 
       var sidemenu = jQuery.cookie('picture-menu');
       var menubar = jQuery("#menubar");
-
+return;
       if (menubar.length == 1) {
 
Index: extensions/Autosize/js/autosize.dimensions.js
===================================================================
--- extensions/Autosize/js/autosize.dimensions.js	(revision 16682)
+++ extensions/Autosize/js/autosize.dimensions.js	(revision 16931)
@@ -33,5 +33,5 @@
             options = options || false;
             options = jQuery.extend({ margin: options });
-
+            Maxi_val = this.parent().width();
             var val = this.is(':visible') ? this[0]['offset' + name] :
                     num(this,
@@ -118,4 +118,5 @@
       myposition = "";
       results = {
+        visible:false ,
         position: "",
         top: 0,
@@ -127,5 +128,37 @@
         borderwidth: borderwidth,
         padding: padding,
-        margin: margin, id: "", nodeName: ""
+        margin: margin,
+
+        out: {
+          width: 0,
+          height: 0,
+          right: 0,
+          bottom: 0
+        },
+       
+        exterieur: {
+          width: 0,
+          height: 0,
+          right: 0,
+          bottom: 0
+        },
+    
+        general: {
+          width: 0,
+          height: 0,
+          right: 0,
+          bottom: 0,
+          marges: { height:0,
+                    top: 0,
+                    bottom: 0,
+                    width: 0,
+                    left: 0,
+                    right: 0
+                    }
+                },
+        src:"",
+        useMap : "" ,
+        id: "",
+        nodeName: ""
       };
       ;
@@ -150,5 +183,5 @@
           out_width = jQuery(elem).outerWidth();
           out_height = jQuery(elem).outerHeight();
-          elem_parent =elem.parentElement;
+          elem_parent = elem.parentElement;
           if (typeof elem_parent == "undefined") {
             elem_parent = window;
@@ -207,6 +240,8 @@
         Top = Cl_Position.top;
 
-       visible= jQuery(elem).is(':visible');
-        results = {src: elem.src || "none",
+        visible = jQuery(elem).is(':visible');
+        results = { 
+          useMap : elem.useMap || "none",
+          src: elem.src || "none",
           visible: visible || false,
           position: myposition,
@@ -239,15 +274,28 @@
             right: Left + out_width + margin.left + margin.right,
             bottom: Top + out_height + margin.top + margin.bottom,
-            marges: { height: margin.top + borderwidth.top + padding.top +
-                              margin.bottom + borderwidth.bottom + padding.bottom,
-              top: margin.top + borderwidth.top + padding.top,
-              bottom: margin.bottom + borderwidth.bottom + padding.bottom,
-              width: margin.left + borderwidth.left + padding.left +
-                              margin.right + borderwidth.right + padding.right,
-              left: margin.left + borderwidth.left + padding.left,
-              right: margin.right + borderwidth.right + padding.right
-            }
-
-
+            marges: { height: margin.top +
+                      borderwidth.top +
+                      padding.top +
+                      margin.bottom + borderwidth.bottom +
+                      padding.bottom,
+                      top:  margin.top +
+                            borderwidth.top +
+                            padding.top,
+                      bottom: margin.bottom +
+                       borderwidth.bottom +
+                        padding.bottom,
+                      width:  margin.left +
+                              borderwidth.left +
+                              padding.left +
+                              margin.right +
+                              borderwidth.right +
+                              padding.right,
+                      left: margin.left +
+                            borderwidth.left +
+                            padding.left,
+                      right: margin.right +
+                             borderwidth.right +
+                             padding.right
+                    }
           },
           id: id,
@@ -311,18 +359,18 @@
       var element = jQuery(elt).get(0);
       propriete = [];
-      try{
-      if (jQuery(element).length > 0)
-      if (window.getComputedStyle) // Mozilla Firefox & cie
-      {
-        var propriete = window.getComputedStyle(element, null);
-      }
-      else if (element.currentStyle) // Microsoft Internet Explorer
-      {
-
-        var propriete = element.currentStyle;
-      }
-        }catch(e){
-
-        }
+      try {
+        if (jQuery(element).length > 0)
+          if (window.getComputedStyle) // Mozilla Firefox & cie
+          {
+            var propriete = window.getComputedStyle(element, null);
+          }
+          else if (element.currentStyle) // Microsoft Internet Explorer
+          {
+
+            var propriete = element.currentStyle;
+          }
+      } catch (e) {
+
+      }
       return propriete;
     },
@@ -334,49 +382,49 @@
 
   /**************************
-    * Get_val_int
-    * params: element,valeur maxi
-    * return: valeur entiere
+  * Get_val_int
+  * params: element,valeur maxi
+  * return: valeur entiere
   ******************************/
   Get_Val_int = function (myObj, Maxi_val, Mini_val, prop) {
 
-      var val = 0;
-      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) {
+    var val = 0;
+    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;
+        case 'none':
+          return Maxi_val;
+          break;
+        default:
+          break;
+      }
+
+      var reg1 = new RegExp("auto", "g");
+      if (myObj.match(reg1)) {
         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;
-          case 'none':
-            return Maxi_val;
-            break;
-          default:
-            break;
-        }
-
-        var reg1 = new RegExp("auto", "g");
-        if (myObj.match(reg1)) {
-          return Maxi_val;
-        }
 
       if (prop) {
@@ -384,30 +432,30 @@
         myObj = num(prop.elem, prop.prop);
       } else {
-          reg1 = new RegExp("px", "g");
+        reg1 = new RegExp("px", "g");
+        if (myObj.match(reg1)) {
+
+          myObj = Parse_Int(myObj);
+
+        } else {
+          reg1 = new RegExp("%", "g");
           if (myObj.match(reg1)) {
-
-          myObj = Parse_Int(myObj);
-
-          } else {
-            reg1 = new RegExp("%", "g");
-            if (myObj.match(reg1)) {
-              myObj = myObj.replace(reg1, "");
-              val = Math.ceil(myObj * Maxi_val / 100);
-              return val;
-            }
+            myObj = myObj.replace(reg1, "");
+            val = Math.ceil(myObj * Maxi_val / 100);
+            return val;
           }
         }
-        if (Mini_val)
-          if (myObj < Mini_val) return Maxi_val;
+      }
+      if (Mini_val)
+        if (myObj < Mini_val) return Maxi_val;
       val = Parse_Int(myObj);
 
-      } else {
+    } else {
       val = Parse_Int(myObj);
-      }
+    }
     if (typeof (val) == "NaN")
       return Maxi_val;
-      return val;
-
-    }
+    return val;
+
+  }
 
   /*
@@ -415,13 +463,16 @@
   */
   function Parse_Int(valeur_num) {
-  if (!jQuery.isNumeric(valeur_num)){
-    valeur_num = valeur_num.toString();
-    reg1 = new RegExp("px", "gi");
-    if (valeur_num.match(reg1)) {
+    if (!jQuery.isNumeric(valeur_num)) {
+      valeur_num = valeur_num.toString();
+      reg1 = new RegExp("px", "gi");
+      if (valeur_num.match(reg1)) {
         valeur_num = valeur_num.replace(reg1, "");
-    } else {
+      } if (valeur_num.match(RegExp("%", "gi"))) {
         valeur_num = valeur_num.replace(reg1, "");
+        valeur_num = Math.ceil(valeur_num * Maxi_val / 100);
+      } else {
+        valeur_num = valeur_num.replace(reg1, "");
+      }
     }
-   }
     valeur_num = Math.ceil(valeur_num);
     return valeur_num || 0;
@@ -434,6 +485,6 @@
   };
 
-  myjQuery = jQuery;
-  my$ = $;
+ // myjQuery = jQuery;
+ // my$ = $;
 
 })(jQuery);
Index: extensions/Autosize/js/conflit.js
===================================================================
--- extensions/Autosize/js/conflit.js	(revision 16682)
+++ extensions/Autosize/js/conflit.js	(revision 16931)
@@ -174,43 +174,6 @@
     function (jQuery) {
       jQuery(window).load(function () {
-       
-        //============================================================
-        if (jQuery("#check_auto_w").length > 0) {
-          var cl_visible = jQuery("#check_auto_w").get(0).checked;
-          if (!cl_visible) {
-            jQuery("#table0 :text[name*='_width'] ").hide();
-          } else {
-            jQuery("#table0 :text[name*='_width']    ").show();
-          }
-        }
         //==============================================================
-        jQuery("input").click(function () {
-          if (this.name.match(RegExp("_enabled", "gi"))) {
-            sel = "[name*=" + this.name + "]";
-            obj = jQuery("tr" + sel);
-
-            if (this.checked)
-              obj.css({ backgroundColor: "green", color: "white" });
-            else
-              obj.css({ backgroundColor: "red", color: "white" });
-
-            return;
-          }
-
-          if (this.name != "check_auto_w") return;
-
-          cl_visible = this.checked
-          if (!cl_visible) {
-            jQuery("#table0 :text[name*='_width'] ").hide();
-          } else {
-            jQuery("#table0 :text[name*='_width'] ").show();
-          }
-
-          return;
-
-
-
-
-        });
+
         jQuery("#icon_gmaps").bind('click', function () {
           //jQuery("#iGMapsIconContent").dialog("open");
Index: extensions/Autosize/main.inc.php
===================================================================
--- extensions/Autosize/main.inc.php	(revision 16682)
+++ extensions/Autosize/main.inc.php	(revision 16931)
@@ -34,7 +34,11 @@
 add_event_handler('get_admin_plugin_menu_links', array(&$autosize_controler,'cl_autosize_admin')  );
 
-add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_script_1'),  EVENT_HANDLER_PRIORITY_NEUTRAL+20  );	
+// add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_script_1'),  EVENT_HANDLER_PRIORITY_NEUTRAL+20  );	
+
 add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_affiche'), EVENT_HANDLER_PRIORITY_NEUTRAL+21  );
 
 add_event_handler('loc_end_page_tail',array(&$autosize_controler, 'cl_autosize_script_2'),  EVENT_HANDLER_PRIORITY_NEUTRAL );
+
+
+
 ?>
Index: extensions/Autosize/template/autosize.tpl
===================================================================
--- extensions/Autosize/template/autosize.tpl	(revision 16682)
+++ extensions/Autosize/template/autosize.tpl	(revision 16931)
@@ -2,49 +2,53 @@
 {html_head} <!-- autosize/template/autosize.tpl  -->
  <script type="text/javascript">
-    var src_img = '{$SRC_IMG}';
-    var fade_in = '{$fade_in}';
-    var cl_visible = "{$cl_visible}" =="true";
-    var thumbnail = '{$thumbnail}';
-    var scaled_width =  '{$SCALED_WIDTH}'; // valeur par defaut
-    var scaled_height = '{$SCALED_HEIGHT}'; // valeur par defaut
-    var img_width='{$IMG_WIDTH }';
-    var img_height = '{ $IMG_HEIGHT }';
+ 
+var  Autosize_options={ldelim}
+    
+    cookies :{$cookies} ,
+    deriv_type :'{$deriv_type}' ,
+    type_size:'{$deriv_type}' ,
+      DEBUG_autosize:'{$DEBUG_autosize}',
+     theme:'{$theme}',
+     src_img : '{$SRC_IMG}',
+     fade_in : '{$fade_in}',
+     cl_visible : "{$cl_visible}" =="true",
+     thumbnail : '{$thumbnail}',
 
-    var cookie_width='{$COOKIE_WIDTH }';
-    var cookie_height = '{ $COOKIE_HEIGHT }';
+     scaled_width :  '{$SCALED_WIDTH}', // valeur par defaut
+     scaled_height : '{$SCALED_HEIGHT}', // valeur par defaut
+ratio:'{$IMG_WIDTH/$IMG_HEIGHT }' ,
+     img_width:'{$IMG_WIDTH }',
+     img_height : '{ $IMG_HEIGHT }',
 
+     cookie_width:'{$COOKIE_WIDTH }',
+     cookie_height : '{ $COOKIE_HEIGHT }',
 
-    var marge_basse='{ $MARGE_BASSE }';
-    var echelle_max='{ $ECHELLE_MAX }';
-    var mini_width='{ $MINI_WIDTH   }';
-    var mini_height = '{ $MINI_HEIGHT   }';
-    var mini_width2 = '{ $MINI_WIDTH2 }';
-    var mini_height2 = '{ $MINI_HEIGHT2 }';
+     marge_basse:'{ $MARGE_BASSE }',
+     echelle_max:'{ $ECHELLE_MAX }',
+     mini_width:'{ $MINI_WIDTH   }',
+     mini_height : '{ $MINI_HEIGHT   }',
+     mini_width2 : '{ $MINI_WIDTH2 }',
+     mini_height2 : '{ $MINI_HEIGHT2 }',
 
-    var webmaster_width='{$webmaster_width   }';
-    var webmaster_height = '{ $webmaster_height   }';
-    var webmaster_enabled = '{ $webmaster_enabled   }';
+     webmaster_type:'{$webmaster_type.SELECTED  }',
+     webmaster_enabled : '{ $webmaster_enabled   }',
 
-    var admin_width='{ $admin_width   }';
-    var admin_height = '{ $admin_height   }';
-    var admin_enabled = '{ $admin_enabled   }';
+     admin_type : '{ $admin_type.SELECTED    }',
+     admin_enabled : '{ $admin_enabled   }',
 
-    var generic_width='{ $generic_width   }';
-    var generic_height = '{ $generic_height   }';
-    var generic_enabled = '{ $generic_enabled   }';
+     generic_type:'{ $generic_type.SELECTED    }',
+     generic_enabled : '{ $generic_enabled   }',
 
-    var guest_width='{ $guest_width   }';
-    var guest_height = '{$guest_height}';
-    var guest_enabled = '{ $guest_enabled   }';
+     guest_type:'{ $guest_type.SELECTED    }',
+     guest_enabled : '{ $guest_enabled   }',
 
-    var normal_width='{$normal_width}';
-    var normal_height = '{$normal_height}';
-    var normal_enabled = '{ $normal_enabled   }';
+     normal_type:'{$normal_type.SELECTED }',
+     normal_enabled : '{ $normal_enabled   }',
 
-    var user_status='{$user_status}';
-   
-    var check_auto_w = '{$check_auto_w}';
-     
-    var check_desc_v = ('{$check_desc_v}' == 'checked="checked"') ? true : false; 
+     user_status:'{$user_status}',   
+     check_auto_w : '{$check_auto_w}',     
+     check_desc_v :  '{$check_desc_v}' 
+    } ;
+
  </script>
 
@@ -54,5 +58,7 @@
 <script type="text/javascript">
        var visible = '{$visible}';
-   </script>
+   </script> 
+   
+    {/html_head}
 {if $DEBUG_autosize == "true"}
   {assign var="visible" value="block"}
@@ -101,5 +107,5 @@
   {/if}
 
-  {/html_head}
+
   <!--  << autosize/template/autosize.tpl body  -->
 
Index: extensions/Autosize/template/header.tpl
===================================================================
--- extensions/Autosize/template/header.tpl	(revision 16931)
+++ extensions/Autosize/template/header.tpl	(revision 16931)
@@ -0,0 +1,17 @@
+{if not empty($pamoorama)}
+  <script  id="pamoorama0.3" src="plugins/paMOOramics/js/pamoorama0.3.js" type="text/jscript"></script>
+  <script id="mootools" src="plugins/paMOOramics/js/mootools.js" type="text/jscript"></script>
+{combine_script id="conflit_script0" load="header" path = $AUTOSIZE_PATH|@cat:"js/conflit_2.js" require="jquery" }
+{combine_script id="conflit_script"  path = $AUTOSIZE_PATH|@cat:"js/conflit.js" require="jquery" }
+{combine_script id="conflit_script2" load="async" path = $AUTOSIZE_PATH|@cat:"js/conflit_2.js" require="jquery" }
+{combine_script id="autosize.dimensions" path = $AUTOSIZE_PATH|@cat:"js/autosize.dimensions.js" require="jquery"}
+
+{else}
+{/if}
+
+{combine_script id="jquery.cluetip" path = "themes/default/js/plugins/jquery.cluetip.js" require="jquery" }
+
+
+
+
+ 
Index: extensions/Autosize/template/mes_scripts.tpl
===================================================================
--- extensions/Autosize/template/mes_scripts.tpl	(revision 16682)
+++ extensions/Autosize/template/mes_scripts.tpl	(revision 16931)
@@ -33,4 +33,3 @@
 {literal}
 {/literal}
- 
 <!---Fin Mes SCRIPTS --->
Index: extensions/Autosize/template/picture.tpl
===================================================================
--- extensions/Autosize/template/picture.tpl	(revision 16682)
+++ extensions/Autosize/template/picture.tpl	(revision 16931)
@@ -17,4 +17,6 @@
     </span>
   </a>
+
+
 
  <script language="JavaScript" type="text/javascript">
@@ -53,3 +55,5 @@
  var src4 = "{'cl_autosize_info'|@translate}";
  var src5 = "{'cl_autosize_info_1'|@translate}";
- </script> 
+ var src6 = "{$cl_autosize_button.ICON1}";
+ </script>
+
Index: extensions/Autosize/template/picture_1.tpl
===================================================================
--- extensions/Autosize/template/picture_1.tpl	(revision 16931)
+++ extensions/Autosize/template/picture_1.tpl	(revision 16931)
@@ -0,0 +1,4 @@
+{combine_script id="Affiche_script" path= $AUTOSIZE_PATH|@cat:"js/Affiche_script.js" require='jquery,autosize.dimensions'  }
+{if $theme != "elegant"}
+{combine_script id="autosize.cookie" path = $AUTOSIZE_PATH|@cat:"js/autosize.cookie.js" require="jquery,Affiche_script"  }{/if} 
+{combine_script id="autosize.dimensions" path = $AUTOSIZE_PATH|@cat:"js/autosize.dimensions.js" require="jquery"}
