AJAX Redirect on Form issue

Hi everyone…

I’m trying to get this tutorial working on my site (http://www.roscripts.com/Ajax_form_validation-152.html) but I’m stuck on something that should be simple.

The Ajax that uses mootools is passing some variables to a php function which does what it does with them and returns TRUE or FALSE.
My question is…how can I make my javascript code redirect or hide the form on success (TRUE) and how do I keep it and display the errors on failure (FALSE)?

Here’s the javascript code:

window.addEvent('domready', function(){
    $('registerForm').addEvent('submit', function(e) {
        new Event(e).stop();
        var log = $('log_res').empty().addClass('ajax-loading');
            update: log,
            onComplete: function() {

Thank you very much for any pointers.