window.addEvent('domready', function() {

  $('signupForm').addEvent('submit', function(ev) {
                                                new Event(ev).stop(); 
                                                $('email').disabled = true;
                                                $('sendBtn').disabled = true;
                                                var url = '/signups/add';
                                                var myAjax = new Ajax(url, { method: 'post',
                                                                              postBody: 'data[Signup][email]=' + $('email').value,
                                                                              update: $('status'),
                                                                              onComplete: function(){  $('email').disabled = false;
                                                                                                         $('sendBtn').disabled = false; }
                                                                            }).request();
                                              });

});

// Cache the status icons for the sake of responsiveness
(function(){
var imgCache = [ (new Image()).src='/img/icons/accept.png',
                  (new Image()).src='/img/icons/exclamation.png' ];
})();
