var QuickAccess = {
  SendToAFriend: function(action) {
    var email = $('send_to_friend').value;

    if(!/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(email)) {
      alert('Invalid email address');
    }

    new Ajax.Request(
      action,
      {
        asynchronous:true,
        parameters: { "email" : email },
        onSuccess: function(){}
      });

    alert('Success');

    $('send_to_friend').value = '';

    return false;
  }
}
