// ****************************************************************************************************************************************************** // *** CODE JAVASCRIPT // ****************************************************************************************************************************************************** // *** // *** favoris(nom,url) Ajouter aux favoris du Navigateur // *** ajax_send(url,data,reponse) Envoi une requete AJAX // *** verif_email(email) Vérifie une adresse e-mail // *** // *** onlyFlash(fichier,x,y,bgcolor,id) Renvoie le code d'un Lecteur Flash // *** objetFlash(fichier,x,y,bgcolor,id) Affiche un Lecteur Flash // *** // *** cacheid(id) Fixe le style 'display' de l'ID correspondant à 'none' // *** afficheid(id) Fixe le style 'display' de l'ID correspondant à 'block' // *** swapid(id) Inverse le style 'display' de l'ID correspondant // *** // *** + position Souris !!! // *** // ****************************************************************************************************************************************************** function NoError() { // return true; } //window.onerror=NoError; var abalonetitre = unescape('%3D%3D%20%20%20A%20B%20A%20L%20O%20N%20%20E%20%2C%20%20%20A%20g%20e%20n%20c%20e%20%20%20d%20%27%20E%20m%20p%20l%20o%20i%20s%20%20%20%3D%3D%0A%0A'); function favoris(nom,url) { if (document.all) { window.external.AddFavorite(url,nom); } else { window.sidebar.addPanel(nom,url,""); } } function ajax_send(url,data,reponse) { // url = POST ACTION data = POST Vars de la forme 'a=1&b=2&c=3' reponse = fonction pour la reponse (a mettre sans parenthèses) ; exemple : en mettant "test" la fonction test(return_vars) sera lancé ! var xmlhr_object = null; if (window.XMLHttpRequest) {xmlhr_object = new XMLHttpRequest();} else if (window.ActiveXObject) {xmlhr_object = new ActiveXObject("Microsoft.XMLHTTP");} xmlhr_object.onreadystatechange = function() { if (xmlhr_object.readyState == 4) { retour = reponse+"('"+xmlhr_object.responseText+"');"; eval(retour); } } xmlhr_object.open("POST", url, true); xmlhr_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlhr_object.send(data); } function verif_email(email) { email = ''+email; var regexp = /\w[\w\-\.]*@\w[\w\-\.]*\.[a-z]{2,}/i; retour = false; if (email != '') { if (regexp.test(email)) { retour = true; } } return retour; } function onlyFlash(fichier,x,y,bgcolor,id) { flashvars = fichier.split("?"); HTML = ''; HTML+= ''; HTML+= ''; HTML+= ''; HTML+= ''; HTML+= ''; HTML+= ''; HTML+= ''; HTML+= ''; HTML+= ''; HTML+= ''; return HTML; } function objetFlash(fichier,x,y,bgcolor,id) { HTML = onlyFlash(fichier,x,y,bgcolor,id); document.write(HTML); } function cacheid(id) {document.getElementById(id).style.display='none';} function afficheid(id) {document.getElementById(id).style.display='block';} function swapid(id) { if (document.getElementById(id).style.display=='block') { document.getElementById(id).style.display='none'; } else { document.getElementById(id).style.display='block'; } } var sourisX; var sourisY; function position(e) { sourisX = (navigator.appName.substring(0,3) == "Net") ? e.pageX : event.x+document.body.scrollLeft; sourisY = (navigator.appName.substring(0,3) == "Net") ? e.pageY : event.y+document.body.scrollTop; } if (navigator.appName.substring(0,3) == "Net") document.captureEvents(Event.MOUSEMOVE); document.onmousemove = position;