// function to start rotation at interval of 5 seconds
   function startRotation()
   	{
   		// first content manually
   		   rotate();
   		
   		// repeat at interval
   		   setInterval("rotate()", 5000);
   	}

// function to change rotational content
	 function rotate()
	 	{
	 		// set url to get content from
	 		   strURL = "/magazines/magazine_rotate.php";
	 		
	 		var xmlHttpReq = false;
	 		var self = this;
	 		
	 		// Mozilla/Safari
	 		if (window.XMLHttpRequest) 
	 			{
	 				self.xmlHttpReq = new XMLHttpRequest();
	 			}
	 		// IE
	 		else if (window.ActiveXObject) 
	 			{
	 				self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
	 			}
	 		
	 		self.xmlHttpReq.open('POST', strURL, true);
	 		self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
	 		
	 		self.xmlHttpReq.onreadystatechange = function() 
	 			{
	 				if (self.xmlHttpReq.readyState == 4)
	 					{
	 						setContent(self.xmlHttpReq.responseText);
	 					}
	 			}
	 		
	 		// Mozilla/Safari
	 		if (window.XMLHttpRequest) 
	 			{
	 				self.xmlHttpReq.send(null);
	 			}
	 		// IE
	 		else if (window.ActiveXObject) 
	 			{
	 				self.xmlHttpReq.send();
	 			}
	 	}

// function to get rotational content
   function setContent(strInput)
   	{
   		//alert(strInput);
   		document.getElementById('rotating_magazine').innerHTML = strInput;
   		//alert(document.getElementById('rotating_magazine').innerHTML);
   	}

// add onLoad attribute to body tag
   window.onload = startRotation;


