//path			 = <page.php> : <script to process data>
//tResponse		 = <myDiv> : <DIV to display response>
//data			 = <key=value&key2=value2> : <data to send to script>

var responseID = "";
var hideLoadv = 0;

//post data
function AjaxPost(path,tResponse,data) {
	hideLoadv = 1;
    var xmlHttpReq = false;
    var self = this;
	responseID = tResponse;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
		//self.xmlHttpReq = new ActiveXObject("Msxml2.XMLHTTP");
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', path, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
		
        if (self.xmlHttpReq.readyState == 4) {
		
			if (self.xmlHttpReq.status == 200) { 
				AjaxDisplay(self.xmlHttpReq.responseText);
				hideLoadv=0;
			}
        }
    }
    self.xmlHttpReq.send(data);
}

//display data
function AjaxDisplay(str){
    document.getElementById(responseID).innerHTML = str;
}