diff --git a/scp/js/scp.js b/scp/js/scp.js
index 2ab155cdf4784a4a8e1e6f975a0c529e1483e423..33839e80c39174391d9d10e9e2c2029a44af9221 100644
--- a/scp/js/scp.js
+++ b/scp/js/scp.js
@@ -400,11 +400,16 @@ $(document).ready(function(){
         return false;
     });
 
-    $(document).keydown(function(e) {        
-        if (e.keyCode == 27) {
+    $(document).keydown(function(e) {
+
+        if (e.keyCode == 27 && !$('#overlay').is(':hidden')) {
             $('div.dialog').hide();
             $('#overlay').hide();
-        }  
+
+            e.preventDefault();
+            e.stopPropagation();
+            return false;
+        }
     });
 
     /* advanced search */
diff --git a/scp/js/tips.js b/scp/js/tips.js
index 7a299ad86ab9f00f3caa7e6872902053660f510e..9fdd2261701abc3c60012dd54a6ebe10a6b548fc 100644
--- a/scp/js/tips.js
+++ b/scp/js/tips.js
@@ -213,4 +213,12 @@ jQuery(function() {
         e.preventDefault();
         $(this).parent().parent().remove();
     });
+
+    $(document).live('mouseup', function (e) {
+        var container = $('.tip_box');
+        if (!container.is(e.target)
+            && container.has(e.target).length === 0) {
+            container.remove();
+        }
+    });
 });