//gäller alla ajax-refresh funktioner /////////////////////
function createRequestObject() { 
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))
}
 



 


 
//div 1
/////////////////////////////////////
function refreshdiv_allonline()
{
var seconds = 5;

var divid = "allonline";

var url = "online/ajax_allonline.php";

 

var xmlHttp1 = createRequestObject();
// No cache
var timestamp = fetch_unix_timestamp();
var nocacheurl = url+"?t="+timestamp;
 

xmlHttp1.onreadystatechange=function()
{

if(xmlHttp1.readyState==4)
{
document.getElementById(divid).innerHTML=xmlHttp1.responseText;

setTimeout('refreshdiv_allonline()',seconds*1000);

}

}

xmlHttp1.open("GET",nocacheurl,true);

xmlHttp1.send(null);

}


// Start the refreshing process
window.onload = function startrefresh()
{
setTimeout('refreshdiv_allonline()',seconds*1000);
}
 






//div 2
/////////////////////////////////////
function refreshdiv_online_v()
{
var seconds = 5;

var divid = "online_v";

var url = "online/ajax_online_v.php";

 

var xmlHttp2 = createRequestObject();
// No cache
var timestamp = fetch_unix_timestamp();
var nocacheurl = url+"?t="+timestamp;
 

xmlHttp2.onreadystatechange=function()
{

if(xmlHttp2.readyState==4)
{
document.getElementById(divid).innerHTML=xmlHttp2.responseText;

setTimeout('refreshdiv_online_v()',seconds*1000);

}

}

xmlHttp2.open("GET",nocacheurl,true);

xmlHttp2.send(null);

}


// Start the refreshing process
window.onload = function startrefresh()
{
setTimeout('refreshdiv_online_v()',seconds*1000);
}
 
 
 
 




//div 3
/////////////////////////////////////
function refreshdiv_online_m()
{
var seconds = 5;

var divid = "online_m";

var url = "online/ajax_online_m.php";

 

var xmlHttp3 = createRequestObject();
// No cache
var timestamp = fetch_unix_timestamp();
var nocacheurl = url+"?t="+timestamp;
 

xmlHttp3.onreadystatechange=function()
{

if(xmlHttp3.readyState==4)
{
document.getElementById(divid).innerHTML=xmlHttp3.responseText;

setTimeout('refreshdiv_online_m()',seconds*1000);

}

}

xmlHttp3.open("GET",nocacheurl,true);

xmlHttp3.send(null);

}


// Start the refreshing process
window.onload = function startrefresh()
{
setTimeout('refreshdiv_online_m()',seconds*1000);
}
 

 
 
 
 

 

//div 4
/////////////////////////////////////
function refreshdiv_ip()
{
var seconds = 5;

var divid = "ip";

var url = "ajax_online_ip.php";

 

var xmlHttp4 = createRequestObject();
// No cache
var timestamp = fetch_unix_timestamp();
var nocacheurl = url+"?t="+timestamp;
 

xmlHttp4.onreadystatechange=function()
{

if(xmlHttp4.readyState==4)
{
document.getElementById(divid).innerHTML=xmlHttp4.responseText;

setTimeout('refreshdiv_ip()',seconds*1000);

}

}

xmlHttp4.open("GET",nocacheurl,true);

xmlHttp4.send(null);

}


// Start the refreshing process
window.onload = function startrefresh()
{
setTimeout('refreshdiv_ip()',seconds*1000);
}
 
 
 
 
 
 
 
 
 
 
//div 5
/////////////////////////////////////
function refreshdiv_admins()
{
var seconds = 5;

var divid = "admins";

var url = "ajax_online_admins.php";

 

var xmlHttp5 = createRequestObject();
// No cache
var timestamp = fetch_unix_timestamp();
var nocacheurl = url+"?t="+timestamp;
 

xmlHttp5.onreadystatechange=function()
{

if(xmlHttp5.readyState==4)
{
document.getElementById(divid).innerHTML=xmlHttp5.responseText;

setTimeout('refreshdiv_admins()',seconds*1000);

}

}

xmlHttp5.open("GET",nocacheurl,true);

xmlHttp5.send(null);

}


// Start the refreshing process
window.onload = function startrefresh()
{
setTimeout('refreshdiv_admins()',seconds*1000);
}  
 
 
 
 
 
 

 
 
 //div 6
/////////////////////////////////////
function refreshdiv_medlemmar()
{
var seconds = 5;

var divid = "medlemmar";

var url = "ajax_online_members.php";

 

var xmlHttp6 = createRequestObject();
// No cache
var timestamp = fetch_unix_timestamp();
var nocacheurl = url+"?t="+timestamp;
 

xmlHttp6.onreadystatechange=function()
{

if(xmlHttp6.readyState==4)
{
document.getElementById(divid).innerHTML=xmlHttp6.responseText;

setTimeout('refreshdiv_medlemmar()',seconds*1000);

}

}

xmlHttp6.open("GET",nocacheurl,true);

xmlHttp6.send(null);

}


// Start the refreshing process
window.onload = function startrefresh()
{
setTimeout('refreshdiv_medlemmar()',seconds*1000);
}
