Index: trunk/expressoMail1_2/js/abas.js
===================================================================
--- trunk/expressoMail1_2/js/abas.js	(revision 4460)
+++ trunk/expressoMail1_2/js/abas.js	(revision 4787)
@@ -25,7 +25,12 @@
 	}
 	
-	if ( typeof win == 'object' && win.close && win.close.constructor == Function )
-		win.close( );
-
+	if ( typeof win == 'object' && win.close && win.close.constructor == Function ){
+            var search_win = document.getElementById( 'window_QuickCatalogSearch' );
+            if(search_win){
+                search_win.style.visibility = 'hidden';
+            }
+            win.close( );
+        }
+		
 	if (! Element('border_id_'+ID))
 		return false; // Not possible to alternate
Index: trunk/expressoMail1_2/js/shortcut.js
===================================================================
--- trunk/expressoMail1_2/js/shortcut.js	(revision 4771)
+++ trunk/expressoMail1_2/js/shortcut.js	(revision 4787)
@@ -242,15 +242,21 @@
 shortcut.add("Esc",function(){
 	var window_closed = false;
-	for(var window in arrayJSWin)
-	{
-		if (arrayJSWin[window].visible)
-		{
+        var search_win = document.getElementById( 'window_QuickCatalogSearch' );
+        
+        for(var window in arrayJSWin)
+        {
+                if (arrayJSWin[window].visible)
+                {
+                    window_closed = true;
+                    if(search_win.style.visibility == 'hidden'){
                         arrayJSWin[window].close();
-			var search_win = document.getElementById( 'window_QuickCatalogSearch' );
-                        search_win.style.visibility = 'hidden';
-			window_closed = true;
-		}
-	}
-    
+                    }
+                }
+        }
+        if((search_win) && (search_win.style.visibility == 'visible')){
+            search_win.style.visibility = 'hidden';
+            win.close();
+       }        
+
 	if (!window_closed)
 		delete_border(get_msg_id(), 'false');
Index: trunk/expressoMail1_2/js/QuickCatalogSearch.js
===================================================================
--- trunk/expressoMail1_2/js/QuickCatalogSearch.js	(revision 4763)
+++ trunk/expressoMail1_2/js/QuickCatalogSearch.js	(revision 4787)
@@ -219,5 +219,5 @@
 				border: true,
                                 onclose: 'QuickCatalogSearch.restoreShortcuts("'+ div.id +'")' });
-			
+
 			this.arrayWin[div.id] = win;
 			win.draw();
@@ -230,5 +230,5 @@
 		document.getElementById('select_QuickCatalogSearch').focus();
 
-                if(is_ie){
+                if(is_ie && (preferences.use_shortcuts == '1')){
                     shortcut.remove('down');
                     shortcut.remove('up');
@@ -255,5 +255,32 @@
 		this.arrayWin['window_QuickCatalogSearch_A'].close();
                 document.getElementById("window_QuickCatalogSearch").style.visibility = "hidden";
-                if(is_ie)
+                if(typeof shortcut.all_shortcuts['down'] == 'undefined'){
+                    if(is_ie  && (preferences.use_shortcuts == '1'))
+                    {
+                        shortcut.add("down",function(){select_msg('null', 'down');},{'disable_in_input':false});
+                        shortcut.add("up",function(){select_msg('null', 'up');},{'disable_in_input':false});
+                        shortcut.add("return",function(){
+                            if ( Element('border_id_0').className==='menu-sel' )
+                            {
+                                    all_messages = Element('tbody_box').childNodes;
+                                    for (var i=0; i < all_messages.length; i++)
+                                    {
+                                            if ( exist_className(all_messages[i], 'selected_shortcut_msg') )
+                                            {
+                                                    Element("td_who_" + all_messages[i].id).onclick();
+                                                    return;
+                                            }
+                                    }
+                            }
+                        },{'disable_in_input':true});
+                    }
+                }
+	}
+
+        emQuickCatalogSearch.prototype.restoreShortcuts = function(id) {
+
+            var search_win = document.getElementById(id);
+            if(typeof shortcut.all_shortcuts['down'] == 'undefined'){
+                if (search_win.style.visibility == 'visible')
                 {
                     shortcut.add("down",function(){select_msg('null', 'down');},{'disable_in_input':false});
@@ -274,27 +301,4 @@
                     },{'disable_in_input':true});
                 }
-	}
-
-        emQuickCatalogSearch.prototype.restoreShortcuts = function(id) {
-
-            var search_win = document.getElementById(id);
-            if (search_win.style.visibility == 'visible')
-            {
-                shortcut.add("down",function(){select_msg('null', 'down');},{'disable_in_input':false});
-                shortcut.add("up",function(){select_msg('null', 'up');},{'disable_in_input':false});
-                shortcut.add("return",function(){
-                    if ( Element('border_id_0').className==='menu-sel' )
-                    {
-                            all_messages = Element('tbody_box').childNodes;
-                            for (var i=0; i < all_messages.length; i++)
-                            {
-                                    if ( exist_className(all_messages[i], 'selected_shortcut_msg') )
-                                    {
-                                            Element("td_who_" + all_messages[i].id).onclick();
-                                            return;
-                                    }
-                            }
-                    }
-                },{'disable_in_input':true});
             }
             search_win.style.visibility = 'hidden';
