function createRequestObject() {
  var ro;
  try {ro = new XMLHttpRequest();}
  catch(e) {
    try {ro = new ActiveXObject("Msxml2.XMLHTTP");}
    catch(e) {
      try {ro = new ActiveXObject("Microsoft.XMLHTTP");}
      catch(e) {
        alert("Your browser does not support AJAX!");
        return false;
      }
    }
  }
  return ro;
}

var newHTTP = createRequestObject(); 

var theForm;


function sendComments(eventid){
	var txtComments = document.getElementById('txtComments').value;
	
	
	//alert('theid='+theID+'thepass='+thePass);
	newHTTP.open('get', 'postcomments_byajax.php?eventid='+eventid+'&txtComments='+txtComments);
	//newHTTP.open('get', 'loginbyajax.php');
	newHTTP.onreadystatechange = getComments;
	newHTTP.send(null);
}

function getComments(){
	if(newHTTP.readyState == 4){
		
		if(newHTTP.status == 200){
			var response = newHTTP.responseText;
				//alert("Contact form submitted!");
				document.getElementById('comments_para').innerHTML = response;
				document.getElementById('txtComments').value= "";
		}
	}
}
