var xhttp;

function getAds(){
	xhttp=GetXHttpObject();
	if (xhttp==null){
		alert ("Browser does not support HTTP Request");
		return;
	}//end if
	var nocache = (new Date()).getTime();
	var url="webservices/ads.php?nocache="+nocache;
		
	xhttp.onreadystatechange=changeAds;
	xhttp.open("GET",url,true);
	xhttp.send(null);
}//end function

function changeAds(){
		if (xhttp.readyState==4 || xhttp.readyState=="complete"){
		document.getElementById("ads").innerHTML=xhttp.responseText; 
	}//end if
}//end function

function GetXHttpObject(){
	var xhttp=null;
    try{
		// Firefox, Opera 8.0+, Safari
		xhttp=new XMLHttpRequest();
	}//end try
	catch (e){
		//Internet Explorer
		try{
			xhttp=new ActiveXObject("Msxml2.XMLHTTP");
		}//end try
		catch (e){
			xhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}//end catch
    }//end catch
	return xhttp;
}//end function