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

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

[Autosize][beta] Adjust height with theme stripped
.


File size: 56.8 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);
429                         marge_right = (info_imageInfoBar.margin.left + info_imageInfoBar.margin.right);
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                     } else if (info_ToolBar.width > 0)
439                         marge = (info_the_page.width - info_ToolBar.width) / 2;
440
441                     marge_right = marge;
442                     marge_left = marge;
443                     winwidth = info_the_page.width;
444                 }
445
446
447
448                 marge_right += Zone_Affichage.borderwidth.right;
449                 marge_left += Zone_Affichage.borderwidth.left;
450                 winwidth -= (marge_right + marge_left);
451                 //---------------------------------------------
452                 jQuery(Parent).width(winwidth);
453                 jQuery(Parent).css({ height: "auto" });
454
455
456                 //  jQuery(Parent).height(Zone_Affichage.height);
457                 //---------------------------------------------
458
459                 if (Type_Img == "pamoorama") {
460
461                     mypanorama = window.myPamoorama;
462                     //============================================================
463                     if (typeof (mypanorama) == "undefined") return false;
464                     var myPamoorama = mypanorama;
465                     if (typeof (myPamoorama.skipInit) == "undefined") return false;
466                     //
467
468                     if (myPamoorama.skipInit == false) {
469
470                         return false;
471                     }
472
473                     var info_pamoorama = jQuery("#pamoorama").infos();
474                     var info_pamoorama_outter = jQuery("#pamoorama_outter").infos();
475                     var info_pamoorama_inner = jQuery("#pamoorama_inner").infos();
476                     var info_pamoorama_footer = jQuery("#pamoorama_footer").infos();
477                     var info_pamoorama_frame = jQuery("#pamoorama_frame").infos();
478                     TheImg = jQuery("#pamoorama");
479                     obj = TheImg.get(0);
480
481                 } else {
482
483
484
485
486                 }
487                 //=================================================================
488
489
490                 switch (Type_Img) {
491                     case "map":
492                         img_reelle.height = info_img.height;
493                         info_map = jQuery("#mapPicture").infos();
494                         jQuery("#map").css("left", info_map.width + "px");
495                         Bandeau_bas.height = 10;
496
497                         if (theme.match(RegExp("simple", "g"))) {
498                             img_reelle.width = winwidth; //- info_map.width -marge_right;
499                         } else {
500                             img_reelle.width = winwidth - info_map.width - marge_right;
501                         }
502
503
504                         info_the_page = jQuery("#the_page").infos();
505                         winwidth = img_reelle.width;
506
507                         ;
508
509                         break
510
511
512                     case "panorama":
513                         // return;
514
515
516                         TheImg = jQuery().Get_Img_Maxi("#Panorama img");
517                         info_theImage = jQuery(TheImg).infos();
518                         info_the_page = jQuery("#the_page").infos();
519
520                         break
521                     case "img":
522
523                         if (!TheImg) return true;
524                         if (theme.match(RegExp("luciano", "g"))) {
525                             TheImg = jQuery("#the_page #theImg");
526                         }
527                         info_theImage = jQuery(TheImg).infos();
528                         info_the_page = jQuery("#the_page").infos();
529
530
531                         break
532                     case "img_autre":
533                         if (!TheImg) {
534                             if (DEBUG == "true") alert("TheImg=null");
535                             return true;
536
537                         }
538                         info_theImage = jQuery(TheImg).infos();
539                         info_the_page = jQuery("#the_page").infos();
540
541
542                         break
543                     case "embed":
544                         //
545
546                         info_theImage = info_img;
547                         info_the_page = jQuery("#the_page").infos();
548
549                         if (rapport < 0) {
550                             img_height = info_img.height;
551                             img_width = info_img.width;
552
553                             img_reelle.height = img_height;
554                             img_reelle.width = img_width;
555
556                         }
557
558                         break
559                     case "charlie":
560
561
562                         info_theImage = info_img;
563                         info_the_page = jQuery("#the_page").infos();
564                         if (rapport < 0) {
565                             img_height = parseInt(info_img.height);
566                             img_width = parseInt(info_img.width);
567
568                             img_reelle.height = parseInt(info_img.height);
569                             img_reelle.width = parseInt(info_img.width);
570                         }
571
572                         break
573                     case "pamoorama":
574
575                         img_reelle = { height: img_height, width: img_width };
576
577                         //=========================================================
578                         img_reelle.height = img_height;
579                         img_reelle.width = Zone_Affichage.width;
580
581
582                         TheImg = myPamoorama.image;
583                         info_theImage = jQuery("#pamoorama").infos();
584                         info_theImage.height = img_reelle.height;
585
586
587                         info_the_page = jQuery("#the_page").infos();
588
589                         break
590
591
592                 }
593
594                 //=============== Vérification taille minimale  autorizée ======================
595                 var miniWidth = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("min-width"), mini_width);
596                 var miniHeight = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("min-height"), mini_height);
597
598                 var miniWidth2 = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("min-width"), mini_width2);
599                 var miniHeight2 = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("min-height"), mini_height2);
600
601                 var maxWidth = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("max-width"), winwidth, "0");
602                 maxHeight = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("max-height"), winheight, "0");
603
604
605                 mini_width = parseInt(miniWidth);
606                 mini_height = parseInt(miniHeight);
607
608                 img_reelle.width = parseInt(img_reelle.width);
609
610                 if (img_reelle.width < mini_width) return true;
611
612                 img_reelle.height = parseInt(img_reelle.height);
613                 if (img_reelle.height < parseInt(mini_height)) return true;
614                 //==================================================================================   
615                 if (rapport < 0) {
616
617                     img_init.height = parseInt(img_height);
618                     img_init.width = parseInt(img_width);
619
620                     rapport = img_width / img_height;
621
622                     if (Type_Img != "map")
623                         rapport = (img_init.width / img_init.height);
624                     else
625                         rapport = 0;
626
627                 }
628
629
630                 //=============== Zone d'affichage ============================
631
632                 borderW = Zone_Affichage.borderwidth.left;
633                 borderW += Zone_Affichage.borderwidth.right;
634
635
636                 Zone_Affichage.width = winwidth - borderW;
637
638
639
640                 var Licence = jQuery(".licencetag");
641                 info_Licence = jQuery(".licencetag").infos();
642
643                 jQuery(Parent + " #theImg IMG").css("marginTop", "0px")
644                 //========== Correction en fonction du thème =============================
645                 var correction = 0;
646                 if (theme.match(RegExp("sobre", "g"))) {
647
648                     //   correction = -info_Licence.padding.top;
649                     if (Type_Img == 'img') {
650                         if (msie == true) correction = 0;
651                         else correction = 0;
652                         correction = 10;
653                     }
654
655                 } else if (theme.match(RegExp("Pure", "g"))) {
656                     correction += 0; //??
657                 } else if (theme.match(RegExp("luciano", "g"))) {
658                     correction = 0; //??
659
660                 } else if (theme.match(RegExp("simple", "g"))) {
661                     correction += 0; //??
662                 } else if (theme.match(RegExp("gally", "g"))) {
663                     correction += 0; //??
664
665                 }
666
667                 //====================================================
668                 if (options.imageAutosizeMargin > 0) Marge_Basse = options.imageAutosizeMargin;
669                 else Marge_Basse = parseInt(marge_basse || 0); // hors bandeau
670                 //==========================================================================
671                 h = 0;
672
673                 h = (Zone_Affichage.padding.bottom + Zone_Affichage.padding.top + Zone_Affichage.margin.top + Zone_Affichage.margin.bottom);
674                 Bandeau = Bandeau_t.img_top;
675                 Zone_Affichage.height = winheight - Bandeau - Marge_Basse - correction - h;
676                 //=========================================================================
677                 if (Zone_Affichage.height < mini_height2)
678                     Zone_Affichage.height = mini_height2;
679                 if (Zone_Affichage.width < mini_width2)
680                     Zone_Affichage.width = mini_width2;
681                 //=========================================================================
682                 if (typeof (Bandeau_bas) != "undefined") {
683                     Zone_Affichage.height -= (Bandeau_bas.height + Bandeau_bas.marge.top + Bandeau_bas.marge.bottom);
684
685
686                 } else {
687
688                 }
689
690                 var Image_height = Zone_Affichage.height;
691
692                 //=============================================================
693                 var height_user = eval(user_status + "_height");
694                 var reg1 = new RegExp("%", "g");
695                 if (height_user.match(reg1))
696                     Image_height = Image_height * parseInt(height_user) / 100;
697                 else
698                     Image_height = parseInt(height_user);
699
700                 echelle_max = parseFloat(echelle_max, '3');
701                 var echelle = parseFloat(Image_height / img_reelle.height, 3);
702
703                 if (echelle > echelle_max) { echelle = echelle_max; }
704                 Image_height = parseInt(img_reelle.height * echelle);
705                 //============================================================
706
707                 var Image_width;
708                 if (rapport > 0)
709                     Image_width = parseInt(Image_height * rapport);
710                 else if (Type_Img == "map") {
711                     Image_width = Zone_Affichage.width - marge_left - marge_right;
712                 } else {
713                     Image_width = Zone_Affichage.width;
714                 }
715
716                 //===============================================================
717                 align_auto = "center";
718                 if (jQuery("#theImg").css("textAlign"))
719                     align_auto = jQuery("#theImg").css("textAlign");
720                 var widthmin = winwidth;
721
722                 if (check_auto_w == 'checked="checked"') {
723                     // if (Type_Img != "pamoorama" && Type_Img != "panorama" ) {
724                     //==== largeur à atteindre ===
725                     var width_user = eval(user_status + "_width");
726                     // Largeur maximale en fonction du statut
727                     if (width_user.match(reg1))
728                     // pourcentage
729                         widthmin = widthmin * parseInt(width_user) / 100;
730                     else
731                         widthmin = parseInt(width_user);
732
733                     var marges = 0;
734
735                     if (typeof (info_img) != "undefined") {
736                         widthmin -= info_img.borderwidth.left || 0;
737                         widthmin -= info_img.borderwidth.right || 0;
738                     }
739                     widthmin -= marges;
740                     widthmin -= (Bandeau_t.borderwidth.left + Bandeau_t.borderwidth.left);
741                     Image_width -= (Bandeau_t.borderwidth.left + Bandeau_t.borderwidth.left);
742                     if (Image_width > widthmin) {
743                         //   Image_width largeur à atteindre
744                         //  Calcul du rapport d'agrandissement
745                         var echelle_w = parseFloat((widthmin) / img_reelle.width, 3);
746                         if (echelle_w > echelle_max) { echelle_w = echelle_max; }
747                         Image_width = parseInt(img_reelle.width * echelle_w);
748                         if (rapport > 0)
749                             Image_height = parseInt(Image_width / rapport);
750                     }
751
752
753
754                 }
755
756
757                 // }
758                 //===================================================
759
760                 img_finale.height = Image_height;
761                 img_finale.width = Image_width;
762                 if (theme.match(RegExp("stripped", "gi"))) {
763                     img_finale.width -= (llgboframe.top * 2);
764                     if (rapport > 0) img_finale.height = (img_finale.width / rapport);
765                     else img_finale.height -= (llgboframe.top * 2);
766                 }
767                 zoom = echelle;
768                 if (llgboframe.height > 0) {
769                     //=============LLGBO2 ===========================
770                     t1 = llgboframe;
771                     if (!TheImg.src) {
772                         TheImg = jQuery(TheImg).find("img").get(0)
773                         if (!TheImg.src) {
774                             TheImg = jQuery(Parent).find("div").get(0)
775                         }
776                     }
777                     if (TheImg.src) {
778
779
780                         wingbo = img_finale.width;
781                         heightgbo = img_finale.height;
782                         img_finale.width -= marges_llgbo;
783                         if (jQuery("#slideshow").infos().width > 0) {
784                             img_finale.height -= (marges_llgbo * 1.5);
785                         } else {
786                             img_finale.height -= marges_llgbo
787                         }
788
789
790                         if (wingbo > winwidth) {
791                             jQuery("#gbo").width(winwidth);
792                             jQuery("#gbo").height(winheight);
793                             jQuery("#gbo").css("width", winwidth + "px");
794                             jQuery("#gbo").css("height", winheight + "px");
795                         }
796                         else {
797                             jQuery("#gbo").width(wingbo);
798                             jQuery("#gbo").height(heightgbo);
799                             jQuery("#gbo").css("width", wingbo + "px");
800                             jQuery("#gbo").css("height", heightgbo + "px");
801                         }
802
803                         a0 = jQuery("area[rel!=up][rel!=prev][rel!=next]");
804                         a1 = jQuery("area[rel=prev]");
805                         a2 = jQuery("area[rel=next]");
806                         a3 = jQuery("area[rel=up]");
807                         nb_zone = 3;
808                         if (a1.length == 0) {
809                             nb_zone -= 1;
810                         }
811                         if (a2.length == 0) {
812                             nb_zone -= 1;
813                         }
814
815
816                         var Largeur_zone = (img_finale.width / nb_zone);
817                         var Hauteur_zone = (img_finale.height);
818                         var init_zone = 0;
819
820                         if (a1.length > 0) {
821                             coord = { x0: init_zone, y0: 0, x1: Largeur_zone, y1: Hauteur_zone };
822
823                             jQuery("area[rel=prev]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" });
824                             init_zone += Largeur_zone;
825                         }
826
827                         coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: img_finale.height };
828
829                         if (a0.length > 0) {
830                             jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1 / 2) + "'" });
831                             jQuery(a0).attr({ coords: "'" + coord.x0 + "," + (coord.y1 / 2) + "," + coord.x1 + "," + (coord.y1) + "'" });
832                         } else {
833                             jQuery("area[rel=up]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + (coord.y1) + "'" });
834                         }
835                         init_zone += Largeur_zone;
836
837                         if (a2.length > 0) {
838                             coord = { x0: init_zone, y0: 0, x1: init_zone + Largeur_zone, y1: img_finale.height };
839                             jQuery("area[rel=next]").attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" });
840                         }
841                     }
842                 }
843
844                 //================ Zone affichage =========================
845
846
847                 //  jQuery(Cadre).css("top", "0px");
848                 jQuery("#standard").css("top", 0 + "px");
849                 jQuery("#comments").css("top", 0 + "px");
850                 //========== Image Remise à l'échelle =======================
851
852                 img_finale.height = parseInt(img_finale.height);
853                 img_finale.width = parseInt(img_finale.width);
854                 //=========================================================================
855                 if (jQuery("#slideshow").infos().width > 0) {
856
857                     jQuery(Cadre).css({ marginLeft: "auto"
858                     });
859                 }
860                 else
861                     jQuery(Cadre).css({ marginLeft: marge_left + "px"
862                     });
863                 jQuery(Cadre).width(Zone_Affichage.width);
864                 //   jQuery(Cadre).height(Zone_Affichage.height);
865
866                 if (typeof (gmaps) != "undefined") {
867                     Gmap_ = gmaps.maps[0];
868                     if (Gmap_.sizeMode == 'A') {
869                         jQuery("#iGMapsIcon").css({ width: old_window.width * 0.8 + "px", height: old_window.height * 0.8 + "px" });
870
871                     }
872                 }
873                 //============= flv,mov,mpg  ok
874                 /* wmv nok
875                 * avi nok
876                 //===========================================
877                 */
878                 if (Type_Img == "charlie") {
879                     t1 = jQuery("#charlie").infos();
880
881                     /**/
882
883                     pdf = 0;
884                     jQuery("#charlie div").each(function (i) {
885
886
887                         p1 = jQuery(this).infos();
888                         pdf += p1.padding.right + p1.padding.left;
889                     });
890                     img_finale.width -= pdf;
891
892                     jQuery("#charlie").css({
893                         width: img_finale.width + pdf,
894                         height: img_finale.height,
895                         margin: "auto"
896                     });
897
898
899
900                     jQuery("#player").css("width", img_finale.width + "px");
901                     jQuery("#player").css("height", img_finale.height);
902
903                     jQuery("#embedplayer").css("width", img_finale.width);
904                     jQuery("#embedplayer").css("height", img_finale.height);
905
906
907                     jQuery("object").width(img_finale.width);
908                     jQuery("object").height(img_finale.height);
909
910
911                 } else if (Type_Img == "panorama") {
912
913                     // -----     jQuery(TheImg).panorama2(img_finale.height, img_finale.width);
914                     // jQuery(TheImg).height(img_finale.height);
915                     // jQuery(TheImg).width(img_finale.width);
916                     jQuery("#Panorama div").height(img_finale.height);
917                     //  class=simple_panorama
918
919                     jQuery(".panorama-viewport").css("left", "2px");
920                     jQuery(".panorama-viewport").css("width", "auto");
921
922
923                 } else if (Type_Img == "pamoorama") {
924                     info_theImage.height = Zone_Affichage.height;
925                     img_height = myPamoorama.imageHeight
926                     if (theme.match(RegExp("simple", "g"))) {
927                         //  marge_right = 2;
928                     }
929                     new_width = Zone_Affichage.width - marge_right - marge_left;
930                     new_width = Zone_Affichage.width - (info_theImage.borderwidth.right + info_theImage.borderwidth.left);
931
932
933
934                     Zone_Affichage.height += info_pamoorama_footer.height;
935                     zoom = info_theImage.height / img_height;
936                     myPamoorama.options.width = new_width * zoom;
937                     //  if(msie || safari) jQuery("#pamoorama_inner ").css({ zoom: zoom });
938                     //====================================================
939                     jQuery("#pamoorama").css({
940                         marginLeft: "auto",
941                         marginRight: "auto",
942                         //height: Zone_Affichage.height + "px", sinon déclenchement panorama sur la hauteur;
943                         width: new_width + "px"
944                     });
945                     jQuery("#pamoorama").width(new_width);
946
947                     //====================================================
948                     info_pamoorama = jQuery("#pamoorama").infos();
949                     img_finale.height = info_pamoorama.height - info_pamoorama_footer.height;
950                     img_finale.width = new_width;
951
952                     jQuery("#pamoorama_outter").width(new_width);
953
954
955                     // commenter sinon outter augmente à chaque resize
956                     //  jQuery("#pamoorama_outter").height(info_pamoorama.height - info_pamoorama_footer.height);
957
958
959
960                     jQuery("#pamoorama_outter").css({ width: new_width + "px" });
961                     jQuery("#pamoorama_footer").css({ width: new_width + "px" });
962                     //     
963                     //====================================================
964                     info_pamoorama = jQuery("#pamoorama").infos();
965                     info_pamoorama_outter = jQuery("#pamoorama_outter").infos();
966                     info_pamoorama_inner = jQuery("#pamoorama_inner").infos();
967                     info_pamoorama_footer = jQuery("#pamoorama_footer").infos();
968                     info_pamoorama_frame = jQuery("#pamoorama_frame").infos();
969
970                     info_frame = jQuery(myPamoorama.frame).infos();
971
972                     zoom = img_finale.height / img_height;
973
974
975                 } else if (TheImg.src) {
976                     //--- background ?? ---
977                     jQuery(TheImg).height(img_finale.height);
978                     jQuery(TheImg).width(img_finale.width);
979                     jQuery(TheImg).css({ height: img_finale.height + "px ",
980                         width: img_finale.width + "px "
981                     });
982
983
984                 } else {
985                     //===map ? ===
986                     jQuery(TheImg).height(img_finale.height);
987                     jQuery(TheImg).width(img_finale.width);
988                     jQuery(TheImg).css({ height: img_finale.height + "px ",
989                         width: img_finale.width + "px "
990                     });
991
992                 }
993
994                 jQuery("#navThumbPrev").css({ overflow: "hidden" });
995                 jQuery("#navThumbNext").css({ overflow: "hidden" });
996                 n = typeof inittoolbar;
997                 if (Type_Img == "map") {
998                     jQuery("#navThumbNext").css({ display: 'none' });
999                     jQuery("#navThumbPrev").css({ display: 'none' });
1000                 }
1001                 try {
1002                     if (theme.match(RegExp("gally", "gi"))) {
1003                         if (typeof inittoolbar == "function") {
1004                             if (typeof (currentTab) == "undefined") inittoolbar();
1005                             else initializeImageMode("resize");
1006                         }
1007                         //===========================================================================
1008
1009                         if (jQuery("#navThumbPrev").length > 0) {
1010                             jQuery("#navThumbPrev").css({ height: info_img.height + "px",
1011                                 overflow: "hidden"
1012                             });
1013
1014                         }
1015                         if (jQuery("#navThumbNext").length > 0) {
1016                             jQuery("#navThumbNext").css({ height: info_img.height + "px",
1017                                 overflow: "hidden"
1018                             });
1019
1020                         }
1021
1022
1023                         if (!theme.match(RegExp("lapis", "gi"))) {
1024                             if (typeof initializeImageMode == "function") {
1025                                 initializeImageMode("resize");
1026                             }
1027
1028                         }
1029
1030                     } else if (theme.match(RegExp("simple", "g"))) {
1031
1032                         jQuery("#imageToolBar").css({ position: "static" });
1033
1034                         info_imageInfoBar = jQuery("#imageInfoBar").infos();
1035                         if (info_imageInfoBar.bottom < info_img.bottom) {
1036                             //   jQuery("#imageInfoBar").height(info_img.bottom);
1037                         }
1038
1039                     } else {
1040
1041                         //    jQuery("#imageToolBar").css("position", "static");
1042                     }
1043                 } catch (e) {
1044
1045                 }
1046                 //  --- rglage de la hauteur de page en fonction du copyright-----------
1047                 if (typeof (pos) == "undefined") pos = jQuery("#copyright").infos();
1048                 if (pos != jQuery("#copyright").infos())
1049                     pos = jQuery("#copyright").infos();
1050                 if (theme.match(RegExp("stripped", "gi"))) {
1051                     var TitleBox = jQuery("#imageTitleContainer");
1052                     if (TitleBox.length != 0) TitleBox.css("width", img_finale.width + "px");
1053                 } else {
1054                     if (pos.top > 100)
1055                         jQuery("#the_page").height(pos.top);
1056
1057                 }
1058
1059                 if (!theme.match(RegExp("luciano", "gi"))) {
1060                     jQuery("#linkNext").css({ height: "80px", width: "200px", overflow: "hidden" });
1061                     jQuery("#linkPrev").css({ height: "80px", width: "200px", overflow: "hidden" });
1062                     jQuery(".navThumb img").css({ height: "80px", width: "", overflow: "hidden" });
1063                 }
1064                 info_frame = jQuery(Cadre).infos();
1065                 if (theme.match(RegExp("stripped", "gi"))) {
1066                     pos = "absolute";
1067                     info_theImageBox = jQuery("#theImageAndTitle").infos();
1068                     t1 = info_theImageBox.top;
1069                     l1 = info_theImageBox.left;
1070                     // info_theImageBox = jQuery(Parent).infos();
1071
1072                 } else {
1073                     pos = "absolute";
1074                     t1 = info_frame.top;
1075                     l1 = info_frame.left;
1076                     info_theImageBox = jQuery(Parent).infos();
1077                 }
1078
1079                 info_theImageBox.margin.margin = info_frame.margin.margin;
1080                 info_theImageBox.top = t1;
1081                 info_theImageBox.left = l1;
1082                 info_theImageBox.pos = "absolute";
1083                 Window_Affichage = info_theImageBox;
1084                 if (DEBUG == "true") {
1085                     //   jQuery(Cadre).css("border", "solid green");
1086
1087                     jQuery("#Debug5").css({ background: "transparent",
1088                         position: pos,
1089                         border: "green solid 2px",
1090                         textAlign: align_auto,
1091                         margin: Window_Affichage.margin.margin,
1092                         top: Window_Affichage.top + "px",
1093                         left: Window_Affichage.left + "px",
1094                         width: Window_Affichage.width + "px",
1095                         height: Window_Affichage.height + "px"
1096                     }); //red
1097                     jQuery("#Debug4").css({ top: info_frame.bottom - info_description.height + "px" }); //green
1098                 }
1099
1100                 Wait_Affichage();
1101
1102                 return true;
1103
1104
1105
1106
1107
1108                 //_____________________________________________________
1109             } // Resize();
1110
1111
1112             //======================================================================
1113
1114
1115         });            // fin extend
1116
1117
1118
1119     } // function
1120);
1121
1122
1123/*
1124* recherche la plus grande image (hauteur ou largeur)
1125*/
1126function Get_Img_Maxi(myobj) {
1127    var w00 = 0;
1128    var myImg = null;
1129    jQuery(myobj).each(function (i) {
1130        w0 = img_reelle.width;
1131        h0 = img_reelle.height;
1132        if (h0 > w0) w0 = h0;
1133        if (w0 > w00) {
1134            if (!this.src.match(RegExp(".png", "g")))
1135                if (!this.src.match(RegExp(thumbnail, "g"))) {
1136                    myImg = this;
1137                    w00 = w0;
1138                }
1139
1140        }
1141    });
1142    return myImg;
1143}
1144
1145//============================================================
1146/*
1147*
1148*/
1149
1150function Info_entete(Parent) {
1151    if (typeof (marge_top) != "undefined") return result;
1152    info_imageToolBar = jQuery("#imageToolBar").infos();
1153    if (info_imageToolBar.position == "absolute") {
1154        jQuery("#imageToolBar").css("position", "relative");
1155        jQuery("#imageToolBar").css("top", 0 + "px");
1156    }
1157    optiontop = 0;
1158
1159    info_imageInfoBar = jQuery("#imageInfoBar").infos();
1160
1161    jQuery("#" + "theImgContainer").css("marginTop", "0px");
1162    info_theImage = jQuery(Parent).infos();
1163    info_thePicturePage = jQuery("#thePicturePage").infos();
1164
1165
1166    if (theme.match(RegExp("stripped", "gi"))) {
1167
1168        info_theImageAndTitle = jQuery("#theImageAndTitle").infos();
1169        info_theImageBox = jQuery("#theImageBox").infos();
1170
1171        optiontop = (marges_llgbo / 2) + info_theImageAndTitle.margin.top;
1172
1173    }
1174
1175    if (info_theImage.position == "relative") {
1176        //--- passage relative ==> static ===/
1177        jQuery(Parent).css("position", "static");
1178        info_theImage = jQuery(Parent).infos();
1179
1180    } else {
1181
1182    }
1183    if (info_theImage.position == "absolute") {
1184        //--- passage absolute ==> static ===/
1185        jQuery(Parent).css("position", "static");
1186        info_theImage = jQuery(Parent).infos();
1187
1188    }
1189
1190    marge_top = Math.ceil(Info_the_page.top +
1191                                     Info_the_page.borderwidth.top +
1192                                     info_theImage.borderwidth.top +
1193                                     info_thePicturePage.margin.top
1194                                     );
1195
1196    img_top = Math.ceil(info_theImage.top +
1197                        info_theImage.borderwidth.top +
1198                        info_thePicturePage.margin.top + optiontop);
1199    result = info_imageToolBar;
1200    result.width = "20%";
1201    result.left = "40%";
1202    result.marge_top = marge_top;
1203    result.img_top = img_top;
1204    //=== Afficher le titre de l'image sur le cadre ===
1205    llgboh2 = jQuery("#gboh2").infos();
1206    result.img_top += llgboh2.height;
1207    return result;
1208
1209}
1210
1211/* Récupère les informations sur la description.
1212*
1213*/
1214
1215//====================================================
1216function Info_Description_f(Parent) {
1217
1218
1219    jQuery(Parent).css({ display: "block" });
1220    //====== détection du type d'images ======
1221    if (jQuery("#charlie").length > 0) {
1222        Type_Img = "charlie";
1223    } else if (jQuery("#pamoorama").length) {
1224        Type_Img = "pamoorama";
1225    } else if (jQuery(Parent + " embed").length > 0) {
1226        Type_Img = "embed";
1227    } else if (jQuery("#map").length) {
1228        Type_Img = "map";
1229
1230    } else if (jQuery("#Panorama").length) {
1231        Type_Img = "panorama";
1232    } else if (jQuery(Parent).find("img").length > 0) {
1233        Type_Img = "img";
1234    } else if (jQuery(Parent + "Box").find("img").length > 0) {
1235        Type_Img = "img";
1236        Parent = Parent + "Box";
1237    } else if (jQuery("img").length > 0) {
1238        Type_Img = "img_autre";
1239        return;
1240    } else {
1241        return;
1242    }
1243    // jQuery(Parent + " p:not(:contains(' ')) ").remove();
1244    // jQuery(Parent + " p:(:contains('')) ").remove();
1245    llgboframe = jQuery("#gbo").infos();
1246    marges_llgbo = 0;
1247
1248    if (llgboframe.height > 0) {
1249
1250        ll1 = jQuery("#gbo div:first").infos();
1251        ll2 = jQuery("#gbo div:last").infos(); ;
1252        ll1 = ll1.width;
1253        ll2 = ll2.width - ll2.borderwidth.left - ll2.borderwidth.right;
1254        marges_llgbo = (ll1 - ll2);
1255
1256    }
1257
1258    Bandeau_t = Info_entete(Parent)
1259    Bandeau = Bandeau_t.img_top;
1260
1261    info_theImgContainer = jQuery("#" + "theImgContainer").infos();
1262    info_description = jQuery("#" + "description").infos();
1263    //=============================================================================         
1264    //   jQuery(Parent + " p").css({ padding: "0px", margin: "0px "    });
1265    if (theme.match(RegExp("simple", "gi"))) {
1266        jQuery(Parent).css({ padding: "0px",
1267            marginLeft: "0px",
1268            marginRight: "auto",
1269            marginTop: "0px",
1270            marginBottom: "0px"
1271
1272        });
1273    }
1274
1275
1276    if (theme.match(RegExp("luciano", "g"))) {
1277        jQuery("#imageContainer").css({ height: "auto" });
1278        TheImg = jQuery(Parent + " #theImg img");
1279        info_img = jQuery(TheImg).infos();
1280
1281
1282    } else if (Type_Img == "map") {
1283
1284        info_map = jQuery("#mapPicture").infos();
1285        marge_left = info_map.width;
1286
1287        jQuery("#map").css({ left: marge_left + "px", padding: "0px",
1288            marginLeft: "0px",
1289            marginRight: "4px",
1290            marginTop: "0px",
1291            marginBottom: "0px", position: "relative"
1292        });
1293
1294        TheImg = jQuery("#map");
1295        info_img = jQuery(TheImg).infos();
1296
1297
1298    } else if (jQuery("#charlie").length > 0) {
1299
1300        jQuery("#charlie").css({ padding: "0px"
1301
1302        });
1303        TheImg = jQuery("#charlie")
1304        info_img = jQuery(TheImg).infos();
1305
1306
1307
1308    } else if (jQuery(Parent + " embed").length > 0) {
1309
1310        TheImg = jQuery(Parent + " embed");
1311        info_img = jQuery(TheImg).infos();
1312
1313
1314
1315    } else if (Type_Img == "pamoorama") {
1316        if (!nopano) {
1317            Wait_pamoorama();
1318            return
1319        }
1320        TheImg = jQuery("#pamoorama");
1321        info_img = jQuery(TheImg).infos();
1322        info_footer = jQuery("#pamoorama_footer").infos();
1323        info_img.height = parseInt(img_reelle.height) + parseInt(info_footer.height);
1324
1325    } else {
1326        TheImg = jQuery(Parent + " img");
1327
1328        TheImg = Get_Img_Maxi(TheImg);
1329        if (!TheImg) TheImg = jQuery(Parent);   // sans img ??
1330        info_img = jQuery(TheImg).infos();
1331    }
1332    //=====================================================================================
1333
1334    switch (info_img.position) {
1335        case "relative":
1336            break;
1337        case "static":
1338            break;
1339        case "absolute":
1340            break;
1341        case "":
1342            break;
1343        default:
1344            break;
1345    }
1346
1347    info_description.marge = {
1348        bottom: info_img.padding.bottom + info_img.margin.bottom + info_img.borderwidth.bottom,
1349        top: info_img.padding.top + info_img.borderwidth.top + info_img.margin.top
1350    }
1351
1352
1353    if (llgboframe.height > 0) info_img = llgboframe; // format de l'image+largeur du cadre
1354
1355    if (theme.match(RegExp("luciano", "g"))) {
1356
1357        info_theImgContainer = jQuery("#imageContainer").infos();
1358        info_description.bottom = jQuery("#imageInfo").infos().top;
1359        info_description.top = info_theImgContainer.bottom;
1360        Info_slidshowToolBar = jQuery("#slidshowToolBar").infos();
1361
1362        if (Info_slidshowToolBar.height > 0) {
1363            correction = (Info_slidshowToolBar.height);
1364            info_description.top = info_img.bottom;
1365            info_description.bottom = jQuery("#copyright").infos().top;
1366        }
1367
1368        //=========================================================
1369    } else if (theme.match(RegExp("stripped", "gi"))) {
1370        //options.imageAutosize
1371        //options.imageMargin
1372        if (options.imageAutosizeTitle == false) {
1373            info_description.top =   info_theImageBox.bottom;
1374
1375            info_description.bottom =info_HeaderBar.margin.top+ info_description.top +
1376                                    info_description.borderwidth.top +
1377                                    info_description.borderwidth.bottom +
1378                                      options.imageAutosizeMargin*2 + 
1379                                    (marges_llgbo / 2)+4;
1380
1381        } else {
1382       
1383       
1384            info_description.top = info_theImageBox.bottom +
1385                        jQuery("#content").infos().top +
1386                        options.imageAutosizeMargin * 2  +
1387                        (marges_llgbo / 2)
1388                                ;
1389            info_description.bottom = jQuery("#tabZone").infos().top +
1390                        info_theImageAndTitle.margin.top;
1391           if (msie == true) info_description.bottom -= 4;
1392        };
1393        check_desc_v = true; 
1394
1395    } else {
1396        info_description.bottom = info_theImage.bottom;
1397        info_description.top = info_img.height + info_theImage.top;
1398        // info_description.bottom -= info_img.top;
1399    }
1400    // 
1401
1402    info_description.height = info_description.bottom - info_description.top;
1403
1404    if (check_desc_v == false) {
1405        info_description.height = 0;
1406    }
1407
1408    Debug_pos();
1409
1410    //cl_visible=false ;
1411    return info_description;
1412}
1413
1414//====================================================
1415function Debug_info(index, infos, nom) {
1416
1417    if (infos.height > 0) {
1418
1419        message = browser.browser + " -- > Info : " + nom + " " + infos.id + "\n" +
1420                 "Info nodeName: " + infos.nodeName + "\n" +
1421                 "Info width: " + infos.width + "\n" +
1422                 "Info height: " + infos.height + "\n" +
1423                 "Info top: " + infos.top + "\n" +
1424                 "Info left: " + infos.left + "\n" +
1425                 "Info position: " + infos.position + "\n";
1426
1427        myDebug = { id: "Debug" + index, texte: message,
1428            css: {
1429                color: "black",
1430                opacity: "0.5",
1431                position: "absolute",
1432                height: infos.height || 100 + "px",
1433                width: infos.width || 300 + "px",
1434                left: infos.left || 0 + "px",
1435                border: "solid 1px green",
1436                top: infos.top + "px"
1437
1438            }
1439        }
1440        return myDebug;
1441    } else {
1442        return null;
1443    }
1444
1445
1446}
1447//====================================================
1448function Debug_pos() {
1449    if (DEBUG == "true") {
1450
1451        jQuery("[id ^='Debug']").show();
1452        /*
1453        Debug2  background-color:yellow
1454        Debug3 background-color:blue
1455        Debug4 background-color:green
1456        Debug5 background-color:red
1457
1458        */
1459
1460        affiche_debug({
1461            Debug1: Debug_info(1, Bandeau_t, "Bandeau_t"),
1462            Debug4: Debug_info(4, info_description, "info_description"),
1463            Debug5: Debug_info(5, info_img, "info_img")
1464        });
1465    }
1466}
1467
1468function affiche_debug(aff_infos) {
1469    jQuery(jQuery("[id ^='Debug']")).each(function (i) {
1470        if (aff_infos[this.id]) {
1471            if (aff_infos[this.id].css) {
1472                jQuery("#" + this.id).css(aff_infos[this.id].css);
1473                jQuery("#" + this.id).text(aff_infos[this.id].texte);
1474            }
1475        }
1476    });
1477    return;
1478
1479}
1480
1481
1482jQuery(function () {
1483    jQuery('#pamoorama').live('ON', function (e) {
1484        jQuery(jQuery('.debug').get(1)).trigger('ON');
1485        Bandeau_bas = Info_Description_f(Parent);
1486        Bandeau = Bandeau_bas.top;
1487        old_window = { width: 0, height: 0 };
1488        Wait_Affichage();
1489    });
1490
1491    jQuery(Parent).live('ON', function (e) {
1492        jQuery(jQuery('.debug').get(1)).trigger('ON');
1493        Wait_Affichage();
1494    });
1495
1496    // Custom Event, ON to turn on a debug.
1497    jQuery('.debug').live('ON', function (e) {
1498
1499        jQuery('.debug').trigger('OFF');
1500        jQuery(this).addClass('debugOn');
1501    });
1502
1503    // On Click = debugs On
1504    jQuery('.debug').live('click', function (e) {
1505
1506        jQuery(this).trigger('ON');
1507    });
1508
1509    // Custom Event, Turn off a debug
1510    jQuery('.debug').live('OFF', function (e) {
1511
1512        jQuery(this).removeClass('debugOn');
1513    });
1514
1515    // on Double Click, remove the debug from the DOM
1516    jQuery('.debug').live('dblclick', function () {
1517
1518        jQuery(this).fadeOut(function () { $(this).remove() });
1519    });
1520
1521    // Add another debug to the DOM
1522    jQuery('#adddebugs').click(function () {
1523        jQuery('<div></div>')
1524            .addClass('debug')
1525            .appendTo('#debugsContainer');
1526    });
1527
1528    // Add 10 testing debugs to start with
1529    jQuery(window).load(function () {
1530        DEBUG = (typeof DEBUG != "undefined") ? DEBUG : "false";
1531        if (DEBUG == "true") {
1532            for (var i = 0; i < 10; i++) {
1533                jQuery('#adddebugs').click();
1534            }
1535            jQuery(jQuery('.debug').get(8)).click();
1536
1537        }
1538    }); //on load
1539}); 
Note: See TracBrowser for help on using the repository browser.