Changeset 17308 for extensions/Autosize


Ignore:
Timestamp:
Aug 2, 2012, 3:12:47 PM (12 years ago)
Author:
cljosse
Message:

[extensions] Autosize fix compatibility with 2.4, clean up...

Location:
extensions/Autosize
Files:
12 edited

Legend:

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

    r17192 r17308  
    2828        {
    2929  global $user,$page,$template,$cl_plugin;
    30 
    31  
    3230 // header ('X-UA-Compatible: n=7')  ;
    3331 // header ('X-UA-Compatible: IE=Edge')  ;
    34   if(isset($page['body_id']) && $page['body_id'] == 'theAdminPage' ) return ;
    35 
    36     if ('kardon' == $user['theme'] and isset($_GET['slideshow'])) return ;
    37      
     32    if(isset($page['body_id']) &&       $page['body_id'] == 'theAdminPage' ) return ;   
    3833    $ma_page=isset($page['body_id'])?$page['body_id']:"" ;
    3934    if ($ma_page=='thePiwiShackControllerPage') return ;
    40       $file =AUTOSIZE_PATH_ABS.'template/header.tpl' ;
     35    if (!isset($template->files['pamooramics_content'])) return ; 
     36    if ('kardon' == $user['theme'] and isset($_GET['slideshow'])) return ;
     37    $has_pamoorama=isset($template->files['pamooramics_content']);
     38
     39    $file =AUTOSIZE_PATH_ABS.'template/header.tpl' ;
    4140    $template->set_filenames(array('autosize_init_header'=> $file ));
    4241    $template->set_filenames(array('autosize_init'=>AUTOSIZE_PATH_ABS. "template/conflit.tpl" ) );
     
    5049    $template->assign(
    5150      array(   
    52         'autosize_parametres' => $autosize_parametres ,
    53         'cl_plugins' => $cl_plugin ,
    54         'cl_version' => $cl_plugin['version'] ,
    55         'name' => $cl_plugin['name'] ,
    56         'pamoorama' =>  isset($PAMOORAMICS_PATH)?"true":"false",                                                                 
    57         'theme' => $theme  ,
    58         'DEBUG_autosize' =>  $DEBUG_autosize ,
    59         'AUTOSIZE_PATH' => str_replace("../","",AUTOSIZE_PATH)  ,
    60         'AUTOSIZE_PATH_ABS' => AUTOSIZE_PATH_ABS,
    61         'Version_pwg' => PHPWG_VERSION       ,
    62             'loading' => AUTOSIZE_PATH . 'images/loading.gif'
    63          )
     51          'autosize_parametres' => $autosize_parametres ,
     52          'cl_plugins' => $cl_plugin ,
     53          'cl_version' => $cl_plugin['version'] ,
     54          'name' => $cl_plugin['name'] ,
     55          'pamoorama' =>  $has_pamoorama,                                                               
     56          'theme' => $theme  ,
     57          'DEBUG_autosize' =>  $DEBUG_autosize ,
     58          'AUTOSIZE_PATH' => str_replace("../","",AUTOSIZE_PATH)  ,
     59          'AUTOSIZE_PATH_ABS' => AUTOSIZE_PATH_ABS,
     60          'Version_pwg' => PHPWG_VERSION           )
    6461    );
    6562                $template->concat('cl_conflit_init', $template->parse('autosize_init_header', true));
     
    7370 {
    7471           global  $template,$user,$conf,$picture ,$page, $cl_plugin,$known_script ;
    75 
    7672                global  $template,$user,$conf,$picture ,$page, $cl_plugin ;
    77 
    7873   if ('kardon' == $user['theme'] and isset($_GET['slideshow'])) return ;
    7974   if (!isset($PAMOORAMICS_PATH)) return ;   
     
    8479$DEBUG_autosize = isset($conf['cl_debug_conflit']) ? $conf['cl_debug_conflit'] : $DEBUG_autosize ;
    8580//=====================================================================
    86 
    87 
    88                         $ma_page=isset($page['body_id'])?$page['body_id']:"" ;
    89                         $theme=$user['theme'];
    90                         if ($ma_page=='thePiwiShackControllerPage') return ;
    91 
    92 
    93 $img_width=isset($picture['current']['width'])?$picture['current']['width']:480;
    94 $img_height=isset($picture['current']['height'])?$picture['current']['height']:320;
    95 
    96 $img_scaled_width=isset($picture['current']['scaled_width'])?$picture['current']['scaled_width']:480;
    97 $img_scaled_height=isset($picture['current']['scaled_height'])?$picture['current']['scaled_height']:320;
    98 
    99 
    100 
    101 
    102 $src_img_h=isset($_POST['src_img_h'])?$_POST['src_img_h']: $img_width               ;
    103 $src_img_w= isset($_POST['src_img_w'])?$_POST['src_img_w']:$img_height              ;
     81    $ma_page=isset($page['body_id'])?$page['body_id']:"" ;
     82    $theme=$user['theme'];
     83    if ($ma_page=='thePiwiShackControllerPage') return ;
     84    $img_width=isset($picture['current']['width'])?$picture['current']['width']:480;
     85    $img_height=isset($picture['current']['height'])?$picture['current']['height']:320;
     86    $img_scaled_width=isset($picture['current']['scaled_width'])?$picture['current']['scaled_width']:480;
     87    $img_scaled_height=isset($picture['current']['scaled_height'])?$picture['current']['scaled_height']:320;
     88    $src_img_h=isset($_POST['src_img_h'])?$_POST['src_img_h']: $img_width               ;
     89    $src_img_w= isset($_POST['src_img_w'])?$_POST['src_img_w']:$img_height              ;
    10490if(isset($_COOKIE['img_w'])){
    105 $src_img_w=$_COOKIE['img_w'];
    106 $src_img_h=$_COOKIE['img_h'];
     91    $src_img_w=$_COOKIE['img_w'];
     92    $src_img_h=$_COOKIE['img_h'];
    10793}
    10894
     
    139125       var cookie_path   ='". cookie_path() ."'
    140126                        </script>";
    141          
    142 
    143127                $template->append('footer_elements',$autoscript); 
    144128                return ;
    145129 }// function cl_autosize_script_2
     130  /*************************************
     131 * cl_autosize_script_3()
     132 **************************************/
     133 static public function cl_autosize_script_3()
     134 {
     135           global  $template;
     136 
     137
     138    $has_pamoorama=isset($template->files['pamooramics_content']);
     139    if (!$has_pamoorama) return ; 
     140
     141                        $autoscript="<div id='debug' >TEST</div>
     142      <script type='text/javascript'>                   
     143                        if (typeof (Ajout_Ajax) == 'function')
     144                           Ajout_Ajax(); 
     145                        </script>";
     146                $template->append('footer_elements',$autoscript); 
     147                return ;
     148 }// function cl_autosize_script_3
    146149
    147150        //================================================================
     
    227230        $template->set_filenames(array('autosize_init_header'=> $file ));
    228231                $theme=$user['theme'];   
    229           $deriv_type = pwg_get_session_var('picture_deriv', IMG_LARGE);                               
     232          $deriv_type = pwg_get_session_var('picture_deriv', IMG_LARGE);   
     233          $defined_types = array_keys(ImageStdParams::get_defined_type_map());
     234                                       
    230235                                if($autosize_parametres->check_icon_v == 'on'){                         
    231236                                                $template->assign('cl_autosize_button',
  • extensions/Autosize/css/autosize.css

    r17192 r17308  
    1  
     1  #bp_img_cla,#icon_gmaps,#bp_cla{
     2
     3  height:26px}
     4  .actionButtons{
     5  overflow:hidden;
     6  height:30px}
    27#theImage {
    3 /*    opacity: 0.1;
    4     filter: alpha(opacity:10);
    5     */
    6    
     8
    79}
    810body {
    911
    1012}
     13#bp_cla {
     14  vertical-align: middle;
     15  text-align: center;
     16}
    1117#the_page {
    12   /*  background-color: #FF0000;
    13   margin-top: -4px;
    14 position:static ;*/
     18
    1519   
    1620}
     
    2428}
    2529
    26 #imageHeaderBar {background-color: transparent;
    27   /* 
    28   margin-top: -4px;
    29 position:static ;*/
     30#imageHeaderBar {
     31
    3032   
    3133}
    32 #navThumbNext, #navThumbPrev{ /*height:200px;*/
     34#navThumbNext, #navThumbPrev{
    3335
    3436 
    3537}
    36 /**/
     38
    3739#theImageAndInfos, #theImageAndTitle {
    38 /*   background-color: #FF0000; */
     40
    3941
    4042}
    4143#content {
    42  /* background-color: transparent;*/
    43  
     44
    4445}
    45 #theImage {   /*
    46  background-image: url('../images/quadrille_100.gif');
    47   margin: 5px;
    48  border: 10px solid #0000F0;
    49   padding: 20px;
    50  */
    51  /*  background-color: transparent;*/
     46#theImage {
     47
    5248   }
    53  
    54 .licencetag,.imageComment{
     49.imageComment{
    5550 
    5651  }
     52.licencetag {
     53
     54}
    5755
    5856#theMainImage {
    59 /*
    60   margin: 15px;
    61   border: 15px solid #f0f0ff;
    62   padding:15px;
    63  
    64  background-color: #0000FF; */
     57
    6558}
    6659#imageInfos{
    6760overflow:hidden ;
    68 /*
    69 margin : 0px;
    70   border: 0px solid #00f0f0;
    71   padding: 10px;*/
     61
    7262
    7363 }
    7464 
    7565#imageInfoBar {
    76 /*
    77 margin : 20px;
    78   border: 20px solid #00f0f0;
    79   padding: 20px;
    8066
    81  background-color: #00FF00;
    82  opacity:0.3 ;*/
    8367}
    8468#thePicturePage{
    85 /* background-color: #FF0000;
    86  border: 5px solid #FFfF00;*/
     69
     70}
     71#menubar{
     72
     73
    8774}
    8875
    89 
     76#debug {
     77  background-color: #FFFFCC;
     78  color: #003300;
     79}
    9080#Debug0 {
    9181  align: center;
  • extensions/Autosize/include/affiche.php

    r17192 r17308  
    1818if (isset($_COOKIE['picture_deriv']))
    1919  {
    20   if (isset($_COOKIE['img_w']))
    21   $cookies =  '"'.$_COOKIE['img_w']." x ".  $_COOKIE['img_h'] .'"';
     20  if (isset($_COOKIE['theImageWidth']))
     21  $cookies =  '"'.$_COOKIE['theImageWidth']." x ".  $_COOKIE['theImageHeight'] .'"';
    2222
    2323    if ( array_key_exists($_COOKIE['picture_deriv'], ImageStdParams::get_defined_type_map()) )
     
    5353          $src= $derivative->src_image ;
    5454       
    55     }
    56  
    57 
     55    }
    5856 
    5957$img_width=isset($imgScaledWH)?$imgSizeWH[0]:"480";
     
    9896  $options[$value] = $type_size;   
    9997
    100 //======================================================     
     98//===================
     99$value=0;
     100$liste_type="";
     101foreach ($img_all as $img_select){
     102          $imgSizeWH  =  $img_select->get_size();       
     103          $img_type  =  $img_select->get_type();       
     104          $img_url  = $img_select->get_url(); 
     105
     106          $liste_type .= $img_type.",".$img_url.",".$imgSizeWH[0] .",".$imgSizeWH[1]."|" ;
     107          if(strtolower($img_type)=="original") break ;
     108
     109
     110
     111
     112//===================================     
    101113       
    102114        $template->assign(
     
    105117            'cookies' =>  $cookies ,
    106118            'deriv_type' =>$deriv_type ,
     119            'liste_type' => $liste_type ,
    107120            'webmaster_type' => array(
    108121                                            'OPTIONS' => $options,
  • extensions/Autosize/js/Affiche_script.js

    r17192 r17308  
    22// problème avec GMaps+diaporama:
    33// corriger   gmaps_pip.class.inc.php ajouter ligne 90 if ( !isset($_GET['slideshow']))
    4 //==============================================================
    5 
    6 (function (jQuery) {
     4//============================================================== 
    75  jQuery.Affiche_script = { version: '1.0' };
    8 
    9   var theMainImage_Id = "#theMainImage";
    10   var Zone_image;
    116  /********************************************
    127  *  document ready
    138  ********************************************/
    149  jQuery(document).ready(function (jQuery) {
     10    var Type_Img;
     11    var theImg;
     12    /******************************************
     13    * Save_cookies
     14    ******************************************/
     15    Save_cookies = function (parametres) {
     16      if (parametres.typeSave) document.cookie = 'picture_deriv=' + parametres.typeSave + ';path="' + "/" + '" ';
     17      if (parametres.typeSave) jQuery.cookie('picture_deriv', parametres.typeSave, { path: "/" });
     18      if (parametres.pictureMap) jQuery.cookie('picture_map', parametres.pictureMap, { path: "/" });
     19      if (parametres.imgSrc) jQuery.cookie('imgSrc', parametres.imgSrc, { path: "/" });
     20      if (parametres.theMainImageHeight) jQuery.cookie('theMainImageHeight', parametres.theMainImageHeight, { path: "/" });
     21      if (parametres.theMainImageWidth) jQuery.cookie('theMainImageWidth', parametres.theMainImageWidth, { path: "/" });
     22      if (parametres.theImageHeight) jQuery.cookie('theImageHeight', parametres.theImageHeight, { path: "/" });
     23      if (parametres.theImageWidth) jQuery.cookie('theImageWidth', parametres.theImageWidth, { path: "/" });
     24      if (parametres.windowHeight) jQuery.cookie('windowHeight', parametres.windowHeight, { path: "/" });
     25      if (parametres.windowWidth) jQuery.cookie('windowWidth', parametres.WindowWidth, { path: "/" });
     26    }
     27    //____________________ Save_cookies _____________________________
     28    Get_cookies = function () {
     29      parametres = {
     30        typeSave: jQuery.cookie('picture_deriv'),
     31        pictureMap: jQuery.cookie('picture_map'),
     32        imgSrc: jQuery.cookie('imgSrc'),
     33
     34        theMainImageHeight: jQuery.cookie('theMainImageHeight'),
     35        theMainImageWidth: jQuery.cookie('theMainImageWidth'),
     36
     37        theImageHeight: jQuery.cookie('theImageHeight'),
     38        theImageWidth: jQuery.cookie('theImageWidth'),
     39        windowHeight: jQuery.cookie('windowHeight'),
     40        windowWidth: jQuery.cookie('windowWidth')
     41      }
     42      return parametres;
     43    }
     44    //____________________ Get_cookies _____________________________
     45
     46
     47
     48    /*************************************************
     49    * Recupère le Type d'mage
     50    *************************************************/
     51    Get_type_img = function (e) {
     52      //====== détection du type d'images ======
     53      if (jQuery("#charlie").length > 0) {
     54        Type_Img = "charlie";
     55      } else if (jQuery("#Panorama").length) {
     56        Type_Img = "panorama";
     57      } else if (jQuery("#pamoorama").length) {
     58        Type_Img = "pamoorama";
     59      } else if (jQuery("#map").length) {
     60        Type_Img = "map";
     61      } else if (jQuery("#Panorama").length) {
     62        Type_Img = "panorama";
     63      } else if ((jQuery("#theImage" + " iframe").length + jQuery("#theImage" + " object").length + jQuery("#theImage" + " embed").length) > 0) {
     64
     65        if (jQuery("#theImage" + " object").length > 0) {
     66
     67          type_src = "object";
     68
     69        } else if (jQuery("#theImage" + " embed").length > 0) {
     70
     71          type_src = "embed";
     72
     73        } else {
     74
     75          type_src = "iframe";
     76        }
     77        nbf = jQuery("#theImage" + " " + type_src).length;
     78        frm1 = jQuery("#theImage" + " " + type_src).get(0);
     79        Type_Img = "charlie";
     80
     81        //'fb - xfbml - like - button
     82
     83        objs = jQuery("#theImage" + " div").get(0);
     84        if (jQuery(objs).length > 0) {
     85          id_0 = jQuery(objs).attr("id");
     86          if (id_0 == "") {
     87            jQuery(objs).attr("id", "charlie");
     88          } else {
     89            if (nbf > 1) {
     90              jQuery(frm1).attr("id", "charlie");
     91            } else {
     92              Type_Img = "img";
     93            }
     94          }
     95        } else {
     96          jQuery(frm1).attr("id", "charlie");
     97        }
     98
     99
     100      } else if (jQuery("#theImage").find("img").length > 0) {
     101        Type_Img = "img";
     102      } else if (jQuery("#theImage" + "Box").find("img").length > 0) {
     103        Type_Img = "img";
     104        Parent = Parent + "Box";
     105      } else if (jQuery("img").length > 0) {
     106        Type_Img = "img_autre";
     107        return;
     108      } else {
     109        return;
     110      }
     111    }
     112    //____________________ Get_type_img _____________________________
     113
     114    //====================================
     115    //  set_cl
     116    //====================================
     117    set_cl = function (Valid) {
     118      if (typeof Valid == "undefined") Valid = options.useMap.match(RegExp("Autosize", "gi")) || false;
     119      if (typeof options.cl_visible == "undefined") return;
     120      if (typeof src1 == "undefined") return;
     121
     122      if (options.cl_visible) src = src1;
     123      else src = src2;
     124
     125      if (options.cl_visible) {
     126        src_info = src3;
     127        src_infos_1 = src3;
     128      } else {
     129        src_info = src4;
     130        src_infos_1 = src5;
     131      }
     132
     133      if ((typeof Zone_image != "undefined") && typeof Zone_image.image != "undefined" && Valid) {
     134        Zone_image.zoom = (Zone_image.image.height / Zone_image.image_init.height);
     135        zoom_cl = parseInt(100 * Zone_image.zoom);
     136        jQuery('#zoom ').val(zoom_cl);
     137
     138        zoom_cl = jQuery('#zoom ').val();
     139
     140        jQuery('#bp_cla').attr('alt', src_info);
     141        jQuery('#bp_cla').attr('title', src_info);
     142        jQuery('#bp_cla').attr('Stitle', src_info);
     143        jQuery('#bp_cla').attr('Stip', zoom_cl + "%");
     144        r = { width: jQuery("#theMainImage").width(), height: jQuery("#theMainImage").height(),
     145          rap: jQuery("#theMainImage").width() / jQuery("#theMainImage").height(),
     146          rap_init: Zone_image.image_init.rapport
     147        }
     148
     149
     150        jQuery('#bp_cla span').text(zoom_cl + "% ");
     151        color_back = jQuery('#imageToolBar').css("backgroundColor");
     152        if (color_back.match(new RegExp("rgb", "gi"))) {
     153          color_back = color_back.split("(")[1].split(")")[0].split(",");
     154          color_back = "rgb(" + Math.abs(255 - color_back[0]) + ","
     155                + Math.abs(255 - color_back[1]) + ","
     156                + Math.abs(255 - color_back[2]) + ")";
     157        }
     158        else if (color_back.match(new RegExp("#", "gi")))
     159          color_back = Math.abs("#65536" - color_back);
     160        else
     161          color_back = jQuery('body').css("color");
     162        jQuery('#bp_cla span').css({ color: color_back, aling: "center" });
     163        jQuery('#auto_details').text(" (" + Zone_image.image.width + " x " + Zone_image.image.height + ")");
     164
     165        //===============================================
     166      } else {
     167        src = src6;
     168        jQuery('#auto_details').text("");
     169      }
     170      bp_scr = jQuery('#bp_img_cla');
     171      if (bp_scr.length > 0) {
     172        src_enc = bp_scr.attr("src");
     173        if (!src_enc.match(src)) {
     174          bp_scr.get(0).src = src;
     175          jQuery('#bp_img_cla').attr('alt', src_info);
     176          jQuery('#bp_img_cla').attr('title', src_info);
     177        }
     178      }
     179
     180    }
     181    //____________________ set_cl _____________________________
     182
     183    /********************************
     184    * Set__bgo
     185    *********************************/
     186    Set_llbgo = function (Force) {
     187      if (Type_Img == "pamoorama") {
     188
     189      }
     190      if (Force)
     191        if (typeof LlgboFr_Resize == "function") {
     192          LlgboFr_Resize();
     193        }
     194      if (Type_Img == "pamoorama") {
     195        return;
     196      }
     197      nom_map = theImg.useMap.replace("#", "");
     198      maps = jQuery("map[name='" + nom_map + "']");
     199      if (maps.length == 0) return;
     200      // nom_map = maps[0].name;
     201      maps = jQuery("map[name='" + nom_map + "']  area");
     202      nb_zone = maps.length;
     203      Largeur_zone = (Zone_image.image.width / nb_zone);
     204      Hauteur_zone = (Zone_image.image.height);
     205      init_zone = 0;
     206      j = 0;
     207      maps.each(function (e) {
     208        init_zone = Largeur_zone * j;
     209        rel = jQuery(this).attr("rel");
     210        title = jQuery(this).attr("title");
     211        alt = jQuery(this).attr("alt");
     212        H = Hauteur_zone;
     213        if (rel == "up") {
     214          H = Hauteur_zone / 4;
     215        }
     216        coord = { x0: init_zone, y0: 0, x1: Math.ceil(init_zone + Largeur_zone), y1: Hauteur_zone };
     217        jQuery(this).attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" });
     218        j++;
     219      });
     220
     221      return;
     222    }
     223    //__________  Set_llbgo _______________
     224
     225    /********************************************
     226    *  window LOAD
     227    ********************************************/
     228    jQuery(window).load(function () {
     229      href = location.href;
     230      var aff_ok = false;
     231      if (DEBUG_autosize == "true") {
     232        for (var i = 0; i < 10; i++) {
     233          jQuery('#adddebugs').click();
     234        }
     235        jQuery(jQuery('.debug').get(i - 1)).click();
     236      }
     237      //=======================================================================
     238      infos_theMainImage = jQuery(theMainImage_id).infos(true);
     239      infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre general
     240
     241      if (infos_theMainImage.width == 0) {
     242        if (Type_Img == "pamoorama") {
     243          infos_theMainImage = jQuery("#pamoorama").infos(true);
     244          theMainImage_id = "#pamoorama";
     245
     246        } else {
     247          infos_theMainImage = jQuery("#theImage img").infos();
     248        }
     249        if (infos_theMainImage.id == "")
     250          jQuery("#theImage img").attr("id", "theMainImage");
     251        infos_theMainImage = jQuery(theMainImage_id).infos();
     252      }
     253
     254
     255      if (options.theme.match(RegExp("simple", "gi"))) {
     256        jQuery(theMainImage_id).css({ maxWidth: "none" });
     257
     258        theImageAndInfos_id = "#content";
     259        infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre general
     260        infos_theImage = jQuery(theImage_id).infos(true);                 // conteneur
     261        infos_theImage.height = infos_window.height - infos_theImage.top;
     262        jQuery(theImage_id).height(infos_theImage.height);
     263
     264      } else {
     265        infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre general
     266        if (infos_theImageAndInfos.visible == false)
     267          theImageAndInfos_id = "#imageContainer";
     268      }
     269
     270
     271      imageInfos_id = "#imageInfos";
     272      content_id = "#content";
     273      infos_content = jQuery(content_id).infos(true);                 // conteneur
     274      infos_theImage = jQuery(theImage_id).infos(true);                 // conteneur
     275      infos_imageInfos = jQuery(imageInfos_id).infos(true);             // information
     276      infos_theMainImage = jQuery(theMainImage_id).infos(true);         // Image
     277      if (infos_theMainImage.visible == false) {
     278
     279      }
     280      jQuery("#loading").show(0);
     281
     282      if (options.check_desc_v) {
     283        infos_Licence = jQuery(".licencetag").infos(true);
     284        infos_imageComment = jQuery(imageComment_id).infos(true);
     285        h01 = (infos_Licence.general.height);
     286        h02 = (infos_imageComment.general.height);
     287        options.marge_basse += Math.max(h01, h02);
     288      }
     289
     290      infos_theMainImage = jQuery(theMainImage_id).infos(true);
     291      infos_theImage = jQuery(theImage_id).infos(true);
     292
     293      Zone_image = { image_init: {
     294        width: infos_theMainImage.width,
     295        height: infos_theMainImage.height,
     296        rapport: infos_theMainImage.width / infos_theMainImage.height
     297      },
     298        image: {
     299          width: infos_theImage.general.width,
     300          height: infos_window.height - infos_theImage.top - options.marge_basse,
     301          rapport: infos_theMainImage.width / infos_theMainImage.height
     302        },
     303        container: {
     304          width: infos_theImage.general.width,
     305          height: infos_window.height - (infos_theImage.top)
     306        }
     307      }
     308      if (Type_Img == "pamoorama") {
     309        jQuery(theMainImage_id).width(Zone_image.container.width);
     310      }
     311
     312      /***********************************************************
     313      *  RESIZE (une fois document chargé)
     314      ***********************************************************/
     315      jQuery(window).resize(function (event, ui) {
     316        infos_theImage = jQuery(theImage_id).infos(true);
     317        infos_window = jQuery(window).infos();
     318        infos_body = jQuery("body").infos();
     319        infos_content = jQuery(content_id).infos();
     320
     321        infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre general
     322        Zone_image.container = { height: infos_window.height - (infos_theImage.top),
     323          width: infos_theImage.width
     324        };
     325
     326        if (options.theme.match(RegExp("simple", "gi"))) {
     327          jQuery(theMainImage_id).css({ maxWidth: "none" });
     328          Zone_image.container.height = infos_window.height - infos_theImage.top - infos_content.general.marges.height - (infos_theImage.general.marges.height);
     329          //jQuery("#menubar").css("margin-right", "0");
     330          infos_menubar = jQuery("#menubar").infos(true);
     331          if (infos_menubar.visible == true) {
     332            Zone_image.container.width -= infos_menubar.right;
     333          }
     334        }
     335
     336        jQuery(theImage_id).height(Zone_image.container.height + 2);
     337        jQuery("#loading").hide(fade_in);
     338        if (DEBUG_autosize == "no") return;
     339        Autosize_resize(true, options);
     340
     341      });
     342      //_____________ widow.resize _______________
     343
     344      type_src = "div";
     345      old_window = { width: 0, height: 0 };
     346      List_autosize = new Array();
     347      nu_img = 0;
     348      tempo = 0;
     349
     350
     351      infos_llgbo = jQuery(llgbo_id).infos();
     352      infos_llgboh2 = jQuery("#llgboh2").infos();
     353      marges_llgbo = 0;
     354      //==========================================================================================
     355      jQuery("#loading").show(0);
     356      if (DEBUG_autosize != "no")
     357        init_gen();
     358      jQuery(window).resize();
     359      jQuery(window).resize();
     360    });
     361    //__________________window.onload_________________
     362
    15363    /********************************************
    16364    *  window unLOAD
     
    20368      try {
    21369
    22         if (typeof theMainImage_Id != "undefined") {
    23 
     370        if (typeof theMainImage_id != "undefined") {
     371          infos_window = jQuery(window).infos(true);
     372          infos_theImage = jQuery("#" + infos_theImage.id).infos(true);
     373          infos_theMainImage = jQuery("#" + theMainImage.id).infos(true);
    24374          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
     375
     376          Save_cookies({
     377            pictureMap: cookies.pictureMap,
     378            typeSave: cookies.typeSave,
     379            windowHeight: infos_window.height,
     380            windowWidth: infos_window.width,
     381            theImageHeight: infos_theImage.height,
     382            theImageWidth: infos_theImage.width,
     383            theMainImageHeight: infos_theMainImage.height,
     384            theMainImageWidth: infos_theMainImage.width
    39385          });
    40386
     
    44390      }
    45391
    46     }); //unload
    47 
     392    });
     393    //_________ unload ___________
     394
     395
     396
     397    //===================
     398    // options
     399    //===================
    48400
    49401    //=========================================================
    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>";
     402    /*messages = "This frame uses the W3C box model: <span>" + jQuery.support.boxModel + "</span>";
     403    messages += "This frame uses the html5Clone: <span>" + jQuery.support.html5Clone + "</span>";*/
    52404    // jQuery("p").html(messages);
    53405    if (typeof (options) == "undefined") {
     
    64416
    65417    options = jQuery.extend(defaults, options);
     418
     419    options.liste_type = options.liste_type.split("|");
     420    options.liste_type.pop();
     421    for (i = 0; i < options.liste_type.length; i++) {
     422      options.liste_type[i] = options.liste_type[i].split(",");
     423    }
     424
    66425    jQuery("#form_autosize_picture").addClass("Autosize_margin");
    67426    //===== marges suplémentaires en fonction theme ===
     
    71430    options.marge_droite = jQuery(".Autosize_margin").Get_Val_int(jQuery(".Autosize_margin").css("right"));
    72431    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;
    80     }
    81 
    82 
     432    imageComment_id = ".imageComment";
     433    if (options.theme.match(RegExp("simple", "gi"))) {
     434      jQuery("#theImage p").addClass("imageComment");
     435    }
     436    if (options.theme.match(RegExp("mont", "gi"))) {
     437      jQuery("#content").css({ marginLeft: 'auto' }); //monblanc
     438    }
    83439
    84440    DEBUG_autosize = options.DEBUG_autosize;
     441
     442
    85443    Get_type_img();
    86444
     
    88446    // VARIABLES 
    89447    //===================
    90 
    91     type_src = "div";
    92     old_window = { width: 0, height: 0 };
    93     List_autosize = new Array();
    94     nu_img = 0;
    95     tempo = 0;
     448    var cookies = Get_cookies();
     449    var Zone_image;
     450    var theMainImage_id = "#theMainImage";
     451    var theImage_id = "#theImage";
     452    var theImageAndInfos_id = "#theImageAndInfos";
     453    var infos_window = jQuery(window).infos();
     454    var infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre general
     455    var infos_content;
     456    var infos_body;
     457    var infos_the_page = jQuery("#the_page").infos(true);
    96458    var nopano;
    97     var cookies = Get_cookies();
    98     var theme = options.theme;
    99 
    100     var Type_Img = "";
    101 
    102459    var llgbo_id = "#llgbo0";
    103     var infos_llgbo = jQuery(llgbo_id).infos();
    104     var infos_llgboh2 = jQuery("#llgboh2").infos();
    105460    var marges_llgbo = 0;
    106 Zone_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 
     461    var type_size = cookies.typeSave; // xxx
     462    var useMap = cookies.pictureMap; // #mapxxx
     463    var user_status = options.user_status;
     464    var type_size_maxi = eval("options." + user_status + "_type"); //limite taille
     465
     466
     467
     468    if (DEBUG_autosize == "no") return;
    155469    //=============================================================
    156470    // REPONSE ACTION
    157471    //=============================================================
     472    jQuery("#theMainImage," + theMainImage_id + ",.preload, .next1 , ").load(function (e) {
     473      if (this.complete) {
     474        jQuery("#loading").hide(1000);
     475      }
     476      //_________ theMainImage  ___________
     477
     478      if (typeof theMainImage_id != "undefined")
     479        if (init_img(this))
     480          nu_img = 0;
     481    });
     482
     483
    158484    jQuery("#reset").click(function () {
    159485      location.reload();
     
    184510      mouseLocation.x = evt.clientX;
    185511      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 
    198512    }
    199513
     
    232546    //  REPONSE TRIGGER
    233547    //===========================================================
    234 
    235 
    236548    jQuery('#ret_autosize').live('ON', function (e) {
    237549      if (nu_img == "") nu_img = 8;
     
    242554    //==========================================================
    243555    jQuery("map area").mouseover(function (e) {
     556      nok = theImg.useMap;
    244557      hok = this;
    245 
    246558    });
    247559
     
    291603
    292604      id = this.id;
    293       theImage_init();
     605      Select_Image(); //+calcul
    294606    });
    295607
     
    301613    });
    302614
    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     });
    314615
    315616    //=================================================================
     
    325626      jQuery(jQuery('.debug').get(1)).trigger('ON');
    326627      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");
     628
     629      }
     630    });
     631
     632    //===============================================
     633    // jQuery("#theImage").trigger("Start_right");
     634    //===============================================
    332635    jQuery("#theImage").live('Start_right', function (e) {
    333636      if (typeof Zone_image == "undefined") return
     
    341644      // 200=window.myPamoorama.imageWidth
    342645      // 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;
     646      nw = (200 * Zone_image.container.width) / window.myPamoorama.imageWidth;
    347647      jQuery("#pamoorama_frame").width(nw);
    348648
     
    350650
    351651    });
    352 
     652    //===============================================
     653    // jQuery("#theImage").trigger("Start_left");
     654    //===============================================
    353655    jQuery("#theImage").live('Start_left', function (e) {
    354656      if (typeof Zone_image == "undefined") return
    355       if (nu_img == "") nu_img = 7;
    356       jQuery(jQuery('.debug').get(nu_img)).trigger('ON');
     657      jQuery("#theImage").show(0);
     658      window.myPamoorama.autoSlideFx.to = 0;
    357659      test_w = window.myPamoorama.autoSlideFx.to;
    358660      test_w = window.myPamoorama.autoScrollFx.to;
     
    360662      jQuery("#pamoorama_thumb img").width(200);
    361663      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 
    370664    });
    371665
     
    409703    jQuery("#menuSwitcher,#infoSwitcher").click(function (e) {
    410704
    411       setTimeout(function () { Autosize_resize(true) }, 10);
     705      setTimeout(function () { jQuery(window).resize() }, 10);
     706      setTimeout(function () { jQuery(window).resize() }, 12);
    412707      nu_img = 0;
    413708    });
     
    444739    //====================================================
    445740    jQuery("#derivativeSwitchBox a").click(function () {
    446       var theImg = document.getElementById(theMainImage_Id.replace("#", ""));
     741      theImg = document.getElementById(theMainImage_id.replace("#", ""));
    447742      if (theImg) {
    448743        pathnames = jQuery(this).attr("href").split(":");
     
    455750        }
    456751
    457         infos_theMainImage = jQuery(theMainImage_Id).infos();
    458         infos_theImage = jQuery("#theImage").infos();
     752        infos_theMainImage = jQuery(theMainImage_id).infos();
     753
    459754        theImg.removeAttribute("width");
    460755        theImg.removeAttribute("height");
     
    466761          init_img(theImg);
    467762          wx = parseInt(nw[0]);
    468           wh = parseInt(wx / rapport);
    469           //jQuery("#theImage").css("height", wh + "px");
     763          wh = parseInt(wx / Zone_image.image_init.rapport);
     764
    470765          jQuery(theImg).width(wx);
    471766          jQuery(theImg).height(wh);
     
    499794
    500795    });
     796    //____________________ set_llgbo _____________________________
    501797
    502798    //====================================
     
    507803
    508804      img_finale = img_init;
    509       rapport = parseInt(img_init.width) / parseInt(img_init.height);
     805
    510806      useMap = infos_theMainImage.useMap; // #mapmedium
    511807
     
    520816      old_img_w = cookies.imgWidth;
    521817      if (infos_theMainImage.visible == true) {
    522         var theImg = document.getElementById(theMainImage_Id.replace("#", ""));
     818        theImg = document.getElementById(theMainImage_id.replace("#", ""));
    523819        theImg.useMap = useMap;
    524820      }
    525 
    526     } // Autosize_init
    527     //===========================================================================
     821      fade_in = parseInt(options.fade_in || 0);
     822
     823    }
     824    //____________________ Autosize_init _____________________
     825
     826    /***************************
     827    * Autosize_resize
     828    ***************************/
    528829    Autosize_resize = function (force, parametres) {
    529       fade_in = parseInt(fade_in || 1000);
    530 
     830      theImg = document.getElementById(theMainImage_id.replace("#", ""));
     831      if (theImg) {
     832        theImg.removeAttribute("width");
     833        theImg.removeAttribute("height");
     834      }
    531835      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" });
     836
     837        jQuery(theImageAndInfos_id).css({ height: "auto" });
    535838        if (Type_Img == "pamoorama") {
    536           jQuery("#theImage").css({ height: "auto" });
    537 
     839          Set_Pamoorama({ width: Zone_image.container.width - 5, height: Zone_image.image.height });
     840          if (nopano)
     841            if (window.myPamoorama.options.autoscrollOnLoad) {
     842              window.myPamoorama.startAnimRight();
     843            }
    538844        } 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();
     845
     846          jQuery(theMainImage_id).height(Zone_image.image.height);
     847          jQuery(theMainImage_id).width(Zone_image.image.width);
     848        }
     849
    546850
    547851        set_cl(true);
    548852      } else {
    549         Set_Pamoorama();
     853
     854        Set_Pamoorama({ width: Zone_image.container.width, height: Zone_image.image.height });
    550855        set_cl(false);
    551856      }
    552857
    553       jQuery(theMainImage_Id).show(fade_in);
     858
    554859      Set_llbgo(true);
    555860      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                        });
     861    };
     862    //_________________Autosize ____________________________________   
     863
     864
     865
     866
     867
     868
     869
     870
    614871
    615872    /*****************
    616     * changeImgSrc1
     873    * changeImgSrc 
    617874    ******************/
    618875    changeImgSrc = function (url, typeSave, useMap) {
    619       var theImg = document.getElementById(theMainImage_Id.replace("#", ""));
     876      theImg = document.getElementById(theMainImage_id.replace("#", ""));
    620877      if (theImg) {
    621878        theImg.removeAttribute("width");
    622879        theImg.removeAttribute("height");
    623880        //  theImg.useMap = "#map" + useMap;
    624 
    625881        jQuery('#derivativeSwitchBox .switchCheck').css('visibility', 'hidden');
    626882        jQuery('#derivativeChecked' + useMap.replace("#", "")).css('visibility', 'visible');
     
    631887          pictureMap = "#map" + typeSave;
    632888        }
    633         theImg.src = url; // charge Image
    634889        theImg.useMap = pictureMap;
     890        if (theImg.src.match(RegExp(url, "gi"))) {
     891          jQuery("#loading").hide(0);
     892        } else {
     893          jQuery("#loading").show(0);
     894        }
     895        theImg.src = url; // charge Image       
    635896        //===================================================
    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 
    644897        Save_cookies({
    645898          typeSave: typeSave,
     
    648901        });
    649902        cookies = Get_cookies();
    650 
    651       }
    652 
    653 
    654     }          //changeImgSrc1
     903      }
     904    }
     905    //__________________ changeImgSrc ______________________
     906
    655907    /************************************
    656908    *
     
    659911      if (Type_Img != "pamoorama") return;
    660912
    661       jQuery("#loading").attr("id", "theMainImage");
     913      // jQuery("#loading").attr("id", "theMainImage");
     914      tempo = 0;
    662915
    663916      Wait_pamoorama_st = false;
    664917      while (Wait_pamoorama_st == false) {
    665918        Wait_pamoorama_st = Wait_pamoorama_time();
    666       }
    667     }
     919        jQuery.noop();
     920      }
     921      tempo = 0;
     922
     923      Wait_pamoorama_st = false;
     924      while (Wait_pamoorama_st == false) {
     925        Wait_pamoorama_st = Wait_pamoorama_time();
     926        jQuery.noop()
     927      }
     928
     929      if (nopano)
     930        if (window.myPamoorama.options.autoscrollOnLoad) {
     931          window.myPamoorama.startAnimRight();
     932          jQuery.noop()
     933        }
     934
     935    }
     936    //__________________ Wait_pamoorama ______________________
     937
    668938    Wait_pamoorama_time = function () {
    669939
     
    673943        mypanorama = window.myPamoorama;
    674944        if (!mypanorama) {
     945          jQuery("#loading").show(5000);
    675946          tempo = tempo + 1;
    676           if (tempo > 2000) return true;
     947          if (tempo > 5000) return true;
    677948          nopano = false;
    678949          setTimeout("Wait_pamoorama_time()", 500);
     
    694965
    695966        nopano = true;
    696 
     967        jQuery("#pamoorama").show(1000);
    697968        return true;
    698969
    699970      }
    700     } // Wait_pamoorama
    701     //====================================================================================
     971    }
     972    //__________________ Wait_pamoorama time______________________
     973
     974    /**********************
     975    *
     976    ***********************/
    702977    Wait_Affichage = function () {
    703978      Wait_Affichage_st = false;
    704979      while (Wait_Affichage_st == false) {
     980        jQuery.noop();
    705981        Wait_Affichage_st = Wait_Affichage_time();
    706982      }
    707983    }
    708     //==========================================
     984    //__________________ Wait_Affichage ______________________
     985
     986
    709987    Wait_Affichage_time = function () {
    710988      if (typeof fade_in == "undefined") fade_in = 1000;
     
    7221000      if (typeof stb != "undefined")
    7231001        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) {
     1002      if (typeof theMainImage_id == "undefined") return true;
     1003
     1004      if (theMainImage_id.selector) {
     1005        theMainImage_id = theMainImage_id.selector;
     1006      }
     1007      if (theMainImage_id == null) return;
     1008
     1009      if (jQuery(theMainImage_id).length == 0) {
    7321010        if (jQuery("#pamoorama_inner").length > 0) {
    7331011          return true;
     
    7411019      } else {
    7421020
    743         img_h = jQuery(theMainImage_Id).height();
    744         img_w = jQuery(theMainImage_Id).width();
     1021        img_h = jQuery(theMainImage_id).height();
     1022        img_w = jQuery(theMainImage_id).width();
    7451023
    7461024        jQuery("#src_img_h").val(img_h);
    7471025        jQuery("#src_img_w").val(img_w);
    7481026        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);
     1027        if (typeof infos_theImage == "undefined") return;
     1028
    7521029        jQuery("#ret_autosize").trigger('ON', {
    7531030          width: img_w,
    7541031          height: img_h,
    755           theImage: theMainImage_Id,
     1032          theImage: theMainImage_id,
    7561033          src_img: infos_theMainImage.src,
    757           window_height: Window_Affichage.height,
    758           window_width: Window_Affichage.width
     1034          window_height: infos_theImage.height,
     1035          window_width: infos_theImage.width
    7591036        });
    7601037      }
    7611038      return true;
    762     } // Wait_affichage
    763 
    764 
    765 
     1039    }
     1040    //______________ Wait_affichage ______
    7661041
    7671042
     
    7701045    **********************/
    7711046    init_img = function (theImg) {
    772 
    7731047      name_src = theImg.src;
    7741048      img_init = { width: jQuery(theImg).width(), height: jQuery(theImg).height() }
     
    7801054
    7811055      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;
     1056
     1057      if (typeof Zone_image.image == "undefined") Zone_image.image = { height: Zone_image.image_init.height, width: Zone_image.image_init.width }; ;
     1058
     1059      Zone_image.image_init.height = img_init.height;
     1060      Zone_image.image_init.width = img_init.width;
     1061      Zone_image.zoom = Zone_image.image_init.height / img_init.height;
     1062      Zone_image.image_init.rapport = img_init.rapport;
    7871063      nu_img = 0;
    788       if (typeof Zone_image.src == "undefined") return false;
     1064      if (typeof Zone_image.src == "undefined") {
     1065        Zone_image.src = name_src;
     1066        return false;
     1067      }
    7891068      stx = name_src.match(Zone_image.src);
    7901069      sty = infos_theMainImage.src;
    7911070      return stx;
    7921071    }
    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       //=====================================================================================
    1003       infos_theMainImage = jQuery(theMainImage_Id).infos();
    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
     1072    //___________ init_img _______
    10881073
    10891074    //=======================================================================================
    10901075    Debug_info = function (index, infos, Nom_str) {
     1076
    10911077      if (DEBUG_autosize == "true") {
    10921078        if (typeof infos == "undefined") return;
     
    11151101          }
    11161102          return myDebug;
     1103
    11171104        } else {
    11181105          if (typeof old_messages == "undefined") {
     
    11471134              }
    11481135            }
     1136            return myDebug;
    11491137          }
    1150 
    1151           return myDebug;
    11521138        }
    11531139      }
     
    11691155
    11701156        affiche_debug({
    1171           Debug1: Debug_info(1, Bandeau_t, "Bandeau_t"),
    1172           Debug4: Debug_info(4, infos_description, "infos_description"),
    11731157          Debug5: Debug_info(5, infos_theMainImage, "infos_theMainImage")
    11741158        });
     
    11871171      return;
    11881172    }
     1173    //___________ affiche_debug ____
     1174
    11891175    //===========================================
    11901176    //
     
    12011187        p0.left += 35;
    12021188      }
    1203       jQuery("#map").width(Zone_image.container.width - p0.left);
    1204       jQuery("#map").css({ position: "absolute", height: Zone_image.container.height + "px" });
    1205     }
    1206 
    1207     jQuery("map [name='mapAutosize'] area").mouseover(function (e) {
     1189      jQuery("#map").width(Zone_image.image.width);
     1190      jQuery("#map").css({ height: Zone_image.image.height + "px" });
     1191
     1192      return true;
     1193    }
     1194
     1195    jQuery("map [name='#Autosize'] area").mouseover(function (e) {
    12081196      return;
    12091197    });
     1198    //___ Set_Map ___
     1199
    12101200    //=====================================
    12111201    //
    12121202    //=====================================
    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         });
     1203    Select_Image = function () {
     1204      var pt = options.liste_type;
     1205      if (pt.length > 0) {
     1206        Save_container = Zone_image.container;
    12241207        //===== calcul Image ===
    12251208        Calcul_Image();
    1226         tw = Zone_image.image.width;
    1227         th = Zone_image.image.height;
     1209        tw = Zone_image.image.width;  // valeur maxi
     1210        th = Zone_image.image.height;  // valeur maxi
    12281211        n = 0;
    12291212        maxi_size = { w: tw, h: th, idx: -1 };
     
    12321215        size_encours = { w: tw, h: th };
    12331216
    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]) };
     1217        jQuery(pt).each(function (i) {
     1218          vn = this;
     1219          size_derive = { w: parseInt(vn[2]), h: parseInt(vn[3]) };
    12371220          if (size_derive.h > size_encours.h) {
    12381221            if (maxi_size.idx < 0) {
    12391222              maxi_size = size_derive;
    1240               maxi_size.idx = n;
     1223              maxi_size.idx = n + 1;
    12411224            }
    12421225          }
     
    12481231          n++;
    12491232        });
     1233
     1234
    12501235        // n = n - 1 ;
    12511236        n = maxi_size.idx;
     
    12531238        if (n > pt.length - 1) n = pt.length - 1; // format le plus grand
    12541239        if (n < 0) n = pt.length - 1; // format le plus grand
     1240
    12551241        imgSrc = pt[n][1];
    1256         last_map = pt[n][5];
     1242        last_map = pt[n][0];
     1243        //     if (Type_Img == "pamoorama") return;
     1244        if (typeof Zone_image.src == "undefined") Zone_image.src = " ";
    12571245        status = imgSrc.match(RegExp(Zone_image.src, "gi"));
    12581246        status1 = (imgSrc.toString() == Zone_image.src.toString());
     1247
    12591248        if (status1 == true) return;
    1260         theImg = document.getElementById(theMainImage_Id.replace("#", ""));
     1249        theImg = document.getElementById(theMainImage_id.replace("#", ""));
    12611250        href_path = "javascript:changeImgSrc('" + imgSrc + "', '" + last_map + "', '" + "Autosize" + "')";
    12621251        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;
     1252        if (theImg.tagName != "IMG") {
     1253          theImg.useMap = "#Autosize";
     1254          imgSrc_i = jQuery(theImg).css("backgroundImage");
     1255          imgSrc_j = jQuery(theImg).css("background-image");
     1256
     1257        } else {
     1258          if (theImg.useMap.match(RegExp("map", "gi"))) return;
     1259          if (theImg.src.match(RegExp(imgSrc, "gi"))) return;
     1260          changeImgSrc(imgSrc, last_map, "#Autosize");
     1261        }
    12671262        return true;
    12681263
    12691264
    1270         var theImg = document.getElementById(theMainImage_Id.replace("#", ""));
     1265        theImg = document.getElementById(theMainImage_id.replace("#", ""));
    12711266        if (init_img(theImg)) {
    12721267
     
    12881283    * correction pamoorama
    12891284    *************************************************/
    1290     Set_Pamoorama = function () {
    1291       myPamoorama = window.myPamoorama;
     1285    Set_Pamoorama = function (Format) {
    12921286      if (Type_Img == "pamoorama") {
    1293 
     1287        if (!Format) return;
     1288
     1289        myPamoorama = window.myPamoorama;
    12941290        if (!nopano) {
    1295           //theMainImage_Id = "#pamoorama";
    12961291          nopano = false;
    12971292          Wait_pamoorama();
    1298           infos_theMainImage = jQuery(theMainImage_Id).infos();
    1299           //theMainImage_Id = "#pamoorama";
    1300         }
    1301 
    1302 
     1293        }
    13031294        if (typeof myPamoorama == "undefined") {
    13041295          return;
     
    13061297        //========================================================= 
    13071298        if (!nopano) {
    1308           //theMainImage_Id = "#pamoorama";
    13091299          nopano = false;
    13101300          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 
     1301        }
     1302
     1303        jQuery("#pamoorama").show(1000);
     1304        jQuery("#loading").hide(1000);
     1305
     1306        Wait_pamoorama();
     1307        window.myPamoorama.stopAnim();
     1308        infos_theMainImage = jQuery("#pamoorama").infos(true);
    13251309        //====================================================
    13261310        jQuery("#pamoorama").css({
     
    13291313          //  height: Zone_Affichage.height + "px" , sinon déclenchement panorama sur la hauteur;
    13301314        });
    1331 
     1315        //============================================================
     1316        infos_pamoorama = jQuery("#pamoorama").infos(true);
     1317        infos_pamoorama_outter = jQuery("#pamoorama_outter").infos();
     1318        infos_pamoorama_inner = jQuery("#pamoorama_inner").infos();
     1319        infos_pamoorama_footer = jQuery("#pamoorama_footer").infos();
     1320        infos_pamoorama_frame = jQuery("#pamoorama_frame").infos();
     1321
     1322        infos_frame = jQuery(myPamoorama.frame).infos();
    13321323        marges_w = infos_pamoorama.general.marges.width;
    1333 
    13341324        marges_h = infos_pamoorama.general.marges.height;
    13351325        marges_h += infos_pamoorama_footer.general.height;
    1336 
    13371326        jQuery("#pamoorama").css({
    13381327          width: ""
    13391328        });
    13401329
    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)
     1330
     1331        outter_width = Format.width;
     1332        pos = jQuery("#theImage").offset();
     1333        pos.top = infos_pamoorama.top;
     1334        pos.left = infos_pamoorama.left;
     1335        outter_height = Format.height - marges_h;
     1336        /*
     1337        jQuery("#theMainImage").width(outter_width);
     1338        jQuery("#theMainImage").height(outter_height);
     1339        jQuery("#theMainImage").css({ left: pos.left, top: pos.top, margin: "auto", border: "solid 1px red"
     1340
     1341        });
     1342
     1343        */
     1344
     1345        Zoom_pano = outter_height / Format.height;
     1346        new_image = { height: Math.ceil(Format.height * Zoom_pano),
     1347          width: Math.ceil(Format * Zoom_pano)
    13461348        }
    13471349
     
    13541356
    13551357        //---------- test largeur image
    1356         new_width = Zone_image.container.width;
     1358        new_width = Format.width;
    13571359        if (new_width > new_image.width) {
    13581360          new_width = new_image.width;
     
    13771379        //============= Mise à l'echelle ==================
    13781380        jQuery("#pamoorama_footer").css({
    1379           width: Zone_image.container.width + "px"
     1381          width: Format.width + "px"
    13801382        });
    13811383
    1382         window.myPamoorama.options.width = Math.ceil(Zone_image.container.width);
     1384        window.myPamoorama.options.width = Math.ceil(Format.width);
    13831385        //==================================================================
    13841386        new_max_left = new_image.width - outter_width;
     
    13991401        // frame = Zone_image.container.width
    14001402
    1401         nw = (window.myPamoorama.image.width * Zone_image.container.width) / window.myPamoorama.imageWidth;
     1403        nw = (window.myPamoorama.image.width * Format.width) / window.myPamoorama.imageWidth;
    14021404        jQuery("#pamoorama_frame").width(nw);
    14031405        jQuery("#pamoorama").css({
    14041406          width: outter_width, height: "auto"
    14051407        });
    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 
     1408        //        jQuery("#theImage").trigger("Start_right");
     1409        jQuery("#theImage").height(Zone_image.container.height + 1);
     1410
     1411        jQuery("#theImage").css({
     1412          height: Zone_image.container.height
    14131413        });
    14141414
     1415
     1416        return true
    14151417      } // test img
    14161418    } // Set_Pamoorama
     
    14281430    //====================================
    14291431    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();
    14481432
    14491433      /****************************************/
    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   
     1434      infos_imageInfos = jQuery(imageInfos_id).infos(true);             // information
     1435      infos_theMainImage = jQuery(theMainImage_id).infos(true);         // Image   
    14531436      // commentContent
    14541437      // copyright
     
    14591442
    14601443      container = {
    1461         height: infos_window.height - pos_top,
    1462         width: infos_content.width
     1444        height: Zone_image.container.height,
     1445        width: Zone_image.container.width
    14631446      }
    14641447      marge_left = options.marge_left;
     
    14681451
    14691452      //==========================================================
    1470       if (theme.match(RegExp("stripped", "gi"))) {
     1453      if (options.theme.match(RegExp("stripped", "gi"))) {
    14711454        infos_the_page.margin.left = 20;  //taille fleche
    14721455        infos_the_page.margin.right = 20;
     
    14741457
    14751458
    1476       if (theme.match(RegExp("elegant", "gi"))) {
     1459      if (options.theme.match(RegExp("elegant", "gi"))) {
    14771460
    14781461        jQuery("#imageInfos").css({ position: "absolute", right: 0, top: 0
     
    14811464        // marge_right += infos_content.general.marges.right;
    14821465        if (infos_imageInfos.visible == true) {
    1483           marge_right += infos_imageInfos.general.width; ;
     1466          //  marge_right += infos_imageInfos.general.width; ;
    14841467
    14851468        } else {
     
    14871470
    14881471        }
    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"))) {
     1472        marge_right += 1;
     1473        marge_left += 1;
     1474
     1475      } else if (options.theme.match(RegExp("stripped", "gi"))) {
     1476
     1477      } else if (options.theme.match(RegExp("simple", "gi"))) {
     1478
     1479
     1480
     1481      } else if (options.theme.match(RegExp("OS", "gi"))) {
     1482
     1483      } else if (options.theme.match(RegExp("pur", "gi"))) {
    15061484        marge_right += 0;
    15071485        // marge_right += 25;
     1486      } else if (options.theme.match(RegExp("mont", "gi"))) {
     1487        marge_right += 0;
     1488
     1489        // marge_right += 25;
     1490
    15081491
    15091492      } 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;
     1493
    15201494
    15211495
     
    15261500      //========== Format Image ============== 
    15271501      retrait_img.height = Math.ceil(options.marges_llgbo || 0)
    1528       + Math.ceil(infos_theMainImage.exterieur.height - infos_theMainImage.height);
     1502      + Math.ceil(infos_theMainImage.general.marges.height);
     1503      retrait_img.height += 2;
    15291504      //===============================================================
    1530       retrait_img.width = Math.ceil(infos_theMainImage.exterieur.width - infos_theMainImage.width); // borderwidth+padding
     1505      retrait_img.width = Math.ceil(infos_theMainImage.general.marges.width); // borderwidth+padding
    15311506      retrait_img.width += Math.ceil(options.marges_llgbo || 0);
    1532       retrait_img.width += 0;
     1507      retrait_img.width += 2;
    15331508
    15341509      //================== Limite Format Image =====================
    15351510      container.height_interne = container.height - marge_top - marge_bottom;
    15361511      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       }
    15451512      image_max = {
    15461513        height: container.height_interne - retrait_img.height,
     
    15521519      height_theMainImage = Math.ceil(image_max.height);
    15531520      width_theMainImage = Math.ceil(image_max.width);
     1521
    15541522      if (Type_Img == "pamoorama") {
    15551523
    15561524      } else {
    1557         height_theMainImage = Math.ceil(width_theMainImage / rapport);
     1525
     1526        height_theMainImage = Math.ceil(width_theMainImage / Zone_image.image_init.rapport);
     1527
    15581528        if (height_theMainImage > container.height_interne) {
    15591529          image_max.height = container.height_interne;
    1560           image_max.width = image_max.height * rapport;
     1530          image_max.width = image_max.height * Zone_image.image_init.rapport;
    15611531          width_theMainImage = Math.ceil(image_max.width);
    15621532          height_theMainImage = Math.ceil(image_max.height);
     
    15641534        if (width_theMainImage > container.width_interne) {
    15651535          image_max.width = container.width_interne;
    1566           image_max.height = image_max.height / rapport;
     1536          image_max.height = image_max.width / Zone_image.image_init.rapport;
    15671537          width_theMainImage = Math.ceil(image_max.width);
    15681538          height_theMainImage = Math.ceil(image_max.height);
     
    15731543
    15741544        }
    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 
     1545
     1546      }
    15941547      //================================================================
    15951548      Zone_image.image = {
     
    15981551      };
    15991552
    1600       Zone_image.container = {
    1601         width: container.width,
    1602         height: container.height
    1603 
    1604       };
     1553
    16051554      //=================================================================
    1606       Zone_image.src = jQuery(theMainImage_Id).attr("src");
    1607       Zone_image.zoom = Zone_image.image.height / Zone_image.height_init;
     1555      Zone_image.marges = { width: marge_left + marge_right + retrait_img.width,
     1556        height: marge_top + marge_bottom + retrait_img.height
     1557
     1558      }
     1559      Zone_image.src = jQuery(theMainImage_id).attr("src");
     1560      Zone_image.zoom = Zone_image.image.height / Zone_image.image_init.height;
    16081561    }
    16091562
    16101563    /*********************************************
    1611     * Calcul l es dimensions.
     1564    * Calcul les dimensions.
    16121565    *********************************************/
    16131566    Get_dimensions = function (force, parametres) {
    1614       if (theImage_init()) {
    1615         infos_theMainImage = jQuery(theMainImage_Id).infos();
     1567      if (Select_Image()) {  //+calcul
     1568        infos_theMainImage = jQuery(theMainImage_id).infos();
    16161569        Zone_image.src = infos_theMainImage.src;
    16171570      }
    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;
     1571
     1572
     1573      if (typeof Zone_image.image_init.rapport == "undefined") return;
    16251574      if (force && force == true) old_window.width = 0;
    16261575
     
    16321581
    16331582
    1634       if (typeof useMap == "") useMap = "#Autosize";
     1583      if (typeof useMap == "") useMap = "Autosize";
    16351584      if (options.useMap) {
    16361585        //  useMap = options.useMap;
     
    16581607      }
    16591608
    1660       //=================================================================
    16611609      Calcul_Image();
     1610      jQuery("#loading").hide();
    16621611      img_finale = { width: Zone_image.image.width, height: Zone_image.image.height };
    1663       //=================================================================
    1664       old_window = jQuery(window).infos();
    1665 
     1612      r1 = Zone_image.image.width / Zone_image.image.height;
    16661613      //=================================================================
    16671614      switch (Type_Img) {
    16681615        case "map":
    1669           Set_Map(true);
     1616          if (Set_Map(true)) return false;
    16701617          break
    16711618        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]");
     1619          if (!theMainImage_id) {
     1620
    16821621          }
    1683           infos_theImage = jQuery(theMainImage_Id).infos();
     1622          infos_theImage = jQuery(theMainImage_id).infos();
    16841623          infos_the_page = jQuery("#the_page").infos();
    1685           jQuery("#theImage").height(infos_theImage.height);
    16861624          img_finale.height = infos_theImage.height;
    16871625          break
    16881626        case "img":
    16891627
    1690           if (!theMainImage_Id) return;
    1691           if (theme.match(RegExp("luciano", "g"))) {
    1692 
    1693           }
    1694 
    1695           infos_the_page = jQuery("#the_page").infos();
     1628
     1629
    16961630
    16971631
    16981632          break
    16991633        case "img_autre":
    1700           if (!theMainImage_Id) {
     1634          if (!theMainImage_id) {
    17011635            if (DEBUG_autosize == "true") alert("The_MainImage=null");
    17021636            return;
    17031637
    17041638          }
    1705           infos_theImage = jQuery(theMainImage_Id).infos();
     1639
    17061640          infos_the_page = jQuery("#the_page").infos();
    17071641
     
    17141648          if (infos_theMainImage.width == 0)
    17151649            infos_theMainImage = jQuery("#the_page").infos();
    1716           infos_theImage = infos_theMainImage;
     1650
    17171651          infos_the_page = jQuery("#the_page").infos();
    17181652          Bandeau_bas.height = Bandeau_bas.top;
     
    17351669        case "charlie":
    17361670          img_reelle = { height: img_height, width: img_width };
    1737           infos_theMainImage = jQuery(theMainImage_Id).infos(); ;
     1671          infos_theMainImage = jQuery(theMainImage_id).infos(); ;
    17381672          infos_the_page = jQuery("#the_page").infos();
    17391673          if (rapport < 0) {
     
    17491683
    17501684          /*
    1751           infos_theImage = jQuery("#pamoorama_outter").infos();
    1752           infos_theImage.height = infos_theImage.height;
     1685       
    17531686          infos_the_page = jQuery("#the_page").infos();
    17541687          */
     
    17601693
    17611694      //================= 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 
     1695      if ((Zone_image.image.height < options.mini_height) || (Zone_image.image.width < options.mini_width)) {
     1696        Zone_image.image.width = Math.ceil(Zone_image.width_init);
     1697        Zone_image.image.height = Math.ceil(Zone_image.image.width / Zone_image.image_init.rapport);
     1698      }
    17991699
    18001700      //=================================================
    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;
     1701      if (Zone_image.image.height < options.mini_height2) {
     1702        Zone_image.image.height = parseInt(options.mini_height2);
     1703        Zone_image.image.width = Math.ceil(Zone_image.image.height * Zone_image.image_init.rapport);
     1704      }
     1705      if (Zone_image.image.width < options.mini_width2) {
     1706        Zone_image.image.width = parseInt(options.mini_width2);
     1707        Zone_image.image.height = Math.ceil(Zone_image.image.width / Zone_image.image_init.rapport);
     1708      }
    18051709      //==================================================
    1806       //   Image_width largeur à atteindre
     1710      //   ImageWidthidth largeur à atteindre
    18071711      //   Calcul du rapport d'agrandissement
    18081712      if (Type_Img != "pamoorama") {
    18091713        echelle_max = parseFloat(options.echelle_max, '3');
    18101714        if (Zone_image.zoom > 1) {
    1811           theImage_init();
     1715          Select_Image(); //+calcul
    18121716        }
    18131717        if (Zone_image.zoom > echelle_max) {
    18141718          Zone_image.zoom = echelle_max;
    18151719          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       }
     1720          if (Zone_image.image_init.rapport > 0)
     1721            Zone_image.image.height = parseInt(Zone_image.width_init / Zone_image.image_init.rapport);
     1722        }
     1723      }
     1724      mxi = Math.ceil(Zone_image.image.height + Zone_image.marges.height);
     1725
     1726      Zone_image.container.height = Math.max(Zone_image.container.height, mxi);
    18201727      img_finale = { width: Zone_image.image.width, height: Zone_image.image.height };
    18211728      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 
     1729    }
     1730    //________________ Get_dimensions ___________________
     1731
     1732
     1733    /*****************************
     1734    *  init_gen
     1735    *****************************/
    22271736
    22281737    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);
     1738      theImg = document.getElementById(theMainImage_id.replace("#", ""));
    22661739      //==================================================
    22671740      marges_llgbo = 0;
     
    22901763      infos_llgbo.top = pAll.Top;
    22911764      infos_llgbo.bottom = pAll.Bottom;
    2292       pAll = jQuery(theMainImage_Id).absoluteAll({ pos_absolute: true });
     1765      pAll = jQuery(theMainImage_id).absoluteAll({ pos_absolute: true });
    22931766      pos_top = pAll.Top; ;
    22941767      pos_bottom = pAll.Bottom; ;
     
    23011774        pos_top = infos_theImageAndInfos.top;
    23021775
    2303 
    23041776      options.pos_top = pos_top;
    2305 
    23061777      options.marge_left = infos_theImage.general.marges.left + Math.ceil(options.marge_gauche);
    23071778      options.marge_right = infos_theImage.general.marges.right + Math.ceil(options.marge_droite);
    23081779      options.marge_top += infos_theImage.general.marges.top + infos_content.general.marges.top + Math.ceil(options.marge_haute);
    23091780      options.marge_bottom = Math.ceil(options.marge_basse); // +infos_content.general.marges.bottom; ;
    2310 
    2311       old_window = { width: 0, height: 0 };
    2312 
    23131781
    23141782      //=================== Gestion liste photos size ============================
     
    23531821        last_map = pt[us][5]; // taille selectionné.
    23541822        href_path = "javascript:changeImgSrc('" + imgSrc + "', '" + last_map + "', '" + "Autosize" + "')";
    2355 
    2356 
    2357 
    23581823        new_html = '<br /><span class="switchCheck" id="derivativeCheckedAutosize" style="visibility:visible" >&#x2714; </span>';
    23591824        new_html += '<a id="linkAutosize" href="' + href_path + '">';
     
    23691834          useMap = last_map;
    23701835        }
    2371 
    2372 
    2373 
    23741836
    23751837        typeSave = cookies.typeSave; //picturederiv xxx
     
    23871849        last_map = type_size_maxi;
    23881850        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   ******************************************/
    2409   Save_cookies = function (parametres) {
    2410     if (parametres.typeSave) document.cookie = 'picture_deriv=' + parametres.typeSave + ';path="' + "/" + '" ';
    2411     if (parametres.typeSave) jQuery.cookie('picture_deriv', parametres.typeSave, { path: "/" });
    2412     if (parametres.pictureMap) jQuery.cookie('picture_map', parametres.pictureMap, { path: "/" });
    2413     if (parametres.imgSrc) jQuery.cookie('img', parametres.imgSrc, { path: "/" });
    2414 
    2415     if (parametres.imgHeight) jQuery.cookie('img_h', infos_theMainImage.height, { path: "/" });
    2416     if (parametres.imgWidth) jQuery.cookie('img_w', infos_theMainImage.width, { path: "/" });
    2417     if (parametres.windowHeight) jQuery.cookie('window_height', Window_Affichage.height, { path: "/" });
    2418     if (parametres.windowWidth) jQuery.cookie('window_width', Window_Affichage.width, { path: "/" });
    2419   }
    2420 
    2421   Get_cookies = function () {
    2422     parametres = {
    2423       typeSave: jQuery.cookie('picture_deriv'),
    2424       pictureMap: jQuery.cookie('picture_map'),
    2425       imgSrc: jQuery.cookie('img'),
    2426 
    2427       imgHeight: jQuery.cookie('img_h'),
    2428       imgWidth: jQuery.cookie('img_w'),
    2429       windowHeight: jQuery.cookie('window_height'),
    2430       windowWidth: jQuery.cookie('window_width')
    2431     }
    2432     return parametres;
    2433   }
    2434 
    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 
     1851      }
     1852    };
     1853    //_______________________ init_gen _______________________
     1854
     1855    //============= Gestion Maps ================
     1856    nom_map = "Autosize";
     1857    a_up = jQuery("map[name='" + nom_map + "'] area[rel=up]");
     1858    a_prev = jQuery("map[name='" + nom_map + "'] area[rel=prev]");
     1859    a_next = jQuery("map[name='" + nom_map + "'] area[rel=next]");
     1860    new_html = '<map name="' + nom_map + '" >';
     1861    nb_zone = jQuery("div .navigationButtons a").length;
     1862    Largeur_zone = (jQuery("#theMainImage").width() / nb_zone);
     1863    Hauteur_zone = jQuery("#theMainImage").height();
     1864    init_zone = 0;
     1865    j = 0;
     1866    jQuery("div .navigationButtons a").each(function (e) {
     1867      Hauteur_zone = jQuery("#theMainImage").height();
     1868      title = jQuery(this).attr("title");
     1869      h_ref = jQuery(this).attr("href");
     1870      init_zone = Largeur_zone * j;
     1871      if (title.match(":")) {
     1872        if (j == 0)
     1873          rel = "prev";
     1874        else
     1875          rel = "next";
    24611876      } 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;
    2496     } else {
    2497       return;
    2498     }
    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;
    2518     }
    2519 
    2520     if ((typeof Zone_image != "undefined") && typeof Zone_image.image != "undefined" && Valid) {
    2521       Zone_image.zoom = (Zone_image.image.height / Zone_image.height_init);
    2522       zoom_cl = parseInt(100 * Zone_image.zoom);
    2523       jQuery('#zoom ').val(zoom_cl);
    2524 
    2525       zoom_cl = jQuery('#zoom ').val();
    2526 
    2527       jQuery('#bp_cla').attr('alt', src_info);
    2528       jQuery('#bp_cla').attr('title', src_info);
    2529       jQuery('#bp_cla').attr('Stitle', src_info);
    2530       jQuery('#bp_cla').attr('Stip', zoom_cl + "%");
    2531       jQuery('#bp_cla span').text(zoom_cl + "%");
    2532       color_back = jQuery('#imageToolBar').css("backgroundColor");
    2533       if (color_back.match(new RegExp("rgb", "gi"))) {
    2534         color_back = color_back.split("(")[1].split(")")[0].split(",");
    2535         color_back = "rgb(" + Math.abs(255 - color_back[0]) + ","
    2536                 + Math.abs(255 - color_back[1]) + ","
    2537                 + Math.abs(255 - color_back[2]) + ")";
    2538       }
    2539       else if (color_back.match(new RegExp("#", "gi")))
    2540         color_back = Math.abs("#65536" - color_back);
    2541       else
    2542         color_back = jQuery('body').css("color");
    2543       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("");
    2550     }
    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 
    2561   }
    2562   /********************************
    2563   *
    2564   *********************************/
    2565 
    2566   Set_llbgo = function (Force) {
    2567     if (Type_Img == "pamoorama") {
    2568 
    2569     }
    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 + "'" });
     1877        rel = "up";
     1878        Hauteur_zone = Hauteur_zone / 4;
     1879      }
     1880      coord = init_zone + "," + 0 + "," + Math.ceil(init_zone + Largeur_zone) + "," + Hauteur_zone;
     1881      new_html += '<area rel="' + rel + '" title="' + title + '" href="' + h_ref + '" shape="rect" coords="' + coord + '" alt="' + title + '" />';
     1882
    26051883      j++;
    26061884    });
    2607 
    2608     return;
    2609   }
    2610 
    2611 
    2612   //=====================================================================
    2613   //
    2614   //  Fonctions supplémentaires
    2615   //
    2616   //=====================================================================
    2617   function Autosize_resize(Obj) {
    2618     conf = jQuery(Obj).get(0).conf;
    2619     Obj = jQuery(Obj).get(0).obj;
    2620     myWindow = jQuery("#" + conf.parent).infos();
    2621     if (myWindow.width == 0) myWindow = jQuery(window).infos();
    2622     marge_basse = 0;
    2623     if (conf.MargeBasse)
    2624       marge_basse = jQuery(Obj).Get_Val_int(conf.MargeBasse);
    2625     marge_top = 0;
    2626     if (conf.MargeHaute)
    2627       marge_top = jQuery(Obj).Get_Val_int(conf.MargeHaute);
    2628     infos_Obj = jQuery(Obj).infos();
    2629     h1_left = jQuery(Obj).absoluteLeft();
    2630     h1_top = jQuery(Obj).absoluteTop();
    2631 
    2632     if (h1_top < infos_Obj.height)
    2633       h1 = (myWindow.height - h1_top - marge_basse - marge_top);
    2634     else
    2635       h1 = (myWindow.height - marge_basse);
    2636     rap = infos_Obj.height / infos_Obj.width;
    2637     w2 = parseInt(h1 / rap);
    2638     if (w2 < infos_Obj.width)
    2639       marginLeft = infos_Obj.left + parseInt((infos_Obj.width - w2) / 2) + "px";
    2640     else
    2641       marginLeft = "auto";
    2642     jQuery(Obj).css({ width: "auto", marginTop: marge_top,
    2643       marginLeft: "auto", marginBottom: 0 + "px",
    2644       verticalAlign: "middle", textAlign: "center"
    2645     });
    2646     jQuery(Obj).height(h1);
    2647     //=============================================================
    2648     if (conf.ResizePicture == "true")
    2649       imgs = jQuery(Obj).find("img");
    2650     else
    2651       imgs = jQuery(Obj).find("img");
    2652     Parent = Obj;
    2653 
    2654     Obj_w = jQuery(Obj).width();
    2655     Obj_h = jQuery(Obj).height();
    2656     if (imgs.length > 0) {
    2657       jQuery(imgs).each(function (i) {
    2658         img = jQuery(this);
    2659         h1_top = jQuery(img).absoluteTop() - h1_top;
    2660         h1_bottom = Obj_h - h1_top;
    2661         infos_theMainImage = { width: conf.width[i], height: conf.height[i] }; //origine
    2662         img_rap = conf.rap[i];
    2663         if (infos_theMainImage.width > Obj_w) h1 = parseInt(Obj_w / img_rap);
    2664         h1 -= h1_top;
    2665         if (h1 > Obj_h - h1_top) {
    2666           h1 = Obj_h - h1_top;
    2667         }
    2668         w2 = parseInt(h1 * img_rap);
    2669         if (w2 > 0 && h1 > 0 && img.length > 0) {
    2670           img.height(h1);
    2671           img.width(w2);
    2672         }
    2673       });
    2674     } else {
    2675       imgs = jQuery(Obj).children();
    2676       jQuery(imgs).each(function (i) {
    2677         if (this.height > 0) {
    2678           h1_top = jQuery(this).absoluteTop() - h1_top;
    2679           h1_bottom = Obj_h - h1_top;
    2680           infos_theMainImage = { width: conf.width[i], height: conf.height[i] }; //origine
    2681           img_rap = conf.rap[i];
    2682           if (infos_theMainImage.width > Obj_w) h1 = parseInt(Obj_w / img_rap);
    2683           h1 -= h1_top;
    2684           if (h1 > Obj_h - h1_top) {
    2685             h1 = Obj_h - h1_top;
    2686           }
    2687           w2 = parseInt(h1 * img_rap);
    2688           if (w2 > Obj_w) {
    2689             w2 = Obj_w;
    2690           }
    2691 
    2692           if (w2 > 0 && h1 > 0) {
    2693             this.height = (h1);
    2694             this.width = (w2);
    2695           }
    2696 
    2697         }
    2698         name = this.name;
    2699       });
    2700 
    2701 
    2702 
    2703     }
    2704 
    2705   }
    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]));
    2717     }
    2718     wait_resize = false;
    2719     return true;
    2720   }
    2721 
    2722 
    2723   jQuery("#derivativeSwitchBox a").mouseover(function () {
    2724     nu_img = 0;
    2725   });
    2726 
    2727 
    2728   /**/
    2729 
    2730 })(jQuery);
     1885    new_html += '</map>';
     1886    jQuery("#theImage map:last").after(new_html);
     1887   
     1888  });                                                                                                                          // ready
     1889
  • extensions/Autosize/js/autosize.cookie.js

    r16931 r17308  
    154154    jQuery("document").ready(function (jQuery) {
    155155
     156      return;
     157
    156158      // side-menu show/hide
    157      
    158 
    159       var sidemenu = jQuery.cookie('picture-menu');
     159
     160
     161      var sidemenu = jQuery.cookie('picture-menu') || jQuery.cookie('side-menu');
    160162      var menubar = jQuery("#menubar");
    161 return;
     163      //  return;
    162164      if (menubar.length == 1) {
    163165
     
    165167
    166168        // if cookie says the menu is hiding, keep it hidden!
    167         if (sidemenu == 'visible') {
     169        if (sidemenu == 'visible' || sidemenu == 'showing') {
    168170          showMenu(0);
    169171        } else {
  • extensions/Autosize/js/autosize.dimensions.js

    r17192 r17308  
    8080          m[name]['Bottom'] = pos.top + size.height;
    8181        } else {
    82          
     82
    8383          if (name == 'Left' || name == 'Top') {
    8484            m[name] = name == 'Left' ? pos.left : (pos.top);
     
    102102
    103103    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 };
     104      if (Arguments) {
     105        if (Arguments == true) {
     106          Args = { pos_absolute: true || false, pos_externe: Arguments.pos_externe || false };
     107        } else {
     108          Args = { pos_absolute: Arguments.pos_absolute || false, pos_externe: Arguments.pos_externe || false };
     109        }
     110      } else {
     111        Args = { pos_absolute: false, pos_externe: false };
     112      }
     113
    109114
    110115      var width = 0, height = 0;
  • extensions/Autosize/js/conflit.js

    r16931 r17308  
    263263        return new_element;
    264264    }
    265     //=========================================================
     265      //=========================================================
     266
    266267});    // fin extend
    267268
     
    486487}
    487488//====================================
    488 
    489 librairies = new Array;
    490  
     489function Ajout_Ajax() {
     490  if (typeof $.ajax != "function")
     491    $.ajax = function (args) {
     492      return jQuery.ajax(args);
     493    }
     494}
     495   
    491496function save_framework(page) {
    492     // theGategoryPage,theRegisterPage
    493     // thePicturePage
    494     // si admin.php page = "",theIdentificationPage
    495497    try {
    496498        Conflit = { version: cl_version, name: cl_plugin };
     
    500502    if (jQuery('#browser').length > 0) {
    501503        jQuery('#browser').val(browser.browser);
    502   }
     504      }
     505      Ajout_Ajax();
     506
    503507    if (typeof (Parent) == "undefined")
    504508        Parent = "#theImage";
     
    546550})(jQuery);
    547551
    548  
     552
    549553//--------------------------------------------------------------
    550 //=== ajout des fonctions jQuery ===
    551     if (typeof MooTools == "undefined" && typeof Prototype == "undefined") {
    552    //   $ = jQuery.noConflict();
    553    //   jQuery.extend($, jQuery);
    554     } else {
    555  
    556 
    557     /* */
    558     }
  • extensions/Autosize/main.inc.php

    r17192 r17308  
    3333$autosize_controler = new autosize_controler();
    3434add_event_handler('get_admin_plugin_menu_links', array(&$autosize_controler,'cl_autosize_admin')  );
    35  
    3635
    37 add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_script_1'),  EVENT_HANDLER_PRIORITY_NEUTRAL+21  ); 
     36 add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_script_1'),  EVENT_HANDLER_PRIORITY_NEUTRAL   );   
    3837
    3938add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_affiche'), EVENT_HANDLER_PRIORITY_NEUTRAL+21  );
    4039
    41 add_event_handler('loc_end_page_tail',array(&$autosize_controler, 'cl_autosize_script_2'),  EVENT_HANDLER_PRIORITY_NEUTRAL );
     40add_event_handler('loc_end_page_tail',array(&$autosize_controler, 'cl_autosize_script_3'),  EVENT_HANDLER_PRIORITY_NEUTRAL-1);
    4241
    43 //add_event_handler('loc_after_page_header', array(&$autosize_controler, 'autosize_calcContent'),  EVENT_HANDLER_PRIORITY_NEUTRAL-1, 20  );
     42
    4443add_event_handler('render_element_content', array(&$autosize_controler, 'autosize_calcContent'),40,2);
    4544
  • extensions/Autosize/template/autosize.tpl

    r17192 r17308  
    77    cookies :{$cookies} ,
    88    deriv_type :'{$deriv_type}' ,
     9    liste_type:'{$liste_type}'   ,
     10
    911    type_size:'{$deriv_type}' ,
    1012      DEBUG_autosize:'{$DEBUG_autosize}',
  • extensions/Autosize/template/conflit.tpl

    r12527 r17308  
    11{html_head}
     2 <!-- << autosize/template/conflit.tpl  -->
    23<script type="text/javascript">
    34    var DEBUG_autosize = '{$DEBUG_autosize}';
     
    67    var cl_plugin = '{$name}';
    78    var Version_pwg='{$Version_pwg}';
    8 
    9     var Cookie_width='{$COOKIE_WIDTH }';
    10     var Cookie_height = '{$COOKIE_HEIGHT }';
    11 
    129{if $DEBUG_autosize == "true"}
    1310    var cl_query = '{$autosize_parametres->query}';
     
    2118{/if}
    2219</script>
     20 <!--  autosize/template/conflit.tpl >>   -->
     21
    2322{/html_head}
  • extensions/Autosize/template/header.tpl

    r16931 r17308  
    11{if not empty($pamoorama)}
    2   <script  id="pamoorama0.3" src="plugins/paMOOramics/js/pamoorama0.3.js" type="text/jscript"></script>
    3   <script id="mootools" src="plugins/paMOOramics/js/mootools.js" type="text/jscript"></script>
    4 {combine_script id="conflit_script0" load="header" path = $AUTOSIZE_PATH|@cat:"js/conflit_2.js" require="jquery" }
    5 {combine_script id="conflit_script"  path = $AUTOSIZE_PATH|@cat:"js/conflit.js" require="jquery" }
    6 {combine_script id="conflit_script2" load="async" path = $AUTOSIZE_PATH|@cat:"js/conflit_2.js" require="jquery" }
     2{combine_script id="conflit_script"  load="header" path = $AUTOSIZE_PATH|@cat:"js/conflit.js" require="jquery" }
     3{combine_script id="conflit_script0" load="header"  path = $AUTOSIZE_PATH|@cat:"js/conflit_2.js" require="jquery" }
    74{combine_script id="autosize.dimensions" path = $AUTOSIZE_PATH|@cat:"js/autosize.dimensions.js" require="jquery"}
     5{combine_script id="conflit_script1" load="footer" path = $AUTOSIZE_PATH|@cat:"js/conflit_2.js" require="jquery" }
    86
    97{else}
  • extensions/Autosize/template/picture_1.tpl

    r16931 r17308  
    11{combine_script id="Affiche_script" path= $AUTOSIZE_PATH|@cat:"js/Affiche_script.js" require='jquery,autosize.dimensions'  }
    22{if $theme != "elegant"}
    3 {combine_script id="autosize.cookie" path = $AUTOSIZE_PATH|@cat:"js/autosize.cookie.js" require="jquery,Affiche_script"  }{/if}
     3{combine_script id="autosize.cookie" path = $AUTOSIZE_PATH|@cat:"js/autosize.cookie.js" require="jquery"  }{/if}
    44{combine_script id="autosize.dimensions" path = $AUTOSIZE_PATH|@cat:"js/autosize.dimensions.js" require="jquery"}
Note: See TracChangeset for help on using the changeset viewer.