// declare new variables for each new div that you add, and link to the div by ID
// var region_div = document.getElementById("region_div");

var LOGIN_COUNTER=0;

function makeonline(){
		ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	 if (doc){
	       doc.open("GET", "./make_online.php?section=makeonline", false);
	       doc.send(null);
			
	    }
		
		setTimeout('makeonline()',20000);	 
}

function UPDATE_LOGIN_COUNTER(show)
	{
		ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	 if (doc){
	       doc.open("GET", "./make_online.php?section=login_counter", false);
	       doc.send(null);
		   	var Counter=parseInt(doc.responseText);
			
		   if(LOGIN_COUNTER<Counter)
		   	{
		   		LOGIN_COUNTER=Counter;
				if(show=="whos_online")
					document.location="whos_online.html";
				if(show=="chat_details")
					document.location="index.php?show=chat_details";
				if(show=="home")
					document.location="home.html";
			}
	    }
		
		setTimeout("UPDATE_LOGIN_COUNTER('"+show+"')",10000);	 
		
	}


/*function Check_chat(){
		
		ajax();
		// Load the result from the response page
		// ** As far a I know firefox will only load a document on the SAME domain!!	
	 if (doc){
	       doc.open("GET", "http://www.adultsfunclub.co.uk/make_online.php?section=check_chat", false);
	       doc.send(null);
		
	 if(doc.responseText>0)
		 	{
			var Userid=parseInt(doc.responseText);
				
			var newwindow=window.open("http://www.adultsfunclub.co.uk/php121/php121im.php?to="+Userid,"winname"+Userid,"height=500,width=540,left=20,top=20,toolbar=no,menubar=no,directories=no,location=no,scrollbars=yes,status=no,resizable=yes,fullscreen=no");
			if (window.focus) {newwindow.focus();} 
			}
	    }
}*/
