function addComment(form, image_id)
{
    var comment = form.comment.value;
    var name    = form.name.value;
    var email   = form.email.value;
    
    if ('' == comment) {
        alert('You should write a comment text!');
        form.comment.focus();
        return false;
    }

    if ('' == name) {
        alert('You forgot to specify your name!');
        form.name.focus();
        return false;
    }

    if ('' == email || false == isValidEmail(email)) {
        alert('Email is mandatory and must be valid!');
        form.email.focus();
        return false;
    }

    xajax_addComment(image_id, name, email, comment);
    form.name.value = form.email.value = form.comment.value = '';
}