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

function getquerystring() {	
	var param1= document.getElementById("param1").value;
	var email= document.getElementById("email").value;
	var comment= document.getElementById("comment").value;
	return 'param1='+param1+'&email='+email+'&comment='+comment;   
}

function updatepage(str){
    document.getElementById("result").innerHTML = str;
    if(str.match("Oops"))
        document.getElementById("result").style.color="red";
        else
        	document.getElementById("result").style.color="green";
}
