function initRotate(){
	if (window.XMLHttpRequest){ // code for IE7+, Firefox, Chrome, Opera, Safari
  		xmlhttp=new XMLHttpRequest();
  	} else { // code for IE6, IE5
  		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  	}
	xmlhttp.open("GET", "/_php/hp_images.php", false);
	xmlhttp.send();
	
	productImages = xmlhttp.responseText.split(';').slice(0, -1);
	document.getElementsByName("rotatingImage").src = productImages[Math.floor(Math.random()*productImages.length)];
	setTimeout("rotateImage()", 4*1000);
}

function rotateImage(){
	document.getElementsByName("rotatingImage").src = productImages[Math.floor(Math.random()*productImages.length)];
	setTimeout("rotateImage()", 4*1000);
}

window.onload=initRotate;

