var sPath = window.location.pathname;
//var sPage = sPath.substring(sPath.lastIndexOf('\\') + 1);
var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);

function doBlink() {
	var blink = document.all.tags("BLINK")
	for (var i=0; i<blink.length; i++)
		blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : ""
}

function startBlink() {
	if (document.all)
		setInterval("doBlink()",20000)
}
window.onload = startBlink;


// Create multiple XMLHttpRequest objects (one for each DIV)

var xmlHttp_twenty = AJAX();
var xmlHttp_thirty = AJAX();
var xmlHttp_twentytwo = AJAX();

// 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 the DIV testimonials
//
////////////////////////////////

function refreshdiv_testimonials(){

// Customise those settings

var seconds = 10;
var divid = "testimonials";
var url = "thetestimonials.php";

// No cache

var timestamp = fetch_unix_timestamp();
var nocacheurl = url+"?t="+timestamp;

// The code...

xmlHttp_twenty.onreadystatechange=function(){
if(xmlHttp_twenty.readyState==4){
document.getElementById(divid).innerHTML=xmlHttp_twenty.responseText;
setTimeout('refreshdiv_testimonials()',seconds*1000);
}
}
xmlHttp_twenty.open("GET",nocacheurl,true);
xmlHttp_twenty.send(null);
}

// Start the refreshing process

window.onload = function startrefresh(){
setTimeout('refreshdiv_testimonials()',seconds*1000);
}

////////////////////////////////

////////////////////////////////
//
// Refreshing the DIV league
//
////////////////////////////////

function refreshdiv_league(){

// Customise those settings

var seconds = 10;
var divid = "league";
var url = "theleagues.php";

// No cache

var timestamp = fetch_unix_timestamp();
var nocacheurl = url+"?t="+timestamp;

// The code...

xmlHttp_thirty.onreadystatechange=function(){
if(xmlHttp_thirty.readyState==4){
document.getElementById(divid).innerHTML=xmlHttp_thirty.responseText;
setTimeout('refreshdiv_league()',seconds*1000);
}
}
xmlHttp_thirty.open("GET",nocacheurl,true);
xmlHttp_thirty.send(null);
}

// Start the refreshing process

window.onload = function startrefresh(){
setTimeout('refreshdiv_league()',seconds*1000);
}

////////////////////////////////
