
var xmlHttp_NewEvent = false;
function xmlHttpInit()
{
	try {
	  xmlHttp_NewEvent = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
	  try {
		xmlHttp_NewEvent = new ActiveXObject("Microsoft.XMLHTTP");
	  } catch (e2) {
		xmlHttp_NewEvent = false;
	  }
	}
	if (!xmlHttp_NewEvent && typeof XMLHttpRequest != 'undefined') {
	  xmlHttp_NewEvent = new XMLHttpRequest();
	}
}

function NewEvent()
{
	xmlHttpInit()
	xmlHttp_NewEvent.open("GET", "Swant_Ajax.asp?action=NewEvent&t="+Math.random(), true);
	xmlHttp_NewEvent.onreadystatechange = GetNewEvent;
	xmlHttp_NewEvent.send(null); 
}

function GetNewEvent()
{
  if (xmlHttp_NewEvent.readyState < 4) {
  }
  if (xmlHttp_NewEvent.readyState == 4) {
	var response = xmlHttp_NewEvent.responseText.split("|");
	if (response[0]/4 > 0)
	{
		PlaySoundAct();
	}
	document.getElementById("ajax_order").innerHTML=response[0];
	document.getElementById("ajax_onlinepay").innerHTML=response[1];
	document.getElementById("ajax1").innerHTML=response[2];
	document.getElementById("ajax2").innerHTML=response[3];
	document.getElementById("ajax3").innerHTML=response[4];
  }
}

function PlaySoundAct(){	
   document.getElementById("ShowSound").innerHTML = "&nbsp;<bgsound loop=1 volume=0 src=images/NewEvent.wav></bgsound>";
}
setInterval('NewEvent()',1000*5);