function InitAjax() { RequestObject = false; if(window.XMLHttpRequest) { try { RequestObject = new XMLHttpRequest(); } catch(e) { RequestObject = false; } } else if(window.ActiveXObject) { try { RequestObject = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { RequestObject = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { RequestObject = false; } } } return RequestObject; } // ------------------------------------------------------------- function SubmitNewEvent(div_id, thisform) { xmlHttp = InitAjax(div_id); //form = document.getElementById(form_id); elem = document.getElementById(div_id); xmlHttp.open("POST", "../ajax_mailer.php", true); xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); // //alert (form_id); xmlHttp.send(BuildPostVars(thisform)); xmlHttp.onreadystatechange = function() { if(xmlHttp.readyState == 4) { elem.innerHTML = xmlHttp.responseText; xmlHttp.close; xmlHttp = null; } } } // function BuildPostVars(thisform) { //return str = 'fname=' + thisform.fname.value + '&comment=' + thisform.comment.value; // } // ------------------------------------------------------------- //function BuildPostVars(form) { return str = 'fname=' + form.fname.value + '&comment=' + form.comment.value; }