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

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

[extensions] Autosize fix compatibility with 2.4 (charlie's,Embedded Videos)

File size: 72.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    *  Get COOKIE
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        //'fb - xfbml - like - button
132        objs = jQuery("#theImage" + " div").get(0);
133        if (jQuery(objs).length > 0) {
134          id_0 = jQuery(objs).attr("id");
135          if (id_0 == "") {
136            jQuery(objs).attr("id", "charlie");
137          } else {
138            if (nbf > 1) {
139              jQuery(frm1).attr("id", "charlie");
140            } else {
141              //  Type_Img = "img";
142            }
143          }
144        } else {
145          jQuery(frm1).attr("id", "iframe");
146          jQuery(frm1).wrap('<div id="' + "theMainImage" + '" style="border:1px solid Transparent" />');
147        }
148
149
150      } else if (jQuery("#theImage").find("img").length > 0) {
151        Type_Img = "img";
152      } else if (jQuery("#theImage" + "Box").find("img").length > 0) {
153        Type_Img = "img";
154        Parent = Parent + "Box";
155      } else if (jQuery("img").length > 0) {
156        Type_Img = "img_autre";
157        return;
158      } else {
159        return;
160      }
161    }
162    //____________________ Get_type_img _____________________________
163
164    //====================================
165    //  set_cl
166    //====================================
167    set_cl = function (Valid) {
168      if (typeof Valid == "undefined") Valid = options.pictureSelType.match(RegExp("Autosize", "gi")) || false;
169      if (typeof options.cl_visible == "undefined") return;
170      if (typeof src1 == "undefined") return;
171      if (options.cl_visible) src = src1;
172      else src = src2;
173
174      if (typeof options.pictureSelType != "undefined" && (options.pictureSelType == "Autosize" || options.pictureSelType == "SelMaxi")) {
175        if (options.pictureSelType == "SelMaxi") src = src6;
176      } else {
177        Valid = false;
178        src = src2;
179        jQuery("#bp_cla span").text("");
180      }
181      if (options.cl_visible) {
182        src_info = src3;
183        src_infos_1 = src3;
184      } else {
185        src_info = src4;
186        src_infos_1 = src5;
187      }
188      src_info = options.pictureDeriv;
189      if (!Valid) {
190        Zone_image.image.height = Zone_image.image_init.height;
191        Zone_image.image.width = Zone_image.image_init.width;
192
193      }
194      if ((typeof Zone_image != "undefined") && typeof Zone_image.image != "undefined") {
195        Zone_image.zoom = (Zone_image.image.height / Zone_image.image_init.height);
196        zoom_cl = parseInt(100 * Zone_image.zoom) + "%"; ;
197        if (!Valid) {
198          if (options.pictureSelType == "SelMaxi")
199            zoom_cl = options.pictureSelType + " [" + options.pictureDeriv + "]";
200          else {
201            zoom_cl = "";
202            src_info = options.pictureDeriv;
203          }
204        }
205        jQuery('#bp_cla').attr('alt', src_info);
206        jQuery('#bp_cla').attr('title', src_info);
207        jQuery('#bp_cla').attr('Stitle', src_info);
208        jQuery('#bp_cla').attr('Stip', zoom_cl);
209        r = { width: jQuery("#theMainImage").width(), height: jQuery("#theMainImage").height(),
210          rap: jQuery("#theMainImage").width() / jQuery("#theMainImage").height(),
211          rap_init: Zone_image.image_init.rapport
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__llbgo
254    *********************************/
255    Set_llbgo = function (Force) {
256
257      if (options.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
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
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    // REPONSE ACTION
569    //=============================================================
570    theMainImage_st = false;
571    jQuery("#reset").click(function () {
572      location.reload();
573    });
574
575
576    //===========================================================
577    //  REPONSE TRIGGER
578    //===========================================================
579    jQuery('#ret_autosize').live('ON', function (e) {
580      if (nu_img == "") nu_img = 8;
581      jQuery(jQuery('.debug').get(nu_img)).trigger('ON');
582
583    });
584
585    //==========================================================
586    jQuery("map area").mouseover(function (e) {
587      try {
588        nok = theImg.useMap;
589        hok = this;
590      }
591      catch (r) {
592
593      }
594    });
595
596    //==================================
597    // jQuery("#llgbo").trigger("ON");
598    //==================================
599    jQuery(llgbo_id).live('ON', function (e) {
600      n_id = this;
601      infos_llgbo = jQuery(llgbo_id).infos();
602      if (infos_llgbo.visible == false) return;
603
604      marges_llgbo = 0;
605      if (infos_llgbo.height > 0) {
606        infos_llgboframe1 = jQuery(llgbo_id + " div:last").infos();
607        infos_llgboframe31 = jQuery(llgbo_id + "  div:first").infos();
608        //=============================================
609        ll2 = infos_llgboframe1.width; // llgboframe1 interieur
610        ll1 = infos_llgboframe31.exterieur.width; // llgboframe31 avec border width
611        options.marges_llgbo = (ll1 - ll2);
612        infos_llgboh2 = jQuery("#llgboh2").infos();
613      }
614    });
615    //==============================
616    // jQuery("#mapPicture").trigger("ON");
617    //==============================
618    jQuery("#mapPicture").live('ON', function (e) {
619      p2 = jQuery("#infoSwitcher").infos();
620    });
621    //==============================
622    // jQuery("#map").trigger("ON");
623    //==============================
624    jQuery("#map").live('ON', function (e) {
625      p2 = jQuery("#map").infos();
626    });
627    //===================================
628    // jQuery("#theImage").trigger("ON");
629    //===================================
630    jQuery("#imageInfos").live('on', function (e) {
631      target = e.target.id;
632    });
633
634    //===================================
635    // jQuery("#theImage").trigger("ON");
636    //===================================
637    jQuery("#theImage").live('ON', function (e) {
638      target = e.target.id;
639
640      id = this.id;
641      Select_Image(); //+calcul
642    });
643
644
645
646
647    //=================================================================
648    jQuery(document).live('gallyInterfaceReady', function (e) {
649      i = jQuery(this).text();
650      jQuery(this).trigger('ON');
651    }
652
653          );
654
655
656    /*********************************
657    *
658    ********************************/
659    var old_width;
660
661    jQuery("#theImage").resize(function (e) {
662
663    });
664
665
666
667    jQuery("#menuSwitcher,#infoSwitcher").click(function (e) {
668      options.set_sw = this.id;
669      setTimeout(function () { div_resize() }, 10);
670      nu_img = 0;
671    });
672
673    div_resize = function (i) {
674
675      jQuery("#theImage").trigger("resize");
676      /*
677      if (jQuery("#theImage").width() != old_width) {
678      setTimeout(function () { div_resize() }, 10);
679      }
680      */
681    }
682    //===========================================
683    // jQuery("#theImageAndInfos").trigger("ON");
684    //===========================================
685    jQuery("#theImageAndInfos").live('ON', function (e) {
686      infos_theImageAndInfos = jQuery("#theImageAndInfos").infos();
687      //   setTimeout(function () { Autosize_resize(true) }, 100);
688      nu_img = 0;
689    }); // fin click #theImageAndInfos ON
690
691
692    jQuery("#theImageAndInfos").resize(function (e) {
693
694    });
695
696
697    jQuery("#linkAutosize").click(function (e) {
698      nu_img = 0;
699    });
700    //==================================
701    //
702    //===================================
703    jQuery('#derivativeCheckedAutosize').click(function () {
704      try {
705        pathnames = jQuery(this).attr("href").split(":");
706
707        //  eval(pathnames[1]);
708      } catch (e) {
709        n = false;
710      }
711    }); // fin click derivativeCheckedAutosize
712    //====================================================
713    if (typeof decode_href != 'function') {
714      function decode_href(myObj) {
715        href_path = jQuery(myObj).attr("href");
716        pt = href_path.split("(");
717        pt = pt[1].split(")");
718        pt = pt[0].replace(RegExp("'", "g"), "");
719        pt = pt.replace(RegExp(" ", "g"), "");
720        pt = pt.split(",");
721        source = pt[0];
722        pictureDeriv = pt[1];
723        pictureMap = pt[2];
724        if (pt.length > 3)
725          pictureSelType = pt[3];
726        else
727          pictureSelType = pt[1];
728
729        return { source: source,
730          pictureDeriv: pictureDeriv,
731          pictureMap: pictureMap,
732          pictureSelType: pictureSelType
733        }
734      }
735    }
736
737    jQuery("#derivativeSwitchBox a").click(function (e) {
738      retour = decode_href(this);
739      theImg = document.getElementById(theMainImage_id.replace("#", ""));
740      if (theImg) {
741        // options.pictureDeriv = retour.pictureDeriv;
742        options.pictureSelType = retour.pictureSelType;
743        options.pictureDeriv = retour.pictureDeriv;
744        options.pictureMap = retour.pictureDeriv;
745
746        if (this.name) {
747          options.pictureSelType = this.name;
748          n = Get_dimensions(true, options);
749        } else {
750        }
751
752        jQuery("#derivativeSwitchBox span").removeClass("auto_details linkAutosize");
753        jQuery("#derivativeSwitchBox a").removeClass("auto_details linkAutosize");
754        if (options.pictureSelType == "Autosize" || options.pictureSelType == "SelMaxi") {
755          spans = jQuery("#derivativeChecked" + options.pictureSelType).next();
756          spans.addClass("linkAutosize");
757          spans.find("span").addClass("auto_details");
758          jQuery(".auto_details").text("");
759        }
760        Autosize_resize(true, options);
761      }
762    });
763    //__________ fin click #derivativeSwitchBox a ____________
764
765    jQuery("input").click(function () {
766      if (this.name.match(RegExp("_enabled", "gi"))) {
767        sel = "[name*=" + this.name + "]";
768        obj = jQuery("tr" + sel);
769
770        if (this.checked)
771          obj.css({ backgroundColor: "green", color: "white" });
772        else
773          obj.css({ backgroundColor: "red", color: "white" });
774        return;
775      }
776      return;
777    });
778
779
780    //====================================
781    Autosize_init = function (name, value) {
782      img_defaut = { height: options.scaled_height, width: options.scaled_width };
783      img_reelle = { height: options.theImageHeight, width: options.theImageWidth };
784      img_init = { height: options.theImageHeight, width: options.theImageWidth };  // taille initiale
785
786      img_finale = img_init;
787
788      useMap = infos_theMainImage.useMap; // #mapmedium
789
790      useMap = options.pictureMap; // #mapxxx
791      pictureDeriv = options.pictureDeriv; //picturederiv xxx
792
793
794      old_img = options.imgSrc;
795      old_window_height = options.windowHeight || jQuery(window).height();
796      old_window_width = options.windowWidth || jQuery(window).width();
797      old_img_h = options.imgHeight;
798      old_img_w = options.imgWidth;
799      if (infos_theMainImage.visible == true) {
800        theImg = document.getElementById(theMainImage_id.replace("#", ""));
801        theImg.useMap = useMap;
802      }
803      fade_in = parseInt(options.fade_in || 0);
804
805    }
806    //____________________ Autosize_init _____________________
807
808    /***************************
809    * Autosize_resize
810    ***************************/
811    Autosize_resize = function (force, parametres) {
812      n = Get_dimensions(true, options);
813      if (n == false) return;
814      Save_cookies(options);
815      if (options.pictureSelType != "Autosize" && options.pictureSelType != "SelMaxi") {
816        /**/
817        jQuery(theImg).width(Zone_image.image_init.width);
818        jQuery(theImg).height(Zone_image.image_init.height);
819
820        set_cl("no");
821        Set_llbgo(true);
822        return;
823
824      }
825      infos_theImage = jQuery(theImage_id).infos(true);
826      if (typeof img_finale == "undefined") img_finale = { width: Zone_image.image.width, height: Zone_image.image.height };
827      if (img_finale.width && (img_finale.width != Zone_image.image.width || img_finale.height != Zone_image.image.height)) {
828        img_finale = { width: Zone_image.image.width, height: Zone_image.image.height };
829      }
830      r1 = Zone_image.image.width / Zone_image.image.height;
831      //======================================================
832
833      affiche_debug({
834
835        Debug1: Debug_info(1, "Cont:" + infos_theImage.width
836    + " X " + infos_theImage.height
837    + " IMG: " + img_finale.width
838    + " X " + img_finale.height
839    + " mgw : " + Zone_image.marges.width
840    , "->")
841      });
842
843      if (Type_Img == "pamoorama") {// img_finale.width
844        jQuery("#pamoorama").width(img_finale.width);
845        jQuery("#pamoorama").height(img_finale.height);
846
847
848        infos_pamoorama = jQuery("#pamoorama").infos({ absolute: true });
849
850        Set_Pamoorama({ width: img_finale.width, height: img_finale.height });
851        if (nopano)
852          if (window.myPamoorama.options.autoscrollOnLoad) {
853            window.myPamoorama.startAnimRight();
854          }
855
856        //jQuery(theMainImage_id).height(Zone_image.image.height);
857      } else {
858        if (options.imageAutosize == false)
859          if (options.pictureSelType == "Autosize" || options.pictureSelType == "SelMaxi") {
860            jQuery(theMainImage_id).height(Zone_image.image.height);
861            jQuery(theMainImage_id).width(Zone_image.image.width);
862
863          } else {
864            jQuery(theMainImage_id).width(Zone_image.image_init.width);
865            jQuery(theMainImage_id).height(Zone_image.image_init.height);
866          }
867
868
869          if (Type_Img == "charlie" || Type_Img == "iframe") {
870            jQuery("#" + "theMainImage_obj").attr("width",Zone_image.image.width);
871             jQuery("#" + "theMainImage_obj").attr("height",Zone_image.image.height);
872          jQuery("#" + Type_Img).attr("width",Zone_image.image.width);
873          jQuery("#" + Type_Img).attr("height",Zone_image.image.height);
874          swfobj = jQuery("#" + Type_Img).infos({ absolute: true });
875
876          //  jQuery("#" + Type_Img).attr({ height: Zone_image.image.height, width: Zone_image.image.width - 50 });
877          //  jQuery(theMainImage_obj).attr({ height: Zone_image.image.height, width: Zone_image.image.width - 50 });
878          //  jQuery(theMainImage_emb).attr({ height: Zone_image.image.height, width: Zone_image.image.width });
879
880        }
881
882
883      }
884
885      set_cl();
886      Set_llbgo(true);
887      return true;
888    };
889    //_________________Autosize ____________________________________   
890
891    /*****************
892    * changeImgSrc
893    ******************/
894    changeImgSrc = function (url, typeSave, typeMap, type) {
895      if (url) {
896        if (url.match(RegExp("i.php", "gi"))) {
897          urls = url.split("?");
898        }
899      }
900      url2 = jQuery("#theMainImage").attr("src");
901      if (typeof type != "undefined")
902        options.pictureSelType = type;
903      else {
904        options.pictureSelType = typeSave;
905        type = typeSave;
906
907      }
908      options.pictureDeriv = typeSave;
909      typeMap = typeSave;
910
911      jQuery('#derivativeSwitchBox .switchCheck').css('visibility', 'hidden');
912      if (typeof type != "undefined" && (type == "Autosize" || type == "SelMaxi")) {
913        jQuery('#derivativeChecked' + type).css('visibility', 'visible');
914        document.cookie = 'picture_sel_type=' + type + ';path=' + COOKIE_PATH;
915      } else {
916
917        jQuery('#derivativeChecked' + typeSave).css('visibility', 'visible');
918        document.cookie = 'picture_sel_type=' + typeSave + ';path=' + COOKIE_PATH;
919      }
920      options.pictureMap = typeMap;
921      options.pictureDeriv = typeSave;
922      document.cookie = 'picture_deriv=' + typeSave + ';path=' + COOKIE_PATH;
923
924
925
926      jQuery("#theMainImage").removeAttr("width height").attr("src", url)
927      .load(function (i) {
928        if (!init_img(this)) {
929          return;
930        }
931        //=======================================================================   
932
933      })
934      .live("ON", function (e) {
935        theMainImage_st = this.complete;
936        imgsrc = this.src;
937        // alert(this.src + ' Image does not exist !!');
938      }).error(function (i) {
939        imgsrc = this.src;
940      });
941      /***********************
942      *
943      **********************/
944      jQuery("#theMainImage," + theMainImage_id + ",.preload, .next1 , ")
945         .error(function (e) {
946           if (!this.complete) {
947             // le fichier n'est pas present
948             src = jQuery(this).attr("src").replace("./_data/i/", "", 1);
949             src = this.src.split("/_data/i")[1];
950             url = 'i.php?' + src + "&ajaxload=true";
951             jQuery(theMainImage_id).attr("src", url);
952             /*
953             jQuery.ajax({
954             type: 'GET',
955             url: 'i.php?' + src + "&ajaxload=true",
956             dataType: 'json',
957             success: (function (data) {
958             j = data.url;
959             //  jQuery(theMainImage_id).attr("src", data.url);
960
961             })
962
963             });
964             */
965
966
967
968           }
969
970         })
971         .bind("Finish", function (e, data) {
972           if (typeof imageInfos_id == "undefined") return;
973
974         })
975          .bind("ON", function (e, data) {
976            if (data.status != "ok") {
977              popup = jQuery(".errors");
978              if (popup.length == 0) {
979                jQuery("#theImage").append("<div class='errors'><span></span></div>");
980              }
981              jQuery(".errors").text("Erreur : [" + data.done + "] " + data.responseText);
982              jQuery(".errors").show().delay(10000).hide(2000);
983              return;
984            }
985            if (data.src) {
986              if (typeof imageInfos_id == "undefined") return;
987              if (options.pictureDeriv == "Original" && data.src.match(RegExp("\-.." + ".jpg", "gi"))) {
988                Autosize_resize(true, options);
989              } else if (data.src.match(RegExp(options.pictureDeriv.substr(0, 2) + ".jpg", "gi"))) {
990                Autosize_resize(true, options);
991              } else {
992
993              }
994            }
995          });
996      //_________ theMainImage  ___________
997
998
999      document.cookie = 'picture_deriv=' + typeSave + ';path=' + COOKIE_PATH;
1000    }
1001
1002    //__________________ changeImgSrc ______________________
1003
1004    /*****************************
1005    *      pamoorama
1006    ******************************/
1007
1008    jQuery("#pamoorama").bind("on", function () { alert($(this).text()); });
1009    jQuery("#pamoorama").bind("on", function (e) {
1010      myPamoorama = window.myPamoorama;
1011    });
1012    jQuery("#pamoorama_inner").live("on", function (e) {
1013      myPamoorama = window.myPamoorama;
1014    });
1015    jQuery('#pamoorama').live('ON', function (e) {
1016      jQuery(jQuery('.debug').get(1)).trigger('ON');
1017      Autosize_resize(true, options);
1018    });
1019
1020    //===============================================
1021    // jQuery("#theImage").trigger("Start_right");
1022    //===============================================
1023    jQuery("#theImage").live('Start_right', function (e) {
1024      if (typeof Zone_image == "undefined") return
1025      test_w = window.myPamoorama.autoSlideFx.to;
1026      test_w = window.myPamoorama.autoScrollFx.to;
1027      nf = jQuery("#pamoorama_thumb").height();
1028      jQuery("#pamoorama_thumb img").width(200);
1029      jQuery("#pamoorama_thumb img").height(nf);
1030      // 200=window.myPamoorama.imageWidth
1031      // frame = Zone_image.container.width
1032      nw = (200 * Zone_image.image.width) / window.myPamoorama.imageWidth;
1033      jQuery("#pamoorama_frame").width(nw);
1034    });
1035    //===============================================
1036    // jQuery("#theImage").trigger("Start_left");
1037    //===============================================
1038    jQuery("#theImage").live('Start_left', function (e) {
1039      if (typeof Zone_image == "undefined") return
1040      jQuery("#theImage").show(0);
1041      window.myPamoorama.autoSlideFx.to = 0;
1042      test_w = window.myPamoorama.autoSlideFx.to;
1043      test_w = window.myPamoorama.autoScrollFx.to;
1044      nf = jQuery("#pamoorama_thumb").height();
1045      jQuery("#pamoorama_thumb img").width(200);
1046      jQuery("#pamoorama_thumb img").height(nf);
1047    });
1048
1049    /************************************
1050    * Wait_pamoorama
1051    ************************************/
1052    Wait_pamoorama = function () {
1053      if (Type_Img != "pamoorama") return;
1054      tempo = 0;
1055      Wait_pamoorama_st = false;
1056
1057
1058      while (Wait_pamoorama_st == false) {
1059        Wait_pamoorama_st = Wait_pamoorama_time();
1060        jQuery.noop();
1061      }
1062      tempo = 0;
1063      if (nopano) {
1064        if (window.myPamoorama.options.autoscrollOnLoad) {
1065          window.myPamoorama.startAnimRight();
1066          jQuery.delay(100);
1067        }
1068
1069
1070
1071      }
1072
1073    }
1074    //__________________ Wait_pamoorama ______________________
1075    jQuery(".pwg-icon-clock-minus, .pwg-icon-clock-plus").click(function (i) {
1076
1077
1078
1079
1080
1081    }).mouseover(function (i) {
1082
1083    })
1084
1085
1086    Wait_pamoorama_time = function () {
1087      if (nopano == true) return true;
1088
1089
1090
1091      if (jQuery("#pamoorama").length) {
1092        tempo = tempo + 1;
1093
1094        mypanorama = window.myPamoorama;
1095        if (!mypanorama) {
1096          if (tempo > 500) return true;
1097          setTimeout("Wait_pamoorama_time()", 500);
1098          return false;
1099
1100        }
1101
1102        if (mypanorama.skipInit == false) {
1103          if (tempo > 500) return true;
1104          setTimeout("Wait_pamoorama_time()", 500);
1105          return false;
1106        }
1107        //=============================================================
1108        if (Math.abs(mypanorama.imageHeight) < 100) {
1109          setTimeout("Wait_pamoorama_time()", 500);
1110          return false;
1111        }
1112
1113        if (jQuery(".infos").length > 0) {
1114          jQuery(".infos").empty();
1115          jQuery(".infos").hide();
1116        }
1117
1118        nopano = true;
1119
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 || vn[0] == "Original") {
1268            maxi_size = size_derive;
1269            maxi_size.idx = n;
1270            return false
1271          }
1272
1273          if (vn[0] != "square" && vn[0] != "thumb" && vn[0] != "SelMaxi" && vn[0] != "Autosize") {
1274            if (size_derive.h > size_encours.h) {
1275              if (maxi_size.idx < 0) {
1276                maxi_size = size_derive;
1277                maxi_size.idx = n;
1278                if (options.pictureSelType == "SelMaxi" || options.pictureSelType == "Autosize")
1279                  return false
1280              }
1281            }
1282            if (size_derive.h < size_encours.h && size_derive.h > 10) {
1283              mini_size = size_derive;
1284              mini_size.idx = n;
1285            }
1286          }
1287          n++;
1288        });
1289
1290
1291
1292
1293        n = maxi_size.idx;
1294        if (n < 0) {
1295          n = mini_size.idx;
1296        }
1297        if (options.pictureSelType.match(RegExp("SelMaxi", "gi"))) {
1298          n = mini_size.idx;
1299
1300        }
1301        if (options.pictureSelType.match(RegExp("Autosize", "gi"))) {
1302
1303        }
1304
1305        pictureDeriv = pt[n][0];
1306        last_id = pt[n][0];
1307        jQuery(".switchCheck").each(function (i) {
1308
1309          if (!this.id.match(RegExp("Original", "gi"))) {
1310            if (this.id.match(RegExp("SelMaxi", "gi"))) return false;
1311            last_id = this.id.replace("derivativeChecked", "");
1312          }
1313          if (last_id.match(RegExp(pictureDeriv, "gi"))) return false;
1314        });
1315
1316        options.pictureDeriv = last_id;
1317
1318        return { url: pt[n][1], pictureDeriv: last_id, pictureMap: last_id, width: pt[n][2], height: pt[n][3] };
1319      }
1320      return { imgSrc: "", pictureDeriv: "", width: "", height: "" };
1321    }
1322    //_______________ Get_Maxi ______
1323
1324    /********************
1325    *
1326    ********************/
1327    Select_Image = function () {
1328      var pt = options.liste_type;
1329
1330
1331      if (pt.length > 0) {
1332        //===== calcul Image ===
1333        if (typeof imageInfos_id == "undefined") return;
1334        Calcul_Image();
1335        options.theImageMargeZone = Zone_image.marges;
1336        if (Type_Img != 'charlie') {
1337          /*
1338          if (options.pictureSelType != "SelMaxi" && options.pictureSelType != "Autosize") {
1339          options.pictureMap = options.pictureDeriv;
1340           
1341          imgSrc = options.liste_type[6];
1342          changeImgSrc(imgSrc, options.pictureDeriv, options.pictureMap, options.pictureSelType);
1343          src = theImg.src;
1344          return;
1345          } else {
1346          IMg = Get_Maxi(Zone_image.image);
1347          }
1348          */
1349          IMg = Get_Maxi(Zone_image.image);
1350          imgSrc = IMg.url;
1351          if (options.imgSrc.match(RegExp(imgSrc, "gi")))
1352            options.imgSrc = imgSrc;
1353
1354          img_width = IMg.width;
1355          img_height = IMg.height;
1356
1357          Zone_image.image_init = { height: IMg.height,
1358            width: IMg.width,
1359            rapport: IMg.width / IMg.height
1360
1361          };
1362          if (typeof Zone_image.image == "undefined")
1363            Zone_image.image = { height: IMg.height,
1364              width: IMg.width,
1365              rapport: IMg.width / IMg.height
1366
1367            };
1368        } else {
1369          return;
1370        }
1371        Zone_image.zoom = Zone_image.image.height / Zone_image.image_init.height;
1372        if (typeof Zone_image.src == "undefined") Zone_image.src = " ";
1373
1374        identique = Zone_image.src.match(RegExp(imgSrc, "gi"));
1375        if (identique) return;
1376        href_path = "javascript:changeImgSrc('" + imgSrc + IMg.pictureDeriv + "', '" + "', '" + IMg.pictureMap + "', '" + options.pictureSelType + "')";
1377        jQuery(".linkAutosize").attr("href", href_path);
1378        theImg = document.getElementById(theMainImage_id.replace("#", ""));
1379
1380        if ((theImg == null) || theImg.tagName != "IMG") {
1381          imgSrc_i = jQuery(theImg).css("backgroundImage");
1382          imgSrc_j = jQuery(theImg).css("background-image");
1383          return;
1384        } else {
1385          last_id = IMg.pictureDeriv;
1386          changeImgSrc(imgSrc, last_id, IMg.pictureMap, options.pictureSelType);
1387        }
1388
1389        theImg.useMap = "#map" + IMg.pictureMap;
1390        return true;
1391
1392
1393        theImg = document.getElementById(theMainImage_id.replace("#", ""));
1394        if (init_img(theImg)) {
1395
1396          return true;
1397        }
1398        return false;
1399
1400      } else {
1401
1402
1403        return false;
1404      }
1405
1406
1407    };  //_______________ Select_Image ______
1408
1409
1410    /*************************************************
1411    * correction pamoorama
1412    *************************************************/
1413
1414    Set_Pamoorama = function (Format) {
1415      myPamoorama = window.myPamoorama;
1416      if (Type_Img == "pamoorama") {
1417
1418        if (!nopano) {
1419          theMainImage_Id = "#pamoorama";
1420          nopano = false;
1421          Wait_pamoorama();
1422          infos_theMainImage = jQuery(theMainImage_Id).infos();
1423          //theMainImage_Id = "#pamoorama";
1424        }
1425
1426
1427        if (typeof myPamoorama == "undefined") {
1428          return;
1429        }
1430        //========================================================= 
1431        if (!nopano) {
1432          //theMainImage_Id = "#pamoorama";
1433          nopano = false;
1434          Wait_pamoorama();
1435          infos_theMainImage = jQuery(theMainImage_Id).infos();
1436          //theMainImage_Id = "#pamoorama";
1437        }
1438
1439
1440        infos_pamoorama_outter = jQuery("#pamoorama_outter").infos({ absolute: true });
1441        infos_pamoorama_inner = jQuery("#pamoorama_inner").infos({ absolute: true });
1442        infos_pamoorama_frame = jQuery("#pamoorama_frame").infos({ absolute: true });
1443        infos_frame = jQuery(myPamoorama.frame).infos({ absolute: true });
1444
1445
1446        //====================================================
1447        marges_w = infos_pamoorama.general.marges.width;
1448        marges_h = infos_pamoorama.general.marges.height;
1449
1450        jQuery("#pamoorama_footer").css({
1451          width: Format.width + "px"
1452        });
1453        infos_pamoorama_footer = jQuery("#pamoorama_footer").infos();
1454        marges_h += infos_pamoorama_footer.general.height;
1455        outter_height = Format.height;
1456
1457        Zoom_pano = (Format.height - marges_h) / Zone_image.image_init.height;
1458        new_image = { height: Math.ceil(Zone_image.image_init.height * Zoom_pano),
1459          width: Math.ceil(Zone_image.image_init.width * Zoom_pano)
1460        }
1461
1462        jQuery("#pamoorama_inner").css({
1463          width: new_image.width + "px", height: new_image.height + "px", "background-size": "100%"
1464        });
1465        //---------- test largeur image
1466        new_width = Format.width - (options.marge_right + options.marge_left);
1467
1468        if (new_width > new_image.width) {
1469          new_width = new_image.width;
1470          jQuery("#pamoorama_outter").css({
1471
1472            align: "center",
1473            margin: "0"
1474          });
1475        }
1476        outter_width = new_width;
1477
1478        jQuery("#pamoorama_outter").css({
1479          align: 'center',
1480          margin: 'auto',
1481          width: outter_width + "px",
1482          height: Format.height - marges_h + "px"
1483        });
1484        //============= Mise à l'echelle ==================
1485        window.myPamoorama.options.width = Math.ceil(Format.width);
1486        //==================================================================
1487        new_max_left = new_image.width - outter_width;
1488        if (!window.myPamoorama.outter) return;
1489        window.myPamoorama.outter.scrollTo(new_max_left, 0);
1490
1491        if (typeof window.myPamoorama.autoScrollFx != "undefined") window.myPamoorama.autoScrollFx.to = new Array(new_max_left, 0);
1492        window.myPamoorama.ratio = Math.ceil(new_image.width / 200);
1493        window.myPamoorama.imageWidth = new_image.width;
1494        window.myPamoorama.imageHeight = new_image.height;
1495        nf = jQuery("#pamoorama_thumb").height();
1496        jQuery("#pamoorama_thumb img").width(180);
1497        jQuery("#pamoorama_thumb img").height(nf);
1498
1499        jQuery("#pamoorama_thumb").css({
1500          /*   position: "absolute", */
1501          left: (Format.width - 215) + "px"
1502
1503        });
1504        jQuery("#pamoorama_thumb img").css({
1505
1506        });
1507        // 200=window.myPamoorama.width
1508        // frame = Zone_image.container.width
1509
1510        nw = (window.myPamoorama.image.width * Format.width) / window.myPamoorama.imageWidth;
1511        jQuery("#pamoorama_frame").width(nw);
1512
1513
1514      } // 
1515    } // Set_Pamoorama
1516
1517    /*********************************************************/
1518
1519    Toggle_bp = function () {
1520      options.cl_visible = !options.cl_visible;
1521      Autosize_resize();
1522      Wait_Affichage();
1523
1524    }
1525
1526    //====================================
1527    //
1528    //====================================
1529    Calcul_Image = function () {
1530
1531      /****************************************/
1532      if (typeof imageInfos_id == "undefined") return;
1533      infos_imageInfos = jQuery(imageInfos_id).infos({ absolute: true });             // information
1534      infos_theMainImage = jQuery(theMainImage_id).infos({ absolute: true });         // Image   
1535      // commentContent
1536      // copyright
1537
1538
1539
1540      pos_top = options.pos_top;
1541      //    pos_top = infos_theImage.top;
1542
1543      pos = jQuery(theImage_id).offset();
1544      infos_theImage = jQuery(theImage_id).infos(true);   // container
1545      infos_window = jQuery(window).infos(true);   // window
1546      w = infos_theImage.general.marges.width
1547
1548      container = {
1549        height: infos_window.height - options.theImageTop,
1550        width: infos_window.width - options.theImageLeft - options.theImageRight
1551      }
1552      marge_left = options.marge_left | 0;
1553      marge_right = options.marge_right | 0;
1554      marge_top = options.marge_top | 0;
1555      marge_bottom = options.marge_bottom | 0;
1556
1557      //==========================================================
1558      if (test_theme("stripped")) {
1559        infos_the_page.margin.left = 20;  //taille fleche
1560        infos_the_page.margin.right = 20;
1561      }
1562
1563
1564      if (test_theme("elegant")) {
1565
1566        if (infos_imageInfos.visible == true) {
1567          //  marge_right += infos_imageInfos.general.width; ;
1568
1569        } else {
1570          marge_right += 0;
1571
1572        }
1573        marge_right += 1;
1574        marge_left += 1;
1575
1576      } else if (test_theme("stripped")) {
1577
1578      } else if (test_theme("simple")) {
1579
1580
1581
1582      } else if (test_theme("OS")) {
1583
1584      } else if (test_theme("pur")) {
1585        marge_right += 0;
1586        // marge_right += 25;
1587      } else if (test_theme("mont")) {
1588        marge_right += 0;
1589
1590        // marge_right += 25;
1591
1592
1593      } else {
1594
1595
1596
1597      }
1598
1599
1600      retrait_img = {};
1601      //========== Format Image ============== 
1602      retrait_img.height = Math.ceil(options.marges_llgbo || 0)
1603      + Math.ceil(infos_theMainImage.general.marges.height);
1604      retrait_img.height += 2;
1605
1606
1607      //===============================================================
1608      retrait_img.width = Math.ceil(infos_theMainImage.general.marges.width); // borderwidth+padding
1609      retrait_img.width = Math.ceil(infos_theImage.general.marges.width); // borderwidth+padding
1610      retrait_img.width += Math.ceil(options.marges_llgbo || 0);
1611      retrait_img.width += 2;
1612      if (!options.check_desc_v)
1613        marge_bottom = 0;
1614
1615      //================== Limite Format Image =====================
1616      container.height_interne = container.height - marge_top - marge_bottom;
1617      container.width_interne = container.width - marge_left - marge_right;
1618
1619      container.height_interne = Math.max(container.height_interne, Math.ceil(options.mini_height) + retrait_img.height),
1620      container.width_interne = Math.max(container.width_interne, Math.ceil(options.mini_width) + retrait_img.width)
1621
1622
1623      image_max = {
1624        height: (container.height_interne - retrait_img.height),
1625        width: (container.width_interne - retrait_img.width)
1626      }
1627      //=========================
1628      // test débordement
1629      //=========================
1630      height_theMainImage = Math.ceil(image_max.height);
1631      width_theMainImage = Math.ceil(image_max.width);
1632
1633      if (typeof Zone_image.image_init.rapport == "undefined") {
1634        Zone_image.image_init.rapport = options.ratio;
1635      }
1636      if (Type_Img == "charlie") {
1637
1638      } else if (Type_Img == "pamoorama") {
1639        if (height_theMainImage > container.height_interne) {
1640          n = options.pictureSelType;
1641        }
1642      } else {
1643
1644        height_theMainImage = Math.ceil(width_theMainImage / options.ratio);
1645
1646
1647
1648        if (height_theMainImage > container.height_interne) {
1649          image_max.height = container.height_interne;
1650          image_max.width = image_max.height * Zone_image.image_init.rapport;
1651          width_theMainImage = Math.ceil(image_max.width);
1652          height_theMainImage = Math.ceil(image_max.height);
1653        }
1654        if (width_theMainImage > container.width_interne) {
1655          image_max.width = container.width_interne;
1656          image_max.height = image_max.width / Zone_image.image_init.rapport;
1657          width_theMainImage = Math.ceil(image_max.width);
1658          height_theMainImage = Math.ceil(image_max.height);
1659
1660        } else if (width_theMainImage > container.width) {
1661
1662        } else {
1663
1664        }
1665      }
1666      //=================================================================
1667      Zone_image.image = {
1668        width: width_theMainImage,
1669        height: height_theMainImage,
1670        rapport: width_theMainImage / height_theMainImage
1671      };
1672      Zone_image.marges = { width: marge_left + marge_right + retrait_img.width,
1673        height: marge_top + marge_bottom + retrait_img.height
1674      }
1675      Zone_image.src = jQuery(theMainImage_id).attr("src");
1676    }
1677
1678    /*********************************************
1679    * Calcul les dimensions.
1680    *********************************************/
1681    Get_dimensions = function (force, parametres) {
1682      new_img = jQuery(theMainImage_id).infos({ absolute: true });
1683      new_dim = jQuery(theImage_id).infos({ absolute: true });
1684      new_win = jQuery(window).infos({ absolute: true }); // avec ascenseur   
1685      options.theImageTop = new_dim.top;
1686      options.theImageLeft = new_dim.left;
1687      options.theImageRight = (new_win.width - new_dim.right);
1688      options.marge_bottom = Math.ceil(new_dim.out.bottom - new_img.out.bottom);
1689      if (Type_Img == "iframe") { }
1690      new_dim.out.bottom = new_win.height - options.marge_bottom;
1691
1692      options.theImageBottom = new_win.height - new_dim.out.bottom;
1693      options.marge_top = Math.ceil(new_img.top - new_dim.top);
1694
1695      if (options.theImageBottom < 0) {
1696        options.theImageBottom = 0;
1697      }
1698      options.theImageWidth = new_win.width - options.theImageLeft - options.theImageRight;
1699      options.theImageHeight = new_win.height - options.marge_top - options.theImageBottom - options.theImageTop;
1700      var chk = eval("options." + user_status + "_enabled");
1701      if (chk == "") { return; }
1702
1703      if (Type_Img != "map" && Type_Img != "iframe")
1704        Select_Image();
1705      infos_theMainImage = jQuery(theMainImage_id).infos({ absolute: true });
1706      Zone_image.src = infos_theMainImage.src;
1707      useMap = options.pictureSelType;
1708      /*
1709      if (useMap) {
1710      if (!useMap.match(RegExp("Autosize", "gi"))) {
1711      if (typeof img_height != "undefined") {
1712      jQuery(theImg).height(img_height);
1713      jQuery(theImg).width(img_width);
1714      }
1715      return;
1716      }
1717      }
1718
1719      if (options.imageAutosize) {
1720      return true; //stripped
1721      }
1722
1723      if (typeof options.cl_visible == "undefined") return;
1724      if (!options.cl_visible == true) { return; }
1725      */
1726
1727      //=================================================================
1728      switch (Type_Img) {
1729        case "map":
1730          if (Set_Map(true)) return false;
1731          break
1732        case "panorama":
1733          if (!theMainImage_id) {
1734
1735          }
1736          infos_theImage = jQuery(theMainImage_id).infos();
1737          infos_the_page = jQuery("#the_page").infos();
1738          img_finale.height = infos_theImage.height;
1739          break
1740        case "img":
1741
1742
1743
1744
1745
1746          break
1747        case "img_autre":
1748          if (!theMainImage_id) {
1749            if (DEBUG_autosize.match("true", gi)) alert("The_MainImage=null");
1750            return;
1751
1752          }
1753
1754          infos_the_page = jQuery("#the_page").infos();
1755
1756
1757          break
1758        case "embed":
1759          //
1760          if (infos_theMainImage.width == 0)
1761            infos_theMainImage = jQuery("#thePicturePage").infos();
1762          if (infos_theMainImage.width == 0)
1763            infos_theMainImage = jQuery("#the_page").infos();
1764
1765
1766          iph1 = jQuery("#theImage div").infos();
1767
1768          break
1769        case "charlie":
1770
1771          break
1772
1773        case "iframe":
1774          Zone_image.image.width = options.theImageWidth;
1775          Zone_image.image.height = options.theImageHeight;
1776          Zone_image.zoom = 1;
1777          break
1778        case "pamoorama":
1779          Wait_pamoorama();
1780          break
1781      }
1782
1783
1784
1785      //=================================================
1786      if (Zone_image.image.height < options.mini_height2) {
1787        Zone_image.image.height = parseInt(options.mini_height2);
1788        Zone_image.image.width = Math.ceil(Zone_image.image.height * Zone_image.image_init.rapport);
1789      }
1790      if (Zone_image.image.width < options.mini_width2) {
1791        Zone_image.image.width = parseInt(options.mini_width2);
1792        Zone_image.image.height = Math.ceil(Zone_image.image.width / Zone_image.image_init.rapport);
1793      }
1794      //==================================================
1795      //   ImageWidthidth largeur à atteindre
1796      //   Calcul du rapport d'agrandissement
1797
1798      echelle_max = parseFloat(options.echelle_max, '3');
1799      if (Zone_image.zoom > echelle_max) {
1800        Zone_image.zoom = echelle_max;
1801        Zone_image.image.width = parseInt(Zone_image.image_init.width * Zone_image.zoom);
1802        if (Zone_image.image_init.rapport > 0)
1803          Zone_image.image.height = parseInt(Zone_image.image_init.width / Zone_image.image_init.rapport);
1804      }
1805      if (Type_Img != "pamoorama") {
1806        mxi = Math.ceil(Zone_image.image.height + Zone_image.marges.height);
1807        Zone_image.container.height = Math.max(Zone_image.container.height, mxi);
1808      }
1809      img_finale = { width: Zone_image.image.width, height: Zone_image.image.height };
1810      return true;
1811    }
1812    //________________ Get_dimensions ___________________
1813
1814
1815    /*****************************
1816    *  init_gen
1817    *****************************/
1818    init_gen = function (e) {
1819      theImg = document.getElementById(theMainImage_id.replace("#", ""));
1820      //==================================================
1821      marges_llgbo = 0;
1822      options.marges_llgbo = 0;
1823      if (jQuery(llgbo_id).length > 0) {
1824        infos_llgbo = jQuery(llgbo_id).infos(true);
1825        if (infos_llgbo.visible == true) {
1826          if (infos_llgbo.height > 0) {
1827            infos_llgboframe1 = jQuery(llgbo_id + " div:last").infos();
1828            infos_llgboframe31 = jQuery(llgbo_id + "  div:first").infos();
1829            //=============================================
1830            ll2 = infos_llgboframe1.width; // llgboframe1
1831            ll1 = infos_llgboframe31.general.width; // llgboframe31
1832            options.marges_llgbo = (ll1 - ll2);
1833            infos_llgboh2 = jQuery("#llgboh2").infos();
1834          }
1835        }
1836
1837        marges_llgbo = options.marges_llgbo;
1838      }
1839
1840      //========= Récupération des informations ============= 
1841
1842      options.marge_top = 0;
1843      pAll = jQuery(llgbo_id).absoluteAll({ absolute: true });
1844      infos_llgbo.top = pAll.Top;
1845      infos_llgbo.bottom = pAll.Bottom;
1846      pAll = jQuery(theMainImage_id).absoluteAll({ absolute: true });
1847      pos_top = pAll.Top; ;
1848      pos_bottom = pAll.Bottom; ;
1849
1850      if (infos_llgbo.top > 0) {
1851        pos_top = infos_llgbo.top;
1852
1853        options.marge_top = infos_theMainImage.top - infos_theImage.top;
1854      } else
1855        pos_top = infos_theImageAndInfos.top;
1856
1857      options.pos_top = pos_top;
1858      options.marge_left = infos_theImage.general.marges.left + Math.ceil(options.marge_gauche);
1859      options.marge_right = infos_theImage.general.marges.right + Math.ceil(options.marge_droite);
1860      options.marge_top += infos_theImage.general.marges.top + infos_content.general.marges.top + Math.ceil(options.marge_haute);
1861      options.marge_bottom = Math.ceil(options.marge_basse); // +infos_content.general.marges.bottom; ;
1862      if (options.pictureDeriv == null)
1863        options.first = true;
1864      else
1865        options.first = false;
1866      //=================== Gestion liste photos size ============================
1867      us = 0;
1868      if (!options.theMainImageWidth) options.theMainImageWidth = options.scaledWidth;
1869      if (!options.theMainImageHeight) options.theMainImageHeight = options.scaledHeight;
1870
1871      if (options.first) {
1872        if (options.pictureDeriv) {
1873
1874          pictureSelType = options.pictureSelType;
1875          options.pictureMap = options.pictureDeriv;
1876
1877        } else {
1878          IMg = Get_Maxi(Zone_image.image);
1879          options.pictureDeriv = IMg.pictureDeriv;
1880          imgSrc = IMg.url;
1881          width = IMg.width;
1882          height = IMg.height;
1883          options.pictureDeriv = IMg.pictureDeriv;
1884          options.pictureMap = IMg.pictureMap;
1885        }
1886      }
1887      if (pictureSelType_user != options.pictureSelType) {
1888        /*
1889        user_status = options.user_status;
1890        pictureSelType_user = eval("options." + user_status + "_type"); //limite taille
1891        */
1892        pictureDeriv_user = options.pictureDeriv;
1893        options.pictureDeriv_user = pictureDeriv_user;
1894        pictureSelType = options.pictureSelType;
1895      }
1896      //=================== 2==================================
1897      href_path = "javascript:changeImgSrc('" + options.imgSrc + "', '" + options.pictureDeriv + "', '" + options.pictureDeriv + "', '" + "SelMaxi" + "')";
1898      spans = jQuery("#derivativeCheckedSelMaxi").next();
1899      spans.attr("href", href_path);
1900      spans.attr("name", "SelMaxi");
1901      spans = spans.find("span");
1902      spans.attr("name", "SelMaxi");
1903      spans.text("(" + options.theMainImageWidth + " x " + options.theMainImageHeight + ")");
1904      //==========================================================
1905      href_path = "javascript:changeImgSrc('" + options.imgSrc + "', '" + options.pictureDeriv + "', '" + options.pictureDeriv + "', '" + "Autosize" + "')";
1906
1907      spans = jQuery("#derivativeCheckedAutosize").next();
1908      spans.attr("href", href_path);
1909      spans.attr("name", "Autosize");
1910      spans = spans.find("span");
1911      spans.attr("name", "Autosize");
1912      spans.text("(" + options.theMainImageWidth + " x " + options.theMainImageHeight + ")");
1913      //==========================================================
1914
1915      if (options.pictureSelType == "Autosize" || options.pictureSelType == "SelMaxi") {
1916        spans = jQuery("#derivativeChecked" + options.pictureSelType).next();
1917        spans.addClass("linkAutosize");
1918        spans.find("span").addClass("auto_details");
1919      }
1920      pictureDeriv = options.pictureDeriv;
1921      Autosize_resize(true, options);
1922      Autosize_resize(true, options);
1923    };
1924    //_______________________ init_gen _______________________
1925
1926
1927    /*********************************************
1928    * DEBUG ....
1929    *********************************************/
1930    /*
1931    if (DEBUG_autosize.match("true",gi))   {
1932    for (var i = 0; i < 10; i++) {
1933    jQuery('#adddebugs').click();
1934    }
1935    jQuery(jQuery('.debug').get(i - 1)).click();
1936    }
1937    */
1938
1939    // Custom Event, ON to turn on a debug.
1940    jQuery('.debug').live('ON', function (e) {
1941
1942      nu_img = jQuery(this).text();
1943      jQuery('.debug').trigger('OFF');
1944      jQuery(this).addClass('debugOn');
1945
1946    });
1947
1948    // On Click = debugs On
1949    jQuery('.debug').live('click', function (e) {
1950      i = jQuery(this).text();
1951      jQuery(this).trigger('ON');
1952    });
1953
1954    // Custom Event, Turn off a debug
1955    jQuery('.debug').live('OFF', function (e) {
1956      jQuery(this).removeClass('debugOn');
1957    });
1958
1959    // on Double Click, remove the debug from the DOM
1960    jQuery('.debug').live('dblclick', function () {
1961      jQuery(this).fadeOut(function () { jQuery(this).remove() });
1962    });
1963
1964    // Add another debug to the DOM
1965    jQuery('#adddebugs').click(function () {
1966      i = jQuery('.debug').length;
1967      jQuery('<div>' + i + '</div>')
1968    .addClass('debug')
1969    .appendTo('#debugsContainer');
1970    });
1971
1972
1973
1974    if (DEBUG_autosize.match("mouse", "gi")) {
1975      var mouseLocation = new Point(-500, -500);
1976      function Point(x, y) {
1977        this.x = x; this.y = y;
1978      }
1979      register_position();
1980
1981      function register_position() {
1982        mouse_x = 0;
1983        mouse_y = 0;
1984        //  document.onmousemove = position;
1985
1986      }
1987
1988      function position(evt) {
1989        if (!evt) evt = window.event;
1990        mouseLocation.x = evt.clientX;
1991        mouseLocation.y = evt.clientY;
1992      }
1993
1994      jQuery("div,a,img").mousemove(function (evt) {
1995
1996        if (!evt) evt = window.event;
1997        mouseLocation.x = evt.clientX;
1998        mouseLocation.y = evt.clientY;
1999        Context = jQuery(this).context.nodeName;
2000        obj_id = "#" + this.id.toString();
2001        infos_g = jQuery(obj_id).infos(true);
2002        infos_g.top = jQuery(obj_id).absoluteTop();
2003        wg = jQuery("body").width() - infos_g.right;
2004
2005        affiche_debug({
2006
2007          Debug1: Debug_info(1, "x:" + mouseLocation.x
2008    + " y: " + mouseLocation.y
2009    + " id: " + obj_id
2010    + " top: " + infos_g.top,
2011    +" Node: " + Context
2012    , "->")
2013    ,
2014          Debug2: Debug_info(2, "W:" + infos_g.general.width
2015    + " H: " + infos_g.general.height
2016    + " right: " + (wg)
2017    + " left: " + infos_g.left
2018    + " Node: " + Context
2019    , "->")
2020        });
2021
2022      });
2023
2024    }
2025
2026
2027    //=======================================================================================
2028    Debug_info = function (index, infos, Nom_str) {
2029      if (typeof infos == "undefined") return;
2030      width_g = Math.ceil(jQuery("body").width() / 5) - 10;
2031      if (typeof infos.height != "undefined") {
2032        message = " -- > Info : " + Nom_str + " " + infos.id + "\n" +
2033                         "Info nodeName: " + infos.nodeName + "\n" +
2034                         "Info width: " + infos.width + "\n" +
2035                         "Info height: " + infos.height + "\n" +
2036                         "Info top: " + infos.top + "\n" +
2037                         "Info left: " + infos.left + "\n" +
2038                         "Info position: " + infos.position + "\n";
2039
2040        myDebug = { id: "Debug" + index, texte: message,
2041          css: {
2042            color: "black",
2043            opacity: "1",
2044            position: "absolute",
2045            height: infos.height || pos_top - 30 + "px",
2046            width: infos.width || width_g + "px",
2047            left: infos.left || 0 + "px",
2048            border: "solid 1px green",
2049            top: infos.top + "px"
2050          }
2051        }
2052        return myDebug;
2053
2054      } else {
2055        if (typeof old_messages == "undefined") {
2056          old_messages = new Array();
2057
2058        }
2059        if (infos != "" && infos != "undefined") {
2060          nc0 = old_messages[index] || "";
2061          if (typeof nc0 != "undefined") {
2062            nc0 = nc0.toString().split("<br />");
2063            if (nc0.length > 4) nc0.shift();
2064            old_messages[index] = nc0.join("<br />");
2065          }
2066          old_messages[index] += "" + Nom_str + "->" + infos + "<br />";
2067          message = old_messages[index];
2068          colors = Array('black', 'white', 'white', 'white', 'white', 'white', 'red');
2069          myDebug = { id: "Debug" + index, texte: message,
2070            css: { display: "block",
2071              color: colors[index - 1],
2072              opacity: "1",
2073              position: "absolute",
2074              align: "left",
2075              height: 80 + "px",
2076              width: width_g + "px",
2077              left: ((index - 1) * width_g) + "px",
2078              border: "solid 1px green",
2079              top: 0 + "px"
2080            }
2081          }
2082          return myDebug;
2083        }
2084      }
2085
2086
2087    } //Debug_info
2088    //====================================================
2089    affiche_debug = function (aff_infos) {
2090      jQuery(jQuery("[id ^='Debug']")).each(function (i) {
2091        if (aff_infos[this.id]) {
2092          if (aff_infos[this.id].css) {
2093            jQuery("#" + this.id).css(aff_infos[this.id].css);
2094            jQuery("#" + this.id).html(aff_infos[this.id].texte);
2095          }
2096        }
2097      });
2098      return;
2099    }
2100    //___________ affiche_debug ____
2101    //====================================================
2102    function Debug_pos() {
2103      return;
2104      if (DEBUG_autosize.match("true", gi)) {
2105
2106        jQuery("[id ^='Debug']").show();
2107        /*
2108        Debug2  background-color:yellow
2109        Debug3 background-color:blue
2110        Debug4 background-color:green
2111        Debug5 background-color:red
2112
2113        */
2114
2115        affiche_debug({
2116          Debug5: Debug_info(5, infos_theMainImage, "infos_theMainImage")
2117        });
2118      }
2119    } // Debug_pos
2120    //==========================================================
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130  });                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              // ready
2131
2132
2133  jQuery("#derivativeSwitchBox a").click(function (e) {
2134    k1 = 0;
2135  });
Note: See TracBrowser for help on using the repository browser.