if (typeof getURL == 'undefined') { getURL = function(url, callback) { if (!url) throw 'No URL for getURL'; try { if (typeof callback.operationComplete == 'function') callback = callback.operationComplete; } catch (e) {} if (typeof callback != 'function') throw 'No callback function for getURL'; var http_request = null; if (typeof XMLHttpRequest != 'undefined') { http_request = new XMLHttpRequest(); } else if (typeof ActiveXObject != 'undefined') { try { http_request = new ActiveXObject('Msxml2.XMLHTTP'); } catch (e) { try { http_request = new ActiveXObject('Microsoft.XMLHTTP'); } catch (e) {} } } if (!http_request) throw 'Both getURL and XMLHttpRequest are undefined'; http_request.onreadystatechange = function() { if (http_request.readyState == 4) { callback( { success : true, content : http_request.responseText, contentType : http_request.getResponseHeader("Content-Type") } ); } } http_request.open('GET', url, true); http_request.send(null); } } function outputrule(req) { alert(req.content); } function fetch_new_rules() { if(isPaused) return; if(isBusy) return; isBusy = true; getURL('diag_logs_filter_dynamic.php?lastsawtime=' + lastsawtime, fetch_new_rules_callback); } function fetch_new_rules_callback(callback_data) { if(isPaused) return; var data_split; var new_data_to_add = Array(); var data = callback_data.content; data_split = data.split("\n"); for(var x=0; x 0; i--) { rows[i].innerHTML = rows[i-1].innerHTML; } } $('firstrow').update(data[x]); } } function toggle_pause() { if(isPaused) { isPaused = false; fetch_new_rules(); } else { isPaused = true; } } /* start local AJAX engine */ if (typeof updateDelay != 'undefined') { timer = setInterval('fetch_new_rules()', updateDelay); }