// JavaScript Document

function prayerJoin() {
  //Element.hide(hide);
  //Element.show(show);
  $('#prayerChoice').hide("fast");
  $('#prayerForm').show("fast");
}
function prayerDone() {
  $('#prayerForm').hide("fast");
  $('#prayerChoice').show("fast");
}

function showContact () {
   $('#formBoxContactb').hide();  
   $('#formBoxContact').show("fast");      
}
function processContact() {
 // get the form values
 var name = $('#uName').val();
 var email = $('#uEmail').val();
 var phone = $('#uPhone').val();
 var text = $('#uText').val();

 $.ajax({
   type: "POST",
   url: "process.php",
   data: "op=contact&uName="+name+"&uEmail="+email+"&uPhone="+phone+"&uText="+encodeURI(text),
   success: function(resp){
     // we have the response
     document.getElementById('formBoxContactb').innerHTML = resp;
     
     $('#formBoxContact').hide("fast");
     $('#formBoxContactb').show();

     //alert("Server said:\n '" + resp + "'");
   },
   error: function(e){
     alert('Error: ' + e);
   }
 });
}
    
function processEmailList() {
 // get the form values
 var name = $('#pfName').val();
 var email = $('#pfEmail').val();

 $.ajax({
   type: "POST",
   url: "process.php",
   data: "op=list&uName="+name+"&uEmail="+email,
   success: function(resp){
     // we have the response
     document.getElementById('prayerFormb').innerHTML = resp;
     
     $('#prayerFormInside').hide("fast");
     $('#prayerFormb').show();

     //alert("Server said:\n '" + resp + "'");
   },
   error: function(e){
     alert('Error: ' + e);
   }
 });
}
