function Catholic_Directory_Snippets_Newsletter_Subscribe() { if(document.getElementById("Catholic-Directory-Snippets-Newsletter-ReceiveBy-Email").checked==true) ReceiveBy="Email" else ReceiveBy="Mobile" var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { alert(this.responseText); } }; xhttp.open("POST", "https://www.catholicdirectory.org/snippets/ajax/newsletterSubscribe.asp", true); xhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8"); xhttp.send("NewsletterID=&GroupID=&Title="+escape(document.getElementById("Catholic-Directory-Snippets-Newsletter-Title").value)+"&FName="+escape(document.getElementById("Catholic-Directory-Snippets-Newsletter-FName").value)+"&LName="+escape(document.getElementById("Catholic-Directory-Snippets-Newsletter-LName").value)+"&Email="+escape(document.getElementById("Catholic-Directory-Snippets-Newsletter-Email").value)+"&Mobile="+escape(document.getElementById("Catholic-Directory-Snippets-Newsletter-Mobile").value)+"&ReceiveBy="+ReceiveBy+"&PageAction=Subscribe"); } function Catholic_Directory_Snippets_Newsletter_Display(NewsletterID) { window.open("https://www.caspar.news/?NL="+NewsletterID+"-Website", '_blank'); } if(!!document.getElementById("Catholic-Directory-Snippets-Parish-Newsletters")) { document.getElementById("Catholic-Directory-Snippets-Parish-Newsletters").innerHTML=''; } else { var div = document.createElement('div'); // Create a new div div.id="Catholic-Directory-Snippets-Parish-Newsletters-New"; div.style.cssText="z-index: 1;position: relative;"; script = document.scripts[document.scripts.length - 1]; // A reference to the currently running script div.innerHTML = ''; // Add some content to the newly-created div script.parentElement.insertBefore(div, script); // Add the newly-created div to the page; }