
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 theHTML = httpObj.responseText;


var idname = document.thetargetid;
var HpartstheHTML = theHTML.split('*****');
var divcontents = document.getElementById(idname);
divcontents.innerHTML = theHTML;

if (document.therecipid != "") {
var therecip = document.therecipid;
var addtoit = document.getElementById(therecip);
addtoit.innerHTML = divcontents.innerHTML + addtoit.innerHTML;
}

} else {
alert("There was a problem with the response: " + 
httpObj.statusText);
}
}

}
document.last = "";
document.laststartat = 0;

function getThePart(thetarget,theurl) {
var tarit = document.getElementById(thetarget);
tarit.innerHTML = '<div style="position:absolute; width:400px;"><div style="position:relative; left:140px; top:80px; width:120px; border:1px dashed #BBBBBB; background-color:#444444; color:#FFFFFF; font-weight:600; padding:5px;">Loading.<blink>.</blink>.<br>Please Wait!</div></div>' + tarit.innerHTML;
document.thetargetid = thetarget;
document.therecipid = "";
httpObj.open("GET", theurl, true);
httpObj.onreadystatechange = getHttpResponse;
httpObj.send(null);
}



function doPoll(theid,answer) {

getThePart('poll-' + theid,'/utils/poll-vote.php?id=' + theid + '&vote=' + answer);
}




function doIframe(thenum,theurl) {
var theid = document.getElementById(thenum);
theid.innerHTML = '<iframe src="' + theurl + '" frameborder=0 style="width:100%;height:260px;"></iframe>';
}






