(function ($) {
    Drupal.behaviors.jnb_standard_fileinput = {
        attach: function (context, settings) {
            createNewFileInput();
        }
    }
})(jQuery);
function createNewFileInput() { (function ($) {
    var newInput = '';
    if ($("#edit-attachment.form-file.error").length == 1) {
        newInput += '<input type="text" name="newFileInput" id="newFileInput" class="error" />';
        newInput += '<img id="newFileInputImage" alt="" src="' + Drupal.settings.basePath + 'sites/all/themes/jnb_standard/images/forms/file-error.png" />';
    }
    else {
        newInput += '<input type="text" name="newFileInput" id="newFileInput" />';
        newInput += '<img id="newFileInputImage" alt="" src="' + Drupal.settings.basePath + 'sites/all/themes/jnb_standard/images/forms/file.png" />';
    }
    $("#webform-component-attachment").prepend(newInput);
    $("#webform-component-attachment").bind('change', function() {
        $("#newFileInput").val($("#edit-attachment").val());
    });
})(jQuery); }(jQuery);
