Changeset 17192


Ignore:
Timestamp:
Jul 28, 2012, 8:48:54 PM (12 years ago)
Author:
cljosse
Message:

[extensions] Autosize fix compatibility with 2.4, new options

Location:
extensions/Autosize
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • extensions/Autosize/autosize.inc.php

    r16931 r17192  
    2727 static public function cl_autosize_script_1()
    2828        {
    29                 global  $template,$user,$conf,$picture ,$page, $cl_plugin ;
    30  
     29  global $user,$page,$template,$cl_plugin;
     30
     31 
    3132 // header ('X-UA-Compatible: n=7')  ;
    3233 // header ('X-UA-Compatible: IE=Edge')  ;
     
    5859        'AUTOSIZE_PATH' => str_replace("../","",AUTOSIZE_PATH)  ,
    5960        'AUTOSIZE_PATH_ABS' => AUTOSIZE_PATH_ABS,
    60         'Version_pwg' => PHPWG_VERSION       
     61        'Version_pwg' => PHPWG_VERSION       ,
     62            'loading' => AUTOSIZE_PATH . 'images/loading.gif'
    6163         )
    6264    );
     
    7173 {
    7274           global  $template,$user,$conf,$picture ,$page, $cl_plugin,$known_script ;
     75
     76                global  $template,$user,$conf,$picture ,$page, $cl_plugin ;
     77
    7378   if ('kardon' == $user['theme'] and isset($_GET['slideshow'])) return ;
    74 
     79   if (!isset($PAMOORAMICS_PATH)) return ;   
    7580                        $AUTOSIZE_PATH = dirname(__FILE__).'/';
    7681//================================================================
     
    155160
    156161  // this is the default handler that generates the display for the element
    157  static public function autosize_RenderContent($content, $element_info)
     162 static public function autosize_calcContent($content)
    158163{
    159   global $conf; 
    160   if ( !empty($content) )
    161   {// someone hooked us - so we skip;
    162     return $content;
    163   }
    164   if (isset($_COOKIE['picture_deriv']))
    165   {
    166     if ( array_key_exists($_COOKIE['picture_deriv'], ImageStdParams::get_defined_type_map()) )
    167     {
    168       pwg_set_session_var('picture_deriv', $_COOKIE['picture_deriv']);
     164  global $conf;
     165   
     166 global $page, $template,$picture;
     167
     168
     169  $current = $template->get_template_vars('current');
     170  $defined_types = array_keys(ImageStdParams::get_defined_type_map()); 
     171if (isset($current)){
     172    if (!isset($current['selected_derivative'])){ 
     173      $model= $defined_types[count($defined_types)-1];
     174      $selected_derivative =      $current['derivatives'][$model];
     175      $template->append('current', array(
     176      'selected_derivative' => $selected_derivative
     177    ), true);
     178
     179
     180    $current = $template->get_template_vars('current');
     181        }
     182
     183         $derivative=$current['selected_derivative'] ;
     184          $imgScaledWH=$derivative->src_image->get_size();
     185          $imgSizeWH  =  $derivative->get_size();       
     186          $img_type  =  $derivative->get_type();       
     187          $img_url  = $derivative->get_url();
     188          $img_all= $derivative->get_all($derivative->src_image);
     189          $scaled_size=$derivative->get_size_hr(); //792 x 441
     190          $scaled_size=$derivative->get_scaled_size_htm(); // width="792" height="441"
     191         //================= taille mis a l'échelle
     192          $scaled_size=$derivative->get_scaled_size(100,100); // array([0]=>100,[1]=>55)
     193          $src= $derivative->src_image ;
     194       
    169195    }
    170     setcookie('picture_deriv', false, 0, cookie_path() );
    171   }
    172   $deriv_type = pwg_get_session_var('picture_deriv', $conf['derivative_default_size']);
    173   $selected_derivative = $element_info['derivatives'][$deriv_type];
    174 
    175   $unique_derivatives = array();
    176   $show_original = isset($element_info['element_url']);
    177   $added = array();
    178   foreach($element_info['derivatives'] as $type => $derivative)
    179    $element_info['derivatives']['Autosize']=$derivative; // last
    180 
    181   foreach($element_info['derivatives'] as $type => $derivative) {     
    182   if ($type=='Autosize'){   
    183        
    184     $url = $derivative->get_url();
    185     if (isset($added[$url]))
    186       continue;
    187     $added[$url] = 1;
    188     $show_original &= !($derivative->same_as_source());
    189     $unique_derivatives[$type]= $derivative;
    190      }
    191 
    192   }
    193 
    194   global $page, $template;
    195 
    196   if ($show_original)
    197   {
    198     $template->assign( 'U_ORIGINAL', $element_info['element_url'] );
    199   }
    200 
    201   $template->append('current', array(
    202       'selected_derivative' => $selected_derivative,
    203       'unique_derivatives' => $unique_derivatives,
    204     ), true);   
    205       $file =AUTOSIZE_PATH_ABS.'template/picture_content.tpl' ;
    206   $template->set_filenames(
    207     array('autosize_content'=> $file)
    208     );
    209 
    210   $template->assign( array(
    211       'ALT_IMG' => $element_info['file'],
    212       'COOKIE_PATH' => cookie_path(),
    213       )
    214     );
    215    return $template->parse( 'autosize_content', false);
     196 
     197    $img_scaled_width=isset($imgScaledWH)?$imgScaledWH[0]:"480";
     198    $img_scaled_height=isset($imgScaledWH)?$imgScaledWH[1]:"320";
     199    $current = $template->get_template_vars('picture');
     200    $picture['current']['scaled_width']=$img_scaled_width;
     201    $picture['current']['scaled_height']= $img_scaled_height;
     202    $picture['current']['image_url']=$src->rel_path;
     203   
    216204 }
    217205
     
    228216 if ('kardon' == $user['theme'] and isset($_GET['slideshow'])) return ;
    229217                load_language('plugin.lang', AUTOSIZE_PATH);
     218
    230219                $AUTOSIZE_PATH = dirname(__FILE__).'/';
    231220                 if (isset( $page['body_id']) && $page['body_id']=='thePicturePage'  ) {
     
    271260        $template->parse('mes_script');
    272261      }     
    273        
     262           
    274263        return $template->parse( 'autosize_content', false);
    275264                                  }
  • extensions/Autosize/css/autosize.css

    r16931 r17192  
    11 
    22#theImage {
    3     opacity: 100;
    4     filter: alpha(opacity:100);
     3/*    opacity: 0.1;
     4    filter: alpha(opacity:10);
     5    */
    56   
    67}
    7 body{
    8  
     8body {
     9
    910}
    1011#the_page {
    11   /* 
     12  /*  background-color: #FF0000;
    1213  margin-top: -4px;
    1314position:static ;*/
     
    2324}
    2425
    25 
     26#imageHeaderBar {background-color: transparent;
     27  /* 
     28  margin-top: -4px;
     29position:static ;*/
     30   
     31}
    2632#navThumbNext, #navThumbPrev{ /*height:200px;*/
    2733
     
    3440}
    3541#content {
    36 /*
    37   border: 5px solid #00FF00;
    38 padding:10px;
    39  margin:15px
     42 /* background-color: transparent;*/
     43 
     44}
     45#theImage {   /*
     46 background-image: url('../images/quadrille_100.gif');
     47  margin: 5px;
     48 border: 10px solid #0000F0;
     49  padding: 20px;
    4050 */
    41 }
    42 #theImage { 
    43  /*  padding: 10px;  margin: 10px;
    44  border: 5px solid #0000F0;
    45   background-color: #0000FF;
    46    background-image: url('../images/quadrille_100.gif');
    47    */ }
     51 /*  background-color: transparent;*/
     52   }
    4853 
     54.licencetag,.imageComment{
     55 
     56  }
    4957
    50 
    51 #theMainImage {
     58#theMainImage {
    5259/*
    5360  margin: 15px;
     
    5764 background-color: #0000FF; */
    5865}
     66#imageInfos{
     67overflow:hidden ;
     68/*
     69margin : 0px;
     70  border: 0px solid #00f0f0;
     71  padding: 10px;*/
    5972
    60 #imageInfos, #imageInfoBar {
    61 /* margin : 20px;
    62   border: 20px solid #FFf0f0;
     73 }
     74 
     75#imageInfoBar {
     76/*
     77margin : 20px;
     78  border: 20px solid #00f0f0;
    6379  padding: 20px;
    64  
    65  background-color: #FF0000; */
     80
     81 background-color: #00FF00;
     82 opacity:0.3 ;*/
    6683}
    6784#thePicturePage{
     
    7188
    7289
     90#Debug0 {
     91  align: center;
     92  color: black;
     93/*  z-index: 2000;*/
     94  position: absolute;
     95  background-color: Beige;
     96  top: 0px;
     97  left: 0px;
     98  width: 800px;
     99  margin: auto;
     100}
     101#Debug1 {
     102  align: center;
     103  color: black;
     104/*  z-index: 2000;*/
     105  position: absolute;
     106  background-color: Beige;
     107  top: 0px;
     108  left: 0px;
     109  width: 800px;
     110  margin: auto;
     111}
     112
     113
     114#Debug2 {
     115  align: center;
     116  color: black;
     117 /*  z-index: 2000;*/
     118  position: absolute;
     119  background-color: yellow;
     120  top: 0px;
     121  left: 0px;
     122  width: 800px;
     123  margin: auto;
     124}
     125#Debug3 {
     126  align: center;
     127  color: #FFFFFF;
     128/*  z-index: 2000;*/
     129  position: absolute;
     130  background-color: blue;
     131  top: 0px;
     132  left: 0px;
     133  width: 800px;
     134  margin: auto;
     135}
     136#Debug4 {
     137  align: center;
     138  color: #CCFF33;
     139 
     140/*  z-index: 2000;*/
     141  background-color: green;
     142  top: 0px;
     143  left: 0px;
     144  width: 800px;
     145  margin: auto;
     146}
     147
     148
     149#Debug5 {
     150  align: center;
     151/*  z-index: 2000;*/
     152  z-index: 2000;
     153  position: absolute;
     154  background-color: red;
     155  top: 100px;
     156  left: 0px;
     157  width: 300px;
     158  margin: auto;
     159}
     160#Debug6 {
     161  align: center;
     162  display: none;
     163}
  • extensions/Autosize/include/affiche.php

    r16931 r17192  
    88
    99 ;
    10 //=================================================================================================
     10//==============================================================================
    1111$DEBUG_autosize = isset($_POST['cl_debug_conflit']) ? $_POST['cl_debug_conflit'] : "false" ;
    1212$DEBUG_autosize = isset($_GET['cl_debug_conflit']) ? $_GET['cl_debug_conflit'] : $DEBUG_autosize ;
     
    2828  }
    2929  $deriv_type = pwg_get_session_var('picture_deriv', $conf['derivative_default_size']);
     30  $defined_types = array_keys(ImageStdParams::get_defined_type_map()); 
    3031
    31 if (isset($current)){
    32  $derivative=$current['selected_derivative'] ;
    33   $imgScaledWH=$derivative->src_image->get_size();
    34         $imgSizeWH  =  $derivative->get_size();
    35   $img_type  =  $derivative->get_type();       
    36   $img_url  = $derivative->get_url();
    37   $img_all= $derivative->get_all($derivative->src_image);
    38   $scaled_size=$derivative->get_size_hr(); //792 x 441
    39    $scaled_size=$derivative->get_scaled_size_htm(); // width="792" height="441"
    40    //================= taille mis a l'échelle
    41    $scaled_size=$derivative->get_scaled_size(100,100); // array([0]=>100,[1]=>55)
    42   $src= $derivative->src_image ;
    43      
    44     }
    45 
    46           $defined_types = array_keys(ImageStdParams::get_defined_type_map());     
     32if (isset($current)){
     33    if (!isset($current['selected_derivative'])){ 
     34      $model= $defined_types[count($defined_types)-1];
     35      $selected_derivative =      $current['derivatives'][$model];
     36      $template->append('current', array(
     37      'selected_derivative' => $selected_derivative
     38    ), true);
    4739
    4840
     41    $current = $template->get_template_vars('current');
     42        }
     43         $derivative=$current['selected_derivative'] ;
     44          $imgScaledWH=$derivative->src_image->get_size();
     45          $imgSizeWH  =  $derivative->get_size();       
     46          $img_type  =  $derivative->get_type();       
     47          $img_url  = $derivative->get_url();
     48          $img_all= $derivative->get_all($derivative->src_image);
     49          $scaled_size=$derivative->get_size_hr(); //792 x 441
     50          $scaled_size=$derivative->get_scaled_size_htm(); // width="792" height="441"
     51         //================= taille mis a l'échelle
     52          $scaled_size=$derivative->get_scaled_size(100,100); // array([0]=>100,[1]=>55)
     53          $src= $derivative->src_image ;
     54       
     55    }
     56 
    4957
     58 
    5059$img_width=isset($imgScaledWH)?$imgSizeWH[0]:"480";
    5160$img_height=isset($imgScaledWH)?$imgSizeWH[1]:"320";
  • extensions/Autosize/js/Affiche_script.js

    r16935 r17192  
    33// corriger   gmaps_pip.class.inc.php ajouter ligne 90 if ( !isset($_GET['slideshow']))
    44//==============================================================
    5 jQuery(document).ready(function (jQuery) {
    6   //=============================================================
    7   // REPONSE ACTION
    8   //=============================================================
    9   jQuery("#reset").click(function () {
    10     location.reload();
    11   });
    12 
    13 
    14   //===========================================================
    15   //  REPONSE TRIGGER
    16   //===========================================================
    17   jQuery('#pamoorama').live('ON', function (e) {
    18     jQuery(jQuery('.debug').get(1)).trigger('ON');
    19     if (typeof Bandeau_bas == "undefined" || Bandeau_bas.width == 0) {
    20       Bandeau_bas = infos_Description_f("#theImage");
    21       Bandeau = Bandeau_bas.top;
     5
     6(function (jQuery) {
     7  jQuery.Affiche_script = { version: '1.0' };
     8
     9  var theMainImage_Id = "#theMainImage";
     10  var Zone_image;
     11  /********************************************
     12  *  document ready
     13  ********************************************/
     14  jQuery(document).ready(function (jQuery) {
     15    /********************************************
     16    *  window unLOAD
     17    ********************************************/
     18    jQuery(window).unload(function () {
     19
     20      try {
     21
     22        if (typeof theMainImage_Id != "undefined") {
     23
     24          useMap = options.useMap;
     25          pictureMap = jQuery.cookie('picture_map');
     26          typeSave = jQuery.cookie('picture_deriv');
     27
     28          old_img = jQuery.cookie('img');
     29          old_window_height = jQuery.cookie('window_height');
     30          old_window_width = jQuery.cookie('window_width');
     31          old_img_h = jQuery.cookie('img_h');
     32          old_img_w = jQuery.cookie('img_w');
     33
     34          set_cookies({
     35            window_height: infos_window.height,
     36            window_width: infos_window.width,
     37            img_h: infos_theMainImage.height,
     38            img_w: infos_theMainImage.width
     39          });
     40
     41        }
     42      } catch (r) {
     43
     44      }
     45
     46    }); //unload
     47
     48
     49    //=========================================================
     50    messages = "This frame uses the W3C box model: <span>" + jQuery.support.boxModel + "</span>";
     51    messages += "This frame uses the html5Clone: <span>" + jQuery.support.html5Clone + "</span>";
     52    // jQuery("p").html(messages);
     53    if (typeof (options) == "undefined") {
     54      options = { imageAutosize: false }
    2255    }
    23   });
    24   //=============================================================
    25   jQuery('#ret_autosize').live('ON', function (e) {
    26     if (nu_img == "") nu_img = 8;
    27     jQuery(jQuery('.debug').get(nu_img)).trigger('ON');
    28 
    29   });
    30 
    31   //==========================================================
    32   jQuery("map area").mouseover(function (e) {
    33     hok = this;
    34 
    35   });
    36 
    37   //==================================
    38   // jQuery("#llgbo").trigger("ON");
    39   //==================================
    40   jQuery(llgbo_id).live('ON', function (e) {
    41     n_id = this;
    42     infos_llgbo = jQuery(llgbo_id).infos();
    43     if (infos_llgbo.visible == false) return;
    44 
    45     marges_llgbo = 0;
    46     if (infos_llgbo.height > 0) {
    47       infos_llgboframe1 = jQuery(llgbo_id + " div:last").infos();
    48       infos_llgboframe31 = jQuery(llgbo_id + "  div:first").infos();
    49       //=============================================
    50       ll2 = infos_llgboframe1.width; // llgboframe1
    51       ll1 = infos_llgboframe31.general.width; // llgboframe31
    52       options.marges_llgbo = (ll1 - ll2);
    53       infos_llgboh2 = jQuery("#llgboh2").infos();
     56    options = jQuery.extend(Autosize_options, options);
     57    var defaults = {
     58      useMap: '#Autosize',
     59      imageAutosizeMargin: 0,
     60      imageAutosize: false,
     61      marge_basse: options.imageAutosizeMargin || 0,
     62      DEBUG_autosize: false
     63    };
     64
     65    options = jQuery.extend(defaults, options);
     66    jQuery("#form_autosize_picture").addClass("Autosize_margin");
     67    //===== marges suplémentaires en fonction theme ===
     68    options.marge_haute = jQuery(".Autosize_margin").Get_Val_int(jQuery(".Autosize_margin").css("top"));
     69    options.marge_basse = jQuery(".Autosize_margin").Get_Val_int(jQuery(".Autosize_margin").css("bottom"));
     70    options.marge_gauche = jQuery(".Autosize_margin").Get_Val_int(jQuery(".Autosize_margin").css("left"));
     71    options.marge_droite = jQuery(".Autosize_margin").Get_Val_int(jQuery(".Autosize_margin").css("right"));
     72    fade_in = options.fade_in || 0;
     73
     74
     75
     76    if (options.check_desc_v) {
     77      infos_Licence = jQuery(".licencetag").infos({ pos_absolute: true });
     78      infos_imageComment = jQuery(".imageComment").infos({ pos_absolute: true });
     79      options.marge_basse += infos_imageComment.general.height;
    5480    }
    55   });
    56   //==============================
    57   // jQuery("#mapPicture").trigger("ON");
    58   //==============================
    59   jQuery("#mapPicture").live('ON', function (e) {
    60     p2 = jQuery("#infoSwitcher").infos();
    61   });
    62   //==============================
    63   // jQuery("#map").trigger("ON");
    64   //==============================
    65   jQuery("#map").live('ON', function (e) {
    66 
    67   });
    68 
    69   //===================================
    70   // jQuery("#theImage").trigger("ON");
    71   //===================================
    72   jQuery("#theImage").live('ON', function (e) {
    73     target = e.target.id;
    74 
    75     id = this.id;
    76     theImage_init("#theImage");
    77   });
    78 
    79   /***********************
    80   *
    81   **********************/
    82   jQuery("#theMainImage").error(function (e) {
    83     alert(this.src + ' Image does not exist !!');
    84   });
    85 
    86   jQuery("#theMainImage,.preload, .next1 , ").load(function (e) {
    87     if (init_img(this))
    88       setTimeout(function () { Autosize_resize(true) }, 100);
     81
     82
     83
     84    DEBUG_autosize = options.DEBUG_autosize;
     85    Get_type_img();
     86
     87    //===================
     88    // VARIABLES 
     89    //===================
     90
     91    type_src = "div";
     92    old_window = { width: 0, height: 0 };
     93    List_autosize = new Array();
    8994    nu_img = 0;
    90   });
    91 
    92   //=================================================================
    93   jQuery(document).live('gallyInterfaceReady', function (e) {
    94     i = jQuery(this).text();
    95     jQuery(this).trigger('ON');
    96   }
     95    tempo = 0;
     96    var nopano;
     97    var cookies = Get_cookies();
     98    var theme = options.theme;
     99
     100    var Type_Img = "";
     101
     102    var llgbo_id = "#llgbo0";
     103    var infos_llgbo = jQuery(llgbo_id).infos();
     104    var infos_llgboh2 = jQuery("#llgboh2").infos();
     105    var marges_llgbo = 0;
     106Zone_image = {
     107      width_init: options.img_width,
     108      height_init: options.img_height,
     109      rapport_init: options.img_width / options.img_height
     110    };
     111
     112    var theImageAndInfos_id = "#theImageAndInfos";
     113
     114    if (options.theme.match(RegExp("simple", "gi"))) {
     115      theImageAndInfos_id = "#content";
     116      jQuery(theMainImage_Id).attr("position", "static");
     117
     118    } else {
     119      infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre general
     120      if (infos_theImageAndInfos.visible == false)
     121        theImageAndInfos_id = "#imageContainer";
     122    }
     123
     124    theImage_id = "#theImage";
     125    imageInfos_id = "#imageInfos";
     126    theMainImage_Id = "#theMainImage";
     127
     128    infos_theImage = jQuery(theImage_id).infos({ pos_absolute: true });                 // conteneur
     129    infos_imageInfos = jQuery(imageInfos_id).infos({ pos_absolute: true });             // information
     130    infos_theMainImage = jQuery(theMainImage_Id).infos({ pos_absolute: true });         // Image 
     131    /************************************
     132    *
     133    *************************************/
     134
     135    infos_theImage = jQuery(theImage_id).infos({ pos_absolute: true });                 // conteneur
     136    infos_imageInfos = jQuery(imageInfos_id).infos({ pos_absolute: true });             // information
     137    infos_theMainImage = jQuery(theMainImage_Id).infos({ pos_absolute: true });         // Image   
     138
     139    infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre general
     140    var infos_theImage = jQuery("#theImage").infos();                  // Container
     141    var infos_imageInfos = jQuery("#imageInfos").infos();              // Informations
     142
     143    var infos_the_page = jQuery("#the_page").infos();
     144    var infos_content = jQuery("#content").infos();
     145    var infos_titrePage = jQuery("#titrePage").infos();
     146    var infos_imageInfoBar = jQuery("#imageInfoBar").infos();
     147    var infos_theHeader = jQuery("#theHeader").infos();
     148    var infos_imageToolBar = jQuery("#imageToolBar").infos();
     149    var infos_imageHeaderBar = jQuery("#imageHeaderBar").infos();
     150    var infos_body = jQuery("body").infos();
     151
     152
     153    var Type_Img = "";
     154
     155    //=============================================================
     156    // REPONSE ACTION
     157    //=============================================================
     158    jQuery("#reset").click(function () {
     159      location.reload();
     160    });
     161    var mouseLocation = new Point(-500, -500);
     162    //========================================================
     163    jQuery("#pamoorama").live("on", function (e) {
     164      myPamoorama = window.myPamoorama;
     165    });
     166    jQuery("#pamoorama_inner").live("on", function (e) {
     167      myPamoorama = window.myPamoorama;
     168    });
     169
     170    function Point(x, y) {
     171      this.x = x; this.y = y;
     172    }
     173    register_position();
     174
     175    function register_position() {
     176      mouse_x = 0;
     177      mouse_y = 0;
     178      //  document.onmousemove = position;
     179
     180    }
     181
     182    function position(evt) {
     183      if (!evt) evt = window.event;
     184      mouseLocation.x = evt.clientX;
     185      mouseLocation.y = evt.clientY;
     186      affiche_debug({
     187        Debug1: Debug_info(1, "x:" + mouseLocation.x + " y: " + mouseLocation.y, "position:"),
     188        Debug2: Debug_info(2, "pos_top:" + options.pos_top + " marge_right: " + options.marge_right, "marges:"),
     189
     190        Debug5: Debug_info(5, "X:" + infos_theMainImage.left +
     191    "Y:" + infos_theMainImage.top +
     192    "W:" + infos_theMainImage.exterieur.width +
     193    "H:" + infos_theMainImage.exterieur.height
     194    , infos_theMainImage.id)
     195      });
     196
     197
     198    }
     199
     200    jQuery("div,a,img").mousemove(function (evt) {
     201
     202      if (!evt) evt = window.event;
     203      mouseLocation.x = evt.clientX;
     204      mouseLocation.y = evt.clientY;
     205      Context = jQuery(this).context.nodeName;
     206      obj_id = "#" + this.id.toString();
     207      infos_g = jQuery(obj_id).infos(true);
     208      infos_g.top = jQuery(obj_id).absoluteTop();
     209
     210
     211      affiche_debug({
     212        Debug1: Debug_info(1, "x:" + mouseLocation.x
     213    + " y: " + mouseLocation.y
     214    + " id: " + obj_id
     215    + " top: " + infos_g.top,
     216    +" Node: " + Context
     217    , "->")
     218    ,
     219        Debug2: Debug_info(2, "W:" + infos_g.general.width
     220    + " H: " + infos_g.general.height
     221    + " id: " + obj_id
     222    + " top: " + infos_g.top,
     223    +" Node: " + Context
     224    , "->")
     225      });
     226
     227    });
     228
     229
     230
     231    //===========================================================
     232    //  REPONSE TRIGGER
     233    //===========================================================
     234
     235
     236    jQuery('#ret_autosize').live('ON', function (e) {
     237      if (nu_img == "") nu_img = 8;
     238      jQuery(jQuery('.debug').get(nu_img)).trigger('ON');
     239
     240    });
     241
     242    //==========================================================
     243    jQuery("map area").mouseover(function (e) {
     244      hok = this;
     245
     246    });
     247
     248    //==================================
     249    // jQuery("#llgbo").trigger("ON");
     250    //==================================
     251    jQuery(llgbo_id).live('ON', function (e) {
     252      n_id = this;
     253      infos_llgbo = jQuery(llgbo_id).infos();
     254      if (infos_llgbo.visible == false) return;
     255
     256      marges_llgbo = 0;
     257      if (infos_llgbo.height > 0) {
     258        infos_llgboframe1 = jQuery(llgbo_id + " div:last").infos();
     259        infos_llgboframe31 = jQuery(llgbo_id + "  div:first").infos();
     260        //=============================================
     261        ll2 = infos_llgboframe1.width; // llgboframe1 interieur
     262        ll1 = infos_llgboframe31.exterieur.width; // llgboframe31 avec border width
     263        options.marges_llgbo = (ll1 - ll2);
     264        infos_llgboh2 = jQuery("#llgboh2").infos();
     265      }
     266    });
     267    //==============================
     268    // jQuery("#mapPicture").trigger("ON");
     269    //==============================
     270    jQuery("#mapPicture").live('ON', function (e) {
     271      p2 = jQuery("#infoSwitcher").infos();
     272    });
     273    //==============================
     274    // jQuery("#map").trigger("ON");
     275    //==============================
     276    jQuery("#map").live('ON', function (e) {
     277      p2 = jQuery("#map").infos();
     278    });
     279    //===================================
     280    // jQuery("#theImage").trigger("ON");
     281    //===================================
     282    jQuery("#imageInfos").live('on', function (e) {
     283      target = e.target.id;
     284    });
     285
     286    //===================================
     287    // jQuery("#theImage").trigger("ON");
     288    //===================================
     289    jQuery("#theImage").live('ON', function (e) {
     290      target = e.target.id;
     291
     292      id = this.id;
     293      theImage_init();
     294    });
     295
     296    /***********************
     297    *
     298    **********************/
     299    jQuery("#theMainImage").error(function (e) {
     300      alert(this.src + ' Image does not exist !!');
     301    });
     302
     303    jQuery("#theMainImage,.preload, .next1 , ").load(function (e) {
     304      if (this.complete) {
     305        theMainImage_id = "#" + this.id;
     306        jQuery(theMainImage_id).show(1000);
     307      }
     308
     309      if (typeof theMainImage_id != "undefined")
     310        if (init_img(this))
     311          setTimeout(function () { Autosize_resize(true) }, 5);
     312      nu_img = 0;
     313    });
     314
     315    //=================================================================
     316    jQuery(document).live('gallyInterfaceReady', function (e) {
     317      i = jQuery(this).text();
     318      jQuery(this).trigger('ON');
     319    }
    97320
    98321          );
    99   // jQuery("#theImage").trigger("OK");
    100   jQuery("#theImage").live('Start_right', function (e) {
    101     if (typeof Zone_image == "undefined") return
    102     if (nu_img == "") nu_img = 7;
    103     jQuery(jQuery('.debug').get(nu_img)).trigger('ON');
    104     test_w = window.myPamoorama.autoSlideFx.to;
    105     test_w = window.myPamoorama.autoScrollFx.to;
    106     nf = jQuery("#pamoorama_thumb").height();
    107     jQuery("#pamoorama_thumb img").width(200);
    108     jQuery("#pamoorama_thumb img").height(nf);
    109     // 200=window.myPamoorama.imageWidth
    110     // frame = Zone_image.container.width
    111     if (Zone_image.container)
    112       nw = (200 * Zone_image.container.width) / window.myPamoorama.imageWidth;
    113     else
    114       nw = (200 * infos_content.width) / window.myPamoorama.imageWidth;
    115     jQuery("#pamoorama_frame").width(nw);
    116 
    117 
    118 
    119   });
    120 
    121   jQuery("#theImage").live('Start_left', function (e) {
    122     if (typeof Zone_image == "undefined") return
    123     if (nu_img == "") nu_img = 7;
    124     jQuery(jQuery('.debug').get(nu_img)).trigger('ON');
    125     test_w = window.myPamoorama.autoSlideFx.to;
    126     test_w = window.myPamoorama.autoScrollFx.to;
    127     nf = jQuery("#pamoorama_thumb").height();
    128     jQuery("#pamoorama_thumb img").width(200);
    129     jQuery("#pamoorama_thumb img").height(nf);
    130 
    131     nw = (200 * Zone_image.container.width) / window.myPamoorama.imageWidth;
    132     jQuery("#pamoorama_frame").width(nw);
    133 
    134   });
    135 
    136   // Custom Event, ON to turn on a debug.
    137   jQuery('.debug').live('ON', function (e) {
    138 
    139     nu_img = jQuery(this).text();
    140     jQuery('.debug').trigger('OFF');
    141     jQuery(this).addClass('debugOn');
    142 
    143   });
    144 
    145   // On Click = debugs On
    146   jQuery('.debug').live('click', function (e) {
    147     i = jQuery(this).text();
    148     jQuery(this).trigger('ON');
    149   });
    150 
    151   // Custom Event, Turn off a debug
    152   jQuery('.debug').live('OFF', function (e) {
    153     jQuery(this).removeClass('debugOn');
    154   });
    155 
    156   // on Double Click, remove the debug from the DOM
    157   jQuery('.debug').live('dblclick', function () {
    158     jQuery(this).fadeOut(function () { jQuery(this).remove() });
    159   });
    160 
    161   // Add another debug to the DOM
    162   jQuery('#adddebugs').click(function () {
    163     i = jQuery('.debug').length;
    164     jQuery('<div>' + i + '</div>')
     322
     323
     324    jQuery('#pamoorama').live('ON', function (e) {
     325      jQuery(jQuery('.debug').get(1)).trigger('ON');
     326      if (typeof Bandeau_bas == "undefined" || Bandeau_bas.width == 0) {
     327        Bandeau_bas = infos_Description_f("#theImage");
     328        Bandeau = Bandeau_bas.top;
     329      }
     330    });
     331    // jQuery("#theImage").trigger("OK");
     332    jQuery("#theImage").live('Start_right', function (e) {
     333      if (typeof Zone_image == "undefined") return
     334      if (nu_img == "") nu_img = 7;
     335      jQuery(jQuery('.debug').get(nu_img)).trigger('ON');
     336      test_w = window.myPamoorama.autoSlideFx.to;
     337      test_w = window.myPamoorama.autoScrollFx.to;
     338      nf = jQuery("#pamoorama_thumb").height();
     339      jQuery("#pamoorama_thumb img").width(200);
     340      jQuery("#pamoorama_thumb img").height(nf);
     341      // 200=window.myPamoorama.imageWidth
     342      // frame = Zone_image.container.width
     343      if (Zone_image.container)
     344        nw = (200 * Zone_image.container.width) / window.myPamoorama.imageWidth;
     345      else
     346        nw = (200 * infos_content.width) / window.myPamoorama.imageWidth;
     347      jQuery("#pamoorama_frame").width(nw);
     348
     349
     350
     351    });
     352
     353    jQuery("#theImage").live('Start_left', function (e) {
     354      if (typeof Zone_image == "undefined") return
     355      if (nu_img == "") nu_img = 7;
     356      jQuery(jQuery('.debug').get(nu_img)).trigger('ON');
     357      test_w = window.myPamoorama.autoSlideFx.to;
     358      test_w = window.myPamoorama.autoScrollFx.to;
     359      nf = jQuery("#pamoorama_thumb").height();
     360      jQuery("#pamoorama_thumb img").width(200);
     361      jQuery("#pamoorama_thumb img").height(nf);
     362      if (typeof Zone_image.container != "undefined") return;
     363      try {
     364        nw = (200 * Zone_image.container.width) / window.myPamoorama.imageWidth;
     365        jQuery("#pamoorama_frame").width(nw);
     366      } catch (e) {
     367
     368      }
     369
     370    });
     371
     372    // Custom Event, ON to turn on a debug.
     373    jQuery('.debug').live('ON', function (e) {
     374
     375      nu_img = jQuery(this).text();
     376      jQuery('.debug').trigger('OFF');
     377      jQuery(this).addClass('debugOn');
     378
     379    });
     380
     381    // On Click = debugs On
     382    jQuery('.debug').live('click', function (e) {
     383      i = jQuery(this).text();
     384      jQuery(this).trigger('ON');
     385    });
     386
     387    // Custom Event, Turn off a debug
     388    jQuery('.debug').live('OFF', function (e) {
     389      jQuery(this).removeClass('debugOn');
     390    });
     391
     392    // on Double Click, remove the debug from the DOM
     393    jQuery('.debug').live('dblclick', function () {
     394      jQuery(this).fadeOut(function () { jQuery(this).remove() });
     395    });
     396
     397    // Add another debug to the DOM
     398    jQuery('#adddebugs').click(function () {
     399      i = jQuery('.debug').length;
     400      jQuery('<div>' + i + '</div>')
    165401          .addClass('debug')
    166402          .appendTo('#debugsContainer');
    167   });
    168 
    169 
    170   /*********************************
    171   *
    172   ********************************/
    173   jQuery("#menuSwitcher,#infoSwitcher").click(function (e) {
    174 
    175     setTimeout(function () { Autosize_resize(true) }, 10);
    176     nu_img = 0;
    177   });
    178 
    179 
    180   //===========================================
    181   // jQuery("#theImageAndInfos").trigger("ON");
    182   //===========================================
    183   jQuery("#theImageAndInfos").live('ON', function (e) {
    184     infos_theImageAndInfos = jQuery("#theImageAndInfos").infos();
    185     //   setTimeout(function () { Autosize_resize(true) }, 100);
    186     nu_img = 0;
    187   }); // fin click #theImageAndInfos ON
    188   jQuery("#theImageAndInfos").resize(function (e) {
    189 
    190     nu_img = 0;
    191   });
    192 
    193   //==================================
    194   //
    195   //===================================
    196   jQuery('#derivativeCheckedAutosize').click(function () {
    197     pathnames = jQuery(this).attr("href").split(":");
    198     try {
    199       eval(pathnames[1]);
    200     } catch (e) {
    201       n = false;
    202     }
    203   }); // fin click derivativeCheckedAutosize
    204   //====================================================
    205   jQuery("#derivativeSwitchBox a").click(function () {
    206     var theImg = document.getElementById(theMainImage_Id.replace("#", ""));
    207     if (theImg) {
     403    });
     404
     405
     406    /*********************************
     407    *
     408    ********************************/
     409    jQuery("#menuSwitcher,#infoSwitcher").click(function (e) {
     410
     411      setTimeout(function () { Autosize_resize(true) }, 10);
     412      nu_img = 0;
     413    });
     414
     415
     416    //===========================================
     417    // jQuery("#theImageAndInfos").trigger("ON");
     418    //===========================================
     419    jQuery("#theImageAndInfos").live('ON', function (e) {
     420      infos_theImageAndInfos = jQuery("#theImageAndInfos").infos();
     421      //   setTimeout(function () { Autosize_resize(true) }, 100);
     422      nu_img = 0;
     423    }); // fin click #theImageAndInfos ON
     424    jQuery("#theImageAndInfos").resize(function (e) {
     425
     426      nu_img = 0;
     427    });
     428
     429
     430    jQuery("#linkAutosize").click(function (e) {
     431      nu_img = 0;
     432    });
     433    //==================================
     434    //
     435    //===================================
     436    jQuery('#derivativeCheckedAutosize').click(function () {
    208437      pathnames = jQuery(this).attr("href").split(":");
    209 
    210438      try {
    211439        eval(pathnames[1]);
    212         n = true;
    213440      } catch (e) {
    214441        n = false;
    215442      }
    216 
     443    }); // fin click derivativeCheckedAutosize
     444    //====================================================
     445    jQuery("#derivativeSwitchBox a").click(function () {
     446      var theImg = document.getElementById(theMainImage_Id.replace("#", ""));
     447      if (theImg) {
     448        pathnames = jQuery(this).attr("href").split(":");
     449
     450        try {
     451          eval(pathnames[1]);
     452          n = true;
     453        } catch (e) {
     454          n = false;
     455        }
     456
     457        infos_theMainImage = jQuery(theMainImage_Id).infos();
     458        infos_theImage = jQuery("#theImage").infos();
     459        theImg.removeAttribute("width");
     460        theImg.removeAttribute("height");
     461
     462        var nw = "100% x 100%".split("x");
     463        if (jQuery(this).text().match(RegExp("x", "gi"))) {
     464          nw = jQuery(this).text().split("(")[1].split(")")[0];
     465          nw = nw.split("x");
     466          init_img(theImg);
     467          wx = parseInt(nw[0]);
     468          wh = parseInt(wx / rapport);
     469          //jQuery("#theImage").css("height", wh + "px");
     470          jQuery(theImg).width(wx);
     471          jQuery(theImg).height(wh);
     472          set_cl(useMap == "#Autosize");
     473          Set_llbgo();
     474        }
     475
     476      }
     477
     478    });  // fin click #derivativeSwitchBox a
     479
     480    jQuery("input").click(function () {
     481      if (this.name.match(RegExp("_enabled", "gi"))) {
     482        sel = "[name*=" + this.name + "]";
     483        obj = jQuery("tr" + sel);
     484
     485        if (this.checked)
     486          obj.css({ backgroundColor: "green", color: "white" });
     487        else
     488          obj.css({ backgroundColor: "red", color: "white" });
     489
     490        return;
     491      }
     492
     493
     494
     495      return;
     496
     497
     498
     499
     500    });
     501
     502    //====================================
     503    Autosize_init = function (name, value) {
     504      img_defaut = { height: options.scaled_height, width: options.scaled_width };
     505      img_reelle = { height: options.img_height, width: options.img_width };
     506      img_init = { height: options.img_height, width: options.img_width };  // taille initiale
     507
     508      img_finale = img_init;
     509      rapport = parseInt(img_init.width) / parseInt(img_init.height);
     510      useMap = infos_theMainImage.useMap; // #mapmedium
     511
     512      useMap = cookies.pictureMap; // #mapxxx
     513      typeSave = cookies.typeSave; //picturederiv xxx
     514
     515
     516      old_img = cookies.imgSrc;
     517      old_window_height = cookies.windowHeight || jQuery(window).height();
     518      old_window_width = cookies.windowWidth || jQuery(window).width();
     519      old_img_h = cookies.imgHeight;
     520      old_img_w = cookies.imgWidth;
     521      if (infos_theMainImage.visible == true) {
     522        var theImg = document.getElementById(theMainImage_Id.replace("#", ""));
     523        theImg.useMap = useMap;
     524      }
     525
     526    } // Autosize_init
     527    //===========================================================================
     528    Autosize_resize = function (force, parametres) {
     529      fade_in = parseInt(fade_in || 1000);
     530
     531      if (Get_dimensions(force, parametres)) {
     532        jQuery(theMainImage_Id).height(Zone_image.image.height);
     533        jQuery(theMainImage_Id).width(Zone_image.image.width);
     534        jQuery("#theImageAndInfos").css({ height: "auto" });
     535        if (Type_Img == "pamoorama") {
     536          jQuery("#theImage").css({ height: "auto" });
     537
     538        } else {
     539          jQuery("#theImage").css({ height: Zone_image.container.height });
     540          jQuery("#theImage").width(Zone_image.container.height);
     541        }
     542        jQuery("#theImage").width(Zone_image.container.width);
     543
     544
     545        Set_Pamoorama();
     546
     547        set_cl(true);
     548      } else {
     549        Set_Pamoorama();
     550        set_cl(false);
     551      }
     552
     553      jQuery(theMainImage_Id).show(fade_in);
     554      Set_llbgo(true);
     555      return true;
     556
     557      //_____________________________________________________   
     558    }; // Autosize
     559
     560
     561
     562
     563
     564    /********************************************
     565    *  window LOAD
     566    ********************************************/
     567    jQuery(window).load(function () {
     568      href = location.href;
     569      var aff_ok = false;
     570      if (DEBUG_autosize == "true") {
     571        for (var i = 0; i < 10; i++) {
     572          jQuery('#adddebugs').click();
     573        }
     574        jQuery(jQuery('.debug').get(i - 1)).click();
     575      }
     576
     577      Autosize_init();
     578
     579
     580      /*
     581      Bandeau_bas = infos_Description_f("#theImage");
     582      if (typeof Bandeau_bas != "undefined") Bandeau = Bandeau_bas.top;
     583      else Bandeau = 0;
     584      */
     585
     586      Wait_pamoorama();
     587
     588      if (!theImage_init()) {
     589        Wait_Affichage();
     590        Autosize_resize(true, options);
     591        Set_llbgo(true);
     592
     593      } else {
     594        set_cl(options.useMap.match(RegExp("Autosize", "gi")));
     595        Set_llbgo();
     596      }
     597      setTimeout(function () { Autosize_resize(true) }, 100);
     598
     599
     600
     601      //=================================================================================
     602    }); // window.onload
     603    /***********************************************************
     604    *  RESIZE
     605    ***********************************************************/
     606    jQuery(window).resize(
     607                       function (event, ui) {
     608                         Wait_Affichage();
     609                         List_autosize_resize(event, ui);
     610                         Autosize_resize(true, options);
     611
     612
     613                       });
     614
     615    /*****************
     616    * changeImgSrc1
     617    ******************/
     618    changeImgSrc = function (url, typeSave, useMap) {
     619      var theImg = document.getElementById(theMainImage_Id.replace("#", ""));
     620      if (theImg) {
     621        theImg.removeAttribute("width");
     622        theImg.removeAttribute("height");
     623        //  theImg.useMap = "#map" + useMap;
     624
     625        jQuery('#derivativeSwitchBox .switchCheck').css('visibility', 'hidden');
     626        jQuery('#derivativeChecked' + useMap.replace("#", "")).css('visibility', 'visible');
     627        options.useMap = useMap;
     628        if (useMap.match("Autosize")) {
     629          pictureMap = "#" + "Autosize";
     630        } else {
     631          pictureMap = "#map" + typeSave;
     632        }
     633        theImg.src = url; // charge Image
     634        theImg.useMap = pictureMap;
     635        //===================================================
     636
     637
     638        infos_theMainImage = jQuery(theMainImage_Id).infos();
     639        Zone_image.width_init = infos_theMainImage.width;
     640        Zone_image.height_init = infos_theMainImage.height;
     641        Zone_image.zoom = (infos_theMainImage.width / infos_theMainImage.height);
     642        infos_theMainImage.useMap = theImg.useMap;
     643
     644        Save_cookies({
     645          typeSave: typeSave,
     646          pictureMap: pictureMap,
     647          imgSrc: url
     648        });
     649        cookies = Get_cookies();
     650
     651      }
     652
     653
     654    }          //changeImgSrc1
     655    /************************************
     656    *
     657    ************************************/
     658    Wait_pamoorama = function () {
     659      if (Type_Img != "pamoorama") return;
     660
     661      jQuery("#loading").attr("id", "theMainImage");
     662
     663      Wait_pamoorama_st = false;
     664      while (Wait_pamoorama_st == false) {
     665        Wait_pamoorama_st = Wait_pamoorama_time();
     666      }
     667    }
     668    Wait_pamoorama_time = function () {
     669
     670      if (jQuery("#pamoorama").length) {
     671        tempo = tempo + 1;
     672
     673        mypanorama = window.myPamoorama;
     674        if (!mypanorama) {
     675          tempo = tempo + 1;
     676          if (tempo > 2000) return true;
     677          nopano = false;
     678          setTimeout("Wait_pamoorama_time()", 500);
     679          return false;
     680
     681        }
     682
     683        if (mypanorama.skipInit == false) {
     684          if (tempo > 4000) return true;
     685          setTimeout("Wait_pamoorama_time()", 500);
     686          return false;
     687        }
     688        //=============================================================
     689        infos_pamoorama = jQuery("#pamoorama").infos();
     690        if (Math.abs(infos_pamoorama.height) < 50) {
     691          setTimeout("Wait_pamoorama_time()", 500);
     692          return false;
     693        }
     694
     695        nopano = true;
     696
     697        return true;
     698
     699      }
     700    } // Wait_pamoorama
     701    //====================================================================================
     702    Wait_Affichage = function () {
     703      Wait_Affichage_st = false;
     704      while (Wait_Affichage_st == false) {
     705        Wait_Affichage_st = Wait_Affichage_time();
     706      }
     707    }
     708    //==========================================
     709    Wait_Affichage_time = function () {
     710      if (typeof fade_in == "undefined") fade_in = 1000;
     711      fade_in = parseInt(fade_in);
     712      /*
     713      if (!Autosize_resize()) {
     714      setTimeout("Wait_Affichage()", 500);
     715      return
     716      } 
     717      nu_img++;     
     718      */
     719      if (typeof fade_in == "undefined") fade_in = 0;
     720
     721      //   if (nu_img > 1) return;
     722      if (typeof stb != "undefined")
     723        stb.stop().fadeTo(3500, 0);
     724      if (typeof theMainImage_Id == "undefined") return true;
     725
     726      if (theMainImage_Id.selector) {
     727        theMainImage_Id = theMainImage_Id.selector;
     728      }
     729      if (theMainImage_Id == null) return;
     730
     731      if (jQuery(theMainImage_Id).length == 0) {
     732        if (jQuery("#pamoorama_inner").length > 0) {
     733          return true;
     734        }
     735        //=== attente Image chargée ===
     736        if (tempo > 100) return true;
     737        tempo++;
     738        setTimeout("Wait_Affichage_time()", 500);
     739        return false;
     740
     741      } else {
     742
     743        img_h = jQuery(theMainImage_Id).height();
     744        img_w = jQuery(theMainImage_Id).width();
     745
     746        jQuery("#src_img_h").val(img_h);
     747        jQuery("#src_img_w").val(img_w);
     748        jQuery("#ret_autosize").val(infos_theMainImage.src);
     749        if (typeof Window_Affichage == "undefined") return;
     750        jQuery("#window_height").val(Window_Affichage.height);
     751        jQuery("#window_width").val(Window_Affichage.width);
     752        jQuery("#ret_autosize").trigger('ON', {
     753          width: img_w,
     754          height: img_h,
     755          theImage: theMainImage_Id,
     756          src_img: infos_theMainImage.src,
     757          window_height: Window_Affichage.height,
     758          window_width: Window_Affichage.width
     759        });
     760      }
     761      return true;
     762    } // Wait_affichage
     763
     764
     765
     766
     767
     768    /***********************
     769    *
     770    **********************/
     771    init_img = function (theImg) {
     772
     773      name_src = theImg.src;
     774      img_init = { width: jQuery(theImg).width(), height: jQuery(theImg).height() }
     775
     776      if (typeof theImg.naturalWidth != "undefined")
     777        img_init.width = theImg.naturalWidth;
     778      if (typeof theImg.naturalHeight != "undefined")
     779        img_init.height = theImg.naturalHeight;
     780
     781      img_init.rapport = img_init.width / img_init.height;
     782      Zone_image.height_init = img_init.height;
     783      Zone_image.width_init = img_init.width;
     784      if (typeof Zone_image.image == "undefined") Zone_image.image = { height: Zone_image.height_init, width: Zone_image.width_init }; ;
     785      Zone_image.zoom = Zone_image.image.height / Zone_image.height_init;
     786      Zone_image.rapport = img_init.rapport;
     787      nu_img = 0;
     788      if (typeof Zone_image.src == "undefined") return false;
     789      stx = name_src.match(Zone_image.src);
     790      sty = infos_theMainImage.src;
     791      return stx;
     792    }
     793
     794
     795    /*****************************************************
     796    * recherche la plus grande image (hauteur ou largeur)
     797    *****************************************************/
     798    Get_Img_Maxi = function (myobj) {
     799      var w00 = 0;
     800      var myImg = null;
     801
     802      img = jQuery(theMainImage_Id);
     803      if (img != null) {
     804        return;
     805
     806      }
     807      img = jQuery(myobj);
     808
     809      img = jQuery('img[alt]');
     810
     811      jQuery(myobj).each(function (i) {
     812        w0 = img_reelle.width;
     813        h0 = img_reelle.height;
     814        if (h0 > w0) w0 = h0;
     815        if (w0 > w00) {
     816          if (!this.src.match(RegExp(".png", "gi")))
     817            if (!this.src.match(RegExp(thumbnail, "g"))) {
     818              myImg = this;
     819              jQuery(myImg).addClass("Image");
     820              w00 = w0;
     821            }
     822
     823        }
     824      });
     825      return myImg;
     826    } // Get_Img_Maxi
     827
     828
     829    /*************************************************************
     830    *
     831    **************************************************************/
     832    infos_entete = function () {
     833      infos_imageToolBar = jQuery("#imageToolBar").infos();
     834      if (typeof (marge_top) != "undefined") return;
     835
     836      optiontop = 0;
     837      infos_imageInfoBar = jQuery("#imageInfoBar").infos();
     838
     839      infos_thePicturePage = jQuery("#thePicturePage").infos();
     840      infos_theImage = jQuery("#theImage").infos();
     841      if (theme.match(RegExp("stripped", "gi"))) {
     842        infos_theImageAndTitle = jQuery("#theImageAndTitle").infos();
     843        infos_theImageBox = jQuery("#theImageBox").infos();
     844        optiontop = (marges_llgbo / 2) + infos_theImageAndTitle.margin.top;
     845      }
     846
     847
     848
     849      marge_top = Math.ceil(infos_the_page.top +
     850                                             infos_the_page.borderwidth.top +
     851                                             infos_theImage.borderwidth.top +
     852                                             infos_thePicturePage.margin.top
     853                                             );
     854
     855      img_top = Math.ceil(infos_theImage.top +
     856                                infos_theImage.padding.top +
     857                                infos_theImage.borderwidth.top +
     858                                infos_thePicturePage.margin.top + optiontop);
     859      result = infos_imageToolBar;
     860      // result.width = "20%";
     861      // result.left = "40%";
     862      result.marge_top = marge_top;
     863      result.img_top = img_top;
     864      //=== Afficher le titre de l'image sur le cadre ===
     865
     866
     867      if (infos_llgboh2.top > 0) {
     868        result.img_top = infos_llgboh2.top;
     869
     870      }
     871      else if (marges_llgbo > 0) {
     872        result.img_top -= (8);
     873      }
     874      return result;
     875    } // infos_entete
     876
     877    /*************************************************
     878    * Récupère les informations sur la description.
     879    *
     880    *************************************************/
     881    infos_Description_f = function () {
     882      // jQuery("#theImage").css({ display: "block" });
     883
     884      //===============  CHARLIE ==============================
     885      if (jQuery("#charlie").length > 0) {
     886        jQuery("#charlie").css({
     887          paddingTop: "0px",
     888          marginTop: "0px",
     889          paddingBottom: "0px",
     890          marginBottom: "0px"
     891        });
     892
     893      }
     894
     895      //  Bandeau_t = infos_entete();
     896      //  Bandeau = Bandeau_t.img_top;
     897      infos_theImgContainer = jQuery("#" + "theImgContainer").infos();
     898      infos_description = jQuery("#" + "description").infos();
     899      //=============================================================================
     900
     901
     902
     903      if (theme.match(RegExp("luciano", "g"))) {
     904
     905
     906
     907
     908      } else if (Type_Img == "map") {
     909
     910        infos_map = jQuery("#mapPicture").infos();
     911        marge_left = infos_map.width;
     912
     913        jQuery("#map").css({ left: marge_left + "px", padding: "0px",
     914          marginLeft: "0px",
     915          marginRight: "4px",
     916          marginTop: "0px",
     917          marginBottom: "0px",
     918          position: "relative"
     919        });
     920
     921        theMainImage_Id = "#map";
     922        infos_theMainImage = jQuery(theMainImage_Id).infos();
     923
     924
     925      } else if (jQuery("#charlie").length > 0) {
     926        infos_charlie = jQuery("#charlie").infos();
     927        obj_charlie = jQuery("object");
     928        try {
     929          tp = obj_charlie.attr();
     930        } catch (e) {
     931          tp = obj_charlie.prop();
     932        }
     933
     934        if (tp != undefined) {
     935          if (obj_charlie.length > 0)
     936            tp = jQuery("object").attr("type") || jQuery("object").prop("type");
     937          else
     938            tp = jQuery("embed").attr("type") || jQuery("embed").prop("type");
     939        }
     940
     941        if (tp == 'application/x-shockwave-flash') {
     942          jQuery("#charlie").css({
     943            paddingTop: "0px",
     944            marginTop: "0px",
     945            paddingBottom: "30px",
     946            marginBottom: "0px"
     947          });
     948        } else {
     949
     950        }
     951
     952        var MainImage = jQuery(theMainImage_Id);
     953
     954        if (MainImage.length == 0) {
     955          theMainImage_Id = "#charlie";
     956          infos_theMainImage = jQuery(theMainImage_Id).infos();
     957        } else {
     958
     959          infos_theMainImage = jQuery(theMainImage_Id).infos();
     960
     961        }
     962
     963
     964      } else if (jQuery("#theImage" + " embed").length > 0) {
     965        if (jQuery(theMainImage_Id).lenght == 0) {
     966          theMainImage_Id = "#theImage" + " embed";
     967          infos_theMainImage = jQuery(theMainImage_Id).infos();
     968          jQuery("#theImage" + " embed").width({ width: infos_theMainImage.width + "px", height: infos_theMainImage.height + "px" });
     969        } else {
     970
     971          infos_theMainImage = jQuery(theMainImage_Id).infos();
     972          Type_Img == "charlie"
     973          if (infos_theMainImage.width == 0) {
     974
     975            infos_theMainImage = jQuery(theMainImage_Id).infos();
     976
     977          }
     978        }
     979
     980      } else if (Type_Img == "pamoorama") {
     981        if (!nopano) {
     982          Wait_pamoorama();
     983
     984        }
     985        infos_theMainImage = jQuery(theMainImage_Id).infos();
     986        infos_footer = jQuery("#pamoorama_footer").infos();
     987        infos_theMainImage.height += parseInt(infos_theMainImage.height) + parseInt(infos_footer.height);
     988
     989      } else {
     990        if (jQuery(theMainImage_Id).length == 0) {
     991          theMainImage_Id = "#theImage" + " img[alt]";
     992        } else {
     993
     994        }
     995
     996
     997        if (!theMainImage_Id)
     998          theMainImage_Id = "#theImage";   // sans img ??
     999
     1000
     1001      }
     1002      //=====================================================================================
    2171003      infos_theMainImage = jQuery(theMainImage_Id).infos();
    218       infos_theImage = jQuery("#theImage").infos();
    219       theImg.removeAttribute("width");
    220       theImg.removeAttribute("height");
    221 
    222       var nw = "100% x 100%".split("x");
    223       if (jQuery(this).text().match(RegExp("x", "gi"))) {
    224         nw = jQuery(this).text().split("(")[1].split(")")[0];
    225         nw = nw.split("x");
    226         init_img(theImg);
    227         wx = parseInt(nw[0]);
    228         wh = parseInt(wx / rapport);
    229         //jQuery("#theImage").css("height", wh + "px");
    230         jQuery(theImg).width(wx);
    231         jQuery(theImg).height(wh);
    232         set_cl(useMap == "#Autosize");
    233         Set_llbgo();
     1004
     1005      switch (infos_theMainImage.position) {
     1006        case "relative":
     1007          break;
     1008        case "static":
     1009          break;
     1010        case "absolute":
     1011          break;
     1012        case "":
     1013          break;
     1014        default:
     1015          break;
     1016      }
     1017
     1018      infos_description.marge = {
     1019        bottom: infos_theMainImage.padding.bottom + infos_theMainImage.margin.bottom + infos_theMainImage.borderwidth.bottom,
     1020        top: infos_theMainImage.padding.top + infos_theMainImage.borderwidth.top + infos_theMainImage.margin.top
     1021      }
     1022
     1023      if (infos_llgbo.height > 0) infos_theMainImage = infos_llgbo; // format de l'image+largeur du cadre
     1024
     1025      if (theme.match(RegExp("luciano", "g"))) {
     1026
     1027        infos_theImgContainer = jQuery(theImageAndInfos_id).infos();
     1028        infos_description.bottom = jQuery("#imageInfo").infos().top;
     1029        infos_description.top = infos_theImgContainer.bottom;
     1030        infos_slidshowToolBar = jQuery("#slidshowToolBar").infos();
     1031
     1032        if (infos_slidshowToolBar.height > 0) {
     1033          correction = (infos_slidshowToolBar.height);
     1034          infos_description.top = infos_theMainImage.bottom;
     1035          infos_description.bottom = jQuery("#copyright").infos().top;
     1036        }
     1037
     1038        //=========================================================
     1039      } else if (theme.match(RegExp("stripped", "gi"))) {
     1040        //options.imageAutosize
     1041        //options.imageMargin
     1042
     1043        infos_content = jQuery("#content").infos();
     1044        if (options.imageAutosizeTitle == false) {
     1045          infos_description.top = infos_theImageBox.bottom;
     1046
     1047          infos_description.bottom = infos_HeaderBar.margin.top + infos_description.top +
     1048                                            infos_description.borderwidth.top +
     1049                                            infos_description.borderwidth.bottom +
     1050                                              options.imageAutosizeMargin * 2 +
     1051                                            (marges_llgbo / 2) + 4;
     1052
     1053        } else {
     1054
     1055
     1056          infos_description.top = infos_theImageBox.bottom -
     1057                                infos_content.top +
     1058                                options.imageAutosizeMargin * 2 +
     1059                                (marges_llgbo / 2)
     1060                                        ;
     1061          infos_description.bottom = jQuery("#tabZone").infos().top +
     1062                                infos_theImageAndTitle.margin.top;
     1063          if (msie == true) infos_description.bottom -= 4;
     1064        };
     1065        check_desc_v = true;
     1066
     1067      } else {
     1068        if (theme.match(RegExp("sobre", "gi"))) {
     1069          infos_description.marge.top = -2;
     1070        }
     1071        infos_description.bottom = infos_theImage.bottom; //482
     1072        infos_description.top = infos_theMainImage.height + infos_theImage.top; //410+62
     1073        // infos_description.bottom -= infos_theMainImage.top;
     1074      }
     1075      //
     1076
     1077      infos_description.height = infos_description.bottom - infos_description.top;
     1078
     1079      if (options.check_desc_v == false) {
     1080        infos_description.height = 0;
     1081      }
     1082
     1083      Debug_pos();
     1084
     1085      //options.cl_visible=false ;
     1086      return infos_description;
     1087    } //infos_Description_f
     1088
     1089    //=======================================================================================
     1090    Debug_info = function (index, infos, Nom_str) {
     1091      if (DEBUG_autosize == "true") {
     1092        if (typeof infos == "undefined") return;
     1093        width_g = Math.ceil(infos_body.width / 5) - 10;
     1094        if (typeof infos.height != "undefined") {
     1095
     1096          message = " -- > Info : " + Nom_str + " " + infos.id + "\n" +
     1097                         "Info nodeName: " + infos.nodeName + "\n" +
     1098                         "Info width: " + infos.width + "\n" +
     1099                         "Info height: " + infos.height + "\n" +
     1100                         "Info top: " + infos.top + "\n" +
     1101                         "Info left: " + infos.left + "\n" +
     1102                         "Info position: " + infos.position + "\n";
     1103
     1104          myDebug = { id: "Debug" + index, texte: message,
     1105            css: {
     1106              color: "black",
     1107              opacity: "1",
     1108              position: "absolute",
     1109              height: infos.height || pos_top - 30 + "px",
     1110              width: infos.width || width_g + "px",
     1111              left: infos.left || 0 + "px",
     1112              border: "solid 1px green",
     1113              top: infos.top + "px"
     1114            }
     1115          }
     1116          return myDebug;
     1117        } else {
     1118          if (typeof old_messages == "undefined") {
     1119            old_messages = new Array();
     1120
     1121          }
     1122          if (infos != "" && infos != "undefined") {
     1123            nc0 = old_messages[index] || "";
     1124
     1125            if (typeof nc0 != "undefined") {
     1126              nc0 = nc0.toString().split("<br />");
     1127              if (nc0.length > 6) nc0.shift();
     1128
     1129              old_messages[index] = nc0.join("<br />");
     1130            }
     1131            old_messages[index] += "" + Nom_str + "->" + infos + "<br />";
     1132
     1133            message = old_messages[index];
     1134
     1135            colors = Array('black', 'black', 'white', 'white', 'white', 'white', 'red');
     1136            myDebug = { id: "Debug" + index, texte: message,
     1137              css: {
     1138                color: colors[index - 1],
     1139                opacity: "1",
     1140                position: "absolute",
     1141                align: "left",
     1142                height: 80 + "px",
     1143                width: width_g + "px",
     1144                left: ((index - 1) * width_g) + "px",
     1145                border: "solid 1px green",
     1146                top: 0 + "px"
     1147              }
     1148            }
     1149          }
     1150
     1151          return myDebug;
     1152        }
    2341153      }
    2351154
    2361155    }
    237 
    238   });  // fin click #derivativeSwitchBox a
    239 
    240   jQuery("input").click(function () {
    241     if (this.name.match(RegExp("_enabled", "gi"))) {
    242       sel = "[name*=" + this.name + "]";
    243       obj = jQuery("tr" + sel);
    244 
    245       if (this.checked)
    246         obj.css({ backgroundColor: "green", color: "white" });
    247       else
    248         obj.css({ backgroundColor: "red", color: "white" });
    249 
     1156    //====================================================
     1157    function Debug_pos() {
     1158      return;
     1159      if (DEBUG_autosize == "true") {
     1160
     1161        jQuery("[id ^='Debug']").show();
     1162        /*
     1163        Debug2  background-color:yellow
     1164        Debug3 background-color:blue
     1165        Debug4 background-color:green
     1166        Debug5 background-color:red
     1167
     1168        */
     1169
     1170        affiche_debug({
     1171          Debug1: Debug_info(1, Bandeau_t, "Bandeau_t"),
     1172          Debug4: Debug_info(4, infos_description, "infos_description"),
     1173          Debug5: Debug_info(5, infos_theMainImage, "infos_theMainImage")
     1174        });
     1175      }
     1176    }
     1177    //==========================================================
     1178    affiche_debug = function (aff_infos) {
     1179      jQuery(jQuery("[id ^='Debug']")).each(function (i) {
     1180        if (aff_infos[this.id]) {
     1181          if (aff_infos[this.id].css) {
     1182            jQuery("#" + this.id).css(aff_infos[this.id].css);
     1183            jQuery("#" + this.id).html(aff_infos[this.id].texte);
     1184          }
     1185        }
     1186      });
    2501187      return;
    2511188    }
    252 
    253 
    254 
    255     return;
    256 
    257 
    258 
    259 
    260   });
    261 
    262   //====================================
    263   Autosize_init = function (name, value) {
    264     img_defaut = { height: options.scaled_height, width: options.scaled_width };
    265     img_reelle = { height: options.img_height, width: options.img_width };
    266     img_init = { height: options.img_height, width: options.img_width };  // taille initiale
    267 
    268     img_finale = img_init;
    269     rapport = parseInt(img_init.width) / parseInt(img_init.height);
    270     useMap = infos_theMainImage.useMap; // #mapmedium
    271     Type_Img = "";
    272     nopano = false;
    273 
    274     useMap = cookies.pictureMap; // #mapxxx
    275     typeSave = cookies.typeSave; //picturederiv xxx
    276 
    277 
    278     old_img = cookies.imgSrc;
    279     old_window_height = cookies.windowHeight || jQuery(window).height();
    280     old_window_width = cookies.windowWidth || jQuery(window).width();
    281     old_img_h = cookies.imgHeight;
    282     old_img_w = cookies.imgWidth;
    283 
    284     var theImg = document.getElementById(theMainImage_Id.replace("#", ""));
    285     theImg.useMap = useMap;
    286 
    287 
    288   } // Autosize_init
    289   //===========================================================================
    290   Autosize_resize = function (force, parametres) {
    291     theImage_init();
    292 
    293     if (Get_dimensions(force, parametres)) {
    294 
    295       jQuery(theMainImage_Id).height(Zone_image.image.height);
    296       jQuery(theMainImage_Id).width(Zone_image.image.width);
    297       jQuery("#theImageAndInfos").css({ height: "auto" });
    298       jQuery("#theImage").css({ height: "auto" });
    299       //  jQuery("#theImage").width(Zone_image.container.width);
    300       // jQuery("#theImage").width("auto");
    301       Set_Pamoorama();
    302 
    303       set_cl(true);
    304     } else {
    305       Set_Pamoorama();
    306       set_cl(false);
     1189    //===========================================
     1190    //
     1191    //===========================================
     1192    Set_Map = function (nds) {
     1193      p0 = jQuery("#map").position();
     1194      if (!p0) return;
     1195
     1196      infos_map = jQuery("#map").infos();
     1197      // if (infos_map.width == (Zone_image.container.width - p0.left))   return ;
     1198      nds = jQuery("#imageInfos").css("display");
     1199      if (nds != "none") {
     1200        p2 = jQuery("#infoSwitcher").infos();
     1201        p0.left += 35;
     1202      }
     1203      jQuery("#map").width(Zone_image.container.width - p0.left);
     1204      jQuery("#map").css({ position: "absolute", height: Zone_image.container.height + "px" });
    3071205    }
    308     Set_llbgo(true);
    309     return true;
    310 
    311     //_____________________________________________________   
    312   }; // Autosize
    313 
     1206
     1207    jQuery("map [name='mapAutosize'] area").mouseover(function (e) {
     1208      return;
     1209    });
     1210    //=====================================
     1211    //
     1212    //=====================================
     1213    theImage_init = function () {
     1214      if (jQuery("#derivativeSwitchBox").length > 0) {
     1215        var px = jQuery(".derivativeSizeDetails ");
     1216        i = 0;
     1217        n = 0;
     1218        var pt = new Array();
     1219        jQuery("#derivativeSwitchBox a").each(function (i) {
     1220          href_path = jQuery(this).attr("href");
     1221          if (href_path.match(RegExp("auto", "gi"))) return true;
     1222          pt[i] = href_path.split("'");
     1223        });
     1224        //===== calcul Image ===
     1225        Calcul_Image();
     1226        tw = Zone_image.image.width;
     1227        th = Zone_image.image.height;
     1228        n = 0;
     1229        maxi_size = { w: tw, h: th, idx: -1 };
     1230        mini_size = { w: tw, h: th, idx: 0 };
     1231        size_derive = { w: 0, h: 0 };
     1232        size_encours = { w: tw, h: th };
     1233
     1234        jQuery(".derivativeSizeDetails").each(function (i) {
     1235          vn = jQuery(this).text().replace("(", "").replace(")", "").split("x");
     1236          size_derive = { w: parseInt(vn[0]), h: parseInt(vn[1]) };
     1237          if (size_derive.h > size_encours.h) {
     1238            if (maxi_size.idx < 0) {
     1239              maxi_size = size_derive;
     1240              maxi_size.idx = n;
     1241            }
     1242          }
     1243          if (size_derive.h < size_encours.h) {
     1244            mini_size = size_encours;
     1245            mini_size.idx = n;
     1246          }
     1247
     1248          n++;
     1249        });
     1250        // n = n - 1 ;
     1251        n = maxi_size.idx;
     1252
     1253        if (n > pt.length - 1) n = pt.length - 1; // format le plus grand
     1254        if (n < 0) n = pt.length - 1; // format le plus grand
     1255        imgSrc = pt[n][1];
     1256        last_map = pt[n][5];
     1257        status = imgSrc.match(RegExp(Zone_image.src, "gi"));
     1258        status1 = (imgSrc.toString() == Zone_image.src.toString());
     1259        if (status1 == true) return;
     1260        theImg = document.getElementById(theMainImage_Id.replace("#", ""));
     1261        href_path = "javascript:changeImgSrc('" + imgSrc + "', '" + last_map + "', '" + "Autosize" + "')";
     1262        jQuery("#linkAutosize").attr("href", href_path);
     1263        if (theImg.useMap.match(RegExp("map", "gi"))) return true;
     1264        if (theImg.src.match(RegExp(imgSrc, "gi"))) return true;
     1265        changeImgSrc(imgSrc, last_map, "#Autosize");
     1266        Zone_image.zoom = Zone_image.image.height / Zone_image.height_init;
     1267        return true;
     1268
     1269
     1270        var theImg = document.getElementById(theMainImage_Id.replace("#", ""));
     1271        if (init_img(theImg)) {
     1272
     1273          return true;
     1274        }
     1275        return false;
     1276
     1277      } else {
     1278
     1279
     1280        return false;
     1281      }
     1282
     1283
     1284    };
     1285
     1286
     1287    /*************************************************
     1288    * correction pamoorama
     1289    *************************************************/
     1290    Set_Pamoorama = function () {
     1291      myPamoorama = window.myPamoorama;
     1292      if (Type_Img == "pamoorama") {
     1293
     1294        if (!nopano) {
     1295          //theMainImage_Id = "#pamoorama";
     1296          nopano = false;
     1297          Wait_pamoorama();
     1298          infos_theMainImage = jQuery(theMainImage_Id).infos();
     1299          //theMainImage_Id = "#pamoorama";
     1300        }
     1301
     1302
     1303        if (typeof myPamoorama == "undefined") {
     1304          return;
     1305        }
     1306        //========================================================= 
     1307        if (!nopano) {
     1308          //theMainImage_Id = "#pamoorama";
     1309          nopano = false;
     1310          Wait_pamoorama();
     1311          infos_theMainImage = jQuery(theMainImage_Id).infos();
     1312          //theMainImage_Id = "#pamoorama";
     1313        }
     1314
     1315
     1316
     1317        infos_pamoorama = jQuery("#pamoorama").infos();
     1318        infos_pamoorama_outter = jQuery("#pamoorama_outter").infos();
     1319        infos_pamoorama_inner = jQuery("#pamoorama_inner").infos();
     1320        infos_pamoorama_footer = jQuery("#pamoorama_footer").infos();
     1321        infos_pamoorama_frame = jQuery("#pamoorama_frame").infos();
     1322        infos_frame = jQuery(myPamoorama.frame).infos();
     1323
     1324
     1325        //====================================================
     1326        jQuery("#pamoorama").css({
     1327          marginLeft: "auto",
     1328          marginRight: "auto"
     1329          //  height: Zone_Affichage.height + "px" , sinon déclenchement panorama sur la hauteur;
     1330        });
     1331
     1332        marges_w = infos_pamoorama.general.marges.width;
     1333
     1334        marges_h = infos_pamoorama.general.marges.height;
     1335        marges_h += infos_pamoorama_footer.general.height;
     1336
     1337        jQuery("#pamoorama").css({
     1338          width: ""
     1339        });
     1340
     1341        outter_height = Zone_image.container.height - marges_h;
     1342        Zoom_pano = outter_height / Zone_image.height_init;
     1343
     1344        new_image = { height: Math.ceil(Zone_image.height_init * Zoom_pano),
     1345          width: Math.ceil(Zone_image.width_init * Zoom_pano)
     1346        }
     1347
     1348        jQuery("#pamoorama_inner").css({ width: new_image.width, height: new_image.height, "background-size": "100%"
     1349        });
     1350
     1351        //  jQuery("#pamoorama_inner").width(Zone_image.width_init * Zoom_pano);
     1352        //  jQuery("#pamoorama_inner").height(Zone_image.height_init * Zoom_pano);
     1353
     1354
     1355        //---------- test largeur image
     1356        new_width = Zone_image.container.width;
     1357        if (new_width > new_image.width) {
     1358          new_width = new_image.width;
     1359          jQuery("#pamoorama_outter").css({
     1360            position: 'absolute',
     1361            align: "center",
     1362            margin: "auto"
     1363          });
     1364        }
     1365        outter_width = new_width;
     1366
     1367
     1368        //  jQuery("#pamoorama_thumb").width(200 /  Zone_image.zoom);
     1369
     1370        jQuery("#pamoorama_outter").css({
     1371
     1372          align: 'center',
     1373          margin: 'auto',
     1374          width: outter_width + "px",
     1375          height: outter_height + "px"
     1376        });
     1377        //============= Mise à l'echelle ==================
     1378        jQuery("#pamoorama_footer").css({
     1379          width: Zone_image.container.width + "px"
     1380        });
     1381
     1382        window.myPamoorama.options.width = Math.ceil(Zone_image.container.width);
     1383        //==================================================================
     1384        new_max_left = new_image.width - outter_width;
     1385        //   jQuery(window.myPamoorama.inner).width(Zone_image.width_init* Zoom_pano);
     1386        //    jQuery(window.myPamoorama.inner).height(Zone_image.height_init * Zoom_pano);
     1387
     1388        if (!window.myPamoorama.outter) return;
     1389        window.myPamoorama.outter.scrollTo(new_max_left, 0);
     1390
     1391        window.myPamoorama.autoScrollFx.to = new Array(new_max_left, 0);
     1392        window.myPamoorama.ratio = Math.ceil(new_image.width / 200);
     1393        window.myPamoorama.imageWidth = new_image.width;
     1394        window.myPamoorama.imageHeight = new_image.height;
     1395        nf = jQuery("#pamoorama_thumb").height();
     1396        jQuery("#pamoorama_thumb img").width(200);
     1397        jQuery("#pamoorama_thumb img").height(nf);
     1398        // 200=window.myPamoorama.width
     1399        // frame = Zone_image.container.width
     1400
     1401        nw = (window.myPamoorama.image.width * Zone_image.container.width) / window.myPamoorama.imageWidth;
     1402        jQuery("#pamoorama_frame").width(nw);
     1403        jQuery("#pamoorama").css({
     1404          width: outter_width, height: "auto"
     1405        });
     1406        //infos_theMainImage.width;
     1407        //  infos_theMainImage.height;
     1408
     1409        jQuery("#theMainImage").width(infos_pamoorama_outter.width);
     1410        jQuery("#theMainImage").height(infos_pamoorama_outter.height);
     1411        jQuery("#theMainImage").css({ margin: "auto"
     1412
     1413        });
     1414
     1415      } // test img
     1416    } // Set_Pamoorama
     1417    /*********************************************************/
     1418
     1419    Toggle_bp = function () {
     1420      options.cl_visible = !options.cl_visible;
     1421      Autosize_resize();
     1422      Wait_Affichage();
     1423
     1424    }
     1425
     1426    //====================================
     1427    //
     1428    //====================================
     1429    Calcul_Image = function () {
     1430      // theImageAndInfos(jaune) -> theImage(vert) -> [llgbo] -> theMainImage
     1431      // + infos_imageInfos(red)
     1432      infos_window = jQuery(window).infos();
     1433      infos_body = jQuery("body").infos(); // thePicturePage
     1434      infos_the_page = jQuery("#the_page").infos();
     1435      // theHeader
     1436      //
     1437      infos_menubar = jQuery("#menubar").infos();
     1438      infos_menubar_dl = jQuery("#menubar dl").infos();
     1439      infos_content = jQuery("#content").infos();
     1440      // imageHeaderBar
     1441      // imageToolBar imageInfoBar
     1442      infos_imageInfoBar = jQuery("#imageInfoBar").infos();
     1443      infos_imageToolBar = jQuery("#imageToolBar").infos();
     1444      //theImageAndTitle
     1445      infos_theImageAndInfos = jQuery("#theImageAndInfos").infos();
     1446      if (infos_theImageAndInfos.width == 0)
     1447        infos_theImageAndInfos = jQuery("#theImageAndTitle").infos();
     1448
     1449      /****************************************/
     1450      infos_theImage = jQuery(theImage_id).infos({ pos_absolute: true });                 // conteneur
     1451      infos_imageInfos = jQuery(imageInfos_id).infos({ pos_absolute: true });             // information
     1452      infos_theMainImage = jQuery(theMainImage_Id).infos({ pos_absolute: true });         // Image   
     1453      // commentContent
     1454      // copyright
     1455
     1456
     1457      pos_top = options.pos_top;
     1458      pos_top = infos_theImage.top;
     1459
     1460      container = {
     1461        height: infos_window.height - pos_top,
     1462        width: infos_content.width
     1463      }
     1464      marge_left = options.marge_left;
     1465      marge_right = options.marge_right;
     1466      marge_top = options.marge_top;
     1467      marge_bottom = options.marge_bottom;
     1468
     1469      //==========================================================
     1470      if (theme.match(RegExp("stripped", "gi"))) {
     1471        infos_the_page.margin.left = 20;  //taille fleche
     1472        infos_the_page.margin.right = 20;
     1473      }
     1474
     1475
     1476      if (theme.match(RegExp("elegant", "gi"))) {
     1477
     1478        jQuery("#imageInfos").css({ position: "absolute", right: 0, top: 0
     1479        });
     1480
     1481        // marge_right += infos_content.general.marges.right;
     1482        if (infos_imageInfos.visible == true) {
     1483          marge_right += infos_imageInfos.general.width; ;
     1484
     1485        } else {
     1486          marge_right += 0;
     1487
     1488        }
     1489
     1490
     1491      } else if (theme.match(RegExp("stripped", "gi"))) {
     1492
     1493      } else if (theme.match(RegExp("simple", "gi"))) {
     1494        if (infos_imageInfoBar.visible == true) {
     1495          marge_right += infos_imageInfoBar.general.width;
     1496
     1497        } else {
     1498          marge_right += 0;
     1499
     1500        }
     1501        marge_left += 2;
     1502
     1503      } else if (theme.match(RegExp("OS", "gi"))) {
     1504
     1505      } else if (theme.match(RegExp("pur", "gi"))) {
     1506        marge_right += 0;
     1507        // marge_right += 25;
     1508
     1509      } else {
     1510        //   jQuery("#menuSwitcher").hide();
     1511
     1512        margeLeft = infos_content.margin.left;
     1513        if (infos_menubar_dl.visible == true) {
     1514          margeLeft += infos_body.general.marges.width + infos_menubar.general.width;
     1515        }
     1516        else
     1517
     1518          margeLeft += infos_thePicturePage.general.marges.width;
     1519        // container.width -= margeLeft;
     1520
     1521
     1522      }
     1523
     1524
     1525      retrait_img = {};
     1526      //========== Format Image ============== 
     1527      retrait_img.height = Math.ceil(options.marges_llgbo || 0)
     1528      + Math.ceil(infos_theMainImage.exterieur.height - infos_theMainImage.height);
     1529      //===============================================================
     1530      retrait_img.width = Math.ceil(infos_theMainImage.exterieur.width - infos_theMainImage.width); // borderwidth+padding
     1531      retrait_img.width += Math.ceil(options.marges_llgbo || 0);
     1532      retrait_img.width += 0;
     1533
     1534      //================== Limite Format Image =====================
     1535      container.height_interne = container.height - marge_top - marge_bottom;
     1536      container.width_interne = container.width - marge_left - marge_right;
     1537
     1538      rapport = Zone_image.rapport_init;
     1539      if (Type_Img == "pamoorama") {
     1540        container.height_interne -= (marge_bottom + marge_top);
     1541      }
     1542      if (options.marges_llgbo > 0) {
     1543        // container.height_interne - = (marge_bottom);
     1544      }
     1545      image_max = {
     1546        height: container.height_interne - retrait_img.height,
     1547        width: container.width_interne - retrait_img.width
     1548      }
     1549      //=========================
     1550      // test débordement
     1551      //=========================
     1552      height_theMainImage = Math.ceil(image_max.height);
     1553      width_theMainImage = Math.ceil(image_max.width);
     1554      if (Type_Img == "pamoorama") {
     1555
     1556      } else {
     1557        height_theMainImage = Math.ceil(width_theMainImage / rapport);
     1558        if (height_theMainImage > container.height_interne) {
     1559          image_max.height = container.height_interne;
     1560          image_max.width = image_max.height * rapport;
     1561          width_theMainImage = Math.ceil(image_max.width);
     1562          height_theMainImage = Math.ceil(image_max.height);
     1563        }
     1564        if (width_theMainImage > container.width_interne) {
     1565          image_max.width = container.width_interne;
     1566          image_max.height = image_max.height / rapport;
     1567          width_theMainImage = Math.ceil(image_max.width);
     1568          height_theMainImage = Math.ceil(image_max.height);
     1569
     1570        } else if (width_theMainImage > container.width) {
     1571
     1572        } else {
     1573
     1574        }
     1575        height_theMainImage = Math.ceil(width_theMainImage / rapport);
     1576      }
     1577      //=================================================
     1578
     1579
     1580      container.height = height_theMainImage + marge_bottom + marge_top;
     1581      bottom = jQuery("#imageInfos").absoluteAll({ pos_absolute: true }).Bottom;
     1582      ps = infos_imageInfos.left;
     1583      ps1 = infos_theImage.left;
     1584      if (ps > infos_theImage.right)
     1585        container.height = Math.max(container.height, infos_imageInfos.general.bottom);
     1586
     1587      container.width = infos_content.width - marge_right - marge_left;
     1588
     1589      affiche_debug({
     1590        Debug3: Debug_info(3, "H:" + container.height + "  img:" + height_theMainImage + " if " + infos_imageInfos.general.bottom, " ext:")
     1591      });
     1592
     1593
     1594      //================================================================
     1595      Zone_image.image = {
     1596        width: width_theMainImage,
     1597        height: height_theMainImage
     1598      };
     1599
     1600      Zone_image.container = {
     1601        width: container.width,
     1602        height: container.height
     1603
     1604      };
     1605      //=================================================================
     1606      Zone_image.src = jQuery(theMainImage_Id).attr("src");
     1607      Zone_image.zoom = Zone_image.image.height / Zone_image.height_init;
     1608    }
     1609
     1610    /*********************************************
     1611    * Calcul l es dimensions.
     1612    *********************************************/
     1613    Get_dimensions = function (force, parametres) {
     1614      if (theImage_init()) {
     1615        infos_theMainImage = jQuery(theMainImage_Id).infos();
     1616        Zone_image.src = infos_theMainImage.src;
     1617      }
     1618      infos_widow = jQuery(window).infos();
     1619      infos_body = jQuery("body").infos();
     1620      var winwidth = infos_body.width;
     1621      var winheight = infos_body.height;
     1622
     1623
     1624      if (typeof rapport == "undefined") return;
     1625      if (force && force == true) old_window.width = 0;
     1626
     1627
     1628      if (infos_theMainImage.useMap.match(RegExp("Autosize", "gi")))
     1629        infos_theMainImage.useMap = "#Autosize";
     1630
     1631      useMap = options.useMap;
     1632
     1633
     1634      if (typeof useMap == "") useMap = "#Autosize";
     1635      if (options.useMap) {
     1636        //  useMap = options.useMap;
     1637      }
     1638      if (useMap) {
     1639        if (!useMap.match(RegExp("Autosize", "gi"))) {
     1640          return;
     1641        }
     1642      }
     1643
     1644      if (options.imageAutosize) {
     1645        return; //stripped
     1646      }
     1647
     1648      if (typeof options.cl_visible == "undefined") return;
     1649      if (!options.cl_visible == true) { return; }
     1650      //======================================================
     1651
     1652      var chk = eval("options." + user_status + "_enabled");
     1653      if (chk == "") { return; }
     1654
     1655      if (!options.useMap.match(RegExp("Autosize", "gi"))) {
     1656
     1657        return;
     1658      }
     1659
     1660      //=================================================================
     1661      Calcul_Image();
     1662      img_finale = { width: Zone_image.image.width, height: Zone_image.image.height };
     1663      //=================================================================
     1664      old_window = jQuery(window).infos();
     1665
     1666      //=================================================================
     1667      switch (Type_Img) {
     1668        case "map":
     1669          Set_Map(true);
     1670          break
     1671        case "panorama":
     1672          if (!theMainImage_Id) {
     1673            theMainImage_Id = theMainImage_id;
     1674            if (theMainImage_Id.length > 0)
     1675              return;
     1676            theMainImage_Id = jQuery().Get_Img_Maxi("#Panorama img[alt]");
     1677
     1678            if (theMainImage_Id.length > 0)
     1679              theMainImage_Id = theMainImage_Id[0];
     1680            else
     1681              theMainImage_Id = jQuery().Get_Img_Maxi("#Panorama img[alt]");
     1682          }
     1683          infos_theImage = jQuery(theMainImage_Id).infos();
     1684          infos_the_page = jQuery("#the_page").infos();
     1685          jQuery("#theImage").height(infos_theImage.height);
     1686          img_finale.height = infos_theImage.height;
     1687          break
     1688        case "img":
     1689
     1690          if (!theMainImage_Id) return;
     1691          if (theme.match(RegExp("luciano", "g"))) {
     1692
     1693          }
     1694
     1695          infos_the_page = jQuery("#the_page").infos();
     1696
     1697
     1698          break
     1699        case "img_autre":
     1700          if (!theMainImage_Id) {
     1701            if (DEBUG_autosize == "true") alert("The_MainImage=null");
     1702            return;
     1703
     1704          }
     1705          infos_theImage = jQuery(theMainImage_Id).infos();
     1706          infos_the_page = jQuery("#the_page").infos();
     1707
     1708
     1709          break
     1710        case "embed":
     1711          //
     1712          if (infos_theMainImage.width == 0)
     1713            infos_theMainImage = jQuery("#thePicturePage").infos();
     1714          if (infos_theMainImage.width == 0)
     1715            infos_theMainImage = jQuery("#the_page").infos();
     1716          infos_theImage = infos_theMainImage;
     1717          infos_the_page = jQuery("#the_page").infos();
     1718          Bandeau_bas.height = Bandeau_bas.top;
     1719
     1720          iph1 = jQuery("#theImage div").infos();
     1721          if ((winheight - iph1.bottom) > 0)
     1722            Bandeau_bas.height = (winheight - iph1.bottom) + 50;
     1723          else
     1724            Bandeau_bas.height = 50;
     1725
     1726
     1727          if (rapport < 0) {
     1728            img_height = infos_theMainImage.height;
     1729            img_width = infos_theMainImage.width;
     1730            img_reelle.height = img_height;
     1731            img_reelle.width = img_width;
     1732          }
     1733
     1734          break
     1735        case "charlie":
     1736          img_reelle = { height: img_height, width: img_width };
     1737          infos_theMainImage = jQuery(theMainImage_Id).infos(); ;
     1738          infos_the_page = jQuery("#the_page").infos();
     1739          if (rapport < 0) {
     1740            img_height = parseInt(infos_theMainImage.height);
     1741            img_width = parseInt(infos_theMainImage.width);
     1742            img_reelle.height = parseInt(infos_theMainImage.height);
     1743            img_reelle.width = parseInt(infos_theMainImage.width);
     1744          }
     1745          break
     1746
     1747
     1748        case "pamoorama":
     1749
     1750          /*
     1751          infos_theImage = jQuery("#pamoorama_outter").infos();
     1752          infos_theImage.height = infos_theImage.height;
     1753          infos_the_page = jQuery("#the_page").infos();
     1754          */
     1755          break
     1756      }
     1757
     1758      img_finale = { width: Zone_image.image.width, height: Zone_image.image.height };
     1759
     1760
     1761      //================= Vérification Taille image minimun autorisée ========
     1762      MinWidth = jQuery(theMainImage_Id).css("minWidth");
     1763      if (MinWidth == "0px")
     1764        MinWidth = options.mini_width;
     1765      MinHeight = jQuery(theMainImage_Id).css("minHeight");
     1766      if (MinHeight == "0px")
     1767        MinHeight = options.mini_height;
     1768
     1769      MaxWidth = jQuery(theMainImage_Id).css("maxWidth");
     1770      if (MaxWidth == "0px")
     1771        MaxWidth = winwidth;
     1772      MaxHeight = jQuery(theMainImage_Id).css("maxHeight");
     1773      if (MaxHeight == "0px")
     1774        MaxHeight = winheight;
     1775
     1776      //=============== Vérification taille minimale  autorizée ======================
     1777      var miniWidth = jQuery(theMainImage_Id).Get_Val_int(MinWidth, options.mini_width);
     1778      var miniHeight = jQuery(theMainImage_Id).Get_Val_int(MinHeight, options.mini_height);
     1779      if (winwidth < options.mini_width2) mini_width2 = winwidth;
     1780
     1781      var miniWidth2 = jQuery(theMainImage_Id).Get_Val_int(MinWidth, options.mini_width2);
     1782      var miniHeight2 = jQuery(theMainImage_Id).Get_Val_int(MinHeight, options.mini_height2);
     1783
     1784
     1785      var maxWidth = jQuery(theMainImage_Id).Get_Val_int(MaxWidth, winwidth, "0");
     1786      maxHeight = jQuery(theMainImage_Id).Get_Val_int(MaxHeight, winheight, "0");
     1787
     1788      mini_width = parseInt(miniWidth);
     1789      mini_height = parseInt(miniHeight);
     1790      img_reelle.width = parseInt(img_reelle.width);
     1791      if (img_reelle.width < mini_width)
     1792        return;
     1793      img_reelle.height = parseInt(img_reelle.height);
     1794      if (img_reelle.height < parseInt(mini_height))
     1795        return;
     1796
     1797
     1798
     1799
     1800      //=================================================
     1801      if (Zone_image.image.height < options.mini_height2)
     1802        Zone_image.image.height = options.mini_height2;
     1803      if (Zone_image.image.width < options.mini_width2)
     1804        Zone_image.image.width = options.mini_width2;
     1805      //==================================================
     1806      //   Image_width largeur à atteindre
     1807      //   Calcul du rapport d'agrandissement
     1808      if (Type_Img != "pamoorama") {
     1809        echelle_max = parseFloat(options.echelle_max, '3');
     1810        if (Zone_image.zoom > 1) {
     1811          theImage_init();
     1812        }
     1813        if (Zone_image.zoom > echelle_max) {
     1814          Zone_image.zoom = echelle_max;
     1815          Zone_image.image.width = parseInt(Zone_image.width_init * Zone_image.zoom);
     1816          if (rapport > 0)
     1817            Zone_image.image.height = parseInt(Zone_image.width_init / rapport);
     1818        }
     1819      }
     1820      img_finale = { width: Zone_image.image.width, height: Zone_image.image.height };
     1821      return true;
     1822
     1823
     1824
     1825
     1826
     1827
     1828
     1829      //===================================================
     1830
     1831      img_finale.height = Image_height;
     1832      img_finale.width = Image_width;
     1833      if (theme.match(RegExp("stripped", "gi"))) {
     1834        img_finale.width -= (llgboframe.top * 2);
     1835        if (rapport > 0) img_finale.height = (img_finale.width / rapport);
     1836        else img_finale.height -= (llgboframe.top * 2);
     1837
     1838      }
     1839      zoom = echelle;
     1840      if (typeof (llgboframe) != "undefined" && llgboframe.height > 0) {
     1841        //=============LLGBO2 ===========================
     1842        t1 = llgboframe;
     1843        if (!theMainImage_Id.src) {
     1844          theMainImage_Id = jQuery(llgbo_id).find("img").get(0)
     1845          if (!theMainImage_Id.src) {
     1846            theMainImage_Id = jQuery("#theImage").find("div").get(0)
     1847          }
     1848        }
     1849        if (theMainImage_Id.src) {
     1850          wingbo = img_finale.width;
     1851          heightgbo = img_finale.height;
     1852          if (Type_Img == "panorama") {
     1853            heightgbo = infos_theImage.height;
     1854            img_finale.height = infos_theImage.height;
     1855          }
     1856
     1857
     1858
     1859
     1860          //    jQuery("#theImage").height(heightgbo + marges_llgbo / 2);
     1861        }
     1862      }
     1863
     1864      //================ Zone affichage =========================
     1865
     1866      //  jQuery("#theImage").css("top", "0px");
     1867      jQuery("#standard").css("top", 0 + "px");
     1868      jQuery("#comments").css("top", 0 + "px");
     1869      //========== Image Remise à l'échelle =======================
     1870
     1871      img_finale.height = parseInt(img_finale.height);
     1872      img_finale.width = parseInt(img_finale.width);
     1873      //=========================================================================
     1874      //=== cadre = theImage
     1875      if (theme.match(RegExp("simple", "gi"))) {
     1876        jQuery("#theImage").width(Zone_Affichage.width); //centrer simple black
     1877        jQuery("#theImage").css({ width: Zone_Affichage.width + "px",
     1878          marginLeft: "auto"
     1879        });
     1880
     1881      } else if (theme.match(RegExp("sobre", "gi")) || theme.match(RegExp("hr_", "gi")) || theme.match(RegExp("Mont", "gi"))) {
     1882        jQuery("#theImage").css({ width: "auto", marginLeft: "auto" });
     1883      } else if (theme.match(RegExp("saruka", "gi"))) {
     1884
     1885        jQuery("#theImage").css({ width: Zone_Affichage.width + "px" });
     1886      } else if (theme.match(RegExp("elegant", "gi"))) {
     1887
     1888        // jQuery("#theImage").css("width", "auto");
     1889        jQuery("#theImage").css({ height: Zone_Affichage.height + "px", width: "auto" }); //conteneur
     1890
     1891      } else {
     1892        jQuery("#theImage").css("width", "auto");
     1893
     1894      }
     1895      // ;
     1896
     1897      if (Type_Img == "panorama" || Type_Img == "pamoorama") {
     1898        img_finale.height = infos_theImage.height;
     1899        Zone_Affichage.height = img_finale.height;
     1900
     1901      }
     1902
     1903      if (typeof (gmaps) != "undefined") {
     1904        Gmap_ = gmaps.maps[0];
     1905        if (Gmap_.sizeMode == 'A') {
     1906          jQuery("#iGMapsIcon").css({ width: old_window.width * 0.8 + "px", height: old_window.height * 0.8 + "px" });
     1907
     1908        }
     1909      }
     1910      //============= flv,mov,mpg  ok
     1911      /* wmv nok
     1912      * avi nok
     1913      //===========================================
     1914      */
     1915      if (Type_Img == "charlie") {
     1916        t1 = jQuery("#charlie").infos();
     1917
     1918        /**/
     1919
     1920        pdf = 0;
     1921        jQuery("#charlie div").each(function (i) {
     1922
     1923
     1924          p1 = jQuery(this).infos();
     1925          pdf += p1.padding.right + p1.padding.left;
     1926        });
     1927        img_finale.width -= pdf;
     1928
     1929        jQuery("#charlie").css({
     1930          width: img_finale.width + pdf + "px",
     1931          height: img_finale.height + "px",
     1932          marginLeft: "auto"
     1933        });
     1934
     1935
     1936        if (MainImage.length > 0) {
     1937          img_finale.height = parseInt(img_finale.width / rapport);
     1938          img_finale.height -= 30;
     1939          img_finale.width = rapport * img_finale.height;
     1940
     1941
     1942          MainImage.width(img_finale.width);
     1943          MainImage.height(img_finale.height);
     1944          jQuery("#embedplayer").width(300);
     1945          jQuery("#embedplayer").height(15);
     1946        } else {
     1947          jQuery("#player").css("width", img_finale.width + "px");
     1948          jQuery("#player").css("height", img_finale.height + "px");
     1949
     1950          jQuery("#embedplayer").css("width", img_finale.width + "px");
     1951          jQuery("#embedplayer").css("height", img_finale.height + "px");
     1952
     1953          jQuery("embed").css({ width: img_finale.width + "px",
     1954            height: img_finale.height + "px"
     1955          });
     1956          jQuery("object").css({ width: img_finale.width + "px",
     1957            height: img_finale.height + "px"
     1958          });
     1959          jQuery("video").css({ width: img_finale.width + "px",
     1960            height: img_finale.height + "px"
     1961          });
     1962
     1963
     1964
     1965          jQuery("video").height(img_finale.height);
     1966          jQuery("video").width(img_finale.width);
     1967
     1968          jQuery("object").width(img_finale.width);
     1969          jQuery("object").height(img_finale.height);
     1970          //jQuery("#theImage").height(img_finale.height + Bandeau_bas.height); //??             
     1971
     1972          jQuery(theMainImage_Id).height(img_finale.height);
     1973          jQuery("#theImage").css("height", "auto");
     1974        }
     1975
     1976
     1977      } else if (Type_Img == "embed") {
     1978
     1979        if (MainImage.length > 0) {
     1980          img_finale.height = parseInt(img_finale.width / rapport);
     1981          img_finale.height -= 30;
     1982          img_finale.width = rapport * img_finale.height;
     1983
     1984
     1985          MainImage.width(img_finale.width);
     1986          MainImage.height(img_finale.height);
     1987          jQuery("#embedplayer").width(300);
     1988          jQuery("#embedplayer").height(15);
     1989        } else {
     1990          jQuery("#theImage").css("height", "auto");
     1991          jQuery("embed").css("height", img_finale.height);
     1992          jQuery("object").css({ height: img_finale.height + "px" });
     1993
     1994          jQuery("object").width(img_finale.width);
     1995          jQuery("object").height(img_finale.height);
     1996        }
     1997
     1998      } else if (Type_Img == "panorama") {
     1999        if (typeof asp_options != "undefined")
     2000          n = asp_options;
     2001        n1 = jQuery("#Panorama div").width();
     2002        jQuery(".panorama-viewport").css("margin", "auto");
     2003        n = infos_imageToolBar;
     2004
     2005
     2006      } else if (Type_Img == "pamoorama") {
     2007        Set_Pamoorama();
     2008
     2009
     2010
     2011
     2012      } else if (theMainImage_Id != null && theMainImage_Id.src) {
     2013        //--- background ?? ---
     2014        jQuery(theMainImage_Id).height(img_finale.height);
     2015        jQuery(theMainImage_Id).width(img_finale.width);
     2016        jQuery(theMainImage_Id).css({ height: img_finale.height + "px ",
     2017          width: img_finale.width + "px "
     2018        });
     2019
     2020
     2021      } else {
     2022        //===map ? luciano ===
     2023        //   jQuery(theMainImage_Id).css({ height: img_finale.height + "px ",  width: img_finale.width + "px });
     2024        //   jQuery(theMainImage_Id).height(img_finale.height );
     2025        //   jQuery(theMainImage_Id).width(img_finale.width );
     2026        //   jQuery(theMainImage_Id).attr({ width: img_finale.width  });
     2027        h = img_finale.height;
     2028        h = Zone_Affichage.height - Zone_Affichage.borderwidth.top - Zone_Affichage.borderwidth.bottom;
     2029        h -= (infos_theImage.borderwidth.bottom + infos_theImage.borderwidth.top);
     2030
     2031        jQuery(theMainImage_Id).attr({ height: h - 3 }); //image
     2032        if (theme.match(RegExp("elegant", "gi"))) {
     2033          return true;
     2034
     2035        }
     2036        if (theme.match(RegExp("luciano", "g"))) {
     2037          imgl = 180;
     2038          l = Zone_Affichage.left;
     2039
     2040          jQuery(".imageNumber").css({ left: l + "px"
     2041
     2042          });
     2043          jQuery("#theImage" + " #theImg IMG").css({ height: img_finale.height + "px ",
     2044            width: (img_finale.width - imgl) + "px ", marginTop: "0px"
     2045          })
     2046        }
     2047
     2048      }
     2049
     2050      var theImg = document.getElementById(theMainImage_Id.replace("#", ""));
     2051      if (theImg) {
     2052        theImg.removeAttribute("width");
     2053        theImg.removeAttribute("height");
     2054        jQuery(theMainImage_Id).css("width", img_finale.width + "px");
     2055      }
     2056
     2057      jQuery("#navThumbPrev").css({ overflow: "hidden" });
     2058      jQuery("#navThumbNext").css({ overflow: "hidden" });
     2059      n = typeof inittoolbar;
     2060      if (Type_Img == "map") {
     2061        jQuery("#navThumbNext").css({ display: 'none' });
     2062        jQuery("#navThumbPrev").css({ display: 'none' });
     2063        jQuery("#theImage").css({ marginTop: infos_imageToolBar.height + "px", marginLeft: "0px",
     2064          width: winwidth + "px",
     2065          height: winheight + "px"
     2066        });
     2067        //mapPicture
     2068      }
     2069      try {
     2070        if (theme.match(RegExp("gally", "gi"))) {
     2071          if (typeof inittoolbar == "function") {
     2072            if (typeof (currentTab) == "undefined") inittoolbar();
     2073            else initializeImageMode("resize");
     2074          } else {
     2075            tp = gallyPP.getImageProp();
     2076            if (typeof (GallyPP) == "function")
     2077              gallyPP = new GallyPP();
     2078
     2079            iph = jQuery("#imageHeaderBar").infos();
     2080            jQuery("#imageToolBar").css({ top: iph.bottom + "px", position: "absolute" });
     2081            jQuery("#theImage").width(winwidth);
     2082          }
     2083          //===========================================================================
     2084          if (jQuery("#navThumbPrev").length > 0) {
     2085            jQuery("#navThumbPrevContainer").css({ left: "0px"
     2086            });
     2087          }
     2088          if (jQuery("#navThumbNext").length > 0) {
     2089            jQuery("#navThumbNextContainer").css({ left: "0px"
     2090            });
     2091          }
     2092          //=============================================================================
     2093          if (!theme.match(RegExp("lapis", "gi"))) {
     2094            if (typeof initializeImageMode == "function") {
     2095              initializeImageMode("resize");
     2096            }
     2097
     2098          }
     2099
     2100        } else if (theme.match(RegExp("simple", "g"))) {
     2101
     2102          jQuery("#imageToolBar").css({ position: "static" });
     2103
     2104          infos_imageInfoBar = jQuery("#imageInfoBar").infos();
     2105          if (infos_imageInfoBar.bottom < infos_theMainImage.bottom) {
     2106            //   jQuery("#imageInfoBar").height(infos_theMainImage.bottom);
     2107          }
     2108
     2109        } else {
     2110
     2111          //    jQuery("#imageToolBar").css("position", "static");
     2112        }
     2113      } catch (e) {
     2114
     2115      }
     2116      zoom = img_finale.height / img_height;
     2117      h0 = jQuery("#content").height();
     2118      if (h0 == null) {
     2119        h0 = winheight - Zone_Affichage.top;
     2120      }
     2121      h1 = (h0 - img_finale.height) / 2;
     2122      //  jQuery("#theImage").css({ marginTop: h1 + "px" });
     2123
     2124      zoom = parseInt(zoom * 100);
     2125      jQuery('#zoom ').val(zoom);
     2126
     2127
     2128
     2129      //  --- réglage de la hauteur de page en fonction du copyright-----------
     2130      infos_copyright = jQuery("#copyright").infos();
     2131
     2132      if (theme.match(RegExp("stripped", "gi"))) {
     2133        var TitleBox = jQuery("#imageTitleContainer");
     2134        if (TitleBox.length != 0) TitleBox.css("width", img_finale.width + "px");
     2135      } else {
     2136
     2137      }
     2138
     2139
     2140      /*
     2141      if (!theme.match(RegExp("luciano", "gi"))) {
     2142      jQuery("#linkNext").css({ height: "80px", width: "200px", overflow: "hidden" });
     2143      jQuery("#linkPrev").css({ height: "80px", width: "200px", overflow: "hidden" });
     2144      jQuery(".navThumb img").css({ height: "80px", width: "", overflow: "hidden" });
     2145      }
     2146      */
     2147      infos_frame = jQuery("#theImage").infos();
     2148      if (theme.match(RegExp("stripped", "gi"))) {
     2149        /*
     2150        infos_theImageBox = jQuery("#theImageAndTitle").infos();
     2151        p1 = jQuery(".randomButtons").infos();
     2152        p2 = jQuery("#imageHeaderBar").infos();
     2153        p3 = infos_content.top;
     2154        p1 = options.imageAutosizeTitle;
     2155
     2156        jQuery("#theImage").width("width", infos_theImageBox.width + "px");
     2157        //jQuery("#theImageAndTitle").css("position", "relative");
     2158        jQuery("#content").css({ position: "relative", top: "10px", marginTop: "0px",
     2159        paddingTop: "0px", textAalign: "center", marginLeft: "auto"
     2160        });
     2161
     2162        jQuery("#theImageAndTitle").css({ position: "relative", top: "0px", marginTop: "0px",
     2163        paddingTop: "0px", marginLeft: "auto"
     2164        }); */
     2165        t1 = infos_theImageBox.top;
     2166        l1 = infos_theImageBox.left;
     2167        // infos_theImageBox = jQuery("#theImage").infos();
     2168
     2169      } else {
     2170
     2171        t1 = infos_frame.top;
     2172        l1 = infos_frame.left;
     2173        infos_theImageBox = jQuery("#theImage").infos(); //theImage
     2174      }
     2175      infos_theImageBox.margin.margin = infos_frame.margin.margin;
     2176      infos_theImageBox.top = t1;
     2177      infos_theImageBox.left = l1;
     2178      //  infos_theImageBox.position = "absolute";
     2179
     2180      Window_Affichage = infos_theImageBox;
     2181      if (DEBUG_autosize == "_true") {
     2182        //   jQuery("#theImage").css("border", "solid green");
     2183
     2184        jQuery("#Debug5").css({ background: "red",
     2185          position: "absolute",
     2186          border: "green solid 2px",
     2187          textAlign: align_auto,
     2188          margin: "auto",
     2189          top: Window_Affichage.top + "px",
     2190          left: Window_Affichage.left + "px",
     2191          width: Window_Affichage.width + "px",
     2192          height: Window_Affichage.height + "px"
     2193        }); //red
     2194        jQuery("#Debug4").css({ top: infos_frame.bottom - infos_description.height + "px" }); //green
     2195      }
     2196
     2197      //Wait_Affichage();
     2198
     2199      return true;
     2200    } // Get_dimensions
     2201
     2202
     2203    var infos_theMainImage = jQuery(theMainImage_Id).infos();          // Image
     2204
     2205    if (infos_theMainImage.width == 0) {
     2206      if (Type_Img == "pamoorama") {
     2207        infos_theMainImage.id = "#theMainImage";
     2208
     2209      } else {
     2210        infos_theMainImage = jQuery("#theImage img").infos();
     2211
     2212      }
     2213      if (infos_theMainImage.id == "")
     2214        jQuery("#theImage img").attr("id", "theMainImage");
     2215      infos_theMainImage = jQuery(theMainImage_Id).infos();
     2216    }
     2217
     2218
     2219
     2220
     2221    var type_size = cookies.typeSave; // xxx
     2222    var useMap = cookies.pictureMap; // #mapxxx
     2223
     2224    var user_status = options.user_status;
     2225    var type_size_maxi = eval("options." + user_status + "_type"); //limite taille
     2226
     2227
     2228    init_gen = function (e) {
     2229
     2230      //============= Gestion Maps ================
     2231      nom_map = "Autosize";
     2232      a_up = jQuery("map[name='" + nom_map + "'] area[rel=up]");
     2233      a_prev = jQuery("map[name='" + nom_map + "'] area[rel=prev]");
     2234      a_next = jQuery("map[name='" + nom_map + "'] area[rel=next]");
     2235
     2236      new_html = '<map name="Autosize" >';
     2237
     2238
     2239      nb_zone = jQuery("div .navigationButtons a").length;
     2240
     2241      Largeur_zone = (infos_theMainImage.width / nb_zone);
     2242      Hauteur_zone = (infos_theMainImage.height);
     2243      init_zone = 0;
     2244      j = 0;
     2245      jQuery("div .navigationButtons a").each(function (e) {
     2246        Hauteur_zone = (infos_theMainImage.height);
     2247        title = jQuery(this).attr("title");
     2248        h_ref = jQuery(this).attr("href");
     2249        init_zone = Largeur_zone * j;
     2250        if (title.match(":")) {
     2251          if (j == 0)
     2252            rel = "prev";
     2253          else
     2254            rel = "next";
     2255        } else {
     2256          rel = "up";
     2257          Hauteur_zone = Hauteur_zone / 4;
     2258        }
     2259        coord = init_zone + "," + 0 + "," + Math.ceil(init_zone + Largeur_zone) + "," + Hauteur_zone;
     2260        new_html += '<area rel="' + rel + '" title="' + title + '" href="' + h_ref + '" shape="rect" coords="' + coord + '" alt="' + title + '" />';
     2261
     2262        j++;
     2263      });
     2264      new_html += '</map>';
     2265      jQuery("#theImage map:last").after(new_html);
     2266      //==================================================
     2267      marges_llgbo = 0;
     2268      options.marges_llgbo = 0;
     2269      if (jQuery(llgbo_id).length > 0) {
     2270        infos_llgbo = jQuery(llgbo_id).infos();
     2271        if (infos_llgbo.visible == true) {
     2272          if (infos_llgbo.height > 0) {
     2273            infos_llgboframe1 = jQuery(llgbo_id + " div:last").infos();
     2274            infos_llgboframe31 = jQuery(llgbo_id + "  div:first").infos();
     2275            //=============================================
     2276            ll2 = infos_llgboframe1.width; // llgboframe1
     2277            ll1 = infos_llgboframe31.general.width; // llgboframe31
     2278            options.marges_llgbo = (ll1 - ll2);
     2279            infos_llgboh2 = jQuery("#llgboh2").infos();
     2280          }
     2281        }
     2282
     2283        marges_llgbo = options.marges_llgbo;
     2284      }
     2285
     2286      //========= Récupération des informations ============= 
     2287
     2288      options.marge_top = 0;
     2289      pAll = jQuery(llgbo_id).absoluteAll({ pos_absolute: true });
     2290      infos_llgbo.top = pAll.Top;
     2291      infos_llgbo.bottom = pAll.Bottom;
     2292      pAll = jQuery(theMainImage_Id).absoluteAll({ pos_absolute: true });
     2293      pos_top = pAll.Top; ;
     2294      pos_bottom = pAll.Bottom; ;
     2295
     2296      if (infos_llgbo.top > 0) {
     2297        pos_top = infos_llgbo.top;
     2298
     2299        options.marge_top = infos_theMainImage.top - infos_theImage.top;
     2300      } else
     2301        pos_top = infos_theImageAndInfos.top;
     2302
     2303
     2304      options.pos_top = pos_top;
     2305
     2306      options.marge_left = infos_theImage.general.marges.left + Math.ceil(options.marge_gauche);
     2307      options.marge_right = infos_theImage.general.marges.right + Math.ceil(options.marge_droite);
     2308      options.marge_top += infos_theImage.general.marges.top + infos_content.general.marges.top + Math.ceil(options.marge_haute);
     2309      options.marge_bottom = Math.ceil(options.marge_basse); // +infos_content.general.marges.bottom; ;
     2310
     2311      old_window = { width: 0, height: 0 };
     2312
     2313
     2314      //=================== Gestion liste photos size ============================
     2315      us = 0;
     2316      type_size = cookies.typeSave; // xxx
     2317      useMap = cookies.pictureMap; // #mapxxx
     2318
     2319      user_status = options.user_status;
     2320      type_size_maxi = eval("options." + user_status + "_type"); //limite taille
     2321      type_size = type_size || type_size_maxi;
     2322      n = 0;
     2323
     2324      var pt = new Array();
     2325      jQuery("#derivativeSwitchBox .switchCheck").css('visibility', 'hidden');
     2326      jQuery("#derivativeSwitchBox a").css('visibility', 'hidden');
     2327
     2328      jQuery("#derivativeSwitchBox a").each(function (i) {
     2329        href_path = jQuery(this).attr("href");
     2330        pt[i] = href_path.split("'");
     2331        tsz = pt[i][5];
     2332        jQuery(this).css('visibility', 'visible');
     2333        //--- recherche limite ---
     2334        if (tsz.match(RegExp(type_size_maxi, "gi"))) {
     2335          return false;
     2336        }
     2337        //--- type en cours ---
     2338        if (tsz.match(RegExp("^" + type_size, "gi"))) {
     2339          us = n;
     2340        }
     2341
     2342        n++;
     2343      });
     2344
     2345      jQuery("derivativeChecked" + options.type_size).css('visibility', 'visible');
     2346      //==== en cours ============
     2347      n = pt.length - 1;
     2348      if (n >= 0) {
     2349        imgSrc = pt[n][1];
     2350        last_map = pt[n][5];  // dernière position
     2351        //=======================================
     2352        imgSrc = pt[us][1];
     2353        last_map = pt[us][5]; // taille selectionné.
     2354        href_path = "javascript:changeImgSrc('" + imgSrc + "', '" + last_map + "', '" + "Autosize" + "')";
     2355
     2356
     2357
     2358        new_html = '<br /><span class="switchCheck" id="derivativeCheckedAutosize" style="visibility:visible" >&#x2714; </span>';
     2359        new_html += '<a id="linkAutosize" href="' + href_path + '">';
     2360        new_html += 'Autosize<span class="derivativeSizeDetails" id="auto_details" > - Autosize</span>  </a>';
     2361        if (!type_size.match(RegExp("Autosize", "gi"))) {
     2362          jQuery("#derivativeSwitchBox br:last").before(new_html);
     2363        }
     2364
     2365        useMap = "#" + type_size_maxi; // #mapxxx
     2366        if (useMap == "#Autosize" && type_size_maxi == "Autosize") {
     2367
     2368        } else {
     2369          useMap = last_map;
     2370        }
     2371
     2372
     2373
     2374
     2375        typeSave = cookies.typeSave; //picturederiv xxx
     2376        options.type_size = useMap.replace("#", "");
     2377
     2378        type_size = options.type_size;
     2379        cookies.pictureMap = "#" + type_size_maxi; // #mapxxx
     2380        cookies.typeSave = type_size_maxi; //picturederiv xxx
     2381        cookies.imgSrc = imgSrc;
     2382        changeImgSrc(imgSrc, last_map, type_size);
     2383      } else {
     2384        type_size_maxi = cookies.pictureMap; // #mapxxx
     2385        type_size_maxi = cookies.typeSave; //picturederiv xxx
     2386        imgSrc = cookies.imgSrc;
     2387        last_map = type_size_maxi;
     2388        href_path = "";
     2389
     2390      }
     2391      affiche_debug({
     2392        Debug1: Debug_info(1, href_path, "href_path:"),
     2393        Debug4: Debug_info(4, "img:" + imgSrc + " last_map: " + last_map + " maxi:" + type_size_maxi, "Init:")
     2394      });
     2395
     2396
     2397    };        //init_gen
     2398    init_gen();
     2399
     2400
     2401  });                                                                                       // ready
     2402
     2403  //===============================================================
     2404  //  Fonctions générales
     2405  //===============================================================
     2406  /******************************************
     2407  *
     2408  ******************************************/
    3142409  Save_cookies = function (parametres) {
    3152410    if (parametres.typeSave) document.cookie = 'picture_deriv=' + parametres.typeSave + ';path="' + "/" + '" ';
     
    3382433  }
    3392434
    340   /********************************************
    341   *  window unLOAD
    342   ********************************************/
    343   jQuery(window).unload(function () {
    344     try {
    345       if (typeof theMainImage_Id != "undefined") {
    346 
    347         useMap = options.useMap;
    348         pictureMap = jQuery.cookie('picture_map');
    349         typeSave = jQuery.cookie('picture_deriv');
    350 
    351         old_img = jQuery.cookie('img');
    352         old_window_height = jQuery.cookie('window_height');
    353         old_window_width = jQuery.cookie('window_width');
    354         old_img_h = jQuery.cookie('img_h');
    355         old_img_w = jQuery.cookie('img_w');
    356         set_cookies({
    357 
    358       });
    359 
    360       if (typeof Window_Affichage != "undefined") {
    361         jQuery.cookie('window_height', Window_Affichage.height, { path: "/" });
    362         jQuery.cookie('window_width', Window_Affichage.width, { path: "/" });
    363       }
    364     }
    365   } catch (r) {
    366 
    367   }
    368 
    369 }); //unload
    370 
    371 
    372 
    373 
    374 /********************************************
    375 *  window LOAD
    376 ********************************************/
    377 jQuery(window).load(function () {
    378   href = location.href;
    379   var aff_ok = false;
    380   if (DEBUG_autosize == "true") {
    381     for (var i = 0; i < 10; i++) {
    382       jQuery('#adddebugs').click();
    383     }
    384     jQuery(jQuery('.debug').get(i - 1)).click();
    385   }
    386 
    387   Autosize_init();
    388   //========================================================= 
    389 
    390   Bandeau_bas = infos_Description_f("#theImage");
    391   if (typeof Bandeau_bas != "undefined") Bandeau = Bandeau_bas.top;
    392   else Bandeau = 0;
    393 
    394 
    395   if (!theImage_init("#theMainImage")) {
    396     Autosize_resize(true, options);
    397     Set_llbgo(true);
    398     Wait_Affichage();
    399   } else {
    400     set_cl(options.useMap.match(RegExp("Autosize", "gi")));
    401     Set_llbgo();
    402   }
    403 
    404 
    405 
    406 
    407   //=================================================================================
    408 }); // window.onload
    409 /***********************************************************
    410 *  RESIZE
    411 ***********************************************************/
    412 jQuery(window).resize(
    413                        function (event, ui) {
    414                          List_autosize_resize(event, ui);
    415                          Autosize_resize(true, options);
    416                          Wait_Affichage();
    417                        });
    418 
    419 /*****************
    420 * changeImgSrc1
    421 ******************/
    422 changeImgSrc = function (url, typeSave, useMap) {
    423   var theImg = document.getElementById(theMainImage_Id.replace("#", ""));
    424   if (theImg) {
    425     theImg.removeAttribute("width");
    426     theImg.removeAttribute("height");
    427     //  theImg.useMap = "#map" + useMap;
    428 
    429     jQuery('#derivativeSwitchBox .switchCheck').css('visibility', 'hidden');
    430     jQuery('#derivativeChecked' + useMap.replace("#", "")).css('visibility', 'visible');
    431     options.useMap = useMap;
    432     if (useMap.match("Autosize")) {
    433       pictureMap = "#" + "Autosize";
     2435
     2436  /*************************************************
     2437  * Recuoère le Type d'mage
     2438  *************************************************/
     2439  Get_type_img = function (e) {
     2440    //====== détection du type d'images ======
     2441    if (jQuery("#charlie").length > 0) {
     2442      Type_Img = "charlie";
     2443    } else if (jQuery("#Panorama").length) {
     2444      Type_Img = "panorama";
     2445    } else if (jQuery("#pamoorama").length) {
     2446      Type_Img = "pamoorama";
     2447    } else if (jQuery("#map").length) {
     2448      Type_Img = "map";
     2449    } else if (jQuery("#Panorama").length) {
     2450      Type_Img = "panorama";
     2451    } else if ((jQuery("#theImage" + " iframe").length + jQuery("#theImage" + " object").length + jQuery("#theImage" + " embed").length) > 0) {
     2452
     2453      if (jQuery("#theImage" + " object").length > 0) {
     2454
     2455        type_src = "object";
     2456
     2457      } else if (jQuery("#theImage" + " embed").length > 0) {
     2458
     2459        type_src = "embed";
     2460
     2461      } else {
     2462
     2463        type_src = "iframe";
     2464      }
     2465      nbf = jQuery("#theImage" + " " + type_src).length;
     2466      frm1 = jQuery("#theImage" + " " + type_src).get(0);
     2467      Type_Img = "charlie";
     2468
     2469      //'fb - xfbml - like - button
     2470
     2471      objs = jQuery("#theImage" + " div").get(0);
     2472      if (jQuery(objs).length > 0) {
     2473        id_0 = jQuery(objs).attr("id");
     2474        if (id_0 == "") {
     2475          jQuery(objs).attr("id", "charlie");
     2476        } else {
     2477          if (nbf > 1) {
     2478            jQuery(frm1).attr("id", "charlie");
     2479          } else {
     2480            Type_Img = "img";
     2481          }
     2482        }
     2483      } else {
     2484        jQuery(frm1).attr("id", "charlie");
     2485      }
     2486
     2487
     2488    } else if (jQuery("#theImage").find("img").length > 0) {
     2489      Type_Img = "img";
     2490    } else if (jQuery("#theImage" + "Box").find("img").length > 0) {
     2491      Type_Img = "img";
     2492      Parent = Parent + "Box";
     2493    } else if (jQuery("img").length > 0) {
     2494      Type_Img = "img_autre";
     2495      return;
    4342496    } else {
    435       pictureMap = "#map" + typeSave;
    436     }
    437     theImg.src = url; // charge Image
    438     theImg.useMap = pictureMap;
    439     infos_theMainImage = jQuery(theMainImage_Id).infos();
    440     infos_theMainImage.useMap = theImg.useMap;
    441     Save_cookies({
    442       typeSave: typeSave,
    443       pictureMap: pictureMap,
    444       imgSrc: url
    445     });
    446     cookies = Get_cookies();
    447 
    448   }
    449 
    450 
    451 }          //changeImgSrc1
    452 /************************************
    453 *
    454 ************************************/
    455 Wait_pamoorama = function () {
    456   if (jQuery("#pamoorama").length) {
    457     mypanorama = window.myPamoorama;
    458     if (!mypanorama) {
    459       tempo = tempo + 1;
    460       if (tempo > 10)
    461         return true;
    462       setTimeout("Wait_pamoorama()", 500);
    463       return false;
    464     }
    465     if (mypanorama.skipInit == false) {
    466       setTimeout("Wait_pamoorama()", 500);
    467       return false;
    468     }
    469     //=============================================================
    470     infos_pamoorama = jQuery("#pamoorama").infos();
    471     if (Math.abs(infos_pamoorama.height) < 50) {
    472       setTimeout("Wait_pamoorama()", 500);
    473       return false;
    474     }
    475     nopano = true;
    476     theMainImage_Id = "#pamoorama";
    477 
    478   }
    479 } // Wait_pamoorama
    480 //====================================================================================
    481 Wait_Affichage = function () {
    482 
    483   if (typeof fade_in == "undefined") fade_in = 1000;
    484   fade_in = parseInt(fade_in);
    485   /*
    486   if (!Autosize_resize()) {
    487   setTimeout("Wait_Affichage()", 500);
    488   return
    489   } 
    490   nu_img++;     
    491   */
    492   if (typeof fade_in == "undefined") fade_in = 0;
    493   if (fade_in == 0) {
    494     jQuery("#theImage").css({ opacity: "1" });
    495     jQuery("#theImg").css({ opacity: "1" });
    496     jQuery("#imageTitleContainer").css({ opacity: "1" });
    497     jQuery("#theImageAndTitle").css({ opacity: "1" });
    498   } else {
    499     jQuery("#theImage").animate({ opacity: "1" },
    500                                                  fade_in, "swing",
    501                                                  function (i) {
    502                                                    jQuery("#theImage").css({ opacity: "1" });
    503                                                    jQuery("#theImg").css({ opacity: "1" });
    504                                                    jQuery("#imageTitleContainer").css({ opacity: "1" });
    505                                                    jQuery("#theImageAndTitle").css({ opacity: "1" });
    506 
    507                                                    if (DEBUG_autosize == "true") {
    508 
    509                                                      nu_img--;
    510                                                      if (nu_img < 1) nu_img = 1;
    511 
    512                                                      bp1 = jQuery('.debug').get(nu_img);
    513                                                      jQuery(bp1).trigger('ON');
    514                                                    }
    515                                                  }
    516                                                );
    517 
    518   }
    519   //   if (nu_img > 1) return;
    520   if (typeof stb != "undefined")
    521     stb.stop().fadeTo(3500, 0);
    522   if (typeof theMainImage_Id == "undefined") return true;
    523 
    524   if (theMainImage_Id.selector) {
    525     theMainImage_Id = theMainImage_Id.selector;
    526   }
    527   if (theMainImage_Id == null) return;
    528 
    529   if (jQuery(theMainImage_Id).length > 0) {
    530     if (typeof img_h == "undefined") {
    531       img_h = jQuery(theMainImage_Id).height();
    532       img_w = jQuery(theMainImage_Id).width();
    533     }
    534 
    535     jQuery("#src_img_h").val(img_h);
    536     jQuery("#src_img_w").val(img_w);
    537     jQuery("#ret_autosize").val(infos_theMainImage.src);
    538     if (typeof Window_Affichage == "undefined") return;
    539     jQuery("#window_height").val(Window_Affichage.height);
    540     jQuery("#window_width").val(Window_Affichage.width);
    541     jQuery("#ret_autosize").trigger('ON', {
    542       width: img_w,
    543       height: img_h,
    544       theImage: theMainImage_Id,
    545       src_img: infos_theMainImage.src,
    546       window_height: Window_Affichage.height,
    547       window_width: Window_Affichage.width
    548     });
    549   }
    550 } // Wait_affichage
    551 
    552 
    553 
    554 
    555 
    556 /***********************
    557 *
    558 **********************/
    559 init_img = function (theImg) {
    560   name_src = theImg.src;
    561   img_init = { width: jQuery(theImg).width(), height: jQuery(theImg).height() }
    562 
    563   if (theImg.naturalWidth)
    564     img_init.width = theImg.naturalWidth;
    565   if (theImg.naturalHeight)
    566     img_init.height = theImg.naturalHeight;
    567 
    568   img_init.rapport = img_init.width / img_init.height;
    569   Zone_image.height_init = img_init.height;
    570   Zone_image.width_init = img_init.width;
    571   Zone_image.rapport = img_init.rapport;
    572 
    573   nu_img = 0;
    574   theMainImage_Id = "#" + theImg.id;
    575   if (typeof Zone_image.src == "undefined") return;
    576   return name_src.match(Zone_image.src);
    577 }
    578 
    579 
    580 /*****************************************************
    581 * recherche la plus grande image (hauteur ou largeur)
    582 *****************************************************/
    583 Get_Img_Maxi = function (myobj) {
    584   var w00 = 0;
    585   var myImg = null;
    586 
    587   img = jQuery(theMainImage_Id);
    588   if (img != null) {
    589     return;
    590 
    591   }
    592   img = jQuery(myobj);
    593 
    594   img = jQuery('img[alt]');
    595 
    596   jQuery(myobj).each(function (i) {
    597     w0 = img_reelle.width;
    598     h0 = img_reelle.height;
    599     if (h0 > w0) w0 = h0;
    600     if (w0 > w00) {
    601       if (!this.src.match(RegExp(".png", "gi")))
    602         if (!this.src.match(RegExp(thumbnail, "g"))) {
    603           myImg = this;
    604           jQuery(myImg).addClass("Image");
    605           w00 = w0;
    606         }
    607 
    608     }
    609   });
    610   return myImg;
    611 } // Get_Img_Maxi
    612 
    613 
    614 /*************************************************************
    615 *
    616 **************************************************************/
    617 infos_entete = function () {
    618   infos_imageToolBar = jQuery("#imageToolBar").infos();
    619   if (typeof (marge_top) != "undefined") return;
    620 
    621   optiontop = 0;
    622   infos_imageInfoBar = jQuery("#imageInfoBar").infos();
    623 
    624   infos_thePicturePage = jQuery("#thePicturePage").infos();
    625   infos_theImage = jQuery("#theImage").infos();
    626   if (theme.match(RegExp("stripped", "gi"))) {
    627     infos_theImageAndTitle = jQuery("#theImageAndTitle").infos();
    628     infos_theImageBox = jQuery("#theImageBox").infos();
    629     optiontop = (marges_llgbo / 2) + infos_theImageAndTitle.margin.top;
    630   }
    631 
    632 
    633 
    634   marge_top = Math.ceil(infos_the_page.top +
    635                                              infos_the_page.borderwidth.top +
    636                                              infos_theImage.borderwidth.top +
    637                                              infos_thePicturePage.margin.top
    638                                              );
    639 
    640   img_top = Math.ceil(infos_theImage.top +
    641                                 infos_theImage.padding.top +
    642                                 infos_theImage.borderwidth.top +
    643                                 infos_thePicturePage.margin.top + optiontop);
    644   result = infos_imageToolBar;
    645   // result.width = "20%";
    646   // result.left = "40%";
    647   result.marge_top = marge_top;
    648   result.img_top = img_top;
    649   //=== Afficher le titre de l'image sur le cadre ===
    650 
    651 
    652   if (infos_llgboh2.top > 0) {
    653     result.img_top = infos_llgboh2.top;
    654 
    655   }
    656   else if (marges_llgbo > 0) {
    657     result.img_top -= (8);
    658   }
    659   return result;
    660 } // infos_entete
    661 /*************************************************
    662 * Récupère les informations sur la description.
    663 *
    664 *************************************************/
    665 infos_Description_f = function () {
    666   // jQuery("#theImage").css({ display: "block" });
    667   //====== détection du type d'images ======
    668   if (jQuery("#charlie").length > 0) {
    669     Type_Img = "charlie";
    670   } else if (jQuery("#Panorama").length) {
    671     Type_Img = "panorama";
    672   } else if (jQuery("#pamoorama").length) {
    673     Type_Img = "pamoorama";
    674   } else if (jQuery("#map").length) {
    675     Type_Img = "map";
    676   } else if (jQuery("#Panorama").length) {
    677     Type_Img = "panorama";
    678   } else if ((jQuery("#theImage" + " iframe").length + jQuery("#theImage" + " object").length + jQuery("#theImage" + " embed").length) > 0) {
    679 
    680     if (jQuery("#theImage" + " object").length > 0) {
    681 
    682       type_src = "object";
    683 
    684     } else if (jQuery("#theImage" + " embed").length > 0) {
    685 
    686       type_src = "embed";
    687 
    688     } else {
    689 
    690       type_src = "iframe";
    691     }
    692     nbf = jQuery("#theImage" + " " + type_src).length;
    693     frm1 = jQuery("#theImage" + " " + type_src).get(0);
    694     Type_Img = "charlie";
    695 
    696     //'fb - xfbml - like - button
    697 
    698     objs = jQuery("#theImage" + " div").get(0);
    699     if (jQuery(objs).length > 0) {
    700       id_0 = jQuery(objs).attr("id");
    701       if (id_0 == "") {
    702         jQuery(objs).attr("id", "charlie");
    703       } else {
    704         if (nbf > 1) {
    705           jQuery(frm1).attr("id", "charlie");
    706         } else {
    707           Type_Img = "img";
    708         }
    709       }
    710     } else {
    711       jQuery(frm1).attr("id", "charlie");
    712     }
    713 
    714 
    715   } else if (jQuery("#theImage").find("img").length > 0) {
    716     Type_Img = "img";
    717   } else if (jQuery("#theImage" + "Box").find("img").length > 0) {
    718     Type_Img = "img";
    719     Parent = Parent + "Box";
    720   } else if (jQuery("img").length > 0) {
    721     Type_Img = "img_autre";
    722     return;
    723   } else {
    724     return;
    725   }
    726   //===============  CHARLIE ==============================
    727   if (jQuery("#charlie").length > 0) {
    728     jQuery("#charlie").css({
    729       paddingTop: "0px",
    730       marginTop: "0px",
    731       paddingBottom: "0px",
    732       marginBottom: "0px"
    733     });
    734 
    735   }
    736   //================ LLGBO ======================
    737   marges_llgbo = 0;
    738   options.marges_llgbo = 0;
    739   if (jQuery(llgbo_id).length > 0) {
    740     infos_llgbo = jQuery(llgbo_id).infos();
    741     if (infos_llgbo.visible == true) {
    742       if (infos_llgbo.height > 0) {
    743         infos_llgboframe1 = jQuery(llgbo_id + " div:last").infos();
    744         infos_llgboframe31 = jQuery(llgbo_id + "  div:first").infos();
    745         //=============================================
    746         ll2 = infos_llgboframe1.width; // llgboframe1
    747         ll1 = infos_llgboframe31.general.width; // llgboframe31
    748         options.marges_llgbo = (ll1 - ll2);
    749         infos_llgboh2 = jQuery("#llgboh2").infos();
    750       }
    751     }
    752     jQuery(llgbo_id).trigger("ON");
    753     marges_llgbo = options.marges_llgbo;
    754   }
    755 
    756   //  Bandeau_t = infos_entete();
    757   //  Bandeau = Bandeau_t.img_top;
    758   infos_theImgContainer = jQuery("#" + "theImgContainer").infos();
    759   infos_description = jQuery("#" + "description").infos();
    760   //=============================================================================
    761 
    762 
    763 
    764   if (theme.match(RegExp("luciano", "g"))) {
    765 
    766 
    767 
    768 
    769   } else if (Type_Img == "map") {
    770 
    771     infos_map = jQuery("#mapPicture").infos();
    772     marge_left = infos_map.width;
    773 
    774     jQuery("#map").css({ left: marge_left + "px", padding: "0px",
    775       marginLeft: "0px",
    776       marginRight: "4px",
    777       marginTop: "0px",
    778       marginBottom: "0px",
    779       position: "relative"
    780     });
    781 
    782     theMainImage_Id = "#map";
    783     infos_theMainImage = jQuery(theMainImage_Id).infos();
    784 
    785 
    786   } else if (jQuery("#charlie").length > 0) {
    787     infos_charlie = jQuery("#charlie").infos();
    788     obj_charlie = jQuery("object");
    789     try {
    790       tp = obj_charlie.attr();
    791     } catch (e) {
    792       tp = obj_charlie.prop();
    793     }
    794 
    795     if (tp != undefined) {
    796       if (obj_charlie.length > 0)
    797         tp = jQuery("object").attr("type") || jQuery("object").prop("type");
    798       else
    799         tp = jQuery("embed").attr("type") || jQuery("embed").prop("type");
    800     }
    801 
    802     if (tp == 'application/x-shockwave-flash') {
    803       jQuery("#charlie").css({
    804         paddingTop: "0px",
    805         marginTop: "0px",
    806         paddingBottom: "30px",
    807         marginBottom: "0px"
    808       });
    809     } else {
    810 
    811     }
    812 
    813     var MainImage = jQuery(theMainImage_Id);
    814 
    815     if (MainImage.length == 0) {
    816       theMainImage_Id = "#charlie";
    817       infos_theMainImage = jQuery(theMainImage_Id).infos();
    818     } else {
    819 
    820       infos_theMainImage = jQuery(theMainImage_Id).infos();
    821 
    822     }
    823 
    824 
    825   } else if (jQuery("#theImage" + " embed").length > 0) {
    826     if (jQuery(theMainImage_Id).lenght == 0) {
    827       theMainImage_Id = "#theImage" + " embed";
    828       infos_theMainImage = jQuery(theMainImage_Id).infos();
    829       jQuery("#theImage" + " embed").width({ width: infos_theMainImage.width + "px", height: infos_theMainImage.height + "px" });
    830     } else {
    831 
    832       infos_theMainImage = jQuery(theMainImage_Id).infos();
    833       Type_Img == "charlie"
    834       if (infos_theMainImage.width == 0) {
    835 
    836         infos_theMainImage = jQuery(theMainImage_Id).infos();
    837 
    838       }
    839     }
    840 
    841   } else if (Type_Img == "pamoorama") {
    842     if (!nopano) {
    843       Wait_pamoorama();
    844 
    845     }
    846     infos_theMainImage = jQuery(theMainImage_Id).infos();
    847     infos_footer = jQuery("#pamoorama_footer").infos();
    848     infos_theMainImage.height += parseInt(infos_theMainImage.height) + parseInt(infos_footer.height);
    849 
    850   } else {
    851     if (jQuery(theMainImage_Id).length == 0) {
    852       theMainImage_Id = "#theImage" + " img[alt]";
    853     } else {
    854 
    855     }
    856 
    857 
    858     if (!theMainImage_Id)
    859       theMainImage_Id = "#theImage";   // sans img ??
    860 
    861 
    862   }
    863   //=====================================================================================
    864   infos_theMainImage = jQuery(theMainImage_Id).infos();
    865 
    866   switch (infos_theMainImage.position) {
    867     case "relative":
    868       break;
    869     case "static":
    870       break;
    871     case "absolute":
    872       break;
    873     case "":
    874       break;
    875     default:
    876       break;
    877   }
    878 
    879   infos_description.marge = {
    880     bottom: infos_theMainImage.padding.bottom + infos_theMainImage.margin.bottom + infos_theMainImage.borderwidth.bottom,
    881     top: infos_theMainImage.padding.top + infos_theMainImage.borderwidth.top + infos_theMainImage.margin.top
    882   }
    883 
    884   if (infos_llgbo.height > 0) infos_theMainImage = infos_llgbo; // format de l'image+largeur du cadre
    885 
    886   if (theme.match(RegExp("luciano", "g"))) {
    887 
    888     infos_theImgContainer = jQuery(theImageAndInfos_id).infos();
    889     infos_description.bottom = jQuery("#imageInfo").infos().top;
    890     infos_description.top = infos_theImgContainer.bottom;
    891     infos_slidshowToolBar = jQuery("#slidshowToolBar").infos();
    892 
    893     if (infos_slidshowToolBar.height > 0) {
    894       correction = (infos_slidshowToolBar.height);
    895       infos_description.top = infos_theMainImage.bottom;
    896       infos_description.bottom = jQuery("#copyright").infos().top;
    897     }
    898 
    899     //=========================================================
    900   } else if (theme.match(RegExp("stripped", "gi"))) {
    901     //options.imageAutosize
    902     //options.imageMargin
    903 
    904     infos_content = jQuery("#content").infos();
    905     if (options.imageAutosizeTitle == false) {
    906       infos_description.top = infos_theImageBox.bottom;
    907 
    908       infos_description.bottom = infos_HeaderBar.margin.top + infos_description.top +
    909                                             infos_description.borderwidth.top +
    910                                             infos_description.borderwidth.bottom +
    911                                               options.imageAutosizeMargin * 2 +
    912                                             (marges_llgbo / 2) + 4;
    913 
    914     } else {
    915 
    916 
    917       infos_description.top = infos_theImageBox.bottom -
    918                                 infos_content.top +
    919                                 options.imageAutosizeMargin * 2 +
    920                                 (marges_llgbo / 2)
    921                                         ;
    922       infos_description.bottom = jQuery("#tabZone").infos().top +
    923                                 infos_theImageAndTitle.margin.top;
    924       if (msie == true) infos_description.bottom -= 4;
    925     };
    926     check_desc_v = true;
    927 
    928   } else {
    929     if (theme.match(RegExp("sobre", "gi"))) {
    930       infos_description.marge.top = -2;
    931     }
    932     infos_description.bottom = infos_theImage.bottom; //482
    933     infos_description.top = infos_theMainImage.height + infos_theImage.top; //410+62
    934     // infos_description.bottom -= infos_theMainImage.top;
    935   }
    936   //
    937 
    938   infos_description.height = infos_description.bottom - infos_description.top;
    939 
    940   if (options.check_desc_v == false) {
    941     infos_description.height = 0;
    942   }
    943 
    944   Debug_pos();
    945 
    946   //options.cl_visible=false ;
    947   return infos_description;
    948 } //infos_Description_f
    949 
    950 //=======================================================================================
    951 Debug_info = function (index, infos, nom) {
    952   if (infos.height > 0) {
    953     message = browser.browser + " -- > Info : " + nom + " " + infos.id + "\n" +
    954                          "Info nodeName: " + infos.nodeName + "\n" +
    955                          "Info width: " + infos.width + "\n" +
    956                          "Info height: " + infos.height + "\n" +
    957                          "Info top: " + infos.top + "\n" +
    958                          "Info left: " + infos.left + "\n" +
    959                          "Info position: " + infos.position + "\n";
    960     myDebug = { id: "Debug" + index, texte: message,
    961       css: {
    962         color: "black",
    963         opacity: "0.5",
    964         position: "absolute",
    965         height: infos.height || 100 + "px",
    966         width: infos.width || 300 + "px",
    967         left: infos.left || 0 + "px",
    968         border: "solid 1px green",
    969         top: infos.top + "px"
    970       }
    971     }
    972     return myDebug;
    973   } else {
    974     if (typeof old_messages == "undefined") {
    975       old_messages = new Array();
    976 
    977     }
    978     if (infos != "" && infos != "undefined") {
    979       nc0 = old_messages[index];
    980 
    981       if (typeof nc0 != "undefined") {
    982         nc0 = old_messages[index].toString().split("<br />");
    983         if (nc0.length > 3) nc0.shift();
    984 
    985         old_messages[index] = nc0.join("<br />");
    986       }
    987       old_messages[index] += " : " + nom + " -- > " + infos + "<br />";
    988 
    989       message = browser.browser + old_messages[index];
    990 
    991       myDebug = { id: "Debug" + index, texte: message,
    992         css: {
    993           color: "black",
    994           opacity: "1.0",
    995           position: "absolute",
    996           align: "left",
    997           height: 100 + "px",
    998           width: 800 + "px",
    999           left: 300 + "px",
    1000           border: "solid 1px green",
    1001           top: 0 + "px"
    1002         }
    1003       }
    1004     }
    1005 
    1006     return myDebug;
    1007   }
    1008 
    1009 
    1010 }
    1011 //====================================================
    1012 function Debug_pos() {
    1013   return;
    1014   if (DEBUG_autosize == "true") {
    1015 
    1016     jQuery("[id ^='Debug']").show();
    1017     /*
    1018     Debug2  background-color:yellow
    1019     Debug3 background-color:blue
    1020     Debug4 background-color:green
    1021     Debug5 background-color:red
    1022 
    1023     */
    1024 
    1025     affiche_debug({
    1026       Debug1: Debug_info(1, Bandeau_t, "Bandeau_t"),
    1027       Debug4: Debug_info(4, infos_description, "infos_description"),
    1028       Debug5: Debug_info(5, infos_theMainImage, "infos_theMainImage")
    1029     });
    1030   }
    1031 }
    1032 //==========================================================
    1033 affiche_debug = function (aff_infos) {
    1034   jQuery(jQuery("[id ^='Debug']")).each(function (i) {
    1035     if (aff_infos[this.id]) {
    1036       if (aff_infos[this.id].css) {
    1037         jQuery("#" + this.id).css(aff_infos[this.id].css);
    1038         jQuery("#" + this.id).html(aff_infos[this.id].texte);
    1039       }
    1040     }
    1041   });
    1042   return;
    1043 }
    1044 //===========================================
    1045 //
    1046 //===========================================
    1047 Set_Map = function (nds) {
    1048   p0 = jQuery("#map").position();
    1049   if (!p0) return;
    1050 
    1051   infos_map = jQuery("#map").infos();
    1052   // if (infos_map.width == (Zone_image.container.width - p0.left))   return ;
    1053   nds = jQuery("#imageInfos").css("display");
    1054   if (nds != "none") {
    1055     p2 = jQuery("#infoSwitcher").infos();
    1056     p0.left += 35;
    1057   }
    1058   jQuery("#map").width(Zone_image.container.width - p0.left);
    1059   jQuery("#map").css({ position: "absolute", height: Zone_image.container.height + "px" });
    1060 }
    1061 
    1062 jQuery("map [name='mapAutosize'] area").mouseover(function (e) {
    1063   return;
    1064 });
    1065 //=====================================
    1066 //
    1067 //=====================================
    1068 theImage_init = function (Obj) {
    1069   if (jQuery("#derivativeSwitchBox").length > 0) {
    1070     id3 = jQuery("#derivativeCheckedAutosize");
    1071     var pi = jQuery("#derivativeSwitchBox > span ");
    1072     var px = jQuery(".derivativeSizeDetails ");
    1073     i = 0;
    1074     n = 0;
    1075     var pt = new Array();
    1076     jQuery("#derivativeSwitchBox a").each(function (i) {
    1077       href_path = jQuery(this).attr("href");
    1078       if (href_path.match(RegExp("auto", "gi"))) return true;
    1079       pt[i] = href_path.split("'");
    1080     });
    1081     Calcul_Image();
    1082     tw = Zone_image.container.width;
    1083     th = Zone_image.container.height;
    1084     n = 0;
    1085     jQuery(".derivativeSizeDetails").each(function (i) {
    1086       vn = jQuery(this).text().replace("(", "").replace(")", "").split("x");
    1087       h0 = parseInt(vn[1]);
    1088       w0 = parseInt(vn[0])
    1089       if (h0 > th) {
    1090         n = i;
    1091         return false;
    1092       }
    1093       if (w0 > tw) {
    1094         n = i;
    1095         return false;
    1096       }
    1097       n++;
    1098     });
    1099     if (n > pt.length - 1) n = pt.length - 1; // format le plus grand
    1100     if (n < 0) n = 0; // format le plus grand
    1101     if (typeof pt[n] == "undefined") {
    1102 
    1103       n = n - 1
    1104     }
    1105 
    1106     imgSrc = pt[n][1];
    1107     last_map = pt[n][5];
    1108     var theImg = document.getElementById(theMainImage_Id.replace("#", ""));
    1109     if (theImg.useMap.match(RegExp("map", "gi"))) return;
    1110     if (theImg.src.match(RegExp(imgSrc, "gi"))) return;
    1111 
    1112     href_path = "javascript:changeImgSrc('" + imgSrc + "', '" + last_map + "', '" + "#Autosize" + "')";
    1113     jQuery("#linkAutosize").attr("href", href_path);
    1114     changeImgSrc(imgSrc, last_map, "#Autosize");
    1115   }
    1116   return false;
    1117 
    1118 };
    1119 
    1120 //===============================================================
    1121 //  Fonctions générales
    1122 //===============================================================
    1123 Set_llbgo = function (Force) {
    1124   if (Force)
    1125     if (typeof LlgboFr_Resize == "function") LlgboFr_Resize();
    1126   // if (typeof updateXY != "function")      return;
    1127   maps = jQuery("map[name^='map']");
    1128   maps = jQuery("map[name='Autosize']");
    1129   if (maps.length == 0) return;
    1130 
    1131   nom_map = 'Autosize';
    1132   // nom_map = maps[0].name;
    1133   maps = jQuery("map[name='" + nom_map + "']  area");
    1134 
    1135 
    1136   nb_zone = maps.length;
    1137   infos_theMainImage = jQuery(theMainImage_Id).infos();          // Image
    1138   var Largeur_zone = (infos_theMainImage.width / nb_zone);
    1139   var Hauteur_zone = (infos_theMainImage.height);
    1140   var init_zone = 0;
    1141   j = 0;
    1142   maps.each(function (e) {
    1143     init_zone = Largeur_zone * j;
    1144     rel = jQuery(this).attr("rel");
    1145     title = jQuery(this).attr("title");
    1146     alt = jQuery(this).attr("alt");
    1147     H = Hauteur_zone;
    1148     if (rel == "up") {
    1149       H = Hauteur_zone / 4;
    1150     }
    1151     coord = { x0: init_zone, y0: 0, x1: Math.ceil(init_zone + Largeur_zone), y1: Hauteur_zone };
    1152     jQuery(this).attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" });
    1153     j++;
    1154   });
    1155 
    1156   return;
    1157 }
    1158 
    1159 /*************************************************
    1160 * correction pamoorama
    1161 *************************************************/
    1162 Set_Pamoorama = function () {
    1163   if (Type_Img == "pamoorama") {
    1164     if (typeof myPamoorama == "undefined") {
    11652497      return;
    11662498    }
    1167 
    1168     Calcul_Image();
    1169     infos_pamoorama = jQuery("#pamoorama").infos();
    1170     infos_pamoorama_outter = jQuery("#pamoorama_outter").infos();
    1171     infos_pamoorama_inner = jQuery("#pamoorama_inner").infos();
    1172     infos_pamoorama_footer = jQuery("#pamoorama_footer").infos();
    1173     infos_pamoorama_frame = jQuery("#pamoorama_frame").infos();
    1174     infos_frame = jQuery(myPamoorama.frame).infos();
    1175 
    1176 
    1177     //====================================================
    1178     jQuery("#pamoorama").css({
    1179       marginLeft: "auto",
    1180       marginRight: "auto"
    1181       //  height: Zone_Affichage.height + "px" , sinon déclenchement panorama sur la hauteur;
    1182     });
    1183 
    1184     infos_pamoorama_inner = jQuery("#pamoorama_inner").infos();
    1185     infos_pamoorama = jQuery("#pamoorama").infos();
    1186 
    1187 
    1188 
    1189 
    1190     marges_w = infos_pamoorama.borderwidth.left +
    1191                           infos_pamoorama.margin.left +
    1192                           infos_pamoorama.borderwidth.right +
    1193                           infos_pamoorama.margin.right;
    1194 
    1195     marges_h = 10 +
    1196                           infos_pamoorama.borderwidth.top +
    1197                           infos_pamoorama.margin.top +
    1198                           infos_pamoorama.borderwidth.bottom +
    1199                           infos_pamoorama.margin.bottom;
    1200     marges_h += infos_pamoorama_footer.borderwidth.top +
    1201                           infos_pamoorama_footer.margin.top +
    1202                           infos_pamoorama_footer.borderwidth.bottom +
    1203                           infos_pamoorama_footer.margin.bottom;
    1204 
    1205     jQuery("#pamoorama").css({
    1206       width: ""
    1207     });
    1208 
    1209     outter_height = Zone_image.container.height - infos_pamoorama_footer.height - marges_h;
    1210     Zoom_pano = outter_height / Zone_image.height_init;
    1211 
    1212     new_image = { height: Math.ceil(Zone_image.height_init * Zoom_pano),
    1213       width: Math.ceil(Zone_image.width_init * Zoom_pano)
     2499  }
     2500
     2501  //====================================
     2502  //
     2503  //====================================
     2504  set_cl = function (Valid) {
     2505    if (typeof Valid == "undefined") Valid = options.useMap.match(RegExp("Autosize", "gi")) || false;
     2506    if (typeof options.cl_visible == "undefined") return;
     2507    if (typeof src1 == "undefined") return;
     2508
     2509    if (options.cl_visible) src = src1;
     2510    else src = src2;
     2511
     2512    if (options.cl_visible) {
     2513      src_info = src3;
     2514      src_infos_1 = src3;
     2515    } else {
     2516      src_info = src4;
     2517      src_infos_1 = src5;
    12142518    }
    12152519
    1216     jQuery("#pamoorama_inner").css({ width: new_image.width, height: new_image.height, "background-size": "100%"
    1217     });
    1218 
    1219     //  jQuery("#pamoorama_inner").width(Zone_image.width_init * Zoom_pano);
    1220     //  jQuery("#pamoorama_inner").height(Zone_image.height_init * Zoom_pano);
    1221 
    1222 
    1223     //---------- test largeur image
    1224     new_width = Zone_image.container.width;
    1225     if (new_width > new_image.width) {
    1226       new_width = new_image.width;
    1227       jQuery("#pamoorama_outter").css({
    1228         position: 'absolute',
    1229         align: "center",
    1230         margin: "auto"
    1231       });
    1232     }
    1233     outter_width = new_width;
    1234 
    1235 
    1236     //  jQuery("#pamoorama_thumb").width(200 /  Zone_image.zoom);
    1237 
    1238     jQuery("#pamoorama_outter").css({
    1239 
    1240       align: 'center',
    1241       margin: 'auto',
    1242       width: outter_width + "px",
    1243       height: outter_height + "px"
    1244     });
    1245     //============= Mise à l'echelle ==================
    1246     jQuery("#pamoorama_footer").css({
    1247       width: Zone_image.container.width + "px"
    1248     });
    1249 
    1250     window.myPamoorama.options.width = Math.ceil(Zone_image.container.width);
    1251     //==================================================================
    1252     new_max_left = new_image.width - outter_width;
    1253     //   jQuery(window.myPamoorama.inner).width(Zone_image.width_init* Zoom_pano);
    1254     //    jQuery(window.myPamoorama.inner).height(Zone_image.height_init * Zoom_pano);
    1255 
    1256 
    1257     window.myPamoorama.outter.scrollTo(new_max_left, 0);
    1258 
    1259     window.myPamoorama.autoScrollFx.to = new Array(new_max_left, 0);
    1260     window.myPamoorama.ratio = Math.ceil(new_image.width / 200);
    1261     window.myPamoorama.imageWidth = new_image.width;
    1262     window.myPamoorama.imageHeight = new_image.height;
    1263     nf = jQuery("#pamoorama_thumb").height();
    1264     jQuery("#pamoorama_thumb img").width(200);
    1265     jQuery("#pamoorama_thumb img").height(nf);
    1266     // 200=window.myPamoorama.width
    1267     // frame = Zone_image.container.width
    1268 
    1269     nw = (window.myPamoorama.image.width * Zone_image.container.width) / window.myPamoorama.imageWidth;
    1270     jQuery("#pamoorama_frame").width(nw);
    1271     jQuery("#pamoorama").css({
    1272       width: "auto", height: "auto"
    1273     });
    1274 
    1275   } // test img
    1276 } // Set_Pamoorama
    1277 /*********************************************************/
    1278 
    1279 Toggle_bp = function () {
    1280   options.cl_visible = !options.cl_visible;
    1281   Autosize_resize();
    1282   Wait_Affichage();
    1283 
    1284 }
    1285 //====================================
    1286 //
    1287 //====================================
    1288 set_cl = function (Valid) {
    1289   if (typeof Valid == "undefined") Valid = options.useMap.match(RegExp("Autosize", "gi")) || false;
    1290 
    1291   if (typeof options.cl_visible == "undefined") return;
    1292   if (typeof src1 == "undefined") return;
    1293 
    1294   if (options.cl_visible) src = src1;
    1295   else src = src2;
    1296 
    1297   if (options.cl_visible) {
    1298     src_info = src3;
    1299     src_infos_1 = src3;
    1300   }
    1301   else {
    1302     src_info = src4;
    1303     src_infos_1 = src5;
    1304   }
    1305   if (Valid) {
    1306     if (typeof Zone_image.image != "undefined") {
     2520    if ((typeof Zone_image != "undefined") && typeof Zone_image.image != "undefined" && Valid) {
    13072521      Zone_image.zoom = (Zone_image.image.height / Zone_image.height_init);
    13082522      zoom_cl = parseInt(100 * Zone_image.zoom);
     
    13202534        color_back = color_back.split("(")[1].split(")")[0].split(",");
    13212535        color_back = "rgb(" + Math.abs(255 - color_back[0]) + ","
    1322       + Math.abs(255 - color_back[1]) + ","
    1323       + Math.abs(255 - color_back[2]) + ")";
    1324 
     2536                + Math.abs(255 - color_back[1]) + ","
     2537                + Math.abs(255 - color_back[2]) + ")";
    13252538      }
    13262539      else if (color_back.match(new RegExp("#", "gi")))
     
    13282541      else
    13292542        color_back = jQuery('body').css("color");
    1330 
    1331 
    13322543      jQuery('#bp_cla span').css("color", color_back);
     2544      jQuery('#auto_details').text(" (" + Zone_image.image.width + " x " + Zone_image.image.height + ")");
     2545
     2546      //===============================================
     2547    } else {
     2548      src = src6;
     2549      jQuery('#auto_details').text("");
    13332550    }
    1334   } else {
    1335     src = src6;
     2551    bp_scr = jQuery('#bp_img_cla');
     2552    if (bp_scr.length > 0) {
     2553      src_enc = bp_scr.attr("src");
     2554      if (!src_enc.match(src)) {
     2555        bp_scr.get(0).src = src;
     2556        jQuery('#bp_img_cla').attr('alt', src_info);
     2557        jQuery('#bp_img_cla').attr('title', src_info);
     2558      }
     2559    }
     2560
    13362561  }
    1337   if (Zone_image.image)
    1338     jQuery('#auto_details').text(" (" + Zone_image.image.width + " x " + Zone_image.image.height + ")");
    1339   bp_scr = jQuery('#bp_img_cla');
    1340 
    1341   if (bp_scr.length > 0) {
    1342     src_enc = bp_scr.attr("src");
    1343     if (!src_enc.match(src)) {
    1344       bp_scr.get(0).src = src;
    1345       jQuery('#bp_img_cla').attr('alt', src_info);
    1346       jQuery('#bp_img_cla').attr('title', src_info);
     2562  /********************************
     2563  *
     2564  *********************************/
     2565
     2566  Set_llbgo = function (Force) {
     2567    if (Type_Img == "pamoorama") {
     2568
    13472569    }
    1348   }
    1349 }
    1350 //====================================
    1351 //
    1352 //====================================
    1353 Calcul_Image = function () {
    1354   // theImageAndInfos(jaune) -> theImage(vert) -> [llgbo] -> theMainImage
    1355   // + infos_imageInfos(red)
    1356   infos_window = jQuery(window).infos();
    1357   infos_body = jQuery("body").infos(); // thePicturePage
    1358   infos_the_page = jQuery("#the_page").infos();
    1359   // theHeader
    1360   //
    1361   infos_menubar = jQuery("#menubar").infos();
    1362   infos_menubar_dl = jQuery("#menubar dl").infos();
    1363   infos_content = jQuery("#content").infos();
    1364   // imageHeaderBar
    1365   // imageToolBar imageInfoBar
    1366   infos_imageInfoBar = jQuery("#imageInfoBar").infos();
    1367   infos_imageToolBar = jQuery("#imageToolBar").infos();
    1368   //theImageAndTitle
    1369   infos_theImageAndInfos = jQuery("#theImageAndInfos").infos();
    1370   if (infos_theImageAndInfos.width == 0)
    1371     infos_theImageAndInfos = jQuery("#theImageAndTitle").infos();
    1372   infos_theImage = jQuery("#theImage").infos();
    1373   /****************************************
    1374   * marginl r 10 10,borderwidth 5 5, padding 10 10
    1375   * infos_theImage width 849 , (+padding) out 869,(+border) ext 879 ,(+marge) general 899
    1376   * general marges width 50 l25+r25,
    1377   ****************************************/
    1378 
    1379   infos_imageInfos = jQuery("#imageInfos").infos();
    1380   infos_theMainImage = jQuery(theMainImage_Id).infos();         // Image
    1381   infos_theMainImage.src = jQuery(theMainImage_Id).attr("src");
    1382 
    1383   // commentContent
    1384   // copyright
    1385 
    1386   pos_top = options.pos_top;
    1387   pos_top = options.pos_top + infos_llgbo.top
    1388 
    1389   container = {
    1390     height: infos_window.height - pos_top,
    1391     width: infos_content.width
    1392   }
    1393   marge_left = infos_theImage.general.marges.left;
    1394   marge_right = infos_theImage.general.marges.right;
    1395   marge_top = infos_theImage.general.marges.top + infos_content.general.marges.top + 2;
    1396   marge_bottom = infos_theImage.general.marges.bottom + Math.ceil(options.marge_basse) + infos_content.general.marges.bottom; ;
    1397 
    1398   //==========================================================
    1399   if (theme.match(RegExp("stripped", "gi"))) {
    1400     infos_the_page.margin.left = 20;  //taille fleche
    1401     infos_the_page.margin.right = 20;
    1402   }
    1403 
    1404 
    1405   if (theme.match(RegExp("elegant", "gi"))) {
    1406     jQuery("#imageInfos").css({ position: "absolute", right: 0, margin: "auto"
    1407       , top: 0
     2570    if (Force)
     2571      if (typeof LlgboFr_Resize == "function") {
     2572
     2573        LlgboFr_Resize();
     2574      }
     2575
     2576
     2577    // if (typeof updateXY != "function")      return;
     2578    maps = jQuery("map[name^='map']");
     2579    maps = jQuery("map[name='Autosize']");
     2580    if (maps.length == 0) return;
     2581
     2582    nom_map = 'Autosize';
     2583    // nom_map = maps[0].name;
     2584    maps = jQuery("map[name='" + nom_map + "']  area");
     2585
     2586
     2587    nb_zone = maps.length;
     2588
     2589    infos_theMainImage = jQuery(theMainImage_Id).infos();          // Image
     2590    var Largeur_zone = (infos_theMainImage.width / nb_zone);
     2591    var Hauteur_zone = (infos_theMainImage.height);
     2592    var init_zone = 0;
     2593    j = 0;
     2594    maps.each(function (e) {
     2595      init_zone = Largeur_zone * j;
     2596      rel = jQuery(this).attr("rel");
     2597      title = jQuery(this).attr("title");
     2598      alt = jQuery(this).attr("alt");
     2599      H = Hauteur_zone;
     2600      if (rel == "up") {
     2601        H = Hauteur_zone / 4;
     2602      }
     2603      coord = { x0: init_zone, y0: 0, x1: Math.ceil(init_zone + Largeur_zone), y1: Hauteur_zone };
     2604      jQuery(this).attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" });
     2605      j++;
    14082606    });
    1409 
    1410 
    1411     // marge_right += infos_content.general.marges.right;
    1412     if (infos_imageInfos.visible == true) {
    1413       marge_right += infos_imageInfos.width + 2;
    1414 
    1415     } else {
    1416       marge_right += 15;
    1417 
    1418     }
    1419     marge_left += 5;
    1420     marge_top += 20;
    1421 
    1422   } else if (theme.match(RegExp("stripped", "gi"))) {
    1423 
    1424   } else if (theme.match(RegExp("simple", "gi"))) {
    1425 
    1426 
    1427   } else if (theme.match(RegExp("OS", "gi"))) {
    1428 
    1429   } else if (theme.match(RegExp("pur", "gi"))) {
    1430 
    1431     marge_right += 25;
    1432 
    1433   } else {
    1434     //   jQuery("#menuSwitcher").hide();
    1435 
    1436     margeLeft = infos_content.margin.left;
    1437     if (infos_menubar_dl.visible == true) {
    1438       margeLeft += infos_body.general.marges.width + infos_menubar.general.width;
    1439     }
    1440     else
    1441 
    1442       margeLeft += infos_thePicturePage.general.marges.width;
    1443     // container.width -= margeLeft;
    1444 
    1445 
    1446   }
    1447 
    1448 
    1449 
    1450   //========== Format Image ============== 
    1451   retrait_img_h = Math.ceil(options.marges_llgbo || 0)
    1452       + infos_theMainImage.general.marges.height
    1453      ;
    1454   //===============================================================
    1455   retrait_img = Math.ceil(infos_theMainImage.general.marges.width);
    1456   retrait_img += Math.ceil(options.marges_llgbo || 0);
    1457   retrait_img += 0;
    1458 
    1459   //================== Limite Format Image =====================
    1460   image_max = {
    1461     height: container.height - marge_top - marge_bottom - retrait_img_h,
    1462     width: container.width - marge_left - marge_right - retrait_img
    1463   }
    1464   //================================================================
    1465   if (typeof Zone_image.height_init == "undefined") {
    1466     init_img(theImg);
    1467     Zone_image.width_init = img_init.width;
    1468     Zone_image.height_init = img_init.height;
    1469     Zone_image.height_init = Math.ceil(img_init.height);
    1470     Zone_image.rapport_init = Math.ceil(img_init.width / Zone_image.height_init);
    1471     rapport = Zone_image.rapport_init;
    1472   }
    1473 
    1474   theMainImage_str = theMainImage_Id.replace("#", "");
    1475   useMap_en_cours = jQuery(theMainImage_Id).attr("useMap");
    1476 
    1477   var theImg = document.getElementById(theMainImage_str);
    1478   if (theImg) {
    1479     if (useMap_en_cours.match(RegExp("map", "gi"))) {
    1480       image_max.height = jQuery(theImg).height() - retrait_img_h;
    1481       image_max.width = jQuery(theImg).width() - retrait_img;
    1482       width_theMainImage = image_max.width;
    1483       height_theMainImage = image_max.height;
    1484     } else {
    1485       //=========================
    1486       // test débordement
    1487       //=========================
    1488       rapport = Zone_image.rapport_init;
    1489       width_theMainImage = Math.ceil(image_max.width);
    1490       height_theMainImage = Math.ceil(width_theMainImage / rapport);
    1491 
    1492       container.height_interne = container.height - marge_top - marge_bottom;
    1493       container.width_interne = container.width - marge_left - marge_right;
    1494 
    1495       if (height_theMainImage > container.height_interne) {
    1496         image_max.height = container.height_interne;
    1497         image_max.width = image_max.height * rapport;
    1498         width_theMainImage = Math.ceil(image_max.width);
    1499         height_theMainImage = Math.ceil(image_max.height);
    1500       }
    1501       if (width_theMainImage > container.width_interne) {
    1502         image_max.width = container.width_interne;
    1503         image_max.height = image_max.height / rapport;
    1504         width_theMainImage = Math.ceil(image_max.width);
    1505         height_theMainImage = Math.ceil(image_max.height);
    1506 
    1507       } else if (width_theMainImage > container.width) {
    1508 
    1509       } else {
    1510 
    1511       }
    1512     }
    1513     //===============================================================
    1514   }
    1515   if (Type_Img != "pamoorama") {
    1516 
    1517   }
    1518 
    1519   //=================================================
    1520   rapport = Zone_image.rapport_init;
    1521 
    1522   height_theMainImage = Math.ceil(width_theMainImage / rapport);
    1523   container.height = height_theMainImage + retrait_img_h + infos_theImage.general.marges.top + pos_top;
    1524 
    1525   //================================================================
    1526   Zone_image.image = {
    1527     width: width_theMainImage,
    1528     height: height_theMainImage
    1529   };
    1530 
    1531   Zone_image.container = {
    1532     width: container.width,
    1533     height: container.height
    1534 
    1535   };
    1536   //=================================================================
    1537 
    1538   Zone_image.src = jQuery(theMainImage_Id).attr("src");
    1539 
    1540 
    1541   Zone_image.zoom = Zone_image.image.height / Zone_image.height_init;
    1542 
    1543 }
    1544 
    1545 /*********************************************
    1546 * Calcul l es dimensions.
    1547 *********************************************/
    1548 Get_dimensions = function (force, parametres) {
    1549   infos_theMainImage = jQuery(theMainImage_Id).infos();
    1550   Zone_image.src = infos_theMainImage.src;
    1551   if (typeof rapport == "undefined") return;
    1552   if (force && force == true) old_window.width = 0;
    1553 
    1554 
    1555   if (infos_theMainImage.useMap.match(RegExp("Autosize", "gi")))
    1556     infos_theMainImage.useMap = "#Autosize";
    1557 
    1558   useMap = options.useMap;
    1559 
    1560   if (theme.match("simple")) useMap = "#Autosize";
    1561   if (typeof useMap == "") useMap = "#Autosize";
    1562   if (options.useMap) {
    1563     //  useMap = options.useMap;
    1564   }
    1565   if (useMap) {
    1566     if (!useMap.match(RegExp("Autosize", "gi"))) {
    1567       return;
    1568     }
    1569   }
    1570 
    1571   if (options.imageAutosize) {
    1572     return; //stripped
    1573   }
    1574 
    1575   if (typeof options.cl_visible == "undefined") return;
    1576   if (!options.cl_visible == true) { return; }
    1577   //======================================================
    1578 
    1579   var chk = eval("options." + user_status + "_enabled");
    1580   if (chk == "") { return; }
    1581 
    1582   if (!options.useMap.match(RegExp("Autosize", "gi"))) {
    15832607
    15842608    return;
    15852609  }
    15862610
    1587   //=================================================================
    1588   infos_widow = jQuery(window).infos();
    1589   var winwidth = infos_body.width;
    1590   var winheight = infos_body.height;
    1591   if (Type_Img == "pamoorama") {
    1592     theMainImage_Id = "#pamoorama";
    1593     Calcul_Image();
    1594   } else {
    1595     Calcul_Image();
    1596   }
    1597   img_finale = { width: Zone_image.image.width, height: Zone_image.image.height };
    1598   //=================================================================
    1599   old_window = jQuery(window).infos();
    1600   //========= Récupération des informations ============= 
    1601   var Licence = jQuery(".licencetag");
    1602   infos_Licence = jQuery(".licencetag").infos();
    1603   //=================================================================
    1604   switch (Type_Img) {
    1605     case "map":
    1606       Set_Map(true);
    1607       break
    1608     case "panorama":
    1609       if (!theMainImage_Id) {
    1610         theMainImage_Id = "#theMainImage";
    1611         if (theMainImage_Id.length > 0)
    1612           return;
    1613         theMainImage_Id = jQuery().Get_Img_Maxi("#Panorama img[alt]");
    1614 
    1615         if (theMainImage_Id.length > 0)
    1616           theMainImage_Id = theMainImage_Id[0];
    1617         else
    1618           theMainImage_Id = jQuery().Get_Img_Maxi("#Panorama img[alt]");
    1619       }
    1620       infos_theImage = jQuery(theMainImage_Id).infos();
    1621       infos_the_page = jQuery("#the_page").infos();
    1622       jQuery("#theImage").height(infos_theImage.height);
    1623       img_finale.height = infos_theImage.height;
    1624       break
    1625     case "img":
    1626 
    1627       if (!theMainImage_Id) return;
    1628       if (theme.match(RegExp("luciano", "g"))) {
    1629 
    1630       }
    1631 
    1632       infos_the_page = jQuery("#the_page").infos();
    1633 
    1634 
    1635       break
    1636     case "img_autre":
    1637       if (!theMainImage_Id) {
    1638         if (DEBUG_autosize == "true") alert("The_MainImage=null");
    1639         return;
    1640 
    1641       }
    1642       infos_theImage = jQuery(theMainImage_Id).infos();
    1643       infos_the_page = jQuery("#the_page").infos();
    1644 
    1645 
    1646       break
    1647     case "embed":
    1648       //
    1649       if (infos_theMainImage.width == 0)
    1650         infos_theMainImage = jQuery("#thePicturePage").infos();
    1651       if (infos_theMainImage.width == 0)
    1652         infos_theMainImage = jQuery("#the_page").infos();
    1653       infos_theImage = infos_theMainImage;
    1654       infos_the_page = jQuery("#the_page").infos();
    1655       Bandeau_bas.height = Bandeau_bas.top;
    1656 
    1657       iph1 = jQuery("#theImage div").infos();
    1658       if ((winheight - iph1.bottom) > 0)
    1659         Bandeau_bas.height = (winheight - iph1.bottom) + 50;
    1660       else
    1661         Bandeau_bas.height = 50;
    1662 
    1663 
    1664       if (rapport < 0) {
    1665         img_height = infos_theMainImage.height;
    1666         img_width = infos_theMainImage.width;
    1667         img_reelle.height = img_height;
    1668         img_reelle.width = img_width;
    1669       }
    1670 
    1671       break
    1672     case "charlie":
    1673       img_reelle = { height: img_height, width: img_width };
    1674       infos_theMainImage = jQuery(theMainImage_Id).infos(); ;
    1675       infos_the_page = jQuery("#the_page").infos();
    1676       if (rapport < 0) {
    1677         img_height = parseInt(infos_theMainImage.height);
    1678         img_width = parseInt(infos_theMainImage.width);
    1679         img_reelle.height = parseInt(infos_theMainImage.height);
    1680         img_reelle.width = parseInt(infos_theMainImage.width);
    1681       }
    1682       break
    1683 
    1684 
    1685     case "pamoorama":
    1686       img_reelle = { height: img_height, width: img_width };
    1687       //=========================================================
    1688       img_reelle.height = img_height;
    1689       img_reelle.width = Zone_Affichage.width;
    1690       if (typeof myPamoorama != "undefined") theMainImage_Id = myPamoorama.image;
    1691       infos_theImage = jQuery("#pamoorama").infos();
    1692       infos_theImage.height = infos_theImage.height;
    1693       infos_the_page = jQuery("#the_page").infos();
    1694       break
    1695   }
    1696 
    1697   img_finale = { width: Zone_image.image.width, height: Zone_image.image.height };
    1698   return true;
    1699 
    1700   //================= Vérification Taille image minimun autorisée ========
    1701   MinWidth = jQuery(theMainImage_Id).css("minWidth");
    1702   if (MinWidth == "0px")
    1703     MinWidth = options.mini_width;
    1704   MinHeight = jQuery(theMainImage_Id).css("minHeight");
    1705   if (MinHeight == "0px")
    1706     MinHeight = options.mini_height;
    1707 
    1708   MaxWidth = jQuery(theMainImage_Id).css("maxWidth");
    1709   if (MaxWidth == "0px")
    1710     MaxWidth = winwidth;
    1711   MaxHeight = jQuery(theMainImage_Id).css("maxHeight");
    1712   if (MaxHeight == "0px")
    1713     MaxHeight = winheight;
    1714 
    1715   //=============== Vérification taille minimale  autorizée ======================
    1716   var miniWidth = jQuery(theMainImage_Id).Get_Val_int(MinWidth, options.mini_width);
    1717   var miniHeight = jQuery(theMainImage_Id).Get_Val_int(MinHeight, options.mini_height);
    1718   if (winwidth < options.mini_width2) mini_width2 = winwidth;
    1719 
    1720   var miniWidth2 = jQuery(theMainImage_Id).Get_Val_int(MinWidth, options.mini_width2);
    1721   var miniHeight2 = jQuery(theMainImage_Id).Get_Val_int(MinHeight, options.mini_height2);
    1722 
    1723 
    1724   var maxWidth = jQuery(theMainImage_Id).Get_Val_int(MaxWidth, winwidth, "0");
    1725   maxHeight = jQuery(theMainImage_Id).Get_Val_int(MaxHeight, winheight, "0");
    1726 
    1727   mini_width = parseInt(miniWidth);
    1728   mini_height = parseInt(miniHeight);
    1729   img_reelle.width = parseInt(img_reelle.width);
    1730   if (img_reelle.width < mini_width)
    1731     return;
    1732   img_reelle.height = parseInt(img_reelle.height);
    1733   if (img_reelle.height < parseInt(mini_height))
    1734     return;
    1735 
    1736 
    1737 
    1738 
    1739   //=================================================
    1740   if (Zone_image.image.height < options.mini_height2)
    1741     Zone_image.image.height = options.mini_height2;
    1742   if (Zone_image.image.width < options.mini_width2)
    1743     Zone_image.image.width = options.mini_width2;
    1744   //==================================================
    1745   //   Image_width largeur à atteindre
    1746   //   Calcul du rapport d'agrandissement
    1747   echelle_max = parseFloat(options.echelle_max, '3');
    1748   if (Zone_image.zoom > echelle_max) {
    1749     Zone_image.zoom = echelle_max;
    1750     Zone_image.image.width = parseInt(Zone_image.width_init * Zone_image.zoom);
    1751     if (rapport > 0)
    1752       Zone_image.image.height = parseInt(Zone_image.width_init / rapport);
    1753   }
    1754   //=============================================================
    1755   var height_user = eval("options." + user_status + "_height");
    1756   var width_user = eval("options." + user_status + "_width");
    1757   var reg1 = new RegExp("%", "g");
    1758   //=============================================================     
    1759   if (height_user.match(reg1))
    1760     Image_height = Zone_image.height_init * parseInt(height_user) / 100;
    1761   else
    1762     Image_height = parseInt(height_user);
    1763   //==============================================================
    1764 
    1765   Image_width = parseInt(Image_height * rapport);
    1766 
    1767   //======================================================================
    1768   img_finale = { width: Zone_image.image.width, height: Zone_image.image.height };
    1769   return true;
    1770 
    1771 
    1772 
    1773 
    1774 
    1775 
    1776 
    1777   //===================================================
    1778 
    1779   img_finale.height = Image_height;
    1780   img_finale.width = Image_width;
    1781   if (theme.match(RegExp("stripped", "gi"))) {
    1782     img_finale.width -= (llgboframe.top * 2);
    1783     if (rapport > 0) img_finale.height = (img_finale.width / rapport);
    1784     else img_finale.height -= (llgboframe.top * 2);
    1785 
    1786   }
    1787   zoom = echelle;
    1788   if (typeof (llgboframe) != "undefined" && llgboframe.height > 0) {
    1789     //=============LLGBO2 ===========================
    1790     t1 = llgboframe;
    1791     if (!theMainImage_Id.src) {
    1792       theMainImage_Id = jQuery(llgbo_id).find("img").get(0)
    1793       if (!theMainImage_Id.src) {
    1794         theMainImage_Id = jQuery("#theImage").find("div").get(0)
    1795       }
    1796     }
    1797     if (theMainImage_Id.src) {
    1798       wingbo = img_finale.width;
    1799       heightgbo = img_finale.height;
    1800       if (Type_Img == "panorama") {
    1801         heightgbo = infos_theImage.height;
    1802         img_finale.height = infos_theImage.height;
    1803       }
    1804 
    1805 
    1806 
    1807 
    1808       //    jQuery("#theImage").height(heightgbo + marges_llgbo / 2);
    1809     }
    1810   }
    1811 
    1812   //================ Zone affichage =========================
    1813 
    1814   //  jQuery("#theImage").css("top", "0px");
    1815   jQuery("#standard").css("top", 0 + "px");
    1816   jQuery("#comments").css("top", 0 + "px");
    1817   //========== Image Remise à l'échelle =======================
    1818 
    1819   img_finale.height = parseInt(img_finale.height);
    1820   img_finale.width = parseInt(img_finale.width);
    1821   //=========================================================================
    1822   //=== cadre = theImage
    1823   if (theme.match(RegExp("simple", "gi"))) {
    1824     jQuery("#theImage").width(Zone_Affichage.width); //centrer simple black
    1825     jQuery("#theImage").css({ width: Zone_Affichage.width + "px",
    1826       marginLeft: "auto"
    1827     });
    1828 
    1829   } else if (theme.match(RegExp("sobre", "gi")) || theme.match(RegExp("hr_", "gi")) || theme.match(RegExp("Mont", "gi"))) {
    1830     jQuery("#theImage").css({ width: "auto", marginLeft: "auto" });
    1831   } else if (theme.match(RegExp("saruka", "gi"))) {
    1832 
    1833     jQuery("#theImage").css({ width: Zone_Affichage.width + "px" });
    1834   } else if (theme.match(RegExp("elegant", "gi"))) {
    1835 
    1836     // jQuery("#theImage").css("width", "auto");
    1837     jQuery("#theImage").css({ height: Zone_Affichage.height + "px", width: "auto" }); //conteneur
    1838 
    1839   } else {
    1840     jQuery("#theImage").css("width", "auto");
    1841 
    1842   }
    1843   // ;
    1844 
    1845   if (Type_Img == "panorama" || Type_Img == "pamoorama") {
    1846     img_finale.height = infos_theImage.height;
    1847     Zone_Affichage.height = img_finale.height;
    1848 
    1849   }
    1850 
    1851   if (typeof (gmaps) != "undefined") {
    1852     Gmap_ = gmaps.maps[0];
    1853     if (Gmap_.sizeMode == 'A') {
    1854       jQuery("#iGMapsIcon").css({ width: old_window.width * 0.8 + "px", height: old_window.height * 0.8 + "px" });
    1855 
    1856     }
    1857   }
    1858   //============= flv,mov,mpg  ok
    1859   /* wmv nok
    1860   * avi nok
    1861   //===========================================
    1862   */
    1863   if (Type_Img == "charlie") {
    1864     t1 = jQuery("#charlie").infos();
    1865 
    1866     /**/
    1867 
    1868     pdf = 0;
    1869     jQuery("#charlie div").each(function (i) {
    1870 
    1871 
    1872       p1 = jQuery(this).infos();
    1873       pdf += p1.padding.right + p1.padding.left;
    1874     });
    1875     img_finale.width -= pdf;
    1876 
    1877     jQuery("#charlie").css({
    1878       width: img_finale.width + pdf + "px",
    1879       height: img_finale.height + "px",
    1880       marginLeft: "auto"
    1881     });
    1882 
    1883 
    1884     if (MainImage.length > 0) {
    1885       img_finale.height = parseInt(img_finale.width / rapport);
    1886       img_finale.height -= 30;
    1887       img_finale.width = rapport * img_finale.height;
    1888 
    1889 
    1890       MainImage.width(img_finale.width);
    1891       MainImage.height(img_finale.height);
    1892       jQuery("#embedplayer").width(300);
    1893       jQuery("#embedplayer").height(15);
    1894     } else {
    1895       jQuery("#player").css("width", img_finale.width + "px");
    1896       jQuery("#player").css("height", img_finale.height + "px");
    1897 
    1898       jQuery("#embedplayer").css("width", img_finale.width + "px");
    1899       jQuery("#embedplayer").css("height", img_finale.height + "px");
    1900 
    1901       jQuery("embed").css({ width: img_finale.width + "px",
    1902         height: img_finale.height + "px"
    1903       });
    1904       jQuery("object").css({ width: img_finale.width + "px",
    1905         height: img_finale.height + "px"
    1906       });
    1907       jQuery("video").css({ width: img_finale.width + "px",
    1908         height: img_finale.height + "px"
    1909       });
    1910 
    1911 
    1912 
    1913       jQuery("video").height(img_finale.height);
    1914       jQuery("video").width(img_finale.width);
    1915 
    1916       jQuery("object").width(img_finale.width);
    1917       jQuery("object").height(img_finale.height);
    1918       //jQuery("#theImage").height(img_finale.height + Bandeau_bas.height); //??             
    1919 
    1920       jQuery(theMainImage_Id).height(img_finale.height);
    1921       jQuery("#theImage").css("height", "auto");
    1922     }
    1923 
    1924 
    1925   } else if (Type_Img == "embed") {
    1926 
    1927     if (MainImage.length > 0) {
    1928       img_finale.height = parseInt(img_finale.width / rapport);
    1929       img_finale.height -= 30;
    1930       img_finale.width = rapport * img_finale.height;
    1931 
    1932 
    1933       MainImage.width(img_finale.width);
    1934       MainImage.height(img_finale.height);
    1935       jQuery("#embedplayer").width(300);
    1936       jQuery("#embedplayer").height(15);
    1937     } else {
    1938       jQuery("#theImage").css("height", "auto");
    1939       jQuery("embed").css("height", img_finale.height);
    1940       jQuery("object").css({ height: img_finale.height + "px" });
    1941 
    1942       jQuery("object").width(img_finale.width);
    1943       jQuery("object").height(img_finale.height);
    1944     }
    1945 
    1946   } else if (Type_Img == "panorama") {
    1947     if (typeof asp_options != "undefined")
    1948       n = asp_options;
    1949     n1 = jQuery("#Panorama div").width();
    1950     jQuery(".panorama-viewport").css("margin", "auto");
    1951     n = infos_imageToolBar;
    1952 
    1953 
    1954   } else if (Type_Img == "pamoorama") {
    1955     Set_Pamoorama();
    1956 
    1957 
    1958 
    1959 
    1960   } else if (theMainImage_Id != null && theMainImage_Id.src) {
    1961     //--- background ?? ---
    1962     jQuery(theMainImage_Id).height(img_finale.height);
    1963     jQuery(theMainImage_Id).width(img_finale.width);
    1964     jQuery(theMainImage_Id).css({ height: img_finale.height + "px ",
    1965       width: img_finale.width + "px "
    1966     });
    1967 
    1968 
    1969   } else {
    1970     //===map ? luciano ===
    1971     //   jQuery(theMainImage_Id).css({ height: img_finale.height + "px ",  width: img_finale.width + "px });
    1972     //   jQuery(theMainImage_Id).height(img_finale.height );
    1973     //   jQuery(theMainImage_Id).width(img_finale.width );
    1974     //   jQuery(theMainImage_Id).attr({ width: img_finale.width  });
    1975     h = img_finale.height;
    1976     h = Zone_Affichage.height - Zone_Affichage.borderwidth.top - Zone_Affichage.borderwidth.bottom;
    1977     h -= (infos_theImage.borderwidth.bottom + infos_theImage.borderwidth.top);
    1978 
    1979     jQuery(theMainImage_Id).attr({ height: h - 3 }); //image
    1980     if (theme.match(RegExp("elegant", "gi"))) {
    1981       return true;
    1982 
    1983     }
    1984     if (theme.match(RegExp("luciano", "g"))) {
    1985       imgl = 180;
    1986       l = Zone_Affichage.left;
    1987 
    1988       jQuery(".imageNumber").css({ left: l + "px"
    1989 
    1990       });
    1991       jQuery("#theImage" + " #theImg IMG").css({ height: img_finale.height + "px ",
    1992         width: (img_finale.width - imgl) + "px ", marginTop: "0px"
    1993       })
    1994     }
    1995 
    1996   }
    1997 
    1998   var theImg = document.getElementById(theMainImage_Id.replace("#", ""));
    1999   if (theImg) {
    2000     theImg.removeAttribute("width");
    2001     theImg.removeAttribute("height");
    2002     jQuery(theMainImage_Id).css("width", img_finale.width + "px");
    2003   }
    2004 
    2005   jQuery("#navThumbPrev").css({ overflow: "hidden" });
    2006   jQuery("#navThumbNext").css({ overflow: "hidden" });
    2007   n = typeof inittoolbar;
    2008   if (Type_Img == "map") {
    2009     jQuery("#navThumbNext").css({ display: 'none' });
    2010     jQuery("#navThumbPrev").css({ display: 'none' });
    2011     jQuery("#theImage").css({ marginTop: infos_imageToolBar.height + "px", marginLeft: "0px",
    2012       width: winwidth + "px",
    2013       height: winheight + "px"
    2014     });
    2015     //mapPicture
    2016   }
    2017   try {
    2018     if (theme.match(RegExp("gally", "gi"))) {
    2019       if (typeof inittoolbar == "function") {
    2020         if (typeof (currentTab) == "undefined") inittoolbar();
    2021         else initializeImageMode("resize");
    2022       } else {
    2023         tp = gallyPP.getImageProp();
    2024         if (typeof (GallyPP) == "function")
    2025           gallyPP = new GallyPP();
    2026 
    2027         iph = jQuery("#imageHeaderBar").infos();
    2028         jQuery("#imageToolBar").css({ top: iph.bottom + "px", position: "absolute" });
    2029         jQuery("#theImage").width(winwidth);
    2030       }
    2031       //===========================================================================
    2032       if (jQuery("#navThumbPrev").length > 0) {
    2033         jQuery("#navThumbPrevContainer").css({ left: "0px"
    2034         });
    2035       }
    2036       if (jQuery("#navThumbNext").length > 0) {
    2037         jQuery("#navThumbNextContainer").css({ left: "0px"
    2038         });
    2039       }
    2040       //=============================================================================
    2041       if (!theme.match(RegExp("lapis", "gi"))) {
    2042         if (typeof initializeImageMode == "function") {
    2043           initializeImageMode("resize");
    2044         }
    2045 
    2046       }
    2047 
    2048     } else if (theme.match(RegExp("simple", "g"))) {
    2049 
    2050       jQuery("#imageToolBar").css({ position: "static" });
    2051 
    2052       infos_imageInfoBar = jQuery("#imageInfoBar").infos();
    2053       if (infos_imageInfoBar.bottom < infos_theMainImage.bottom) {
    2054         //   jQuery("#imageInfoBar").height(infos_theMainImage.bottom);
    2055       }
    2056 
    2057     } else {
    2058 
    2059       //    jQuery("#imageToolBar").css("position", "static");
    2060     }
    2061   } catch (e) {
    2062 
    2063   }
    2064   zoom = img_finale.height / img_height;
    2065   h0 = jQuery("#content").height();
    2066   if (h0 == null) {
    2067     h0 = winheight - Zone_Affichage.top;
    2068   }
    2069   h1 = (h0 - img_finale.height) / 2;
    2070   //  jQuery("#theImage").css({ marginTop: h1 + "px" });
    2071 
    2072   zoom = parseInt(zoom * 100);
    2073   jQuery('#zoom ').val(zoom);
    2074 
    2075 
    2076 
    2077   //  --- réglage de la hauteur de page en fonction du copyright-----------
    2078   if (typeof (pos_copyright) == "undefined") pos_copyright = jQuery("#copyright").infos();
    2079 
    2080   if (theme.match(RegExp("stripped", "gi"))) {
    2081     var TitleBox = jQuery("#imageTitleContainer");
    2082     if (TitleBox.length != 0) TitleBox.css("width", img_finale.width + "px");
    2083   } else {
    2084 
    2085   }
    2086 
    2087 
    2088   /*
    2089   if (!theme.match(RegExp("luciano", "gi"))) {
    2090   jQuery("#linkNext").css({ height: "80px", width: "200px", overflow: "hidden" });
    2091   jQuery("#linkPrev").css({ height: "80px", width: "200px", overflow: "hidden" });
    2092   jQuery(".navThumb img").css({ height: "80px", width: "", overflow: "hidden" });
    2093   }
    2094   */
    2095   infos_frame = jQuery("#theImage").infos();
    2096   if (theme.match(RegExp("stripped", "gi"))) {
    2097     /*
    2098     infos_theImageBox = jQuery("#theImageAndTitle").infos();
    2099     p1 = jQuery(".randomButtons").infos();
    2100     p2 = jQuery("#imageHeaderBar").infos();
    2101     p3 = infos_content.top;
    2102     p1 = options.imageAutosizeTitle;
    2103 
    2104     jQuery("#theImage").width("width", infos_theImageBox.width + "px");
    2105     //jQuery("#theImageAndTitle").css("position", "relative");
    2106     jQuery("#content").css({ position: "relative", top: "10px", marginTop: "0px",
    2107     paddingTop: "0px", textAalign: "center", marginLeft: "auto"
    2108     });
    2109 
    2110     jQuery("#theImageAndTitle").css({ position: "relative", top: "0px", marginTop: "0px",
    2111     paddingTop: "0px", marginLeft: "auto"
    2112     }); */
    2113     t1 = infos_theImageBox.top;
    2114     l1 = infos_theImageBox.left;
    2115     // infos_theImageBox = jQuery("#theImage").infos();
    2116 
    2117   } else {
    2118 
    2119     t1 = infos_frame.top;
    2120     l1 = infos_frame.left;
    2121     infos_theImageBox = jQuery("#theImage").infos(); //theImage
    2122   }
    2123   infos_theImageBox.margin.margin = infos_frame.margin.margin;
    2124   infos_theImageBox.top = t1;
    2125   infos_theImageBox.left = l1;
    2126   //  infos_theImageBox.position = "absolute";
    2127 
    2128   Window_Affichage = infos_theImageBox;
    2129   if (DEBUG_autosize == "_true") {
    2130     //   jQuery("#theImage").css("border", "solid green");
    2131 
    2132     jQuery("#Debug5").css({ background: "red",
    2133       position: "absolute",
    2134       border: "green solid 2px",
    2135       textAlign: align_auto,
    2136       margin: "auto",
    2137       top: Window_Affichage.top + "px",
    2138       left: Window_Affichage.left + "px",
    2139       width: Window_Affichage.width + "px",
    2140       height: Window_Affichage.height + "px"
    2141     }); //red
    2142     jQuery("#Debug4").css({ top: infos_frame.bottom - infos_description.height + "px" }); //green
    2143   }
    2144 
    2145   //Wait_Affichage();
    2146 
    2147   return true;
    2148 } // Get_dimensions
    2149 
    2150 
    2151 //=========================================================
    2152 theMainImage_Id = "#theMainImage";
    2153 if (typeof (options) == "undefined") {
    2154   options = { imageAutosize: false }
    2155 }
    2156 options = jQuery.extend(Autosize_options, options);
    2157 var defaults = {
    2158   useMap: '#Autosize',
    2159   imageAutosizeMargin: 0,
    2160   imageAutosize: false,
    2161   marge_basse: options.imageAutosizeMargin || 0,
    2162   DEBUG_autosize: false
    2163 };
    2164 
    2165 options = jQuery.extend(defaults, options);
    2166 jQuery("#form_autosize_picture").addClass("Autosize_margin");
    2167 //===== marges suplémentaires en fonction theme ===
    2168 options.marge_haute = jQuery(".Autosize_margin").Get_Val_int(jQuery(".Autosize_margin").css("top"));
    2169 options.marge_basse = jQuery(".Autosize_margin").Get_Val_int(jQuery(".Autosize_margin").css("bottom"));
    2170 options.marge_gauche = jQuery(".Autosize_margin").Get_Val_int(jQuery(".Autosize_margin").css("left"));
    2171 options.marge_droite = jQuery(".Autosize_margin").Get_Val_int(jQuery(".Autosize_margin").css("right"));
    2172 
    2173 
    2174 DEBUG_autosize = options.DEBUG_autosize;
    2175 cookies = Get_cookies();
    2176 
    2177 //============= Gestion Maps ================
    2178 nom_map = "Autosize";
    2179 a_up = jQuery("map[name='" + nom_map + "'] area[rel=up]");
    2180 a_prev = jQuery("map[name='" + nom_map + "'] area[rel=prev]");
    2181 a_next = jQuery("map[name='" + nom_map + "'] area[rel=next]");
    2182 
    2183 new_html = '<map name="Autosize" >';
    2184 
    2185 var theme = options.theme;
    2186 nb_zone = jQuery("div .navigationButtons a").length;
    2187 var infos_theMainImage = jQuery(theMainImage_Id).infos();          // Image
    2188 var Largeur_zone = (infos_theMainImage.width / nb_zone);
    2189 var Hauteur_zone = (infos_theMainImage.height);
    2190 var init_zone = 0;
    2191 j = 0;
    2192 jQuery("div .navigationButtons a").each(function (e) {
    2193   Hauteur_zone = (infos_theMainImage.height);
    2194   title = jQuery(this).attr("title");
    2195   h_ref = jQuery(this).attr("href");
    2196   init_zone = Largeur_zone * j;
    2197   if (title.match(":")) {
    2198     if (j == 0)
    2199       rel = "prev";
    2200     else
    2201       rel = "next";
    2202   } else {
    2203     rel = "up";
    2204     Hauteur_zone = Hauteur_zone / 4;
    2205   }
    2206   coord = init_zone + "," + 0 + "," + Math.ceil(init_zone + Largeur_zone) + "," + Hauteur_zone;
    2207   new_html += '<area rel="' + rel + '" title="' + title + '" href="' + h_ref + '" shape="rect" coords="' + coord + '" alt="' + title + '" />';
    2208 
    2209   j++;
    2210 });
    2211 new_html += '</map>';
    2212 jQuery("#theImage map:last").after(new_html);
    2213 
    2214 //=================== Gestion liste photos size ============================
    2215 us = 0;
    2216 var user_status = options.user_status;
    2217 var type_size = eval("options." + user_status + "_type"); //limite taille
    2218 var type_size_maxi = eval("options." + user_status + "_type"); //limite taille
    2219 
    2220 n = 0;
    2221 
    2222 var pt = new Array();
    2223 jQuery("#derivativeSwitchBox .switchCheck").css('visibility', 'hidden');
    2224 jQuery("#derivativeSwitchBox a").css('visibility', 'hidden');
    2225 
    2226 jQuery("#derivativeSwitchBox a").each(function (i) {
    2227   href_path = jQuery(this).attr("href");
    2228   pt[i] = href_path.split("'");
    2229   tsz = pt[i][5];
    2230   jQuery(this).css('visibility', 'visible');
    2231   //--- recherche limite ---
    2232   if (tsz.match(RegExp(type_size_maxi, "gi"))) {
    2233     return false;
    2234   }
    2235   //--- type en cours ---
    2236   if (tsz.match(RegExp("^" + options.type_size, "gi"))) {
    2237     us = n;
    2238   }
    2239 
    2240   n++;
    2241 });
    2242 
    2243 jQuery("derivativeChecked" + options.type_size).css('visibility', 'visible');
    2244 
    2245 
    2246 
    2247 //===================
    2248 // VARIABLES 
    2249 //===================
    2250 var theMainImage_Id = "#theMainImage";
    2251 type_src = "div";
    2252 old_window = { width: 0, height: 0 };
    2253 List_autosize = new Array();
    2254 nu_img = 0;
    2255 tempo = 0;
    2256 //====================================================
    2257 var infos_thePicturePage = jQuery("#thePicturePage").infos();
    2258 var infos_theImageAndInfos;
    2259 
    2260 var theImageAndInfos_id = "#theImageAndInfos";
    2261 if (options.theme.match(RegExp("simple", "gi"))) {
    2262   theImageAndInfos_id = "#content";
    2263 
    2264   jQuery(theMainImage_Id).attr("position", "static");
    2265 
    2266 
    2267 } else {
    2268   infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre general
    2269   if (infos_theImageAndInfos.visible == true)
    2270     theImageAndInfos_id = "#theImageAndInfos";
    2271   else
    2272     theImageAndInfos_id = "#imageContainer";
    2273 }
    2274 
    2275 infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre general
    2276 
    2277 var infos_theImage = jQuery("#theImage").infos();                  // Container
    2278 infos_theMainImage = jQuery(theMainImage_Id).infos();          // Image
    2279 
    2280 if (infos_theMainImage.width == 0) {
    2281   infos_theMainImage = jQuery("#theImage img").infos();
    2282   if (infos_theMainImage.id == "")
    2283     jQuery("#theImage img").attr("id", "theMainImage");
    2284   infos_theMainImage = jQuery(theMainImage_Id).infos();
    2285 }
    2286 
    2287 var infos_imageInfos = jQuery("#imageInfos").infos();              // Informations
    2288 
    2289 
    2290 var infos_the_page = jQuery("#the_page").infos();
    2291 var infos_content = jQuery("#content").infos();
    2292 var infos_titrePage = jQuery("#titrePage").infos();
    2293 var infos_imageInfoBar = jQuery("#imageInfoBar").infos();
    2294 var infos_theHeader = jQuery("#theHeader").infos();
    2295 var infos_imageToolBar = jQuery("#imageToolBar").infos();
    2296 var infos_imageHeaderBar = jQuery("#imageHeaderBar").infos();
    2297 var infos_body = jQuery("body").infos();
    2298 var llgbo_id = "#llgbo0";
    2299 
    2300 var infos_llgbo = jQuery(llgbo_id).infos();
    2301 var infos_llgboh2 = jQuery("#llgboh2").infos();
    2302 
    2303 var marges_llgbo = 0;
    2304 var Zone_image = {
    2305   width_init: options.img_width,
    2306   height_init: options.img_height,
    2307   rapport_init: options.img_width / options.img_height
    2308 };
    2309 
    2310 var Type_Img = "";
    2311 
    2312 
    2313 
    2314 pos_top = jQuery(theImageAndInfos_id).position();
    2315 pos_top = pos_top.top - infos_theImageAndInfos.general.marges.top;
    2316 pos_top += infos_content.general.marges.top;
    2317 pos_top += infos_theImage.general.marges.top;
    2318 options.pos_top = pos_top;
    2319 
    2320 
    2321 old_window = { width: 0, height: 0 };
    2322 
    2323 
    2324 //==== en cours ============
    2325 n = pt.length - 1;
    2326 if (n >= 0) {
    2327   imgSrc = pt[n][1];
    2328   last_map = pt[n][5];
    2329 
    2330   imgSrc = pt[us][1];
    2331   last_map = pt[us][5];
    2332 
    2333   new_html = '<br /><span class="switchCheck" id="derivativeCheckedAutosize" style="visibility:visible" >&#x2714; </span>';
    2334   new_html += '<a id="linkAutosize" href="javascript:changeImgSrc(\'' + imgSrc + '\', \'' + last_map + '\', \'' + type_size + '\') ">';
    2335   new_html += 'Autosize<span class="derivativeSizeDetails" id="auto_details" > - Autosize</span>  </a>';
    2336   if (type_size.match(RegExp("Autosize", "gi"))) {
    2337     jQuery("#derivativeSwitchBox br:last").before(new_html);
    2338   }
    2339 
    2340   useMap = cookies.pictureMap; // #mapxxx
    2341   if (useMap == "#Autosize" && type_size_maxi == "Autosize") {
    2342 
    2343   } else {
    2344     useMap = last_map;
    2345   }
    2346 
    2347   typeSave = cookies.typeSave; //picturederiv xxx
    2348   options.type_size = useMap.replace("#", "");
    2349 
    2350   type_size = options.type_size;
    2351   cookies.pictureMap = useMap; // #mapxxx
    2352   cookies.typeSave = last_map; //picturederiv xxx
    2353   cookies.imgSrc = imgSrc;
    2354 
    2355   changeImgSrc(imgSrc, last_map, type_size);
    2356 
    2357 
    2358 }
    2359 
    2360 
    2361 });                                                                                                                                                      // ready
    23622611
    23632612  //=====================================================================
     
    24552704
    24562705  }
    2457  
    2458 
    2459     /********************************************************
    2460     * List_autosize_resize
    2461     ********************************************************/
    2462     function List_autosize_resize(event, ui) {
    2463       if (typeof wait_resize == "undefined") wait_resize = false;
    2464       if (wait_resize == true) return;
    2465       wait_resize = true;
    2466       if (List_autosize.length == 0) return;
    2467       for (i = 0; i < List_autosize.length; i++) {
    2468         Autosize_resize(jQuery(List_autosize[i]));
    2469       }
    2470       wait_resize = false;
    2471       return true;
     2706
     2707  /********************************************************
     2708  * List_autosize_resize
     2709  ********************************************************/
     2710  function List_autosize_resize(event, ui) {
     2711    if (typeof wait_resize == "undefined") wait_resize = false;
     2712    if (wait_resize == true) return;
     2713    wait_resize = true;
     2714    if (List_autosize.length == 0) return;
     2715    for (i = 0; i < List_autosize.length; i++) {
     2716      Autosize_resize(jQuery(List_autosize[i]));
    24722717    }
    2473 
    2474 
    2475 
     2718    wait_resize = false;
     2719    return true;
     2720  }
     2721
     2722
     2723  jQuery("#derivativeSwitchBox a").mouseover(function () {
     2724    nu_img = 0;
     2725  });
    24762726
    24772727
    24782728  /**/
     2729
     2730})(jQuery);
  • extensions/Autosize/js/autosize.dimensions.js

    r16931 r17192  
    4949  *
    5050  */
    51   jQuery.each(['Left', 'Top'],
     51  jQuery.each(['Left', 'Top', 'Right', 'Bottom', 'All'],
    5252    function (i, name) {
     53      //========== scroll =================
    5354      jQuery.fn['scroll' + name] = function (val) {
    5455        if (!this[0]) return;
     
    5859        }) : this[0] == window || this[0] == document ? self[(name == 'Left' ? 'pageXOffset' : 'pageYOffset')] || jQuery.boxModel && document.documentElement['scroll' + name] || document.body['scroll' + name] : this[0]['scroll' + name];
    5960      };
    60       //================================================
    61       jQuery.fn['absolute' + name] = function (val) {
    62         if (!this[0]) return;
     61      //========= Absolute =====================
     62      jQuery.fn['absolute' + name] = function (Args) {
     63        if (!this[0]) return 0;
    6364        a = jQuery(this[0]);
    64         m = 0;
    65         while (a.length > 0) {
    66           val = jQuery(a).infos();
    67           if (val.position != "absolute") {
    68             m += name == 'Left' ? val.left : val.top;
    69             m += name == 'Left' ? val.margin.left : val.margin.top;
    70             m += name == 'Left' ? val.margin.right : val.margin.bottom;
    71             m += name == 'Left' ? val.borderwidth.left : val.borderwidth.top;
    72             //   m += name == 'Left' ? val.borderwidth.right : val.borderwidth.bottom;
    73             //   m += name == 'Left' ? val.padding.left : val.padding.top;
    74             //   m += name == 'Left' ? val.padding.right : val.padding.bottom;
    75             a = jQuery(a).offsetParent();
    76           } else
    77             break;
     65        m = { Left: 0, Top: 0, Right: 0, Bottom: 0,
     66          All: {
     67            Left: 0, Top: 0, Right: 0, Bottom: 0
     68          }
     69        };
     70        pos = jQuery(this).offset();
     71        pos.top = Math.ceil(pos.top);
     72        pos.left = Math.ceil(pos.left);
     73
     74        size = { width: jQuery(this).outerWidth(), height: jQuery(this).outerHeight() };
     75
     76        if (name == "All") {
     77          m[name]['Left'] = pos.left;
     78          m[name]['Top'] = pos.top;
     79          m[name]['Right'] = pos.left + size.width;
     80          m[name]['Bottom'] = pos.top + size.height;
     81        } else {
     82         
     83          if (name == 'Left' || name == 'Top') {
     84            m[name] = name == 'Left' ? pos.left : (pos.top);
     85          } else {
     86            m[name] = name == 'Right' ? pos.left + size.width : pos.top + size.height;
     87          }
     88
    7889
    7990        }
    80         //306
    81 
    82 
    83         return m;
     91
     92
     93        return m[name];
    8494
    8595
     
    91101  jQuery.fn.extend({
    92102
    93     infos: function () {
     103    infos: function (Arguments) {
     104      if (!Arguments) {
     105        Arguments = { pos_absolute: false, pos_externe: false };
     106
     107      }
     108      Args = { pos_absolute: Arguments.pos_absolute || false, pos_externe: Arguments.pos_externe || false };
     109
    94110      var width = 0, height = 0;
    95111      var elem = jQuery(this).get(0);
     
    118134      myposition = "";
    119135      results = {
    120         visible:false ,
     136        visible: false,
    121137        position: "",
    122138        top: 0,
     
    136152          bottom: 0
    137153        },
    138        
     154
    139155        exterieur: {
    140156          width: 0,
     
    143159          bottom: 0
    144160        },
    145    
     161
    146162        general: {
    147163          width: 0,
     
    149165          right: 0,
    150166          bottom: 0,
    151           marges: { height:0,
    152                     top: 0,
    153                     bottom: 0,
    154                     width: 0,
    155                     left: 0,
    156                     right: 0
    157                     }
    158                 },
    159         src:"",
    160         useMap : "" ,
     167          marges: { height: 0,
     168            top: 0,
     169            bottom: 0,
     170            width: 0,
     171            left: 0,
     172            right: 0
     173          }
     174        },
     175        src: "",
     176        useMap: "",
    161177        id: "",
    162178        nodeName: ""
     
    177193          out_width = width;
    178194          out_height = height;
     195          in_width = width; ;
     196          in_height = height;
     197
    179198        } else {
    180199
     
    183202          out_width = jQuery(elem).outerWidth();
    184203          out_height = jQuery(elem).outerHeight();
     204          in_width = jQuery(elem).innerWidth();
     205          in_height = jQuery(elem).innerHeight();
    185206          elem_parent = elem.parentElement;
    186207          if (typeof elem_parent == "undefined") {
    187208            elem_parent = window;
    188209          }
    189           out_width = jQuery(elem).outerWidth();
    190           out_height = jQuery(elem).outerHeight();
    191           in_width = jQuery(elem).innerWidth();
    192           in_height = jQuery(elem).innerHeight();
     210
    193211          if (typeof Css.width != "undefined")
    194212            width = Get_Val_int(Css.width, jQuery(elem_parent).width(), 0);
     
    236254        } else {
    237255          Cl_Position = jQuery(elem).d_position();
     256
     257          /*
     258          margin: 5px;
     259          border: 10px ;
     260          padding: 20px;
     261
     262          */
     263          s_elem = elem;
     264          Left = Cl_Position.left; //  291
     265          Top = Cl_Position.top; // 812
     266          if (Args.pos_absolute == true) {
     267
     268            all = jQuery(elem).absoluteAll();
     269
     270            Top = all.Top;
     271            Left = all.Left;
     272            Args.pos_externe = false;
     273          }
     274
     275          if (Args.pos_externe == true) {
     276            if (elem.tagName != "BODY") {
     277              nodeName = nodeName || "";
     278              L1 = jQuery(elem).position();  // sans les marges ;
     279              L2 = jQuery(elem).position(true); //  296 x 817
     280              Left = L1.left;
     281              Top = L1.top;
     282            }
     283
     284          }
     285
     286          elem = s_elem;
    238287        }
    239         Left = Cl_Position.left;
    240         Top = Cl_Position.top;
    241 
    242288        visible = jQuery(elem).is(':visible');
    243         results = { 
    244           useMap : elem.useMap || "none",
     289        results = {
     290          useMap: elem.useMap || "none",
    245291          src: elem.src || "none",
    246292          visible: visible || false,
     
    279325                      margin.bottom + borderwidth.bottom +
    280326                      padding.bottom,
    281                       top: margin.top +
     327              top: margin.top +
    282328                            borderwidth.top +
    283329                            padding.top,
    284                       bottom: margin.bottom +
     330              bottom: margin.bottom +
    285331                       borderwidth.bottom +
    286332                        padding.bottom,
    287                       width: margin.left +
     333              width: margin.left +
    288334                              borderwidth.left +
    289335                              padding.left +
     
    291337                              borderwidth.right +
    292338                              padding.right,
    293                       left: margin.left +
     339              left: margin.left +
    294340                            borderwidth.left +
    295341                            padding.left,
    296                       right: margin.right +
     342              right: margin.right +
    297343                             borderwidth.right +
    298344                             padding.right
    299                     }
     345            }
    300346          },
    301347          id: id,
    302           nodeName: nodeName
     348          nodeName: nodeName || ""
    303349        };
    304350
     
    350396    */
    351397    offsetParent: function () {
    352       var offsetParent = this[0].offsetParent;
    353       while (offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static'))
    354         offsetParent = offsetParent.offsetParent;
    355       return jQuery(offsetParent);
     398      if (this[0] == window) return;
     399      try {
     400
     401        n1 = this[0].nodeName;
     402        var offsetParent = this[0].offsetParent;
     403
     404        while (offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static'))
     405          offsetParent = offsetParent.offsetParent;
     406        return jQuery(offsetParent);
     407      } catch (e) {
     408        jQuery(offsetParent);
     409      }
    356410    },
    357411    // getStyles(Obj) Récupérer la valeur CSS
     
    485539  };
    486540
    487  // myjQuery = jQuery;
    488  // my$ = $;
     541  // myjQuery = jQuery;
     542  // my$ = $;
    489543
    490544})(jQuery);
  • extensions/Autosize/main.inc.php

    r16931 r17192  
    22/*
    33Plugin Name: AutoSize
    4 Version: auto
     4Version: 2.04
    55Description: Ajuste l'affichage des photos en fonction de la hauteur de la fenetre de navigation
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=448
     
    3333$autosize_controler = new autosize_controler();
    3434add_event_handler('get_admin_plugin_menu_links', array(&$autosize_controler,'cl_autosize_admin')  );
     35 
    3536
    36 // add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_script_1'),  EVENT_HANDLER_PRIORITY_NEUTRAL+20  );       
     37add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_script_1'),  EVENT_HANDLER_PRIORITY_NEUTRAL+21  ); 
    3738
    3839add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_affiche'), EVENT_HANDLER_PRIORITY_NEUTRAL+21  );
     
    4041add_event_handler('loc_end_page_tail',array(&$autosize_controler, 'cl_autosize_script_2'),  EVENT_HANDLER_PRIORITY_NEUTRAL );
    4142
    42 
     43//add_event_handler('loc_after_page_header', array(&$autosize_controler, 'autosize_calcContent'),  EVENT_HANDLER_PRIORITY_NEUTRAL-1, 20  );
     44add_event_handler('render_element_content', array(&$autosize_controler, 'autosize_calcContent'),40,2);
    4345
    4446?>
  • extensions/Autosize/template/autosize.tpl

    r16931 r17192  
    8888
    8989</style>
    90 
    91 
    92 <div id="Debug0"  align=center style="color:black;z-index:2000;position:absolute; background-color:Beige; top:0px;left:0px;width:800px;margin:auto;"></div>
    93 <div id="Debug1"  align=center style="color:black;z-index:2000;position:absolute; background-color:Beige; top:0px;left:0px;width:800px;margin:auto;"></div>
    94 <div id="Debug2"  align=center style="color:black;z-index:2000;position:absolute; background-color:yellow; top:0px;left:0px;width:800px;margin:auto;"></div>
    95 <div id="Debug3"  align=center style="color:black;z-index:2000;position:absolute; background-color:blue; top:0px;left:0px;width:800px;margin:auto;"></div>
    96 <div id="Debug4"  align=center style="color:black;z-index:2000;position:absolute; background-color:green; top:0px;left:0px;width:800px;margin:auto;"></div>
    97 <div id="Debug5"  align=center style="color:black;z-index:2000;position:absolute; background-color:red; top:100px;left:0px;width:300px;margin:auto;"></div>
     90<div id="Debug0"  ></div>
     91<div id="Debug1"  ></div>
     92<div id="Debug2"  ></div>
     93<div id="Debug3"  ></div>
     94<div id="Debug4"  ></div>
     95<div id="Debug5" ></div>
    9896 <div id="Debug6"  align=center style="display:none"></div>
    9997
     
    120118<input id='zoom'  name='zoom' type='hidden' value='' />
    121119</form ></div>
     120
     121<img id='loading' src='{$AUTOSIZE_PATH}images/loading.gif' style='position:absolute;left:50%;top:50%;z-index:10; display:none' />
  • extensions/Autosize/template/picture.tpl

    r16935 r17192  
    1414    title="{'cl_autosize_info_2'|@translate}"
    1515    alt="{'cl_autosize_info_2'|@translate}" />
    16     <img class="button" id="bp_img_cla" alt="{'cl_autosize_info_2'|@translate}"  src="{$cl_autosize_button.ICON}"  complete="complete"/><span>
    17     </span>
     16    <img class="button" id="bp_img_cla" alt="{'cl_autosize_info_2'|@translate}"  src="{$cl_autosize_button.ICON}"  complete="complete"/><span></span>
    1817  </a>
    1918
Note: See TracChangeset for help on using the changeset viewer.