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 idname = document.thetargetid;
         	var divcontents = document.getElementById(idname);
		var theHTML = httpObj.responseText;
		divcontents.innerHTML = theHTML;
        } else {
            alert("There was a problem with the response" + httpObj.statusText);
        }
    }
}

var url = "/michael/techpapers/elements/parts/"; 
document.last = "";
document.laststartat = 0;

function getThePart(thetarget,theurl) {
document.thetargetid = thetarget;
httpObj.open("GET", url + theurl + ".htm", true);
httpObj.onreadystatechange = getHttpResponse;
httpObj.send(null);
}

function pagePart(theurl) {
if (theurl == 'event') {
getThePart('main','main');
} else {
getThePart('page-part',theurl);
}
}

function popUp(theurl) {
if (theurl == "") {
// CLOSE THE POPUP
managePopupDisplay(0);
emptyThePart('popup-content');
} else {
// OPEN THE POPUP
managePopupDisplay(1);
getThePart('popup-content',theurl);
}
}

function emptyThePart(thepart) {
var d = document.getElementById(thepart);
d.innerHTML = "";
}


