// Create multiple XMLHttpRequest objects (one for each DIV)

var xmlHttp_one = AJAX();
var xmlHttp_two = AJAX();
var xmlHttp_left = AJAX();
var xmlHttp_right = 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 TIMEDIV
//
////////////////////////////////

function refreshdiv_timediv(){

// Customise those settings

var seconds = 10;
var divid = "timediv";
//var url = "boo.php";
var url = "banner_process.php";


// No cache

var timestamp = fetch_unix_timestamp();
var nocacheurl = url+"?t="+timestamp;
//alert(nocacheurl);
// The code...

xmlHttp_one.onreadystatechange=function(){
if(xmlHttp_one.readyState==4){
document.getElementById(divid).innerHTML=xmlHttp_one.responseText;
//setTimeout('refreshdiv_timediv()',seconds*1000);

}
}
xmlHttp_one.open("GET",nocacheurl,true);
xmlHttp_one.send(null);




}

//=====================================================================================

function refreshdiv_timediv_1(){

// Customise those settings

var seconds1 = 20;
var divid1 = "timediv_1";
//var url = "boo.php";
var url1 = "banner_process_1.php";

refreshdiv_timediv();
refreshdiv_timediv_left();
refreshdiv_timediv_right();
// No cache

var timestamp1 = fetch_unix_timestamp();
var nocacheurl1 = url1+"?t="+timestamp1;
//alert(nocacheurl1);
// The code...

xmlHttp_two.onreadystatechange=function(){
if(xmlHttp_two.readyState==4){

document.getElementById(divid1).innerHTML=xmlHttp_two.responseText;
setTimeout('refreshdiv_timediv_1();',seconds1*1000);

}
}
xmlHttp_two.open("GET",nocacheurl1,true);
xmlHttp_two.send(null);


}

//=====================================================================================

function refreshdiv_timediv_left(){

// Customise those settings

var seconds1 = 22;
var divid1 = "timediv_left";
//var url = "boo.php";
var url1 = "banner_process_bottom_left.php";


// No cache

var timestamp1 = fetch_unix_timestamp();
var nocacheurl1 = url1+"?t="+timestamp1;
//alert(nocacheurl1);
// The code...

xmlHttp_left.onreadystatechange=function(){
if(xmlHttp_left.readyState==4){

document.getElementById(divid1).innerHTML=xmlHttp_left.responseText;

}
}
xmlHttp_left.open("GET",nocacheurl1,true);
xmlHttp_left.send(null);


}
//=====================================================================================

function refreshdiv_timediv_right(){

// Customise those settings

var seconds1 = 22;
var divid1 = "timediv_right";
//var url = "boo.php";
var url1 = "banner_process_bottom_right.php";


// No cache

var timestamp1 = fetch_unix_timestamp();
var nocacheurl1 = url1+"?t="+timestamp1;
//alert(nocacheurl1);
// The code...

xmlHttp_right.onreadystatechange=function(){
if(xmlHttp_left.readyState==4){

document.getElementById(divid1).innerHTML=xmlHttp_right.responseText;

}
}
xmlHttp_right.open("GET",nocacheurl1,true);
xmlHttp_right.send(null);


}




window.onload =  refreshdiv_timediv_1; 
//window.onload =  refreshdiv_timediv_1; 

