);
    } else if (!$msg.length) {
        $msg =  $(parent).find('.' + type + 'Reason-Error');
    }
    show_only($msg);
    $(parent).find('.' + type + '-error').slideDown();
}

function show_errors(element, reasons) {
    if (!reasons || !reasons.length || !reasons[0]) {
        reasons = [ $('#errorReason-Error').text() ];
    }
    var ul = $(element).empty().slideDown();
    $.each(reasons, function(i, reason) {
        $('<li>', { text: reason }).appendTo(ul);
    });
}

function require_el(id) {
   