var xmlHttp;

function deleteEvent(x)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
 
//setTimeout("window.location.assign(this.href)", 10000);

//tid = setInterval("deleteEvent(x)",50);
 
var eid = document.getElementById(x).id;
//alert (eid);
var url="events.php";
url=url+"?id="+eid;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);

window.location.assign(this.href);

}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("eid").innerHTML=xmlHttp.responseText;
 } 
}
