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

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

[extensions] autosize compatiblity with gmaps(Version 1.3.0a)

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