/* ajouter un lien lors de copie/colle */ function addLink() { var body_element = document.getElementsByTagName('body')[0]; var selection; selection = window.getSelection(); var pagelink = " Lire plus sur : "+document.location.href+""; // change this if you want var copytext = selection + pagelink; var newdiv = document.createElement('div'); body_element.appendChild(newdiv); newdiv.innerHTML = copytext; selection.selectAllChildren(newdiv); window.setTimeout(function() { body_element.removeChild(newdiv); },0); } /* afficher / masquer un div */ function showhideme(id) { shown = document.getElementById(id).style.display; if (shown == 'block') shown2 = 'none'; else shown2 = 'block'; document.getElementById(id).style.display=shown2; } function MM_openBrWindow(theURL,winName,features) { window.open(theURL,winName,features); } function confirmeAction(message){ reponse = confirm(message);return reponse; } function confirmeSupprime(){ reponse = confirm("Etes-vous certain de vouloir supprimer cette ressource ?");return reponse; } /* AJAX */ function sendData(page, div) { if(document.all) var XhrObj = new ActiveXObject("Microsoft.XMLHTTP") ; else var XhrObj = new XMLHttpRequest(); var content = document.getElementById(div); XhrObj.open("POST", page); XhrObj.onreadystatechange = function(){ if (XhrObj.readyState == 4 && XhrObj.status == 200) content.innerHTML = XhrObj.responseText ; } XhrObj.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=iso-8859-1'); XhrObj.send(null); } function sendData2(page, div, laclass) { if(document.all) var XhrObj = new ActiveXObject("Microsoft.XMLHTTP") ; else var XhrObj = new XMLHttpRequest(); var content = document.getElementById(div); XhrObj.open("GET", page); XhrObj.onreadystatechange = function(){ if (XhrObj.readyState == 4 && XhrObj.status == 200) content.innerHTML = XhrObj.responseText; else content.innerHTML = "