Changeset 7702


Ignore:
Timestamp:
Nov 8, 2010, 3:00:27 PM (13 years ago)
Author:
cljosse
Message:

[Autosize][beta] save

Location:
extensions/Autosize/js
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/Autosize/js/Affiche_script.js

    r7669 r7702  
    1414    jQuery('#bp_cla').attr('Stitle', src_info);
    1515    jQuery('#bp_cla').attr('Stip', " ");
    16     old_w = 0;
    17    
    18     jQuery(window).resize();
     16
     17    jQuery(window).resize( );
    1918}
     19//=================================================================================================
    2020
    2121jQuery(document).ready(
    2222
    23       function (jQuery) {
    24 
    25 
    26           if (DEBUG == "false") {
    27               jQuery("#Debug").hide();
    28               jQuery("#Debug1").hide();
    29               jQuery("#Debug2").hide();
    30           }
    31           var img_top = "0";
    32 
    33           var old_h = 0;
    34           var rapport = -1;
    35           var old_w = 0;
    36 
    37           var llgboframe = jQuery("#gbo div:first");
    38           var marges_llgbo = 0;
    39           if (llgboframe.length > 0) {
    40               ll1 = jQuery(llgboframe).info();
    41               ll2 = jQuery("#gbo div:last").info();
    42               marges_llgbo = (ll1.width - ll2.width) + ll2.borderwidth.left + ll2.borderwidth.right;
    43           }
    44 
    45 
    46           //=========================================================
    47 
    48           function wait_Timer() {
    49               old_w = 0
    50               jQuery(window).resize();
    51               info_pamoorama_outter = jQuery("#pamoorama_outter").info();
    52               if (info_pamoorama_outter.width == 0)
    53                   setTimeout("wait_Timer()", 100);
    54 
    55           }
    56 
    57 
    58           //=============================================================
    59           function cl_Timer() {
    60               //   if (!jQuery.browser.msie) { jQuery(function () { alert(jQuery.browser.version); }); }
    61               if (jQuery.browser.msie && parseInt(jQuery.browser.version) < 8)
    62                   alert(jQuery.browser.version);
    63               panoramaContainer = jQuery(".panorama-container");
    64               n = document.scripts[6]; //12--14affiche_script ;
    65               t = n.src;
    66 
    67               currentPosition = 0 - parseInt(jQuery(panoramaContainer).css('margin-left'));
    68               if (currentPosition == NaN) return;
    69 
    70 
    71               if (currentPosition > 1000)
    72                   jQuery(panoramaContainer).css('margin-left', "0px")
    73               setTimeout("cl_Timer()", 500);
    74           }
    75           //=============================================================
    76           function onPropertyChange(e) {
    77               var el = e.srcElement;
    78               var new_class = el.className;
    79               ID = el.id;
    80               Prop = e.propertyName.split(".");
    81               Property = Prop[1];
    82               if (Property == "display") {
    83                   Valeur = parseInt(el.currentStyle[Property]);
    84                   if (Valeur == "block") {
    85 
    86 
    87                   }
    88               }
    89               return;
    90           }
    91 
    92           /* ready
    93           *
    94           *
    95           */
    96           //============================================================
    97           /*
    98           *
    99           */
    100           function Info_entete(Parent) {
    101 
    102               var info_imageToolBar = jQuery("#imageToolBar").info();
    103               if (info_imageToolBar.position == "absolute") {
    104                   jQuery("#imageToolBar").css("position", "relative");
    105                   jQuery("#imageToolBar").css("top", 0 + "px");
    106               }
    107 
    108               var info_theImage = jQuery("#theImage").info();
    109 
    110               if (info_theImage.position == "relative") {
    111                   //--- passage relative ==> static ===/
    112                   jQuery("#theImage").css("position", "static");
    113                   info_theImage = jQuery("#theImage").info();
    114 
    115               }
    116               if (info_theImage.position == "absolute") {
    117                   //--- passage absolute ==> static ===/
    118                   jQuery("#theImage").css("position", "static");
    119                   info_theImage = jQuery("#theImage").info();
    120 
    121               }
    122 
    123               marge_top = Info_the_page.top +
     23     function (jQuery) {
     24
     25
     26
     27         jQuery(window).load(function () {
     28             jQuery("#theImage").css({
     29                 opacity: '0.0', filter: 'alpha(opacity=  0)'
     30             });
     31             //======= cl_conflit ======
     32             if (DEBUG == "false") {
     33                 jQuery("#Debug").hide();
     34                 jQuery("#Debug1").hide();
     35                 jQuery("#Debug2").hide();
     36             }
     37             var img_top = "0";
     38
     39             var rapport = -1;
     40
     41             var llgboframe = jQuery("#gbo div:first");
     42             var marges_llgbo = 0;
     43             if (llgboframe.length > 0) {
     44                 ll1 = jQuery(llgboframe).infos();
     45                 ll2 = jQuery("#gbo div:last").infos();
     46                 marges_llgbo = (ll1.width - ll2.width) + ll2.borderwidth.left + ll2.borderwidth.right;
     47             }
     48             //=========================================================
     49
     50             jQuery("#theImage").css({
     51             // opacity: '1.0', filter: 'alpha(opacity= 100)'
     52         });
     53
     54
     55         function wait_Timer() {
     56
     57             Resize();
     58
     59         }
     60         //=============================================================
     61         function cl_Timer() {
     62             //   if (!jQuery.browser.msie) { jQuery(function () { alert(jQuery.browser.version); }); }
     63             if (jQuery.browser.msie && parseInt(jQuery.browser.version) < 8)
     64                 alert(jQuery.browser.version);
     65             panoramaContainer = jQuery(".panorama-container");
     66             n = document.scripts[6]; //12--14affiche_script ;
     67             t = n.src;
     68             currentPosition = 0 - parseInt(jQuery(panoramaContainer).css('margin-left'));
     69             if (currentPosition == NaN) return;
     70             if (currentPosition > 1000)
     71                 jQuery(panoramaContainer).css('margin-left', "0px")
     72             setTimeout("cl_Timer()", 500);
     73         }
     74         //=============================================================
     75         function onPropertyChange(e) {
     76             var el = e.srcElement;
     77             var new_class = el.className;
     78             ID = el.id;
     79             Prop = e.propertyName.split(".");
     80             Property = Prop[1];
     81             if (Property == "display") {
     82                 Valeur = parseInt(el.currentStyle[Property]);
     83                 if (Valeur == "block") {
     84
     85
     86                 }
     87             }
     88             return;
     89         }
     90         //============================================================
     91         /*
     92         *
     93         */
     94         function Info_entete(Parent) {
     95
     96             var info_imageToolBar = jQuery("#imageToolBar").infos();
     97             if (info_imageToolBar.position == "absolute") {
     98                 jQuery("#imageToolBar").css("position", "relative");
     99                 jQuery("#imageToolBar").css("top", 0 + "px");
     100             }
     101
     102             var info_theImage = jQuery("#theImage").infos();
     103
     104             if (info_theImage.position == "relative") {
     105                 //--- passage relative ==> static ===/
     106                 jQuery("#theImage").css("position", "static");
     107                 info_theImage = jQuery("#theImage").infos();
     108
     109             }
     110             if (info_theImage.position == "absolute") {
     111                 //--- passage absolute ==> static ===/
     112                 jQuery("#theImage").css("position", "static");
     113                 info_theImage = jQuery("#theImage").infos();
     114
     115             }
     116
     117             marge_top = Info_the_page.top +
    124118                                     Info_the_page.borderwidth.top +
    125119                                     info_theImage.borderwidth.top;
    126120
    127               img_top = info_theImage.top + info_theImage.borderwidth.top;
    128               return { marge_top: marge_top, img_top: img_top };
    129 
    130           }
    131 
    132           /* Récupère les informations sur la description.
    133           *
    134           */
    135           function Info_description(Parent) {
    136               //  jQuery("#" + Parent + " p:not(:contains(' ')) ").remove();
    137               //=============================================================================
    138               var info_description = { top: 0, bottom: 0, height: 0 };
    139               if (theme.match(RegExp("simple", "gi"))) {
    140                   jQuery("#" + Parent).css({ padding: "0px",
    141                       marginLeft: "0px",
    142                       marginRight: "auto",
    143                       marginTop: "0px",
    144                       marginBottom: "0px", position: "absolute", top: Bandeau + "px"
    145                   });
    146               } else {
    147 
    148                   jQuery("#" + Parent).css({ padding: "0px",
    149                       marginLeft: "auto",
    150                       marginRight: "auto",
    151                       marginTop: "0px",
    152                       marginBottom: "0px"
    153                   });
    154 
    155 
    156               }
    157 
    158 
    159               //   jQuery("#" + Parent + " p").css({ padding: "0px", margin: "0px "    });
    160 
    161 
    162               if (theme.match(RegExp("luciano", "g"))) {
    163                   info_img = jQuery("#" + Parent + " #theImg img").info();
    164 
    165               } else {
    166 
    167                   info_img = jQuery("#" + Parent + " img").info();
    168               }
    169 
    170               info_description.marge = { bottom: info_img.padding.bottom + info_img.margin.bottom + info_img.borderwidth.bottom,
    171                   top: info_img.padding.top + info_img.borderwidth.top
    172               }
    173 
    174               info_description.top = info_img.bottom + info_img.margin.bottom + info_img.borderwidth.bottom;
    175               //=============================================================================
    176               info_gbo = jQuery("#gbo").info();
    177               if (info_description.top < info_gbo.bottom)
    178                   info_description.top = info_gbo.bottom;
    179               //=============================================================================
    180               info_desc = jQuery("#" + Parent + " p:first").info();
    181               if (info_desc.bottom < info_img.bottom)
    182                   info_desc.bottom = info_img.bottom;
    183 
    184               //  if (info_desc.top > info_img.bottom)
    185               //     info_description.top = info_desc.top;
    186 
    187               if (jQuery("#Panorama").length) {
    188                   Type_Img = "panorama";
    189                   //  cl_visible = false;
    190 
    191               }
    192               info_table = jQuery(".infoTable").info();
    193 
    194               if (info_table.top > info_description.bottom)
    195                   info_description.bottom = info_table.top;
    196               //===========================================================================
    197 
    198               info_licencetag = jQuery(".licencetag").info();
    199 
    200 
    201               if (info_licencetag.bottom > 0) {
    202                   jQuery(".licencetag").css("border", "solid 5px transparent");
    203                   if (info_licencetag.bottom > info_description.bottom) {
    204                       info_description.bottom = info_licencetag.bottom;
    205                   }
    206                   else
    207                       info_description.bottom += info_table.margin.top + info_table.padding.top;
    208 
    209               }
    210               //=============================================================================
    211               if (theme.match(RegExp("gally", "gi"))) {
    212                   if (!theme.match(RegExp("lapis", "gi"))) {
    213                       info_description.bottom = info_description.bottom
    214                   }
    215               }
    216 
    217 
    218 
    219 
    220 
    221               if (info_description.top < 1)
    222                   info_description.top = info_description.bottom;
    223 
    224 
    225               if (info_description.bottom < info_description.top) {
    226                   info_description.bottom = info_description.top;
    227 
    228                   info_desc = jQuery("#" + Parent + " p:last").info();
    229 
    230                   if (info_desc.bottom > info_img.bottom)
    231                       info_description.bottom = info_desc.bottom;
    232               }
    233 
    234 
    235               if (theme.match(RegExp("gally", "g"))) {
    236                   if (!theme.match(RegExp("lapis", "gi"))) {
    237                       info_copyright = jQuery("#copyright").info();
    238                       info_description.bottom += info_copyright.height;
    239                   }
    240               }
    241 
    242               if (theme.match(RegExp("luciano", "g"))) { info_description.bottom -= 30 }
    243 
    244               info_description.height = info_description.bottom - info_description.top;
    245 
    246 
    247               if (DEBUG == "true") {
    248 
    249                   /*  jQuery("#Debug").text(jQuery("#Debug").text() + user_status);   
     121             img_top = info_theImage.top + info_theImage.borderwidth.top;
     122             return { marge_top: marge_top, img_top: img_top };
     123
     124         }
     125
     126         /* Récupère les informations sur la description.
     127         *
     128         */
     129         function Info_description(Parent) {
     130             //  jQuery("#" + Parent + " p:not(:contains(' ')) ").remove();
     131             //=============================================================================
     132             var info_description = { top: 0, bottom: 0, height: 0 };
     133             if (theme.match(RegExp("simple", "gi"))) {
     134                 jQuery("#" + Parent).css({ padding: "0px",
     135                     marginLeft: "0px",
     136                     marginRight: "auto",
     137                     marginTop: "0px",
     138                     marginBottom: "0px", position: "absolute", top: Bandeau + "px"
     139                 });
     140             } else {
     141
     142                 jQuery("#" + Parent).css({ padding: "0px",
     143                     marginLeft: "auto",
     144                     marginRight: "auto",
     145                     marginTop: "0px",
     146                     marginBottom: "0px"
     147                 });
     148
     149
     150             }
     151             //   jQuery("#" + Parent + " p").css({ padding: "0px", margin: "0px "    });
     152             if (theme.match(RegExp("luciano", "g"))) {
     153                 info_img = jQuery("#" + Parent + " #theImg img").infos();
     154
     155             } else {
     156
     157                 info_img = jQuery("#" + Parent + " img").infos();
     158             }
     159
     160             info_description.marge = { bottom: info_img.padding.bottom + info_img.margin.bottom + info_img.borderwidth.bottom,
     161                 top: info_img.padding.top + info_img.borderwidth.top
     162             }
     163
     164             info_description.top = info_img.bottom + info_img.margin.bottom + info_img.borderwidth.bottom;
     165             //=============================================================================
     166             info_gbo = jQuery("#gbo").infos();
     167             if (info_description.top < info_gbo.bottom)
     168                 info_description.top = info_gbo.bottom;
     169             //=============================================================================
     170             info_desc = jQuery("#" + Parent + " p:first").infos();
     171             if (info_desc.bottom < info_img.bottom)
     172                 info_desc.bottom = info_img.bottom;
     173
     174             //  if (info_desc.top > info_img.bottom)
     175             //     info_description.top = info_desc.top;
     176
     177             if (jQuery("#Panorama").length) {
     178                 Type_Img = "panorama";
     179                 //  cl_visible = false;
     180
     181             }
     182             info_table = jQuery(".infoTable").infos();
     183
     184             if (info_table.top > info_description.bottom)
     185                 info_description.bottom = info_table.top;
     186             //===========================================================================
     187
     188             info_licencetag = jQuery(".licencetag").infos();
     189
     190
     191             if (info_licencetag.bottom > 0) {
     192                 jQuery(".licencetag").css("border", "solid 5px transparent");
     193                 if (info_licencetag.bottom > info_description.bottom) {
     194                     info_description.bottom = info_licencetag.bottom;
     195                 }
     196                 else
     197                     info_description.bottom += info_table.margin.top + info_table.padding.top;
     198
     199             }
     200             //=============================================================================
     201             if (theme.match(RegExp("gally", "gi"))) {
     202                 if (!theme.match(RegExp("lapis", "gi"))) {
     203                     info_description.bottom = info_description.bottom
     204                 }
     205             }
     206
     207
     208
     209
     210
     211             if (info_description.top < 1)
     212                 info_description.top = info_description.bottom;
     213
     214
     215             if (info_description.bottom < info_description.top) {
     216                 info_description.bottom = info_description.top;
     217
     218                 info_desc = jQuery("#" + Parent + " p:last").infos();
     219
     220                 if (info_desc.bottom > info_img.bottom)
     221                     info_description.bottom = info_desc.bottom;
     222             }
     223
     224
     225             if (theme.match(RegExp("gally", "g"))) {
     226                 if (!theme.match(RegExp("lapis", "gi"))) {
     227                     info_copyright = jQuery("#copyright").infos();
     228                     info_description.bottom += info_copyright.height;
     229                 }
     230             }
     231
     232             if (theme.match(RegExp("luciano", "g"))) { info_description.bottom -= 30 }
     233
     234             info_description.height = info_description.bottom - info_description.top;
     235
     236
     237             if (DEBUG == "true") {
     238
     239                 /*  jQuery("#Debug").text(jQuery("#Debug").text() + user_status);   
    250240       
    251241
    252                   info_description.width = "800";
    253                   */
    254                   jQuery("#Debug").css('display', 'block');
    255                   jQuery("#Debug1").show();
    256                   jQuery("#Debug2").show();
    257                   Bandeau_bas = info_description;
    258 
    259                   jQuery("#Debug").css({
    260                       filter: 'alpha(opacity:50)',
    261                       position: "absolute",
    262                       width: "800px",
    263                       border: "solid 1px green",
    264                       top: Bandeau + "px"
    265                   });
    266                   jQuery("#Debug").text("Debug:Bandeau : " + Bandeau);
    267 
    268                   jQuery("#Debug1").css({
    269                       filter: 'alpha(opacity:50)',
    270                       position: "absolute",
    271                       border: "solid 1px green",
    272                       top: Bandeau_bas.top + "px",
    273                       width: (200) + "px",
    274                       height: Bandeau_bas.height + "px"
    275                   });
    276                   jQuery("#Debug1").text("Debug1:Bandeau_bas top : " + Bandeau_bas.top + " height:" + Bandeau_bas.height);
    277 
    278                   jQuery("#Debug2").css({
    279                       filter: 'alpha(opacity:50)',
    280                       position: "absolute",
    281                       left: '50px',
    282                       width: (300) + "px",
    283                       border: "solid 1px green", top: Bandeau_bas.bottom + "px"
    284                   });
    285                   jQuery("#Debug2").text("Debug2:Bandeau_bas bottom :" + Bandeau_bas.bottom);
    286 
    287               }
    288 
    289               if (check_desc_v != 'checked="checked"') {
    290                   info_description.height = 0;
    291               }
    292 
    293               return info_description;
    294 
    295           }
    296 
    297           /*
    298           *
    299           */
    300           jQuery("#pamoorama_iner").bind('resize', function () {
    301               wait_Timer();
    302           })
    303           //============================================================//==
    304           jQuery("#pamoorama_outter").bind('resize', function () {
    305               wait_Timer();
    306           })
    307 
    308 
    309 
    310           //============================================================
    311           jQuery("#iGMapsIcon").bind('resize', function () {
    312               jQuery().recentrage_widget();
    313           })
    314           jQuery("#icon_gmaps").bind('click', function () {
    315               jQuery().recentrage_widget();
    316           })
    317 
    318 
    319 
    320 
    321 
    322 
    323           /* jQuery */
    324           var img_init = { height: img_height, width: img_width };  // taille initiale
    325           var img_defaut = { height: scaled_height, width: scaled_width };
    326           var img_reelle = { height: img_height, width: img_width };
    327           var img_finale = { height: 0, width: 0 };
    328           var Zone_Affichage = { height: 0, width: 0 };
    329 
    330           //============================================================
    331 
    332           var Info_the_page = jQuery("#the_page").info();
    333           var Zone_Affichage = jQuery("#theImage").info();
    334 
    335           var Bandeau = 0;
    336           var Bandeau_t = Info_entete("theImage")
    337           Bandeau = Bandeau_t.img_top;
    338           var Bandeau_bas = 0;
    339           Bandeau_bas = Info_description("theImage");
    340           //===================================================================
    341           /*
    342           * window .resize
    343           */
    344           jQuery(window).resize(function (event, ui) {
    345               if (typeof (event) == 'undefined') return;
    346               if (!cl_visible == true) return;
    347               if (eval(user_status + "_enabled") == "") return;
    348               var chk = eval(user_status + "_enabled");
    349 
    350 
    351 
    352               //==========================================================================
    353               var winwidth = jQuery(window).width();
    354               var winheight = jQuery(window).height();
    355               if (old_w == winwidth && old_h == winheight) return;
    356 
    357 
    358 
    359 
    360               if (old_w != winwidth)
    361               { old_w = winwidth; }
    362               else
    363               { if (old_h != winheight) old_h = winheight; }
    364               //===========================================================================
    365 
    366 
    367               var Type_Img = "";
    368               //====== détection du type d'images ======
    369               if (jQuery("#charlie").length > 0) {
    370                   Type_Img = "charlie";
    371               } else if (jQuery("#pamoorama").length) {
    372                   Type_Img = "pamoorama";
    373               } else if (jQuery("#theImage embed").length > 0) {
    374                   Type_Img = "embed";
    375               } else if (jQuery("#map").length) {
    376                   Type_Img = "map";
    377               } else if (jQuery("#Panorama").length) {
    378                   Type_Img = "panorama";
    379               } else if (jQuery("#theImage").find("img").length > 0) {
    380                   Type_Img = "img";
    381               } else if (jQuery("img").length > 0) {
    382                   Type_Img = "img_autre";
    383                   return;
    384               } else {
    385                   return;
    386               }
    387 
    388 
    389 
    390               var Cadre = jQuery("#theImage").get(0);
    391               var info_Cadre = jQuery(Cadre).info();
    392               //===============  Information cadre ======
    393               var info_the_page = jQuery("#the_page").info();
    394 
    395               //=============================================================================
    396               var info_HeaderBar = jQuery("#imageHeaderBar").info();
    397 
    398               var info_content = jQuery("#content").info();
    399 
    400 
    401               var info_titrePage = jQuery("#titrePage").info();
    402 
    403 
    404               var Zone_Affichage = jQuery("#theImage").info();
    405 
    406               var info_ToolBar = jQuery("#imageToolBar").info();
    407               var info_imageInfoBar = jQuery("#imageInfoBar").info();
    408               var info_theHeader = jQuery("#theHeader").info();
    409 
    410 
    411               var marge = 0;
    412               if (info_ToolBar.width > 0)
    413                   marge = (Zone_Affichage.width - info_ToolBar.width) / 2;
    414 
    415               var marge_right = marge;
    416               var marge_left = marge;
    417 
    418               if (info_content.width > 100) {
    419                   marge_left = 0;
    420                   marge_right = info_imageInfoBar.margin.left + info_imageInfoBar.margin.right;
    421                   winwidth = info_content.width;
    422                   marge_right = info_imageInfoBar.width + marge_right;
    423 
    424               }
    425               else
    426                   winwidth = Zone_Affichage.width;
    427 
    428               winwidth -= (marge_right + marge_left);
    429 
    430 
    431 
    432 
    433               if (Type_Img == "pamoorama") {
    434                   var info_pamoorama = jQuery("#pamoorama").info();
    435                   var info_pamoorama_outter = jQuery("#pamoorama_outter").info();
    436                   var info_pamoorama_inner = jQuery("#pamoorama_inner").info();
    437                   var info_pamoorama_footer = jQuery("#pamoorama_footer").info();
    438                   TheImg = jQuery("#pamoorama");
    439                   if (typeof (myPamoorama) == "undefined") {
    440 
    441                       return
    442 
    443                   }
    444                  
    445 
    446          
    447                   po = myPamoorama;
    448 
    449                   /*
    450                   myPamoorama = new pamoorama('pamoorama',{ activateSlider:     {$PANO_ACTIVATESLIDER},
    451                   width:                {$PANO_WIDTH},
    452                   footercolor:          '{$PANO_FOOTERCOLOR}',
    453                   captioncolor:         '{$PANO_CAPTIONCOLOR}',
    454                   caption:              '{$ALT_IMG}',
    455                   enableAutoscroll:     {$PANO_ENABLEAUTOSCROLL},
    456                   autoscrollSpeed:      {$PANO_AUTOSCROLLSPEED},
    457                   autoscrollOnLoad:     {$PANO_AUTOSCROLLONLOAD},
    458                   startAutoscroll:      '{'pamooramics_startAutoscroll'|@translate}',
    459                   stopAutoscroll:               '{'pamooramics_stopAutoscroll'|@translate}',
    460                   loadingMessage: '{'pamooramics_loading'|@translate}',
    461                   clickMessage:         '{'pamooramics_clickMessage'|@translate}',
    462                   dragMessage:          '{'pamooramics_dragMessage'|@translate}'
    463                   });
    464                   */
    465                   /*
    466                   pamoorama_outter
    467                   pamoorama_inner
    468                   pamoorama_footer
    469                   pamoorama_caption
    470                   pamoorama_thumb
    471                   pamoorama_frame
    472                   */
    473               } else {
    474                   //==== récupère Img la plus grande  =====
    475                   if (jQuery("#theImg")) IMG = "#theImg";
    476                   else IMG = Cadre;
    477 
    478                   TheImg2 = Get_Img_Maxi(IMG + " img");
    479                   //=================================================================
    480                   if (TheImg2 == null) {
    481                       if (jQuery(Cadre).find("img").length > 0) {
    482                           IMG = Cadre;
    483                           TheImg = Get_Img_Maxi("#theImage img");
    484                       }
    485                   } else {
    486                       TheImg = TheImg2  //luciano ?
    487 
    488                   }
    489               }
    490               //=================================================================
    491 
    492 
    493               switch (Type_Img) {
    494                   case "map":
    495                       var info_image = jQuery("#map").info();
    496 
    497                       var info_map = jQuery("#mapPicture").info();
    498 
    499                       marge_left = info_map.width;
    500                       jQuery("#map").css("left", marge_left);
    501 
    502                       var TheImg = jQuery("#map").get(0);
    503                       img_reelle.height = info_image.height;
    504                       img_reelle.width = winwidth - marge_right - marge_right;
    505                       Bandeau_bas.height = 10;
    506                       marge_right = 10;
    507 
    508                       info_the_page = jQuery("#the_page").info();
    509                       ;
    510 
    511                       break
    512 
    513 
    514                   case "panorama":
    515                       // return;
    516 
    517 
    518                       TheImg = Get_Img_Maxi("#Panorama img");
    519                       info_theImage = jQuery(TheImg).info();
    520                       info_the_page = jQuery("#the_page").info();
    521 
    522                       break
    523                   case "img":
    524 
    525                       if (!TheImg) return;
    526                       if (theme.match(RegExp("luciano", "g"))) {
    527                           TheImg = jQuery("#the_page #theImg");
    528                       }
    529                       info_theImage = jQuery(TheImg).info();
    530                       info_the_page = jQuery("#the_page").info();
    531 
    532 
    533                       break
    534                   case "img_autre":
    535                       if (!TheImg) return;
    536                       info_theImage = jQuery(TheImg).info();
    537                       info_the_page = jQuery("#the_page").info();
    538 
    539 
    540                       break
    541                   case "embed":
    542                       //
    543 
    544                       TheImg = jQuery(Cadre).find("embed");
    545 
    546                       info_theImage = jQuery(Cadre).info();
    547                       info_the_page = jQuery("#the_page").info();
    548                       if (rapport < 0) {
    549                           img_height = parseInt(jQuery(TheImg).outerHeight());
    550                           img_width = parseInt(jQuery(TheImg).outerWidth());
    551 
    552                           img_reelle.height = img_height;
    553                           img_reelle.width = img_width;
    554 
    555                       }
    556 
    557                       break
    558                   case "charlie":
    559 
    560                       TheImg = jQuery('#charlie object').get(0);
    561                       info_theImage = jQuery(Cadre).info();
    562                       info_the_page = jQuery("#the_page").info();
    563                       if (rapport < 0) {
    564                           img_height = parseInt(TheImg.height);
    565                           img_width = parseInt(TheImg.width);
    566 
    567                           img_reelle.height = parseInt(TheImg.height);
    568                           img_reelle.width = parseInt(TheImg.width);
    569                       }
    570 
    571                       break
    572                   case "pamoorama":
    573                       //=========================================================
    574 
    575 
    576                       if (typeof (myPamoorama.imageHeight) == "undefined") {
    577                            old_w = 0;
    578                           return;
    579                       }
    580 
    581                       img_reelle.height = myPamoorama.imageHeight;
    582                       img_reelle.width = myPamoorama.imageWidth;
    583                       TheImg = myPamoorama.image;
    584                       info_theImage = jQuery("#pamoorama").info();
    585                       info_the_page = jQuery("#the_page").info();
    586 
    587                       break
    588 
    589 
    590               }
    591 
    592               //=============== Vérification taille minimale  autorizée ======================
    593               var miniWidth = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("min-width"), mini_width);
    594               miniHeight = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("min-height"), mini_height);
    595 
    596 
    597               var maxWidth = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("max-width"), winwidth, "0");
    598               maxHeight = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("max-height"), winheight, "0");
    599 
    600               mini_width = parseInt(miniWidth);
    601               mini_height = parseInt(miniHeight);
    602 
    603               img_reelle.width = parseInt(img_reelle.width);
    604 
    605 
    606               if (img_reelle.width < mini_width) return;
    607 
    608               img_reelle.height = parseInt(img_reelle.height);
    609               if (img_reelle.height < parseInt(mini_height)) return;
    610               //==================================================================================   
    611               if (rapport < 0) {
    612 
    613                   img_init.height = parseInt(img_height);
    614                   img_init.width = parseInt(img_width);
    615 
    616                   rapport = img_width / img_height;
    617 
    618                   if (Type_Img != "map")
    619                       rapport = (img_init.width / img_init.height);
    620                   else
    621                       rapport = 0;
    622 
    623               }
    624 
    625 
    626               //=============== Zone d'affichage ============================
    627 
    628               borderW = Zone_Affichage.borderwidth.left;
    629               borderW += Zone_Affichage.borderwidth.right;
    630 
    631 
    632               Zone_Affichage.width = winwidth - borderW;
    633 
    634 
    635 
    636               var Licence = jQuery(".licencetag");
    637               info_Licence = jQuery(".licencetag").info();
    638 
    639               jQuery("#theImage #theImg IMG").css("marginTop", "0px")
    640               //========== Correction en fonction du thème =============================
    641               var correction = 0;
    642               if (theme.match(RegExp("sobre", "g"))) {
    643 
    644                   correction = -info_Licence.padding.top;
    645 
    646               } else if (theme.match(RegExp("Pure", "g"))) {
    647                   correction += 0; //??
    648               } else if (theme.match(RegExp("luciano", "g"))) {
    649                   correction = 0; //??
    650 
    651               } else if (theme.match(RegExp("simple", "g"))) {
    652                   correction += 0; //??
    653               } else if (theme.match(RegExp("gally", "g"))) {
    654                   correction += 0; //??
    655 
    656               }
    657               //================ Licence  ========================
    658 
    659               if (Licence.length > 0) {
    660                   jQuery(".licencetag").css("padding", "0px");
    661 
    662               }
    663               //====================================================
    664               info_img = jQuery(TheImg).info();
    665 
    666 
    667 
    668               img_top = Bandeau;
    669 
    670               Marge_Basse = parseInt(marge_basse || 0); // hors bandeau
    671               //==========================================================================
    672               h = 0;
    673               Zone_Affichage.height = winheight - Bandeau - Marge_Basse - correction;
    674               var Image_height = Zone_Affichage.height - Bandeau_bas.height - Bandeau_bas.marge.top - Bandeau_bas.marge.bottom;
    675 
    676               //=============================================================
    677               var height_user = eval(user_status + "_height");
    678               var reg1 = new RegExp("%", "g");
    679               if (height_user.match(reg1))
    680                   Image_height = Image_height * parseInt(height_user) / 100;
    681               else
    682                   Image_height = parseInt(height_user);
    683 
    684               echelle_max = parseFloat(echelle_max, '3');
    685               var echelle = parseFloat(Image_height / img_reelle.height, 3);
    686 
    687               if (echelle > echelle_max) { echelle = echelle_max; }
    688               Image_height = parseInt(img_reelle.height * echelle);
    689               //============================================================
    690 
    691               var Image_width;
    692               if (rapport > 0)
    693                   Image_width = parseInt(Image_height * rapport);
    694               else if (Type_Img == "map") {
    695                   Image_width = Zone_Affichage.width - marge_left - marge_right;
    696               } else {
    697                   Image_width = Zone_Affichage.width;
    698               }
    699 
    700               //===============================================================
    701               align_auto = "center";
    702               if (jQuery("#theImg").css("textAlign"))
    703                   align_auto = jQuery("#theImg").css("textAlign");
    704               var widthmin = winwidth;
    705 
    706               if (check_auto_w == 'checked="checked"') {
    707                   // if (Type_Img != "pamoorama" && Type_Img != "panorama" ) {
    708                   //==== largeur à atteindre ===
    709                   var width_user = eval(user_status + "_width");
    710                   // Largeur maximale en fonction du statut
    711                   if (width_user.match(reg1))
    712                   // pourcentage
    713                       widthmin = widthmin * parseInt(width_user) / 100;
    714                   else
    715                       widthmin = parseInt(width_user);
    716                   var marges = marges_llgbo;
    717                   widthmin -= info_img.borderwidth.left;
    718                   widthmin -= info_img.borderwidth.right;
    719 
    720                   widthmin -= marges;
    721                   if (Image_width > widthmin) {
    722                       //   Image_width largeur à atteindre
    723                       //  Calcul du rapport d'agrandissement
    724                       var echelle_w = parseFloat((widthmin) / img_reelle.width, 3);
    725                       if (echelle_w > echelle_max) { echelle_w = echelle_max; }
    726                       Image_width = parseInt(img_reelle.width * echelle_w);
    727                       if (rapport > 0)
    728                           Image_height = parseInt(Image_width / rapport);
    729                   }
    730 
    731 
    732 
    733               }
    734 
    735 
    736               // }
    737               //===================================================
    738 
    739 
    740 
    741               zoom = echelle;
    742               //=============LLGBO2 ===========================
    743 
    744 
    745               if (marges_llgbo > 0) {
    746 
    747                   t1 = jQuery(llgboframe).info();
    748                   if (!TheImg.src) {
    749                       TheImg = jQuery(TheImg).find("img").get(0)
    750                   }
    751                   if (TheImg.src) {
    752 
    753                       Image_width -= marges_llgbo; // réduction frame
    754                       Image_height -= marges_llgbo; // réduction frame
    755                       if (rapport > 1) {
    756                           if (Image_width > winwidth) {
    757                               jQuery("#gbo").outerWidth(winwidth);
    758                               jQuery("#gbo").css("width", winwidth + "px");
    759                           }
    760                           else {
    761                               jQuery("#gbo").outerWidth(Image_width);
    762                               jQuery("#gbo").css("width", Image_width + "px");
    763                           }
    764 
    765                           t1 = jQuery("#gbo div:last").info();
    766 
    767                           Image_width = t1.width - (t1.borderwidth.left + t1.borderwidth.right);
    768                           Image_height = parseInt(Image_width / rapport);
    769 
    770                           jQuery("#gbo").outerHeight(Image_height + marges_llgbo);
    771                           jQuery("#gbo").css("height", (Image_height + marges_llgbo) + "px");
    772                           if (jQuery.browser.msie) {
    773                               jQuery("#gbo").css("paddingBottom", 17 + "px");
    774                           }
    775 
    776                       } else {
    777                           Image_height -= 4;
    778                           Image_width -= 4;
    779                           if (Image_width > winwidth) {
    780                               jQuery("#gbo").outerWidth(winwidth);
    781                               jQuery("#gbo").css("width", winwidth + "px");
    782                           }
    783                           else {
    784                               jQuery("#gbo").outerWidth(Image_width);
    785                               jQuery("#gbo").css("width", Image_width + "px");
    786                           }
    787 
    788                           jQuery("#gbo").css("height", (Image_height + marges_llgbo) + "px");
    789                           jQuery("#gbo").height(Image_height + marges_llgbo);
    790 
    791                           jQuery("#gbo").css("width", Image_width + marges_llgbo + "px");
    792                           jQuery("#gbo").width(Image_width + marges_llgbo);
    793 
    794 
    795 
    796                           if (jQuery.browser.msie) {
    797                               jQuery("#gbo").css("paddingBottom", 17 + "px");
    798                           }
    799 
    800                       }
    801                       //  jQuery("#" + Parent + " p:not(:contains(' ')) ").remove();
    802                       a0 = jQuery("area[rel!=up][rel!=prev][rel!=next]");
    803                       a1 = jQuery("area[rel=prev]");
    804                       a2 = jQuery("area[rel=next]");
    805                       a3 = jQuery("area[rel=up]");
    806                       nb_zone = 3;
    807                       if (a1.length == 0) {
    808                           nb_zone -= 1;
    809                       }
    810                       if (a2.length == 0) {
    811                           nb_zone -= 1;
    812                       }
    813 
    814 
    815                       var Largeur_zone = (Image_width / nb_zone);
    816                       var Hauteur_zone = (Image_height);
    817                       var init_zone = 0;
    818 
    819                       if (a1.length > 0) {
    820                           coord = { x0: init_zone, y0: 0, x1: Largeur_zone, y1: Hauteur_zone };
    821 
    822                           jQuery("area[rel=prev]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" });
    823                           init_zone += Largeur_zone;
    824                       }
    825 
    826                       coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: Image_height };
    827 
    828                       if (a0.length > 0) {
    829                           jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1 / 2) + "'" });
    830                           jQuery(a0).attr({ coords: "'" + coord.x0 + "," + (coord.y1 / 2) + "," + coord.x1 + "," + (coord.y1) + "'" });
    831                       } else {
    832                           jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1) + "'" });
    833                       }
    834                       init_zone += Largeur_zone;
    835 
    836                       if (a2.length > 0) {
    837                           coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: Image_height };
    838                           jQuery("area[rel=next]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" });
    839                       }
    840                   }
    841               }
    842 
    843               //================ Zone affichage =========================
    844               //  Image_height, Image_width = valeur a atteindre.
    845               if (theme.match(RegExp("luciano", "g"))) {
    846                   //---- information en dehors du cadre
    847                   Zone_Affichage.height -= Bandeau_bas.height;
    848                   jQuery(Cadre).height(Zone_Affichage.height);
    849 
    850               }
    851 
    852               //=========================================================
    853 
    854               //  jQuery(Cadre).css("top", "0px");
    855               jQuery("#standard").css("top", 0 + "px");
    856               jQuery("#comments").css("top", 0 + "px");
    857 
    858 
    859               jQuery(Cadre).width(Zone_Affichage.width);
    860 
    861               //==============================================================
    862 
    863               img_finale.height = Image_height;
    864               img_finale.width = Image_width;
    865 
    866               //=========================================================================
    867 
    868 
    869               if (typeof (gmaps) != "undefined") {
    870                   Gmap_ = gmaps.maps[0];
    871                   if (Gmap_.sizeMode == 'A') {
    872                       jQuery("#iGMapsIcon").css({ width: old_w * 0.8 + "px", height: old_h * 0.8 + "px" });
    873 
    874                   }
    875               }
    876               //==============================================================
    877               if (Type_Img == "charlie") {
    878                   t1 = jQuery("#charlie").info();
    879                   /**/
    880                   pdf = 2 * parseInt(jQuery(".none_2").css("paddingRight"));
    881                   jQuery("#charlie").css({
    882                       width: Image_width + pdf,
    883                       height: Image_height,
    884                       margin: "auto"
    885                   });
    886 
    887 
    888                   jQuery("#player").css("width", Image_width + 100 + "px");
    889                   jQuery("#player").css("height", Image_height);
    890 
    891                   jQuery("#embedplayer").css("width", Image_width);
    892                   jQuery("#embedplayer").css("height", Image_height);
    893 
    894 
    895                   jQuery("object").width(Image_width);
    896                   jQuery("object").height(Image_height);
    897               } else if (Type_Img == "panorama") {
    898 
    899                   // -----     jQuery(TheImg).panorama2(img_finale.height, img_finale.width);
    900                   // jQuery(TheImg).height(img_finale.height);
    901                   // jQuery(TheImg).width(img_finale.width);
    902                   jQuery("#Panorama div").height(Image_height);
    903                   //  class=simple_panorama
    904 
    905                   jQuery(".panorama-viewport").css("left", "2px");
    906                   jQuery(".panorama-viewport").css("width", "auto");
    907                   //   setTimeout("cl_Timer()", 500);
    908 
    909               } else if (Type_Img == "pamoorama") {
    910 
    911                   img_height = myPamoorama.imageHeight
    912 
    913                   marge_left += 0;
    914                   new_width = Zone_Affichage.width - marge_right - marge_left;
    915                   new_width -= 4;
    916                   jQuery("#pamoorama").css({ marginLeft: "auto",
    917                       marginRight: "auto",
    918 
    919                       height: Image_height + info_pamoorama_footer.height + "px",
    920                       width: new_width + "px"
    921                   });
    922 
    923                   myPamoorama.options.width = new_width;
    924                   jQuery("#pamoorama").width(new_width);
    925 
    926 
    927 
    928 
    929                   jQuery("#pamoorama_outter").css({
    930                       left: marge_left + "px",
    931                       height: myPamoorama.imageHeight + "px",
    932                       width: (new_width) + "px"
    933                   });
    934                   jQuery("#pamoorama_outter").width(new_width);
    935                   h = info_theImage.height;
    936                   jQuery("#pamoorama").css({ height: h + "px" });
    937 
    938                   jQuery("#pamoorama_footer").width(new_width);
    939                   jQuery("#pamoorama_footer").css('width', new_width + "px");
    940 
    941                   jQuery("#linkNext").css({ width: "200px", overflow: "hidden" });
    942                   jQuery("#linkPrev").css({ width: "200px", overflow: "hidden" });
    943                   zoom = Image_height / img_height;
    944                  
    945 
    946 
    947 
    948               } else if (TheImg.src) {
    949                   //--- background ?? ---
    950                   jQuery(TheImg).height(img_finale.height);
    951                   jQuery(TheImg).width(img_finale.width);
    952                   jQuery(TheImg).css("height", img_finale.height + "px");
    953                   jQuery(TheImg).css("width", img_finale.width + "px");
    954 
    955               } else {
    956                   //===map ? ===
    957                   jQuery(TheImg).height(img_finale.height);
    958                   jQuery(TheImg).width(img_finale.width);
    959                   jQuery(TheImg).css("height", img_finale.height + "px");
    960                   jQuery(TheImg).css("width", img_finale.width + "px");
    961 
    962               }
    963 
    964               /*
    965               jQuery("#Debug1").css({
    966               position: "absolute",
    967               top: Bandeau + "px",
    968               textAlign: align_auto,
    969               margin: "0px auto",
    970 
    971 
    972               border: "solid 1px red",
    973 
    974               width: Image_width + "px",
    975               height: Image_height + "px"
    976 
    977               });
    978               //===================================================
    979               jQuery("#Debug2").css({ position: "absolute",
    980               left: Zone_Affichage.left + 'px',
    981               border: "solid 1px green",
    982               top: Zone_Affichage.top + "px",
    983               width: Zone_Affichage.width / 2 + "px",
    984               height: Zone_Affichage.height + "px"
    985 
    986               });
    987               jQuery("#Debug2").text(info_Cadre.bottom);
    988               */
    989 
    990               try {
    991                   if (theme.match(RegExp("gally", "g"))) {
    992 
    993                       //===========================================================================
    994 
    995                       if (jQuery("#navThumbPrev").length > 0) {
    996                           jQuery("#navThumbPrev").css({ height: info_img.height + "px",
    997                               top: info_img.top + 20 + "px"
    998                           });
    999                       }
    1000                       if (jQuery("#navThumbNext").length > 0) {
    1001                           jQuery("#navThumbNext").css({ height: info_img.height + "px",
    1002                               top: info_img.top + 20 +"px"
    1003                           });
    1004                       }
    1005                       if (!theme.match(RegExp("lapis", "gi"))) { }
    1006                   } else if (theme.match(RegExp("simple", "g"))) {
    1007 
    1008                       jQuery("#imageToolBar").css("position", "static");
    1009                       info_imageInfoBar = jQuery("#imageInfoBar").info();
    1010                       if (info_imageInfoBar.bottom < info_img.bottom) {
    1011                           jQuery("#imageInfoBar").height(info_img.bottom);
    1012                       }
    1013 
    1014                   } else {
    1015 
    1016                       //    jQuery("#imageToolBar").css("position", "static");
    1017                   }
    1018               } catch (e) {
    1019 
    1020               }
    1021               // 
    1022               if (!pos) pos = jQuery("#copyright").info();
    1023               if (pos != jQuery("#copyright").info())
    1024                   pos = jQuery("#copyright").info();
    1025               if (pos.top > 100) jQuery("#the_page").height(pos.top);
    1026               if (old_w == jQuery(window).width() && old_h == jQuery(window).height()) return;
    1027               jQuery(window).resize();
    1028               return;
    1029           });
    1030           var pos;
    1031           //===================================================================   
    1032           jQuery(window).resize();
    1033           /*
    1034           * recherche la plus grande image (hauteur ou largeur)
    1035           */
    1036 
    1037 
    1038           function Get_Img_Maxi(myobj) {
    1039               var w00 = 0;
    1040               var TheImg = null;
    1041               jQuery(myobj).each(function (i) {
    1042                   w0 = img_reelle.width;
    1043                   h0 = img_reelle.height;
    1044                   if (h0 > w0) w0 = h0;
    1045                   if (w0 > w00) {
    1046                       if (!this.src.match(RegExp(".png", "g")))
    1047                           if (!this.src.match(RegExp(thumbnail, "g"))) {
    1048                               TheImg = this;
    1049                               w00 = w0;
    1050                           }
    1051 
    1052                   }
    1053               });
    1054               return TheImg;
    1055           }
    1056 
    1057 
    1058       } // function
    1059 );                                                                                                                                                                                                                                                                                                                                                                                                                                                          // ready
     242                 info_description.width = "800";
     243                 */
     244                 jQuery("#Debug").css('display', 'block');
     245                 jQuery("#Debug1").show();
     246                 jQuery("#Debug2").show();
     247                 Bandeau_bas = info_description;
     248
     249                 jQuery("#Debug").css({
     250                     filter: 'alpha(opacity:50)',
     251                     position: "absolute",
     252                     width: "800px",
     253                     border: "solid 1px green",
     254                     top: Bandeau + "px"
     255                 });
     256                 jQuery("#Debug").text("Debug:Bandeau : " + Bandeau);
     257
     258                 jQuery("#Debug1").css({
     259                     filter: 'alpha(opacity:50)',
     260                     position: "absolute",
     261                     border: "solid 1px green",
     262                     top: Bandeau_bas.top + "px",
     263                     width: (200) + "px",
     264                     height: Bandeau_bas.height + "px"
     265                 });
     266                 jQuery("#Debug1").text("Debug1:Bandeau_bas top : " + Bandeau_bas.top + " height:" + Bandeau_bas.height);
     267
     268                 jQuery("#Debug2").css({
     269                     filter: 'alpha(opacity:50)',
     270                     position: "absolute",
     271                     left: '50px',
     272                     width: (300) + "px",
     273                     border: "solid 1px green", top: Bandeau_bas.bottom + "px"
     274                 });
     275                 jQuery("#Debug2").text("Debug2:Bandeau_bas bottom :" + Bandeau_bas.bottom);
     276
     277             }
     278
     279             if (check_desc_v != 'checked="checked"') {
     280                 info_description.height = 0;
     281             }
     282
     283
     284
     285
     286             return info_description;
     287
     288         }
     289
     290         /*
     291         *
     292         */
     293
     294         //============================================================//==
     295         jQuery("#pamoorama_outter").bind('resize', function () {
     296             //   setTimeout("wait_Timer()", 200);
     297
     298         })
     299
     300
     301
     302         //============================================================
     303         jQuery("#iGMapsIcon").bind('resize', function () {
     304             jQuery().recentrage_widget();
     305         })
     306         jQuery("#icon_gmaps").bind('click', function () {
     307             jQuery().recentrage_widget();
     308         })
     309
     310
     311
     312
     313
     314
     315         /* jQuery */
     316         var img_init = { height: img_height, width: img_width };  // taille initiale
     317         var img_defaut = { height: scaled_height, width: scaled_width };
     318         var img_reelle = { height: img_height, width: img_width };
     319         var img_finale = { height: 0, width: 0 };
     320         var Zone_Affichage = { height: 0, width: 0 };
     321
     322         //============================================================
     323
     324         var Info_the_page = jQuery("#the_page").infos();
     325         var Zone_Affichage = jQuery("#theImage").infos();
     326
     327         var Bandeau = 0;
     328         var Bandeau_t = Info_entete("theImage")
     329         Bandeau = Bandeau_t.img_top;
     330         var Bandeau_bas = 0;
     331         Bandeau_bas = Info_description("theImage");
     332         var old_window = { width: 0, height: 0 };
     333
     334
     335         //=================================================================== 
     336         /*
     337         * window .resize
     338         */
     339
     340
     341         jQuery(window).resize(
     342               function (event, ui) {
     343                   Resize();
     344               });
     345
     346         function Resize(Force) {
     347
     348             if (!cl_visible == true) return;
     349             if (Force)
     350                 old_window = { width: 0, height: 0 };
     351
     352             var chk = eval(user_status + "_enabled");
     353             if (chk == "") return;
     354             //=================================================================
     355             //var retour = (getStackTrace());
     356             //   alert(retour);
     357             //jQuery("#debug").text(retour);
     358             //  return
     359             //=================================================================
     360
     361             var winwidth = jQuery(window).width();
     362             var winheight = jQuery(window).height();
     363             if (old_window)
     364                 if (old_window.width == winwidth && old_window.height == winheight) return;
     365             old_window = jQuery(window).infos();
     366             //===========================================================================
     367
     368
     369             var Type_Img = "";
     370             //====== détection du type d'images ======
     371             if (jQuery("#charlie").length > 0) {
     372                 Type_Img = "charlie";
     373             } else if (jQuery("#pamoorama").length) {
     374                 Type_Img = "pamoorama";
     375             } else if (jQuery("#theImage embed").length > 0) {
     376                 Type_Img = "embed";
     377             } else if (jQuery("#map").length) {
     378                 Type_Img = "map";
     379             } else if (jQuery("#Panorama").length) {
     380                 Type_Img = "panorama";
     381             } else if (jQuery("#theImage").find("img").length > 0) {
     382                 Type_Img = "img";
     383             } else if (jQuery("img").length > 0) {
     384                 Type_Img = "img_autre";
     385                 return;
     386             } else {
     387                 return;
     388             }
     389
     390
     391
     392             var Cadre = jQuery("#theImage").get(0);
     393             var info_Cadre = jQuery(Cadre).infos();
     394             //===============  Information cadre ======
     395             var info_the_page = jQuery("#the_page").infos();
     396
     397             //=============================================================================
     398             var info_HeaderBar = jQuery("#imageHeaderBar").infos();
     399
     400             var info_content = jQuery("#content").infos();
     401
     402
     403             var info_titrePage = jQuery("#titrePage").infos();
     404
     405
     406             var Zone_Affichage = jQuery("#theImage").infos();
     407
     408             var info_ToolBar = jQuery("#imageToolBar").infos();
     409             var info_imageInfoBar = jQuery("#imageInfoBar").infos();
     410             var info_theHeader = jQuery("#theHeader").infos();
     411
     412
     413             var marge = 0;
     414             if (info_ToolBar.width > 0)
     415                 marge = (Zone_Affichage.width - info_ToolBar.width) / 2;
     416
     417             var marge_right = marge;
     418             var marge_left = marge;
     419
     420             if (info_content.width > 100) {
     421                 marge_left = 0;
     422                 marge_right = info_imageInfoBar.margin.left + info_imageInfoBar.margin.right;
     423                 winwidth = info_content.width;
     424                 marge_right = info_imageInfoBar.width + marge_right;
     425
     426             }
     427             else
     428                 winwidth = Zone_Affichage.width;
     429
     430             winwidth -= (marge_right + marge_left);
     431
     432
     433
     434
     435             if (Type_Img == "pamoorama") {
     436                 var info_pamoorama = jQuery("#pamoorama").infos();
     437                 var info_pamoorama_outter = jQuery("#pamoorama_outter").infos();
     438                 var info_pamoorama_inner = jQuery("#pamoorama_inner").infos();
     439                 var info_pamoorama_footer = jQuery("#pamoorama_footer").infos();
     440                 TheImg = jQuery("#pamoorama");
     441                 if (typeof (myPamoorama) == "undefined") {
     442
     443                     return
     444
     445                 }
     446
     447
     448
     449                 po = myPamoorama;
     450
     451                 /*
     452                 myPamoorama = new pamoorama('pamoorama',{ activateSlider:      {$PANO_ACTIVATESLIDER},
     453                 width:                 {$PANO_WIDTH},
     454                 footercolor:           '{$PANO_FOOTERCOLOR}',
     455                 captioncolor:  '{$PANO_CAPTIONCOLOR}',
     456                 caption:               '{$ALT_IMG}',
     457                 enableAutoscroll:      {$PANO_ENABLEAUTOSCROLL},
     458                 autoscrollSpeed:       {$PANO_AUTOSCROLLSPEED},
     459                 autoscrollOnLoad:      {$PANO_AUTOSCROLLONLOAD},
     460                 startAutoscroll:       '{'pamooramics_startAutoscroll'|@translate}',
     461                 stopAutoscroll:                '{'pamooramics_stopAutoscroll'|@translate}',
     462                 loadingMessage: '{'pamooramics_loading'|@translate}',
     463                 clickMessage:          '{'pamooramics_clickMessage'|@translate}',
     464                 dragMessage:           '{'pamooramics_dragMessage'|@translate}'
     465                 });
     466                 */
     467                 /*
     468                 pamoorama_outter
     469                 pamoorama_inner
     470                 pamoorama_footer
     471                 pamoorama_caption
     472                 pamoorama_thumb
     473                 pamoorama_frame
     474                 */
     475             } else {
     476                 //==== récupère Img la plus grande  =====
     477                 if (jQuery("#theImg")) IMG = "#theImg";
     478                 else IMG = Cadre;
     479
     480                 TheImg2 = Get_Img_Maxi(IMG + " img");
     481                 //=================================================================
     482                 if (TheImg2 == null) {
     483                     if (jQuery(Cadre).find("img").length > 0) {
     484                         IMG = Cadre;
     485
     486
     487                         TheImg = Get_Img_Maxi("#theImage img");
     488                     }
     489                 } else {
     490                     TheImg = TheImg2  //luciano ?
     491
     492                 }
     493             }
     494             //=================================================================
     495
     496
     497             switch (Type_Img) {
     498                 case "map":
     499                     var info_image = jQuery("#map").infos();
     500
     501                     var info_map = jQuery("#mapPicture").infos();
     502
     503                     marge_left = info_map.width;
     504                     jQuery("#map").css("left", marge_left);
     505
     506                     var TheImg = jQuery("#map").get(0);
     507                     img_reelle.height = info_image.height;
     508                     img_reelle.width = winwidth - marge_right - marge_right;
     509                     Bandeau_bas.height = 10;
     510                     marge_right = 10;
     511
     512                     info_the_page = jQuery("#the_page").infos();
     513                     ;
     514
     515                     break
     516
     517
     518                 case "panorama":
     519                     // return;
     520
     521
     522                     TheImg = Get_Img_Maxi("#Panorama img");
     523                     info_theImage = jQuery(TheImg).infos();
     524                     info_the_page = jQuery("#the_page").infos();
     525
     526                     break
     527                 case "img":
     528
     529                     if (!TheImg) return;
     530                     if (theme.match(RegExp("luciano", "g"))) {
     531                         TheImg = jQuery("#the_page #theImg");
     532                     }
     533                     info_theImage = jQuery(TheImg).infos();
     534                     info_the_page = jQuery("#the_page").infos();
     535
     536
     537                     break
     538                 case "img_autre":
     539                     if (!TheImg) return;
     540                     info_theImage = jQuery(TheImg).infos();
     541                     info_the_page = jQuery("#the_page").infos();
     542
     543
     544                     break
     545                 case "embed":
     546                     //
     547
     548                     TheImg = jQuery(Cadre).find("embed");
     549
     550                     info_theImage = jQuery(Cadre).infos();
     551                     info_the_page = jQuery("#the_page").infos();
     552                     if (rapport < 0) {
     553                         img_height = parseInt(jQuery(TheImg).outerHeight());
     554                         img_width = parseInt(jQuery(TheImg).outerWidth());
     555
     556                         img_reelle.height = img_height;
     557                         img_reelle.width = img_width;
     558
     559                     }
     560
     561                     break
     562                 case "charlie":
     563
     564                     TheImg = jQuery('#charlie object').get(0);
     565                     info_theImage = jQuery(Cadre).infos();
     566                     info_the_page = jQuery("#the_page").infos();
     567                     if (rapport < 0) {
     568                         img_height = parseInt(TheImg.height);
     569                         img_width = parseInt(TheImg.width);
     570
     571                         img_reelle.height = parseInt(TheImg.height);
     572                         img_reelle.width = parseInt(TheImg.width);
     573                     }
     574
     575                     break
     576                 case "pamoorama":
     577                     //=========================================================
     578
     579
     580                     if (typeof (myPamoorama.imageHeight) == "undefined") {
     581                         old_window = { width: 0, height: 0 };
     582
     583
     584                         return;
     585                     }
     586
     587                     img_reelle.height = myPamoorama.imageHeight;
     588                     img_reelle.width = myPamoorama.imageWidth;
     589                     TheImg = myPamoorama.image;
     590                     info_theImage = jQuery("#pamoorama").infos();
     591                     info_the_page = jQuery("#the_page").infos();
     592
     593                     break
     594
     595
     596             }
     597
     598             //=============== Vérification taille minimale  autorizée ======================
     599             var miniWidth = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("min-width"), mini_width);
     600             miniHeight = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("min-height"), mini_height);
     601
     602
     603             var maxWidth = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("max-width"), winwidth, "0");
     604             maxHeight = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("max-height"), winheight, "0");
     605
     606             mini_width = parseInt(miniWidth);
     607             mini_height = parseInt(miniHeight);
     608
     609             img_reelle.width = parseInt(img_reelle.width);
     610
     611
     612             if (img_reelle.width < mini_width) return;
     613
     614             img_reelle.height = parseInt(img_reelle.height);
     615             if (img_reelle.height < parseInt(mini_height)) return;
     616             //==================================================================================   
     617             if (rapport < 0) {
     618
     619                 img_init.height = parseInt(img_height);
     620                 img_init.width = parseInt(img_width);
     621
     622                 rapport = img_width / img_height;
     623
     624                 if (Type_Img != "map")
     625                     rapport = (img_init.width / img_init.height);
     626                 else
     627                     rapport = 0;
     628
     629             }
     630
     631
     632             //=============== Zone d'affichage ============================
     633
     634             borderW = Zone_Affichage.borderwidth.left;
     635             borderW += Zone_Affichage.borderwidth.right;
     636
     637
     638             Zone_Affichage.width = winwidth - borderW;
     639
     640
     641
     642             var Licence = jQuery(".licencetag");
     643             info_Licence = jQuery(".licencetag").infos();
     644
     645             jQuery("#theImage #theImg IMG").css("marginTop", "0px")
     646             //========== Correction en fonction du thème =============================
     647             var correction = 0;
     648             if (theme.match(RegExp("sobre", "g"))) {
     649
     650                 correction = -info_Licence.padding.top;
     651
     652             } else if (theme.match(RegExp("Pure", "g"))) {
     653                 correction += 0; //??
     654             } else if (theme.match(RegExp("luciano", "g"))) {
     655                 correction = 0; //??
     656
     657             } else if (theme.match(RegExp("simple", "g"))) {
     658                 correction += 0; //??
     659             } else if (theme.match(RegExp("gally", "g"))) {
     660                 correction += 0; //??
     661
     662             }
     663             //================ Licence  ========================
     664
     665             if (Licence.length > 0) {
     666                 jQuery(".licencetag").css("padding", "0px");
     667
     668             }
     669             //====================================================
     670             info_img = jQuery(TheImg).infos();
     671
     672
     673
     674             img_top = Bandeau;
     675
     676             Marge_Basse = parseInt(marge_basse || 0); // hors bandeau
     677             //==========================================================================
     678             h = 0;
     679             Zone_Affichage.height = winheight - Bandeau - Marge_Basse - correction;
     680             var Image_height = Zone_Affichage.height - Bandeau_bas.height - Bandeau_bas.marge.top - Bandeau_bas.marge.bottom;
     681
     682             //=============================================================
     683             var height_user = eval(user_status + "_height");
     684             var reg1 = new RegExp("%", "g");
     685             if (height_user.match(reg1))
     686                 Image_height = Image_height * parseInt(height_user) / 100;
     687             else
     688                 Image_height = parseInt(height_user);
     689
     690             echelle_max = parseFloat(echelle_max, '3');
     691             var echelle = parseFloat(Image_height / img_reelle.height, 3);
     692
     693             if (echelle > echelle_max) { echelle = echelle_max; }
     694             Image_height = parseInt(img_reelle.height * echelle);
     695             //============================================================
     696
     697             var Image_width;
     698             if (rapport > 0)
     699                 Image_width = parseInt(Image_height * rapport);
     700             else if (Type_Img == "map") {
     701                 Image_width = Zone_Affichage.width - marge_left - marge_right;
     702             } else {
     703                 Image_width = Zone_Affichage.width;
     704             }
     705
     706             //===============================================================
     707             align_auto = "center";
     708             if (jQuery("#theImg").css("textAlign"))
     709                 align_auto = jQuery("#theImg").css("textAlign");
     710             var widthmin = winwidth;
     711
     712             if (check_auto_w == 'checked="checked"') {
     713                 // if (Type_Img != "pamoorama" && Type_Img != "panorama" ) {
     714                 //==== largeur à atteindre ===
     715                 var width_user = eval(user_status + "_width");
     716                 // Largeur maximale en fonction du statut
     717                 if (width_user.match(reg1))
     718                 // pourcentage
     719                     widthmin = widthmin * parseInt(width_user) / 100;
     720                 else
     721                     widthmin = parseInt(width_user);
     722                 var marges = marges_llgbo;
     723                 widthmin -= info_img.borderwidth.left;
     724                 widthmin -= info_img.borderwidth.right;
     725
     726                 widthmin -= marges;
     727                 if (Image_width > widthmin) {
     728                     //   Image_width largeur à atteindre
     729                     //  Calcul du rapport d'agrandissement
     730                     var echelle_w = parseFloat((widthmin) / img_reelle.width, 3);
     731                     if (echelle_w > echelle_max) { echelle_w = echelle_max; }
     732                     Image_width = parseInt(img_reelle.width * echelle_w);
     733                     if (rapport > 0)
     734                         Image_height = parseInt(Image_width / rapport);
     735                 }
     736
     737
     738
     739             }
     740
     741
     742             // }
     743             //===================================================
     744
     745
     746
     747             zoom = echelle;
     748             //=============LLGBO2 ===========================
     749
     750
     751             if (marges_llgbo > 0) {
     752
     753                 t1 = jQuery(llgboframe).infos();
     754                 if (!TheImg.src) {
     755                     TheImg = jQuery(TheImg).find("img").get(0)
     756                 }
     757                 if (TheImg.src) {
     758
     759                     Image_width -= marges_llgbo; // réduction frame
     760                     Image_height -= marges_llgbo; // réduction frame
     761                     if (rapport > 1) {
     762                         if (Image_width > winwidth) {
     763                             jQuery("#gbo").outerWidth(winwidth);
     764                             jQuery("#gbo").css("width", winwidth + "px");
     765                         }
     766                         else {
     767                             jQuery("#gbo").outerWidth(Image_width);
     768                             jQuery("#gbo").css("width", Image_width + "px");
     769                         }
     770
     771                         t1 = jQuery("#gbo div:last").infos();
     772
     773                         Image_width = t1.width - (t1.borderwidth.left + t1.borderwidth.right);
     774                         Image_height = parseInt(Image_width / rapport);
     775
     776                         jQuery("#gbo").outerHeight(Image_height + marges_llgbo);
     777                         jQuery("#gbo").css("height", (Image_height + marges_llgbo) + "px");
     778                         if (jQuery.browser.msie) {
     779                             jQuery("#gbo").css("paddingBottom", 17 + "px");
     780                         }
     781
     782                     } else {
     783                         Image_height -= 4;
     784                         Image_width -= 4;
     785                         if (Image_width > winwidth) {
     786                             jQuery("#gbo").outerWidth(winwidth);
     787                             jQuery("#gbo").css("width", winwidth + "px");
     788                         }
     789                         else {
     790                             jQuery("#gbo").outerWidth(Image_width);
     791                             jQuery("#gbo").css("width", Image_width + "px");
     792                         }
     793
     794                         jQuery("#gbo").css("height", (Image_height + marges_llgbo) + "px");
     795                         jQuery("#gbo").height(Image_height + marges_llgbo);
     796
     797                         jQuery("#gbo").css("width", Image_width + marges_llgbo + "px");
     798                         jQuery("#gbo").width(Image_width + marges_llgbo);
     799
     800
     801
     802                         if (jQuery.browser.msie) {
     803                             jQuery("#gbo").css("paddingBottom", 17 + "px");
     804                         }
     805
     806                     }
     807                     //  jQuery("#" + Parent + " p:not(:contains(' ')) ").remove();
     808                     a0 = jQuery("area[rel!=up][rel!=prev][rel!=next]");
     809                     a1 = jQuery("area[rel=prev]");
     810                     a2 = jQuery("area[rel=next]");
     811                     a3 = jQuery("area[rel=up]");
     812                     nb_zone = 3;
     813                     if (a1.length == 0) {
     814                         nb_zone -= 1;
     815                     }
     816                     if (a2.length == 0) {
     817                         nb_zone -= 1;
     818                     }
     819
     820
     821                     var Largeur_zone = (Image_width / nb_zone);
     822                     var Hauteur_zone = (Image_height);
     823                     var init_zone = 0;
     824
     825                     if (a1.length > 0) {
     826                         coord = { x0: init_zone, y0: 0, x1: Largeur_zone, y1: Hauteur_zone };
     827
     828                         jQuery("area[rel=prev]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" });
     829                         init_zone += Largeur_zone;
     830                     }
     831
     832                     coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: Image_height };
     833
     834                     if (a0.length > 0) {
     835                         jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1 / 2) + "'" });
     836                         jQuery(a0).attr({ coords: "'" + coord.x0 + "," + (coord.y1 / 2) + "," + coord.x1 + "," + (coord.y1) + "'" });
     837                     } else {
     838                         jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1) + "'" });
     839                     }
     840                     init_zone += Largeur_zone;
     841
     842                     if (a2.length > 0) {
     843                         coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: Image_height };
     844                         jQuery("area[rel=next]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" });
     845                     }
     846                 }
     847             }
     848
     849             //================ Zone affichage =========================
     850             //  Image_height, Image_width = valeur a atteindre.
     851             if (theme.match(RegExp("luciano", "g"))) {
     852                 //---- information en dehors du cadre
     853                 Zone_Affichage.height -= Bandeau_bas.height;
     854                 jQuery(Cadre).height(Zone_Affichage.height);
     855
     856             }
     857
     858             //=========================================================
     859
     860             //  jQuery(Cadre).css("top", "0px");
     861             jQuery("#standard").css("top", 0 + "px");
     862             jQuery("#comments").css("top", 0 + "px");
     863
     864
     865             jQuery(Cadre).width(Zone_Affichage.width);
     866
     867             //==============================================================
     868
     869             img_finale.height = Image_height;
     870             img_finale.width = Image_width;
     871
     872             //=========================================================================
     873
     874
     875             if (typeof (gmaps) != "undefined") {
     876                 Gmap_ = gmaps.maps[0];
     877                 if (Gmap_.sizeMode == 'A') {
     878                     jQuery("#iGMapsIcon").css({ width: old_window.width * 0.8 + "px", height: old_window.height * 0.8 + "px" });
     879
     880                 }
     881             }
     882             //==============================================================
     883             if (Type_Img == "charlie") {
     884                 t1 = jQuery("#charlie").infos();
     885                 /**/
     886                 pdf = 2 * parseInt(jQuery(".none_2").css("paddingRight"));
     887                 jQuery("#charlie").css({
     888                     width: Image_width + pdf,
     889                     height: Image_height,
     890                     margin: "auto"
     891                 });
     892
     893
     894                 jQuery("#player").css("width", Image_width + 100 + "px");
     895                 jQuery("#player").css("height", Image_height);
     896
     897                 jQuery("#embedplayer").css("width", Image_width);
     898                 jQuery("#embedplayer").css("height", Image_height);
     899
     900
     901                 jQuery("object").width(Image_width);
     902                 jQuery("object").height(Image_height);
     903             } else if (Type_Img == "panorama") {
     904
     905                 // -----     jQuery(TheImg).panorama2(img_finale.height, img_finale.width);
     906                 // jQuery(TheImg).height(img_finale.height);
     907                 // jQuery(TheImg).width(img_finale.width);
     908                 jQuery("#Panorama div").height(Image_height);
     909                 //  class=simple_panorama
     910
     911                 jQuery(".panorama-viewport").css("left", "2px");
     912                 jQuery(".panorama-viewport").css("width", "auto");
     913                 //   setTimeout("cl_Timer()", 500);
     914
     915             } else if (Type_Img == "pamoorama") {
     916
     917                 img_height = myPamoorama.imageHeight
     918
     919                 marge_left += 0;
     920
     921                 if (theme.match(RegExp("simple", "g"))) {
     922                     marge_right = 0;
     923                 }
     924                 new_width = Zone_Affichage.width - marge_right - marge_left;
     925                 new_width -= 4;
     926                 jQuery("#pamoorama").css({ marginLeft: "auto",
     927                     marginRight: "auto",
     928
     929                     height: Image_height + info_pamoorama_footer.height + "px",
     930                     width: new_width + "px"
     931                 });
     932
     933                 myPamoorama.options.width = new_width;
     934                 jQuery("#pamoorama").width(new_width);
     935
     936
     937
     938
     939                 jQuery("#pamoorama_outter").css({
     940                     left: marge_left + "px",
     941                     height: myPamoorama.imageHeight + "px",
     942                     width: (new_width) + "px"
     943                 });
     944                 jQuery("#pamoorama_outter").width(new_width);
     945                 h = info_theImage.height;
     946                 jQuery("#pamoorama").css({ height: h + "px" });
     947
     948                 jQuery("#pamoorama_footer").width(new_width);
     949                 jQuery("#pamoorama_footer").css('width', new_width + "px");
     950
     951                 jQuery("#linkNext").css({ width: "200px", overflow: "hidden" });
     952                 jQuery("#linkPrev").css({ width: "200px", overflow: "hidden" });
     953                 zoom = Image_height / img_height;
     954
     955
     956
     957
     958             } else if (TheImg.src) {
     959                 //--- background ?? ---
     960                 jQuery(TheImg).height(img_finale.height);
     961                 jQuery(TheImg).width(img_finale.width);
     962                 jQuery(TheImg).css("height", img_finale.height + "px");
     963                 jQuery(TheImg).css("width", img_finale.width + "px");
     964
     965             } else {
     966                 //===map ? ===
     967                 jQuery(TheImg).height(img_finale.height);
     968                 jQuery(TheImg).width(img_finale.width);
     969                 jQuery(TheImg).css("height", img_finale.height + "px");
     970                 jQuery(TheImg).css("width", img_finale.width + "px");
     971
     972             }
     973
     974             /*
     975             jQuery("#Debug1").css({
     976             position: "absolute",
     977             top: Bandeau + "px",
     978             textAlign: align_auto,
     979             margin: "0px auto",
     980
     981
     982             border: "solid 1px red",
     983
     984             width: Image_width + "px",
     985             height: Image_height + "px"
     986
     987             });
     988             //===================================================
     989             jQuery("#Debug2").css({ position: "absolute",
     990             left: Zone_Affichage.left + 'px',
     991             border: "solid 1px green",
     992             top: Zone_Affichage.top + "px",
     993             width: Zone_Affichage.width / 2 + "px",
     994             height: Zone_Affichage.height + "px"
     995
     996             });
     997             jQuery("#Debug2").text(info_Cadre.bottom);
     998             */
     999             jQuery("#navThumbPrev").css({   overflow: "hidden"
     1000             });
     1001             jQuery("#navThumbNext").css({
     1002                  overflow: "hidden"
     1003             });
     1004             try {
     1005                 if (theme.match(RegExp("gally", "g"))) {
     1006
     1007                     //===========================================================================
     1008                     initializeImageMode("resize");
     1009                     if (jQuery("#navThumbPrev").length > 0) {
     1010                         jQuery("#navThumbPrev").css({ height: info_img.height + "px",
     1011                             top: info_img.top + 20 + "px",overflow:"hidden"
     1012                         });
     1013                         if (Type_Img == "map")
     1014                             jQuery("#navThumbPrevContainer").css({ background: 'none' });
     1015                     }
     1016                     if (jQuery("#navThumbNext").length > 0) {
     1017                         jQuery("#navThumbNext").css({ height: info_img.height + "px",
     1018                             top: info_img.top + 20 + "px", overflow: "hidden"
     1019                         });
     1020
     1021                     }
     1022                     if (Type_Img == "map")
     1023                         jQuery("#navThumbNextContainer").css({ background: 'none' });
     1024
     1025
     1026
     1027                     if (!theme.match(RegExp("lapis", "gi"))) { initializeImageMode("resize"); }
     1028                 } else if (theme.match(RegExp("simple", "g"))) {
     1029
     1030                     jQuery("#imageToolBar").css("position", "static");
     1031                     info_imageInfoBar = jQuery("#imageInfoBar").infos();
     1032                     if (info_imageInfoBar.bottom < info_img.bottom) {
     1033                         jQuery("#imageInfoBar").height(info_img.bottom);
     1034                     }
     1035
     1036                 } else {
     1037
     1038                     //    jQuery("#imageToolBar").css("position", "static");
     1039                 }
     1040             } catch (e) {
     1041
     1042             }
     1043             // 
     1044             if (!pos) pos = jQuery("#copyright").infos();
     1045             if (pos != jQuery("#copyright").infos())
     1046                 pos = jQuery("#copyright").infos();
     1047             if (pos.top > 100) jQuery("#the_page").height(pos.top);
     1048
     1049             if (old_window.width == jQuery(window).width() && old_window.height == jQuery(window).height()) {
     1050                 jQuery("#theImage").css({
     1051                     opacity: '1.0', filter: 'alpha(opacity= 100)'
     1052                 });
     1053                 return;
     1054             }
     1055             Resize(false);
     1056             return;
     1057         };  // Resize();
     1058
     1059         jQuery("#theImage").css({
     1060             opacity: '0.0', filter: 'alpha(opacity=  0)'
     1061         });
     1062
     1063         jQuery("#theImage").animate({
     1064             left: 0
     1065         }, 100, "swing", function () { Resize(true); });
     1066
     1067         var pos;
     1068
     1069         //===================================================================   
     1070         //
     1071
     1072
     1073
     1074         /*
     1075         * recherche la plus grande image (hauteur ou largeur)
     1076         */
     1077
     1078
     1079         function Get_Img_Maxi(myobj) {
     1080             var w00 = 0;
     1081             var TheImg = null;
     1082             jQuery(myobj).each(function (i) {
     1083                 w0 = img_reelle.width;
     1084                 h0 = img_reelle.height;
     1085                 if (h0 > w0) w0 = h0;
     1086                 if (w0 > w00) {
     1087                     if (!this.src.match(RegExp(".png", "g")))
     1088                         if (!this.src.match(RegExp(thumbnail, "g"))) {
     1089                             TheImg = this;
     1090                             w00 = w0;
     1091                         }
     1092
     1093                 }
     1094             });
     1095             return TheImg;
     1096         }
     1097     }); // window.onload
     1098     /* Extension
     1099     * recentrage_widget:
     1100     * :
     1101     */
     1102     //=========================================================
     1103     jQuery.fn.extend({
     1104         recentrage_widget: function () {
     1105             jQuery('html,body').stop().scrollTop(0);
     1106             jQuery('html,body').stop().scrollLeft(0);
     1107             jQuery(".ui-widget-overlay").css("opacity", "0.75");
     1108
     1109             l1 = (jQuery(window).width() - (jQuery(".gmapsPopup").width())) / 2;
     1110             h1 = (jQuery(window).height() - (jQuery(".gmapsPopup").height())) / 2;
     1111
     1112             jQuery(".gmapsPopup").css("left", l1 + "px");
     1113             jQuery(".gmapsPopup").css("top", h1 + "px");
     1114
     1115         }
     1116         //=========================================================
     1117     });            // fin extend
     1118
     1119 } // function
     1120);                                                                                                                                                                                                                                                                                                                                                                                                                                                                       // ready
    10601121    /*
    10611122*
     
    10641125        // Nom du sélecteur personnalisé
    10651126        Description: function (a) {
    1066             n = jQuery(a).info();
     1127            n = jQuery(a).infos();
    10671128            return a;
    10681129
     
    10701131    });
    10711132
    1072     /* Extension
    1073     * absolutize:
    1074     * relativize:
    1075     */
    1076 //=========================================================
    1077     jQuery.fn.extend({
    1078         recentrage_widget: function () {
    1079             jQuery('html,body').stop().scrollTop(0);
    1080             jQuery('html,body').stop().scrollLeft(0);
    1081             jQuery(".ui-widget-overlay").css("opacity", "0.75");
    1082 
    1083             l1 = (jQuery(window).width() - (jQuery(".gmapsPopup").width()))/2;
    1084             h1 = (jQuery(window).height() - (jQuery(".gmapsPopup").height()))/2;
    1085  
    1086             jQuery(".gmapsPopup").css("left", l1 + "px");
    1087             jQuery(".gmapsPopup").css("top", h1 + "px");
    1088 
    1089         },
    1090         //-------------------------------------------------------
    1091         absolutize: function (element) {
    1092             element = jQuery(element).get(0);
    1093             if (element.getStyle('position') == 'absolute') return;
    1094             // Position.prepare(); // To be done manually by Scripty when it needs it.
    1095 
    1096             var offsets = element.positionedOffset();
    1097             var top = offsets[1];
    1098             var left = offsets[0];
    1099             var width = element.clientWidth;
    1100             var height = element.clientHeight;
    1101 
    1102             element._originalLeft = left - parseFloat(element.style.left || 0);
    1103             element._originalTop = top - parseFloat(element.style.top || 0);
    1104             element._originalWidth = element.style.width;
    1105             element._originalHeight = element.style.height;
    1106 
    1107             element.style.position = 'absolute';
    1108             element.style.top = top + 'px';
    1109             element.style.left = left + 'px';
    1110             element.style.width = width + 'px';
    1111             element.style.height = height + 'px';
    1112             return element;
    1113         },
    1114 
    1115         relativize: function (element) {
    1116             element = jQuery(element).get(0); ;
    1117             if (jQuery(element).css('position') == 'relative') return;
    1118             // Position.prepare(); // To be done manually by Scripty when it needs it.
    1119             element._originalLeft = parseFloat(element.style.left || 0);
    1120             element._originalTop = parseFloat(element.style.top || 0);
    1121             element._originalWidth = element.style.width;
    1122             element._originalHeight = element.style.height;
    1123 
    1124             element.style.position = 'relative';
    1125             var top = parseFloat(element.style.top || 0) - (element._originalTop || 0);
    1126             var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0);
    1127 
    1128             element.style.top = top + 'px';
    1129             element.style.left = left + 'px';
    1130             //  element.style.height = element._originalHeight;
    1131             // element.style.width  = element._originalWidth;
    1132             return element;
    1133         }
    1134         //=========================================================
    1135     });          // fin extend
  • extensions/Autosize/js/conflit.js

    r7673 r7702  
    11//==== autosize  remplace $(... avec jQuery( ====
     2/*
     3* A faire Compatibilité entre LLGBO GMAPS
     4*       Luciano rv_gmaps
     5*/
    26var d1 = 0;
    37var init_tb = 0;
    48//===================================================
    5  
    69function $(element, nc) {
    7    return conflit(element, nc)
     10        return conflit(element, nc)
    811}
    912//===================================================
    1013function conflit(element, nc) {
    11     try {
    12        var  retour = alert(nonExistentVariable);
    13        
    14     } catch (e) {
    15 
    1614   var retour=(getStackTrace());
    17 
    18     }
    19 
    20     if (retour == "")
    21         return jQuery(element);
    22 
    23 
    24     if (retour.match(RegExp("pamoorama", "gi"))) {
    25         return jQuery().$Pamoorama(element);
    26     }
    27 
    28     if (retour.match(RegExp("luciano", "gi"))) {
    29         return jQuery().$Luciano(element);
    30     }
    31 
    32     if (retour.match(RegExp("prototype.js", "gi"))) {
    33     return jQuery().$Prototype(element);
    34 }   
    35 
    36 //alert(retour);
    37 if (retour.match(RegExp("jquery|switchmenu|gmaps|switchTabs|switchInterface|gally|initializeImageMode", "gi"))) {
    38     return jQuery(element);
    39 }
    40  
    41 
    42 if (retour.match(RegExp("ie_ready", "gi"))) {
    43     return jQuery().$Pamoorama(element);
    44 }
    45     if (retour.match(RegExp("skipInit", "gi"))) {
    46         return jQuery().$Pamoorama(element);
    47     }
    48     //==============================================================
    49    
    50     if (retour.match(RegExp("(splat|buildFrameWork|photoNext)", "gi"))) {
    51            ret = jQuery().$Luciano(element);
    52            return ret;
    53        }
    54 
    55        //  var form = $('rateForm');
    56        Expression = new RegExp("\$", "gi")
    57        if (retour.match(Expression)) {
    58            if (retour.match(RegExp("rateForm", "gi"))) {
    59                ret = jQuery().$Luciano(element);
    60                return ret;
    61            }
    62        }
    63        if (typeof(Browser)!="undefined")
    64            if (Browser.loaded)
    65                b="mootools1.2.4"
    66 
    67 
    68 
    69     if (retour.match(RegExp("gmaps", "gi"))) {
    70         return jQuery(element);
    71     }
    72     if (retour.match(RegExp("responder", "gi"))) {
    73         return jQuery().$Prototype(element);
    74     }
    75     if (retour.match(RegExp("fire", "gi"))) {
    76         return jQuery().$Prototype(element);
    77     }
    78     if (retour.match(RegExp("createResponder", "gi"))) {
    79         return jQuery().$Prototype(element);
    80     }
    81     if (retour.match(RegExp("element =", "gi"))) {
    82       //  return jQuery().$Prototype(element);
    83     }
    84     if (retour.match(RegExp("stopO", "g"))) {
    85         return jQuery().$Prototype(element);
    86     }
    87     if (element == "document") return jQuery(element);
    88    // alert(retour);
    89 
    90     retour= jQuery(element);
    91     return retour;
    92 
    93 
    94          return jQuery().$Pamoorama(element);
    95            
    96               }
    97               //============================================================
    98 
    99               jQuery(document).ready(
    100       function (jQuery) {
    101 
    102           tpj = jQuery("#pamoorama");
    103           if (tpj.length > 0) { }
    104           jQuery(window).load(function () {
    105 
    106               function $(element, nc) {
    107                   return conflit(element, nc);
    108               }
    109               tpfn=typeof( inittoolbar);
    110 
    111               if (tpfn == "function") inittoolbar();
    112               jQuery("#imageToolBar").css({ position: "relative", top: "0px" });
    113              
    114 
    115               if (jQuery("#theImage").css("position") == "relative") {
    116                   //==== compatibilité Gally/LLGBO ===
    117                   //--- passage relative ==> static ===/
    118                   jQuery("#theImage").css("position", "static");
    119                   jQuery("#imageToolBar").css({ position: "relative", top: "0px" });
    120               }
    121  jQuery(window).resize();
    122           });
    123 
    124       })
     15var ret_element = "";
     16if (retour.match(RegExp("jQuery", "gi"))) {
     17        ret_element = jQuery(element);
     18    } else if (retour.match(RegExp("pamooramics", "gi"))) {
     19    ret_element = jQuery().$Pamoorama(element);
     20} else if (retour.match(RegExp("luciano", "gi"))) {
     21    ret_element = jQuery().$Luciano(element);
     22} else if (retour.match(RegExp("rv_gmaps", "gi"))) {
     23        ret_element = jQuery().$Prototype(element);
     24}else if (retour.match(RegExp("GMaps", "gi"))) {
     25        ret_element = jQuery(element);
     26}else if (retour.match(RegExp("jQuery", "gi"))) {
     27        ret_element = jQuery(element);
     28}
     29if (ret_element != "")
     30        return ret_element;
     31if (DEBUG)
     32    alert(retour);
     33        if (retour == "")
     34                return jQuery(element);
     35}
     36
     37//============================================================
     38jQuery(document).ready(
     39    function (jQuery) {
     40        jQuery(window).load(function () {
     41            function $(element, nc) {
     42                return conflit(element, nc);
     43            }
     44
     45            if (theme.match("gally", "gi"))
     46                if (isFunction(inittoolbar)) {
     47                    if (typeof (currentTab) == "undefined") inittoolbar();
     48                    else initializeImageMode("resize");
     49                };
     50
     51                p1 = jQuery("#theImage").css("position");
     52                if (p1 != "static") {
     53                    //==== compatibilité Gally/LLGBO ===
     54                    //--- passage relative ==> static ===/
     55                    jQuery("#theImage").css( {position:"static",
     56                         opacity: '0', filter: 'alpha(opacity= 0)'
     57                     }
     58
     59                   );
     60                    jQuery("#imageToolBar").css({ position: "relative", top: "0px" });
     61                }
     62
     63            jQuery(window).resize();
     64
     65        });
     66
     67    })
    12568;
    12669
    127 
     70function isFunction(fn) {
     71    tpfn = typeof (fn);
     72    if (tpfn == "function") return true;
     73}
    12874//=========================================================
    12975(function ($2) {
    130               $2.fn.panorama2 =
    131                     function (height, width) {               
    132                         var src =jQuery(this);
    133                          return ;
    134                         }
     76$2.fn.panorama2 =
     77function (height, width) {               
     78var src =jQuery(this);
     79return ;
     80}
    13581
    13682
     
    13985
    14086jQuery.fn.extend({
    141     //---------------- luciano -------------------------------
    142     $Luciano: function (el, nc) {
    143         return document.id(el, nc, this.document);
    144     },
    145     //=============== PaMOOramics ===========================
    146 
    147     $Pamoorama: function (B) {
    148         if (!B) {
    149             if (typeof (B) == "boolean") return null;
    150             return jQuery();
    151         }
    152         if (B.htmlElement) {
    153             return Garbage.collect(B);
    154 
    155         }
    156         if ([window, document].contains(B)) { return B; }
    157         var A = $type(B);
    158         if (A == "string") { B = document.getElementById(B); A = (B) ? "element" : false; }
    159         if (A != "element") {
    160             return null;
    161         }
    162         if (B.htmlElement) { return Garbage.collect(B); }
    163         if (["object", "embed"].contains(B.tagName.toLowerCase())) { return B; }
    164         $extend(B, Element.prototype);
    165         B.htmlElement = function () { };
    166        try{ return Garbage.collect(B);}catch(e){
    167        return ;
    168        }
    169 
    170     },
    171     //===================================================
    172     $Prototype: function (element) {
    173         //======== prototype.js =====================
    174         if (arguments.length > 1) {
    175             for (var i = 0, elements = [], length = arguments.length; i < length; i++)
    176                 elements.push($(arguments[i]));
    177             return elements;
    178         }
    179         if (typeof element == "string")
    180             element = document.getElementById(element);
    181 
    182           return Element.extend(element);
    183 
    184         try {
    185             new_element = Element.extend(element);
    186         } catch (e) {
    187             return new_element;
    188         }
    189         return new_element;
    190     }
    191     //=========================================================
     87//---------------- luciano -------------------------------
     88$Luciano: function (el, nc) {
     89return document.id(el, nc, this.document);
     90},
     91//=============== PaMOOramics ===========================
     92
     93$Pamoorama: function (B) {
     94if (!B) {
     95if (typeof (B) == "boolean") return null;
     96return jQuery();
     97}
     98if (B.htmlElement) {
     99return Garbage.collect(B);
     100
     101}
     102if ([window, document].contains(B)) { return B; }
     103var A = $type(B);
     104if (A == "string") { B = document.getElementById(B); A = (B) ? "element" : false; }
     105if (A != "element") {
     106return null;
     107}
     108if (B.htmlElement) { return Garbage.collect(B); }
     109if (["object", "embed"].contains(B.tagName.toLowerCase())) { return B; }
     110$extend(B, Element.prototype);
     111B.htmlElement = function () { };
     112try{ return Garbage.collect(B);}catch(e){
     113return ;
     114}
     115
     116},
     117//===================================================
     118$Prototype: function (element) {
     119//======== prototype.js =====================
     120if (arguments.length > 1) {
     121for (var i = 0, elements = [], length = arguments.length; i < length; i++)
     122elements.push($(arguments[i]));
     123return elements;
     124}
     125if (typeof element == "string")
     126element = document.getElementById(element);
     127
     128return Element.extend(element);
     129
     130try {
     131new_element = Element.extend(element);
     132} catch (e) {
     133return new_element;
     134}
     135return new_element;
     136}
     137//=========================================================
    192138});   // fin extend
    193139
    194140
    195141
    196 
     142/*
     143* mootools.js  version: "1.11"
     144* pamoorama0.3.js
     145*
     146* main.js (google maps)
     147* prototype.js(mootool version: "1.62")
     148* windows.js
     149*
     150*/
    197151function getStackTrace() {
    198152    var callstack = [];
    199153    var isCallstackPopulated = false;
    200    try {
    201         i.dont.exist += 0; //doesn't exist- that's the point
     154    try {
     155            i.dont.exist += 0; //doesn't exist- that's the point
    202156    } catch (e) {
    203      
    204    var retcallstack = [];
    205         if (e.stack) { //Firefox
    206             var lines = e.stack.split("\n");
    207             for (var i = 2, len = lines.length; i < len; i++) {
    208                 if (lines[i].match(/conflit.js/)) {
    209                     //
    210                 } else if (lines[i].match(/^\s*[A-Za-z0-9\-_\$]+\(/)) {
    211                     callstack.push(lines[i]); //php?
    212                 } else {
    213                     callstack.push(lines[i]);
    214 
    215                 }
    216                 if (lines[i].match("prototype")) {
    217                     break;
    218                 }
    219             }
    220             //Remove call to printStackTrace()
    221             //callstack.shift();
    222             isCallstackPopulated = true;
    223             isCallstackPopulated = false;
    224 
    225         }
    226         else if (window.opera && e.message) {
    227             //Opera =================================
    228             var lines = e.message.split("\n");
    229             for (var i = 0, len = lines.length; i < len; i++) {
    230                 if (lines[i].match(/^\s*[A-Za-z0-9\-_\$]+\(/)) {
    231                     var entry = lines[i];
    232                     //Append next line also since it has the file info
    233                     if (lines[i + 1]) {
    234                         entry += " at " + lines[i + 1];
    235                         i++;
    236                     }
    237                     callstack.push(entry);
    238                 }
    239             }
    240             //Remove call to printStackTrace()
    241            // callstack.shift();
    242             isCallstackPopulated = true;
    243         }
    244         //===== fin Opera======================================
     157        var retcallstack = [];
     158        var e_message = e.message;
     159        var  e_stack = e.stack;
     160if (e_stack) { //Firefox Opera 3.6
     161//=== test fichier source =============
     162var lines = e.stack.split("\n");
     163for (var i = 0, len = lines.length; i < len; i++) {
     164var Src_Match = lines[i];
     165if (Src_Match.match(/conflit.js/)) {
     166//
     167} else {
     168if (Src_Match.match(/^\s*[A-Za-z0-9\-_\$]+\(/)) {
     169callstack.push(Src_Match); //php?
     170} else {
     171callstack.push(Src_Match);
     172}
     173if (Src_Match.match("rv_gmaps", "gi")) {
     174callstack.push("rv_gmaps");
     175isCallstackPopulated = true;
     176break;
     177}
     178if (Src_Match.match("paMOOramics")) {
     179isCallstackPopulated = true;
     180callstack.push("paMOOramics");
     181break;
     182}
     183if (Src_Match.match("Luciano","gi")) {
     184callstack.push("Luciano");
     185isCallstackPopulated = true;
     186break;
     187}
     188if (Src_Match.match("main")) {
     189alert(Src_Match)
     190callstack.push("main");
     191isCallstackPopulated = true;
     192break;
     193}
     194if (Src_Match.match("GMaps|applyMap")) {
     195callstack.push("GMaps");
     196isCallstackPopulated = true;
     197break;
     198}
     199if (Src_Match.match("jQuery")) {
     200callstack.push("jQuery");
     201isCallstackPopulated = true;
     202break;
     203}
     204}
     205}
     206//callstack.shift();
     207}
     208if (window.opera && e.message && isCallstackPopulated == false) {
     209   callstack = [];
     210//Opera =================================
     211var lines = e.message.split("\n");
     212for (var i = 0, len = lines.length; i < len; i++) {
     213if (lines[i].match(/^\s*[A-Za-z0-9\-_\$]+\(/)) {
     214var entry = lines[i];
     215//Append next line also since it has the file info
     216if (lines[i + 1]) {
     217entry += " at " + lines[i + 1];
     218i++;
     219}
     220callstack.push(entry);
     221 isCallstackPopulated = true;
     222}
     223}
     224
     225}
     226//===== fin Opera======================================
     227}
     228if (!isCallstackPopulated) { //IE and Safari
     229    var currentFunction = arguments.callee.caller;
     230    //next
     231    callstack = [];
     232    all_functions = [];
     233    if (currentFunction == null) {
     234        return ("");
    245235    }
    246     if (!isCallstackPopulated) { //IE and Safari
    247         var currentFunction = arguments.callee.caller;
    248         //next
    249         if (currentFunction == null) {
    250             return ("The function was called from the top!");
    251         }
    252 
    253         currentFunction = currentFunction.caller;
    254         //$family
    255         while (currentFunction) {
    256             var fn = currentFunction.toString();
    257             var fname = fn.substring(fn.indexOf("function") + 8, fn.indexOf("(")) || " ";
     236
     237    currentFunction = currentFunction.caller;
     238    //$family
     239    while (currentFunction) {
     240        var fn = currentFunction.toString();
     241         
     242
     243        var fname = fn.substring(fn.indexOf("function") + 8, fn.indexOf("(")) || " ";
     244        if (fname != " $") {
    258245            callstack.push(fn);
    259246            // if (fname != " $") callstack.push(fn);
    260             if (fn.match(RegExp("buildFrameWork", "gi"))) {  //luciano
    261                 break;
     247                           if (fn.match(RegExp("jquery|switchmenu|gmaps|switchTabs|switchInterface|gally|initializeImageMode", "gi"))) {
     248                    callstack.push('jQuery');
     249                    break;
     250                }
     251
     252
     253                if (fn.match(RegExp("_footer|ie_ready", "gi"))) {
     254                    callstack.push('paMOOramics');
     255                    break;
     256                }
     257                if (fn.match(RegExp("observe|responder|stopobserving|fireContentLoadedEvent", "gi"))) {
     258                    callstack.push('rv_gmaps');
     259                    break;
     260                }
     261                //? bubble 
     262                Expression = new RegExp("\$", "gi")
     263                if (fn.match(Expression)) {
     264                    if (fn.match(RegExp("rateForm", "gi"))) {
     265                        callstack.push('Luciano');
     266                        break;
     267                    }
     268                }
     269                if (fn.match(RegExp("(splat|buildFrameWork|photoNext)", "gi"))) {  //luciano
     270                    callstack.push('Luciano');
     271                    break;
     272                }
     273
    262274            }
    263             if (fn.match(RegExp("_footer", "gi"))) {
    264                 break;
    265             }
    266             if (fn.match(RegExp("observe|responder|stopobserving", "gi"))) {
    267                 callstack.push('prototype.js');
    268                  break;
    269             }
    270             if (fn.match(RegExp("stopobserving", "gi"))) {
    271               break;
    272             }
    273           if (fn.match(RegExp("jquery|switchmenu|gmaps|switchTabs|switchInterface|gally|initializeImageMode", "gi"))) {
    274     break ;
    275 }
    276             currentFunction = currentFunction.caller;
     275         
     276        currentFunction = currentFunction.caller;
    277277        }
    278278 
    279     }
     279}
    280280   
    281281    return callstack.join('\n');
    282282}
    283 /*
    284 //1.2.4
    285  Element1.Events.domready = {
    286     onAdd: function (fn) {
    287         if (Browser.loaded) fn.call(this);
    288     }
    289 } ;
    290 
    291 Element2.Events.domready = {
    292     add: function (B) {
    293         if (window.loaded) { B.call(this); return; }
    294         var A = function () {
    295             if (window.loaded) { return; }
    296             window.loaded = true;
    297             window.timer = $clear(window.timer);
    298             this.fireEvent("domready");
    299         } .bind(this);
    300     }
    301 }
    302 */
  • extensions/Autosize/js/jquery.dimensions.js

    r7394 r7702  
    5959    jQuery.fn.extend({
    6060
    61         info: function () {
     61        infos: function () {
    6262            var width = 0, height = 0;
    6363            var elem = jQuery(this).get(0);
     
    8585            //=====================================================================
    8686            results = {
    87                 position: jQuery(elem).css("position"),
     87                position: {
     88                    top: 0, left: 0
     89                },
    8890                top: 0,
    8991                left: 0,
     
    98100            ;
    99101            if (elem) {
    100                 Position = jQuery(elem).position();
     102                if (elem == window) {
     103                    Position = { top: 0, left: 0 };
     104                } else {
     105                    Position = jQuery(elem).position();
     106                }
    101107                left = Position.left;
    102108                top = Position.top;
    103                 width = jQuery(elem).outerWidth();
    104                 height = jQuery(elem).outerHeight();
     109                if (elem == window) {
     110                    width = jQuery(elem).width();
     111                    height = jQuery(elem).height();
     112                } else {
     113                    width = jQuery(elem).outerWidth();
     114                    height = jQuery(elem).outerHeight();
     115               
    105116
    106117
     
    114125                    borderwidth.width = '"' + borderwidth.left + ' ' + borderwidth.top + ' ' + borderwidth.right + ' ' + borderwidth.bottom + '"';
    115126                }
    116 
     127 
    117128
    118129                margin.left = jQuery(elem).Get_Val_int(jQuery(elem).css("marginLeft"));
     
    133144                    padding.padding = '"' + padding.left + ' ' + padding.top + ' ' + padding.right + ' ' + padding.bottom + '"';
    134145                }
    135 
     146}
    136147                results = {
    137                     position: jQuery(elem).css("position"),
     148                    position: Position,
    138149                    top: top,
    139150                    left: left,
     
    155166        position: function () {
    156167            var left = 0, top = 0, elem = this[0], offset, parentOffset, offsetParent, results;
     168
    157169            if (elem) {
    158170                offsetParent = this.offsetParent();
    159171                offset = this.offset();
     172
    160173                if (offsetParent) {
    161                     if (typeof (offsetParent.offset) != "undefined")
     174                    if (elem == window) {
     175                        parentOffset = { top: 0, left: 0 };
     176                    } else if (typeof (offsetParent.offset) != "undefined")
    162177                        parentOffset = offsetParent.offset();
    163178                    else
    164179                        parentOffset = { top: 0, left: 0 };
     180
     181                    if (!offset)
     182                        offset = { top: 0, left: 0 };
    165183
    166184                    offset.top -= num(elem, 'marginTop');
     
    191209            return jQuery(offsetParent);
    192210        },
    193     /*
    194     * Get_val_int
    195     * params: element,valeur maxi
    196     * return: valeur entiere
    197     */
    198  
    199      Get_Val_int: function(myObj, Maxi_val, Mini_val) {
    200         var val = 0;
    201         var reg1 = new RegExp("%", "g")
    202         Maxi_val = parseInt(Maxi_val || "0");
    203 
    204211        /*
    205         - numérique suivie de px ou % ou pt ou em,
    206         - thin, bordure mince,
    207         - medium, bordure moyenne (valeur par défaut),
    208         - thick, bordure épaisse,
    209         - inherit, hérite de son parent (css2).
     212        * Get_val_int
     213        * params: element,valeur maxi
     214        * return: valeur entiere
    210215        */
    211216
    212         if (!myObj) {
    213             return Maxi_val;
     217        Get_Val_int: function (myObj, Maxi_val, Mini_val) {
     218            var val = 0;
     219            var reg1 = new RegExp("%", "g")
     220            Maxi_val = parseInt(Maxi_val || "0");
     221
     222            /*
     223            - numérique suivie de px ou % ou pt ou em,
     224            - thin, bordure mince,
     225            - medium, bordure moyenne (valeur par défaut),
     226            - thick, bordure épaisse,
     227            - inherit, hérite de son parent (css2).
     228            */
     229
     230            if (!myObj) {
     231                return Maxi_val;
     232            }
     233            if (typeof (myObj) == "string") {
     234                if (myObj == "none") return Maxi_val;
     235                if (myObj == "auto") return Maxi_val;
     236                if (Mini_val)
     237                    if (myObj < Mini_val) return Maxi_val;
     238                switch (myObj) {
     239                    case 'thin':
     240                        return 1;
     241                        break;
     242                    case 'medium':
     243                        return 2;
     244                        break;
     245                    case 'thick':
     246                        return 4;
     247                        break;
     248                    case 'inherit':
     249
     250
     251                        break;
     252
     253                    default:
     254
     255
     256                        break;
     257                }
     258
     259
     260
     261
     262
     263                if (myObj.match(reg1)) val = myObj * Maxi_val / 100;
     264                val = parseInt(myObj);
     265
     266            } else
     267                val = parseInt(myObj);
     268
     269
     270            if (typeof (val) == "NaN") return Maxi_val;
     271            return val;
    214272        }
    215         if (typeof (myObj) == "string") {
    216             if (myObj == "none") return Maxi_val;
    217             if (myObj == "auto") return Maxi_val;
    218             if (Mini_val)
    219                 if (myObj < Mini_val) return Maxi_val;
    220             switch (myObj) {
    221                 case 'thin':
    222                     return 1;
    223                     break;
    224                 case 'medium':
    225                     return 2;
    226                     break;
    227                 case 'thick':
    228                     return 4;
    229                     break;
    230                 case 'inherit':
    231 
    232 
    233                     break;
    234 
    235                 default:
    236 
    237 
    238                     break;
    239             }
    240 
    241 
    242 
    243 
    244 
    245             if (myObj.match(reg1)) val = myObj * Maxi_val / 100;
    246             val = parseInt(myObj);
    247 
    248         } else
    249             val = parseInt(myObj);
    250 
    251 
    252         if (typeof (val) == "NaN") return Maxi_val;
    253         return val;
    254     }
    255273    });
    256274    /*
Note: See TracChangeset for help on using the changeset viewer.