function ff_validate_form(element, action)
{
    if(typeof bfUseErrorAlerts != 'undefined'){
     JQuery(".bfErrorMessage").html('');
     JQuery(".bfErrorMessage").css("display","none");
    }
    error = ff_validation(0);
    if (error != '') {
        if(typeof bfUseErrorAlerts == 'undefined'){
           swal(error);
        } else {
           bfShowErrors(error);
        }
        ff_validationFocus('');
    } else
        swal('All inputs are valid.');
} // ff_validate_form