<!------------------ Ajax--------------->
function xmlhttpPost(strURL, qstr, divID, procID, procMsg) {

    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    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) {
	    if(procID)
            	document.getElementById(procID).innerHTML = "&nbsp;";
	    if(divID)
	        document.getElementById(divID).innerHTML = self.xmlHttpReq.responseText;
	
        }
    }
    self.xmlHttpReq.send(qstr);
    if(procID)
    document.getElementById(procID).innerHTML = procMsg;
}
<!------------------ Ajax End --------------->