PageSourceSearch

https://www.marches-publics.gouv.fr/assets/a1c7e1cd/scripts.js

js marches-publics.gouv.fr collected 2026-10-02 16:18:37 UTC 75,722 bytes, 3,584 lines download raw bytes

1/*
2 * Copyright (C) Atexo - All Rights Reserved
3 * Unauthorized copying of this file, via any medium is strictly prohibited
4 * Proprietary and confidential
5 */
6
7// JavaScript Document
8
9
10
11
12//<!--
13
14//////////////////////////////////////Fiche conseil////////////////////////////////////////////
15
16J(document).ready(function(){
17
18		//Feedback message appear with fadIn
19		J(".bloc-message:visible").hide().fadeIn(1200);
20
21		//Display alt value as a title on mouseover
22		J('img').hover(function() {
23			if (J(this).attr('alt')!='') {
24				var title = J(this).attr('alt');
25				J(this).attr('title',title);
26			}
27		}, function() {
28			J(this).removeAttr('title');
29		});
30
31		//Display tootltip for abbr
32		J("abbr.info-suite").hover(function(){
33			J(this).data('title',J(this).attr("title"));
34			J(this).attr("title","");
35		},function() {
36			J(this).attr("title", J(this).data('title'));
37		});
38
39
40		J('#ficheConseil').hide().fadeIn(800);
41
42		J(".btn-toggle").click(function() {
43			J(".fiche-content").slideToggle(200);
44			J("#ficheConseil").toggleClass("collapsed").toggleClass("expanded");
45		})
46
47		//Fonction toggle detail
48		J(".detail-toggle-all").click(function() {
49			if(J(this).hasClass("btn-closed")) {
50				J(this).toggleClass("btn-closed");
51				J(".detail-toggle").removeClass("btn-closed");
52				J(".ligne-detail-lot").removeClass("expanded").addClass("collapsed");
53
54			} else {
55				J(this).addClass("btn-closed");
56				J(".detail-toggle").addClass("btn-closed");
57				J(".ligne-detail-lot").removeClass("collapsed").addClass("expanded");
58			}
59		});
60
61		J(".detail-toggle").click(function() {
62			if(J(this).hasClass("btn-closed")) {
63				J(this).toggleClass("btn-closed");
64				J(this).parents('tr').next(".ligne-detail-lot").removeClass("expanded").addClass("collapsed");
65			} else {
66				J(this).addClass("btn-closed");
67				J(this).parents('tr').next(".ligne-detail-lot").removeClass("collapsed").addClass("expanded");
68			}
69		});
70
71		J(".detail-toggle-one-lot").click(function() {
72			if(J(this).hasClass("clicked")) {
73				J(this).toggleClass("btn-closed");
74				J(this).parents('tr').next(".ligne-detail-one-lot").removeClass("expanded").addClass("collapsed");
75			} else {
76				J(this).addClass("btn-closed");
77				J(this).parents('tr').next(".ligne-detail-one-lot").removeClass("collapsed").addClass("expanded");
78			}
79		});
80
81
82		J('.expandTogglePanels').click(function() {
83			J('.panel').css('display','block');
84			J('.title-toggle').removeClass('title-toggle').addClass('title-toggle-open');
85		});
86		J('.collapseTogglePanels').click(function() {
87			J('.panel').css('display','none');
88			J('.title-toggle-open').removeClass('title-toggle-open').addClass('title-toggle');
89		});
90		J( ".saisir-appartenance-tranches" ).click(function() {
91			J(".modal-appartenance-tranches").dialog({
92				modal: true,
93				resizable: false,
94				closeText:'Fermer',
95				title:'<h2>'+this.title+'</h2>',
96				dialogClass: 'modal-form popup-small2',
97				open: function(){
98					jQuery('.ui-widget-overlay').bind('click',function(){
99						J(".modal-appartenance-tranches").dialog('close');
100					})
101				}
102			});
103		});
104
105		J( ".message-confirmation-retour" ).click(function() {
106			J(".modal-confirmation-retour").dialog({
107				modal: true,
108				resizable: false,
109				closeText:'Fermer',
110				title:'<h2>'+this.title+'</h2>',
111				dialogClass: 'modal-form popup-small2',
112				open: function(){
113					jQuery('.ui-widget-overlay').bind('click',function(){
114						J(".modal-form-prix").dialog('close');
115					})
116				}
117			});
118		});
119
120		J( ".message-confirmation-envoi" ).click(function() {
121			J(".modal-confirmation-envoi").dialog({
122				modal: true,
123				resizable: false,
124				closeText:'Fermer',
125				title:'<h2>'+this.title+'</h2>',
126				dialogClass: 'modal-form popup-small2',
127				open: function(){
128					jQuery('.ui-widget-overlay').bind('click',function(){
129						J(".modal-form-prix").dialog('close');
130					})
131				}
132			});
133		});
134
135		//Fonction toggle detail
136		J("#linkContenusTransmis").click(function() {
137			if(J(this).hasClass("title-toggle")) {
138				showLoader();
139				J(this).removeClass("title-toggle").addClass("title-toggle-open");
140				J("#panel_contenu_transmis").show();
141				var buttonShowContenu = "ctl0_CONTENU_PAGE_afficherContenusTransmisButton";
142				J("#"+ buttonShowContenu).trigger( "click" );
143			} else {
144				J(this).removeClass("title-toggle-open").addClass("title-toggle");
145				J("#panel_contenu_transmis").hide();
146			}
147		});
148
149		//Calcul automatique de l'offset du header pour le sticky nav
150		var offsetHeaderTop = J('header').height();
151		J('#horizonatal-menu').attr('data-offset-top', offsetHeaderTop)
152
153		// Navbar fix scrollable height on mobile
154        J(".navbar-collapse").css({ maxHeight: J(window).height() - J(".navbar-header").height() + "px" });
155        // Toggle the dropdown mobile version
156        J(".horizonatal-menu .mobile-search").click(function(e){
157            e.stopPropagation();
158            J(".atx-popover-markup-login-usr").toggleClass("open");
159        });
160
161		J('.ajout-el.ajout-etablissement').on('click', function() {
162			J('#ctl0_CONTENU_PAGE_etablissements_panelDegradeEtab').find('#modalEtablissement').addClass('in');
163			J('#ctl0_CONTENU_PAGE_etablissements_panelDegradeEtab').find('#modalEtablissement').show();
164		});
165
166		J('#modalEtablissement').find("[data-dismiss='modal']").on('click', function(){
167			J('#modalEtablissement').removeClass('in');
168			J('#modalEtablissement').hide();
169		});
170
171        var ifInitMtriggerDropdown = false;
172        function initMtriggerDropdown() {
173        	if(!ifInitMtriggerDropdown){
174            J('.resultSearch .item_consultation .m--triggerDropdown').bind('click', function(e) {
175              var item=J(this);
176              e.preventDefault();
177              e.stopImmediatePropagation();
178              J(this).parents('.item_consultation').find('.actions').toggleClass("m--showActions");
179            });
180            ifInitMtriggerDropdown = true;
181					}
182        }
183
184        function destroyMtriggerDropdown(){
185          if(ifInitMtriggerDropdown) {
186            J('.resultSearch .item_consultation .m--triggerDropdown').unbind('click');
187            J('.item_consultation .actions.m--showActions').removeClass('m--showActions');
188            ifInitMtriggerDropdown = false;
189          }
190        }
191
192        if (J(window).width() <= 1199) {
193          initMtriggerDropdown();
194        }
195
196        // Show Actions Dropdown Responsive
197        J( window ).resize(function() {
198          if (J(window).width() <= 1199) {
199              initMtriggerDropdown();
200          }
201
202          if (J(window).width() > 1199) {
203            destroyMtriggerDropdown();
204          }
205        });
206
207        // Select for page Advanced Search
208        J('.content-advancedSearch #selectRechercheAvance--m').on('change', function (e) {
209            J('#targetRechercheAvance--m li a').eq(J(this).val()).tab('show');
210	});
211
212        J('.content-detailConsult #selectDetailConsultation--m').on('change', function (e) {
213            J('#targetDetailConsultation--m li a').eq(J(this).val()).tab('show');
214        });
215
216        J('#lotsTechniqueChecked').hide();
217        if (J('#ctl0_CONTENU_PAGE_bloc_etapeDonneesComplementaires_donneeVariante_CcagRef').val() == 3) {
218            J("#lotsTechniqueChecked").show();
219        }
220
221		J('.popover-contratContent').on('click', function(){
222			var curUrl = J(this).parent('.ref-line').find('.popover-template .bouton').attr('onclick');
223
224			setTimeout(function() {
225				J('.popover.fade.show.bs-popover-top').find('.boutons a').attr('onclick', curUrl);
226			}, 500)
227
228		});
229
230		J(document).on("click", ".link-modify-contract", function () {
231			var elem = J(this);
232			var elemById = J("#" + elem.attr('id'));
233			popUp(elemById.attr('data-url'), elemById.attr('data-scrollbar'));
234		});
235	});
236
237//Disable toggle panel onclick
238function disableTogglePanels(myInput,panelClass) {
239	var panel = J('.'+panelClass);
240	if (myInput.checked == true) {
241		panel.addClass('panel-off');
242		//panel.css('pointer-events','none');
243		panel.find('.title-toggle-open').addClass('detail-toggle-inactive');
244		panel.find('.title-toggle').addClass('detail-toggle-inactive');
245		J('.cover').show();
246	}
247	else {
248		return false;
249	}
250}
251//Enable toggle panel onclick
252function enableTogglePanels(myInput,panelClass) {
253	var panel = J('.'+panelClass);
254	if (myInput.checked == true) {
255		//panel.css('pointer-events','inherit');
256		panel.removeClass('panel-off');
257		J('.detail-toggle-inactive').css('class','title-toggle-open');
258		panel.find('.title-toggle-open').removeClass('detail-toggle-inactive');
259		panel.find('.title-toggle').removeClass('detail-toggle-inactive');
260		J('.cover').hide();
261	}
262	else {
263		return false;
264	}
265}
266
267function initFunctions () {
268
269	if (document.getElementById("main-part")) {
270
271		if (document.getElementById("menu") && document.getElementById("main-part").offsetHeight) {
272
273			resetElementHeight();
274
275		}
276
277		else {}
278
279	}
280
281
282
283	if (document.getElementById("ctl0_CONTENU_PAGE_mainPart")) {
284
285
286
287		if (document.getElementById("menu") && document.getElementById("ctl0_CONTENU_PAGE_mainPart").offsetHeight) {
288
289			resetElementHeight();
290
291		}
292
293		else {}
294
295	}
296
297	else {}
298
299	open_ext_link();
300
301}
302
303
304
305function resetElementHeight() {
306
307	if (document.getElementById("main-part")) {
308
309		divHeight = document.getElementById("main-part").offsetHeight;
310
311		leftMenu = document.getElementById("menu").offsetHeight;
312
313
314
315		highestElement = Math.max(divHeight,leftMenu);
316
317
318
319		if (leftMenu < divHeight) {
320
321			document.getElementById("menu").style.height = highestElement + 'px';
322
323		}
324
325		if (leftMenu == divHeight) {
326
327		}
328
329		if (leftMenu > divHeight) {
330
331			//alert('left plus grand');
332
333			document.getElementById("main-part").style.height = 'auto';
334
335			document.getElementById("menu").style.height = 'auto';
336
337			divHeight = document.getElementById("main-part").offsetHeight;
338
339			leftMenu = document.getElementById("menu").offsetHeight;
340
341			highestElement = Math.max(divHeight,leftMenu);
342
343			document.getElementById("menu").style.height = highestElement + 'px';
344
345		}
346
347
348
349	}
350
351
352
353	if (document.getElementById("ctl0_CONTENU_PAGE_mainPart")) {
354
355
356
357		divHeight = document.getElementById("ctl0_CONTENU_PAGE_mainPart").offsetHeight;
358
359		leftMenu = document.getElementById("menu").offsetHeight;
360
361
362
363		highestElement = Math.max(divHeight,leftMenu);
364
365
366
367		if (leftMenu < divHeight) {
368
369			document.getElementById("menu").style.height = highestElement + 'px';
370
371		}
372
373		if (leftMenu == divHeight) {
374
375		}
376
377		if (leftMenu > divHeight) {
378
379			//alert('left plus grand');
380
381			document.getElementById("ctl0_CONTENU_PAGE_mainPart").style.height = 'auto';
382
383			document.getElementById("menu").style.height = 'auto';
384
385			divHeight = document.getElementById("ctl0_CONTENU_PAGE_mainPart").offsetHeight;
386
387			leftMenu = document.getElementById("menu").offsetHeight;
388
389			highestElement = Math.max(divHeight,leftMenu);
390
391			document.getElementById("menu").style.height = highestElement + 'px';
392
393		}
394
395	}
396
397	else {}
398
399}
400
401
402
403function checkHeight () {
404
405
406
407	if (leftMenu < divHeight) {
408
409        bootbox.alert('left plus petit');
410
411		document.getElementById("menu").style.height = divHeight + "px";
412
413		leftMenu = document.getElementById("menu").style.height;
414
415	}
416
417	else if (leftMenu == divHeight) {
418
419        bootbox.alert('left egal');
420
421
422
423		document.getElementById("menu").style.height = 'auto';
424
425		leftMenu = document.getElementById("menu").offsetHeight;
426
427	}
428
429	else if (leftMenu > divHeight) {
430
431        bootbox.alert('left plus grand');
432
433		//alert('no');
434
435		//alert('hgf');
436
437		divHeight = document.getElementById("menu").offsetHeight;
438
439		document.getElementById("menu").style.height = offsetHeight;
440
441	}
442
443}
444
445
446
447
448
449/*set left-menu background height*/
450
451window.onload = function () {
452
453	if (document.getElementById("main-part")) {
454
455
456
457		if (document.getElementById("menu") && document.getElementById("main-part").offsetHeight) {
458
459			resetElementHeight();
460
461		}
462
463		else {}
464
465	}
466
467	if (document.getElementById("ctl0_CONTENU_PAGE_mainPart")) {
468
469
470
471		if (document.getElementById("menu") && document.getElementById("ctl0_CONTENU_PAGE_mainPart").offsetHeight) {
472
473			resetElementHeight();
474
475		}
476
477		else {}
478
479	}
480
481	else {}
482
483	open_ext_link();
484
485}
486
487
488
489
490
491/*date dans le header*/
492
493setInterval('dispDate()', 1000);
494
495function dispDate(){
496
497	myDate = new Date();
498
499	now = new Date();
500
501	jour = now.getDate();
502
503	mois = now.getMonth() + 1;
504
505	annee = now.getFullYear();
506
507	heure = now.getHours();
508
509	minute = now.getMinutes();
510
511
512
513	heure  = ((heure < 10) ? "0" + heure : heure);
514
515	minute  = ((minute < 10) ? "0" + minute : minute);
516
517
518
519	var lettres = ("" + now.toGMTString() + "");
520
521
522
523	//On recherche le jour de la semaine
524
525	var joursemaine = lettres.substring(0,3);
526
527	var js = "";
528
529	var mois2 = "";
530
531
532
533	if(joursemaine=="Mon"){
534
535		js="Lundi";}
536
537	if(joursemaine=="Tue"){
538
539		js="Mardi";}
540
541	if(joursemaine=="Wed"){
542
543		js="Mercredi";}
544
545	if(joursemaine=="Thu"){
546
547		js="Jeudi";}
548
549	if(joursemaine=="Fri"){
550
551		js="Vendredi";}
552
553	if(joursemaine=="Sat"){
554
555		js="Samedi";}
556
557	if(joursemaine=="Sun"){
558
559		js="Dimanche";}
560
561
562
563	//On recherche le mois
564
565	if(mois=="1"){
566
567		mois2="janv.";}
568
569	if(mois=="2"){
570
571		mois2="f&eacute;.";}
572
573	if(mois=="3"){
574
575		mois2="mars";}
576
577	if(mois=="4"){
578
579		mois2="avril";}
580
581	if(mois=="5"){
582
583		mois2="mai";}
584
585	if(mois=="6"){
586
587		mois2="juin";}
588
589	if(mois=="7"){
590
591		mois2="juillet";}
592
593	if(mois=="8"){
594
595		mois2="ao&ucirc;t";}
596
597	if(mois=="9"){
598
599		mois2="sept.";}
600
601	if(mois=="10"){
602
603		mois2="oct.";}
604
605	if(mois=="11"){
606
607		mois2="nov.";}
608
609	if(mois=="12"){
610
611		mois2="d&eacute;.";}
612
613
614
615	var eme = "";
616
617	if(jour==1){
618
619		eme = " er";}
620
621
622
623	if (document.getElementById('displayTime')) {
624
625		document.getElementById('displayTime').innerHTML = (js + ' ' + jour + eme + ' ' + mois2 + ' ' + annee + ' ' + heure + ':' + minute);
626
627	}
628
629}
630
631
632
633
634
635/*Passer à l'onglet suivant*/
636
637function showNextTab () {
638
639
640
641	var myNav = document.getElementById('form-nav');
642
643	for (i=0;i<myNav.childNodes.length;i++) {
644
645		if (myNav.childNodes[i].className == 'tab-on') {
646
647			var myTab = myNav.childNodes[i].id;
648
649			var myLayer = (myTab.substring(7,6));
650
651		}
652
653	}
654
655
656
657	var myTabPosition = (myTab.substring(7,6));
658
659	d = myTabPosition * 1;
660
661	var nextTabId = 'onglet'+(d+1);
662
663	//alert(nextTabId);
664
665	document.getElementById(myTab).className = 'tab';
666
667	document.getElementById(nextTabId).className = 'tab-on';
668
669	myTab = nextTabId ;
670
671	//alert('onglet'+'Layer'+d);
672
673	document.getElementById('onglet'+'Layer'+d).style.display = 'none';
674
675	document.getElementById('onglet'+'Layer'+(d+1)).style.display = 'block';
676
677
678
679	initFunctions();
680
681}
682
683
684
685
686
687
688
689/*Checks IE 6.0*/
690
691var name = navigator.appName ;
692
693var version = navigator.appVersion;
694
695
696
697if (name == 'Microsoft Internet Explorer') {
698
699	id = version.indexOf('MSIE');
700
701	version = version.substring(id+5,id+9);
702
703}
704
705
706
707/*open close panel*/
708
709function togglePanel(myPosition,myPanel) {
710
711	var layer = document.getElementById(myPanel);
712
713	if (layer == null) {
714		return;
715	}
716	if (layer.style.display == 'none') {
717
718		layer.style.display = 'block';
719
720		myPosition.className = "title-toggle-open";
721
722	}
723
724	else if (layer.style.display == 'block') {
725
726		layer.style.display = 'none';
727
728		myPosition.className = "title-toggle";
729
730	}
731
732	initFunctions();
733
734}
735
736
737
738/*Menu gauche rubrique*/
739
740function toggleMenu(myItem) {
741
742
743
744	var myToggleItem =  document.getElementById(myItem);
745
746	var getParentClass = myToggleItem.parentNode.className;
747
748
749
750	if (myToggleItem.style.display == 'block') {
751
752		myToggleItem.style.display = 'none';
753
754		if (getParentClass == 'menu-open menu-on') {
755
756			myToggleItem.parentNode.className = 'menu-open menu-on' + ' toggle-off';
757
758		}
759
760		if (getParentClass == 'menu-open') {
761
762			myToggleItem.parentNode.className = 'menu-open' + ' toggle-off';
763
764		}
765
766		if (getParentClass == 'menu-open toggle-on') {
767
768			myToggleItem.parentNode.className = 'menu-open';
769
770		}
771
772		else {}
773
774	}
775
776	else if (myToggleItem.style.display == 'none') {
777
778		myToggleItem.style.display = 'block';
779
780		if (getParentClass == 'menu-open menu-on toggle-off') {
781
782			myToggleItem.parentNode.className = 'menu-open menu-on';
783
784		}
785
786		if (getParentClass == 'menu-open toggle-on') {
787
788			myToggleItem.parentNode.className = 'menu-open';
789
790		}
791
792		if (getParentClass == 'menu-open') {
793
794			myToggleItem.parentNode.className = 'menu-open toggle-on toggle-on--relative';
795
796		}
797
798		else {}
799
800	}
801	if (document.getElementById('menu')) {
802		document.getElementById('menu').style.height = '100%';
803	}
804
805	initFunctions();
806
807}
808
809
810
811/*sous menu avec fleche*/
812
813function toggleSousMenu(myPosition,myItem) {
814
815
816
817	var myToggleItem =  document.getElementById(myItem);
818
819	if (myToggleItem.style.display == 'block') {
820
821		myToggleItem.style.display = 'none';
822
823		myPosition.parentNode.className = 'off';
824
825	}
826
827	else if (myToggleItem.style.display == 'none') {
828
829		myToggleItem.style.display = 'block';
830
831		myPosition.parentNode.className = 'on';
832
833	}
834
835	initFunctions();
836
837}
838
839
840
841
842
843
844
845function resetSsmenu(myPosition) {
846
847	var mySsliste = myPosition.parentNode.childNodes;
848
849	for (g=0;g<mySsliste.length;g++) {
850
851		if (mySsliste[g].tagName == 'UL') {
852
853			var mySilbing = mySsliste[g].childNodes;
854
855			for (a=0;a<mySilbing.length;a++) {
856
857				if (mySilbing[a].nodeType == 1 && mySilbing[a].tagName == 'LI') {
858
859					mySilbing[a].className = 'off';
860
861					//alert(mySilbing[1].tagName);
862
863					if(navigator.appName == "Microsoft Internet Explorer") {
864
865						mySilbing[0].className = 'on';
866
867					}
868
869					else {
870
871						mySilbing[1].className = 'on';
872
873					}
874
875
876
877				}
878
879			}
880
881		}
882
883	}
884
885}
886
887
888
889
890
891
892
893/*Show layer according to tabs*/
894
895function showHideLayer(myLayer,myParent,nbOnglet) {
896
897	for (t=1;t<=nbOnglet;t++) {
898
899		layers = 'ongletLayer'+t;
900
901		if(document.getElementById(layers)) {
902			document.getElementById(layers).style.display = 'none';
903		}
904
905	}
906	if(document.getElementById(myLayer)) {
907		document.getElementById(myLayer).style.display = 'block';
908	}
909
910
911	var myNav = document.getElementById('form-nav');
912
913	for (i=0;i<myNav.childNodes.length;i++) {
914
915		if (myNav.childNodes[i].className == 'tab-on') {
916
917			if ( myNav.childNodes[i].className == 'tab-inactive') {
918
919				myNav.childNodes[i].className = 'tab-inactive';
920
921			}
922
923			else {
924
925				myNav.childNodes[i].className = 'tab';
926
927			}
928
929		}
930
931	}
932
933	myParent.parentNode.className = 'tab-on';
934
935	initFunctions ();
936
937	ongletActive = document.getElementById('ongletActive');
938
939	if(ongletActive) {
940
941		ongletActive.value = myLayer[myLayer.length-1];
942
943	}
944
945}
946
947
948
949
950
951function showDiv(myDiv) {
952
953	document.getElementById(myDiv).style.display = 'block';
954
955	initFunctions();
956
957
958
959}
960
961function hideDiv(myDiv) {
962
963	document.getElementById(myDiv).style.display = 'none';
964
965	initFunctions();
966
967
968
969}
970
971
972
973/*onclick, show element1 and hide element2 */
974
975function showHideElement(element1,element2) {
976
977	document.getElementById(element1).style.display = 'block';
978
979	document.getElementById(element2).style.display = 'none';
980
981	initFunctions();
982
983}
984
985
986
987
988
989
990
991/*display panel according to option choice*/
992
993function displayOptionChoice(mySelect) {
994
995	var totalOptions = mySelect.options;
996
997	for (i=0;i<totalOptions.length;i++) {
998
999		var totalLayers = (totalOptions[i].getAttribute('value'));
1000		document.getElementById(totalLayers).style.display = 'none';
1001	}
1002	if(document.getElementById('PF1') != null){
1003		document.getElementById('PF1').style.display = 'none';
1004	}
1005	if(document.getElementById('PM1') != null){
1006		document.getElementById('PM1').style.display = 'none';
1007	}
1008	if(document.getElementById('PU1') != null){
1009		document.getElementById('PU1').style.display = 'none';
1010	}
1011
1012	document.getElementById(mySelect.options[mySelect.selectedIndex].value).style.display = 'block';
1013	if(document.getElementById(mySelect.options[mySelect.selectedIndex].value+'1') != null){
1014		document.getElementById(mySelect.options[mySelect.selectedIndex].value+'1').style.display = 'block';
1015	}
1016	initFunctions();
1017
1018}
1019
1020
1021
1022function displayDpi(mySelect) {
1023	var selected = mySelect.options[mySelect.selectedIndex].value;
1024	if(selected != '4' && selected != '5'){
1025		var ccagDpiSelect =mySelect.id.replace("CcagRef", "CcagDpi");
1026		document.getElementById(ccagDpiSelect).selectedIndex = 0;
1027		document.getElementById("divCcagDpi").style.display = 'none';
1028	}else{
1029		document.getElementById("divCcagDpi").style.display = 'none';
1030	}
1031
1032	var element =  document.getElementById("lotsTechniqueChecked");
1033	if (typeof(element) != 'undefined' && element != null)
1034	{
1035		document.getElementById("lotsTechniqueChecked").style.display = 'none';
1036		if (selected == 3) {
1037			document.getElementById("lotsTechniqueChecked").style.display = 'block';
1038		}
1039	}
1040
1041
1042	initFunctions();
1043}
1044
1045
1046function displayOptionChoiceCritere(mySelect) {
1047
1048	var totalOptions = mySelect.options;
1049
1050	for (i=0;i<totalOptions.length;i++) {
1051
1052		var totalLayers = (totalOptions[i].getAttribute('value'));
1053		if(document.getElementById(totalLayers))
1054			document.getElementById(totalLayers).style.display = 'none';
1055	}
1056	document.getElementById(mySelect.options[mySelect.selectedIndex].value).style.display = 'block';
1057	initFunctions();
1058}
1059
1060
1061
1062
1063/*display panel according to 1 option choice*/
1064
1065function displayOneOptionPanel(mySelect,myIndex,myDiv) {
1066
1067	if (mySelect.selectedIndex == myIndex) {
1068		document.getElementById(myDiv).style.display = 'block';
1069
1070	}
1071
1072	else {
1073		document.getElementById(myDiv).style.display = 'none';
1074
1075	}
1076
1077	initFunctions();
1078
1079}
1080
1081
1082
1083
1084
1085/*hide panel according to 1 option choice*/
1086
1087function hideOneOptionPanel(mySelect,myIndex,myDiv) {
1088
1089	if (mySelect.selectedIndex == myIndex) {
1090
1091		document.getElementById(myDiv).style.display = 'none';
1092
1093	}
1094
1095	else {
1096
1097		document.getElementById(myDiv).style.display = 'block';
1098
1099	}
1100
1101	initFunctions();
1102
1103}
1104
1105
1106
1107
1108
1109
1110
1111/*If checkbox is checked, displays 1 Div*/
1112
1113function isCheckedShowDiv(myInput,myDiv) {
1114	if (document.getElementById(myDiv)){
1115		if (myInput.checked == true) {
1116			document.getElementById(myDiv).style.display = 'block';
1117		}
1118		if (myInput.checked == false) {
1119			document.getElementById(myDiv).style.display = 'none';
1120		}
1121		initFunctions();
1122	}
1123}
1124
1125
1126
1127function isCheckedHideDiv(myInput,myDiv) {
1128	if (document.getElementById(myDiv)){
1129		if (myInput.checked == true) {
1130			document.getElementById(myDiv).style.display = 'none';
1131		}
1132		if (myInput.checked == false) {
1133			document.getElementById(myDiv).style.display = 'block';
1134		}
1135		initFunctions();
1136	}
1137}
1138
1139
1140
1141/*If checkbox is checked, displays 1 Div and hide 1 div */
1142
1143function isChecked2(myInput,myDiv1,myDiv2) {
1144
1145	if (myInput.checked == true) {
1146
1147		document.getElementById(myDiv1).style.display = null;
1148
1149		document.getElementById(myDiv2).style.display = 'none';
1150
1151	}
1152
1153	if (myInput.checked == false) {
1154
1155		document.getElementById(myDiv1).style.display = 'none';
1156
1157		document.getElementById(myDiv2).style.display = null;
1158
1159	}
1160
1161	initFunctions();
1162
1163}
1164
1165
1166
1167/*If checkbox is checked, displays table line*/
1168
1169function isCheckedShowLine(myInput,myLine) {
1170
1171	if (myInput.checked == true) {
1172
1173		document.getElementById(myLine).style.display = '';
1174
1175	}
1176
1177	if (myInput.checked == false) {
1178
1179		document.getElementById(myLine).style.display = 'none';
1180
1181	}
1182
1183	initFunctions();
1184
1185}
1186
1187function activateSelect(mySelect) {
1188
1189	document.getElementById(mySelect).disabled = false;
1190
1191}
1192
1193function disactivateSelect(mySelect) {
1194
1195	document.getElementById(mySelect).disabled = true;
1196
1197}
1198
1199
1200
1201function disableInput(myCheckbox,myInput) {
1202
1203	if (myCheckbox.checked == true ) {
1204
1205		document.getElementById(myInput).disabled = true;
1206
1207	}
1208
1209	if (myCheckbox.checked == false ) {
1210
1211		document.getElementById(myInput).disabled = false;
1212
1213	}
1214
1215}
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225/*Clear input default value onclick */
1226
1227function clearOnFocus(e,o){
1228
1229	if(o.firstTime){return}
1230
1231	o.firstTime=true
1232
1233	o.value="";
1234
1235}
1236
1237
1238
1239
1240
1241/*popup*/
1242
1243var newWin = null;
1244
1245function popUp(strURL,strScrollbars) {
1246
1247	popUpName(strURL,strScrollbars,'newWin');
1248
1249}
1250
1251function popUpOpen(URL, name, specs) {
1252
1253    newWin = window.open(URL, name, specs);
1254
1255    newWin.focus();
1256
1257}
1258
1259
1260function popUpName(strURL,strScrollbars,name) {
1261
1262	/*if (newWin !== null) {
1263
1264	 if(!newWin.closed) {
1265
1266	 newWin.close();
1267
1268	 }
1269
1270	 }*/
1271
1272	var strOptions="";
1273
1274	strOptions="toolbar=no,menubar=no,scrollbars="+strScrollbars+",resizable,location=no";
1275
1276	newWin = window.open(strURL, name, strOptions);
1277
1278	newWin.focus();
1279
1280}
1281
1282/*popup Formulaire SUB*/
1283/* 0032110: Reponse Of : interdire l ouverture de plusieurs popup */
1284
1285var newWinFormulaireSub = null;
1286
1287function popUpFormulaireSub(strURL,strScrollbars) {
1288
1289	if (newWinFormulaireSub !== null) {
1290		if(!newWinFormulaireSub.closed) {
1291			newWinFormulaireSub.close();
1292		}
1293	}
1294
1295	var strOptions="";
1296
1297	strOptions="toolbar=no,menubar=no,scrollbars="+strScrollbars+",resizable,location=no";
1298
1299	newWinFormulaireSub = window.open(strURL, 'newWinFormulaireSub', strOptions);
1300
1301	newWinFormulaireSub.focus();
1302
1303}
1304
1305
1306
1307/*Ajuste taille popup si calendrier dépasse*/
1308
1309function resetPopupHeight(myCalendarPositionTop) {
1310
1311
1312
1313	var calendarHeight = document.getElementById('calendar').offsetHeight;
1314
1315	var myPageHeight = document.body.offsetHeight;
1316
1317
1318	var newHeight =myCalendarPositionTop+calendarHeight;
1319
1320
1321
1322	if (document.getElementById('container')) {
1323
1324		var pageHeight = document.getElementById('container').offsetHeight;
1325		var myPageWidth = document.getElementById('container').offsetWidth;
1326
1327		var bodyWidth = document.body.offsetWidth;
1328
1329		if (newHeight>pageHeight) {
1330
1331			// commenter comme correctif du mantis 21012: Dans l'onglet calendrier lorsqu'on appuie sur l'icone calendrier la page du navigateur rétrécit
1332			//prb avec IE9
1333			//window.resizeTo(myPageWidth+50,newHeight+70+myCalendarPositionTop);
1334
1335			document.body.style.overflow = 'visible';
1336
1337		}
1338
1339		else {
1340
1341			document.body.style.position = 'relative';
1342
1343			document.body.style.overflow = 'initial';
1344
1345		}
1346
1347
1348
1349	}
1350
1351}
1352
1353
1354function popupResize (containerId) {
1355
1356
1357
1358	if (containerId == null) {
1359
1360		containerId = "container";
1361
1362	}
1363
1364	var pageHeight = document.getElementById(containerId).offsetHeight;
1365
1366	var pageWidth = document.getElementById(containerId).offsetWidth;
1367
1368
1369
1370	var name = navigator.appName ;
1371
1372	var version = navigator.appVersion;
1373
1374
1375
1376	var autoLeft = (screen.availWidth-pageWidth)/2;
1377
1378	var autoTop = (screen.availHeight-pageHeight)/2;
1379
1380//nous avons enlevé 15 du screen.availHeight pour prendre en concideration la barre des taches
1381	var screenAvailHeight = screen.availHeight-15;
1382
1383	/*if popup content higher than screen height*/
1384
1385	if (pageHeight > screenAvailHeight) {
1386
1387		/*if IE*/
1388
1389		if (name == 'Microsoft Internet Explorer') {
1390
1391			id = version.indexOf('MSIE');
1392
1393			version = version.substring(id+5,id+9);
1394
1395			/*if IE 7*/
1396
1397			if ( version == '7.0;') {
1398
1399				//alert(version);
1400
1401				window.resizeTo(pageWidth+50,screenAvailHeight-100);
1402
1403				window.moveTo(autoLeft-20,50);
1404
1405			}
1406
1407			/*if other IE version*/
1408
1409			else {
1410
1411				window.resizeTo(pageWidth+50,screenAvailHeight-100);
1412
1413				window.moveTo(autoLeft,50);
1414
1415			}
1416
1417		}
1418
1419		/*if other navitor*/
1420
1421		else {
1422
1423			window.resizeTo(pageWidth+50,screenAvailHeight-100);
1424
1425			window.moveTo(autoLeft,50);
1426
1427		}
1428
1429	}
1430
1431	/*else if content smaller than screen height */
1432
1433	else {
1434
1435		/*if IE*/
1436
1437		if (name == 'Microsoft Internet Explorer') {
1438
1439			id = version.indexOf('MSIE');
1440
1441			version = version.substring(id+5,id+9);
1442
1443			/*if IE 7*/
1444
1445			if ( version == '7.0;') {
1446
1447				//alert(version);
1448
1449				window.resizeTo(pageWidth+50,pageHeight+100);
1450
1451				window.moveTo(autoLeft-20,autoTop);
1452
1453			}
1454
1455			/*if other IE version*/
1456
1457			else {
1458
1459				window.resizeTo(pageWidth+50,pageHeight+80);
1460
1461				window.moveTo(autoLeft,autoTop);
1462
1463			}
1464
1465		}
1466
1467		/*if other navitor*/
1468
1469		else {
1470
1471			window.resizeTo(pageWidth+50,pageHeight+100);
1472
1473			window.moveTo(autoLeft,autoTop);
1474
1475		}
1476
1477	}
1478
1479
1480
1481}
1482
1483
1484
1485
1486
1487
1488/*Auto position Message alertes*/
1489
1490function autoPositionPopup () {
1491
1492
1493
1494	var name = navigator.appName ;
1495
1496	var version = navigator.appVersion;
1497
1498
1499
1500	var autoLeft = (screen.availWidth)/2;
1501
1502	var autoTop = (screen.availHeight)/2;
1503
1504
1505
1506	window.moveTo(autoLeft-200,autoTop-100);
1507
1508}
1509
1510
1511
1512
1513
1514
1515
1516/*popup with set height and width*/
1517
1518var newWinSetSize = null;
1519
1520function popUpSetSize(strURL,strWidth,strHeight, strScrollbars ,popupName) {
1521popupName = popupName || 'newWin';
1522
1523	if (newWinSetSize !== null) {
1524
1525		if(!newWinSetSize.closed) {
1526
1527			newWinSetSize.close();
1528
1529		}
1530
1531	}
1532
1533
1534
1535	var strOptions="";
1536
1537	strOptions="toolbar=no,menubar=no,scrollbars="+strScrollbars+",resizable,location=no,height="+strHeight+",width="+strWidth;
1538
1539	newWinSetSize = window.open(strURL, popupName, strOptions);
1540
1541	newWinSetSize.focus();
1542
1543}
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553//Check/Uncheck All checkboxes
1554
1555
1556
1557function CheckAll(chk)
1558
1559{
1560
1561	for (i = 0; i < chk.length; i++)
1562
1563		chk[i].checked = true ;
1564
1565}
1566
1567
1568
1569function UnCheckAll(chk)
1570
1571{
1572
1573	for (i = 0; i < chk.length; i++)
1574
1575		chk[i].checked = false ;
1576
1577}
1578
1579
1580
1581
1582
1583function isCheckedCheckAll(myInput,myInputList) {
1584
1585
1586
1587	if (myInput.checked == true) {
1588
1589		CheckAll(myInputList);
1590
1591	}
1592
1593	if (myInput.checked == false) {
1594
1595		UnCheckAll(myInputList);
1596
1597	}
1598
1599}
1600
1601
1602
1603/*show or hide collection of input */
1604
1605function showHideCollection(myInput,collection1,collection2,totalCollection) {
1606
1607	var myCollectionToShow = collection1 +"_";
1608
1609	var myCollectionToHide = collection2 +"_";
1610
1611
1612
1613	if (myInput.checked == true) {
1614
1615		//show col 2 and hide col 1
1616
1617		for (i=1; i<(totalCollection+1); i++) {
1618
1619			document.getElementById(myCollectionToShow+[i]).style.display = 'block';
1620
1621			document.getElementById(myCollectionToHide+[i]).style.display = 'none';
1622
1623			//alert(myCollectionToShow+[i]);
1624
1625		}
1626
1627	}
1628
1629	if (myInput.checked == false) {
1630
1631		//show col 1 and hide col 2
1632
1633		for (i=1; i<(totalCollection+1); i++) {
1634
1635			document.getElementById(myCollectionToHide+[i]).style.display = 'block';
1636
1637			document.getElementById(myCollectionToShow+[i]).style.display = 'none';
1638
1639		}
1640
1641	}
1642
1643}
1644
1645
1646
1647
1648
1649/*Check Uncheck collection of radio buttons */
1650
1651function isCheckedCheckAllRadio(myInput,myVersion,version,totalCollection) {
1652
1653	var myCollection = myVersion +"_";
1654
1655	for (i=1; i<(totalCollection+1); i++) {
1656
1657		var myTotalCollectionToCheckId = myCollection+[i]+'_'+version;
1658
1659		document.getElementById(myTotalCollectionToCheckId).checked =  true;
1660
1661	}
1662
1663}
1664
1665
1666
1667
1668
1669/*Onclick swap image*/
1670
1671var status = false;
1672
1673function swapImage(myImg,img1,img2) {
1674
1675	var imgRoot = 'themes/images/';
1676
1677	if (status == false )  {
1678
1679		myImg.src = imgRoot+img2;
1680
1681		status = true;
1682
1683	}
1684
1685	else if (status == true )  {
1686
1687		myImg.src = imgRoot+img1;
1688
1689		status = false;
1690
1691	}
1692
1693}
1694
1695
1696
1697
1698
1699/////////////////////////////////////////////Floating div////////////////////////////////////////////////
1700
1701
1702
1703
1704
1705/*Transparent layer that makes the the popup parent window inactive*/
1706
1707function overlay(idPopup, idOverlay) {
1708
1709
1710
1711
1712
1713	var el = document.getElementById(idOverlay);
1714
1715	el.style.visibility = (el.style.visibility == "visible") ? "hidden" : "visible";
1716
1717
1718
1719	var myPageHeight = document.body.offsetHeight;
1720
1721	var myPageWidth = document.body.offsetWidth;
1722
1723	document.getElementById(idOverlay).style.width = myPageWidth+'px';
1724
1725	document.getElementById(idOverlay).style.height = myPageHeight+'px';
1726
1727
1728
1729	initFloatingIframe(idPopup);
1730
1731
1732
1733	if (idPopup != undefined) {
1734
1735		autoPositionLayer(idPopup);
1736
1737	}
1738
1739
1740
1741	if (idOverlay == undefined) {
1742
1743		idOverlay = "overlay";
1744
1745	}
1746
1747}
1748
1749
1750
1751
1752
1753function autoPositionLayer(id) {
1754
1755
1756
1757	/*Attention, il faut appeler la fonction 'overlay' avantauto 'PositionLayer' */
1758
1759	var myLayer =  document.getElementById(id);
1760
1761
1762
1763
1764
1765	/*Positionnement horizontal du Div container par rapport a la taille de la fenetre*/
1766
1767	var windowWidth = 0;
1768
1769	if (typeof(window.innerWidth) == 'number') {
1770
1771		windowWidth= window.innerWidth;
1772
1773	}
1774
1775	else {
1776
1777		if (document.documentElement && document.documentElement.clientWidth) {
1778
1779			windowWidth= document.documentElement.clientWidth;
1780
1781		}
1782
1783		else {
1784
1785			if (document.body && document.body.clientWidth) {
1786
1787				windowWidth = document.body.clientWidth;
1788
1789			}
1790
1791		}
1792
1793	}
1794
1795	var newWidth = Math.round(windowWidth/2);
1796
1797	var myContainerWidth = document.getElementById(id).offsetWidth;
1798
1799	var myContainerWidthPosition = myContainerWidth/2;
1800
1801	myLayer.style.left = newWidth-myContainerWidthPosition+'px';
1802
1803
1804
1805
1806
1807	/*Positionnement vertical du Div container par rapport a la taille de la fenetre*/
1808
1809	var windowHeight = 0;
1810
1811	if (typeof(window.innerHeight) == 'number') {
1812
1813		windowHeight= window.innerHeight;
1814
1815	}
1816
1817	else {
1818
1819		if (document.documentElement && document.documentElement.clientHeight) {
1820
1821			windowHeight= document.documentElement.clientHeight;
1822
1823
1824
1825		}
1826
1827		else {
1828
1829			if (document.body && document.body.clientHeight) {
1830
1831				windowHeight = document.body.clientHeight;
1832
1833			}
1834
1835		}
1836
1837	}
1838
1839	var newHeight = Math.round(windowHeight/2);
1840
1841	var myContainerHeight = document.getElementById(id).offsetHeight;
1842
1843	var myContainerHeightPosition = myContainerHeight/2;
1844
1845
1846
1847	if ( version == '6.0;') {
1848
1849		var windowScroll = document.documentElement.scrollTop;
1850
1851		myLayer.style.top = ((windowHeight/2)+windowScroll-myContainerHeightPosition)+'px';
1852
1853
1854
1855	}
1856
1857	else {
1858
1859		myLayer.style.top = newHeight-myContainerHeightPosition+'px';
1860
1861	}
1862
1863
1864
1865}
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875/*Reinitialization of Layer position on Window resize event*/
1876
1877function initLayer() {
1878
1879	if (document.getElementById('overlay')!= "") {
1880
1881		autoPositionLayer();
1882
1883		initFloatingIframe();
1884
1885	}
1886
1887}
1888
1889
1890
1891/*Set Floating Iframe size*/
1892
1893function initFloatingIframe() {
1894
1895	if (document.getElementById('floatingIframe')){
1896
1897		var myIframe = document.getElementById('floatingIframe');
1898
1899		var myContainerHeight = document.getElementById('container').offsetHeight;
1900
1901		var myContainerWidth = document.getElementById('container').offsetWidth;
1902
1903		myIframe.style.height = myContainerHeight+'px';
1904
1905		myIframe.style.width = myContainerWidth+'px';
1906
1907	}
1908
1909}
1910
1911
1912
1913
1914
1915/////////////////////////////////////////////End Floating div////////////////////////////////////////////////
1916
1917
1918
1919
1920
1921/*show or hide all panels*/
1922
1923function showAll(myPanel,NbPanels) {
1924
1925	for (i=0;i<NbPanels;i++) {
1926
1927		var panel = myPanel + '-' + i;
1928
1929		//alert(panel);
1930
1931		if (document.getElementById(panel).style.display == 'none') {
1932
1933			document.getElementById(panel).style.display = 'block';
1934
1935		}
1936
1937		var mypanelParent = document.getElementById(panel).parentNode;
1938
1939		for (j=0;j<mypanelParent.childNodes.length;j++) {
1940
1941			if (mypanelParent.childNodes[j].className == 'title' ) {
1942
1943				var titlechildnodes = mypanelParent.childNodes[j].childNodes;
1944
1945				for (p=0;p<titlechildnodes.length;p++) {
1946
1947					if(titlechildnodes[p].tagName == 'IMG')
1948
1949						titlechildnodes[p].src = 'themes/images/picto-close-panel.gif';
1950
1951				}
1952
1953			}
1954
1955		}
1956
1957	}
1958
1959}
1960
1961function hideAll(myPanel,NbPanels) {
1962
1963	for (i=0;i<NbPanels;i++) {
1964
1965		var panel = myPanel + '-' + i;
1966
1967		//alert(panel);
1968
1969		if (document.getElementById(panel).style.display == 'block') {
1970
1971			document.getElementById(panel).style.display = 'none';
1972
1973		}
1974
1975		var mypanelParent = document.getElementById(panel).parentNode;
1976
1977		for (j=0;j<mypanelParent.childNodes.length;j++) {
1978
1979			if (mypanelParent.childNodes[j].className == 'title' ) {
1980
1981				var titlechildnodes = mypanelParent.childNodes[j].childNodes;
1982
1983				for (p=0;p<titlechildnodes.length;p++) {
1984
1985					if(titlechildnodes[p].tagName == 'IMG')
1986
1987						titlechildnodes[p].src = 'themes/images/picto-open-panel.gif';
1988
1989				}
1990
1991			}
1992
1993		}
1994
1995	}
1996
1997}
1998
1999
2000
2001
2002
2003
2004
2005//////////////////////////////////////Infos-bulles//////////////////////////////////
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015var idBulleT;
2016
2017var chrono = null;
2018
2019var delai = "500";
2020
2021
2022
2023
2024
2025
2026
2027function afficheBulle(idBulle,parent)
2028
2029{
2030
2031	var bulle = document.getElementById(idBulle);
2032
2033	var offset;
2034
2035	var exp = new RegExp("^td_","gi");
2036
2037
2038
2039	if (chrono!=null)
2040
2041	{
2042
2043		clearTimeout(chrono);
2044
2045		cacheBulleT();
2046
2047	}
2048
2049
2050
2051	bulle.style.display = "block";
2052
2053
2054
2055	var bulleLeft = parent.offsetLeft+10;
2056
2057	var bulleTop = parent.offsetTop-bulle.offsetHeight;
2058
2059
2060
2061	var windowWidth = 0;
2062
2063	if (typeof(window.innerWidth) == 'number') {
2064
2065		windowWidth= window.innerWidth;
2066
2067	}
2068
2069	else {
2070
2071		if (document.documentElement && document.documentElement.clientWidth) {
2072
2073			windowWidth= document.documentElement.clientWidth;
2074
2075		}
2076
2077		else {
2078
2079			if (document.body && document.body.clientWidth) {
2080
2081				windowWidth = document.body.clientWidth;
2082
2083			}
2084
2085		}
2086
2087	}
2088
2089
2090
2091	bulle.style.left = bulleLeft+'px';
2092
2093	bulle.style.top = bulleTop+'px';
2094
2095	if((bulleLeft+bulle.offsetWidth+20) > windowWidth) {
2096
2097		bulle.style.left = (bulleLeft-bulle.offsetWidth)+'px';
2098
2099
2100
2101
2102
2103	}
2104
2105
2106
2107	//check Internet Exporer VErsion
2108
2109
2110
2111	//create iframe to fix ie6 select z-index bug
2112
2113	if (version == '6.0;') {
2114
2115
2116
2117		var myBulleIframe = '<iframe src="blank.html" scrolling="no" frameborder="0" class="info-bulle-Iframe" title="Cadre vide"'+' id="'+idBulle+'-Iframe"'+'></iframe>';
2118
2119		var myMessage = bulle.innerHTML;
2120
2121		bulle.innerHTML = myBulleIframe + myMessage;
2122
2123		var myBulleHeight = bulle.offsetHeight;
2124
2125		var myBulleWidth = bulle.offsetWidth;
2126
2127		myNewID = idBulle+'-Iframe';
2128
2129		var myNewIframe = document.getElementById(myNewID);
2130
2131
2132
2133
2134
2135		var parentClass = myNewIframe.parentNode.className;
2136
2137		var iframeNewClass = parentClass+'-Iframe';
2138
2139		myNewIframe.className = iframeNewClass;
2140
2141		myNewIframe.style.height = myBulleHeight;
2142
2143		myNewIframe.style.width = myBulleWidth;
2144
2145		//alert(myNewIframe.style.height);
2146
2147		//alert(myNewIframe.className);
2148
2149	}
2150
2151
2152
2153
2154
2155}
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165function cacheBulleT()
2166
2167{
2168
2169	document.getElementById(idBulleT).style.display = "none";
2170
2171	chrono = null;
2172
2173}
2174
2175
2176
2177function cacheBulle(idBulle)
2178
2179{
2180
2181	idBulleT = idBulle;
2182
2183	chrono = setTimeout("cacheBulleT()",delai);
2184
2185
2186
2187	//document.getElementById(idBulle).style.display = "none";
2188
2189}
2190
2191
2192
2193function mouseOverBulle()
2194
2195
2196
2197{
2198
2199	clearTimeout(chrono);
2200
2201	chrono = null;
2202
2203}
2204
2205
2206
2207function mouseOutBulle()
2208
2209{
2210
2211	chrono = setTimeout("cacheBulleT()",delai);
2212
2213}
2214
2215
2216
2217
2218
2219//////////////////////////////////////End Infos-bulles//////////////////////////////////
2220
2221
2222
2223/*disable option in selectbox */
2224
2225function disableOption(mySelect,myIndex) {
2226
2227	if (mySelect.selectedIndex == myIndex) {
2228
2229		mySelect.selectedIndex = 0;
2230
2231	}
2232
2233}
2234
2235
2236
2237
2238
2239/////////////////////////////////////Navigation Liste Entites d'achat//////////////////////////
2240
2241
2242
2243
2244
2245function openSousCat(myPosition,myPanel) {
2246
2247	var layer = document.getElementById(myPanel);
2248
2249	if (layer.style.display == 'none') {
2250
2251		layer.style.display = 'block';
2252
2253		myPosition.src = 'themes/images/picto-moins.gif';
2254
2255	}
2256
2257	else if (layer.style.display == 'block') {
2258
2259		layer.style.display = 'none';
2260
2261		myPosition.src = 'themes/images/picto-plus.gif';
2262
2263	}
2264
2265	initFunctions();
2266
2267}
2268
2269
2270
2271
2272
2273/////////////////////////////////////End Navigation Liste Entites d'achat//////////////////////////
2274
2275
2276
2277
2278
2279/*Ouveruture lien externe*/
2280
2281function open_ext_link()
2282
2283{
2284
2285	var liens = document.getElementsByTagName('a');
2286
2287	// On récupère tous les liens (<a>) du document dans une variable (un array), ici liens.
2288
2289	// Une boucle qui parcourt le tableau (array) liens du début à la fin.
2290
2291	for (var i = 0 ; i < liens.length ; ++i)  {
2292
2293		// Si les liens ont un nom de class égal à lien-ext, alors on agit.
2294
2295		if (liens[i].className == 'lien-ext' || liens[i].className == 'lien-ext-left')  {
2296
2297			var actualTitle = liens[i].title;
2298
2299			liens[i].title = actualTitle + '';
2300
2301			// Au clique de la souris.
2302
2303			liens[i].onclick = function()  {
2304
2305				window.open(this.href);
2306
2307				return false; // On ouvre une nouvelle page ayant pour URL le href du lien cliqué et on inhibe le lien réel.
2308
2309			};
2310
2311		}
2312
2313	}
2314
2315}
2316
2317
2318
2319// Au chargement de la page, on appelle la fonction.
2320
2321
2322
2323
2324
2325//////////////////////////////////////MULTI-LINGUISME////////////////////////////////////////////
2326
2327/*Display Objet in selected language*/
2328
2329function showLangueDiv(myObjetlangue,myDiv) {
2330
2331	var totalLangue = document.getElementById(myObjetlangue);
2332
2333	for (i=0;i<totalLangue.childNodes.length;i++) {
2334
2335		//alert(totalLangue.childNodes[i].nodeType);
2336
2337		if(totalLangue.childNodes[i].nodeType == 1) {
2338
2339			var myDivId = totalLangue.childNodes[i].id;
2340
2341			if(document.getElementById(myDivId)) {
2342
2343				document.getElementById(myDivId).style.display = 'none';
2344
2345			}
2346
2347		}
2348
2349	}
2350
2351	document.getElementById(myDiv).style.display = 'block';
2352
2353}
2354
2355
2356
2357
2358
2359/*select and highlight flag*/
2360
2361function selectFlag(myFlag) {
2362
2363	var myFlagParent = myFlag.parentNode;
2364
2365	for (i=0;i<myFlagParent.childNodes.length;i++) {
2366
2367		if (myFlagParent.childNodes[i].tagName == 'A') {
2368
2369			myFlagParent.childNodes[i].className = '';
2370
2371		}
2372
2373
2374
2375	}
2376
2377	myFlag.className = 'on';
2378
2379}
2380
2381//////////////////////////////////////End MULTI-LINGUISME////////////////////////////////////////////
2382
2383J(document).ready(function(){
2384	document.createElement("abbr");
2385	//J(".hidden").hide();
2386
2387	//Choix liste detinataires compte ou registre
2388	J(".tableau-choix-destinataires th.col-compte input[type=checkbox]").click(function(){
2389		J(this).is(':checked') ? J(this).parents('.tableau-choix-destinataires').find('td.col-compte input[type=checkbox]').attr("checked", 'checked') : J(this).parents('.tableau-choix-destinataires').find('td.col-compte input[type=checkbox]').removeAttr("checked");
2390	});
2391
2392	J(".tableau-choix-destinataires th.col-registre input[type=checkbox]").click(function(){
2393		J(this).is(':checked') ? J(this).parents('.tableau-choix-destinataires').find('td.col-registre input[type=checkbox]').attr("checked", 'checked') : J(this).parents('.tableau-choix-destinataires').find('td.col-registre input[type=checkbox]').removeAttr("checked");
2394	});
2395
2396	J(".tableau-choix-destinataires td.check-col input[type=checkbox]").click(function(){
2397		J(this).is(':checked') ? J(this).parents('tr').find('input[type=checkbox]').attr("checked", 'checked') : J(this).parents('tr').find('input[type=checkbox]').removeAttr("checked");
2398	});
2399
2400
2401	// Load Modal dialog on click
2402	J('.bouton-modal').click(function (e) {
2403		J(this).next('.modal').modal();
2404		return false;
2405	});
2406
2407
2408	// Affiche lien Partager on click
2409	J(".bouton-partager").click(function() {
2410		if(J(this).next('.share-panel').hasClass('visible')) {
2411			J(this).next('.share-panel').removeClass('visible');
2412		} else {
2413			J('.share-panel').removeClass('visible');
2414			J(this).next('.share-panel').addClass('visible');
2415		}
2416	});
2417	J('html').click(function() {
2418		J('.share-panel').removeClass('visible');
2419	});
2420	J(".bouton-partager").click(function(event){
2421		event.stopPropagation();
2422	});
2423
2424
2425	maxLength = J(".max-length").attr("maxlength");
2426	//J(".max-length").after("<div class='remaining'><span id='remainingLengthTempId'>"
2427	//		  + maxLength + "</span> caract&egrave;res max.</div>");
2428	J(".max-length").bind("keyup change", function(){checkMaxLength(this.id,  maxLength); } )
2429
2430	//Formattage champ montant
2431	J(".input-montant").blur(function(){
2432		J(this).parseNumber({format:"#,###.00", locale:"fr"});
2433		J(this).formatNumber({format:"#,###.00", locale:"fr"});
2434	});
2435
2436	//Formattage input propre
2437	J('.input-propre').keypress(function(event){
2438		if (event.keyCode == 10 || event.keyCode == 13)
2439			event.preventDefault();
2440		formatInputPropre();
2441	});
2442
2443	formatInputPropre();
2444
2445	//Check all
2446	J(".checkall").click(function(){
2447		J(this).is(':checked') ? J(this).parents("table").find("input[type=checkbox]:not(:disabled)").attr("checked", 'checked') : J(this).parents("table").find("input[type=checkbox]:not(:disabled)").attr("checked",false);
2448	});
2449
2450	//Check all pieces reponses
2451	J(".checkall-pieces-reponses").click(function(){
2452		J(this).is(':checked') ? J(".tableau-reponse").find("input[type=checkbox]:not(:disabled)").prop("checked", 'checked') : J(".tableau-reponse").find("input[type=checkbox]:not(:disabled)").prop("checked",false);
2453		J(this).is(':checked') ? J(".checkall-pieces-reponses").prop("checked", 'checked') : J(".checkall-pieces-reponses").prop("checked",false);
2454
2455	});
2456
2457	//UnCheck all child checkbox elements
2458	/*J(".uncheckall").click(function(){
2459	 J(this).is(':checked') ? false : J(this).parents(".line").find("input[type=checkbox]:not(:disabled)").attr("checked",false);
2460	 });*/
2461	//UnCheck all child checkbox elements
2462	J(".hideall").click(function(){
2463		//J(this).is(':checked') ? J(this).parents(".line").find(".panel").removeClass('hidden').addClass('visible') : J(this).parents(".line").find(".panel").removeClass('hidden').addClass('visible')
2464	});
2465
2466
2467	//Checkbox is checked  --> show child element, Checkbox is unchecked --> hide and uncheck all child checkboxes
2468	J(".toggleUncheckall").click(function(){
2469		if (J(this).is(':checked') == true) {
2470			J(this).parents(".line:first").find(".panel:first").removeClass('hidden').addClass('visible');
2471		}
2472		if (J(this).is(':checked') == false) {
2473			J(this).parents(".line:first").find(".panel").removeClass('visible').addClass('hidden');
2474			J(this).parents(".line:first").find("input[type=checkbox]:not(:disabled)").attr("checked",false);
2475		}
2476	});
2477	//Radio is checked  --> hide and uncheck all child checkboxes
2478	J(".isCheckedHideUncheckall").click(function(){
2479		if (J(this).is(':checked') == true) {
2480			J(this).parents(".line:first").find("input[type=checkbox]:not(:disabled)").attr("checked",false);
2481			J(this).parents(".line:first").find(".panel").removeClass('visible').addClass('hidden');
2482		}
2483	});
2484
2485	//CollapseAll/ToggleAll table detail row
2486	J(".toggle-details-line .collapse-all").click(function(){
2487		J(this).parents('.table-bloc-detail').find('.panel-detail').show();
2488		J(this).parents('.table-bloc-detail').find('.title-toggle').removeClass('title-toggle').addClass('title-toggle-open');
2489		initFunctions();
2490		return false;
2491	});
2492	J(".toggle-details-line .toggle-all").click(function(){
2493		J(this).parents('.table-bloc-detail').find('.panel-detail').hide();
2494		J(this).parents('.table-bloc-detail').find('.title-toggle-open').removeClass('title-toggle-open').addClass('title-toggle');
2495		initFunctions();
2496		return false;
2497	});
2498
2499	//CollapseAll/ToggleAll table AC row
2500	J(".toggle-ac .collapse-all").click(function() {
2501		J(this).parents('.table-bloc-detail').find('.panel-detail').show();
2502		J(this).parents('.table-bloc-detail').find('.line-racine .title-toggle').removeClass('title-toggle').addClass('title-toggle-open');
2503		initFunctions();
2504		return false;
2505	});
2506	J(".toggle-ac .toggle-all").click(function(){
2507		J(this).parents('.table-bloc-detail').find('.panel-detail').hide();
2508		J(this).parents('.table-bloc-detail').find('.panel-detail').nextUntil('.line-racine','tr').hide();
2509		J(this).parents('.table-bloc-detail').find('.title-toggle-open').removeClass('title-toggle-open').addClass('title-toggle');
2510		initFunctions();
2511		return false;
2512	});
2513
2514	J('.tvaIntracommunautaire').on('keypress', function (event) {
2515		var regex = new RegExp("^[a-zA-Z0-9]+$");
2516		var key = String.fromCharCode(!event.charCode ? event.which : event.charCode);
2517		if (!regex.test(key)) {
2518			event.preventDefault();
2519			return false;
2520		}
2521	});
2522
2523
2524});
2525
2526//Formattage champ objet du marche
2527function formatInputPropre () {
2528
2529	var listInput = J('.input-propre');
2530
2531	for(var i=0;i<listInput.length;i++){
2532		var myIds=listInput[i];
2533		var listInputId = J('#'+listInput[i].id).val();
2534		var inputVal2 = listInputId.replace(/\t+/g, '');
2535		var inputPropre = inputVal2.replace(/\n+/g, ' - ');
2536		J('#'+listInput[i].id).val(inputPropre);
2537	}
2538	return false;
2539
2540}
2541
2542//Check maxlength
2543function checkMaxLength(textareaID, maxLength){
2544	currentLengthInTextarea = J("#"+textareaID).val().length;
2545	//J(remainingLengthTempId).text(parseInt(maxLength) - parseInt(currentLengthInTextarea));
2546	if (currentLengthInTextarea > (maxLength)) {
2547		// Trim the field current length over the maxlength.
2548		J(".max-length").val(J(".max-length").val().slice(0, maxLength));
2549		//J(remainingLengthTempId).text(0);
2550
2551	}
2552}
2553
2554function togglePanelClass(myPosition,myPanel){
2555	J('.'+myPanel).toggle();
2556	J(myPosition).toggleClass('title-toggle-open').toggleClass('title-toggle');
2557}
2558function togglePanelDetail(myPosition,myPanel){
2559	J('.'+myPanel).toggle();
2560	J(myPosition).toggleClass('title-toggle-open').toggleClass('title-toggle');
2561	J('.'+myPanel).next('.panel-detail').hide();
2562	J('.'+myPanel).find('.title-toggle-open').removeClass('title-toggle-open').addClass('title-toggle');
2563}
2564//Toggle tableau AC
2565function togglePanelAc(myPosition,myPanel){
2566	J('.'+myPanel).toggle();
2567	J(myPosition).toggleClass('title-toggle-open').toggleClass('title-toggle');
2568	J('.'+myPanel).next('.panel-detail').hide();
2569	J('.'+myPanel).next('tr').hide();
2570	J('.'+myPanel).find('.title-toggle-open').removeClass('title-toggle-open').addClass('title-toggle');
2571}
2572
2573function showHidePanelClass(myPosition,myPanel){
2574	J('.'+myPanel).toggleClass('hidden');
2575	J(myPosition).toggleClass('title-toggle-open').toggleClass('title-toggle');
2576}
2577
2578function togglePanelOpenAll(myPanel){
2579	var panel = J('.'+myPanel);
2580	panel.show();
2581}
2582function togglePanelCloseAll(myPanel){
2583	var panel = J('.'+myPanel);
2584	panel.hide();
2585}
2586
2587function showPanel(myPanel){
2588	J('#'+myPanel).toggleClass('hidden').toggleClass('visible');
2589}
2590
2591
2592function toggleMultiPanel(){
2593	for(var i=0;i<arguments.length;i++){
2594		var allPanels=arguments[i];
2595		J('#'+allPanels).toggleClass('hidden');
2596	}
2597
2598}
2599
2600function toggleTableColum(){
2601	for(var i=0;i<arguments.length;i++){
2602		var allPanels=arguments[i];
2603		J('#'+allPanels).toggle();
2604	}
2605}
2606
2607
2608function cancelAddIllustration(){
2609	overlay('addIllustration','overlayDemandeValidation');
2610	document.getElementById('divValidationSummary').style.display='none';
2611	document.getElementById('nomObligatoire').style.display='none';
2612	document.getElementById('imageObligatoire').style.display='none';
2613	document.getElementById('ctl0_CONTENU_PAGE_nomIllustration').value='';
2614	return false;
2615}
2616
2617function errorAddIllustration(){
2618	overlay('addIllustration','overlayDemandeValidation');
2619	document.getElementById('divValidationSummary').style.display='';
2620	document.getElementById('nomObligatoire').style.display='';
2621	document.getElementById('imageObligatoire').style.display='';
2622}
2623
2624//-->
2625
2626
2627J(document).ready(function(){
2628	J( ".definir-forme-prix" ).click(function() {
2629		J(".modal-form-prix").dialog({
2630			modal: true,
2631			resizable: false,
2632			closeText:'Fermer',
2633			title:this.title,
2634			dialogClass: 'modal-form popup-small2',
2635			open: function(){
2636				jQuery('.ui-widget-overlay').bind('click',function(){
2637					J(".modal-form-prix").dialog('close');
2638				})
2639			}
2640		});
2641	});
2642	J( ".definir-criteres" ).click(function() {
2643		J(".modal-criteres").dialog({
2644			modal: true,
2645			resizable: false,
2646			closeText:'Fermer',
2647			title:'<h2>'+this.title+'</h2>',
2648			dialogClass: 'modal-form popup-small2',
2649			open: function(){
2650				jQuery('.ui-widget-overlay').bind('click',function(){
2651					J(".modal-criteres").dialog('close');
2652				})
2653			}
2654		});
2655	});
2656	J( ".saisir-appartenance-tranches" ).click(function() {
2657		J(".modal-appartenance-tranches").dialog({
2658			modal: true,
2659			resizable: false,
2660			closeText:'Fermer',
2661			title:'<h2>'+this.title+'</h2>',
2662			dialogClass: 'modal-form popup-small2',
2663			open: function(){
2664				jQuery('.ui-widget-overlay').bind('click',function(){
2665					J(".modal-appartenance-tranches").dialog('close');
2666				})
2667			}
2668		});
2669	});
2670
2671});
2672
2673
2674/*
2675 * Permet de d'ouvrir le pop-ine en lui passant la class du lien, la taille de la popin (css) et la pop-ine
2676 */
2677function openModal(myModal,myClass, myEl,title) {
2678	title = typeof title !== 'undefined' ? title : myEl.title;
2679	var dlg = J("."+myModal).dialog({
2680		modal: true,
2681		height: 'auto',
2682		resizable: false,
2683		closeText:'Fermer',
2684		title: title,
2685		dialogClass: 'modal-form popup-small2 '+ myClass,
2686		open: function(){
2687			const body = document.body;
2688			const html = document.documentElement;
2689			const height = Math.max( body.scrollHeight, body.offsetHeight,
2690                       html.clientHeight, html.scrollHeight, html.offsetHeight );
2691			J('.ui-widget-overlay').css("height", height);
2692		}
2693	});
2694}
2695
2696function openModalOnLoad(myModal,myClass,myEl) {
2697	J("."+myModal).dialog({
2698		modal: true,
2699		resizable: false,
2700		closeText:'Fermer',
2701		title:'<h2>'+myEl.title+'</h2>',
2702		dialogClass: 'modal-form popup-small2 '+ myClass,
2703		open: function(){
2704			J(this).parent().css('position','fixed');
2705			J(this).parent().css('top','30%');
2706			/*jQuery('.ui-widget-overlay').bind('click',function(){
2707			 J("."+myModal).dialog('close');
2708			 });*/
2709			//Dialog freezes window scrollbar - Chrome fix
2710			window.setTimeout( function () {
2711				jQuery(document).unbind( 'mousedown.dialog-overlay' ).unbind( 'mouseup.dialog-overlay' );
2712			}, 100 );
2713		}
2714	});
2715}
2716
2717//////////////////////////////////////User et modules bar////////////////////////////////////////////
2718J(document).ready(function(){
2719	/*Rollover Modules*/
2720	var opts =
2721		// horizontal Dock with images expanding downwards in the vertical axis...
2722	{ align: 'middle'
2723		// set the maximum minor axis (vertical) image dimension to 48px
2724		, size: '24'
2725		// add labels..
2726		, labels: 'tc'
2727	};
2728	if(J("#list-modules").length > 0) {
2729		J("#list-modules").jqDock(opts);
2730	}
2731
2732	/*Bloc user infos*/
2733	J('#triggerUserInfos').click( function(event){
2734		event.stopPropagation();
2735		event.preventDefault();
2736		J('.panel-user-infos').toggle();
2737	});
2738	J(document).click( function(){
2739		J('.panel-user-infos').hide();
2740	});
2741
2742});
2743
2744
2745//----------------------------------Verification format champs on blur----------------------------------//
2746J(document).ready(function(){
2747	if (J('.mask-year').length) {
2748		J(".mask-year").mask("9999");
2749	}
2750});
2751
2752
2753function displayOptionByClass(mySelect,elmentId) {
2754	alloti = document.getElementById(elmentId).value;
2755	var totalOptions = mySelect.options;
2756	for (i=0;i<totalOptions.length;i++) {
2757		var totalLayers = (totalOptions[i].getAttribute('value'));
2758		J('.'+totalLayers).hide();
2759	}
2760	if(alloti == '1'){
2761		J('.'+mySelect.options[mySelect.selectedIndex].value).show();
2762		initFunctions();
2763	}else{
2764		displayOptionChoiceCritere(mySelect);
2765	}
2766
2767}
2768
2769function displayOptionByClassContrat(mySelect) {
2770	var totalOptions = mySelect.options;
2771	for (i=0;i<totalOptions.length;i++) {
2772		var totalLayers = (totalOptions[i].getAttribute('value'));
2773		J('.'+totalLayers).hide();
2774		J('.'+mySelect.options[mySelect.selectedIndex].value).show();
2775	}
2776	initFunctions();
2777
2778}
2779
2780/*Function toggle element by Class*/
2781function toggleDisplay(myInput,myDiv) {
2782	if (myInput.checked == true) {
2783		J('.'+myDiv).show();
2784	}
2785	if (myInput.checked == false) {
2786		J('.'+myDiv).hide();
2787	}
2788	initFloatingIframe();
2789}
2790//-->
2791
2792/******************************************Scripts Sortable table row ******************************************/
2793J(window).on("load", function(){
2794	var fixHelperModified = function(e, tr) {
2795			var originals = tr.children();
2796			var helper = tr.clone();
2797			helper.children().each(function(index) {
2798				J(this).width(originals.eq(index).width())
2799			});
2800			return helper;
2801		},
2802		updateIndex = function(e, ui) {
2803			J('td.index', ui.item.parent()).each(function (i) {
2804				var id = J(this).find('input').attr('id');
2805				var name = J(this).find('input').attr('name');
2806				J(this).html('<input class="hidden-field" type="text" readonly="readonly" name="'+ name + '" id="'+ id + '" value="' + (i + 1)+ '" />');
2807
2808			});
2809			/*Init Alternate table row color on table update*/
2810			setTimeout(initAlternateTableRowColor, 200);
2811		};
2812
2813	J(".sortable tbody").sortable({
2814		helper: fixHelperModified,
2815		handle: ".index",
2816		cursor: "move",
2817		cancel: 'select',
2818		stop: updateIndex
2819	});
2820
2821
2822});
2823
2824/*Init Alternate table row color on document ready*/
2825J(document).ready(function(){
2826	initAlternateTableRowColor();
2827});
2828
2829/*Function Init Alternate table row color*/
2830function initAlternateTableRowColor() {
2831	J(".sortable tbody tr:even").removeClass('on');
2832	J(".sortable tbody tr:odd").addClass('on');
2833}
2834
2835/******************************************END Scripts Sortable table row ******************************************/
2836
2837
2838//----------------------------------Treeview with toggle----------------------------------//
2839//http://techlister.com/jquery/creating-jquery-tree-view-without-plugin/976/
2840function loadArborecence() {
2841	J('.treeview .folder').each( function() {
2842		if(!J( this ).parent().hasClass( 'parent')){
2843			J(this).prepend("<span class='expander'></span><span class='icon'></span>");
2844		}
2845	});
2846	J('.treeview li').each( function() {
2847		if(!J( this ).hasClass( 'parent')) {
2848			J( this ).addClass( 'parent');
2849		}
2850	});
2851	J('.treeview li > span').unbind('click');
2852	J('.treeview li > span').click( function( ) {
2853		J( this ).parent().toggleClass( 'active');
2854		J( this ).parent().children( 'ul').slideToggle( 'fast');
2855	});
2856}
2857
2858
2859J( document ).ready( function( ) {
2860	J('.treeview ul').hide();
2861	J('.treeview .arbo').hide();
2862	J('.treeview .root').each( function() {
2863		J(this).prepend("<span class='expander'></span>");
2864	});
2865	J('.treeview li > div.root').click( function( ) {
2866
2867		var idButton = document.getElementById(this.id+"Button");
2868		if(idButton){
2869			idButton.click()
2870		}
2871
2872		J( this ).parent().toggleClass( 'active');
2873		J( this ).next('.arbo').show().children( 'ul').slideToggle( 'fast');
2874	});
2875
2876});
2877
2878
2879//----------------------------------Couleur survol lignes tableaux----------------------------------//
2880J( document ).ready( function( ) {
2881	J('.table-highlight td.check-col input').click( function() {
2882		if (J(this).is(':checked') == true) {
2883			if (J(this).is(':radio')) {
2884				J(this).parents(".table-highlight").find('tr').removeClass('highlight');
2885			}
2886			J(this).parents("tr").addClass('highlight');
2887		}
2888		else {
2889			J(this).parents("tr").removeClass('highlight');
2890		}
2891	});
2892	J('.table-highlight th.check-col input').click( function() {
2893		if (J(this).is(':checked') == true) {
2894			J(this).parents(".table-highlight").find('tr').has("input[type=checkbox]").addClass('highlight');
2895		}
2896		else {
2897			J(this).parents(".table-highlight").find('tr').has("input[type=checkbox]").removeClass('highlight');
2898			J(this).parents("tbody").removeClass('highlight');
2899		}
2900	});
2901
2902	J('.tableau-decision td.check-col input').click( function() {
2903		if (J(this).is(':checked') == true) {
2904			J(this).parents("tbody").addClass('highlight');
2905		}
2906		else {
2907			J(this).parents("tbody").removeClass('highlight');
2908		}
2909	});
2910	J('.tableau-decision th.check-col input').click( function() {
2911		if (J(this).is(':checked') == true) {
2912			J(this).parents(".table-highlight").find("tbody").addClass('highlight');
2913		}
2914		else {
2915			J(this).parents(".table-highlight").find("tbody").removeClass('highlight');
2916		}
2917	});
2918
2919});
2920
2921
2922//----------------------------------Animation timeline 1ere visite----------------------------------//
2923J( document ).ready( function( ) {
2924	J('.timeline-img').click( function( ) {
2925		J('.timeline-block').removeClass('active');
2926		J(this).parents(".timeline-block").addClass('active');
2927		J('.timeline-block p').slideUp();
2928		if (J(this).parents(".timeline-block").find('p').is( ":hidden" ) ) {
2929			J(this).parents(".timeline-block").find('p').slideToggle();
2930		}
2931	});
2932	J('.timeline-content').click( function( ) {
2933		J('.timeline-block').removeClass('active');
2934		J(this).parents(".timeline-block").addClass('active');
2935
2936		J('.timeline-block p').slideUp();
2937		if (J(this).parents(".timeline-block").find('p').is( ":hidden" ) ) {
2938			J(this).parents(".timeline-block").find('p').slideToggle();
2939		}
2940	});
2941});
2942
2943
2944
2945//----------------------------------FAQ----------------------------------//
2946J( document ).ready( function( ) {
2947	J('.panel-faq .panel').hide();
2948	J('.panel-faq h3 a').click( function( ) {
2949		J('.panel-faq .panel').slideUp();
2950		J(this).parent().next('.panel:hidden').slideToggle();
2951		J(this).parent().siblings().find('span').attr('class','arrow-right');
2952		J(this).find('span').toggleClass('arrow-right').toggleClass('arrow-down');
2953	});
2954
2955	J('#myTab a').click(function (e) {
2956		e.preventDefault();
2957		J(this).tab('show');
2958	})
2959
2960});
2961//----------------------------------HISTORIQUE----------------------------------//
2962J(document).ready(function(){
2963
2964	J( ".detail-historique" ).click(function() {
2965		J(".modal-historique").dialog({
2966			modal: true,
2967			resizable: false,
2968			closeText:'Fermer',
2969			title:'<h2>'+this.title+'</h2>',
2970			dialogClass: 'modal-form popup-small popup-800',
2971			open: function(){
2972				jQuery('.ui-widget-overlay').bind('click',function(){
2973					J(".modal-historique").dialog('close');
2974				})
2975			}
2976		});
2977	});
2978
2979});
2980
2981//----------------------------------Popovers----------------------------------//
2982var timer;
2983J(document).ready(function(){
2984
2985	if (J(".popover-detail").length > 0) {
2986		//Popover detail agent
2987		J(".popover-detail").popover({
2988			html : true,
2989			placement: 'right',
2990			sanitize: false,
2991			trigger: 'manual',
2992			container: 'body',
2993			template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-header popover-title"></h3><div class="popover-content popover-body"></div></div>',
2994			content: function() {
2995				var content = J(this).attr("data-popover-content");
2996				return J(content).children(".popover-body").html();
2997			},
2998			title: function() {
2999				var title = J(this).attr("data-popover-content");
3000
3001				if (J(title).children(".popover-heading").html() != undefined) {
3002					return J(title).children(".popover-heading").html();
3003				} else {
3004					return '';
3005
3006				}
3007			}
3008		}).on('click',function(e){
3009			e.preventDefault();
3010		});
3011		//Popover detail trigger on hover
3012		J(".popover-hover").popover({
3013			sanitize: false
3014		}).on("mouseenter", function () {
3015			J(".popover").hide();
3016			clearTimeout(timer);
3017			J(this).popover("show");
3018		}).on("mouseleave", function () {
3019			var _this = this;
3020			timer = setTimeout(function(){
3021				if (!J(".popover:hover").length) {
3022					J(_this).popover("hide");
3023				}
3024			}, 1000);
3025		});
3026
3027		J('[data-toggle="popover"]').click(function () {
3028			J(this).popover('toggle');
3029		});
3030
3031		//Popover close on click outside
3032		J('body').on('click', function (e) {
3033			J('[data-toggle="popover"]').each(function () {
3034				if (!J(this).is(e.target) && J(this).has(e.target).length === 0 && J('.popover').has(e.target).length === 0) {
3035					J(this).popover('hide');
3036				}
3037			});
3038		});
3039	}
3040});
3041
3042//----------------------------------Add dots Read more toggle----------------------------------//
3043function addToggle(){
3044	J('.read-more').each(function() {
3045		var Jbox = J(this);
3046		Jbox.append( ' <a class="toggle" href="#"><span class="open" title="Afficher plus">[&nbsp;+&nbsp;]<span class="sr-only">Afficher plus</span></span><span class="close-btn" title="Afficher moins">[&nbsp;-&nbsp;]<span class="sr-only">Afficher moins</span></span></a>' );
3047
3048		function createDots()
3049		{
3050			Jbox.dotdotdot({
3051				after: 'a.toggle'
3052			});
3053		}
3054		function destroyDots() {
3055			Jbox.trigger( 'destroy' );
3056		}
3057		createDots();
3058
3059		Jbox.on(
3060			'click',
3061			'a.toggle',
3062			function() {
3063				Jbox.toggleClass( 'opened' );
3064
3065				if ( Jbox.hasClass( 'opened' ) ) {
3066					destroyDots();
3067				} else {
3068					createDots();
3069				}
3070				return false;
3071			}
3072		);
3073
3074	});
3075}
3076
3077
3078/*display panel according to 1 option choice*/
3079
3080function displayOneOptionPanelByValue(mySelect,valueSelected,myDiv) {
3081
3082	if (mySelect.options[mySelect.selectedIndex].value == valueSelected) {
3083		document.getElementById(myDiv).style.display = 'block';
3084
3085	}
3086
3087	else {
3088		document.getElementById(myDiv).style.display = 'none';
3089
3090	}
3091
3092	initFunctions();
3093
3094}
3095
3096
3097
3098//-->
3099
3100J( document ).ready(function() {
3101
3102	/*Init buttonset*/
3103	J("#filtreTypeAttribution").buttonset();
3104	J("#filtreTypeAttribution").find("label").unbind("mouseup");
3105	J("#filtreStatut").buttonset();
3106	J("#filtreStatut").find("label").unbind("mouseup");
3107	J("#filtreFavori").buttonset();
3108	J("#filtreFavori").find("label").unbind("mouseup");
3109	J("#filtreContratEntite").buttonset();
3110	J("#filtreContratEntite").find("label").unbind("mouseup");
3111	J(".liste-statuts-art133").buttonset();
3112	J(".liste-statuts-art133").find("label").unbind("mouseup");
3113});
3114
3115//----------------------------------Publicite Progress bar----------------------------------//
3116
3117//Circular progress bar
3118function initKnob() {
3119	J(".dial").knob({
3120		'fgColorStart' : '#fb1934',
3121		'fgColorEnd' : '#53d76a',
3122		'bgColor ' : '#ffffff',
3123		//'angleOffset' : '-90',
3124		//'angleArc' :  '250 ',
3125		width : '100%',
3126		height : '100%',
3127		thickness  : '0.2',
3128
3129		'format' : function (value) {
3130			return value + '%';
3131		},
3132		'draw': function () {
3133			var v=parseInt(J(this.i).val(),10);
3134			var cs=colorParse(this.o.fgColorStart); //Start color
3135			var ce=colorParse(this.o.fgColorEnd); //End color
3136			var ends = new Array(new Color(cs[0],cs[1],cs[2]),new Color(ce[0],ce[1],ce[2]));
3137			var steps = (this.o.max - this.o.min) / this.o.step;
3138			var step = new Array(3);
3139			var color = mixPalette();
3140
3141			this.o.fgColor=color;
3142			this.$.css({'color':color});
3143			function Color(r,g,b) {
3144				this.r = r;
3145				this.g = g;
3146				this.b = b;
3147				this.coll = new Array(r,g,b);
3148				this.text = cText(this.coll);
3149			}
3150
3151			function colorParse(c) {
3152				c = c.toUpperCase();
3153				col = c.replace(/[\#\(\)]*/i,'');
3154				var num = new Array(col.substr(0,2),col.substr(2,2),col.substr(4,2));
3155				var ret = new Array(parseInt(num[0],16),parseInt(num[1],16),parseInt(num[2],16));
3156				return(ret);
3157			}
3158
3159			function stepCalc() {
3160				step[0] = (ends[1].r - ends[0].r) / steps;
3161				step[1] = (ends[1].g - ends[0].g) / steps;
3162				step[2] = (ends[1].b - ends[0].b) / steps;
3163			}
3164
3165			function mixPalette() {
3166				stepCalc();
3167				var r = (ends[0].r + (step[0] * v));
3168				var g = (ends[0].g + (step[1] * v));
3169				var b = (ends[0].b + (step[2] * v));
3170				var color = new Color(r,g,b);
3171				return color.text;
3172				//console.log(palette[i]);
3173			}
3174
3175			function cText(c) {
3176				var result = '';
3177				for (k = 0; k < 3; k++) {
3178					val = Math.round(c[k]/1);
3179					piece = val.toString(16);
3180					if (piece.length < 2) {piece = '0' + piece;}
3181					result = result + piece;
3182				}
3183				result = '#' + result.toUpperCase();
3184				return result;
3185			}
3186		}
3187	});
3188
3189}
3190
3191function animateProgress(thisVal) {
3192	J({value: pbVal}).animate({value: thisVal}, {
3193		duration: 1000,
3194		easing:'swing',
3195		step: function()
3196		{
3197			J('.dial').val(this.value).trigger('change');
3198		}
3199	})
3200	pbVal = thisVal;
3201	J(".updateProgress").text(pbVal);
3202}
3203
3204
3205
3206J(function () {
3207	if(J.isFunction(J(".progress-circle").popover)) {
3208		//Init popover taux de progression publicite
3209		J(".progress-circle").popover({
3210			placement: 'top',
3211			html: true,
3212			container: "body",
3213			trigger: 'hover',
3214			content: function () {
3215				var content = J(this).attr("data-popover-content");
3216				return J(content).children(".popover-body").html();
3217			},
3218			title: function () {
3219				var title = J(this).attr("data-popover-content");
3220				return J(title).children(".popover-heading").html();
3221			},
3222			template: '<div class="popover popover-pub bloc-250"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
3223		});
3224	}
3225})
3226
3227
3228
3229//----------------------------------Chosen Jquery----------------------------------//
3230J(document).ready(function() {
3231	if (J.isFunction('chosen')) {
3232		//J(".select").chosen({disable_search: true});
3233		J(".chosen-select").chosen({
3234			disable_search: false,
3235			no_results_text: "Aucun résultat pour : ",
3236			placeholder_text_multiple: "Selectionnez"
3237		});
3238	}
3239
3240	J(".scrollto").click(function() {
3241		event.preventDefault();
3242        bootbox.alert('gf');
3243	})
3244
3245});
3246
3247
3248//----------------------------------Smooth scroll to anchor----------------------------------//
3249function scrollToAnchor(anchor_id){
3250	var tag = J(anchor_id);
3251	J('html,body').animate({scrollTop: tag.offset().top},'slow');
3252}
3253
3254
3255//----------------------------------Bootstrap tooltip----------------------------------//
3256
3257J(function () {
3258	J('[data-toggle="tooltip"]').tooltip({
3259	});
3260})
3261
3262J(document).on('mouseenter', ".tip-truncate", function() {
3263	var Jthis = J(this);
3264	if(this.offsetWidth < this.scrollWidth && !Jthis.attr('title')) {
3265		Jthis.tooltip({
3266			title: Jthis.text(),
3267			placement: "top"
3268		});
3269		Jthis.tooltip('show');
3270	}
3271});
3272
3273
3274//----------------------------------Treegrid----------------------------------//
3275//Treegrid
3276J(".treeview .toggle").on('click',function(e){
3277	e.preventDefault();
3278	if(J(this).attr('data-click-state') == 1) {
3279		J(this).attr('data-click-state', 0)
3280		J(this).parents(".treeview").treegrid('getRootNodes').treegrid('collapse');
3281	} else {
3282		J(this).attr('data-click-state', 1)
3283		J(this).parents(".treeview").treegrid('getRootNodes').treegrid('expand');
3284	}
3285});
3286
3287//J(".table-attributaires tr(:last).indent-n1").last().addClass("last");
3288//J('.table-attributaires tr').last().find('.indent-n1').last().addClass("last");
3289//J('.table-attributaires tbody').last().find('tr.child').last().addClass("last");
3290J('.table-attributaires tbody').last().find('.indent-n1').last().addClass("last")
3291
3292J('.table-attributaires tr:not(.row-attributaire)').each(function() {
3293	if (  J(this).next('.indent-n1').length != 0  ) {
3294		J(this).addClass("last");
3295	}
3296});
3297
3298
3299
3300
3301// textarea event handler to add support for maxlength attribute
3302J(document).on('input keyup', 'textarea[maxlength]', function(e) {
3303	// maxlength attribute does not in IE prior to IE10
3304	// http://stackoverflow.com/q/4717168/740639
3305	var $this = J(this);
3306	var maxlength = $this.attr('maxlength');
3307	if (maxlength) {
3308		var text = $this.val();
3309
3310		if (text.length > maxlength) {
3311			// truncate excess text (in the case of a paste)
3312			$this.val(text.substring(0,maxlength));
3313			e.preventDefault();
3314		}
3315
3316	}
3317
3318});
3319
3320//-->
3321
3322
3323J(document).ready(function () {
3324	//Fonction toggle detail
3325	J(".js-show-notifications").click(function() {
3326		if(J(this).hasClass("active")) {
3327			J(".js-show-notifications").removeClass("active");
3328			J(".js-notifications").hide();
3329			var buttonInit = "ctl0_bandeauAgent_notificationsAgent_initilaiserNotification";
3330			J("#"+ buttonInit).trigger( "click" );
3331		} else {
3332			J(".notificationsLoader").show();
3333			var buttonRefresh = "ctl0_bandeauAgent_notificationsAgent_refreshNotification";
3334			J("#"+ buttonRefresh).trigger( "click" );
3335			J(this).addClass("active");
3336			J(".js-notifications").show();
3337		}
3338	});
3339
3340});
3341
3342
3343J(document).ready(function () {
3344	if(J('#ctl0_CONTENU_PAGE_objetCandidature_listeLots')){
3345		var loadBlocLot = function (){
3346			var multiArray =  J('#ctl0_CONTENU_PAGE_objetCandidature_listeLots').val()?J('#ctl0_CONTENU_PAGE_objetCandidature_listeLots').val(): [];
3347			if(Array.isArray(multiArray) && multiArray.length > 0) {
3348				multiArray.forEach(function(item,index){
3349					if(item == 0){
3350						var lots = [];
3351						var i = 0;
3352						J('#ctl0_CONTENU_PAGE_objetCandidature_listeLots option').each(function(){
3353							var elementToSelect = J(this).val();
3354							if(elementToSelect != 0){
3355								lots[i++] = elementToSelect;
3356							}
3357						});
3358						J('#ctl0_CONTENU_PAGE_objetCandidature_listeLots').val(lots).trigger("chosen:updated").trigger("change");
3359					}
3360				});
3361			}
3362		};
3363		if (J.isFunction('chosen')) {
3364			J('#ctl0_CONTENU_PAGE_objetCandidature_listeLots').chosen();
3365		}
3366		J('#ctl0_CONTENU_PAGE_objetCandidature_listeLots').change(function(e){
3367			loadBlocLot();
3368		});
3369		loadBlocLot();
3370
3371	}
3372
3373	J('.nav-link').on('click', function(event){
3374		if (J(this).parent().hasClass('open')){
3375			J(this).parent().removeClass('open');
3376
3377			return false;
3378		}
3379
3380		J('.nav-link').each(function(){
3381			J(this).parent().removeClass('open');
3382		});
3383
3384		J(this).parent().addClass('open');
3385		event.stopPropagation();
3386	});
3387
3388
3389	J(document).click(function(event){
3390		var $navMPE = J('#main-nav-MPE');
3391
3392		if (!$navMPE.is(event.target) && !$navMPE.has(event.target).length){
3393			$navMPE.find('.nav-item').removeClass('open');
3394		}
3395	});
3396
3397});
3398
3399function documentScrollTop(_top){
3400
3401	var _offsetTop = jQuery('#iframeRedac').offset().top + _top;
3402	jQuery('html, body').animate({
3403        scrollTop: _offsetTop
3404    }, 200)
3405}
3406
3407var waitForElementToBeVisible = function(selector, callback) {
3408	if (J(selector).length && J(selector).offset() != undefined) {
3409		callback();
3410	} else {
3411		setTimeout(function() {
3412			waitForElementToBeVisible(selector, callback);
3413		}, 100);
3414	}
3415};
3416
3417function goToTopPage(idElement)
3418{
3419	waitForElementToBeVisible('#'+idElement, function() {
3420		J('html, body').animate({
3421			scrollTop: J('#'+idElement).offset().top
3422		}, 200);
3423	});
3424}
3425
3426J(document).ready(function(){
3427	J( ".choix-formulaire" ).click(function() {
3428		J(".modal-choix-formulaire").dialog({
3429			modal: true,
3430			resizable: false,
3431			closeText:'Fermer',
3432			title:'<h2>'+this.title+'</h2>',
3433			dialogClass: 'modal-form popup-small2',
3434			open: function(){
3435				jQuery('.ui-widget-overlay').bind('click',function(){
3436					J(".modal-choix-formulaire").dialog('close');
3437				})
3438			}
3439		});
3440	});
3441
3442});
3443
3444function choixSupportPubTypeAvis(element, idElementTypeAvis, group) {
3445	if(element.checked) {
3446		name = element.name;
3447		J('.supportMOL'+group).each(function () {
3448			if (this.name != element.name)
3449				this.checked = false;
3450		});
3451		J('.supportTypeAvisMOL'+group).each(function () {
3452			if (this.id != idElementTypeAvis)
3453				this.hide();
3454			else
3455				this.show();
3456		});
3457
3458		J('.chosenImage-container').each(function () {
3459			this.style ="width:350px;";
3460		});
3461		J('.supportTypeAvisMOLAucunAvis'+group).hide();
3462
3463	}else {
3464		J('#'+idElementTypeAvis).hide();
3465	}
3466	showTypeAvisVide();
3467}
3468
3469function showTypeAvisVide()
3470{
3471	var aucunSupport = true;
3472	J('.supportMOL').each(function () {
3473		if (this.checked == true)
3474			aucunSupport = false;
3475	});
3476	if(aucunSupport) {
3477		J('.supportTypeAvisMOLAucunAvis').show();
3478		J('.chosenImage-container').each(function () {
3479			this.style ="width:350px;";
3480		});
3481	}
3482}
3483
3484function remonter(){
3485	J("html, body").animate({scrollTop: 0},"slow");
3486}
3487
3488function showSpan(idSpan) {
3489	document.getElementById(idSpan).style.display = '';
3490	initFunctions();
3491}
3492
3493function hideSpan(idSpan) {
3494	document.getElementById(idSpan).style.display = 'none';
3495	initFunctions();
3496}
3497
3498J(document).ready(function(){
3499	if (J('.line-lieuPrincipalExecution > input[type=text]').val() != '' && J('.line-lieuPrincipalExecution > input[type=text]').val() != undefined) {
3500        var _choice_lieuPrincipalExecution_val = J('.line-lieuPrincipalExecution > input[type=text]').val();
3501        set_choice_lieuPrincipalExecution(_choice_lieuPrincipalExecution_val);
3502	}
3503});
3504
3505
3506function suggestionSelected() {
3507    J('.line-lieuPrincipalExecution .acomplete li').click(function () {
3508        if (J(this).attr('title') != undefined && J(this).attr('title') != '') {
3509            var _choice_lieuPrincipalExecution_val = J(this).attr('title');
3510            set_choice_lieuPrincipalExecution(_choice_lieuPrincipalExecution_val);
3511		}
3512    });
3513}
3514function set_choice_lieuPrincipalExecution(val){
3515    var _choice_lieuPrincipalExecution_val = val;
3516    var _choice_lieuPrincipalExecution = '<div class="choice_lieuPrincipalExecution" id="choice_lieuPrincipalExecution" title="'+_choice_lieuPrincipalExecution_val+'"><span><strong>'+_choice_lieuPrincipalExecution_val+'</strong></span><a href="" class="choice_lieuPrincipalExecution-close icon_cross"></a></div>';
3517	J('.line-lieuPrincipalExecution > input[type=text]').hide();
3518	J('.line-lieuPrincipalExecution .content-bloc').hide();
3519
3520    J('.line-lieuPrincipalExecution').append(_choice_lieuPrincipalExecution);
3521    J('.line-lieuPrincipalExecution').find('.choice_lieuPrincipalExecution').click(function(event){
3522        event.preventDefault();
3523        J('.line-lieuPrincipalExecution').find('.choice_lieuPrincipalExecution').remove();
3524		J('.line-lieuPrincipalExecution > input[type=text]').show();
3525		J('.line-lieuPrincipalExecution .content-bloc').show();
3526        J('.line-lieuPrincipalExecution .long').val('').show().focus();
3527    })
3528}
3529
3530function getUrlHash(){
3531
3532	if( window.location.hash ){
3533		return window.location.hash.replace('#', '');
3534	}
3535	return false;
3536}
3537
3538function hideLink(mySelect) {
3539	J("#"+mySelect).hide();
3540}
3541
3542// On surcharge une méthode du code Prado pour corriger un comportement non standard :
3543// soumission de tous les champs de formulaire de la page, même ceux en dehors du formulaire Prado...
3544// Tous les détails du problème : https://atexo.atlassian.net/browse/MPE-15718?focusedCommentId=257461
3545if (typeof Prado !== "undefined" && typeof Prado.CallbackRequest !== "undefined") {
3546	Prado.CallbackRequest = jQuery.klass(Prado.CallbackRequest,
3547		{
3548			getParameters: function () {
3549				var data = {};
3550
3551				if (typeof (this.options.CallbackParameter) != "undefined")
3552					data[Prado.CallbackRequestManager.FIELD_CALLBACK_PARAMETER] = this.getCallbackParameter();
3553				if (this.options.EventTarget)
3554					data[Prado.CallbackRequestManager.FIELD_CALLBACK_TARGET] = this.options.EventTarget;
3555
3556				if (this.options.PostInputs != false) {
3557					var form = this.getForm();
3558					return jQuery(form).serialize()
3559						+ jQuery('.ui-dialog input, .ui-dialog select, .ui-dialog textarea').serialize()
3560						+ '&' + jQuery.param(data);
3561				} else {
3562					var pagestate = jQuery("#" + Prado.CallbackRequestManager.FIELD_CALLBACK_PAGESTATE);
3563					if (pagestate)
3564						data[Prado.CallbackRequestManager.FIELD_CALLBACK_PAGESTATE] = pagestate.val();
3565					return jQuery.param(data);
3566				}
3567			},
3568		});
3569}
3570
3571(function(){
3572	if (typeof Prado !== "undefined" && typeof Prado.Element !== "undefined") {
3573		// Store a reference to the original setAttribute method.
3574		var originalSetAttributeMethod = Prado.Element.setAttribute;
3575
3576		// Define overriding method.
3577		Prado.Element.setAttribute = function (element, attribute, value) {
3578			if (typeof value !== 'object') {
3579				// Execute the original method.
3580				originalSetAttributeMethod.apply(this, arguments);
3581			}
3582		}
3583	}
3584})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.