
function getXMLAd(keyword,adDiv){


var newLogoDiv = document.getElementById(adDiv);

if (newLogoDiv.innerHTML == ""){
// no ad div contents, so fetch an ad and populate the div

	if (window.XMLHttpRequest){
	  xhttp=new XMLHttpRequest();
	  }	else {  // for older IE 5/6
	  xhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	xhttp.open("GET", "http://adimages.go.com/ad/sponsors/utilities/test/abcfamily/heroAdFeed2-"+keyword+".xml",false);  // normally this keyword value would be passed as a query string parameter, not as a portion of a filename.
	xhttp.send("");
	xmlDoc=xhttp.responseXML;
	var heroAdAsset=xmlDoc.getElementsByTagName("adCode")[0].childNodes[0].nodeValue;
	document.getElementById(adDiv).innerHTML = heroAdAsset;
	}
}
