var xmlhttp = false;

if( window.XMLHttpRequest) {
	xmlhttp = new XMLHttpRequest();
	xmlhttp.overrideMimeType('text/xml');
}
else if (window.ActiveXObject) 
{
	xmlhttp = new ActiveXObject("Microsoft.XMLHTTP")
}

function getNextProduct( product ) {
	var url   = 'rotation.php?product=' + product;
	xmlhttp.open('GET', url, true);
	xmlhttp.onreadystatechange = replaceProduct;
	xmlhttp.send(null);
}

function replaceProduct() {
	if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
		document.getElementById("bodycopy").innerHTML=xmlhttp.responseText;	
	}
}
