function ultimateAjax(urlTo, mySend, x){
  var http = null;
  if(window.XMLHttpRequest)
    http = new XMLHttpRequest();
  else if (window.ActiveXObject)
    http = new ActiveXObject("Microsoft.XMLHTTP");

  http.onreadystatechange = function()
  {
    if(http.readyState==1){
		x.innerHTML= "<p>Please wait, updating...</p>";
 	}
    if(http.readyState == 4){
		x.innerHTML= http.responseText;
	}	
  };  
http.open('POST', ''+urlTo, true);
http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');  
http.send(mySend);
return false;
}

function titleAjax(urlTo, mySend){
  var http = null;
  if(window.XMLHttpRequest)
    http = new XMLHttpRequest();
  else if (window.ActiveXObject)
    http = new ActiveXObject("Microsoft.XMLHTTP");

  http.onreadystatechange = function()
  {
    if(http.readyState==1){
		
 	}
    if(http.readyState == 4){
		document.title = http.responseText  + "Surfing Seadog Forum";
	}	
  };  
http.open('POST', ''+urlTo, true);
http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');  
http.send(mySend);
return false;
}

function updateNewest(){
x=document.getElementById("lastmessage");
mySend="lastload="+lastLoad;
ultimateAjax('newestmsg.php', mySend, x);
x.style.background="transparent";
var my_date=new Date();
}

function updateTitle(){
mySend="lastload="+lastLoad;
titleAjax('newmsgcount.php', mySend);

}

setInterval("updateNewest()", 120000);
setInterval("updateTitle()", 120000);