function playVideo(id) {
	var req = getXmlHttpRequestObject();
	req.open("GET", "/util/header_video.php?topId=" + id, true);
	req.onreadystatechange = function () { updateElement('home_top', req);};
	req.send(null);
}

function showNews(id) {
	var req = getXmlHttpRequestObject();
	req.open("GET", "/util/header_news.php?topId=" + id, true);
	req.onreadystatechange = function () { updateElement('home_top', req);};
	req.send(null);
}
	
function getXmlHttpRequestObject() {	
	if (window.XMLHttpRequest) {		
		return new XMLHttpRequest(); //Not IE	
	} else if(window.ActiveXObject) {		
		return new ActiveXObject("Microsoft.XMLHTTP"); //IE	
	} else {
		alert("Your browser doesn't support the XmlHttpRequest object.");	
	}
}

function updateElement(span, receiveReq) {
	//Check to see if the XmlHttpRequests state is finished.	
	//alert('received readyState'+receiveReq.readyState);
	if (receiveReq.readyState == 4 || receiveReq.readyState == 0) {		
	//Set the contents of our span element to the result of the asyncronous call.
	//just to see if it moves
		document.getElementById(span).innerHTML = receiveReq.responseText;
		//alert (receiveReq.responseText);
	}
}
