Index: /branches/2.3/contactcenter/js/ccAddGroup.js
===================================================================
--- /branches/2.3/contactcenter/js/ccAddGroup.js	(revision 4631)
+++ /branches/2.3/contactcenter/js/ccAddGroup.js	(revision 5020)
@@ -408,17 +408,29 @@
 
             }
-            ccTree.select(catalogLevel);
-
-            if (catalogLevel == '0.0')
-            {
-                ccAddGroup.loadPersonalContacts();
-            }
-            else
-                {
-                   ccAddGroup.clearSourceList();
-                }
-
-            //eval(refresh);
-
+
+            var handler = function(data){
+        
+                if (data){
+                    if (catalogLevel == '0.0')
+                    {
+                        ccAddGroup.loadPersonalContacts();
+                    }
+                    else
+                        {
+                           ccAddGroup.clearSourceList();
+                        }
+                }
+
+            }
+
+            Connector.newRequest('ccAGSearchSetCatalog', CC_url+'set_catalog&catalog='+catalogLevel, 'GET', handler);
+        }
+
+        cAddGroup.prototype.returnToOriginalCatalog = function(){
+            var handler = function(){
+                return;
+            }
+
+            Connector.newRequest('ccAGSearchSetCatalog', CC_url+'set_catalog&catalog='+ccTree.actualLevel, 'GET', handler);
         }
         
Index: /branches/2.3/contactcenter/js/cc.js
===================================================================
--- /branches/2.3/contactcenter/js/cc.js	(revision 4293)
+++ /branches/2.3/contactcenter/js/cc.js	(revision 5020)
@@ -2778,2 +2778,8 @@
 	Connector.newRequest('voip', "../../expressoMail1_2/controller.php?action=expressoMail1_2.functions.callVoipconnect&to="+phoneUser+"&typePhone="+typePhone, 'POST', handler_voip);
 	}
+
+function closeWindowCreateGroup(){
+    if ((document.getElementById('ccAddGroup DOM').style.visibility == 'visible')){
+        ccAddGroup.clear(); ccAddGroup.returnToOriginalCatalog(); ccAddGroup.window.close();
+    }
+}
Index: /branches/2.3/contactcenter/templates/default/addGroup.tpl
===================================================================
--- /branches/2.3/contactcenter/templates/default/addGroup.tpl	(revision 3970)
+++ /branches/2.3/contactcenter/templates/default/addGroup.tpl	(revision 5020)
@@ -73,7 +73,7 @@
 			<td align="center" colspan="3">
 					<br>						
-					<input title="{ccAGSave}" type="button" onclick="ccAddGroup.send();" value="{ccAGSave}" />
+					<input title="{ccAGSave}" type="button" onclick="ccAddGroup.send(); ccAddGroup.returnToOriginalCatalog();" value="{ccAGSave}" />
 					<input title="{ccAGClear}" type="button" onclick="ccAddGroup.clear();" value="{ccAGClear}" />
-					<input title="{ccAGCancel}" type="button" onclick="ccAddGroup.clear(); ccAddGroup.window.close();" value="{ccAGCancel}"/>						
+					<input title="{ccAGCancel}" type="button" onclick="ccAddGroup.clear(); ccAddGroup.returnToOriginalCatalog(); ccAddGroup.window.close();" value="{ccAGCancel}"/>
 			</td>
 		</tr>
Index: /branches/2.3/contactcenter/templates/default/index.tpl
===================================================================
--- /branches/2.3/contactcenter/templates/default/index.tpl	(revision 3311)
+++ /branches/2.3/contactcenter/templates/default/index.tpl	(revision 5020)
@@ -120,5 +120,5 @@
 				<tr>
 					<td class="image-menu" width="150px" height="100%" align="left" valign="top"> 
-						<div class="menu-degrade" id="cc_tree" style="overflow:auto;position:relative; width: 150px;border: 0px solid #999;"></div>
+						<div onclick=closeWindowCreateGroup(); class="menu-degrade" id="cc_tree" style="overflow:auto;position:relative; width: 150px;border: 0px solid #999;"></div>
 					</td>
 				</tr>
@@ -143,5 +143,5 @@
 					<td align="left">															
 					<input id="cc_button_new" onMouseOver="if(!menuStarted) menu();menu.onmouseover()" onMouseOut="menu.onmouseout()"  value="{cc_btn_new}" type="button">					
-					<div id="cc_panel_search_call" style="display: inline"></div>
+					<div onclick=closeWindowCreateGroup(); id="cc_panel_search_call" style="display: inline"></div>
 					<div id="cc_panel_table" style="display: none; text-align: right">
 					<input type="button" value="{cc_panel_table}" class="tab_box" style="cursor: pointer; cursor: hand;" onclick="javascript: ccChangeVisualization('table')" />
@@ -264,3 +264,4 @@
 <script type="text/javascript" src="js/ccMain.js"></script>
 <script type="text/javascript" src="js/cc_full_search.js"></script>
+<script type="text/javascript" src="../expressoMail1_2/js/modal/modal.js"></script>
 <!-- END BOTTOM DETAILS-->						
