diff --git a/themes/bootstrap3/js/lightbox.js b/themes/bootstrap3/js/lightbox.js
index 2fffedc84ef7874b09f7cf116ab295ebed23646d..ddc3687dd1b1ca0dd06d05bb3d00f31cbae4c4a8 100644
--- a/themes/bootstrap3/js/lightbox.js
+++ b/themes/bootstrap3/js/lightbox.js
@@ -160,11 +160,15 @@ var Lightbox = {
    *
    * If one is not found, return html to a success callback function
    */
-  checkForError: function(html, success) {
-    var fi = html.indexOf('<div class="alert alert-danger">');
+  checkForError: function(html, success, type) {
+    if(typeof type === "undefined") {
+      type = "danger";
+    }
+    var divPattern = '<div class="alert alert-'+type+'">';
+    var fi = html.indexOf(divPattern);
     if(fi > -1) {
-      var li = html.indexOf('</div>', fi+31);
-      Lightbox.displayError(html.substring(fi+31, li).replace(/^[\s<>]+|[\s<>]+$/g, ''));
+      var li = html.indexOf('</div>', fi+divPattern.length);
+      Lightbox.displayError(html.substring(fi+divPattern.length, li).replace(/^[\s<>]+|[\s<>]+$/g, ''), type);
     } else {
       success(html);
     }
@@ -172,22 +176,19 @@ var Lightbox = {
   /**
    * Insert an error alert element at the top of the lightbox
    */
-  displayError: function(message) {
-    var alert = $('#modal .modal-body .alert');
+  displayError: function(message, type) {
+    if(typeof type === "undefined") {
+      type = "danger";
+    }
+    $('#modal .modal-body .alert').remove();
     var html = $.parseHTML($('#modal .modal-body').html());
-    // Page with dismissable alert already present
-    if(alert.find('.message').length > 0 && html.length > 1) {
-      $(alert).find('.message').html(message);
-    // Page with alert already present
-    } else if(alert.length > 0 && html.length > 1) {
-      $(alert).html(message);
-    // Empty or alert only, change to message with button
-    } else if($('#modal .modal-body').html() == vufindString.loading+"..."
-    || (html.length == 1 && $(html).hasClass('alert-danger'))) {
-      Lightbox.changeContent('<div class="alert alert-danger" role="alert">'+message+'</div><button class="btn btn-default" onClick="Lightbox.close()">'+vufindString['close']+'</button>');
+     // Empty or alert only, change to message with button
+    if($('#modal .modal-body').html() == vufindString.loading+"..."
+      || (html.length == 1 && $(html).hasClass('alert-'+type))) {
+      Lightbox.changeContent('<div class="alert alert-'+type+'" role="alert">'+message+'</div><button class="btn btn-default" onClick="Lightbox.close()">'+vufindString['close']+'</button>');
     // Page without alert
     } else {
-      $('#modal .modal-body').prepend('<div class="alert alert-danger alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button><p class="message">'+message+'</p></div>');
+      $('#modal .modal-body').prepend('<div class="alert alert-'+type+' alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button><p class="message">'+message+'</p></div>');
     }
     $('.fa-spinner').remove();
     if (typeof Recaptcha !== "undefined" && Recaptcha.widget) {