Index: /branches/2.2/jabberit_messenger/jmessenger/js/trophyim.mini.js
===================================================================
--- /branches/2.2/jabberit_messenger/jmessenger/js/trophyim.mini.js	(revision 3264)
+++ /branches/2.2/jabberit_messenger/jmessenger/js/trophyim.mini.js	(revision 3308)
@@ -13,5 +13,5 @@
 return renderObj;},getHTML:function(page)
 {return this.xmlParse(HTMLSnippets[page]);},getScript:function(script)
-{var newscript=document.createElement('script');newscript.setAttribute('src',script);newscript.setAttribute('type','text/javascript');return newscript;}};TrophyIM={controll:{notificationNewUsers:0},autoConnection:{connect:true},activeChatRoom:{name:[]},chatHistory:{},constants:{stale_roster:false},posWindow:{left:400,top:100},statusConn:{connected:false},_timeOut:{renderRoster:null},setCookie:function(name,value)
+{var newscript=document.createElement('script');newscript.setAttribute('src',script);newscript.setAttribute('type','text/javascript');return newscript;}};TrophyIM={controll:{notificationNewUsers:0},autoConnection:{connect:true},activeChatRoom:{name:[]},chatHistory:{},constants:{stale_roster:false},posWindow:{left:400,top:100},statusConn:{connected:false},_timeOut:{renderRoster:null},removeResult:{idResult:[]},setCookie:function(name,value)
 {var expire=new Date();expire.setDate(expire.getDate()+365);document.cookie=name+"="+value+"; expires="+expire.toGMTString();},delCookie:function(name)
 {var expire=new Date();expire.setDate(expire.getDate()-365);document.cookie=name+"= ; expires="+expire.toGMTString();delete TrophyIM.cookies[name];},getCookies:function()
@@ -402,5 +402,5 @@
 delete this.roster[jid];}}
 this.setPresence=function(fulljid,priority,show,status)
-{var barejid=Strophe.getBareJidFromJid(fulljid);var resource=Strophe.getResourceFromJid(fulljid);var jid_lower=barejid.toLowerCase();if(show!='unavailable'||show!='error')
+{var barejid=Strophe.getBareJidFromJid(fulljid);var resource=Strophe.getResourceFromJid(fulljid);var jid_lower=barejid.toLowerCase();if(show!=='unavailable'||show!=='error')
 {if(!this.roster[jid_lower])
 {this.addContact(barejid,'not-in-roster');}
Index: /branches/2.2/jabberit_messenger/jmessenger/js/trophyim.js
===================================================================
--- /branches/2.2/jabberit_messenger/jmessenger/js/trophyim.js	(revision 3264)
+++ /branches/2.2/jabberit_messenger/jmessenger/js/trophyim.js	(revision 3308)
@@ -159,4 +159,12 @@
 	_timeOut : { renderRoster : null },
 	
+	
+	/** Remove Contact ( type = set )
+	 * 
+	 * 
+	 */
+	
+	removeResult : { idResult : [] },
+	
      /** Function: setCookie
      *
@@ -611,5 +619,5 @@
 			TrophyIM.connection.send( _iq.tree());
         }
-        
+
 		return true;
     },
@@ -632,8 +640,8 @@
     	if( msg.getAttribute('from').toString().indexOf( TROPHYIM_CHATROOM ) < 0 )
     	{	
-        	TrophyIM.rosterObj.setPresence( msg.getAttribute('from'), priority, show, status );
-        }
-        
-        return true;
+    		TrophyIM.rosterObj.setPresence( msg.getAttribute('from'), priority, show, status );
+        }
+
+    	return true;
     },
 
@@ -1326,5 +1334,9 @@
         	// Remove Contact
     		var _id	= TrophyIM.connection.getUniqueId(); 	
-        	var delContact	= $iq({type: 'set', id: _id})
+    		
+    		// Controller Result
+    		//TrophyIM.removeResult.idResult[ TrophyIM.removeResult.idResult.length ] = jidTo;
+
+    		var delContact	= $iq({type: 'set', id: _id})
         		delContact	= delContact.c('query').attrs({xmlns : 'jabber:iq:roster'});
         		delContact	= delContact.c('item').attrs({jid: jidTo, subscription:'remove'}).tree();
@@ -2189,7 +2201,7 @@
         var jid_lower	= barejid.toLowerCase();
         
-        if( show != 'unavailable' || show != 'error' )
-		{
-            if (!this.roster[jid_lower])
+        if( show !== 'unavailable' || show !== 'error' )
+		{
+        	if (!this.roster[jid_lower])
 			{
                 this.addContact( barejid, 'not-in-roster' );
Index: /branches/2.2/jabberit_messenger/jmessenger/js/AddUser.mini.js
===================================================================
--- /branches/2.2/jabberit_messenger/jmessenger/js/AddUser.mini.js	(revision 3260)
+++ /branches/2.2/jabberit_messenger/jmessenger/js/AddUser.mini.js	(revision 3308)
@@ -10,5 +10,5 @@
 else
 {var jidFrom=Base64.decode(loadscript.getUserCurrent().jid);var jidTo=getElement('user_jid_jabberIM').value;var name=getElement('user_name_jabberIM').value;var group=getElement('user_group_jabberIM').value;_winBuild('add_user_info','remove');if(jidFrom!=jidTo)
-{TrophyIM.addContact(jidTo,name,group);}}}
+{TrophyIM.setAutorization(jidTo,jidFrom,'subscribe');TrophyIM.addContact(jidTo,name,group);}}}
 function addNewUser()
 {var name=getElement('name_new_user_jabberit').value;var group=getElement('name_group_new_user_jabberit').value;var jidFrom=getElement('jidFrom_new_user_jabberit').value;var jidTo=getElement('jidTo_new_user_jabberit').value;if((name=name.replace(/^\s+|\s+$|^\n|\n$/g,""))=="")
@@ -17,5 +17,5 @@
 group="";if(group==null||group=="")
 group="";if(jidFrom!=jidTo)
-{TrophyIM.rosterObj.removeContact(jidTo);loadscript.removeElement(getElement('itenContact_'+jidTo));loadscript.removeElement(getElement('span_show_itenContact_'+jidTo));loadscript.removeElement(getElement('itenContactNotification_'+jidTo));TrophyIM.addContact(jidTo,name,group);_winBuild("new_user_jabberit","remove");}}
+{TrophyIM.rosterObj.removeContact(jidTo);loadscript.removeElement(getElement('itenContact_'+jidTo));loadscript.removeElement(getElement('span_show_itenContact_'+jidTo));loadscript.removeElement(getElement('itenContactNotification_'+jidTo));TrophyIM.addContact(jidTo,name,group);TrophyIM.setAutorization(jidTo,jidFrom,'subscribe');_winBuild("new_user_jabberit","remove");}}
 function getElement(elementId)
 {return document.getElementById(elementId);}
Index: /branches/2.2/jabberit_messenger/jmessenger/js/AddUser.js
===================================================================
--- /branches/2.2/jabberit_messenger/jmessenger/js/AddUser.js	(revision 3260)
+++ /branches/2.2/jabberit_messenger/jmessenger/js/AddUser.js	(revision 3308)
@@ -77,4 +77,6 @@
 				if( jidFrom != jidTo )
 				{
+					TrophyIM.setAutorization( jidTo, jidFrom, 'subscribe' );
+
 					TrophyIM.addContact( jidTo, name, group );
 				}
@@ -114,4 +116,6 @@
 
 				TrophyIM.addContact( jidTo, name, group );
+				
+				TrophyIM.setAutorization( jidTo, jidFrom, 'subscribe' );
 				
 				_winBuild("new_user_jabberit","remove");
Index: /branches/2.2/jabberit_messenger/jmessenger/js/jscode/loadIM.js
===================================================================
--- /branches/2.2/jabberit_messenger/jmessenger/js/jscode/loadIM.js	(revision 3264)
+++ /branches/2.2/jabberit_messenger/jmessenger/js/jscode/loadIM.js	(revision 3308)
@@ -370,16 +370,14 @@
 		try
 		{
-		var _divPhoto = getElement( jid + '__photo' );
-
-		if( _divPhoto.style.backgroundImage.indexOf('photo.png') > 0 )
-		{
-			var _imgUser  = path_jabberit + 'inc/WebService.php?' + Date.parse( new Date );
-				_imgUser += '&photo_ldap=' + jid;
-
-			_divPhoto.style.backgroundImage = 'url(' + _imgUser + ')';
-		}
-		}
-		catch(e)
-		{}
+			var _divPhoto = getElement( jid + '__photo' );
+	
+			if( _divPhoto.style.backgroundImage.indexOf('photo.png') > 0 )
+			{
+				var _imgUser  = path_jabberit + 'inc/WebService.php?' + Date.parse( new Date );
+					_imgUser += '&photo_ldap=' + jid;
+	
+				_divPhoto.style.backgroundImage = 'url(' + _imgUser + ')';
+			}
+		}catch(e){}
 	}
 	
@@ -416,4 +414,5 @@
 		String = String.replace( /\*\*@#%/g		, " <img src='"+path_jabberit+"templates/default/images/smiles/14.gif'/> ");
 		String = String.replace( /\(I\)/g		, " <img src='"+path_jabberit+"templates/default/images/smiles/15.gif'/> ");
+		String = String.replace( /C28I/g		, " <img src='"+path_jabberit+"templates/default/images/smiles/16.gif'/> ");
  
 		return String;
@@ -507,5 +506,5 @@
 					searchUser( element.value );	
 				else
-					alert('Your search argument must be longer than 3 characters.');
+					alert( i18n.YOUR_SEARCH_ARGUMENT_MUST_BE_LONGER_THAN_3_CHARACTERS + '.' );
 		}
 	}
@@ -884,20 +883,20 @@
 				case 'from':
 					
-					TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid), 'subscribed');
+					TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid ), 'subscribe');
     				break;
 
 				case 'subscribe' :
 					
-					TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid), 'subscribed');
+					TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid ), 'subscribed');
     				break;
     				
 				case 'none' :					
     				
-    				TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid), 'subscribe');
+    				TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid ), 'subscribe');
     				break;
     				
     			case 'to' :    				
     				
-    				TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid), 'subscribed');    				
+    				TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid ), 'subscribed');    				
     				removeElement( getElement('itenContactNotification_' + jidTo ) );    				
     				break;
@@ -905,11 +904,7 @@
     			case 'not-in-roster':
 	   				
-    				TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid), 'subscribe');
+    				TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid), 'subscribed');
     				addUser.add( jidTo );
 					break;
-					
-				default:
-					
-					alert( "UNDEFINED : " + subscription );
     		}
     	}
Index: /branches/2.2/jabberit_messenger/jmessenger/js/jscode/loadIM.mini.js
===================================================================
--- /branches/2.2/jabberit_messenger/jmessenger/js/jscode/loadIM.mini.js	(revision 3264)
+++ /branches/2.2/jabberit_messenger/jmessenger/js/jscode/loadIM.mini.js	(revision 3308)
@@ -87,7 +87,5 @@
 {try
 {var _divPhoto=getElement(jid+'__photo');if(_divPhoto.style.backgroundImage.indexOf('photo.png')>0)
-{var _imgUser=path_jabberit+'inc/WebService.php?'+Date.parse(new Date);_imgUser+='&photo_ldap='+jid;_divPhoto.style.backgroundImage='url('+_imgUser+')';}}
-catch(e)
-{}}
+{var _imgUser=path_jabberit+'inc/WebService.php?'+Date.parse(new Date);_imgUser+='&photo_ldap='+jid;_divPhoto.style.backgroundImage='url('+_imgUser+')';}}catch(e){}}
 function getShowContactsOffline()
 {if(_preferencesIM[3])
@@ -97,5 +95,5 @@
 return true;}
 function getSmiles(String)
-{String=String.replace(/:\)|:-\)/g," <img src='"+path_jabberit+"templates/default/images/smiles/1.gif'/> ");String=String.replace(/:-D/g," <img src='"+path_jabberit+"templates/default/images/smiles/2.gif'/> ");String=String.replace(/;-\)/g," <img src='"+path_jabberit+"templates/default/images/smiles/3.gif'/> ");String=String.replace(/=-O/g," <img src='"+path_jabberit+"templates/default/images/smiles/4.gif'/> ");String=String.replace(/:P/g," <img src='"+path_jabberit+"templates/default/images/smiles/5.gif'/> ");String=String.replace(/8-\)/g," <img src='"+path_jabberit+"templates/default/images/smiles/6.gif'/> ");String=String.replace(/\>:o/g," <img src='"+path_jabberit+"templates/default/images/smiles/7.gif'/> ");String=String.replace(/:-\$/g," <img src='"+path_jabberit+"templates/default/images/smiles/8.gif'/> ");String=String.replace(/:s|:-X/g," <img src='"+path_jabberit+"templates/default/images/smiles/9.gif'/> ");String=String.replace(/:-\(/g," <img src='"+path_jabberit+"templates/default/images/smiles/10.gif'/> ");String=String.replace(/:\'\(/g," <img src='"+path_jabberit+"templates/default/images/smiles/11.gif'/> ");String=String.replace(/:\|/g," <img src='"+path_jabberit+"templates/default/images/smiles/12.gif'/> ");String=String.replace(/O:-\)/g," <img src='"+path_jabberit+"templates/default/images/smiles/13.gif'/> ");String=String.replace(/\*\*@#%/g," <img src='"+path_jabberit+"templates/default/images/smiles/14.gif'/> ");String=String.replace(/\(I\)/g," <img src='"+path_jabberit+"templates/default/images/smiles/15.gif'/> ");return String;}
+{String=String.replace(/:\)|:-\)/g," <img src='"+path_jabberit+"templates/default/images/smiles/1.gif'/> ");String=String.replace(/:-D/g," <img src='"+path_jabberit+"templates/default/images/smiles/2.gif'/> ");String=String.replace(/;-\)/g," <img src='"+path_jabberit+"templates/default/images/smiles/3.gif'/> ");String=String.replace(/=-O/g," <img src='"+path_jabberit+"templates/default/images/smiles/4.gif'/> ");String=String.replace(/:P/g," <img src='"+path_jabberit+"templates/default/images/smiles/5.gif'/> ");String=String.replace(/8-\)/g," <img src='"+path_jabberit+"templates/default/images/smiles/6.gif'/> ");String=String.replace(/\>:o/g," <img src='"+path_jabberit+"templates/default/images/smiles/7.gif'/> ");String=String.replace(/:-\$/g," <img src='"+path_jabberit+"templates/default/images/smiles/8.gif'/> ");String=String.replace(/:s|:-X/g," <img src='"+path_jabberit+"templates/default/images/smiles/9.gif'/> ");String=String.replace(/:-\(/g," <img src='"+path_jabberit+"templates/default/images/smiles/10.gif'/> ");String=String.replace(/:\'\(/g," <img src='"+path_jabberit+"templates/default/images/smiles/11.gif'/> ");String=String.replace(/:\|/g," <img src='"+path_jabberit+"templates/default/images/smiles/12.gif'/> ");String=String.replace(/O:-\)/g," <img src='"+path_jabberit+"templates/default/images/smiles/13.gif'/> ");String=String.replace(/\*\*@#%/g," <img src='"+path_jabberit+"templates/default/images/smiles/14.gif'/> ");String=String.replace(/\(I\)/g," <img src='"+path_jabberit+"templates/default/images/smiles/15.gif'/> ");String=String.replace(/C28I/g," <img src='"+path_jabberit+"templates/default/images/smiles/16.gif'/> ");return String;}
 function getStatusUserIM()
 {return statusUserIM;}
@@ -125,5 +123,5 @@
 if(element.value.length>=3)
 searchUser(element.value);else
-alert('Your search argument must be longer than 3 characters.');}}
+alert(i18n.YOUR_SEARCH_ARGUMENT_MUST_BE_LONGER_THAN_3_CHARACTERS+'.');}}
 function loginPage()
 {var paramsLoginPage={'username':(((Base64.decode(getUserCurrent().jid)))?Base64.decode(getUserCurrent().jid):""),'password':(((Base64.decode(getUserCurrent().password)))?Base64.decode(getUserCurrent().password):"")}
@@ -197,5 +195,5 @@
 if(divItenContact)
 {var subscription=divItenContact.getAttribute('subscription');switch(subscription)
-{case'from':TrophyIM.setAutorization(jidTo,Base64.decode(this.getUserCurrent().jid),'subscribed');break;case'subscribe':TrophyIM.setAutorization(jidTo,Base64.decode(this.getUserCurrent().jid),'subscribed');break;case'none':TrophyIM.setAutorization(jidTo,Base64.decode(this.getUserCurrent().jid),'subscribe');break;case'to':TrophyIM.setAutorization(jidTo,Base64.decode(this.getUserCurrent().jid),'subscribed');removeElement(getElement('itenContactNotification_'+jidTo));break;case'not-in-roster':TrophyIM.setAutorization(jidTo,Base64.decode(this.getUserCurrent().jid),'subscribe');addUser.add(jidTo);break;default:alert("UNDEFINED : "+subscription);}}}
+{case'from':TrophyIM.setAutorization(jidTo,Base64.decode(this.getUserCurrent().jid),'subscribe');break;case'subscribe':TrophyIM.setAutorization(jidTo,Base64.decode(this.getUserCurrent().jid),'subscribed');break;case'none':TrophyIM.setAutorization(jidTo,Base64.decode(this.getUserCurrent().jid),'subscribe');break;case'to':TrophyIM.setAutorization(jidTo,Base64.decode(this.getUserCurrent().jid),'subscribed');removeElement(getElement('itenContactNotification_'+jidTo));break;case'not-in-roster':TrophyIM.setAutorization(jidTo,Base64.decode(this.getUserCurrent().jid),'subscribed');addUser.add(jidTo);break;}}}
 function setMessageStatus()
 {if(arguments.length>0)
