//  You don't need to change anything in this function:

function xmlhttpPost(strURL) {
    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");
    }
    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(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystring());
}

//   The following function obtains two variables from your form (email and message) 
//   and builds a string that gets sent to your PHP script.  Change this function to
//   obtain whatever fields you want from your form.

function getquerystring() {
    var form     = document.forms['contact-us-form'];
    var posName = form.posName.value;
    var posEmail = form.posEmail.value;
    qstr = '&posName=' + escape(posName) + '&posEmail=' + escape(posEmail); 
    return qstr;
}

function updatepage(str){
    document.getElementById("result").innerHTML = str;
	document.getElementById("result").style.margin = '-5px 12px 0 0' ;
	document.getElementById("sendContactEmail").style.visibility ='hidden';
}

