5
// Mozilla, Opera 8+, Safari
6
xmlHttp = new XMLHttpRequest();
10
xmlHttp = new ActiveXObject( "Msxml2.XMLHTTP" );
14
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
16
alert( "Your browser doesn't support AJAX!" );
23
function generateCache() {
26
xmlHttp.onreadystatechange=function() {
27
if ( xmlHttp.readyState == 4 ) {
28
document.getElementById( "report_cache" ).innerHTML = xmlHttp.responseText;
29
document.getElementById( "report_cache" ).className = "";
30
document.getElementById( "show_button" ).disabled = false;
31
document.getElementById( "show_button" ).className = "";
34
document.getElementById( "report_cache" ).innerHTML = "Generating new cache.";
35
document.getElementById( "report_cache" ).className = "cache_loading";
36
document.getElementById( "show_button" ).disabled = true;
37
document.getElementById( "show_button" ).className = "disabled_button";
38
xmlHttp.open( "GET", "report.php?generate=1&" + getTypeReport(), true );
42
function checkCache() {
43
if ( document.getElementById( "show_button" ).disabled ) {
49
function getTypeReport() {
50
var form = document.getElementById( "limit_form" );
51
return "type=" + form.type.value + "&report=" + form.report.value;
53
function page( num, inc ) {
54
form = document.getElementById( "limit_form" );
56
cur_page = form.page.value;
57
form.page.value = Number(cur_page) + num;
59
form.page.value = num;
61
if ( checkCache() ) form.submit();
64
function resort( sort ) {
65
form = document.getElementById( "limit_form" );
66
form.sort.value = sort;
67
if ( checkCache() ) form.submit();
71
function print_options_hide() {
72
options_menu = document.getElementById("print_options_menu");
73
options_menu.style.display = "none";
76
function print_options_show() {
77
options_menu = document.getElementById("print_options_menu");
78
options_menu.style.display = "";
81
function export_options_hide() {
82
options_menu = document.getElementById("export_options_menu");
83
options_menu.style.display = "none";
86
function export_options_show() {
87
options_menu = document.getElementById("export_options_menu");
88
options_menu.style.display = "";