function XHConn() { var xmlhttp=false; /*from http://jibbering.com/2002/4/httprequest.html */ /*@cc_on @*/ /*@if (@_jscript_version >= 5) // JScript gives us Conditional compilation, we can cope with old IE versions. // and security blocked creation of the objects. try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } @end @*/ if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { xmlhttp = new XMLHttpRequest(); } if (!xmlhttp) { return null; } this.connect = function(sMethod, sURL, sVars, fnDone, layer) { if (!xmlhttp) { return false; } sMethod = sMethod.toUpperCase(); try { if (sMethod == "GET") { xmlhttp.open(sMethod, sURL+"?"+sVars, true); sVars = ""; } else { xmlhttp.open(sMethod, sURL, true); xmlhttp.setRequestHeader("Method", "POST "+sURL+" HTTP/1.1"); xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); } xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4) { if (typeof(fnDone) == 'function') fnDone(xmlhttp); else if (typeof(fnDone) == 'string') eval(fnDone+"(xmlhttp,layer);"); } } xmlhttp.send(sVars); } catch(z) { return false; } return true; }; return this; } function handler_function(xmlhttpobject,layer) { document.getElementById(layer).innerHTML = xmlhttpobject.responseText; } function FetchList(whichpage, qs, layer, time) { time = parseInt(time); if (isNaN(time)) { time = 5000; } connection = new XHConn(); connection.connect('GET', '/'+whichpage+'.php', qs, 'handler_function', layer); delete connection; if (time > 0) { window.setTimeout('FetchList("'+whichpage+'","'+qs+'","'+layer+'", '+time+')', time); } } function ShowEdit(id) { document.getElementById('editpanel').style.display="block"; FetchList('miniedit',id,'editpanel',0); } function CloseEdit() { document.getElementById('editpanel').style.display="none"; }