var global= new function() {}; function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i= 4) { window.print(); } if (fermerFenetre) { window.close(); } } function ValiderCourriel() { return document.getElementById("courriel").value; } function TraiterSuppressionPhoto(id, lien) { if (confirm('Êtes-vous certain de vouloir supprimer l\'image ?')) { document.getElementById(id).href= lien; } else { document.getElementById(id).href= "#"; } } function ActiverFlash() { //Determine browser, we only need this for Internet Explorer if (navigator.appName == "Microsoft Internet Explorer") { //Array of elements to be replaced var arrElements= new Array(3); arrElements[0]= "object"; arrElements[1]= "embed"; arrElements[2]= "applet"; //Loop over element types for (n= 0; n < arrElements.length; n++) { //set object for brevity replaceObj= document.getElementsByTagName(arrElements[n]); //loop over element objects returned for (i= 0; i < replaceObj.length; i++) { //set parent object for brevity parentObj= replaceObj[i].parentNode; //grab the html inside of the element before removing it from the DOM newHTML= parentObj.innerHTML; //remove element from the DOM parentObj.removeChild(replaceObj[i]); //stick the element right back in, but as a new object parentObj.innerHTML = newHTML; } } } } function TrierListe(list, idGenerale) { arrayOptions= new Array(); for (var i= 0; i != list.options.length; i++) { arrayOptions[i]= new Array(); arrayOptions[i][0]= list.options[i].text; arrayOptions[i][1]= list.options[i].value; arrayOptions[i][2]= idGenerale; } arrayOptions.sort(); ViderOptionsListe(list); for (var i= 0; i != arrayOptions.length; i++) { AjouterOptionListe(list, arrayOptions[i][0], arrayOptions[i][1],arrayOptions[i][2] + i); } } function AjouterOptionListe(liste, texte, valeur, idOption) { var option= document.createElement("OPTION"); option.text= texte; option.value= valeur; option.label= texte; option.id= idOption; liste.options.add(option); } function ViderOptionsListe(liste) { for (var i= liste.options.length - 1; i >= 0; i--) { liste.remove(i); } } function RetirerOptionsListe(liste, valeur) { for (var i= liste.options.length - 1; i >= 0; i--) { if (liste.options[i].valeur == valeur) { liste.remove(i); } } } /** * addEvent */ function addEvent(obj, evType, fn) { if (obj.addEventListener) { obj.addEventListener(evType, fn, false); return true; } else if (obj.attachEvent) { var r= obj.attachEvent("on"+evType, fn); return r; } else { return false; } } function getElementByTabIndex(tabIndex) { var noForm= 0; if (arguments[1] != "undefined" && arguments[1] != null) { if (!isNaN(arguments[1])) { noForm= arguments[1]; } } var form= document.forms[noForm]; for (var i= 0; i < form.elements.length; i++) { var element= form.elements[i]; if (element.tabIndex && element.tabIndex == tabIndex) { return element; } } return null; } function RGBtoHex(rouge, vert, bleu) { var valeurHex= function(nombre) { var data= "0123456789ABCDEF"; if (nombre == null) { return "00"; } nombre= parseInt(nombre); if (nombre == 0 || isNaN(nombre)) { return "00"; } nombre= Math.round(Math.min(Math.max(0,nombre), 255)); return data.charAt((nombre - nombre % 16) / 16) + data.charAt(nombre % 16); }; return valeurHex(rouge) + valeurHex(vert) + valeurHex(bleu); } function DisableSelection(cible) { if (typeof cible.onselectstart != "undefined") { cible.onselectstart= function() {return false;}; } else if (typeof cible.style.MozUserSelect != "undefined") { cible.style.MozUserSelect= "none"; } else { cible.onmousedown= function() {return false;}; } $(cible).css("cursor", "default"); } function EnableSelection(cible) { if (typeof cible.onselectstart != "undefined") { cible.onselectstart= null; } else if (typeof cible.style.MozUserSelect != "undefined") { cible.style.MozUserSelect= null; } else { cible.onmousedown= null; } } global.preloaderMedias= function() { var arguments= global.preloaderMedias.arguments; if ($(arguments).length > 0) { var object= null; $(arguments).each(function() { object= document.createElement("object"); $(object).attr("data", this); }); } }; global.SoumettreFormCms= function() { try { $("form#modifierTexte")[0].submit(); } catch (ex) { } }; global.AppliquerReglesAuDOM= function() { $(".swap").mouseover(function(e) { var id= $(this).attr("id"); if (id == "") { if (_enDev) { alert("Il manque l'attribut « id » à une image qui swap."); } return; } var aSwapper= $("#" + id); if (aSwapper) { var remplacement= $(aSwapper).attr("src").replace(/f1/g, "f2"); if (remplacement != $(aSwapper).attr("src")) { MM_swapImage(id, "", remplacement, 1); } } }).mouseout(function(e) { MM_swapImgRestore(); }); $("a").mouseover(function() { self.status= ""; return true; }); $("a").mouseout(function() { self.status= ""; return true; }); $(".imgDeleteCalendrier").click(function(e) { var a= this.id.split("-"); if (a.length != 2) { return; } var input= document.getElementById(a[1]); if (!input) { return; } input.value= ""; var input_texte= document.getElementById(input.id + "_texte"); if (!input_texte) { return; } input_texte.value= ""; }); $("span.lienFermerThickbox").click(function(e) { try { tb_remove(); } catch (ex) { try { parent.tb_remove(); } catch (ex) { } } }); $("img#imgThickBox").click(function() { try { tb_remove(); } catch (ex) { try { parent.tb_remove(); } catch (ex) { } } }); $("img.imgMenu").mouseover(function() { try { var nomMenu= $(this).attr("name"); MM_showMenu(eval("mm_menu_" + nomMenu), 0, 39, null, nomMenu); } catch (ex) { } }).mouseout(function() { try { MM_startTimeout(); } catch (ex) { } }); try { // On donne le focus au premier champ filtre qu'on trouve! if (typeof $("input.focus")[0] != "undefined") { $("input.focus")[0].focus(); } } catch (ex) { } }; $(document).ready(function() { global.AppliquerReglesAuDOM(); });