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

Last change on this file since 18823 was 18823, checked in by cljosse, 11 years ago

[extensions] Autosize fix compatibility with 2.4 (compatible gvideo)

File size: 73.8 KB
Line 
1// problème avec GMaps+diaporama:
2// corriger   gmaps_pip.class.inc.php ajouter ligne 90 if ( !isset($_GET['slideshow']))
3//============================================================== 
4  jQuery.Affiche_script = { version: '2.0.0' };
5  /********************************************
6  *  document ready
7  ********************************************/
8
9
10  jQuery(document).ready(function (jQuery) {
11    var Type_Img;
12    var theImg;
13    var Zone_image;
14
15    /******************************************
16    * test_theme("mont,pur") ...
17    ******************************************/
18
19    test_theme = function (param) {
20      if (!param) return
21      if (!options.theme) return;
22
23      regx = new RegExp(param, "gi");
24      return (options.theme.match(regx))
25
26    }
27    /******************************************
28    * Save_cookies
29    ******************************************/
30    Save_cookies = function (parametres) {
31      parametres.windowHeight = jQuery(window).height();
32      parametres.windowWidth = jQuery(window).width();
33      try {
34        if (parametres.pictureSelType) jQuery.cookie('picture_sel_type', parametres.pictureSelType, { path: COOKIE_PATH });
35        if (parametres.pictureDeriv) jQuery.cookie('picture_deriv', parametres.pictureDeriv, { path: COOKIE_PATH });
36        if (parametres.pictureMap) jQuery.cookie('picture_map', parametres.pictureMap, { path: COOKIE_PATH });
37        if (parametres.imgSrc) jQuery.cookie('img_src', parametres.imgSrc, { path: COOKIE_PATH });
38        if (parametres.theMainImageHeight) jQuery.cookie('theMainImageHeight', parametres.theMainImageHeight, { path: COOKIE_PATH });
39        if (parametres.theMainImageWidth) jQuery.cookie('theMainImageWidth', parametres.theMainImageWidth, { path: COOKIE_PATH });
40        if (parametres.theImageHeight) jQuery.cookie('theImageHeight', parametres.theImageHeight, { path: COOKIE_PATH });
41        if (parametres.theImageWidth) jQuery.cookie('theImageWidth', parametres.theImageWidth, { path: COOKIE_PATH });
42        if (parametres.windowHeight) jQuery.cookie('windowHeight', parametres.windowHeight, { path: COOKIE_PATH });
43        if (parametres.windowWidth) jQuery.cookie('windowWidth', parametres.windowWidth, { path: COOKIE_PATH });
44        if (parametres.theImageTop) jQuery.cookie('theImageTop', parametres.theImageTop, { path: COOKIE_PATH });
45        if (parametres.theImageLeft) jQuery.cookie('theImageLeft', parametres.theImageLeft, { path: COOKIE_PATH });
46        if (parametres.theImageRight) jQuery.cookie('theImageRight', parametres.theImageRight, { path: COOKIE_PATH });
47        if (parametres.theImageBottom) jQuery.cookie('theImageBottom', parametres.theImageBottom, { path: COOKIE_PATH });
48        if (parametres.theImageMargeZone) {
49          jQuery.cookie('theImageMargeWidth', parametres.theImageMargeZone.width, { path: COOKIE_PATH });
50          jQuery.cookie('theImageMargeHeight', parametres.theImageMargeZone.height, { path: COOKIE_PATH });
51        }
52      } catch (e) {
53
54      }
55
56
57    }
58    //____________________ Save_cookies _____________________________
59    /************************************************
60    *
61    *************************************************/
62    Get_cookies = function () {
63      parametres = {
64        pictureDeriv: jQuery.cookie('picture_deriv'),
65        pictureMap: jQuery.cookie('picture_map'),
66        imgSrc: jQuery.cookie('img_src'),
67        pictureSelType: jQuery.cookie('picture_sel_type'),
68        theMainImageHeight: jQuery.cookie('theMainImageHeight'),
69        theMainImageWidth: jQuery.cookie('theMainImageWidth'),
70
71
72        windowHeight: jQuery.cookie('windowHeight'),
73        windowWidth: jQuery.cookie('windowWidth'),
74
75        theImageHeight: jQuery.cookie('theImageHeight'),
76        theImageWidth: jQuery.cookie('theImageWidth'),
77        theImageTop: jQuery.cookie('theImageTop'),
78        theImageLeft: jQuery.cookie('theImageLeft'),
79        theImageBottom: jQuery.cookie('theImageBottom'),
80        theImageRight: jQuery.cookie('theImageRight'),
81        theImageMargeZone: { width: jQuery.cookie('theImageMargeWidth'),
82          height: jQuery.cookie('theImageMargeHeight')
83        }
84
85
86      }
87      return parametres;
88    }
89    //____________________ Get_cookies _____________________________
90
91
92
93    /*************************************************
94    * Recupère le Type d'mage
95    *************************************************/
96    Get_type_img = function (e) {
97      //====== détection du type d'images ======
98
99      if (jQuery("#charlie").length > 0) {
100        Type_Img = "charlie";
101      } else if (jQuery("#Panorama").length > 0) {
102        Type_Img = "panorama";
103
104      } else if (jQuery("#pamoorama").length > 0) {
105        Type_Img = "pamoorama";
106        options.valide = true;
107
108        infos_pamoorama = jQuery("#pamoorama").infos({ absolute: true });
109
110      } else if (jQuery("#map").length > 0 || jQuery("#mapPicture").length > 0) {
111        Type_Img = "map";
112      } else if (jQuery("#Panorama").length) {
113        Type_Img = "panorama";
114      } else if ((jQuery("#theImage" + " iframe").length + jQuery("#theImage" + " object").length + jQuery("#theImage" + " embed").length) > 0) {
115
116        if (jQuery("#theImage" + " object").length > 0) {
117
118          type_src = "object";
119
120        } else if (jQuery("#theImage" + " embed").length > 0) {
121
122          type_src = "embed";
123
124        } else {
125
126          type_src = "iframe";
127        }
128        nbf = jQuery("#theImage" + " " + type_src).length;
129        frm1 = jQuery("#theImage" + " " + type_src).get(0);
130        Type_Img = "iframe";
131
132        //'fb - xfbml - like - button
133
134        objs = jQuery("#theImage" + " div").get(0);
135        if (jQuery(objs).length > 0) {
136          id_0 = jQuery(objs).attr("id");
137          if (id_0 == "") {
138            jQuery(objs).attr("id", "charlie");
139          } else {
140            if (nbf > 1) {
141              jQuery(frm1).attr("id", "charlie");
142            } else {
143              Type_Img = "img";
144            }
145          }
146        } else {
147          jQuery(frm1).attr("id", "iframe");
148        }
149
150
151      } else if (jQuery("#theImage").find("img").length > 0) {
152        Type_Img = "img";
153      } else if (jQuery("#theImage" + "Box").find("img").length > 0) {
154        Type_Img = "img";
155        Parent = Parent + "Box";
156      } else if (jQuery("img").length > 0) {
157        Type_Img = "img_autre";
158        return;
159      } else {
160        return;
161      }
162    }
163    //____________________ Get_type_img _____________________________
164
165    //====================================
166    //  set_cl
167    //====================================
168    set_cl = function (Valid) {
169      if (typeof Valid == "undefined") Valid = options.pictureSelType.match(RegExp("Autosize", "gi")) || false;
170      if (typeof options.cl_visible == "undefined") return;
171      if (typeof src1 == "undefined") return;
172
173      if (options.cl_visible) src = src1;
174      else src = src2;
175
176      if (options.cl_visible) {
177        src_info = src3;
178        src_infos_1 = src3;
179      } else {
180        src_info = src4;
181        src_infos_1 = src5;
182      }
183
184      if (!Valid) {
185        Zone_image.image.height = Zone_image.image_init.height;
186        Zone_image.image.width = Zone_image.image_init.width;
187        src = src6;
188      }
189      if ((typeof Zone_image != "undefined") && typeof Zone_image.image != "undefined") {
190
191        Zone_image.zoom = (Zone_image.image.height / Zone_image.image_init.height);
192        zoom_cl = parseInt(100 * Zone_image.zoom) + "%"; ;
193
194        if (!Valid) {
195          if (options.pictureSelType == "SelMaxi")
196            zoom_cl = options.pictureSelType + " [" + options.pictureDeriv + "]";
197          else
198            zoom_cl = " [" + options.pictureDeriv + "]";
199
200        } else
201
202
203          jQuery('#bp_cla').attr('alt', src_info);
204        jQuery('#bp_cla').attr('title', src_info);
205        jQuery('#bp_cla').attr('Stitle', src_info);
206        jQuery('#bp_cla').attr('Stip', zoom_cl);
207        r = { width: jQuery("#theMainImage").width(), height: jQuery("#theMainImage").height(),
208          rap: jQuery("#theMainImage").width() / jQuery("#theMainImage").height(),
209          rap_init: Zone_image.image_init.rapport
210        }
211
212
213        jQuery('#bp_cla span').text(zoom_cl);
214        color_back = jQuery('#imageToolBar').css("backgroundColor");
215        try {
216          if (color_back.match(new RegExp("rgb", "gi"))) {
217            color_back = color_back.split("(")[1].split(")")[0].split(",");
218            color_back = "rgb(" + Math.abs(255 - color_back[0]) + ","
219                + Math.abs(255 - color_back[1]) + ","
220                + Math.abs(255 - color_back[2]) + ")";
221          }
222          else if (color_back.match(new RegExp("#", "gi")))
223            color_back = Math.abs("#65536" - color_back);
224          else
225            color_back = jQuery('body').css("color");
226          jQuery('#bp_cla span').css({ color: color_back, aling: "center" });
227        } catch (e) {
228
229        }
230        if (options.pictureDeriv) {
231          jQuery('.auto_details').text(" (" + Zone_image.image.width + " x " + Zone_image.image.height + ") " + options.pictureDeriv);
232        }
233        //===============================================
234      } else {
235        src = src6;
236        jQuery('.auto_details').text("");
237
238      }
239      bp_scr = jQuery('#bp_img_cla');
240      if (bp_scr.length > 0) {
241        src_enc = bp_scr.attr("src");
242        if (!src_enc.match(src)) {
243          bp_scr.get(0).src = src;
244          jQuery('#bp_img_cla').attr('alt', src_info);
245          jQuery('#bp_img_cla').attr('title', src_info);
246        }
247      }
248
249    }
250    //____________________ set_cl _____________________________
251
252    /********************************
253    * Set__bgo
254    *********************************/
255    Set_llbgo = function (Force) {
256
257      if (marges_llgbo == 0) return;
258      if (Type_Img == "pamoorama") {
259
260      }
261      if (Force)
262        if (typeof LlgboFr_Resize == "function") {
263          LlgboFr_Resize();
264        }
265      if (Type_Img == "pamoorama" || Type_Img == "charlie") {
266        return;
267      }
268      if (!theImg) return;
269
270      if (theImg.useMap)
271        nom_map = theImg.useMap.replace("#", "");
272      else
273        nom_map = "Autosize";
274
275      maps = jQuery("map[name='" + nom_map + "']");
276      if (maps.length == 0) return;
277      // nom_map = maps[0].name;
278      maps = jQuery("map[name='" + nom_map + "']  area");
279      nb_zone = maps.length;
280      Largeur_zone = (Zone_image.image.width / nb_zone);
281      Hauteur_zone = (Zone_image.image.height);
282      init_zone = 0;
283      j = 0;
284      maps.each(function (e) {
285        init_zone = Largeur_zone * j;
286        rel = jQuery(this).attr("rel");
287        title = jQuery(this).attr("title");
288        alt = jQuery(this).attr("alt");
289        H = Hauteur_zone;
290        if (rel == "up") {
291          H = Hauteur_zone / 4;
292        }
293        coord = { x0: init_zone, y0: 0, x1: Math.ceil(init_zone + Largeur_zone), y1: Hauteur_zone };
294        jQuery(this).attr({ coords: "'" + coord.x0 + "," + coord.y0 + "," + coord.x1 + "," + coord.y1 + "'" });
295        j++;
296      });
297
298      return;
299    }
300    //__________  Set_llbgo _______________
301
302    /********************************************
303    *  window LOAD
304    ********************************************/
305    jQuery(window).load(function () {
306      href = location.href;
307      var aff_ok = false;
308      //=======================================================================
309      infos_theImage = jQuery(theImage_id).infos({ absolute: true });
310      infos_theMainImage = jQuery(theMainImage_id).infos({ absolute: true });
311      infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre general
312
313      if (infos_theMainImage.width == 0) {
314        if (Type_Img == "charlie") {
315          infos_theMainImage = jQuery("#charlie").infos(true);
316          theMainImage_id = "charlie";
317          options.valide = true;
318        } else if (Type_Img == "iframe") {
319
320          infos_theMainImage = jQuery("#iframe").infos(true);
321          theMainImage_id = "iframe";
322          options.valide = true;
323
324          infos_theMainImage.width = infos_theImage.general.width;
325          infos_theMainImage.height = infos_window.height - infos_theImage.top - options.marge_basse;
326          jQuery("#iframe").width(infos_theMainImage.width);
327          jQuery("#iframe").height(infos_theMainImage.height);
328
329        } else if (Type_Img == "pamoorama") {
330          infos_theMainImage = jQuery("#pamoorama").infos(true);
331          theMainImage_id = "#pamoorama";
332          options.valide = true;
333
334        } else {
335
336          jQuery("img").each(function (i) {
337
338            imgSrc = options.imgSrc;
339            n = this.src;
340
341          });
342          infos_theMainImage = jQuery("#theImage img").infos();
343
344        }
345        if (infos_theMainImage.id == "")
346          jQuery("#theImage img").attr("id", "theMainImage");
347        infos_theMainImage = jQuery(theMainImage_id).infos();
348      }
349
350      infos_theImage = jQuery(theImage_id).infos(true);                 // conteneur
351
352
353      if (test_theme("simple")) {
354        jQuery(theMainImage_id).css({ maxWidth: "none" });
355        theImageAndInfos_id = "#content";
356        infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre general
357        infos_theImage.height = infos_window.height - infos_theImage.top;
358        //  jQuery(theImage_id).height(infos_theImage.height);
359
360      } else {
361        infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre general
362        if (infos_theImageAndInfos.visible == false)
363          theImageAndInfos_id = "#imageContainer";
364      }
365
366
367      imageInfos_id = "#imageInfos";
368
369      content_id = "#content";
370      infos_content = jQuery(content_id).infos(true);                 // conteneur
371      infos_theImage = jQuery(theImage_id).infos(true);                 // conteneur
372      infos_imageInfos = jQuery(imageInfos_id).infos(true);             // information
373      infos_theMainImage = jQuery(theMainImage_id).infos(true);         // Image
374      infos_copyright = jQuery("#copyright").infos(true);
375
376
377      if (infos_theImage.top > infos_window.height) {
378        zheight = infos_window.height - infos_content.top;
379      } else {
380        zheight = infos_window.height - (infos_theImage.top);
381      }
382
383
384      if (options.check_desc_v) { }
385
386      infos_comments = jQuery("#comments").infos(true);
387      infos_Licence = jQuery(".licencetag").infos(true);
388      infos_imageComment = jQuery(imageComment_id).infos(true);
389
390
391
392      if (test_theme("simple")) {
393
394
395      } else {
396        if (test_theme("stripped")) {
397
398        } else
399
400          if (test_theme("blanc , pure, hr_ ")) {
401            options.marge_gauche += 10;
402            options.marge_droite += 10;
403          }
404      }
405
406
407      Zone_image = { image_init: {
408        width: infos_theMainImage.width,
409        height: infos_theMainImage.height,
410        rapport: infos_theMainImage.width / infos_theMainImage.height
411      },
412        image: {
413          width: infos_theImage.general.width,
414          height: infos_window.height - infos_theImage.top - options.marge_basse,
415          rapport: infos_theMainImage.width / infos_theMainImage.height
416        },
417        container: {
418          width: infos_theImage.general.width,
419          height: zheight,
420          margesWidth: infos_window.width - infos_theImage.width
421        }, marges: {
422          height: 0,
423          width: 0
424        }
425      }
426
427
428      Zone_image.zoom = (Zone_image.image.height / Zone_image.image_init.height);
429
430
431
432
433      /***********************************************************
434      *  RESIZE (une fois document chargé)
435      ***********************************************************/
436      var new_dim;
437      jQuery(window).resize(function (event, ui) {
438        Autosize_resize(true, options);
439
440        return;
441
442
443
444      });
445      //_____________ widow.resize _______________
446
447      type_src = "div";
448      old_window = { width: 0, height: 0 };
449      List_autosize = new Array();
450      nu_img = 0;
451      tempo = 0;
452
453
454      infos_llgbo = jQuery(llgbo_id).infos(true);
455      infos_llgboh2 = jQuery("#llgboh2").infos(true);
456      marges_llgbo = 0;
457      //==========================================================================================
458      if (options.valide) {
459
460        init_gen();
461
462
463      }
464
465    });
466    //__________________window.onload_________________
467
468    /********************************************
469    *  window unLOAD
470    ********************************************/
471    jQuery(window).unload(function () {
472      return;
473    });
474    //_________ unload ___________
475
476    //===================
477    // VARIABLES 
478
479
480    //===================
481    // options
482    //===================
483
484    //=========================================================
485    /*messages = "This frame uses the W3C box model: <span>" + jQuery.support.boxModel + "</span>";
486    messages += "This frame uses the html5Clone: <span>" + jQuery.support.html5Clone + "</span>";*/
487    // jQuery("p").html(messages);
488    if (typeof (options) == "undefined") {
489      options = { imageAutosize: false }
490    }
491    options = jQuery.extend(Autosize_options, options);
492    var COOKIE_PATH = options.COOKIE_PATH;
493    var cookies = Get_cookies();
494
495    var defaults = {
496      imageAutosizeMargin: 0,
497      imageAutosize: false,
498      marge_basse: options.imageAutosizeMargin || 0,
499      DEBUG_autosize: false
500    };
501
502    options = jQuery.extend(defaults, options);
503
504
505    for (i = 0; i < options.liste_type.length; i++) {
506      options.liste_type[i] = options.liste_type[i].split(",");
507    }
508
509    options.theMainImageWidth = options.theMainImageWidth;
510    options.theMainImageHeight = options.theMainImageHeight;
511
512    jQuery("#form_autosize_picture").addClass("Autosize");
513    //===== marges suplémentaires en fonction theme ===
514    options.valide = jQuery(".Autosize").css("display") != "none";
515
516    options.marge_haute = jQuery(".Autosize").Get_Val_int(jQuery(".Autosize").css("top"));
517    options.marge_basse = jQuery(".Autosize").Get_Val_int(jQuery(".Autosize").css("bottom"));
518    options.marge_gauche = jQuery(".Autosize").Get_Val_int(jQuery(".Autosize").css("left"));
519    options.marge_droite = jQuery(".Autosize").Get_Val_int(jQuery(".Autosize").css("right"));
520    fade_in = options.fade_in || 0;
521    imageComment_id = ".imageComment";
522    if (test_theme("simple")) {
523      jQuery("#theImage p").addClass("imageComment");
524    }
525    if (test_theme("mont")) {
526      jQuery("#content").css({ marginLeft: 'auto' }); //monblanc
527    }
528
529    DEBUG_autosize = options.DEBUG_autosize;
530    Get_type_img();
531
532    var theMainImage_id = "#theMainImage";
533    var theImage_id = "#theImage";
534    var theImageAndInfos_id = "#theImageAndInfos";
535    var infos_window = jQuery(window).infos();
536    var infos_theImageAndInfos = jQuery(theImageAndInfos_id).infos();  // Cadre general
537    var infos_content;
538    var infos_body;
539    var infos_the_page = jQuery("#the_page").infos(true);
540    var nopano;
541    var llgbo_id = "#llgbo0";
542    var marges_llgbo = 0;
543
544    var useMap = options.pictureMap; // #mapxxx
545    var user_status = options.user_status;
546
547    var pictureDeriv = options.pictureDeriv; // xxx
548    var pictureSelType_user = eval("options." + user_status + "_type"); //limite taille
549    if (Type_Img == "pamoorama")
550      options.pictureSelType = "Autosize";
551
552    if (pictureSelType_user != options.pictureSelType) {
553      if (pictureDeriv == null)
554        pictureDeriv = pictureDeriv_user;
555      else
556        pictureDeriv_user = pictureDeriv;
557    }
558
559    if (!options.valide) {
560
561      pictureDeriv = "medium";
562      pictureDeriv_user = pictureDeriv;
563      options.pictureDeriv = pictureDeriv;
564    }
565
566
567
568    jQuery('#derivativeSwitchBox .switchCheck').css('visibility', 'hidden');
569    jQuery('#derivativeChecked' + options.pictureSelType).css('visibility', 'visible');
570    //======================================================================================
571    href_path = "javascript:changeImgSrc('" + options.imgSrc + "', '" + options.pictureDeriv + "', '" + options.pictureDeriv + "', '" + "SelMaxi" + "')";
572
573    /*   */
574    //  jQuery('#derivativeCheckedSelMaxi').hide();
575    jQuery('#derivativeCheckedSelMaxi').next().show();
576    jQuery('#derivativeCheckedSelMaxi').next().next().show();
577
578    spans = jQuery("#derivativeCheckedSelMaxi").next();
579    spans.attr("href", href_path);
580    spans.attr("name", "SelMaxi");
581
582    spans = spans.find("span");
583    spans.attr("name", "SelMaxi");
584    spans.text("(" + options.theMainImageWidth + " x " + options.theMainImageHeight + ")");
585    spans = spans.find("span");
586    spans.text(options.pictureDeriv);
587    //==========================================================
588    href_path = "javascript:changeImgSrc('" + options.imgSrc + "', '" + options.pictureDeriv + "', '" + options.pictureDeriv + "', '" + "Autosize" + "')";
589
590    spans = jQuery("#derivativeCheckedAutosize").next();
591    spans.attr("href", href_path);
592    spans.attr("name", "Autosize");
593    spans = spans.find("span");
594    spans.attr("name", "Autosize");
595    spans.text("(" + options.theMainImageWidth + " x " + options.theMainImageHeight + ")");
596    spans.next().text(options.pictureDeriv);
597    //==========================================================
598
599    /*
600
601
602    jQuery('#derivativeCheckedAutosize').hide();
603    jQuery('#derivativeCheckedAutosize').next().hide();
604    jQuery('#derivativeCheckedAutosize').next().next().hide();
605    */
606
607
608    //=============================================================
609    // REPONSE ACTION
610    //=============================================================
611    theMainImage_st = false;
612
613
614    /***********************
615    *
616    **********************/
617    jQuery("#theMainImage," + theMainImage_id + ",.preload, .next1 , ")
618        .load(function (e) {
619          src = this.src;
620          theMainImage_st = true;
621          if (typeof Zone_image == "undefined") {
622            Zone_image = {};
623          }
624          Zone_image.image_init = { width: this.width, height: this.height, rapport: this.width / this.height };
625          if (!init_img(this)) {
626            nu_img = 0;
627          }
628
629        })
630         .error(function (e) {
631           if (!this.complete) {
632             src = jQuery(this).attr("src").replace("./_data/i/","",1);
633             jQuery.ajax({
634               type: 'GET',
635               url: 'i.php?' +  src + "&ajaxload=true",
636               dataType: 'json',
637               success: (function (data) {
638                 j = data;
639               })
640
641             });
642
643         
644
645           }
646
647         })
648         .bind("Finish", function (e, data) {
649           if (typeof imageInfos_id == "undefined") return;
650         
651         })
652          .bind("ON", function (e, data) {
653            if (data.status != "ok") {
654              popup = jQuery(".errors");
655              if (popup.length == 0) {
656                jQuery("#theImage").append("<div class='errors'><span></span></div>");
657              }
658              jQuery(".errors").text("Erreur : [" + data.done + "] " + data.responseText);
659              jQuery(".errors").show().delay(10000).hide(2000);
660              return;
661            }
662            if (data.src) { 
663             if (typeof imageInfos_id == "undefined") return;
664              if (data.src.match(RegExp(options.pictureDeriv.substr(0, 2) + ".jpg", "gi"))) {             
665             //   Autosize_resize(true, options);
666              }
667            }
668          });
669
670
671    ;
672
673
674
675
676    ;
677    //_________ theMainImage  ___________
678
679
680    jQuery("#reset").click(function () {
681      location.reload();
682    });
683
684
685    //===========================================================
686    //  REPONSE TRIGGER
687    //===========================================================
688    jQuery('#ret_autosize').live('ON', function (e) {
689      if (nu_img == "") nu_img = 8;
690      jQuery(jQuery('.debug').get(nu_img)).trigger('ON');
691
692    });
693
694    //==========================================================
695    jQuery("map area").mouseover(function (e) {
696      try {
697        nok = theImg.useMap;
698        hok = this;
699      }
700      catch (r) {
701
702      }
703    });
704
705    //==================================
706    // jQuery("#llgbo").trigger("ON");
707    //==================================
708    jQuery(llgbo_id).live('ON', function (e) {
709      n_id = this;
710      infos_llgbo = jQuery(llgbo_id).infos();
711      if (infos_llgbo.visible == false) return;
712
713      marges_llgbo = 0;
714      if (infos_llgbo.height > 0) {
715        infos_llgboframe1 = jQuery(llgbo_id + " div:last").infos();
716        infos_llgboframe31 = jQuery(llgbo_id + "  div:first").infos();
717        //=============================================
718        ll2 = infos_llgboframe1.width; // llgboframe1 interieur
719        ll1 = infos_llgboframe31.exterieur.width; // llgboframe31 avec border width
720        options.marges_llgbo = (ll1 - ll2);
721        infos_llgboh2 = jQuery("#llgboh2").infos();
722      }
723    });
724    //==============================
725    // jQuery("#mapPicture").trigger("ON");
726    //==============================
727    jQuery("#mapPicture").live('ON', function (e) {
728      p2 = jQuery("#infoSwitcher").infos();
729    });
730    //==============================
731    // jQuery("#map").trigger("ON");
732    //==============================
733    jQuery("#map").live('ON', function (e) {
734      p2 = jQuery("#map").infos();
735    });
736    //===================================
737    // jQuery("#theImage").trigger("ON");
738    //===================================
739    jQuery("#imageInfos").live('on', function (e) {
740      target = e.target.id;
741    });
742
743    //===================================
744    // jQuery("#theImage").trigger("ON");
745    //===================================
746    jQuery("#theImage").live('ON', function (e) {
747      target = e.target.id;
748
749      id = this.id;
750      Select_Image(); //+calcul
751    });
752
753
754
755
756    //=================================================================
757    jQuery(document).live('gallyInterfaceReady', function (e) {
758      i = jQuery(this).text();
759      jQuery(this).trigger('ON');
760    }
761
762          );
763
764
765    /*********************************
766    *
767    ********************************/
768    var old_width;
769
770    jQuery("#theImage").resize(function (e) {
771
772    });
773
774
775
776    jQuery("#menuSwitcher,#infoSwitcher").click(function (e) {
777      options.set_sw = this.id;
778      setTimeout(function () { div_resize() }, 10);
779      nu_img = 0;
780    });
781
782    div_resize = function (i) {
783
784      jQuery("#theImage").trigger("resize");
785      /*
786      if (jQuery("#theImage").width() != old_width) {
787      setTimeout(function () { div_resize() }, 10);
788      }
789      */
790    }
791    //===========================================
792    // jQuery("#theImageAndInfos").trigger("ON");
793    //===========================================
794    jQuery("#theImageAndInfos").live('ON', function (e) {
795      infos_theImageAndInfos = jQuery("#theImageAndInfos").infos();
796      //   setTimeout(function () { Autosize_resize(true) }, 100);
797      nu_img = 0;
798    }); // fin click #theImageAndInfos ON
799
800
801    jQuery("#theImageAndInfos").resize(function (e) {
802
803    });
804
805
806    jQuery("#linkAutosize").click(function (e) {
807      nu_img = 0;
808    });
809    //==================================
810    //
811    //===================================
812    jQuery('#derivativeCheckedAutosize').click(function () {
813      try {
814        pathnames = jQuery(this).attr("href").split(":");
815
816        //  eval(pathnames[1]);
817      } catch (e) {
818        n = false;
819      }
820    }); // fin click derivativeCheckedAutosize
821    //====================================================
822    if (typeof decode_href != 'function') {
823      function decode_href(myObj) {
824        href_path = jQuery(myObj).attr("href");
825        pt = href_path.split("(");
826        pt = pt[1].split(")");
827        pt = pt[0].replace(RegExp("'", "g"), "");
828        pt = pt.replace(RegExp(" ", "g"), "");
829        pt = pt.split(",");
830        source = pt[0];
831        pictureDeriv = pt[1];
832        pictureMap = pt[2];
833        if (pt.length > 3)
834          pictureSelType = pt[3];
835        else
836          pictureSelType = pt[1];
837
838        return { source: source,
839          pictureDeriv: pictureDeriv,
840          pictureMap: pictureMap,
841          pictureSelType: pictureSelType
842        }
843      }
844    }
845
846    jQuery("#derivativeSwitchBox a").click(function (e) {
847      retour = decode_href(this);
848      theImg = document.getElementById(theMainImage_id.replace("#", ""));
849      if (theImg) {
850        // options.pictureDeriv = retour.pictureDeriv;
851        options.pictureSelType = retour.pictureSelType;
852        options.pictureMap = options.pictureDeriv;
853
854
855        if (this.name) {
856          options.pictureSelType = this.name;
857          n = Get_dimensions(true, options);
858
859
860
861        } else {
862
863
864        }
865
866        jQuery("#derivativeSwitchBox span").removeClass("auto_details linkAutosize");
867        jQuery("#derivativeSwitchBox a").removeClass("auto_details linkAutosize");
868        if (options.pictureSelType == "Autosize" || options.pictureSelType == "SelMaxi") {
869          spans = jQuery("#derivativeChecked" + options.pictureSelType).next();
870          spans.addClass("linkAutosize");
871          spans.find("span").addClass("auto_details");
872          jQuery(".auto_details").text("");
873        }
874      }
875    });
876    //__________ fin click #derivativeSwitchBox a ____________
877
878    jQuery("input").click(function () {
879      if (this.name.match(RegExp("_enabled", "gi"))) {
880        sel = "[name*=" + this.name + "]";
881        obj = jQuery("tr" + sel);
882
883        if (this.checked)
884          obj.css({ backgroundColor: "green", color: "white" });
885        else
886          obj.css({ backgroundColor: "red", color: "white" });
887        return;
888      }
889      return;
890    });
891    //____________________ set_llgbo _____________________________
892
893    //====================================
894    Autosize_init = function (name, value) {
895      img_defaut = { height: options.scaled_height, width: options.scaled_width };
896      img_reelle = { height: options.theImageHeight, width: options.theImageWidth };
897      img_init = { height: options.theImageHeight, width: options.theImageWidth };  // taille initiale
898
899      img_finale = img_init;
900
901      useMap = infos_theMainImage.useMap; // #mapmedium
902
903      useMap = options.pictureMap; // #mapxxx
904      pictureDeriv = options.pictureDeriv; //picturederiv xxx
905
906
907      old_img = options.imgSrc;
908      old_window_height = options.windowHeight || jQuery(window).height();
909      old_window_width = options.windowWidth || jQuery(window).width();
910      old_img_h = options.imgHeight;
911      old_img_w = options.imgWidth;
912      if (infos_theMainImage.visible == true) {
913        theImg = document.getElementById(theMainImage_id.replace("#", ""));
914        theImg.useMap = useMap;
915      }
916      fade_in = parseInt(options.fade_in || 0);
917
918    }
919    //____________________ Autosize_init _____________________
920
921    /***************************
922    * Autosize_resize
923    ***************************/
924    Autosize_resize = function (force, parametres) {
925      n = Get_dimensions(true, options);
926      if (n == false) return;
927      Save_cookies(options);
928      if (options.pictureSelType != "Autosize" && options.pictureSelType != "SelMaxi") {
929        jQuery(theImg).width(Zone_image.image_init.width);
930        jQuery(theImg).height(Zone_image.image_init.height);
931        return;
932
933      }
934      infos_theImage = jQuery(theImage_id).infos(true);
935      if (typeof img_finale == "undefined") img_finale = { width: Zone_image.image.width, height: Zone_image.image.height };
936      if (img_finale.width && (img_finale.width != Zone_image.image.width || img_finale.height != Zone_image.image.height)) {
937        img_finale = { width: Zone_image.image.width, height: Zone_image.image.height };
938      }
939      r1 = Zone_image.image.width / Zone_image.image.height;
940      //======================================================
941
942      affiche_debug({
943
944        Debug1: Debug_info(1, "Cont:" + infos_theImage.width
945    + " X " + infos_theImage.height
946    + " IMG: " + img_finale.width
947    + " X " + img_finale.height
948    + " mgw : " + Zone_image.marges.width
949    , "->")
950      });
951
952      if (Type_Img == "pamoorama") {// img_finale.width
953        jQuery("#pamoorama").width(img_finale.width);
954        jQuery("#pamoorama").height(img_finale.height);
955
956
957        infos_pamoorama = jQuery("#pamoorama").infos({ absolute: true });
958
959        Set_Pamoorama({ width: img_finale.width, height: img_finale.height });
960        if (nopano)
961          if (window.myPamoorama.options.autoscrollOnLoad) {
962            window.myPamoorama.startAnimRight();
963          }
964
965        //jQuery(theMainImage_id).height(Zone_image.image.height);
966      } else {
967      if (options.imageAutosize==false)
968        if (options.pictureSelType == "Autosize" || options.pictureSelType == "SelMaxi") {
969          jQuery(theMainImage_id).height(Zone_image.image.height);
970          jQuery(theMainImage_id).width(Zone_image.image.width);
971
972        } else {
973          jQuery(theMainImage_id).height(Zone_image.image.height);
974          jQuery(theMainImage_id).width(Zone_image.image.width);
975        }
976
977
978        if (Type_Img == "charlie" || Type_Img == "iframe") {
979          swfobj = jQuery("#" + Type_Img).infos({ absolute: true });
980
981          //  jQuery("#" + Type_Img).attr({ height: Zone_image.image.height, width: Zone_image.image.width - 50 });
982          //  jQuery(theMainImage_obj).attr({ height: Zone_image.image.height, width: Zone_image.image.width - 50 });
983          //  jQuery(theMainImage_emb).attr({ height: Zone_image.image.height, width: Zone_image.image.width });
984
985        }
986
987
988      }
989
990      set_cl();
991      Set_llbgo(true);
992      return true;
993    };
994    //_________________Autosize ____________________________________   
995
996    /*****************
997    * changeImgSrc
998    ******************/
999    changeImgSrc = function (url, typeSave, typeMap, type) {
1000      if (url) {
1001        if (options.imgSrc != url) {
1002          options.imgSrc = url;
1003        }
1004      }
1005      jQuery("#theMainImage")
1006      .removeAttr("width height")
1007      .attr("src", url)
1008      .load(function (i) {
1009        url2 = this.src;
1010        jQuery('#derivativeSwitchBox .switchCheck').css('visibility', 'hidden');
1011        type = options.pictureSelType;
1012        if (typeof type != "undefined" && (type == "Autosize" || type == "SelMaxi")) {
1013
1014          jQuery('#derivativeChecked' + type).css('visibility', 'visible');
1015          document.cookie = 'picture_sel_type=' + type + ';path=' + COOKIE_PATH;
1016        } else {
1017          jQuery('#derivativeChecked' + typeSave).css('visibility', 'visible');
1018          document.cookie = 'picture_sel_type=' + typeSave + ';path=' + COOKIE_PATH;
1019        }
1020
1021        options.pictureMap = typeMap;
1022        options.pictureDeriv = typeSave;
1023
1024
1025        document.cookie = 'picture_deriv=' + typeSave + ';path=' + COOKIE_PATH;
1026        Autosize_resize(true, options);
1027      })
1028      .live("ON", function (e) {
1029        theMainImage_st = this.complete;
1030        this.src = this.src;
1031        // alert(this.src + ' Image does not exist !!');
1032      }).error(function (i) {
1033        this.src = this.src;
1034      });
1035      ;
1036
1037
1038
1039      document.cookie = 'picture_deriv=' + typeSave + ';path=' + COOKIE_PATH;
1040    }
1041
1042    //__________________ changeImgSrc ______________________
1043
1044    /*****************************
1045    *      pamoorama
1046    ******************************/
1047
1048    jQuery("#pamoorama").bind("on", function () { alert($(this).text()); });
1049    jQuery("#pamoorama").bind("on", function (e) {
1050      myPamoorama = window.myPamoorama;
1051    });
1052    jQuery("#pamoorama_inner").live("on", function (e) {
1053      myPamoorama = window.myPamoorama;
1054    });
1055    jQuery('#pamoorama').live('ON', function (e) {
1056      jQuery(jQuery('.debug').get(1)).trigger('ON');
1057      Autosize_resize(true, options);
1058    });
1059
1060    //===============================================
1061    // jQuery("#theImage").trigger("Start_right");
1062    //===============================================
1063    jQuery("#theImage").live('Start_right', function (e) {
1064      if (typeof Zone_image == "undefined") return
1065      test_w = window.myPamoorama.autoSlideFx.to;
1066      test_w = window.myPamoorama.autoScrollFx.to;
1067      nf = jQuery("#pamoorama_thumb").height();
1068      jQuery("#pamoorama_thumb img").width(200);
1069      jQuery("#pamoorama_thumb img").height(nf);
1070      // 200=window.myPamoorama.imageWidth
1071      // frame = Zone_image.container.width
1072      nw = (200 * Zone_image.image.width) / window.myPamoorama.imageWidth;
1073      jQuery("#pamoorama_frame").width(nw);
1074    });
1075    //===============================================
1076    // jQuery("#theImage").trigger("Start_left");
1077    //===============================================
1078    jQuery("#theImage").live('Start_left', function (e) {
1079      if (typeof Zone_image == "undefined") return
1080      jQuery("#theImage").show(0);
1081      window.myPamoorama.autoSlideFx.to = 0;
1082      test_w = window.myPamoorama.autoSlideFx.to;
1083      test_w = window.myPamoorama.autoScrollFx.to;
1084      nf = jQuery("#pamoorama_thumb").height();
1085      jQuery("#pamoorama_thumb img").width(200);
1086      jQuery("#pamoorama_thumb img").height(nf);
1087    });
1088
1089    /************************************
1090    * Wait_pamoorama
1091    ************************************/
1092    Wait_pamoorama = function () {
1093      if (Type_Img != "pamoorama") return;
1094      tempo = 0;
1095      Wait_pamoorama_st = false;
1096
1097
1098      while (Wait_pamoorama_st == false) {
1099        Wait_pamoorama_st = Wait_pamoorama_time();
1100        jQuery.noop();
1101      }
1102      tempo = 0;
1103      if (nopano) {
1104        if (window.myPamoorama.options.autoscrollOnLoad) {
1105          window.myPamoorama.startAnimRight();
1106          jQuery.delay(100);
1107        }
1108
1109
1110
1111      }
1112
1113    }
1114    //__________________ Wait_pamoorama ______________________
1115    jQuery(".pwg-icon-clock-minus, .pwg-icon-clock-plus").click(function (i) {
1116      n = window.myPamoorama;
1117      n = this;
1118    })
1119
1120    Wait_pamoorama_time = function () {
1121      if (nopano == true) return true;
1122      if (jQuery("#pamoorama").length) {
1123        tempo = tempo + 1;
1124
1125        mypanorama = window.myPamoorama;
1126        if (!mypanorama) {
1127          if (tempo > 500) return true;
1128          setTimeout("Wait_pamoorama_time()", 500);
1129          return false;
1130
1131        }
1132
1133        if (mypanorama.skipInit == false) {
1134          if (tempo > 500) return true;
1135          setTimeout("Wait_pamoorama_time()", 500);
1136          return false;
1137        }
1138        //=============================================================
1139        if (Math.abs(mypanorama.imageHeight) < 100) {
1140          setTimeout("Wait_pamoorama_time()", 500);
1141          return false;
1142        }
1143
1144        if (jQuery(".infos").length > 0) {
1145          jQuery(".infos").empty();
1146          jQuery(".infos").hide();
1147        }
1148
1149        nopano = true;
1150        Zone_image = { image_init: { width: mypanorama.imageWidth,
1151          height: mypanorama.imageHeight
1152        }
1153        }
1154        jQuery("#pamoorama").trigger("ON");
1155        return true;
1156
1157      }
1158    }
1159    //__________________ Wait_pamoorama time______________________
1160
1161    /**********************
1162    *
1163    ***********************/
1164    Wait_Affichage = function () {
1165      Wait_Affichage_st = false;
1166      while (Wait_Affichage_st == false) {
1167        jQuery.noop();
1168        Wait_Affichage_st = Wait_Affichage_time();
1169      }
1170    }
1171    //__________________ Wait_Affichage ______________________
1172
1173
1174    Wait_Affichage_time = function () {
1175      if (typeof fade_in == "undefined") fade_in = 1000;
1176      fade_in = parseInt(fade_in);
1177      /*
1178      if (!Autosize_resize()) {
1179      setTimeout("Wait_Affichage()", 500);
1180      return
1181      } 
1182      nu_img++;     
1183      */
1184      if (typeof fade_in == "undefined") fade_in = 0;
1185
1186      //   if (nu_img > 1) return;
1187      if (typeof stb != "undefined")
1188        stb.stop().fadeTo(3500, 0);
1189      if (typeof theMainImage_id == "undefined") return true;
1190
1191      if (theMainImage_id.selector) {
1192        theMainImage_id = theMainImage_id.selector;
1193      }
1194      if (theMainImage_id == null) return;
1195
1196      if (jQuery(theMainImage_id).length == 0) {
1197        if (jQuery("#pamoorama_inner").length > 0) {
1198          return true;
1199        }
1200        //=== attente Image chargée ===
1201        if (tempo > 100) return true;
1202        tempo++;
1203        setTimeout("Wait_Affichage_time()", 500);
1204        return false;
1205
1206      } else {
1207
1208        img_h = jQuery(theMainImage_id).height();
1209        img_w = jQuery(theMainImage_id).width();
1210
1211        if (typeof infos_theImage == "undefined") return;
1212        jQuery("#ret_autosize").trigger('ON', {
1213          width: img_w,
1214          height: img_h,
1215          theImage: theMainImage_id,
1216          img_src: infos_theMainImage.src,
1217          window_height: infos_theImage.height,
1218          window_width: infos_theImage.width
1219        });
1220      }
1221      return true;
1222    }
1223    //______________ Wait_affichage ______
1224
1225
1226    /***********************
1227    *
1228    **********************/
1229    init_img = function (theImg) {
1230      if (theImg.complete == false) {
1231        return;
1232      }
1233      name_src = theImg.src;
1234      img_init = { width: jQuery(theImg).width(), height: jQuery(theImg).height() }
1235
1236      if (typeof theImg.naturalWidth != "undefined")
1237        img_init.width = theImg.naturalWidth;
1238      if (typeof theImg.naturalHeight != "undefined")
1239        img_init.height = theImg.naturalHeight;
1240      img_init.rapport = img_init.width / img_init.height;
1241      if (typeof Zone_image == "undefined") Zone_image = { image: {} };
1242      if (typeof Zone_image.image == "undefined") Zone_image.image = { height: Zone_image.image_init.height, width: Zone_image.image_init.width };
1243      // theImg.height = img_init.height;
1244      //  theImg.width = img_init.width;
1245
1246      Zone_image.image_init = { height: img_init.height, width: img_init.width, rapport: img_init.rapport };
1247      Zone_image.zoom = Zone_image.image_init.height / img_init.height;
1248
1249      if (typeof Zone_image.src == "undefined") {
1250        Zone_image.src = name_src;
1251        return false;
1252      }
1253      stx = name_src.match(RegExp(Zone_image.src, "gi"));
1254      return stx;
1255    }
1256    //___________ init_img _______
1257
1258
1259
1260    //===========================================
1261    //
1262    //===========================================
1263    Set_Map = function (nds) {
1264      p0 = jQuery("#map").offset();
1265      if (!p0) return;
1266      infos_mapPicture = jQuery("#mapPicture").infos({ absolute: true });
1267      infos_theImage = jQuery("#theImage").infos({ absolute: true });
1268      jQuery("#map").removeAttr("height");
1269      jQuery("#map").removeAttr("width");
1270      jQuery("#map").width(infos_theImage.width - (infos_mapPicture.width));
1271      jQuery("#map").height(jQuery(window).height() - infos_theImage.top - infos_theImage.general.marges.height);
1272      return true;
1273    }
1274
1275    jQuery("map [name='#Autosize'] area").mouseover(function (e) {
1276      return;
1277    });
1278    //___ Set_Map ___
1279
1280    //=====================================
1281    //
1282    //=====================================
1283    Get_Maxi = function (Maxi_image) {
1284      var pt = options.liste_type;
1285      if (pt.length > 0) {
1286        tw = Maxi_image.width;  // valeur maxi
1287        th = Maxi_image.height;  // valeur maxi
1288        n = 0;
1289        maxi_size = { w: Maxi_image.width, h: Maxi_image.height, idx: -1 };
1290        mini_size = { w: tw, h: th, idx: 0 };
1291        size_derive = { w: 0, h: 0 };
1292        size_encours = { w: tw, h: th };
1293        //=================================
1294        jQuery(pt).each(function (i) {
1295          vn = this;
1296          size_derive = { w: parseInt(vn[2]), h: parseInt(vn[3]) };
1297          if (vn[0] == options.pictureSelType) {
1298            maxi_size = size_derive;
1299            maxi_size.idx = n;
1300            return false
1301          }
1302          if (vn[0] != "square" && vn[0] != "thumb" && vn[0] != "SelMaxi" && vn[0] != "Autosize") {
1303            if (size_derive.h > size_encours.h) {
1304              if (maxi_size.idx < 0) {
1305                maxi_size = size_derive;
1306                maxi_size.idx = n;
1307                return false
1308              }
1309            }
1310            if (size_derive.h < size_encours.h && size_derive.h > 10) {
1311              mini_size = size_derive;
1312              mini_size.idx = n;
1313            }
1314          }
1315          n++;
1316        });
1317        n = maxi_size.idx;
1318        if (n < 0) {
1319          n = mini_size.idx;
1320        }
1321        if (options.pictureSelType.match(RegExp("SelMaxi", "gi"))) {
1322          n = mini_size.idx;
1323
1324        }
1325        if (options.pictureSelType.match(RegExp("Autosize", "gi"))) {
1326
1327        }
1328        options.pictureDeriv = pt[n][0];
1329        return { url: pt[n][1], pictureDeriv: pt[n][0], pictureMap: pt[n][0], width: pt[n][2], height: pt[n][3] };
1330      }
1331      return { imgSrc: "", pictureDeriv: "", width: "", height: "" };
1332    }
1333    //_______________ Get_Maxi ______
1334
1335    /********************
1336    *
1337    ********************/
1338    Select_Image = function () {
1339      var pt = options.liste_type;
1340
1341
1342      if (pt.length > 0) {
1343        //===== calcul Image ===
1344        if (typeof imageInfos_id == "undefined") return;
1345        Calcul_Image();
1346        options.theImageMargeZone = Zone_image.marges;
1347        if (Type_Img != 'charlie') {
1348          if (options.pictureSelType != "SelMaxi" && options.pictureSelType != "Autosize") {
1349            return;
1350          } else {
1351            IMg = Get_Maxi(Zone_image.image);
1352          }
1353          imgSrc = IMg.url;
1354          options.imgSrc = imgSrc;
1355          img_width = IMg.width;
1356          img_height = IMg.height;
1357
1358          Zone_image.image_init = { height: IMg.height,
1359            width: IMg.width,
1360            rapport: IMg.width / IMg.height
1361
1362          };
1363          if (typeof Zone_image.image == "undefined")
1364            Zone_image.image = { height: IMg.height,
1365              width: IMg.width,
1366              rapport: IMg.width / IMg.height
1367
1368            };
1369        } else {
1370          return;
1371        }
1372        Zone_image.zoom = Zone_image.image.height / Zone_image.image_init.height;
1373        if (typeof Zone_image.src == "undefined") Zone_image.src = " ";
1374        status = imgSrc.match(RegExp(Zone_image.src, "gi")); // status = '' si !=
1375        status1 = (imgSrc.toString() == Zone_image.src.toString());
1376
1377        if (status1 == true) {
1378          //  changeImgSrc(imgSrc, IMg.pictureMap, IMg.pictureDeriv, options.pictureSelType);
1379          return;
1380
1381        }
1382        href_path = "javascript:changeImgSrc('" + imgSrc + "', '" + IMg.pictureMap + "', '" + IMg.pictureDeriv + "', '" + options.pictureSelType + "')";
1383        jQuery(".linkAutosize").attr("href", href_path);
1384        theImg = document.getElementById(theMainImage_id.replace("#", ""));
1385
1386        if ((theImg == null) || theImg.tagName != "IMG") {
1387          imgSrc_i = jQuery(theImg).css("backgroundImage");
1388          imgSrc_j = jQuery(theImg).css("background-image");
1389          return;
1390
1391        } else {
1392          theImg.src = imgSrc;
1393        }
1394
1395        theImg.useMap = "#map" + IMg.pictureMap;
1396        return true;
1397
1398
1399        theImg = document.getElementById(theMainImage_id.replace("#", ""));
1400        if (init_img(theImg)) {
1401
1402          return true;
1403        }
1404        return false;
1405
1406      } else {
1407
1408
1409        return false;
1410      }
1411
1412
1413    };  //_______________ Select_Image ______
1414
1415
1416    /*************************************************
1417    * correction pamoorama
1418    *************************************************/
1419
1420    Set_Pamoorama = function (Format) {
1421      myPamoorama = window.myPamoorama;
1422      if (Type_Img == "pamoorama") {
1423
1424        if (!nopano) {
1425          theMainImage_Id = "#pamoorama";
1426          nopano = false;
1427          Wait_pamoorama();
1428          infos_theMainImage = jQuery(theMainImage_Id).infos();
1429          //theMainImage_Id = "#pamoorama";
1430        }
1431
1432
1433        if (typeof myPamoorama == "undefined") {
1434          return;
1435        }
1436        //========================================================= 
1437        if (!nopano) {
1438          //theMainImage_Id = "#pamoorama";
1439          nopano = false;
1440          Wait_pamoorama();
1441          infos_theMainImage = jQuery(theMainImage_Id).infos();
1442          //theMainImage_Id = "#pamoorama";
1443        }
1444
1445
1446        infos_pamoorama_outter = jQuery("#pamoorama_outter").infos({ absolute: true });
1447        infos_pamoorama_inner = jQuery("#pamoorama_inner").infos({ absolute: true });
1448        infos_pamoorama_frame = jQuery("#pamoorama_frame").infos({ absolute: true });
1449        infos_frame = jQuery(myPamoorama.frame).infos({ absolute: true });
1450
1451
1452        //====================================================
1453        marges_w = infos_pamoorama.general.marges.width;
1454        marges_h = infos_pamoorama.general.marges.height;
1455
1456        jQuery("#pamoorama_footer").css({
1457          width: Format.width + "px"
1458        });
1459        infos_pamoorama_footer = jQuery("#pamoorama_footer").infos();
1460        marges_h += infos_pamoorama_footer.general.height;
1461        outter_height = Format.height;
1462
1463        Zoom_pano = (Format.height - marges_h) / Zone_image.image_init.height;
1464        new_image = { height: Math.ceil(Zone_image.image_init.height * Zoom_pano),
1465          width: Math.ceil(Zone_image.image_init.width * Zoom_pano)
1466        }
1467
1468        jQuery("#pamoorama_inner").css({
1469          width: new_image.width + "px", height: new_image.height + "px", "background-size": "100%"
1470        });
1471        //---------- test largeur image
1472        new_width = Format.width - (options.marge_right + options.marge_left);
1473
1474        if (new_width > new_image.width) {
1475          new_width = new_image.width;
1476          jQuery("#pamoorama_outter").css({
1477
1478            align: "center",
1479            margin: "0"
1480          });
1481        }
1482        outter_width = new_width;
1483
1484        jQuery("#pamoorama_outter").css({
1485          align: 'center',
1486          margin: 'auto',
1487          width: outter_width + "px",
1488          height: Format.height - marges_h + "px"
1489        });
1490        //============= Mise à l'echelle ==================
1491        window.myPamoorama.options.width = Math.ceil(Format.width);
1492        //==================================================================
1493        new_max_left = new_image.width - outter_width;
1494        if (!window.myPamoorama.outter) return;
1495        window.myPamoorama.outter.scrollTo(new_max_left, 0);
1496
1497        if (typeof window.myPamoorama.autoScrollFx != "undefined") window.myPamoorama.autoScrollFx.to = new Array(new_max_left, 0);
1498        window.myPamoorama.ratio = Math.ceil(new_image.width / 200);
1499        window.myPamoorama.imageWidth = new_image.width;
1500        window.myPamoorama.imageHeight = new_image.height;
1501        nf = jQuery("#pamoorama_thumb").height();
1502        jQuery("#pamoorama_thumb img").width(180);
1503        jQuery("#pamoorama_thumb img").height(nf);
1504
1505        jQuery("#pamoorama_thumb").css({
1506          /*   position: "absolute", */
1507          left: (Format.width - 215) + "px"
1508
1509        });
1510        jQuery("#pamoorama_thumb img").css({
1511
1512        });
1513        // 200=window.myPamoorama.width
1514        // frame = Zone_image.container.width
1515
1516        nw = (window.myPamoorama.image.width * Format.width) / window.myPamoorama.imageWidth;
1517        jQuery("#pamoorama_frame").width(nw);
1518
1519
1520      } // 
1521    } // Set_Pamoorama
1522
1523    /*********************************************************/
1524
1525    Toggle_bp = function () {
1526      options.cl_visible = !options.cl_visible;
1527      Autosize_resize();
1528      Wait_Affichage();
1529
1530    }
1531
1532    //====================================
1533    //
1534    //====================================
1535    Calcul_Image = function () {
1536
1537      /****************************************/
1538      if (typeof imageInfos_id == "undefined") return;
1539      infos_imageInfos = jQuery(imageInfos_id).infos({ absolute: true });             // information
1540      infos_theMainImage = jQuery(theMainImage_id).infos({ absolute: true });         // Image   
1541      // commentContent
1542      // copyright
1543
1544
1545
1546      pos_top = options.pos_top;
1547      //    pos_top = infos_theImage.top;
1548
1549      pos = jQuery(theImage_id).offset();
1550      infos_theImage = jQuery(theImage_id).infos(true);   // container
1551      infos_window = jQuery(window).infos(true);   // window
1552      w = infos_theImage.general.marges.width
1553
1554      container = {
1555        height: infos_window.height - options.theImageTop,
1556        width: infos_window.width - options.theImageLeft - options.theImageRight
1557      }
1558      marge_left = options.marge_left | 0;
1559      marge_right = options.marge_right | 0;
1560      marge_top = options.marge_top | 0;
1561      marge_bottom = options.marge_bottom | 0;
1562
1563      //==========================================================
1564      if (test_theme("stripped")) {
1565        infos_the_page.margin.left = 20;  //taille fleche
1566        infos_the_page.margin.right = 20;
1567      }
1568
1569
1570      if (test_theme("elegant")) {
1571
1572        if (infos_imageInfos.visible == true) {
1573          //  marge_right += infos_imageInfos.general.width; ;
1574
1575        } else {
1576          marge_right += 0;
1577
1578        }
1579        marge_right += 1;
1580        marge_left += 1;
1581
1582      } else if (test_theme("stripped")) {
1583
1584      } else if (test_theme("simple")) {
1585
1586
1587
1588      } else if (test_theme("OS")) {
1589
1590      } else if (test_theme("pur")) {
1591        marge_right += 0;
1592        // marge_right += 25;
1593      } else if (test_theme("mont")) {
1594        marge_right += 0;
1595
1596        // marge_right += 25;
1597
1598
1599      } else {
1600
1601
1602
1603      }
1604
1605
1606      retrait_img = {};
1607      //========== Format Image ============== 
1608      retrait_img.height = Math.ceil(options.marges_llgbo || 0)
1609      + Math.ceil(infos_theMainImage.general.marges.height);
1610      retrait_img.height += 2;
1611
1612
1613      //===============================================================
1614      retrait_img.width = Math.ceil(infos_theMainImage.general.marges.width); // borderwidth+padding
1615      retrait_img.width = Math.ceil(infos_theImage.general.marges.width); // borderwidth+padding
1616      retrait_img.width += Math.ceil(options.marges_llgbo || 0);
1617      retrait_img.width += 2;
1618      if (!options.check_desc_v)
1619        marge_bottom = 0;
1620
1621      //================== Limite Format Image =====================
1622      container.height_interne = container.height - marge_top - marge_bottom;
1623      container.width_interne = container.width - marge_left - marge_right;
1624
1625      container.height_interne = Math.max(container.height_interne, Math.ceil(options.mini_height) + retrait_img.height),
1626      container.width_interne = Math.max(container.width_interne, Math.ceil(options.mini_width) + retrait_img.width)
1627
1628
1629      image_max = {
1630        height: (container.height_interne - retrait_img.height),
1631        width: (container.width_interne - retrait_img.width)
1632      }
1633      //=========================
1634      // test débordement
1635      //=========================
1636      height_theMainImage = Math.ceil(image_max.height);
1637      width_theMainImage = Math.ceil(image_max.width);
1638
1639      if (typeof Zone_image.image_init.rapport == "undefined") {
1640        Zone_image.image_init.rapport = options.ratio;
1641      }
1642      if (Type_Img == "charlie") {
1643
1644      } else if (Type_Img == "pamoorama") {
1645        if (height_theMainImage > container.height_interne) {
1646          n = options.pictureSelType;
1647        }
1648      } else {
1649
1650        height_theMainImage = Math.ceil(width_theMainImage / options.ratio);
1651
1652
1653
1654        if (height_theMainImage > container.height_interne) {
1655          image_max.height = container.height_interne;
1656          image_max.width = image_max.height * Zone_image.image_init.rapport;
1657          width_theMainImage = Math.ceil(image_max.width);
1658          height_theMainImage = Math.ceil(image_max.height);
1659        }
1660        if (width_theMainImage > container.width_interne) {
1661          image_max.width = container.width_interne;
1662          image_max.height = image_max.width / Zone_image.image_init.rapport;
1663          width_theMainImage = Math.ceil(image_max.width);
1664          height_theMainImage = Math.ceil(image_max.height);
1665
1666        } else if (width_theMainImage > container.width) {
1667
1668        } else {
1669
1670        }
1671
1672
1673
1674
1675      }
1676
1677
1678
1679      Zone_image.image = {
1680        width: width_theMainImage,
1681        height: height_theMainImage,
1682        rapport: width_theMainImage / height_theMainImage
1683
1684      };
1685
1686
1687      //=================================================================
1688      Zone_image.marges = { width: marge_left + marge_right + retrait_img.width,
1689        height: marge_top + marge_bottom + retrait_img.height
1690
1691      }
1692      Zone_image.src = jQuery(theMainImage_id).attr("src");
1693
1694    }
1695
1696    /*********************************************
1697    * Calcul les dimensions.
1698    *********************************************/
1699    Get_dimensions = function (force, parametres) {
1700      new_img = jQuery(theMainImage_id).infos({ absolute: true });
1701      new_dim = jQuery(theImage_id).infos({ absolute: true });
1702      new_win = jQuery(window).infos({ absolute: true }); // avec ascenseur   
1703      options.theImageTop = new_dim.top;
1704      options.theImageLeft = new_dim.left;
1705      options.theImageRight = (new_win.width - new_dim.right);
1706      options.theImageBottom = new_win.height - new_dim.out.bottom;
1707      options.marge_top = Math.ceil(new_img.top - new_dim.top);
1708      options.marge_bottom = Math.ceil(new_dim.out.bottom - new_img.out.bottom);
1709      if (options.theImageBottom < 0) {
1710        options.theImageBottom = 0;
1711      }
1712      options.theImageWidth = new_win.width - options.theImageLeft - options.theImageRight;
1713      options.theImageHeight = new_win.height - options.marge_top - options.theImageBottom - options.theImageTop;
1714
1715
1716
1717
1718      var chk = eval("options." + user_status + "_enabled");
1719      if (chk == "") { return; }
1720
1721      if (Type_Img != "map")
1722        Select_Image();
1723      infos_theMainImage = jQuery(theMainImage_id).infos({ absolute: true });
1724      Zone_image.src = infos_theMainImage.src;
1725      useMap = options.pictureSelType;
1726      /*
1727      if (useMap) {
1728      if (!useMap.match(RegExp("Autosize", "gi"))) {
1729      if (typeof img_height != "undefined") {
1730      jQuery(theImg).height(img_height);
1731      jQuery(theImg).width(img_width);
1732      }
1733      return;
1734      }
1735      }
1736
1737      if (options.imageAutosize) {
1738      return true; //stripped
1739      }
1740
1741      if (typeof options.cl_visible == "undefined") return;
1742      if (!options.cl_visible == true) { return; }
1743      */
1744
1745      //=================================================================
1746      switch (Type_Img) {
1747        case "map":
1748          if (Set_Map(true)) return false;
1749          break
1750        case "panorama":
1751          if (!theMainImage_id) {
1752
1753          }
1754          infos_theImage = jQuery(theMainImage_id).infos();
1755          infos_the_page = jQuery("#the_page").infos();
1756          img_finale.height = infos_theImage.height;
1757          break
1758        case "img":
1759
1760
1761
1762
1763
1764          break
1765        case "img_autre":
1766          if (!theMainImage_id) {
1767            if (DEBUG_autosize.match("true", gi)) alert("The_MainImage=null");
1768            return;
1769
1770          }
1771
1772          infos_the_page = jQuery("#the_page").infos();
1773
1774
1775          break
1776        case "embed":
1777          //
1778          if (infos_theMainImage.width == 0)
1779            infos_theMainImage = jQuery("#thePicturePage").infos();
1780          if (infos_theMainImage.width == 0)
1781            infos_theMainImage = jQuery("#the_page").infos();
1782
1783
1784          iph1 = jQuery("#theImage div").infos();
1785
1786          break
1787        case "charlie":
1788
1789          break
1790
1791        case "iframe":
1792          Zone_image.image.width = options.theImageWidth;
1793          Zone_image.image.height = options.theImageHeight;
1794          break
1795        case "pamoorama":
1796          Wait_pamoorama();
1797          break
1798      }
1799
1800
1801
1802      //=================================================
1803      if (Zone_image.image.height < options.mini_height2) {
1804        Zone_image.image.height = parseInt(options.mini_height2);
1805        Zone_image.image.width = Math.ceil(Zone_image.image.height * Zone_image.image_init.rapport);
1806      }
1807      if (Zone_image.image.width < options.mini_width2) {
1808        Zone_image.image.width = parseInt(options.mini_width2);
1809        Zone_image.image.height = Math.ceil(Zone_image.image.width / Zone_image.image_init.rapport);
1810      }
1811      //==================================================
1812      //   ImageWidthidth largeur à atteindre
1813      //   Calcul du rapport d'agrandissement
1814
1815      echelle_max = parseFloat(options.echelle_max, '3');
1816      if (Zone_image.zoom > echelle_max) {
1817        Zone_image.zoom = echelle_max;
1818        Zone_image.image.width = parseInt(Zone_image.image_init.width * Zone_image.zoom);
1819        if (Zone_image.image_init.rapport > 0)
1820          Zone_image.image.height = parseInt(Zone_image.image_init.width / Zone_image.image_init.rapport);
1821      }
1822      if (Type_Img != "pamoorama") {
1823        mxi = Math.ceil(Zone_image.image.height + Zone_image.marges.height);
1824        Zone_image.container.height = Math.max(Zone_image.container.height, mxi);
1825      }
1826      img_finale = { width: Zone_image.image.width, height: Zone_image.image.height };
1827      return true;
1828    }
1829    //________________ Get_dimensions ___________________
1830
1831
1832    /*****************************
1833    *  init_gen
1834    *****************************/
1835
1836    init_gen = function (e) {
1837
1838
1839      theImg = document.getElementById(theMainImage_id.replace("#", ""));
1840      //==================================================
1841      marges_llgbo = 0;
1842      options.marges_llgbo = 0;
1843      if (jQuery(llgbo_id).length > 0) {
1844        infos_llgbo = jQuery(llgbo_id).infos(true);
1845        if (infos_llgbo.visible == true) {
1846          if (infos_llgbo.height > 0) {
1847            infos_llgboframe1 = jQuery(llgbo_id + " div:last").infos();
1848            infos_llgboframe31 = jQuery(llgbo_id + "  div:first").infos();
1849            //=============================================
1850            ll2 = infos_llgboframe1.width; // llgboframe1
1851            ll1 = infos_llgboframe31.general.width; // llgboframe31
1852            options.marges_llgbo = (ll1 - ll2);
1853            infos_llgboh2 = jQuery("#llgboh2").infos();
1854          }
1855        }
1856
1857        marges_llgbo = options.marges_llgbo;
1858      }
1859
1860      //========= Récupération des informations ============= 
1861
1862      options.marge_top = 0;
1863      pAll = jQuery(llgbo_id).absoluteAll({ absolute: true });
1864      infos_llgbo.top = pAll.Top;
1865      infos_llgbo.bottom = pAll.Bottom;
1866      pAll = jQuery(theMainImage_id).absoluteAll({ absolute: true });
1867      pos_top = pAll.Top; ;
1868      pos_bottom = pAll.Bottom; ;
1869
1870      if (infos_llgbo.top > 0) {
1871        pos_top = infos_llgbo.top;
1872
1873        options.marge_top = infos_theMainImage.top - infos_theImage.top;
1874      } else
1875        pos_top = infos_theImageAndInfos.top;
1876
1877      options.pos_top = pos_top;
1878      options.marge_left = infos_theImage.general.marges.left + Math.ceil(options.marge_gauche);
1879      options.marge_right = infos_theImage.general.marges.right + Math.ceil(options.marge_droite);
1880      options.marge_top += infos_theImage.general.marges.top + infos_content.general.marges.top + Math.ceil(options.marge_haute);
1881      options.marge_bottom = Math.ceil(options.marge_basse); // +infos_content.general.marges.bottom; ;
1882      if (options.pictureDeriv == null)
1883        options.first = true;
1884      else
1885        options.first = false;
1886      //=================== Gestion liste photos size ============================
1887      us = 0;
1888      if (!options.theMainImageWidth) options.theMainImageWidth = options.scaledWidth;
1889      if (!options.theMainImageHeight) options.theMainImageHeight = options.scaledHeight;
1890
1891      if (options.first) {
1892        if (options.pictureDeriv) {
1893
1894          pictureSelType = options.pictureSelType;
1895          options.pictureMap = options.pictureDeriv;
1896
1897        } else {
1898          IMg = Get_Maxi(Zone_image.image);
1899          options.pictureDeriv = IMg.pictureDeriv;
1900          imgSrc = IMg.url;
1901          width = IMg.width;
1902          height = IMg.height;
1903          options.pictureDeriv = IMg.pictureDeriv;
1904          options.pictureMap = IMg.pictureMap;
1905        }
1906      }
1907      if (pictureSelType_user != options.pictureSelType) {
1908        /*
1909        user_status = options.user_status;
1910        pictureSelType_user = eval("options." + user_status + "_type"); //limite taille
1911        */
1912        pictureDeriv_user = options.pictureDeriv;
1913        options.pictureDeriv_user = pictureDeriv_user;
1914        pictureSelType = options.pictureSelType;
1915      }
1916      //==========================================================
1917      href_path = "javascript:changeImgSrc('" + options.imgSrc + "', '" + options.pictureDeriv + "', '" + options.pictureDeriv + "', '" + "SelMaxi" + "')";
1918      spans = jQuery("#derivativeCheckedSelMaxi").next();
1919      spans.attr("href", href_path);
1920      spans.attr("name", "SelMaxi");
1921      spans = spans.find("span");
1922      spans.attr("name", "SelMaxi");
1923      spans.text("(" + options.theMainImageWidth + " x " + options.theMainImageHeight + ")");
1924      //==========================================================
1925      href_path = "javascript:changeImgSrc('" + options.imgSrc + "', '" + options.pictureDeriv + "', '" + options.pictureDeriv + "', '" + "Autosize" + "')";
1926
1927      spans = jQuery("#derivativeCheckedAutosize").next();
1928      spans.attr("href", href_path);
1929      spans.attr("name", "Autosize");
1930      spans = spans.find("span");
1931      spans.attr("name", "Autosize");
1932      spans.text("(" + options.theMainImageWidth + " x " + options.theMainImageHeight + ")");
1933      //==========================================================
1934
1935      if (options.pictureSelType == "Autosize" || options.pictureSelType == "SelMaxi") {
1936        spans = jQuery("#derivativeChecked" + options.pictureSelType).next();
1937        spans.addClass("linkAutosize");
1938        spans.find("span").addClass("auto_details");
1939      }
1940      pictureDeriv = options.pictureDeriv;
1941      Autosize_resize(true, options);
1942      return;
1943      IMg = Get_Maxi(Zone_image.image);
1944      imgSrc = IMg.url;
1945
1946      width = IMg.width;
1947      height = IMg.height;
1948
1949      n = 0;
1950      var pt = new Array();
1951
1952
1953      //uyu = jQuery(uyu + " span");
1954      //
1955
1956      // auto_details
1957      //==== limite affichage selection = pictureSelType ====
1958      jQuery("#derivativeSwitchBox a").css('visibility', 'hidden');
1959      jQuery("#derivativeSwitchBox a").each(function (i) {
1960        href_path = jQuery(this).attr("href");
1961        pt[i] = href_path.split("'");
1962        tsz = pt[i][5];
1963
1964        jQuery(this).css('visibility', 'visible');
1965        //--- recherche limite ---
1966        if (tsz.match(RegExp(pictureSelType_user, "gi"))) {
1967          if (tsz.match(RegExp(options.pictureSelType, "gi"))) {
1968            us = n;
1969          } else {
1970            return false;
1971          }
1972        }
1973        //--- type en cours ---
1974        if (tsz.match(RegExp("^" + pictureDeriv, "gi"))) {
1975          us = n;
1976        }
1977
1978        n++;
1979      });
1980      jQuery(".switchCheck").css('visibility', 'hidden');
1981      jQuery("derivativeChecked" + pictureSelType_user).css('visibility', 'visible');
1982      /*  */
1983      //==== en cours ============
1984      if (options.imgSrc) {
1985        changeImgSrc(options.imgSrc, options.pictureDeriv, options.pictureDeriv, options.pictureSelType);
1986        imgSrc = options.imgSrc;
1987      }
1988
1989      href_path = "";
1990
1991    };
1992    //_______________________ init_gen _______________________
1993
1994
1995    /*********************************************
1996    * DEBUG ....
1997    *********************************************/
1998    /*
1999    if (DEBUG_autosize.match("true",gi))   {
2000    for (var i = 0; i < 10; i++) {
2001    jQuery('#adddebugs').click();
2002    }
2003    jQuery(jQuery('.debug').get(i - 1)).click();
2004    }
2005    */
2006
2007    // Custom Event, ON to turn on a debug.
2008    jQuery('.debug').live('ON', function (e) {
2009
2010      nu_img = jQuery(this).text();
2011      jQuery('.debug').trigger('OFF');
2012      jQuery(this).addClass('debugOn');
2013
2014    });
2015
2016    // On Click = debugs On
2017    jQuery('.debug').live('click', function (e) {
2018      i = jQuery(this).text();
2019      jQuery(this).trigger('ON');
2020    });
2021
2022    // Custom Event, Turn off a debug
2023    jQuery('.debug').live('OFF', function (e) {
2024      jQuery(this).removeClass('debugOn');
2025    });
2026
2027    // on Double Click, remove the debug from the DOM
2028    jQuery('.debug').live('dblclick', function () {
2029      jQuery(this).fadeOut(function () { jQuery(this).remove() });
2030    });
2031
2032    // Add another debug to the DOM
2033    jQuery('#adddebugs').click(function () {
2034      i = jQuery('.debug').length;
2035      jQuery('<div>' + i + '</div>')
2036    .addClass('debug')
2037    .appendTo('#debugsContainer');
2038    });
2039
2040
2041
2042    if (DEBUG_autosize.match("mouse", "gi")) {
2043      var mouseLocation = new Point(-500, -500);
2044      function Point(x, y) {
2045        this.x = x; this.y = y;
2046      }
2047      register_position();
2048
2049      function register_position() {
2050        mouse_x = 0;
2051        mouse_y = 0;
2052        //  document.onmousemove = position;
2053
2054      }
2055
2056      function position(evt) {
2057        if (!evt) evt = window.event;
2058        mouseLocation.x = evt.clientX;
2059        mouseLocation.y = evt.clientY;
2060      }
2061
2062      jQuery("div,a,img").mousemove(function (evt) {
2063
2064        if (!evt) evt = window.event;
2065        mouseLocation.x = evt.clientX;
2066        mouseLocation.y = evt.clientY;
2067        Context = jQuery(this).context.nodeName;
2068        obj_id = "#" + this.id.toString();
2069        infos_g = jQuery(obj_id).infos(true);
2070        infos_g.top = jQuery(obj_id).absoluteTop();
2071        wg = jQuery("body").width() - infos_g.right;
2072
2073        affiche_debug({
2074
2075          Debug1: Debug_info(1, "x:" + mouseLocation.x
2076    + " y: " + mouseLocation.y
2077    + " id: " + obj_id
2078    + " top: " + infos_g.top,
2079    +" Node: " + Context
2080    , "->")
2081    ,
2082          Debug2: Debug_info(2, "W:" + infos_g.general.width
2083    + " H: " + infos_g.general.height
2084    + " right: " + (wg)
2085    + " left: " + infos_g.left
2086    + " Node: " + Context
2087    , "->")
2088        });
2089
2090      });
2091
2092    }
2093
2094
2095    //=======================================================================================
2096    Debug_info = function (index, infos, Nom_str) {
2097      if (typeof infos == "undefined") return;
2098      width_g = Math.ceil(jQuery("body").width() / 5) - 10;
2099      if (typeof infos.height != "undefined") {
2100        message = " -- > Info : " + Nom_str + " " + infos.id + "\n" +
2101                         "Info nodeName: " + infos.nodeName + "\n" +
2102                         "Info width: " + infos.width + "\n" +
2103                         "Info height: " + infos.height + "\n" +
2104                         "Info top: " + infos.top + "\n" +
2105                         "Info left: " + infos.left + "\n" +
2106                         "Info position: " + infos.position + "\n";
2107
2108        myDebug = { id: "Debug" + index, texte: message,
2109          css: {
2110            color: "black",
2111            opacity: "1",
2112            position: "absolute",
2113            height: infos.height || pos_top - 30 + "px",
2114            width: infos.width || width_g + "px",
2115            left: infos.left || 0 + "px",
2116            border: "solid 1px green",
2117            top: infos.top + "px"
2118          }
2119        }
2120        return myDebug;
2121
2122      } else {
2123        if (typeof old_messages == "undefined") {
2124          old_messages = new Array();
2125
2126        }
2127        if (infos != "" && infos != "undefined") {
2128          nc0 = old_messages[index] || "";
2129          if (typeof nc0 != "undefined") {
2130            nc0 = nc0.toString().split("<br />");
2131            if (nc0.length > 4) nc0.shift();
2132            old_messages[index] = nc0.join("<br />");
2133          }
2134          old_messages[index] += "" + Nom_str + "->" + infos + "<br />";
2135          message = old_messages[index];
2136          colors = Array('black', 'white', 'white', 'white', 'white', 'white', 'red');
2137          myDebug = { id: "Debug" + index, texte: message,
2138            css: { display: "block",
2139              color: colors[index - 1],
2140              opacity: "1",
2141              position: "absolute",
2142              align: "left",
2143              height: 80 + "px",
2144              width: width_g + "px",
2145              left: ((index - 1) * width_g) + "px",
2146              border: "solid 1px green",
2147              top: 0 + "px"
2148            }
2149          }
2150          return myDebug;
2151        }
2152      }
2153
2154
2155    } //Debug_info
2156    //====================================================
2157    affiche_debug = function (aff_infos) {
2158      jQuery(jQuery("[id ^='Debug']")).each(function (i) {
2159        if (aff_infos[this.id]) {
2160          if (aff_infos[this.id].css) {
2161            jQuery("#" + this.id).css(aff_infos[this.id].css);
2162            jQuery("#" + this.id).html(aff_infos[this.id].texte);
2163          }
2164        }
2165      });
2166      return;
2167    }
2168    //___________ affiche_debug ____
2169    //====================================================
2170    function Debug_pos() {
2171      return;
2172      if (DEBUG_autosize.match("true", gi)) {
2173
2174        jQuery("[id ^='Debug']").show();
2175        /*
2176        Debug2  background-color:yellow
2177        Debug3 background-color:blue
2178        Debug4 background-color:green
2179        Debug5 background-color:red
2180
2181        */
2182
2183        affiche_debug({
2184          Debug5: Debug_info(5, infos_theMainImage, "infos_theMainImage")
2185        });
2186      }
2187    } // Debug_pos
2188    //==========================================================
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198  });                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      // ready
2199
2200
2201  jQuery("#derivativeSwitchBox a").click(function (e) {
2202    k1 = 0;
2203  });
Note: See TracBrowser for help on using the repository browser.