function xmlhttpPost(strURL, strAttr, divID) {

    var xmlHttpReq = false;
    var self = this;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
  //before sending the xmlrequest, let's tell the user that he'll have to wait.
 //   updatepage(divID, '<i><font size=1>connecting to db</font></i>');

    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepage(divID, self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(strAttr);
}

function updatepage(divID, str){
    document.getElementById(divID).innerHTML = str;
}

function waitOnRatings() {
    updatepage('scalebar','<i><font size=1>Waiting for database...</font></i><br><img alt="minus one" src=scale/minusone.gif border=0><img alt="minus half" src=scale/minuspointfive.gif border=0><img alt="zero" src=scale/zero.gif border=0><img alt="plus half" src=scale/pluspointfive.gif border=0><img src=scale/plusone.gif alt="plus one" border=0>');
}

function waitOnLogin() {

	updatepage('loginformdiv','<i><font size=1>Waiting for database...</font></i><br>');
}

function waitOnComments(strURL, strAttr, divID) {
    updatepage('cformMsg','<i><font size=1>Waiting for database...</font></i>');
    document.forms[0].elements[1].disabled=true;


    var xmlHttpReq2 = false;
    var self = this;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq2 = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq2 = new ActiveXObject("Microsoft.XMLHTTP");
    }
  //before sending the xmlrequest, let's tell the user that he'll have to wait.
 //   updatepage(divID, '<i><font size=1>connecting to db</font></i>');

    self.xmlHttpReq2.open('POST', strURL, true);
    self.xmlHttpReq2.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq2.onreadystatechange = function() {
        if (self.xmlHttpReq2.readyState == 4) {
            updatepage(divID, self.xmlHttpReq2.responseText);
	    updatepage('cformMsg','');
	    document.forms[0].elements[1].disabled=false;
        }
    }
    self.xmlHttpReq2.send(strAttr);
}
