1 | var cl_visible = true; |
---|
2 | function Toggle_bp() { |
---|
3 | cl_visible = !cl_visible; |
---|
4 | if (cl_visible) src = src1; |
---|
5 | else src = src2; |
---|
6 | if (cl_visible) src_info = src3; |
---|
7 | else src_info = src4; |
---|
8 | |
---|
9 | jQuery('#bp_cla').attr('alt', src_info); |
---|
10 | jQuery('#bp_cla').attr('title', src_info); |
---|
11 | |
---|
12 | jQuery('#bp_img_cla').get(0).src = src; |
---|
13 | jQuery('#bp_img_cla').attr('alt', src_info); |
---|
14 | jQuery('#bp_img_cla').attr('title', src_info); |
---|
15 | jQuery('#bp_cla').attr('Stitle', src_info); |
---|
16 | jQuery('#bp_cla').attr('Stip', " "); |
---|
17 | old_w = 0; |
---|
18 | jQuery(window).resize(); |
---|
19 | } |
---|
20 | |
---|
21 | jQuery(document).ready( |
---|
22 | function (jQuery) { |
---|
23 | var img_top = "0"; |
---|
24 | |
---|
25 | var old_h = 0; |
---|
26 | var rapport = -1; |
---|
27 | var old_w = 0; |
---|
28 | |
---|
29 | var llgboframe = jQuery("#gbo div:first"); |
---|
30 | var marges_llgbo = 0; |
---|
31 | if (llgboframe.length > 0) { |
---|
32 | |
---|
33 | marges_llgbo = jQuery(llgboframe).outerWidth() - jQuery("#gbo div:last").innerWidth(); |
---|
34 | } |
---|
35 | |
---|
36 | |
---|
37 | //========================================================= |
---|
38 | |
---|
39 | function wait_Timer() { |
---|
40 | old_w = 0 |
---|
41 | jQuery(window).resize(); |
---|
42 | info_pamoorama_outter = jQuery("#pamoorama_outter").info(); |
---|
43 | if (info_pamoorama_outter.width == 0) |
---|
44 | setTimeout("wait_Timer()", 100); |
---|
45 | |
---|
46 | } |
---|
47 | |
---|
48 | |
---|
49 | |
---|
50 | function cl_Timer() { |
---|
51 | // if (!jQuery.browser.msie) { jQuery(function () { alert(jQuery.browser.version); }); } |
---|
52 | if (jQuery.browser.msie && parseInt(jQuery.browser.version) < 8) |
---|
53 | alert(jQuery.browser.version); |
---|
54 | panoramaContainer = jQuery(".panorama-container"); |
---|
55 | n = document.scripts[6]; //12--14affiche_script ; |
---|
56 | t = n.src; |
---|
57 | |
---|
58 | currentPosition = 0 - parseInt(jQuery(panoramaContainer).css('margin-left')); |
---|
59 | if (currentPosition == NaN) return; |
---|
60 | |
---|
61 | |
---|
62 | if (currentPosition > 1000) |
---|
63 | jQuery(panoramaContainer).css('margin-left', "0px") |
---|
64 | setTimeout("cl_Timer()", 500); |
---|
65 | } |
---|
66 | function onPropertyChange(e) { |
---|
67 | var el = e.srcElement; |
---|
68 | var new_class = el.className; |
---|
69 | ID = el.id; |
---|
70 | Prop = e.propertyName.split("."); |
---|
71 | Property = Prop[1]; |
---|
72 | if (Property == "display") { |
---|
73 | Valeur = parseInt(el.currentStyle[Property]); |
---|
74 | if (Valeur == "block") { |
---|
75 | |
---|
76 | |
---|
77 | } |
---|
78 | } |
---|
79 | return; |
---|
80 | } |
---|
81 | |
---|
82 | /* ready |
---|
83 | * |
---|
84 | * |
---|
85 | */ |
---|
86 | //============================================================ |
---|
87 | /* |
---|
88 | * |
---|
89 | */ |
---|
90 | function Info_entete(Parent) { |
---|
91 | var info_imageToolBar = jQuery("#imageToolBar").info(); |
---|
92 | if (info_imageToolBar.position == "absolute") { |
---|
93 | jQuery("#imageToolBar").css("position", "relative"); |
---|
94 | jQuery("#imageToolBar").css("top", 0 + "px"); |
---|
95 | } |
---|
96 | var info_theImage = jQuery("#theImage").info(); |
---|
97 | |
---|
98 | if (info_theImage.position == "relative") { |
---|
99 | //--- passage absolute ==> static ===/ |
---|
100 | jQuery("#theImage").css("position", "static"); |
---|
101 | info_theImage = jQuery("#theImage").info(); |
---|
102 | |
---|
103 | } |
---|
104 | if (info_theImage.position == "absolute") { |
---|
105 | //--- passage absolute ==> static ===/ |
---|
106 | jQuery("#theImage").css("position", "static"); |
---|
107 | info_theImage = jQuery("#theImage").info(); |
---|
108 | |
---|
109 | } |
---|
110 | |
---|
111 | marge_top = Info_the_page.top + |
---|
112 | Info_the_page.borderwidth.top + |
---|
113 | info_theImage.borderwidth.top; |
---|
114 | |
---|
115 | img_top = info_theImage.top + info_theImage.borderwidth.top; |
---|
116 | return { marge_top: marge_top, img_top: img_top }; |
---|
117 | |
---|
118 | } |
---|
119 | |
---|
120 | /* Récupère les informations sur la description. |
---|
121 | * |
---|
122 | */ |
---|
123 | function Info_description(Parent) { |
---|
124 | jQuery("#" + Parent + " p").css({ padding: "0px", margin: "0px " |
---|
125 | }); |
---|
126 | // jQuery("#" + Parent + " p:not(:contains(' ')) ").remove(); |
---|
127 | |
---|
128 | |
---|
129 | |
---|
130 | //============================================================================= |
---|
131 | var info_description = { top: 0, bottom: 0, height: 0 }; |
---|
132 | |
---|
133 | if (theme.match(RegExp("simple", "gi"))) { |
---|
134 | jQuery("#" + Parent).css({ padding: "0px", |
---|
135 | marginLeft: "0px", |
---|
136 | marginRight: "auto", |
---|
137 | marginTop: "0px", |
---|
138 | marginBottom: "0px" |
---|
139 | }); |
---|
140 | } else { |
---|
141 | jQuery("#" + Parent).css({ padding: "0px", |
---|
142 | marginLeft: "auto", |
---|
143 | marginRight: "auto", |
---|
144 | marginTop: "0px", |
---|
145 | marginBottom: "0px" |
---|
146 | }); |
---|
147 | } |
---|
148 | |
---|
149 | if (theme.match(RegExp("luciano", "g"))) { |
---|
150 | info_img = jQuery("#" + Parent + " #theImg").info(); |
---|
151 | } else { |
---|
152 | |
---|
153 | info_img = jQuery("#" + Parent + " img").info(); |
---|
154 | } |
---|
155 | |
---|
156 | info_description.marge = { bottom: info_img.padding.bottom + info_img.margin.bottom + info_img.borderwidth.bottom, |
---|
157 | top: info_img.padding.top + info_img.borderwidth.top |
---|
158 | } |
---|
159 | |
---|
160 | info_description.top = info_img.bottom + info_img.margin.bottom + info_img.borderwidth.bottom; |
---|
161 | //============================================================================= |
---|
162 | info_gbo = jQuery("#gbo").info(); |
---|
163 | if (info_description.top < info_gbo.bottom) |
---|
164 | info_description.top = info_gbo.bottom; |
---|
165 | //============================================================================= |
---|
166 | info_desc = jQuery("#" + Parent + " p:first").info(); |
---|
167 | // if (info_desc.top > info_img.bottom) |
---|
168 | // info_description.top = info_desc.top; |
---|
169 | |
---|
170 | |
---|
171 | info_table = jQuery(".infoTable").info(); |
---|
172 | |
---|
173 | if (info_table.top > info_description.bottom) |
---|
174 | info_description.bottom = info_table.top; |
---|
175 | //=========================================================================== |
---|
176 | |
---|
177 | info_licencetag = jQuery(".licencetag").info(); |
---|
178 | |
---|
179 | |
---|
180 | if (info_licencetag.bottom > 0) { |
---|
181 | jQuery(".licencetag").css("border", "solid 5px transparent"); |
---|
182 | if (info_licencetag.bottom > info_licencetag.height) |
---|
183 | info_description.bottom = info_licencetag.bottom - 3; |
---|
184 | else |
---|
185 | info_description.bottom -= info_licencetag.padding.top + info_table.margin.top; |
---|
186 | |
---|
187 | } |
---|
188 | //============================================================================= |
---|
189 | if (theme.match(RegExp("gally", "gi"))) { |
---|
190 | if (!theme.match(RegExp("lapis", "gi"))) { |
---|
191 | info_description.bottom = info_description.bottom |
---|
192 | } |
---|
193 | } |
---|
194 | |
---|
195 | |
---|
196 | |
---|
197 | |
---|
198 | |
---|
199 | if (info_description.top < 1) |
---|
200 | info_description.top = info_description.bottom; |
---|
201 | |
---|
202 | |
---|
203 | if (info_description.bottom < info_description.top) { |
---|
204 | info_description.bottom = info_description.top; |
---|
205 | |
---|
206 | info_desc = jQuery("#" + Parent + " p:last").info(); |
---|
207 | |
---|
208 | if (info_desc.bottom > info_img.bottom) |
---|
209 | info_description.bottom = info_desc.bottom; |
---|
210 | } |
---|
211 | |
---|
212 | |
---|
213 | if (theme.match(RegExp("gally", "g"))) { |
---|
214 | if (!theme.match(RegExp("lapis", "gi"))) { |
---|
215 | info_copyright = jQuery("#copyright").info(); |
---|
216 | info_description.bottom += info_copyright.height; |
---|
217 | } |
---|
218 | } |
---|
219 | info_description.height = info_description.bottom - info_description.top; |
---|
220 | |
---|
221 | if (0) { |
---|
222 | /* jQuery("#Debug").text(jQuery("#Debug").text() + user_status); |
---|
223 | |
---|
224 | jQuery("#Debug").hide(); |
---|
225 | jQuery("#Debug1").hide(); |
---|
226 | jQuery("#Debug2").hide(); |
---|
227 | info_description.width = "800"; |
---|
228 | */ |
---|
229 | |
---|
230 | Bandeau_bas = info_description; |
---|
231 | |
---|
232 | jQuery("#Debug").css({ |
---|
233 | filter: 'alpha(opacity:50)', |
---|
234 | position: "absolute", |
---|
235 | width: "800px", |
---|
236 | border: "solid 1px green", |
---|
237 | top: Bandeau + "px" |
---|
238 | }); |
---|
239 | jQuery("#Debug").text("Debug:Bandeau : " + Bandeau); |
---|
240 | |
---|
241 | jQuery("#Debug1").css({ |
---|
242 | filter: 'alpha(opacity:50)', |
---|
243 | position: "absolute", |
---|
244 | border: "solid 1px green", |
---|
245 | top: Bandeau_bas.top + "px", |
---|
246 | width: (200) + "px", |
---|
247 | height: Bandeau_bas.height + "px" |
---|
248 | }); |
---|
249 | jQuery("#Debug1").text("Debug1:Bandeau_bas top : " + Bandeau_bas.top + " height:" + Bandeau_bas.height); |
---|
250 | |
---|
251 | jQuery("#Debug2").css({ |
---|
252 | filter: 'alpha(opacity:50)', |
---|
253 | position: "absolute", |
---|
254 | left: '50px', |
---|
255 | width: (300) + "px", |
---|
256 | border: "solid 1px green", top: Bandeau_bas.bottom + "px" |
---|
257 | }); |
---|
258 | jQuery("#Debug2").text("Debug2:Bandeau_bas bottom :" + Bandeau_bas.bottom); |
---|
259 | // cl_visible = false; |
---|
260 | } |
---|
261 | |
---|
262 | if (check_desc_v != 'checked="checked"') { |
---|
263 | info_description.height = 0; |
---|
264 | } |
---|
265 | |
---|
266 | return info_description; |
---|
267 | |
---|
268 | } |
---|
269 | |
---|
270 | /* |
---|
271 | * |
---|
272 | */ |
---|
273 | jQuery("#pamoorama_iner").bind('resize', function () { |
---|
274 | wait_Timer(); |
---|
275 | }) |
---|
276 | //============================================================//== |
---|
277 | jQuery("#pamoorama_outter").bind('resize', function () { |
---|
278 | wait_Timer(); |
---|
279 | }) |
---|
280 | |
---|
281 | |
---|
282 | |
---|
283 | //============================================================ |
---|
284 | jQuery("#iGMapsIcon").bind('resize', function () { |
---|
285 | jQuery().recentrage_widget(); |
---|
286 | }) |
---|
287 | |
---|
288 | |
---|
289 | |
---|
290 | |
---|
291 | |
---|
292 | |
---|
293 | |
---|
294 | /* jQuery */ |
---|
295 | var img_init = { height: img_height, width: img_width }; // taille initiale |
---|
296 | var img_defaut = { height: scaled_height, width: scaled_width }; |
---|
297 | var img_reelle = { height: img_height, width: img_width }; |
---|
298 | var img_finale = { height: 0, width: 0 }; |
---|
299 | var Zone_Affichage = { height: 0, width: 0 }; |
---|
300 | |
---|
301 | //============================================================ |
---|
302 | |
---|
303 | var Info_the_page = jQuery("#the_page").info(); |
---|
304 | var Zone_Affichage = jQuery("#theImage").info(); |
---|
305 | |
---|
306 | var Bandeau = 0; |
---|
307 | var Bandeau_t = Info_entete("theImage") |
---|
308 | Bandeau = Bandeau_t.img_top; |
---|
309 | var Bandeau_bas = 0; |
---|
310 | Bandeau_bas = Info_description("theImage"); |
---|
311 | //=================================================================== |
---|
312 | /* |
---|
313 | * window .resize |
---|
314 | */ |
---|
315 | jQuery(window).resize(function (event, ui) { |
---|
316 | if (typeof (event) == 'undefined') return; |
---|
317 | if (!cl_visible) return; |
---|
318 | if (eval(user_status + "_enabled") == "") return; |
---|
319 | var chk = eval(user_status + "_enabled"); |
---|
320 | |
---|
321 | |
---|
322 | |
---|
323 | //========================================================================== |
---|
324 | var winwidth = jQuery(window).width(); |
---|
325 | var winheight = jQuery(window).height(); |
---|
326 | if (old_w == winwidth && old_h == winheight) return; |
---|
327 | |
---|
328 | |
---|
329 | |
---|
330 | if (old_w != winwidth) |
---|
331 | { old_w = winwidth; } |
---|
332 | else |
---|
333 | { if (old_h != winheight) old_h = winheight; } |
---|
334 | //=========================================================================== |
---|
335 | |
---|
336 | |
---|
337 | var Cadre = jQuery("#theImage").get(0); |
---|
338 | |
---|
339 | var Type_Img = ""; |
---|
340 | //====== détection du type d'images ====== |
---|
341 | if (jQuery("#charlie").length > 0) { |
---|
342 | Type_Img = "charlie"; |
---|
343 | } else if (jQuery("#pamoorama").length) { |
---|
344 | Type_Img = "pamoorama"; |
---|
345 | } else if (jQuery("#theImage embed").length > 0) { |
---|
346 | Type_Img = "embed"; |
---|
347 | } else if (jQuery("#map").length) { |
---|
348 | Type_Img = "map"; |
---|
349 | } else if (jQuery("#Panorama").length) { |
---|
350 | Type_Img = "panorama"; |
---|
351 | } else if (jQuery(Cadre).find("img").length > 0) { |
---|
352 | Type_Img = "img"; |
---|
353 | } else if (jQuery("img").length > 0) { |
---|
354 | Type_Img = "img_autre"; |
---|
355 | return; |
---|
356 | } else { |
---|
357 | return; |
---|
358 | } |
---|
359 | |
---|
360 | |
---|
361 | |
---|
362 | var info_Cadre = jQuery(Cadre).info(); |
---|
363 | //=============== Information cadre ====== |
---|
364 | var info_the_page = jQuery("#the_page").info(); |
---|
365 | |
---|
366 | //============================================================================= |
---|
367 | var info_HeaderBar = jQuery("#imageHeaderBar").info(); |
---|
368 | |
---|
369 | var info_content = jQuery("#content").info(); |
---|
370 | |
---|
371 | |
---|
372 | var info_titrePage = jQuery("#titrePage").info(); |
---|
373 | |
---|
374 | |
---|
375 | var Zone_Affichage = jQuery("#theImage").info(); |
---|
376 | |
---|
377 | var info_ToolBar = jQuery("#imageToolBar").info(); |
---|
378 | var info_imageInfoBar = jQuery("#imageInfoBar").info(); |
---|
379 | var info_theHeader = jQuery("#theHeader").info(); |
---|
380 | |
---|
381 | var marge = (Zone_Affichage.width - info_ToolBar.width) / 2; |
---|
382 | |
---|
383 | var marge_right = marge; |
---|
384 | var marge_left = marge; |
---|
385 | |
---|
386 | if (info_content.width > 100) { |
---|
387 | marge_left = 0; |
---|
388 | marge_right = info_imageInfoBar.margin.left + info_imageInfoBar.margin.right; |
---|
389 | winwidth = info_content.width; |
---|
390 | marge_right = info_imageInfoBar.width + marge_right; |
---|
391 | } |
---|
392 | else |
---|
393 | winwidth = Zone_Affichage.width; |
---|
394 | |
---|
395 | winwidth -= (marge_right + marge_left); |
---|
396 | |
---|
397 | |
---|
398 | |
---|
399 | if (Type_Img == "pamoorama") { |
---|
400 | var info_pamoorama = jQuery("#pamoorama").info(); |
---|
401 | var info_pamoorama_outter = jQuery("#pamoorama_outter").info(); |
---|
402 | var info_pamoorama_inner = jQuery("#pamoorama_inner").info(); |
---|
403 | var info_pamoorama_footer = jQuery("#pamoorama_footer").info(); |
---|
404 | TheImg = jQuery("#pamoorama"); |
---|
405 | |
---|
406 | /* |
---|
407 | pamoorama_outter |
---|
408 | pamoorama_inner |
---|
409 | pamoorama_footer |
---|
410 | pamoorama_caption |
---|
411 | pamoorama_thumb |
---|
412 | pamoorama_frame |
---|
413 | */ |
---|
414 | } else { |
---|
415 | //==== récupère Img la plus grande ===== |
---|
416 | if (jQuery("#theImg")) IMG = "#theImg"; |
---|
417 | else IMG = Cadre; |
---|
418 | |
---|
419 | TheImg2 = Get_Img_Maxi(IMG + " img"); |
---|
420 | //================================================================= |
---|
421 | if (TheImg2 == null) { |
---|
422 | if (jQuery(Cadre).find("img").length > 0) { |
---|
423 | IMG = Cadre; |
---|
424 | TheImg = Get_Img_Maxi("#theImage img"); |
---|
425 | } |
---|
426 | } else { |
---|
427 | TheImg = TheImg2 //luciano ? |
---|
428 | |
---|
429 | } |
---|
430 | } |
---|
431 | //================================================================= |
---|
432 | |
---|
433 | |
---|
434 | switch (Type_Img) { |
---|
435 | case "map": |
---|
436 | var info_image = jQuery("#map").info(); |
---|
437 | |
---|
438 | var info_map = jQuery("#mapPicture").info(); |
---|
439 | |
---|
440 | marge_left = info_map.width; |
---|
441 | jQuery("#map").css("left", marge_left); |
---|
442 | |
---|
443 | var TheImg = jQuery("#map").get(0); |
---|
444 | img_reelle.height = info_image.height; |
---|
445 | img_reelle.width = winwidth - marge_right - marge_right; |
---|
446 | Bandeau_bas.height = 10; |
---|
447 | marge_right = 10; |
---|
448 | |
---|
449 | info_the_page = jQuery("#the_page").info(); |
---|
450 | ; |
---|
451 | |
---|
452 | break |
---|
453 | |
---|
454 | |
---|
455 | case "panorama": |
---|
456 | |
---|
457 | var w00 = 0; |
---|
458 | jQuery("#Panorama img").each(function (i) { |
---|
459 | w0 = this.width; |
---|
460 | if (w0 > w00) { |
---|
461 | TheImg = this; |
---|
462 | n = TheImg.nameProp; |
---|
463 | w00 = w0; |
---|
464 | } |
---|
465 | }); |
---|
466 | |
---|
467 | info_theImage = jQuery(TheImg).info(); |
---|
468 | info_the_page = jQuery("#the_page").info(); |
---|
469 | |
---|
470 | break |
---|
471 | case "img": |
---|
472 | |
---|
473 | if (!TheImg) return; |
---|
474 | info_theImage = jQuery(TheImg).info(); |
---|
475 | info_the_page = jQuery("#the_page").info(); |
---|
476 | |
---|
477 | |
---|
478 | break |
---|
479 | case "img_autre": |
---|
480 | if (!TheImg) return; |
---|
481 | info_theImage = jQuery(TheImg).info(); |
---|
482 | info_the_page = jQuery("#the_page").info(); |
---|
483 | |
---|
484 | |
---|
485 | break |
---|
486 | case "embed": |
---|
487 | // |
---|
488 | |
---|
489 | TheImg = jQuery(Cadre).find("embed"); |
---|
490 | |
---|
491 | info_theImage = jQuery(Cadre).info(); |
---|
492 | info_the_page = jQuery("#the_page").info(); |
---|
493 | if (rapport < 0) { |
---|
494 | img_height = parseInt(jQuery(TheImg).outerHeight()); |
---|
495 | img_width = parseInt(jQuery(TheImg).outerWidth()); |
---|
496 | |
---|
497 | img_reelle.height = img_height; |
---|
498 | img_reelle.width = img_width; |
---|
499 | |
---|
500 | } |
---|
501 | |
---|
502 | break |
---|
503 | case "charlie": |
---|
504 | |
---|
505 | TheImg = jQuery('#charlie object').get(0); |
---|
506 | info_theImage = jQuery(Cadre).info(); |
---|
507 | info_the_page = jQuery("#the_page").info(); |
---|
508 | if (rapport < 0) { |
---|
509 | img_height = parseInt(TheImg.height); |
---|
510 | img_width = parseInt(TheImg.width); |
---|
511 | |
---|
512 | img_reelle.height = parseInt(TheImg.height); |
---|
513 | img_reelle.width = parseInt(TheImg.width); |
---|
514 | } |
---|
515 | |
---|
516 | break |
---|
517 | case "pamoorama": |
---|
518 | //========================================================= |
---|
519 | var Images = jQuery("#pamoorama img"); |
---|
520 | var Image = jQuery("#pamoorama").find("img"); |
---|
521 | |
---|
522 | info_theImage = jQuery("#pamoorama").info(); |
---|
523 | info_the_page = jQuery("#the_page").info(); |
---|
524 | break |
---|
525 | |
---|
526 | |
---|
527 | } |
---|
528 | |
---|
529 | //=============== Vérification taille minimale autorizée ====================== |
---|
530 | var miniWidth = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("min-width"), mini_width); |
---|
531 | miniHeight = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("min-height"), mini_height); |
---|
532 | |
---|
533 | |
---|
534 | var maxWidth = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("max-width"), winwidth, "0"); |
---|
535 | maxHeight = jQuery(TheImg).Get_Val_int(jQuery(TheImg).css("max-height"), winheight, "0"); |
---|
536 | |
---|
537 | mini_width = parseInt(miniWidth); |
---|
538 | mini_height = parseInt(miniHeight); |
---|
539 | |
---|
540 | img_reelle.width = parseInt(img_reelle.width); |
---|
541 | |
---|
542 | |
---|
543 | if (img_reelle.width < mini_width) return; |
---|
544 | |
---|
545 | img_reelle.height = parseInt(img_reelle.height); |
---|
546 | if (img_reelle.height < parseInt(mini_height)) return; |
---|
547 | //================================================================================== |
---|
548 | if (rapport < 0) { |
---|
549 | |
---|
550 | img_init.height = parseInt(img_height); |
---|
551 | img_init.width = parseInt(img_width); |
---|
552 | |
---|
553 | rapport = img_width / img_height; |
---|
554 | |
---|
555 | if (Type_Img != "map") |
---|
556 | rapport = (img_init.width / img_init.height); |
---|
557 | else |
---|
558 | rapport = 0; |
---|
559 | |
---|
560 | } |
---|
561 | |
---|
562 | |
---|
563 | //=============== Zone d'affichage ============================ |
---|
564 | |
---|
565 | borderW = Zone_Affichage.borderwidth.left; |
---|
566 | borderW += Zone_Affichage.borderwidth.right; |
---|
567 | |
---|
568 | |
---|
569 | Zone_Affichage.width = winwidth - borderW; |
---|
570 | |
---|
571 | |
---|
572 | |
---|
573 | var Licence = jQuery(".licencetag"); |
---|
574 | info_Licence = jQuery(".licencetag").info(); |
---|
575 | //================================================================================== |
---|
576 | jQuery("#theImage #theImg IMG").css("marginTop", "0px") |
---|
577 | |
---|
578 | var correction = 0; |
---|
579 | if (theme.match(RegExp("sobre", "g"))) { |
---|
580 | |
---|
581 | correction = -info_Licence.padding.top; |
---|
582 | |
---|
583 | } else if (theme.match(RegExp("Pure", "g"))) { |
---|
584 | correction += 0; //?? |
---|
585 | } else if (theme.match(RegExp("luciano", "g"))) { |
---|
586 | correction += 0; //?? |
---|
587 | } else if (theme.match(RegExp("simple", "g"))) { |
---|
588 | correction += 0; //?? |
---|
589 | } else if (theme.match(RegExp("gally", "g"))) { |
---|
590 | correction += 0; //?? |
---|
591 | |
---|
592 | } |
---|
593 | //================ Licence ======================== |
---|
594 | |
---|
595 | if (Licence.length > 0) { |
---|
596 | jQuery(".licencetag").css("padding", "0px"); |
---|
597 | |
---|
598 | } |
---|
599 | //==================================================== |
---|
600 | info_img = jQuery(TheImg).info(); |
---|
601 | |
---|
602 | |
---|
603 | |
---|
604 | img_top = Bandeau; |
---|
605 | |
---|
606 | Marge_Basse = parseInt(marge_basse || 0); // hors bandeau |
---|
607 | //========================================================================== |
---|
608 | h = 0; |
---|
609 | Zone_Affichage.height = winheight - Bandeau - Marge_Basse - correction; |
---|
610 | var Image_height = Zone_Affichage.height - Bandeau_bas.height - Bandeau_bas.marge.top - Bandeau_bas.marge.bottom; |
---|
611 | |
---|
612 | //============================================================= |
---|
613 | var height_user = eval(user_status + "_height"); |
---|
614 | var reg1 = new RegExp("%", "g"); |
---|
615 | if (height_user.match(reg1)) |
---|
616 | Image_height = Image_height * parseInt(height_user) / 100; |
---|
617 | else |
---|
618 | Image_height = parseInt(height_user); |
---|
619 | |
---|
620 | echelle_max = parseFloat(echelle_max, '3'); |
---|
621 | var echelle = parseFloat(Image_height / img_reelle.height, 3); |
---|
622 | |
---|
623 | if (echelle > echelle_max) { echelle = echelle_max; } |
---|
624 | Image_height = parseInt(img_reelle.height * echelle); |
---|
625 | //============================================================ |
---|
626 | |
---|
627 | var Image_width; |
---|
628 | if (rapport > 0) |
---|
629 | Image_width = parseInt(Image_height * rapport); |
---|
630 | else if (Type_Img == "map") { |
---|
631 | Image_width = Zone_Affichage.width - marge_left - marge_right; |
---|
632 | } else { |
---|
633 | Image_width = Zone_Affichage.width; |
---|
634 | } |
---|
635 | |
---|
636 | //=============================================================== |
---|
637 | align_auto = "center"; |
---|
638 | if (jQuery("#theImg").css("textAlign")) |
---|
639 | align_auto = jQuery("#theImg").css("textAlign"); |
---|
640 | var widthmin = winwidth; |
---|
641 | |
---|
642 | if (check_auto_w == 'checked="checked"') { |
---|
643 | // if (Type_Img != "pamoorama" && Type_Img != "panorama" ) { |
---|
644 | //==== largeur à atteindre === |
---|
645 | var width_user = eval(user_status + "_width"); |
---|
646 | // Largeur maximale en fonction du statut |
---|
647 | if (width_user.match(reg1)) |
---|
648 | // pourcentage |
---|
649 | widthmin = widthmin * parseInt(width_user) / 100; |
---|
650 | else |
---|
651 | widthmin = parseInt(width_user); |
---|
652 | var marges = marges_llgbo; |
---|
653 | widthmin -= info_img.borderwidth.left; |
---|
654 | widthmin -= info_img.borderwidth.right; |
---|
655 | |
---|
656 | widthmin -= marges; |
---|
657 | if (Image_width > widthmin) { |
---|
658 | // Image_width largeur à atteindre |
---|
659 | // Calcul du rapport d'agrandissement |
---|
660 | var echelle_w = parseFloat((widthmin) / img_reelle.width, 3); |
---|
661 | if (echelle_w > echelle_max) { echelle_w = echelle_max; } |
---|
662 | Image_width = parseInt(img_reelle.width * echelle_w); |
---|
663 | if (rapport > 0) |
---|
664 | Image_height = parseInt(Image_width / rapport); |
---|
665 | } |
---|
666 | |
---|
667 | |
---|
668 | |
---|
669 | } |
---|
670 | |
---|
671 | |
---|
672 | // } |
---|
673 | //=================================================== |
---|
674 | |
---|
675 | |
---|
676 | |
---|
677 | zoom = echelle; |
---|
678 | //=============LLGBO2 =========================== |
---|
679 | |
---|
680 | |
---|
681 | if (marges_llgbo > 0) { |
---|
682 | |
---|
683 | t1 = jQuery(llgboframe).info(); |
---|
684 | |
---|
685 | |
---|
686 | if (TheImg.src) { |
---|
687 | |
---|
688 | Image_width -= marges_llgbo; // réduction frame |
---|
689 | Image_height -= marges_llgbo; // réduction frame |
---|
690 | if (rapport > 1) { |
---|
691 | jQuery("#gbo").outerWidth(Image_width); |
---|
692 | jQuery("#gbo").css("width", Image_width + "px"); |
---|
693 | |
---|
694 | |
---|
695 | t1 = jQuery("#gbo div:last").info(); |
---|
696 | |
---|
697 | Image_width = jQuery("#gbo div:last").innerWidth(); |
---|
698 | Image_height = parseInt(Image_width / rapport); |
---|
699 | |
---|
700 | jQuery("#gbo").outerHeight(Image_height + marges_llgbo); |
---|
701 | jQuery("#gbo").css("height", (Image_height + marges_llgbo) + "px"); |
---|
702 | if ( jQuery.browser.msie) { |
---|
703 | jQuery("#gbo").css("paddingBottom", 18 + "px"); |
---|
704 | } |
---|
705 | |
---|
706 | } else { |
---|
707 | Image_height -= 4; |
---|
708 | Image_width -= 4; |
---|
709 | jQuery("#gbo").css("height", (Image_height + marges_llgbo) + "px"); |
---|
710 | jQuery("#gbo").css("width", Image_width + marges_llgbo + "px"); |
---|
711 | |
---|
712 | Image_width = jQuery("#gbo div:last").innerWidth(); |
---|
713 | Image_height = parseInt(Image_width / rapport); |
---|
714 | |
---|
715 | } |
---|
716 | |
---|
717 | a1 = jQuery("area[rel=prev]"); |
---|
718 | a2 = jQuery("area[rel=next]"); |
---|
719 | |
---|
720 | if (a1.length == 0) { |
---|
721 | jQuery("area[rel=prev]").attr({ coords: "'" + 0 + ",0," + 0 + "," + 0 + "'" }); |
---|
722 | jQuery("area[rel=up]").attr({ coords: "'" + 0 + ",0," + Image_width / 2 + "," + Image_height + "'" }); |
---|
723 | jQuery("area[rel=next]").attr({ coords: "'" + Image_width / 2 + ",0," + (Image_width) + "," + Image_height + "'" }); |
---|
724 | |
---|
725 | } else if (a2.length == 0) { |
---|
726 | jQuery("area[rel=prev]").attr({ coords: "'" + 0 + ",0," + (Image_width) / 2 + "," + Image_height + "'" }); |
---|
727 | jQuery("area[rel=up]").attr({ coords: "'" + Image_width / 2 + ",0," + (Image_width * 2) / 2 + "," + Image_height + "'" }); |
---|
728 | jQuery("area[rel=next]").attr({ coords: "'" + 0 + ",0," + 0 + "," + 0 + "'" }); |
---|
729 | |
---|
730 | } else { |
---|
731 | |
---|
732 | jQuery("area[rel=prev]").attr({ coords: "'" + 0 + ",0," + (Image_width) / 3 + "," + Image_height + "'" }); |
---|
733 | jQuery("area[rel=up]").attr({ coords: "'" + Image_width / 3 + ",0," + (Image_width * 2) / 3 + "," + Image_height + "'" }); |
---|
734 | jQuery("area[rel=next]").attr({ coords: "'" + (Image_width * 2) / 3 + ",0," + (Image_width) + "," + Image_height + "'" }); |
---|
735 | } |
---|
736 | |
---|
737 | |
---|
738 | } |
---|
739 | } |
---|
740 | |
---|
741 | //================ Zone affichage ========================= |
---|
742 | // Image_height, Image_width = valeur a atteindre. |
---|
743 | if (theme.match(RegExp("luciano", "g"))) { |
---|
744 | Zone_Affichage.height -= Bandeau_bas.height; |
---|
745 | jQuery(Cadre).height(Zone_Affichage.height); |
---|
746 | |
---|
747 | } |
---|
748 | |
---|
749 | //========================================================= |
---|
750 | |
---|
751 | jQuery(Cadre).css("top", "0px"); |
---|
752 | jQuery("#standard").css("top", 0 + "px"); |
---|
753 | jQuery("#comments").css("top", 0 + "px"); |
---|
754 | |
---|
755 | |
---|
756 | jQuery(Cadre).width(Zone_Affichage.width); |
---|
757 | |
---|
758 | //============================================================== |
---|
759 | |
---|
760 | img_finale.height = Image_height; |
---|
761 | img_finale.width = Image_width; |
---|
762 | |
---|
763 | //========================================================================= |
---|
764 | |
---|
765 | |
---|
766 | if (typeof (gmaps) != "undefined") { |
---|
767 | Gmap_ = gmaps.maps[0]; |
---|
768 | if (Gmap_.sizeMode == 'A') { |
---|
769 | jQuery("#iGMapsIcon").css({ width: old_w * 0.8 + "px", height: old_h * 0.8 + "px" }); |
---|
770 | |
---|
771 | } |
---|
772 | } |
---|
773 | //============================================================== |
---|
774 | if (Type_Img == "charlie") { |
---|
775 | t1 = jQuery("#charlie").info(); |
---|
776 | /**/ |
---|
777 | pdf = 2 * parseInt(jQuery(".none_2").css("paddingRight")); |
---|
778 | jQuery("#charlie").css({ |
---|
779 | width: Image_width + pdf, |
---|
780 | height: Image_height, |
---|
781 | margin: "auto" |
---|
782 | }); |
---|
783 | |
---|
784 | |
---|
785 | jQuery("#player").css("width", Image_width + 100 + "px"); |
---|
786 | jQuery("#player").css("height", Image_height); |
---|
787 | |
---|
788 | jQuery("#embedplayer").css("width", Image_width); |
---|
789 | jQuery("#embedplayer").css("height", Image_height); |
---|
790 | |
---|
791 | |
---|
792 | jQuery("object").width(Image_width); |
---|
793 | jQuery("object").height(Image_height); |
---|
794 | } else if (Type_Img == "panorama") { |
---|
795 | |
---|
796 | // jQuery(TheImg).panorama2(img_finale.height, img_finale.width); |
---|
797 | jQuery(TheImg).height(img_finale.height); |
---|
798 | jQuery(TheImg).width(img_finale.width); |
---|
799 | jQuery("#Panorama div").height(Image_height); |
---|
800 | // class=simple_panorama |
---|
801 | |
---|
802 | jQuery(".panorama-viewport").css("left", "2px"); |
---|
803 | jQuery(".panorama-viewport").css("width", "auto"); |
---|
804 | // setTimeout("cl_Timer()", 500); |
---|
805 | |
---|
806 | } else if (Type_Img == "pamoorama") { |
---|
807 | return; |
---|
808 | |
---|
809 | marge_left += 0; |
---|
810 | new_width = Zone_Affichage.width - marge_right - marge_left; |
---|
811 | jQuery("#pamoorama").css({ margin: 0 + "px", |
---|
812 | left: marge_left + "px", |
---|
813 | height: Image_height + info_pamoorama_footer.height + "px", |
---|
814 | width: new_width + "px" |
---|
815 | }); |
---|
816 | |
---|
817 | jQuery("#pamoorama").width(new_width); |
---|
818 | |
---|
819 | |
---|
820 | jQuery("#pamoorama_outter").css({ |
---|
821 | left: marge_left + "px", |
---|
822 | height: Image_height + "px", |
---|
823 | width: (new_width) + "px" |
---|
824 | }); |
---|
825 | jQuery("#pamoorama_outter").width(new_width); |
---|
826 | |
---|
827 | |
---|
828 | jQuery("#pamoorama_footer").width((Zone_Affichage.width - marge_right - marge_left)); |
---|
829 | jQuery("#pamoorama_footer").css('width', (Zone_Affichage.width - marge_right - marge_left) + "px"); |
---|
830 | zoom = Image_height / img_height; |
---|
831 | info_pamoorama_outter = jQuery("#pamoorama_outter").info(); |
---|
832 | |
---|
833 | h_frame = jQuery("#pamoorama").width(); |
---|
834 | if (old_w == jQuery(window).width() && old_h == jQuery(window).height()) { |
---|
835 | |
---|
836 | /* if (info_pamoorama_outter.width == 0) |
---|
837 | setTimeout("wait_Timer()", 100); |
---|
838 | */ |
---|
839 | // jQuery(TheImg).css("zoom", zoom); |
---|
840 | } |
---|
841 | |
---|
842 | |
---|
843 | } else if (TheImg.src) { |
---|
844 | //--- background ?? --- |
---|
845 | jQuery(TheImg).height(img_finale.height); |
---|
846 | jQuery(TheImg).width(img_finale.width); |
---|
847 | jQuery(TheImg).css("height", img_finale.height + "px"); |
---|
848 | jQuery(TheImg).css("width", img_finale.width + "px"); |
---|
849 | |
---|
850 | } else { |
---|
851 | //===map ? === |
---|
852 | jQuery(TheImg).height(img_finale.height); |
---|
853 | jQuery(TheImg).width(img_finale.width); |
---|
854 | jQuery(TheImg).css("height", img_finale.height + "px"); |
---|
855 | jQuery(TheImg).css("width", img_finale.width + "px"); |
---|
856 | } |
---|
857 | |
---|
858 | /* |
---|
859 | jQuery("#Debug1").css({ |
---|
860 | position: "absolute", |
---|
861 | top: Bandeau + "px", |
---|
862 | textAlign: align_auto, |
---|
863 | margin: "0px auto", |
---|
864 | |
---|
865 | |
---|
866 | border: "solid 1px red", |
---|
867 | |
---|
868 | width: Image_width + "px", |
---|
869 | height: Image_height + "px" |
---|
870 | |
---|
871 | }); |
---|
872 | //=================================================== |
---|
873 | jQuery("#Debug2").css({ position: "absolute", |
---|
874 | left: Zone_Affichage.left + 'px', |
---|
875 | border: "solid 1px green", |
---|
876 | top: Zone_Affichage.top + "px", |
---|
877 | width: Zone_Affichage.width / 2 + "px", |
---|
878 | height: Zone_Affichage.height + "px" |
---|
879 | |
---|
880 | }); |
---|
881 | jQuery("#Debug2").text(info_Cadre.bottom); |
---|
882 | */ |
---|
883 | |
---|
884 | try { |
---|
885 | if (theme.match(RegExp("gally", "g"))) { |
---|
886 | |
---|
887 | //=========================================================================== |
---|
888 | |
---|
889 | if (jQuery("#navThumbPrev").length > 0) { |
---|
890 | jQuery("#navThumbPrev").css({ height: info_img.height + "px", |
---|
891 | top: info_img.top |
---|
892 | }); |
---|
893 | } |
---|
894 | if (jQuery("#navThumbNext").length > 0) { |
---|
895 | jQuery("#navThumbNext").css({ height: info_img.height + "px", |
---|
896 | top: info_img.top |
---|
897 | }); |
---|
898 | } |
---|
899 | if (!theme.match(RegExp("lapis", "gi"))) { } |
---|
900 | } else if (theme.match(RegExp("simple", "g"))) { |
---|
901 | |
---|
902 | } else { |
---|
903 | |
---|
904 | jQuery("#imageToolBar").css("position", "static"); |
---|
905 | } |
---|
906 | } catch (e) { |
---|
907 | |
---|
908 | } |
---|
909 | // |
---|
910 | if (!pos) pos = jQuery("#copyright").info(); |
---|
911 | if (pos != jQuery("#copyright").info()) |
---|
912 | pos = jQuery("#copyright").info(); |
---|
913 | if (pos.top > 100) jQuery("#the_page").height(pos.top); |
---|
914 | |
---|
915 | if (old_w == jQuery(window).width() && old_h == jQuery(window).height()) return; |
---|
916 | jQuery(window).resize(); |
---|
917 | return; |
---|
918 | }); |
---|
919 | var pos; |
---|
920 | //=================================================================== |
---|
921 | jQuery(window).resize(); |
---|
922 | /* |
---|
923 | * recherche la plus grande image (hauteur ou largeur) |
---|
924 | */ |
---|
925 | |
---|
926 | |
---|
927 | function Get_Img_Maxi(myobj) { |
---|
928 | var w00 = 0; |
---|
929 | var TheImg = null; |
---|
930 | jQuery(myobj).each(function (i) { |
---|
931 | w0 = img_reelle.width; |
---|
932 | h0 = img_reelle.height; |
---|
933 | if (h0 > w0) w0 = h0; |
---|
934 | if (w0 > w00) { |
---|
935 | if (!this.src.match(RegExp(".png", "g"))) |
---|
936 | if (!this.src.match(RegExp(thumbnail, "g"))) { |
---|
937 | TheImg = this; |
---|
938 | w00 = w0; |
---|
939 | } |
---|
940 | |
---|
941 | } |
---|
942 | }); |
---|
943 | return TheImg; |
---|
944 | } |
---|
945 | |
---|
946 | |
---|
947 | } // function |
---|
948 | ); // ready |
---|
949 | /* |
---|
950 | * |
---|
951 | */ |
---|
952 | jQuery.extend(jQuery.expr[':'], { |
---|
953 | // Nom du sélecteur personnalisé |
---|
954 | Description: function (a) { |
---|
955 | n = jQuery(a).info(); |
---|
956 | return a; |
---|
957 | |
---|
958 | } |
---|
959 | }); |
---|
960 | |
---|
961 | /* Extension |
---|
962 | * absolutize: |
---|
963 | * relativize: |
---|
964 | */ |
---|
965 | //========================================================= |
---|
966 | jQuery.fn.extend({ |
---|
967 | recentrage_widget: function () { |
---|
968 | jQuery('html,body').stop().scrollTop(0); |
---|
969 | jQuery('html,body').stop().scrollLeft(0); |
---|
970 | jQuery(".ui-widget-overlay").css("opacity", "0.75"); |
---|
971 | |
---|
972 | l1 = (jQuery(window).width() - (jQuery(".gmapsPopup").width()))/2; |
---|
973 | h1 = (jQuery(window).height() - (jQuery(".gmapsPopup").height()))/2; |
---|
974 | |
---|
975 | jQuery(".gmapsPopup").css("left", l1 + "px"); |
---|
976 | jQuery(".gmapsPopup").css("top", h1 + "px"); |
---|
977 | |
---|
978 | }, |
---|
979 | //------------------------------------------------------- |
---|
980 | absolutize: function (element) { |
---|
981 | element = jQuery(element).get(0); |
---|
982 | if (element.getStyle('position') == 'absolute') return; |
---|
983 | // Position.prepare(); // To be done manually by Scripty when it needs it. |
---|
984 | |
---|
985 | var offsets = element.positionedOffset(); |
---|
986 | var top = offsets[1]; |
---|
987 | var left = offsets[0]; |
---|
988 | var width = element.clientWidth; |
---|
989 | var height = element.clientHeight; |
---|
990 | |
---|
991 | element._originalLeft = left - parseFloat(element.style.left || 0); |
---|
992 | element._originalTop = top - parseFloat(element.style.top || 0); |
---|
993 | element._originalWidth = element.style.width; |
---|
994 | element._originalHeight = element.style.height; |
---|
995 | |
---|
996 | element.style.position = 'absolute'; |
---|
997 | element.style.top = top + 'px'; |
---|
998 | element.style.left = left + 'px'; |
---|
999 | element.style.width = width + 'px'; |
---|
1000 | element.style.height = height + 'px'; |
---|
1001 | return element; |
---|
1002 | }, |
---|
1003 | |
---|
1004 | relativize: function (element) { |
---|
1005 | element = jQuery(element).get(0); ; |
---|
1006 | if (jQuery(element).css('position') == 'relative') return; |
---|
1007 | // Position.prepare(); // To be done manually by Scripty when it needs it. |
---|
1008 | element._originalLeft = parseFloat(element.style.left || 0); |
---|
1009 | element._originalTop = parseFloat(element.style.top || 0); |
---|
1010 | element._originalWidth = element.style.width; |
---|
1011 | element._originalHeight = element.style.height; |
---|
1012 | |
---|
1013 | element.style.position = 'relative'; |
---|
1014 | var top = parseFloat(element.style.top || 0) - (element._originalTop || 0); |
---|
1015 | var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0); |
---|
1016 | |
---|
1017 | element.style.top = top + 'px'; |
---|
1018 | element.style.left = left + 'px'; |
---|
1019 | // element.style.height = element._originalHeight; |
---|
1020 | // element.style.width = element._originalWidth; |
---|
1021 | return element; |
---|
1022 | } |
---|
1023 | //========================================================= |
---|
1024 | }); // fin extend |
---|