//guestbook entry (AJAX) - uses prototype lib

function spgbk() {
   handlerUrl = 'guestbookSignup.php';
   formId = 'gbsuform';
   
   new Ajax.Request(handlerUrl, {

      method:'post',
      parameters: $(formId).serialize(true),
      onSuccess: function(transport){
         var response = transport.responseText || "no response text";
	     if (response != "no response text") {
		   responseParts = response.split("~~~");
		   //alert(response);
		   //[0] = box title; [1] = div content text
		   document.getElementById('boxTitle').value = responseParts[0];		   
		   document.getElementById('dialogcontent').innerHTML = responseParts[1];
		   	
           }
	       else { 
	       alert ("There was no response text. Please contact administrator.");
		   }
		},

      onFailure: function(){ 
         alert('Error: AJAX request failure.  Please try again or contact administrator.');
         }

      });
	  
   }
   