Event.observe(window, 'load', afficheSousRubriqueInit, false); function afficheSousRubriqueInit() { $('rubrique').onchange = afficheSousRubrique; $('Search').onclick = callSubmit; } function switchStatus(postid) { var url = "http://www.mymemoriae.eu/wp-content/themes/quovadis/ajax/switchStatus.php?id="+postid; var success = function(t){switchStatusComplete(t, postid);} var myAjax = new Ajax.Request(url, {method:'post', onSuccess:success}); return false; } function callSubmit(evt) { $('frm-search').submit(); return false; } function afficheSousRubrique(evt) { var url = "http://www.mymemoriae.eu/wp-content/themes/quovadis/ajax/getSousRub2.php?id="+$('rubrique').value; var success = function(t){afficheSousRubriqueComplete(t);} var myAjax = new Ajax.Request(url, {method:'post', onSuccess:success}); return false; } function afficheSousRubriqueComplete(t) { document.getElementById("spansous_rubrique").innerHTML = t.responseText; } function switchStatusComplete(t, postid) { document.getElementById("linkSwitch_"+postid).innerHTML = t.responseText; if (document.getElementById("linkSwitch_"+postid).title == "Cliquez pour rendre public" ) document.getElementById("linkSwitch_"+postid).title = "Cliquez pour rendre privé"; else document.getElementById("linkSwitch_"+postid).title = "Cliquez pour rendre public"; }