function vb(){var C=null;try{C=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{C=new ActiveXObject("Microsoft.XMLHTTP")}catch(sc){C=null}}if(!C&&typeof XMLHttpRequest!="undefined"){C=new XMLHttpRequest()}return C}

function includeContent(strTitle) {
	document.write("<span id='id" + arURLs.length + "'></span>");
	var strUrl="redirect.asp?id=id" + arURLs.length + "&title=" + strTitle + "&login=demo";
	arURLs.push(strUrl);
	if (arURLs.length==1) startRetrieval();
}
function startRetrieval() {
	if (intPos<arURLs.length) {	
		xml=vb();
		xml.open ("GET", arURLs[intPos], true);
		arURLs[intPos]=""; intPos++;
		
		xml.onreadystatechange=reportLoaded;
		xml.send("");
	}
	
}
function reportLoaded() {
	if (xml.readyState==4) {
		var objXML=xml.responseXML;
		
		var id=objXML.getElementsByTagName("id");
		if (!id) {
			alert ("ID not found");
			return;
		}
		var txt=objXML.getElementsByTagName("text");
		if (!txt) return;
		
		var el=document.getElementById(getTextVersion(id[0]));
		el.innerHTML=getTextVersion(txt[0]);
		
		//' check if there is more to retrieve
		startRetrieval();
	}
}
function getTextVersion(XMLnode) {
    var text;
    try {
        //serialization to string DOM Browser
        var serializer = new XMLSerializer();
        text = serializer.serializeToString(XMLnode.firstChild);
		text=text.replace("<![CDATA[","").replace("]]>","");
    } catch(e) {
        // serialization of an XML to String (IE only)
        text = XMLnode.text;
    }
    return text;
}

//' the following global variables are used
var intPos=0;						//' pointer to following URL to load
var arURLs=new Array();	//' array of all URL's that must be retrieved
var xml;						//' global object used to retrieve data (asynchronous)


