function makeHttpObject() {
    var xmlHttpObj;
    // branch for Activex version (Microsoft IE)
    /*@cc_on
    @if (@_jscript_version >= 5)
        try {
            xmlHttpObj = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                xmlHttpObj = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (E) {
                xmlHttpObj = false;
            }
        }
    @else
        xmlHttpObj = false;
    @end @*/
    // branch for native XMLHttpRequest object (Mozilla & Safari)
    if (!xmlHttpObj && typeof XMLHttpRequest != 'undefined') {
        try {
            xmlHttpObj = new XMLHttpRequest();
        } catch (e) {
            xmlHttpObj = false;
        }
    }
    return xmlHttpObj;
}
var httpObj = makeHttpObject(); // create the HTTP Object

function getHttpResponse() {
    if (httpObj.readyState == 4) {
        if (httpObj.status == 200) {
         var theurl = document.theurl;
		var idname = document.thetargetid;
         	var divcontents = document.getElementById(idname);
		var theHTML = httpObj.responseText;
				divcontents.innerHTML = theHTML;
          

        } else {
            alert("Not done for demo. " + httpObj.statusText);
        }
        

        
    }
}

var url = "/exdomains/papers/parts/"; 
document.last = "";
document.laststartat = 0;

function getThePart(thetarget,theurl) {
document.thetargetid = thetarget;
document.theurl = theurl;


if (theurl == "paper" || theurl == "paperlogin") {
changeClass("page-content","pmn-contentzone-detail");
hideItem("pmn-auxzone");
} else {
changeClass("page-content","pmn-contentzone");
displayItem("pmn-auxzone");
}

httpObj.open("GET", url + theurl + ".htm", true);
httpObj.onreadystatechange = getHttpResponse;
httpObj.send(null);
}

function emptyThePart(thepart) {
var d = document.getElementById(thepart);
d.innerHTML = "";
}

function doPart(theurl) {
getThePart('page-content',theurl);
}
