// Customise those settings

var secondsVisitors = 30;
var dividVisitors = "numofvisitorsdiv";
var urlVisitors = "visitors.asp";

////////////////////////////////
//
// Refreshing the DIV
//
////////////////////////////////

function refreshdivVisitors(){

// The XMLHttpRequest object

var xmlHttpVisitors;
try{
xmlHttpVisitors=new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari
}
catch (e){
try{
xmlHttpVisitors=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer
}
catch (e){
try{
xmlHttpVisitors=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e){
alert("Your browser does not support AJAX.");
return false;
}
}
}

// Timestamp for preventing IE caching the GET request

fetch_unix_timestampVisitors = function()
{
return parseInt(new Date().getTime().toString().substring(0, 10))
}

var timestampVisitors = fetch_unix_timestampVisitors();
var nocacheurlVisitors = urlVisitors+"?t="+timestampVisitors;

// The code...

xmlHttpVisitors.onreadystatechange=function(){
if(xmlHttpVisitors.readyState==4){
document.getElementById(dividVisitors).innerHTML=xmlHttpVisitors.responseText;
setTimeout('refreshdivVisitors()',secondsVisitors*1000);
}
}
xmlHttpVisitors.open("GET",nocacheurlVisitors,true);
xmlHttpVisitors.send(null);
}

// Start the refreshing process

var secondsVisitors;
window.onload = function startrefreshVisitors(){
setTimeout('refreshdivVisitors()',secondsVisitors*1000);
setTimeout('refreshdiv()',seconds*1000);
}

