function NewAjax() { var xmlhttp = false; try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp = new XMLHttpRequest(); } return xmlhttp; } function SendVote(id, action, next) { var answer; answer = document.getElementById('answer-'+id); ajax = NewAjax(); ajax.open("POST", "http://en.twash.org/vote.php", true); ajax.onreadystatechange = function() { if (ajax.readyState == 4) { answer.innerHTML = ajax.responseText; if (ajax.responseText == 'You just vote up!' || ajax.responseText == 'You just vote down!') { var votes; votes = document.getElementById('votes-'+id); votes.innerHTML = next; } var voting1; voting1 = document.getElementById('voting1-'+id); voting1.style.display = 'none'; var voting2; voting2 = document.getElementById('voting2-'+id); voting2.style.display = 'none'; } else { answer.innerHTML = 'Wait...'; } } ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("id="+id+"&action="+action); } function DisplayFavs(user, p) { var answer; answer = document.getElementById('answer'); ajax = NewAjax(); ajax.open("POST", "http://en.twash.org/favs.php", true); ajax.onreadystatechange = function() { if (ajax.readyState == 4) { answer.innerHTML = ajax.responseText; } else { answer.innerHTML = '
Wait...
'; } } ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); ajax.send("user="+user+"&p="+p); }