var http = new XMLHttpRequest();
function postfrm(Form) {
	
	document.getElementById("form_main_abs").style.display = "block";
	
	var http = new XMLHttpRequest();
	
	var url = "volunteering_submit.php";
	
	var params = "";
	if(Form.txtName.value != "") {
		params += "txtName="+Form.txtName.value;
	}
	if(Form.txtDOB.value != "") {
		params += "&txtDOB="+Form.txtDOB.value;
	}
	if(Form.txtAdd.value != "") {
		params += "&txtAdd="+Form.txtAdd.value;
	}
	if(Form.txtEmailId.value != "") {
		params += "&txtEmailId="+Form.txtEmailId.value;
	}
	if(Form.txtPhNum.value != "") {
		params += "&txtPhNum="+Form.txtPhNum.value;
	}
	if(Form.txtEmgContactNo.value != "") {
		params += "&txtEmgContactNo="+Form.txtEmgContactNo.value;
	}
	if(Form.lstVehicle.value != "") {
		params += "&lstVehicle="+Form.lstVehicle.value;
	}
	if(Form.lstWeek.value != "") {
		params += "&lstWeek="+Form.lstWeek.value;
	}
	if(Form.txtComm.value != "") {
		params += "&txtComm="+Form.txtComm.value;
	}

//	alert(params);
//	return false;
	
	http.open("POST", url, true);
	
	//Send the proper header information along with the request
	http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http.setRequestHeader("Content-length", params.length);
	http.setRequestHeader("Connection", "close");
	
	http.onreadystatechange = function() {//Call a function when the state changes.
		if(http.readyState == 4 && http.status == 200) {
//			alert("http.responseText : "+http.responseText);
			document.getElementById("form_main_abs").style.display = "none";
			document.getElementById("volunerFrm").style.display = "none";
			document.getElementById("tksmessage").style.display = "block";
		}
	}
	http.send(params);	
}

/*http.onreadystatechange = function() {//Call a function when the state changes.
	if(http.readyState == 4 && http.status == 200) {
		alert(http.responseText);
		document.getElementById("form_main_abs").style.display = "none";
	}
}*/