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

Last change on this file since 18735 was 18735, checked in by cljosse, 12 years ago

[extensions] Autosize fix compatibility with 2.4 (option marge bottom)

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