var prev_id = -1; var xmlhttp = false; if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); xmlhttp.overrideMimeType('text/xml'); } else if (window.ActiveXObject) { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } function load_msg(msg_id, msg_folder) { if (!xmlhttp) { return; } if (prev_id > -1) { document.getElementById("msg"+prev_id).bgColor = ""; } document.getElementById("msg"+msg_id).bgColor = "#aabbcc"; prev_id = msg_id; url = "?function=load_msg&folder=" + msg_folder + "&id=" + msg_id; xmlhttp.open("GET", "ajax.py"+url, true); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4) { //alert(xmlhttp.responseText); //alert(xmlhttp.getAllResponseHeaders()); response = xmlhttp.responseText document.getElementById("bottompane").innerHTML = response; document.getElementById("msg" + msg_id).style.fontWeight = "normal"; document.getElementById("bottompane").style.display = "block"; } } xmlhttp.send(url) return false; }