// The AJAX function
function AJAX(){
	try{
		xmlHttp=new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari
		return xmlHttp;
	}
	catch (e){
		try{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer
			return xmlHttp;
		}
		catch (e){
			try{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
				return xmlHttp;
			}
			catch (e){
				alert("Your browser does not support AJAX.");
				return false;
			}
		}
	}
}

// Timestamp for preventing IE caching the GET request (common function)
function fetch_unix_timestamp()
{
 return parseInt(new Date().getTime().toString().substring(0, 10))
}

/////////////////////////////////////////////////////////
// Refreshing wgc1_players_div
//    - This is for player list only (used on front page)
/////////////////////////////////////////////////////////
function refreshdiv_wgc1_players_div(){
	// Customise those settings
	var seconds = 15;
	var divid = "wgc1_players_div";
	var url = "wgc1_players.php";

	// Create xmlHttp
	var xmlHttp_one = AJAX();

	// No cache
	var timestamp = fetch_unix_timestamp();
	var nocacheurl = url+"?t="+timestamp;

	// The code
	xmlHttp_one.onreadystatechange=function(){
		if(xmlHttp_one.readyState==4){
			document.getElementById(divid).innerHTML=xmlHttp_one.responseText;
			setTimeout('refreshdiv_wgc1_players_div()',seconds*1000);
		}
	}
	xmlHttp_one.open("GET",nocacheurl,true);
	xmlHttp_one.send(null);
}

// Start the refreshing process
window.onload = function startrefresh(){
	setTimeout('refreshdiv_wgc1_players_div()',seconds*1000);
}

/////////////////////////////////////////////////////////
// Refreshing wgc2_players_div
//    - This is for player list only (used on front page)
/////////////////////////////////////////////////////////
function refreshdiv_wgc2_players_div(){
	// Customise those settings
	var seconds = 15;
	var divid = "wgc2_players_div";
	var url = "wgc2_players.php";

	// Create xmlHttp
	var xmlHttp_two = AJAX();

	// No cache
	var timestamp = fetch_unix_timestamp();
	var nocacheurl = url+"?t="+timestamp;

	// The code
	xmlHttp_two.onreadystatechange=function(){
		if(xmlHttp_two.readyState==4){
			document.getElementById(divid).innerHTML=xmlHttp_two.responseText;
			setTimeout('refreshdiv_wgc2_players_div()',seconds*1000);
		}
	}
	xmlHttp_two.open("GET",nocacheurl,true);
	xmlHttp_two.send(null);
}

// Start the refreshing process
window.onload = function startrefresh(){
	setTimeout('refreshdiv_wgc2_players_div()',seconds*1000);
}

/////////////////////////////////////////////////////////
// Refreshing wgc3_players_div
//    - This is for player list only (used on front page)
/////////////////////////////////////////////////////////
function refreshdiv_wgc3_players_div(){
	// Customise those settings
	var seconds = 15;
	var divid = "wgc3_players_div";
	var url = "wgc3_players.php";

	// Create xmlHttp
	var xmlHttp_three = AJAX();

	// No cache
	var timestamp = fetch_unix_timestamp();
	var nocacheurl = url+"?t="+timestamp;

	// The code
	xmlHttp_three.onreadystatechange=function(){
		if(xmlHttp_three.readyState==4){
			document.getElementById(divid).innerHTML=xmlHttp_three.responseText;
			setTimeout('refreshdiv_wgc3_players_div()',seconds*1000);
		}
	}
	xmlHttp_three.open("GET",nocacheurl,true);
	xmlHttp_three.send(null);
}

// Start the refreshing process
var seconds;
window.onload = function startrefresh(){
	setTimeout('refreshdiv_wgc3_players_div()',seconds*1000);
}

/////////////////////////////////////////////////////////
// Refreshing wgc1_player_stats_div
//    - This is for full player stats (used on full monitor page)
/////////////////////////////////////////////////////////
function refreshdiv_wgc1_player_stats_div(){
	// Customise those settings
	var seconds = 15;
	var divid = "wgc1_player_stats_div";
	var url = "wgc1_player_stats.php";

	// Create xmlHttp
	var xmlHttp_four = AJAX();

	// No cache
	var timestamp = fetch_unix_timestamp();
	var nocacheurl = url+"?t="+timestamp;

	// The code
	xmlHttp_four.onreadystatechange=function(){
		if(xmlHttp_four.readyState==4){
			document.getElementById(divid).innerHTML=xmlHttp_four.responseText;
			setTimeout('refreshdiv_wgc1_player_stats_div()',seconds*1000);
		}
	}
	xmlHttp_four.open("GET",nocacheurl,true);
	xmlHttp_four.send(null);
}

// Start the refreshing process
window.onload = function startrefresh(){
	setTimeout('refreshdiv_wgc1_player_stats_div()',seconds*1000);
}

/////////////////////////////////////////////////////////
// Refreshing wgc2_player_stats_div
//    - This is for full player stats (used on full monitor page)
/////////////////////////////////////////////////////////
function refreshdiv_wgc2_player_stats_div(){
	// Customise those settings
	var seconds = 15;
	var divid = "wgc2_player_stats_div";
	var url = "wgc2_player_stats.php";

	// Create xmlHttp
	var xmlHttp_five = AJAX();

	// No cache
	var timestamp = fetch_unix_timestamp();
	var nocacheurl = url+"?t="+timestamp;

	// The code
	xmlHttp_five.onreadystatechange=function(){
		if(xmlHttp_five.readyState==4){
			document.getElementById(divid).innerHTML=xmlHttp_five.responseText;
			setTimeout('refreshdiv_wgc2_player_stats_div()',seconds*1000);
		}
	}
	xmlHttp_five.open("GET",nocacheurl,true);
	xmlHttp_five.send(null);
}

// Start the refreshing process
window.onload = function startrefresh(){
	setTimeout('refreshdiv_wgc2_player_stats_div()',seconds*1000);
}

/////////////////////////////////////////////////////////
// Refreshing wgc3_player_stats_div
//    - This is for full player stats (used on full monitor page)
/////////////////////////////////////////////////////////
function refreshdiv_wgc3_player_stats_div(){
	// Customise those settings
	var seconds = 15;
	var divid = "wgc3_player_stats_div";
	var url = "wgc3_player_stats.php";

	// Create xmlHttp
	var xmlHttp_six = AJAX();

	// No cache
	var timestamp = fetch_unix_timestamp();
	var nocacheurl = url+"?t="+timestamp;

	// The code
	xmlHttp_six.onreadystatechange=function(){
		if(xmlHttp_six.readyState==4){
			document.getElementById(divid).innerHTML=xmlHttp_six.responseText;
			setTimeout('refreshdiv_wgc3_player_stats_div()',seconds*1000);
		}
	}
	xmlHttp_six.open("GET",nocacheurl,true);
	xmlHttp_six.send(null);
}

// Start the refreshing process
window.onload = function startrefresh(){
	setTimeout('refreshdiv_wgc3_player_stats_div()',seconds*1000);
}

/////////////////////////////////////////////////////////
// Refreshing wgc1_server_status_div
//    - Used on full monitor page
/////////////////////////////////////////////////////////
function refreshdiv_wgc1_server_status_div(){
	// Customise those settings
	var seconds = 15;
	var divid = "wgc1_server_status_div";
	var url = "wgc1_server_status.php";

	// Create xmlHttp
	var xmlHttp_seven = AJAX();

	// No cache
	var timestamp = fetch_unix_timestamp();
	var nocacheurl = url+"?t="+timestamp;

	// The code
	xmlHttp_seven.onreadystatechange=function(){
		if(xmlHttp_seven.readyState==4){
			document.getElementById(divid).innerHTML=xmlHttp_seven.responseText;
			setTimeout('refreshdiv_wgc1_server_status_div()',seconds*1000);
		}
	}
	xmlHttp_seven.open("GET",nocacheurl,true);
	xmlHttp_seven.send(null);
}

// Start the refreshing process
window.onload = function startrefresh(){
	setTimeout('refreshdiv_wgc1_server_status_div()',seconds*1000);
}

/////////////////////////////////////////////////////////
// Refreshing wgc2_server_status_div
//    - Used on full monitor page
/////////////////////////////////////////////////////////
function refreshdiv_wgc2_server_status_div(){
	// Customise those settings
	var seconds = 15;
	var divid = "wgc2_server_status_div";
	var url = "wgc2_server_status.php";

	// Create xmlHttp
	var xmlHttp_eight = AJAX();

	// No cache
	var timestamp = fetch_unix_timestamp();
	var nocacheurl = url+"?t="+timestamp;

	// The code
	xmlHttp_eight.onreadystatechange=function(){
		if(xmlHttp_eight.readyState==4){
			document.getElementById(divid).innerHTML=xmlHttp_eight.responseText;
			setTimeout('refreshdiv_wgc2_server_status_div()',seconds*1000);
		}
	}
	xmlHttp_eight.open("GET",nocacheurl,true);
	xmlHttp_eight.send(null);
}

// Start the refreshing process
window.onload = function startrefresh(){
	setTimeout('refreshdiv_wgc2_server_status_div()',seconds*1000);
}

/////////////////////////////////////////////////////////
// Refreshing wgc3_server_status_div
//    - Used on full monitor page
/////////////////////////////////////////////////////////
function refreshdiv_wgc3_server_status_div(){
	// Customise those settings
	var seconds = 15;
	var divid = "wgc3_server_status_div";
	var url = "wgc3_server_status.php";

	// Create xmlHttp
	var xmlHttp_nine = AJAX();

	// No cache
	var timestamp = fetch_unix_timestamp();
	var nocacheurl = url+"?t="+timestamp;

	// The code
	xmlHttp_nine.onreadystatechange=function(){
		if(xmlHttp_nine.readyState==4){
			document.getElementById(divid).innerHTML=xmlHttp_nine.responseText;
			setTimeout('refreshdiv_wgc3_server_status_div()',seconds*1000);
		}
	}
	xmlHttp_nine.open("GET",nocacheurl,true);
	xmlHttp_nine.send(null);
}

// Start the refreshing process
window.onload = function startrefresh(){
	setTimeout('refreshdiv_wgc3_server_status_div()',seconds*1000);
}

/////////////////////////////////////////////////////////
// Refreshing wgc1_status_short_div
//    - Used on front page only
/////////////////////////////////////////////////////////
function refreshdiv_wgc1_status_short_div(){
	// Customise those settings
	var seconds = 15;
	var divid = "wgc1_status_short_div";
	var url = "wgc1_status_short.php";

	// Create xmlHttp
	var xmlHttp_ten = AJAX();

	// No cache
	var timestamp = fetch_unix_timestamp();
	var nocacheurl = url+"?t="+timestamp;

	// The code
	xmlHttp_ten.onreadystatechange=function(){
		if(xmlHttp_ten.readyState==4){
			document.getElementById(divid).innerHTML=xmlHttp_ten.responseText;
			setTimeout('refreshdiv_wgc1_status_short_div()',seconds*1000);
		}
	}
	xmlHttp_ten.open("GET",nocacheurl,true);
	xmlHttp_ten.send(null);
}

// Start the refreshing process
window.onload = function startrefresh(){
	setTimeout('refreshdiv_wgc1_status_short_div()',seconds*1000);
}

/////////////////////////////////////////////////////////
// Refreshing wgc2_status_short_div
//    - Used on front page only
/////////////////////////////////////////////////////////
function refreshdiv_wgc2_status_short_div(){
	// Customise those settings
	var seconds = 15;
	var divid = "wgc2_status_short_div";
	var url = "wgc2_status_short.php";

	// Create xmlHttp
	var xmlHttp_eleven = AJAX();

	// No cache
	var timestamp = fetch_unix_timestamp();
	var nocacheurl = url+"?t="+timestamp;

	// The code
	xmlHttp_eleven.onreadystatechange=function(){
		if(xmlHttp_eleven.readyState==4){
			document.getElementById(divid).innerHTML=xmlHttp_eleven.responseText;
			setTimeout('refreshdiv_wgc2_status_short_div()',seconds*1000);
		}
	}
	xmlHttp_eleven.open("GET",nocacheurl,true);
	xmlHttp_eleven.send(null);
}

// Start the refreshing process
window.onload = function startrefresh(){
	setTimeout('refreshdiv_wgc2_status_short_div()',seconds*1000);
}

/////////////////////////////////////////////////////////
// Refreshing wgc3_status_short_div
//    - Used on front page only
/////////////////////////////////////////////////////////
function refreshdiv_wgc3_status_short_div(){
	// Customise those settings
	var seconds = 15;
	var divid = "wgc3_status_short_div";
	var url = "wgc3_status_short.php";

	// Create xmlHttp
	var xmlHttp_twelve = AJAX();

	// No cache
	var timestamp = fetch_unix_timestamp();
	var nocacheurl = url+"?t="+timestamp;

	// The code
	xmlHttp_twelve.onreadystatechange=function(){
		if(xmlHttp_twelve.readyState==4){
			document.getElementById(divid).innerHTML=xmlHttp_twelve.responseText;
			setTimeout('refreshdiv_wgc3_status_short_div()',seconds*1000);
		}
	}
	xmlHttp_twelve.open("GET",nocacheurl,true);
	xmlHttp_twelve.send(null);
}

// Start the refreshing process
window.onload = function startrefresh(){
	setTimeout('refreshdiv_wgc3_status_short_div()',seconds*1000);
}

/////////////////////////////////////////////////////////
// Refreshing wgc3_countdown_div
//    - Used on full monitor page
/////////////////////////////////////////////////////////
function refreshdiv_wgc3_countdown_div(){
	// Customise those settings
	var seconds = 15;
	var divid = "wgc3_countdown_div";
	var url = "wgc3_countdown.php";

	// Create xmlHttp
	var xmlHttp_thirteen = AJAX();

	// No cache
	var timestamp = fetch_unix_timestamp();
	var nocacheurl = url+"?t="+timestamp;

	// The code
	xmlHttp_thirteen.onreadystatechange=function(){
		if(xmlHttp_thirteen.readyState==4){
			document.getElementById(divid).innerHTML=xmlHttp_thirteen.responseText;
			setTimeout('refreshdiv_wgc3_countdown_div()',seconds*1000);
		}
	}
	xmlHttp_thirteen.open("GET",nocacheurl,true);
	xmlHttp_thirteen.send(null);
}

// Start the refreshing process
window.onload = function startrefresh(){
	setTimeout('refreshdiv_wgc3_countdown_div()',seconds*1000);
}