function highlight_on_focus(form, cls) {
    jQuery(form).find('input').focus(function() {
        jQuery(this).addClass(cls);
    });
    jQuery(form).find('input').blur(function() {
        jQuery(this).removeClass(cls);
    });
}
function prepare_article_form(id, options) {
    jQuery(function() {
        var form = jQuery('#' + id)[0];
        if (!jQuery('.has_error').length) {
            jQuery(form).hide();
        } else {
            jQuery(form).show();
        }
        jQuery(form).parent().find('.trigger').click(function() {
            jQuery(form).toggle();
            return false;
        });
        highlight_on_focus(form, options.cls);
    });
}
