function ajax(frm)	{
var xmlHttp;

var url="/process_cmt.php";
      
//create request object
try	{
   //FF, Opera or Safari
   xmlHttp=new XMLHttpRequest();
}
catch (e)	{
   //IE
   try	{
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
   }
   catch (e)	{
      //other
      try	{
         xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
      catch (e)	{
         alert("Unable to load.");
         return false;
      }
   }
}

//sending a request
xmlHttp.open("POST",url,true);	
//Send the proper header information along with the request
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.send(getFormValues(frm));

//what to do when response is recieved
xmlHttp.onreadystatechange=function()	{
   //state = 4 means request complete
   if(xmlHttp.readyState==4)	{			
      document.getElementById('comment_block').innerHTML = xmlHttp.responseText;
   }
}		
}

function getFormValues(form)
{
 var elements = form.elements;
 var comm = new Array();

 for (var i = 0; i < elements.length; i++) {
     if ((name = elements[i].name) && (value = elements[i].value))
     {
      if (elements[i].type == "radio" && !elements[i].checked)
         continue;
         comm.push(name + "=" + encodeURIComponent(value));
   }
 }

 return comm.join("&");
}
