Index: trunk/instant_messenger/js/im_functions.js
===================================================================
--- trunk/instant_messenger/js/im_functions.js	(revision 36)
+++ trunk/instant_messenger/js/im_functions.js	(revision 44)
@@ -10,4 +10,5 @@
       	   this.array_prefe['ch_offline'] = true;	
       this.load_photo	  = false;
+      this.IM_Manutencao  = false;
    }
 
@@ -18,20 +19,27 @@
    IM.prototype.load_im = function()
    {
+	  	
 	  var force = ( arguments.length ) ? true : false;
       var _this = this;
       Sincro.count = 0;
-
-      var handler_contacts = function(data)
-      {
-          if( (data.length) >= (_this.array_users.length) || (data.length - 1) > 0){
-	          _this.array_users.splice(0,_this.array_users.length);
-    	      _this.array_users = data;
-        	  _this.mount_list(data);
-	          _this.conf_VcardUser(data[0]);
+	
+	  if( _this.IM_Manutencao )
+	  {
+	  	_this.Manutencao();	
+	  
+	  }else{
+	      var handler_contacts = function(data)
+	      {
+	          if( (data.length) >= (_this.array_users.length) || (data.length - 1) > 0){
+		          _this.array_users.splice(0,_this.array_users.length);
+	    	      _this.array_users = data;
+	        	  _this.mount_list(data);
+		          _this.conf_VcardUser(data[0]);
+		      }
 	      }
-      }
-	
-	  if ( force || this.getWinContactsState() )
-         cIM.cExecute("$this.Ujabber.list_user",handler_contacts);
+		
+		  if ( force || this.getWinContactsState() )
+	         cIM.cExecute("$this.Ujabber.list_user",handler_contacts);
+	  }
    }
 	
@@ -317,52 +325,59 @@
 	{
 		var _this = this;
-		var handler_message = function(data)
+		
+		if( _this.IM_Manutencao )
 		{
-			if( data.length > 0)
+			_this.Manutencao();
+			
+		}else{
+			var handler_message = function(data)
 			{
-				var TimeStamp		= "";
-				var jid 		    = "";
-				var nickname		= "";
-				var body_message 	= "";
-				var window_message  = "";
-
-				for( var i=0; i < data.length; i++)
-				{			
-					jid   	     = data[i].from;
-					body_message = data[i].body;
-					TimeStamp 	 = (_this.array_prefe['ch_time']) ? "[" + data[i].timestamp + "] " : " ";
+				if( data.length > 0)
+				{
+					var TimeStamp		= "";
+					var jid 		    = "";
+					var nickname		= "";
+					var body_message 	= "";
+					var window_message  = "";
+	
+					for( var i=0; i < data.length; i++)
+					{			
+						jid   	     = data[i].from;
+						body_message = data[i].body;
+						TimeStamp 	 = (_this.array_prefe['ch_time']) ? "[" + data[i].timestamp + "] " : " ";
+						
+						jid = jid.substr(0,jid.indexOf('/'));
+						body_message = decodeURI(body_message.replace(/\\\'/g, '\''));
+	
+						window_message  = document.getElementById(jid + "_chatMessages");
+						nickname = jid;
+	
+						for( var j=1; j < IM.array_users.length; j++ )
+						{
+							if( jid == IM.array_users[j].jid ){
+								nickname = decodeURI(IM.array_users[j].VCARD_NICKNAME);
+							}
+						}
+	
+		                if ( window_message )
+		                {
+		                   window_message.innerHTML += '<strong>' + TimeStamp + nickname + '</strong>&nbsp;' + IM.get_lang('speak') + ':<br/> ' + _this.emotions_icons(body_message) + '<br/><br/>';
+	                       if ( windowItems[jid].state != WINDOW_STATE_REGULAR && windowItems[jid].state != WINDOW_STATE_MAXIMIZED )
+	                          im_win.showWindowItem(jid);
+		                }
+		                else
+		                {
+		                   im_win.open_chat(jid);
+		                   window_message = document.getElementById(jid + '_chatMessages');
+		                   window_message.innerHTML += '<strong>' + TimeStamp + nickname + '</strong>&nbsp;' + IM.get_lang('speak') + ':<br/> ' + _this.emotions_icons(body_message) + '<br/><br/>';
+		                }
+					}
 					
-					jid = jid.substr(0,jid.indexOf('/'));
-					body_message = decodeURI(body_message.replace(/\\\'/g, '\''));
-
-					window_message  = document.getElementById(jid + "_chatMessages");
-					nickname = jid;
-
-					for( var j=1; j < IM.array_users.length; j++ )
-					{
-						if( jid == IM.array_users[j].jid ){
-							nickname = decodeURI(IM.array_users[j].VCARD_NICKNAME);
-						}
-					}
-
-	                if ( window_message )
-	                {
-	                   window_message.innerHTML += '<strong>' + TimeStamp + nickname + '</strong>&nbsp;' + IM.get_lang('speak') + ':<br/> ' + _this.emotions_icons(body_message) + '<br/><br/>';
-                       if ( windowItems[jid].state != WINDOW_STATE_REGULAR && windowItems[jid].state != WINDOW_STATE_MAXIMIZED )
-                          im_win.showWindowItem(jid);
-	                }
-	                else
-	                {
-	                   im_win.open_chat(jid);
-	                   window_message = document.getElementById(jid + '_chatMessages');
-	                   window_message.innerHTML += '<strong>' + TimeStamp + nickname + '</strong>&nbsp;' + IM.get_lang('speak') + ':<br/> ' + _this.emotions_icons(body_message) + '<br/><br/>';
-	                }
-				}
-				
-				window_message.scrollTop = window_message.scrollHeight;
-				im_win.newMessageNotification();
-			}	
-		}
-		cIM.cExecute("$this.Ujabber.getMessages", handler_message);			
+					window_message.scrollTop = window_message.scrollHeight;
+					im_win.newMessageNotification();
+				}	
+			}
+			cIM.cExecute("$this.Ujabber.getMessages", handler_message);			
+		}
 	}
 
