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

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

[Autosize][beta] bug with compatibility piwigo 2.2


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