Rnd = Math.floor(Math.random()*1000);
var finfo = "./adform/publish.cgi?"+Rnd+"=a&mode=XmlFile";
function loadXMLFile()
{
	infoObj = createXMLHttpRequest(displayData);
	if (infoObj)
	{
		infoObj.open("GET",finfo,true);
		infoObj.send(null);
	}
}
function displayData()
{
	if ((infoObj.readyState == 4) && (infoObj.status == 200))
	{
		xmlData = infoObj.responseXML;
		ArtListTags = xmlData.getElementsByTagName("Article");
		numberListTags = xmlData.getElementsByTagName("number");
		dateberListTags = xmlData.getElementsByTagName("date");
		titleListTags = xmlData.getElementsByTagName("title");
		commentListTags = xmlData.getElementsByTagName("comment");
		newimagListTags = xmlData.getElementsByTagName("newimag");

		userLen = ArtListTags.length;
		resultText = "";
		for(i=0; i<userLen; i++){
			if(i < 20){
				num = numberListTags[i].firstChild.nodeValue;
				date = dateberListTags[i].firstChild.nodeValue;
				title = titleListTags[i].firstChild.nodeValue;
				newimg = newimagListTags[i].firstChild.nodeValue;
				
				subtitle = title.substr(0,20);
				if(subtitle.length == title.length){
					subtitle = title;
				}else{
					subtitle = subtitle+"...";
				}
				comment = commentListTags[i].firstChild.nodeValue;
				resultText = resultText + date + ' :<a href="info.html?info=' + num + '" target=parent>' + subtitle + newimg +"</a><br>";
			}
		}
		$("INFORMATION").innerHTML = resultText;
	}else{
		$("INFORMATION").innerHTML = "<b>Loading...</b>";
	}
}
