

function rotate_ads(site,type){
var http = new XMLHttpRequest();

var ra = Math.random ( );
var url = "includes/rotating_ads.php";
var params = "ra="+ra+"&site="+site+"&type="+type;
http.open("POST", url, true);

//Send the proper header information along with the request
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");

http.onreadystatechange = function() {
	if(http.readyState == 4 && http.status == 200) {
		//alert(http.responseText);
		advert_content = http.responseText;
		document.getElementById('rotating_ads_'+type).innerHTML = advert_content;
		advert_content	= "";
	}
}
http.send(params);
setTimeout('rotate_ads(\''+site+'\',\''+type+'\')', 5000);
}
/*
function rotate_ads(site,type)
{
	$.ajax({ url: "includes/rotating_ads.php",data:{ra: ra, site: site, type: type}, context: document.body, type:"post",
		    success: function(msg){
				$('div#rotating_ads_'+type).html(msg);
   			}
	});
	
	setTimeout('rotate_ads(\''+site+'\',\''+type+'\')', 5000);
}
*/