source: extensions/Autosize/js/Affiche_script.js @ 11912

Last change on this file since 11912 was 11912, checked in by cljosse, 13 years ago

[extensions] Autosize fix compatibility with click hd

File size: 57.8 KB
Line 
1Parent = "#theImage";
2function Toggle_bp() {
3    cl_visible = !cl_visible;
4    if (cl_visible) src = src1;
5    else src = src2;
6    if (cl_visible) src_info = src3;
7    else src_info = src4;
8
9    jQuery('#bp_cla').attr('alt', src_info);
10    jQuery('#bp_cla').attr('title', src_info);
11
12    jQuery('#bp_img_cla').get(0).src = src;
13    jQuery('#bp_img_cla').attr('alt', src_info);
14    jQuery('#bp_img_cla').attr('title', src_info);
15    jQuery('#bp_cla').attr('Stitle', src_info);
16    jQuery('#bp_cla').attr('Stip', " ");
17    jQuery().newResize();
18
19}
20nu_img = 0;
21tempo=0;
22
23function Wait_pamoorama() {
24    if (jQuery("#pamoorama").length) {
25        mypanorama = window.myPamoorama;
26        if (!mypanorama) {
27          tempo = tempo + 1;
28          if (tempo > 10) 
29          return true;
30
31            setTimeout("Wait_pamoorama()", 500);
32            return false;
33        }
34        if (mypanorama.skipInit == false) {
35            setTimeout("Wait_pamoorama()", 500);
36            return false;
37        }
38        info_pamoorama = jQuery("#pamoorama").infos();
39        new_width = info_pamoorama.width - (info_pamoorama.borderwidth.left + info_pamoorama.borderwidth.right);
40        if (Math.abs(new_width - myPamoorama.options.width) > 10) {
41            setTimeout("Wait_pamoorama()", 500);
42            return false;
43        }
44
45        nopano = true;
46        old_window = { width: 0, height: 0 };
47        jQuery('#pamoorama').trigger('ON');
48
49    }
50}
51
52
53//==========================================================================
54function Wait_Affichage() {
55    fade_in = parseInt(fade_in);
56    if (!jQuery().newResize()) {
57        setTimeout("Wait_Affichage()", 500);
58        return
59    }
60    nu_img++;
61
62    if (fade_in == 0) {
63        jQuery(Parent).css({ opacity: "1" });
64    } else {
65        jQuery(Parent).animate({ opacity: "1" },
66                                         fade_in, "swing",
67                                         function (i) {
68                                             jQuery(Parent).css({ opacity: "1" });
69                                             if (DEBUG_autosize == "true") {
70                                                 bp1 = jQuery('.debug').get(nu_img);
71                                                 if (!bp1) nu_img = 0;
72                                                 bp1 = jQuery('.debug').get(nu_img);
73                                                 jQuery(bp1).trigger('ON');
74                                             }
75                                         }
76                                       );
77
78    }
79    //   if (nu_img > 1) return;
80
81
82
83    img_h = jQuery(theImg).height();
84    img_w = jQuery(theImg).width();
85
86    jQuery("#src_img_h").val(img_h);
87    jQuery("#src_img_w").val(img_w);
88    jQuery("#ret_autosize").val(src_img);
89    if (typeof Window_Affichage =="undefined" ) {
90        Window_Affichage = { height: Zone_Affichage.height,
91            width: Zone_Affichage.width
92        };
93    }
94    jQuery("#window_height").val(Window_Affichage.height);
95    jQuery("#window_width").val(Window_Affichage.width);
96    jQuery("#ret_autosize").trigger('ON', { width: img_w,
97        height: img_h,
98        theImage: theImg,
99        src_img: src_img,
100        window_height: Window_Affichage.height,
101        window_width: Window_Affichage.width
102    });
103
104
105}
106
107//=====================================================================
108
109List_autosize = new Array();
110function Autosize_resize(Obj) {
111    if (typeof cl_visible != "undefined") return;
112
113
114    conf = jQuery(Obj).get(0).conf;
115    Obj = jQuery(Obj).get(0).obj;
116    myWindow = jQuery("#" + conf.parent).infos();
117
118    if (myWindow.width == 0) myWindow = jQuery(window).infos();
119    marge_basse = 0;
120    if (conf.MargeBasse)
121        marge_basse = jQuery().Get_Val_int(
122            conf.MargeBasse
123    );
124    marge_top = 0;
125    if (conf.MargeHaute)
126        marge_top = jQuery().Get_Val_int(
127            conf.MargeHaute
128    );
129
130    info_Obj = jQuery(Obj).infos();
131    h1_left = jQuery(Obj).absoluteLeft();
132    h1_top = jQuery(Obj).absoluteTop();
133
134    if (h1_top < info_Obj.height)
135        h1 = (myWindow.height - h1_top - marge_basse - marge_top);
136    else
137        h1 = (myWindow.height - marge_basse);
138
139
140    rap = info_Obj.height / info_Obj.width;
141    w2 = parseInt(h1 / rap);
142
143    if (w2 < info_Obj.width)
144        marginLeft = info_Obj.left + parseInt((info_Obj.width - w2) / 2) + "px";
145    else
146        marginLeft = "auto";
147
148    jQuery(Obj).css({ width: "auto", marginTop: marge_top,
149        marginLeft: "auto", marginBottom: 0 + "px",
150        verticalAlign: "middle", textAlign: "center"
151    });
152    jQuery(Obj).height(h1);
153
154    //=============================================================
155    if (conf.ResizePicture != "true") {
156
157    } else
158        imgs = jQuery(Obj).find("img");
159    Obj_w = jQuery(Obj).width();
160    Obj_h = jQuery(Obj).height();
161
162    jQuery(imgs).each(function (i) {
163        img = jQuery(this);
164
165        info_img = { width: conf.width[i], height: conf.height[i] };
166        img_rap = conf.rap[i];
167
168        if (info_img.width > Obj_w) h1 = parseInt(Obj_w / img_rap);
169        else w2 = parseInt(Obj_h * img_rap);
170        if (w2 > 0 && h1 > 0 && img.length > 0) {
171            img.height(h1);
172            img.width(w2);
173        }
174
175    });
176
177
178
179
180}
181jQuery.extend(jQuery.expr[':'], {
182    // Nom du sélecteur personnalisé
183    Autosize: function (a) {
184        n1 = a.className;
185        // personal_block
186        if (n1.match(RegExp("autosize", "gi"))) {
187            //   autoresize = "MargeBasse:30px; ResizePicture:false"
188            infconf = jQuery(a).attr("autosize");
189            n1 = typeof infconf;
190            conf = { MargeBasse: 0, NoPicture: false }
191            if (n1 == "undefined") {
192
193            } else {
194                tableau = infconf.split(";");
195                for (var i = 0; i < tableau.length; i++) {
196                    tableau2 = tableau[i].split(":");
197                    conf[jQuery.trim(tableau2[0])] = jQuery.trim(tableau2[1]);
198                }
199                imgs = jQuery(a).find("img");
200                rap = new Array();
201                width = new Array();
202                height = new Array();
203                jQuery(imgs).each(function (i) {
204                    img = jQuery(this);
205                    rap.push((img.width() / img.height()));
206                    width.push(img.width());
207                    height.push(img.height());
208                });
209
210                conf['rap'] = rap;
211                conf['width'] = width;
212                conf['height'] = height;
213
214                List_autosize.push({ obj: a, conf: conf });
215                jQuery(a).css({ opacity: 1 });
216            }
217        }
218        //  Css = jQuery(a).getStyles(a);
219
220        return false;
221
222    }
223});
224
225
226function List_autosize_resize(event, ui) {
227    if (typeof wait_resize == "undefined") wait_resize = false;
228    if (wait_resize == true) return;
229
230    wait_resize = true;
231    if (List_autosize.length == 0) return;
232    for (i = 0; i < List_autosize.length; i++) {
233        Autosize_resize(jQuery(List_autosize[i]));
234    }
235    wait_resize = false;
236
237}
238//==============================================================
239jQuery(document).ready(
240     function (jQuery) {
241       jQuery(':Autosize');
242
243       jQuery(window).unload(function () {
244         try {
245           if (theImg) {
246             jQuery.cookie('img', theImg.src); // créer un cookie avec une valeur
247             jQuery.cookie('img_h', jQuery(theImg).height());
248             jQuery.cookie('img_w', jQuery(theImg).width());
249             jQuery.cookie('window_height', Window_Affichage.height);
250             jQuery.cookie('window_width', Window_Affichage.width);
251           }
252         } catch (r) {
253
254         }
255
256       });
257
258
259
260       jQuery(window).load(function () {
261         if (typeof img_width == "undefined") {
262           if (List_autosize.length == 0) return;
263           for (i = 0; i < List_autosize.length; i++) {
264             Autosize_resize(jQuery(List_autosize[i]));
265           }
266           return;
267         }
268
269
270         //=========================================================
271         if (typeof (options) == "undefined") {
272           options = { imageAutosizeMargin: 0, imageAutosize: false }
273         }
274
275         old_img = jQuery.cookie('img');
276         old_img_h = jQuery.cookie('img_h');
277         old_img_w = jQuery.cookie('img_w');
278         old_window_height = jQuery.cookie('window_height');
279         old_window_width = jQuery.cookie('window_width');
280
281         //============================================================
282         img_init = { height: img_height, width: img_width };  // taille initiale
283         img_defaut = { height: scaled_height, width: scaled_width };
284         img_reelle = { height: img_height, width: img_width };
285         img_finale = { height: 0, width: 0 };
286
287         img_top = "0";
288         rapport = -1;
289         marges_llgbo = 0;
290
291         //=============================================================
292         Type_Img = "";
293         theImg = null;
294         nopano = false;
295
296
297         Zone_Affichage = { height: 0, width: 0 };
298         //============================================================
299         jQuery("#the_page").css({ top: "0px" });
300
301         Info_the_page = jQuery("#the_page").infos();
302         info_HeaderBar = jQuery("#imageHeaderBar").infos();
303
304         Parent = "#theImage";
305
306         Zone_Affichage = jQuery(Parent).infos();
307         //
308         var old_window = { width: 0, height: 0 };
309
310         Bandeau_bas = Info_Description_f(Parent);       
311         if (typeof Bandeau_bas == "undefined") {
312 
313         }
314         if (typeof Bandeau_bas != "undefined") Bandeau = Bandeau_bas.top;
315         else Bandeau = 0;
316         old_window = { width: 0, height: 0 };
317         jQuery("#theImage").trigger('ON');
318
319         old_window = { width: 0, height: 0 };
320         jQuery().newResize();
321
322         //===================================================================
323         /*
324         * window .resize
325         */
326         jQuery(window).resize(
327               function (event, ui) {
328                 jQuery().newResize();
329               });
330
331         //============== initialisation ===================
332
333         var pos;
334         var set_p = false;
335
336
337       }); // window.onload
338
339       /* Extension
340       * affiche_debug
341
342       * resize
343       * :
344       */
345       //=========================================================
346       old_window = { width: 0, height: 0 };
347       jQuery(window).resize(
348               function (event, ui) {
349                 List_autosize_resize(event, ui);
350                 jQuery().newResize();
351               });
352
353       jQuery.fn.extend({
354         //==========================================================
355         Info_description: function (e) {
356           return Info_Description_f(e);
357
358         },
359         //=============================================================
360         onPropertyChange: function (e) {
361           return;
362
363
364         },
365         /*
366         * recherche la plus grande image (hauteur ou largeur)
367         */
368         Get_Img_Maxi: function (myobj) {
369           return Get_Img_Maxi(myobj);
370         },
371         //============================================================
372         affiche_debug: function (aff_infos) {
373           affiche_debug(aff_infos);
374         },
375         //====================================================
376         newResize: function () {
377           //
378          if (typeof options != undefined)
379             if (options.imageAutosize)
380               return true; //stripped
381           if (DEBUG_autosize == "true") {
382             nu_img += 1;
383
384             bp1 = jQuery('.debug').get(nu_img);
385             if (!bp1) nu_img = 0;
386             bp1 = jQuery('.debug').get(nu_img);
387
388             jQuery(bp1).trigger('ON');
389           }
390           if (typeof cl_visible == "undefined") return;
391           if (!cl_visible == true) { return true; }
392           var chk = eval(user_status + "_enabled");
393           if (chk == "") { return true; }
394           //=================================================================
395           var winwidth = jQuery(window).width();
396           var winheight = jQuery(window).height();
397           n = winwidth - old_window.width;
398           if (Math.abs(n) < 1) {
399             n = winheight - old_window.height;
400             if (Math.abs(n) < 1)
401               return true;
402           }
403           if (Math.abs(n) > 30) nu_img = 0;
404           //if (nu_img > 10) return true;
405           old_window = jQuery(window).infos();
406           //===========================================================================
407
408           jQuery(Parent).width(winwidth);
409           //  jQuery(Parent).height(winheight);
410
411           var Cadre = jQuery(Parent).get(0);
412           var info_theImage = jQuery(Cadre).infos();
413           //===============  Information cadre ======
414           var info_the_page = jQuery("#the_page").infos();
415           //=============================================================================
416
417           var info_content = jQuery("#content").infos();
418           var info_titrePage = jQuery("#titrePage").infos();
419           var info_imageInfoBar = jQuery("#imageInfoBar").infos();
420           var info_theHeader = jQuery("#theHeader").infos();
421
422           var Zone_Affichage = jQuery(Parent).infos();
423           var info_ToolBar = jQuery("#imageToolBar").infos();
424           var marge = 0;
425           var marge_right = 0;
426           var marge_left = 0;
427           if (theme.match(RegExp("simple", "g"))) {
428             if (info_ToolBar.width > 0)
429               marge = (Zone_Affichage.width - info_ToolBar.width) / 2;
430             else if (info_the_page.width > 0)
431               marge = (Zone_Affichage.width - info_the_page.width) / 2;
432
433             marge_right = marge;
434             marge_left = marge;
435
436             if (info_content.width > 100) {
437
438               marge_left = (info_imageInfoBar.margin.left) + 1;
439               marge_right = (marge_left + info_imageInfoBar.margin.right) + 1;
440               winwidth = info_content.width;
441               marge_right = info_imageInfoBar.width + marge_right;
442
443             }
444           } else {
445             if (theme.match(RegExp("stripped", "gi"))) {
446
447               marge = (info_the_page.width - info_HeaderBar.width) / 2;
448               marge_right = marge + 2;
449               marge_left = marge + 2;
450             } else if (info_ToolBar.width > 0) {
451               marge = (info_the_page.width - info_ToolBar.width) / 2;
452
453               marge_right = marge + info_the_page.left;
454               marge_left = marge;
455
456             }
457             winwidth = info_the_page.width;
458           }
459
460
461
462           marge_right += Zone_Affichage.borderwidth.right;
463           marge_left += Zone_Affichage.borderwidth.left;
464           winwidth -= (marge_right + marge_left);
465           //---------------------------------------------
466           /*
467           jQuery(Parent).width(winwidth); // 1.6.2
468           jQuery(Parent).css({ height: "auto" }); //1.6.2
469           */
470           //  jQuery(Parent).height(Zone_Affichage.height);
471           //---------------------------------------------
472
473           if (Type_Img == "pamoorama") {
474
475             mypanorama = window.myPamoorama;
476             //============================================================
477             if (typeof (mypanorama) == "undefined") return false;
478             var myPamoorama = mypanorama;
479             if (typeof (myPamoorama.skipInit) == "undefined") return false;
480             //
481
482             if (myPamoorama.skipInit == false) {
483
484               return false;
485             }
486
487             var info_pamoorama = jQuery("#pamoorama").infos();
488             var info_pamoorama_outter = jQuery("#pamoorama_outter").infos();
489             var info_pamoorama_inner = jQuery("#pamoorama_inner").infos();
490             var info_pamoorama_footer = jQuery("#pamoorama_footer").infos();
491             var info_pamoorama_frame = jQuery("#pamoorama_frame").infos();
492             theImg = jQuery("#pamoorama");
493             obj = theImg.get(0);
494
495           } else {
496
497
498
499
500           }
501           //=================================================================
502
503
504           switch (Type_Img) {
505             case "map":
506               img_reelle.height = winheight; // info_img.height;
507               info_map = jQuery("#mapPicture").infos();
508               jQuery("#map").css("left", info_map.width + "px");
509               Bandeau_bas.height = 10;
510
511               if (theme.match(RegExp("simple", "g"))) {
512                 img_reelle.width = winwidth; //- info_map.width -marge_right;
513               } else {
514                 img_reelle.width = winwidth - info_map.width - marge_right;
515               }
516
517
518               info_the_page = jQuery("#the_page").infos();
519               winwidth = img_reelle.width;
520
521               ;
522
523               break
524
525
526             case "panorama":
527               //  return;
528
529               //the theMainImage ??
530               theImg = jQuery("#theMainImage");
531               if (theImg.length > 0)
532                 theImg = theImg[0];
533               else
534                 theImg = jQuery().Get_Img_Maxi("#Panorama img[alt]");
535               info_theImage = jQuery(theImg).infos();
536               info_the_page = jQuery("#the_page").infos();
537               jQuery("#theImage").height(info_theImage.height);
538               img_finale.height = info_theImage.height;
539
540               break
541             case "img":
542
543               if (!theImg) return true;
544               if (theme.match(RegExp("luciano", "g"))) {
545                 theImg = jQuery("#the_page #theImg");
546               }
547               info_theImage = jQuery(theImg).infos();
548               info_the_page = jQuery("#the_page").infos();
549
550
551               break
552             case "img_autre":
553               if (!theImg) {
554                 if (DEBUG_autosize == "true") alert("theImg=null");
555                 return true;
556
557               }
558               info_theImage = jQuery(theImg).infos();
559               info_the_page = jQuery("#the_page").infos();
560
561
562               break
563             case "embed":
564               //
565
566               info_theImage = info_img;
567               info_the_page = jQuery("#the_page").infos();
568
569               if (rapport < 0) {
570                 img_height = info_img.height;
571                 img_width = info_img.width;
572
573                 img_reelle.height = img_height;
574                 img_reelle.width = img_width;
575
576               }
577
578               break
579             case "charlie":
580
581
582               info_theImage = info_img;
583               info_the_page = jQuery("#the_page").infos();
584               if (rapport < 0) {
585                 img_height = parseInt(info_img.height);
586                 img_width = parseInt(info_img.width);
587
588                 img_reelle.height = parseInt(info_img.height);
589                 img_reelle.width = parseInt(info_img.width);
590               }
591
592               break
593             case "pamoorama":
594
595               img_reelle = { height: img_height, width: img_width };
596
597               //=========================================================
598               img_reelle.height = img_height;
599               img_reelle.width = Zone_Affichage.width;
600
601
602               theImg = myPamoorama.image;
603               info_theImage = jQuery("#pamoorama").infos();
604               //img_finale.height = info_theImage.height;
605               //info_theImage.height = img_reelle.height;
606
607               info_theImage.height = info_theImage.height;
608
609               info_the_page = jQuery("#the_page").infos();
610
611               break
612
613
614           }
615           //================= Vérification taille image ==================
616           MinWidth = jQuery(theImg).css("minWidth");
617           if (MinWidth == "0px")
618             MinWidth = mini_width;
619           MinHeight = jQuery(theImg).css("minHeight");
620           if (MinHeight == "0px")
621             MinHeight = mini_height;
622
623           MaxWidth = jQuery(theImg).css("maxWidth");
624           if (MaxWidth == "0px")
625             MaxWidth = winwidth;
626           MaxHeight = jQuery(theImg).css("maxHeight");
627           if (MaxHeight == "0px")
628             MaxHeight = mwinheight;
629
630           //=============== Vérification taille minimale  autorizée ======================
631           var miniWidth = jQuery(theImg).Get_Val_int(MinWidth, mini_width);
632           var miniHeight = jQuery(theImg).Get_Val_int(MinHeight, mini_height);
633           if (winwidth < mini_width2) mini_width2 = winwidth;
634
635           var miniWidth2 = jQuery(theImg).Get_Val_int(MinWidth, mini_width2);
636           var miniHeight2 = jQuery(theImg).Get_Val_int(MinHeight, mini_height2);
637
638
639           var maxWidth = jQuery(theImg).Get_Val_int(MaxWidth, winwidth, "0");
640           maxHeight = jQuery(theImg).Get_Val_int(MaxHeight, winheight, "0");
641
642
643
644           mini_width = parseInt(miniWidth);
645           mini_height = parseInt(miniHeight);
646
647           img_reelle.width = parseInt(img_reelle.width);
648           // jQuery(Cadre).width(mini_width); 1.6.2
649
650
651           if (img_reelle.width < mini_width) {
652             //jQuery(Cadre).width(mini_width); 1.6.2
653             return true;
654
655           }
656
657           img_reelle.height = parseInt(img_reelle.height);
658           if (img_reelle.height < parseInt(mini_height))
659             return true;
660           //==================================================================================
661           //---------------------------------------------
662           //  jQuery(Parent).width(winwidth);
663           //  jQuery(Parent).css({ height: "auto" });
664           //  jQuery(Parent).height(Zone_Affichage.height);
665           //---------------------------------------------
666
667           if (rapport < 0) {
668
669             img_init.height = parseInt(img_height);
670             img_init.width = parseInt(img_width);
671
672             rapport = img_width / img_height;
673
674             if (Type_Img != "map")
675               rapport = (img_init.width / img_init.height);
676             else
677               rapport = 0;
678
679           }
680
681
682           //=============== Zone d'affichage ============================
683
684           borderW = Zone_Affichage.borderwidth.left;
685           borderW += Zone_Affichage.borderwidth.right;
686
687
688           Zone_Affichage.width = winwidth - borderW;
689
690
691
692           var Licence = jQuery(".licencetag");
693           info_Licence = jQuery(".licencetag").infos();
694
695           jQuery(Parent + " #theImg IMG").css("marginTop", "0px")
696           //========== Correction en fonction du thème =============================
697           var correction = 0;
698           if (theme.match(RegExp("sobre", "g"))) {
699
700             //   correction = -info_Licence.padding.top;
701             if (Type_Img == 'img') {
702               if (msie == true) correction = 0;
703               else correction = 0;
704               correction = 10;
705             }
706
707           } else if (theme.match(RegExp("Pure", "g"))) {
708             correction += 0; //??
709           } else if (theme.match(RegExp("luciano", "g"))) {
710             correction = 0; //??
711
712           } else if (theme.match(RegExp("simple", "g"))) {
713             correction += 0; //??
714           } else if (theme.match(RegExp("gally", "g"))) {
715             correction += 0; //??
716
717           }
718
719           //====================================================
720           if (options.imageAutosizeMargin > 0) Marge_Basse = options.imageAutosizeMargin;
721           else Marge_Basse = parseInt(marge_basse || 0); // hors bandeau
722           //==========================================================================
723           h = 0;
724           Bandeau = 0;
725
726           h = (Zone_Affichage.padding.bottom + Zone_Affichage.padding.top + Zone_Affichage.margin.top + Zone_Affichage.margin.bottom);
727
728           if (typeof Bandeau_t != "undefined") Bandeau = Bandeau_t.img_top|0;
729           Zone_Affichage.height = winheight - Bandeau - Marge_Basse - correction - h;
730           //=========================================================================
731           if (Zone_Affichage.height < mini_height2)
732             Zone_Affichage.height = mini_height2;
733           if (Zone_Affichage.width < mini_width2)
734             Zone_Affichage.width = mini_width2;
735           //=========================================================================
736           if (typeof (Bandeau_bas) != "undefined") {           
737              Zone_Affichage.height -= (Bandeau_bas.height + Bandeau_bas.marge.top|0 + Bandeau_bas.marge.bottom|0);
738                        } else {
739           }
740
741           var Image_height = Zone_Affichage.height;
742
743           //=============================================================
744           var height_user = eval(user_status + "_height");
745           var reg1 = new RegExp("%", "g");
746           if (height_user.match(reg1))
747             Image_height = Image_height * parseInt(height_user) / 100;
748           else
749             Image_height = parseInt(height_user);
750
751           echelle_max = parseFloat(echelle_max, '3');
752           var echelle = parseFloat(Image_height / img_reelle.height, 3);
753
754           if (echelle > echelle_max) { echelle = echelle_max; }
755           Image_height = parseInt(img_reelle.height * echelle);
756           //============================================================
757
758           var Image_width;
759           if (rapport > 0)
760             Image_width = parseInt(Image_height * rapport);
761           else if (Type_Img == "map") {
762             Image_width = Zone_Affichage.width - marge_left - marge_right;
763           } else {
764             Image_width = Zone_Affichage.width;
765           }
766
767           //===============================================================
768           align_auto = "center";
769           if (jQuery("#theImg").css("textAlign"))
770             align_auto = jQuery("#theImg").css("textAlign");
771           var widthmin = winwidth;
772
773           if (check_auto_w == 'checked="checked"') {
774             // if (Type_Img != "pamoorama" && Type_Img != "panorama" ) {
775             //==== largeur à atteindre ===
776             var width_user = eval(user_status + "_width");
777             // Largeur maximale en fonction du statut
778             if (width_user.match(reg1))
779             // pourcentage
780               widthmin = widthmin * parseInt(width_user) / 100;
781             else
782               widthmin = parseInt(width_user);
783
784             var marges = 0;
785
786             if (typeof (info_img) != "undefined") {
787               widthmin -= info_img.borderwidth.left || 0;
788               widthmin -= info_img.borderwidth.right || 0;
789             }
790             widthmin -= marges;
791             if (typeof Bandeau_t != "undefined") {
792               widthmin -= (Bandeau_t.borderwidth.left + Bandeau_t.borderwidth.left);
793               Image_width -= (Bandeau_t.borderwidth.left + Bandeau_t.borderwidth.left);
794             } else {
795
796               jQuery().newResize();
797             }
798             if (Image_width > widthmin) {
799               //   Image_width largeur à atteindre
800               //  Calcul du rapport d'agrandissement
801               var echelle_w = parseFloat((widthmin) / img_reelle.width, 3);
802               if (echelle_w > echelle_max) { echelle_w = echelle_max; }
803               Image_width = parseInt(img_reelle.width * echelle_w);
804               if (rapport > 0)
805                 Image_height = parseInt(Image_width / rapport);
806             }
807
808
809
810           }
811
812
813           // }
814           //===================================================
815
816           img_finale.height = Image_height;
817           img_finale.width = Image_width;
818           if (theme.match(RegExp("stripped", "gi"))) {
819             img_finale.width -= (llgboframe.top * 2);
820             if (rapport > 0) img_finale.height = (img_finale.width / rapport);
821             else img_finale.height -= (llgboframe.top * 2);
822
823           }
824           zoom = echelle;
825           if (typeof (llgboframe) != "undefined" && llgboframe.height > 0) {
826             //=============LLGBO2 ===========================
827             t1 = llgboframe;
828             if (!theImg.src) {
829               theImg = jQuery("#gbo").find("img").get(0)
830               if (!theImg.src) {
831                 theImg = jQuery(Parent).find("div").get(0)
832               }
833             }
834             if (theImg.src) {
835
836
837               wingbo = img_finale.width;
838               heightgbo = img_finale.height;
839               if (Type_Img == "panorama") {
840                 heightgbo = info_theImage.height;
841                 img_finale.height = info_theImage.height;
842               }
843
844               img_finale.width -= marges_llgbo;
845               if (jQuery("#slideshow").infos().width > 0) {
846                 img_finale.height -= (marges_llgbo * 1.5);
847               } else {
848                 img_finale.height -= marges_llgbo
849               }
850
851
852               if (wingbo > winwidth) {
853                 jQuery("#gbo").width(winwidth);
854                 jQuery("#gbo").height(winheight);
855                 jQuery("#gbo").css("width", winwidth + "px");
856                 jQuery("#gbo").css("height", winheight + "px");
857               }
858               else {
859                 jQuery("#gbo").width(wingbo);
860                 jQuery("#gbo").height(heightgbo);
861                 jQuery("#gbo").css("width", wingbo + "px");
862                 jQuery("#gbo").css("height", heightgbo + "px");
863               }
864
865               a0 = jQuery("area[rel!=up][rel!=prev][rel!=next]");
866               a1 = jQuery("area[rel=prev]");
867               a2 = jQuery("area[rel=next]");
868               a3 = jQuery("area[rel=up]");
869               nb_zone = 3;
870               if (a1.length == 0) {
871                 nb_zone -= 1;
872               }
873               if (a2.length == 0) {
874                 nb_zone -= 1;
875               }
876
877
878               var Largeur_zone = (img_finale.width / nb_zone);
879               var Hauteur_zone = (img_finale.height);
880               var init_zone = 0;
881
882               if (a1.length > 0) {
883                 coord = { x0: init_zone, y0: 0, x1: Largeur_zone, y1: Hauteur_zone };
884
885                 jQuery("area[rel=prev]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" });
886                 init_zone += Largeur_zone;
887               }
888
889               coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: img_finale.height };
890
891               if (a0.length > 0) {
892                 jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1 / 2) + "'" });
893                 jQuery(a0).attr({ coords: "'" + coord.x0 + "," + (coord.y1 / 2) + "," + coord.x1 + "," + (coord.y1) + "'" });
894               } else {
895                 jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1) + "'" });
896               }
897               init_zone += Largeur_zone;
898
899               if (a2.length > 0) {
900                 coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: img_finale.height };
901                 jQuery("area[rel=next]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" });
902               }
903               jQuery("#theImage").height(heightgbo + marges_llgbo / 2);
904             }
905           }
906
907           //================ Zone affichage =========================
908
909
910           //  jQuery(Cadre).css("top", "0px");
911           jQuery("#standard").css("top", 0 + "px");
912           jQuery("#comments").css("top", 0 + "px");
913           //========== Image Remise à l'échelle =======================
914
915           img_finale.height = parseInt(img_finale.height);
916           img_finale.width = parseInt(img_finale.width);
917           //=========================================================================
918           if (jQuery("#slideshow").infos().width > 0) {
919
920
921           } else {
922
923           }
924           //=== cadre = theImage
925           jQuery(Cadre).css({ marginLeft: "auto" });
926           // jQuery(Cadre).width(Zone_Affichage.width);
927           jQuery(Cadre).css("width", "auto");
928
929           if (Type_Img == "panorama" || Type_Img == "pamoorama") {
930             img_finale.height = info_theImage.height;
931             Zone_Affichage.height = img_finale.height;
932             jQuery(Cadre).height(Zone_Affichage.height);
933           }
934
935           if (typeof (gmaps) != "undefined") {
936             Gmap_ = gmaps.maps[0];
937             if (Gmap_.sizeMode == 'A') {
938               jQuery("#iGMapsIcon").css({ width: old_window.width * 0.8 + "px", height: old_window.height * 0.8 + "px" });
939
940             }
941           }
942           //============= flv,mov,mpg  ok
943           /* wmv nok
944           * avi nok
945           //===========================================
946           */
947           if (Type_Img == "charlie") {
948             t1 = jQuery("#charlie").infos();
949
950             /**/
951
952             pdf = 0;
953             jQuery("#charlie div").each(function (i) {
954
955
956               p1 = jQuery(this).infos();
957               pdf += p1.padding.right + p1.padding.left;
958             });
959             img_finale.width -= pdf;
960
961             jQuery("#charlie").css({
962               width: img_finale.width + pdf,
963               height: img_finale.height,
964               marginLeft: "auto"
965             });
966
967
968
969             jQuery("#player").css("width", img_finale.width + "px");
970             jQuery("#player").css("height", img_finale.height);
971
972             jQuery("#embedplayer").css("width", img_finale.width);
973             jQuery("#embedplayer").css("height", img_finale.height);
974
975
976             jQuery("object").width(img_finale.width);
977             jQuery("object").height(img_finale.height);
978
979             jQuery(Cadre).height(img_finale.height + Bandeau_bas.height); //??
980             jQuery(theImg).height(img_finale.height);
981
982             jQuery(Cadre).css("height", "auto"); 
983
984           } else if (Type_Img == "panorama") {
985             // -----     jQuery(theImg).panorama2(img_finale.height, img_finale.width);
986             //  jQuery(theImg).height(img_finale.height);
987             //   jQuery(theImg).width(img_finale.width);
988             //  n = jQuery.fn.panorama();
989             // jQuery("#Panorama div").height(img_finale.height);
990             //  class=simple_panorama
991             // jQuery("#Panorama div").height(img_finale.height);
992             if (typeof asp_options != "undefined")
993               n = asp_options;
994             n1 = jQuery("#Panorama div").width();
995             // asp_options.viewport_width = winwidth;
996             //n =n.panorama_animate();
997             //jQuery("#panoramaContainer").stop(); ;
998             // n = jQuery(theImg).panorama(asp_options);
999
1000             //jQuery("#Panorama div").width(asp_options.viewport_width);
1001
1002             jQuery(".panorama-viewport").css("margin", "auto");
1003
1004             n = info_imageToolBar;
1005
1006
1007           } else if (Type_Img == "pamoorama") {
1008
1009
1010
1011             info_theImage.height = Zone_Affichage.height;
1012             img_height = myPamoorama.imageHeight
1013             if (theme.match(RegExp("simple", "g"))) {
1014               //  marge_right = 2;
1015             }
1016             new_width = Zone_Affichage.width - marge_right - marge_left;
1017             new_width = Zone_Affichage.width - (info_theImage.borderwidth.right + info_theImage.borderwidth.left);
1018             if (new_width > myPamoorama.imageWidth)
1019               new_width = myPamoorama.imageWidth;
1020
1021
1022
1023             Zone_Affichage.height += info_pamoorama_footer.height;
1024             zoom = info_theImage.height / img_height;
1025             myPamoorama.options.width = new_width * zoom;
1026             //  if(msie || safari) jQuery("#pamoorama_inner ").css({ zoom: zoom });
1027             //====================================================
1028             jQuery("#pamoorama").css({
1029               marginLeft: "auto",
1030               marginRight: "auto",
1031               //height: Zone_Affichage.height + "px", sinon déclenchement panorama sur la hauteur;
1032               width: new_width + "px"
1033             });
1034             jQuery("#pamoorama").width(new_width);
1035
1036             //====================================================
1037             info_pamoorama = jQuery("#pamoorama").infos();
1038             img_finale.height = info_pamoorama.height - info_pamoorama_footer.height;
1039             img_finale.width = new_width;
1040
1041             jQuery("#pamoorama_outter").width(new_width);
1042
1043             jQuery("#pamoorama_thumb").width(200 / zoom);
1044             // commenter sinon outter augmente à chaque resize
1045             //  jQuery("#pamoorama_outter").height(info_pamoorama.height - info_pamoorama_footer.height);
1046             // pamoorama_frame
1047
1048
1049             jQuery("#pamoorama_outter").css({ width: new_width + "px" });
1050             jQuery("#pamoorama_footer").css({ width: new_width + "px" });
1051             //
1052             //====================================================
1053             info_pamoorama = jQuery("#pamoorama").infos();
1054             info_pamoorama_outter = jQuery("#pamoorama_outter").infos();
1055             info_pamoorama_inner = jQuery("#pamoorama_inner").infos();
1056             info_pamoorama_footer = jQuery("#pamoorama_footer").infos();
1057             info_pamoorama_frame = jQuery("#pamoorama_frame").infos();
1058
1059             info_frame = jQuery(myPamoorama.frame).infos();
1060
1061             zoom = img_finale.height / img_height;
1062
1063
1064           } else if (theImg != null && theImg.src) {
1065             //--- background ?? ---
1066             jQuery(theImg).height(img_finale.height);
1067             jQuery(theImg).width(img_finale.width);
1068             jQuery(theImg).css({ height: img_finale.height + "px ",
1069               width: img_finale.width + "px "
1070             });
1071
1072
1073           } else {
1074             //===map ? luciano ===
1075
1076        // jQuery(Cadre).height(Zone_Affichage.height + Bandeau_bas.height); //??
1077              //     jQuery(Cadre).height(img_finale.height + Bandeau_bas.height); //??
1078         jQuery(Cadre).css("height","auto"); //??
1079             jQuery(theImg).height(img_finale.height);
1080             jQuery(theImg).width(img_finale.width);
1081             jQuery(theImg).css({ height: img_finale.height + "px ",
1082               width: img_finale.width + "px "
1083             });
1084             if (theme.match(RegExp("luciano", "g"))) {
1085               jQuery(Parent + " #theImg IMG").css({ height: img_finale.height + "px ",
1086                 width: img_finale.width + "px "
1087               })
1088             }
1089
1090           }
1091
1092           jQuery("#navThumbPrev").css({ overflow: "hidden" });
1093           jQuery("#navThumbNext").css({ overflow: "hidden" });
1094           n = typeof inittoolbar;
1095           if (Type_Img == "map") {
1096             jQuery("#navThumbNext").css({ display: 'none' });
1097             jQuery("#navThumbPrev").css({ display: 'none' });
1098             jQuery("#theImage").css({ marginTop: info_ToolBar.height + "px", marginLeft: "0px",
1099               width: winwidth + "px",
1100               height: winheight + "px"
1101             });
1102             //mapPicture
1103           }
1104           try {
1105             if (theme.match(RegExp("gally", "gi"))) {
1106               if (typeof inittoolbar == "function") {
1107                 if (typeof (currentTab) == "undefined") inittoolbar();
1108                 else initializeImageMode("resize");
1109               } else {
1110                 tp = gallyPP.getImageProp();
1111                 if (typeof (GallyPP) == "function")
1112                   gallyPP = new GallyPP();
1113
1114                 iph = jQuery("#imageHeaderBar").infos();
1115                 jQuery("#imageToolBar").css({ top: iph.bottom + "px", position: "absolute" });
1116                 jQuery("#theImage").width(winwidth);
1117               }
1118               //===========================================================================
1119               if (jQuery("#navThumbPrev").length > 0) {
1120                 jQuery("#navThumbPrevContainer").css({ left: "0px"
1121                 });
1122               }
1123               if (jQuery("#navThumbNext").length > 0) {
1124                 jQuery("#navThumbNextContainer").css({ left: "0px"
1125                 });
1126               }
1127               //=============================================================================
1128               if (!theme.match(RegExp("lapis", "gi"))) {
1129                 if (typeof initializeImageMode == "function") {
1130                   initializeImageMode("resize");
1131                 }
1132
1133               }
1134
1135             } else if (theme.match(RegExp("simple", "g"))) {
1136
1137               jQuery("#imageToolBar").css({ position: "static" });
1138
1139               info_imageInfoBar = jQuery("#imageInfoBar").infos();
1140               if (info_imageInfoBar.bottom < info_img.bottom) {
1141                 //   jQuery("#imageInfoBar").height(info_img.bottom);
1142               }
1143
1144             } else {
1145
1146               //    jQuery("#imageToolBar").css("position", "static");
1147             }
1148           } catch (e) {
1149
1150           }
1151           //  --- réglage de la hauteur de page en fonction du copyright-----------
1152           if (typeof (pos_copyright) == "undefined") pos_copyright = jQuery("#copyright").infos();
1153
1154           if (theme.match(RegExp("stripped", "gi"))) {
1155             var TitleBox = jQuery("#imageTitleContainer");
1156             if (TitleBox.length != 0) TitleBox.css("width", img_finale.width + "px");
1157           } else {
1158             if (pos_copyright.top > 100) {
1159               // jQuery("#the_page").height(pos_copyright.top);
1160             }
1161           }
1162
1163
1164           /*
1165           if (!theme.match(RegExp("luciano", "gi"))) {
1166           jQuery("#linkNext").css({ height: "80px", width: "200px", overflow: "hidden" });
1167           jQuery("#linkPrev").css({ height: "80px", width: "200px", overflow: "hidden" });
1168           jQuery(".navThumb img").css({ height: "80px", width: "", overflow: "hidden" });
1169           }
1170           */
1171           info_frame = jQuery(Cadre).infos();
1172           if (theme.match(RegExp("stripped", "gi"))) {
1173             pos = "absolute";
1174             info_theImageBox = jQuery("#theImageAndTitle").infos();
1175             p1 = jQuery(".randomButtons").infos();
1176             p2 = jQuery("#imageHeaderBar").infos();
1177             jQuery("#theImage").width("width", info_theImageBox.width + "px");
1178             jQuery("#theImageAndTitle").css("position", "relative");
1179             jQuery("#theImageAndTitle").css({ marginTop: "0px",
1180               paddingTop: (p1.top) + "px"
1181             });
1182             t1 = info_theImageBox.top;
1183             l1 = info_theImageBox.left;
1184             // info_theImageBox = jQuery(Parent).infos();
1185
1186           } else {
1187
1188             t1 = info_frame.top;
1189             l1 = info_frame.left;
1190             info_theImageBox = jQuery(Parent).infos(); //theImage
1191           }
1192
1193           info_theImageBox.margin.margin = info_frame.margin.margin;
1194           info_theImageBox.top = t1;
1195           info_theImageBox.left = l1;
1196           //  info_theImageBox.position = "absolute";
1197
1198           Window_Affichage = info_theImageBox;
1199           if (DEBUG_autosize == "true") {
1200             //   jQuery(Cadre).css("border", "solid green");
1201
1202             jQuery("#Debug5").css({ background: "red",
1203               position: "absolute",
1204               border: "green solid 2px",
1205               textAlign: align_auto,
1206               margin: "auto",
1207               top: Window_Affichage.top + "px",
1208               left: Window_Affichage.left + "px",
1209               width: Window_Affichage.width + "px",
1210               height: Window_Affichage.height + "px"
1211             }); //red
1212             jQuery("#Debug4").css({ top: info_frame.bottom - info_description.height + "px" }); //green
1213           }
1214
1215           Wait_Affichage();
1216
1217           return true;
1218
1219
1220
1221
1222
1223           //_____________________________________________________
1224         } // Resize();
1225
1226
1227         //======================================================================
1228
1229
1230       });            // fin extend
1231
1232
1233
1234     } // function
1235);
1236
1237
1238/*
1239* recherche la plus grande image (hauteur ou largeur)
1240*/
1241function Get_Img_Maxi(myobj) {
1242    var w00 = 0;
1243    var myImg = null;
1244    img = jQuery(myobj);
1245
1246    img = jQuery('img[alt]');
1247
1248    jQuery(myobj).each(function (i) {
1249        w0 = img_reelle.width;
1250        h0 = img_reelle.height;
1251        if (h0 > w0) w0 = h0;
1252        if (w0 > w00) {
1253            if (!this.src.match(RegExp(".png", "g")))
1254                if (!this.src.match(RegExp(thumbnail, "g"))) {
1255                    myImg = this;
1256                    w00 = w0;
1257                }
1258
1259        }
1260    });
1261    return myImg;
1262}
1263
1264//============================================================
1265/*
1266*
1267*/
1268
1269function Info_entete(Parent) {
1270
1271    info_imageToolBar = jQuery("#imageToolBar").infos();
1272    if (typeof (marge_top) != "undefined") return info_imageToolBar;
1273
1274    if (info_imageToolBar.position == "absolute") {
1275        jQuery("#imageToolBar").css("position", "relative");
1276        jQuery("#imageToolBar").css("top", 0 + "px");
1277    }
1278    optiontop = 0;
1279
1280
1281    info_imageInfoBar = jQuery("#imageInfoBar").infos();
1282
1283    jQuery("#" + "theImgContainer").css("marginTop", "0px");
1284    info_theImage = jQuery(Parent).infos();
1285    info_thePicturePage = jQuery("#thePicturePage").infos();
1286
1287
1288    if (theme.match(RegExp("stripped", "gi"))) {
1289
1290        info_theImageAndTitle = jQuery("#theImageAndTitle").infos();
1291        info_theImageBox = jQuery("#theImageBox").infos();
1292
1293        optiontop = (marges_llgbo / 2) + info_theImageAndTitle.margin.top;
1294
1295    }
1296
1297    if (info_theImage.position == "relative") {
1298        //--- passage relative ==> static ===/
1299        jQuery(Parent).css("position", "static");
1300        info_theImage = jQuery(Parent).infos();
1301
1302    } else {
1303
1304    }
1305    if (info_theImage.position == "absolute") {
1306        //--- passage absolute ==> static ===/
1307        jQuery(Parent).css("position", "static");
1308        info_theImage = jQuery(Parent).infos();
1309
1310    }
1311
1312    marge_top = Math.ceil(Info_the_page.top +
1313                                     Info_the_page.borderwidth.top +
1314                                     info_theImage.borderwidth.top +
1315                                     info_thePicturePage.margin.top
1316                                     );
1317
1318    img_top = Math.ceil(info_theImage.top +
1319                        info_theImage.borderwidth.top +
1320                        info_thePicturePage.margin.top + optiontop);
1321    result = info_imageToolBar;
1322   // result.width = "20%";
1323   // result.left = "40%";
1324    result.marge_top = marge_top;
1325    result.img_top = img_top;
1326    //=== Afficher le titre de l'image sur le cadre ===
1327    llgboh2 = jQuery("#gboh2").infos();
1328    result.img_top += llgboh2.height;
1329
1330    return result;
1331
1332}
1333
1334/* Récupère les informations sur la description.
1335*
1336*/
1337
1338//====================================================
1339function Info_Description_f(Parent) {
1340
1341
1342    jQuery(Parent).css({ display: "block" });
1343    //====== détection du type d'images ======
1344    if (jQuery("#charlie").length > 0) {
1345        Type_Img = "charlie";
1346
1347    } else if (jQuery("#pamoorama").length) {
1348        Type_Img = "pamoorama";
1349    } else if (jQuery(Parent + " embed").length > 0) {
1350        Type_Img = "embed";
1351    } else if (jQuery("#map").length) {
1352        Type_Img = "map";
1353
1354    } else if (jQuery("#Panorama").length) {
1355        Type_Img = "panorama";
1356    } else if (jQuery(Parent).find("img").length > 0) {
1357        Type_Img = "img";
1358    } else if (jQuery(Parent + "Box").find("img").length > 0) {
1359        Type_Img = "img";
1360        Parent = Parent + "Box";
1361    } else if (jQuery("img").length > 0) {
1362        Type_Img = "img_autre";
1363        return;
1364    } else {
1365        return;
1366    }
1367    // jQuery(Parent + " p:not(:contains(' ')) ").remove();
1368    // jQuery(Parent + " p:(:contains('')) ").remove();
1369    llgboframe = jQuery("#gbo").infos();
1370    marges_llgbo = 0;
1371
1372    if (llgboframe.height > 0) {
1373        ll2 = jQuery("#gbo div:last").infos();
1374        ll1 = jQuery("#gbo div:first").infos();
1375        ll2 ="" ;
1376        jQuery("#gbo div").each(function (i) {
1377
1378         if (  this.id=="") return ;
1379ll2=this ;
1380        });
1381       ll2 = jQuery(ll2).infos();
1382        ll1 = ll1.width;
1383        ll2 = ll2.width - ll2.borderwidth.left - ll2.borderwidth.right;
1384        marges_llgbo = (ll1 - ll2);
1385
1386    }
1387
1388    Bandeau_t = Info_entete(Parent)
1389    Bandeau = Bandeau_t.img_top;
1390
1391    info_theImgContainer = jQuery("#" + "theImgContainer").infos();
1392    info_description = jQuery("#" + "description").infos();
1393    //=============================================================================
1394    //   jQuery(Parent + " p").css({ padding: "0px", margin: "0px "    });
1395    if (theme.match(RegExp("simple", "gi"))) {
1396        jQuery(Parent).css({ padding: "0px",
1397            marginLeft: "0px",
1398            marginRight: "auto",
1399            marginTop: "0px",
1400            marginBottom: "0px"
1401
1402        });
1403    }
1404
1405
1406    if (theme.match(RegExp("luciano", "g"))) {
1407        jQuery("#imageContainer").css({ height: "auto" });
1408        theImg = jQuery(Parent + " #theImg img");
1409        info_img = jQuery(theImg).infos();
1410
1411
1412    } else if (Type_Img == "map") {
1413
1414        info_map = jQuery("#mapPicture").infos();
1415        marge_left = info_map.width;
1416
1417        jQuery("#map").css({ left: marge_left + "px", padding: "0px",
1418            marginLeft: "0px",
1419            marginRight: "4px",
1420            marginTop: "0px",
1421            marginBottom: "0px",
1422            position: "relative"
1423        });
1424
1425        theImg = jQuery("#map");
1426        info_img = jQuery(theImg).infos();
1427
1428
1429      } else if (jQuery("#charlie").length > 0) {
1430   
1431     if (jQuery("object").attr("type") == 'application/x-shockwave-flash') {
1432          jQuery("#charlie").css({
1433            paddingTop: "0px",
1434            marginTop: "0px",
1435            paddingBottom: "30px",
1436            marginBottom: "0px"
1437          });
1438        } else {
1439          jQuery("#charlie").css({
1440            paddingTop: "0px",
1441            marginTop: "0px",
1442            paddingBottom: "10px",
1443            marginBottom: "0px"
1444          });
1445        }
1446        theImg = jQuery("#charlie");
1447        info_img = jQuery(theImg).infos();
1448 
1449    } else if (jQuery(Parent + " embed").length > 0) {
1450
1451        theImg = jQuery(Parent + " embed");
1452        info_img = jQuery(theImg).infos();
1453
1454
1455
1456    } else if (Type_Img == "pamoorama") {
1457        if (!nopano) {
1458            Wait_pamoorama();
1459            return info_description;
1460        }
1461        theImg = jQuery("#pamoorama");
1462        info_img = jQuery(theImg).infos();
1463        info_footer = jQuery("#pamoorama_footer").infos();
1464        info_img.height = parseInt(img_reelle.height) + parseInt(info_footer.height);
1465
1466    } else {
1467        theImg = jQuery(Parent + " img[alt]");
1468
1469        //theImg = Get_Img_Maxi(theImg);
1470        //theMainImage
1471     
1472        if (!theImg)
1473            theImg = jQuery(Parent);   // sans img ??
1474        if (theImg.length > 1)
1475          {theImg = theImg[0];
1476
1477          }
1478
1479        //theImg = Get_Img_Maxi(theImg);  //1.6.2
1480        //if (!theImg) theImg = jQuery(Parent);   // 1.6.2sans img ??
1481        info_img = jQuery(theImg).infos();
1482    }
1483    //=====================================================================================
1484
1485    switch (info_img.position) {
1486        case "relative":
1487            break;
1488        case "static":
1489            break;
1490        case "absolute":
1491            break;
1492        case "":
1493            break;
1494        default:
1495            break;
1496    }
1497
1498    info_description.marge = {
1499        bottom: info_img.padding.bottom + info_img.margin.bottom + info_img.borderwidth.bottom,
1500        top: info_img.padding.top + info_img.borderwidth.top + info_img.margin.top
1501    }
1502
1503    if (llgboframe.height > 0) info_img = llgboframe; // format de l'image+largeur du cadre
1504
1505    if (theme.match(RegExp("luciano", "g"))) {
1506
1507        info_theImgContainer = jQuery("#imageContainer").infos();
1508        info_description.bottom = jQuery("#imageInfo").infos().top;
1509        info_description.top = info_theImgContainer.bottom;
1510        Info_slidshowToolBar = jQuery("#slidshowToolBar").infos();
1511
1512        if (Info_slidshowToolBar.height > 0) {
1513            correction = (Info_slidshowToolBar.height);
1514            info_description.top = info_img.bottom;
1515            info_description.bottom = jQuery("#copyright").infos().top;
1516        }
1517
1518        //=========================================================
1519    } else if (theme.match(RegExp("stripped", "gi"))) {
1520        //options.imageAutosize
1521        //options.imageMargin
1522        if (options.imageAutosizeTitle == false) {
1523            info_description.top =   info_theImageBox.bottom;
1524
1525            info_description.bottom =info_HeaderBar.margin.top+ info_description.top +
1526                                    info_description.borderwidth.top +
1527                                    info_description.borderwidth.bottom +
1528                                      options.imageAutosizeMargin*2 +
1529                                    (marges_llgbo / 2)+4;
1530
1531        } else {
1532
1533
1534            info_description.top = info_theImageBox.bottom +
1535                        jQuery("#content").infos().top +
1536                        options.imageAutosizeMargin * 2  +
1537                        (marges_llgbo / 2)
1538                                ;
1539            info_description.bottom = jQuery("#tabZone").infos().top +
1540                        info_theImageAndTitle.margin.top;
1541           if (msie == true) info_description.bottom -= 4;
1542        };
1543        check_desc_v = true;
1544
1545      } else {
1546        if (theme.match(RegExp("sobre", "gi"))) {
1547          info_description.marge.top = -2;
1548        }
1549        info_description.bottom = info_theImage.bottom;
1550        info_description.top = info_img.height + info_theImage.top;
1551        // info_description.bottom -= info_img.top;
1552    }
1553    //
1554
1555    info_description.height =   info_description.bottom - info_description.top;
1556
1557    if (check_desc_v == false) {
1558        info_description.height = 0;
1559    }
1560
1561    Debug_pos();
1562
1563    //cl_visible=false ;
1564    return info_description;
1565}
1566
1567//====================================================
1568function Debug_info(index, infos, nom) {
1569
1570    if (infos.height > 0) {
1571
1572        message = browser.browser + " -- > Info : " + nom + " " + infos.id + "\n" +
1573                 "Info nodeName: " + infos.nodeName + "\n" +
1574                 "Info width: " + infos.width + "\n" +
1575                 "Info height: " + infos.height + "\n" +
1576                 "Info top: " + infos.top + "\n" +
1577                 "Info left: " + infos.left + "\n" +
1578                 "Info position: " + infos.position + "\n";
1579
1580        myDebug = { id: "Debug" + index, texte: message,
1581            css: {
1582                color: "black",
1583                opacity: "0.5",
1584                position: "absolute",
1585                height: infos.height || 100 + "px",
1586                width: infos.width || 300 + "px",
1587                left: infos.left || 0 + "px",
1588                border: "solid 1px green",
1589                top: infos.top + "px"
1590
1591            }
1592        }
1593        return myDebug;
1594    } else {
1595        return null;
1596    }
1597
1598
1599}
1600//====================================================
1601function Debug_pos() {
1602    if (DEBUG_autosize == "true") {
1603
1604        jQuery("[id ^='Debug']").show();
1605        /*
1606        Debug2  background-color:yellow
1607        Debug3 background-color:blue
1608        Debug4 background-color:green
1609        Debug5 background-color:red
1610
1611        */
1612
1613        affiche_debug({
1614            Debug1: Debug_info(1, Bandeau_t, "Bandeau_t"),
1615            Debug4: Debug_info(4, info_description, "info_description"),
1616            Debug5: Debug_info(5, info_img, "info_img")
1617        });
1618    }
1619}
1620
1621function affiche_debug(aff_infos) {
1622    jQuery(jQuery("[id ^='Debug']")).each(function (i) {
1623        if (aff_infos[this.id]) {
1624            if (aff_infos[this.id].css) {
1625                jQuery("#" + this.id).css(aff_infos[this.id].css);
1626                jQuery("#" + this.id).text(aff_infos[this.id].texte);
1627            }
1628        }
1629    });
1630    return;
1631
1632}
1633
1634
1635
1636
1637jQuery(function () {
1638  //'gallyInterfaceReady'
1639
1640    jQuery('#pamoorama').live('ON', function (e) {
1641        jQuery(jQuery('.debug').get(1)).trigger('ON');
1642        Bandeau_bas = Info_Description_f(Parent);
1643        Bandeau = Bandeau_bas.top;
1644        old_window = { width: 0, height: 0 };
1645        Wait_Affichage();
1646    });
1647
1648    jQuery(Parent).live('ON', function (e) {
1649        jQuery(jQuery('.debug').get(1)).trigger('ON');
1650        Wait_Affichage();
1651    });
1652
1653    // Custom Event, ON to turn on a debug.
1654    jQuery('.debug').live('ON', function (e) {
1655
1656        jQuery('.debug').trigger('OFF');
1657        jQuery(this).addClass('debugOn');
1658    });
1659
1660    // On Click = debugs On
1661    jQuery('.debug').live('click', function (e) {
1662
1663        jQuery(this).trigger('ON');
1664    });
1665
1666    // Custom Event, Turn off a debug
1667    jQuery('.debug').live('OFF', function (e) {
1668
1669        jQuery(this).removeClass('debugOn');
1670    });
1671
1672    // on Double Click, remove the debug from the DOM
1673    jQuery('.debug').live('dblclick', function () {
1674
1675        jQuery(this).fadeOut(function () { $(this).remove() });
1676    });
1677
1678    // Add another debug to the DOM
1679    jQuery('#adddebugs').click(function () {
1680        jQuery('<div></div>')
1681            .addClass('debug')
1682            .appendTo('#debugsContainer');
1683    });
1684     
1685    // Add 10 testing debugs to start with
1686      jQuery(window).load(function () { 
1687            DEBUG_autosize = (typeof DEBUG_autosize != "undefined") ? DEBUG_autosize : "false";
1688        if (DEBUG_autosize == "true") {
1689            for (var i = 0; i < 10; i++) {
1690                jQuery('#adddebugs').click();
1691            }
1692            jQuery(jQuery('.debug').get(8)).click();
1693
1694         
1695
1696        }
1697    }); //on load
1698});
Note: See TracBrowser for help on using the repository browser.