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

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

[Autosize][beta] compatibility whith piwigo 2.2


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