Index: trunk/instant_messenger/js/im_preferences.js
===================================================================
--- trunk/instant_messenger/js/im_preferences.js	(revision 55)
+++ trunk/instant_messenger/js/im_preferences.js	(revision 57)
@@ -320,28 +320,22 @@
 			var jid = _XMLdata.getElementsByTagName("retorno").item(0);
 			jid = jid.firstChild.nodeValue;
+			_this.jid = jid;
+
+			var vcards = _this.vCardLoad(jid);
 			
-			_this.jid = jid;
-
-			var NickName = document.getElementById('span_nickname');
-			var Message = document.getElementById('span_message');
-			var vcards = _this.vCardLoad(jid);
-
-			NickName.innerHTML = "<b>&nbsp;" + IM.get_lang('your nickname') + "</b>";
-			Message.innerHTML = "<b>&nbsp;" + IM.get_lang('your message') + "</b>";
-			
-			for(var i in vcards)
-			{   
-				var tag_name = vcards[i].substr(0,vcards[i].indexOf('|'));
-				var tag_value = vcards[i].substr((vcards[i].indexOf('|')+1),vcards[i].length);
-
-				if( tag_name === "NICKNAME")
-					NickName.innerHTML = "<b>&nbsp;" + decodeURI(tag_value.substring(0,15)) + "</b>"; 					
-										
-				if( tag_name === "DESC" )
-					Message.innerHTML = "<b>&nbsp;" + decodeURI(tag_value.substring(0,20)) + "...</b>";
-			}
+			var nickname = vcards.substr(vcards.indexOf('NICKNAME'),vcards.length);
+				nickname = nickname.substr(0,nickname.indexOf('|'));
+				nickname = nickname.substr(nickname.indexOf(':') + 1 , nickname.length);
+
+			var message = vcards.substr(vcards.indexOf('DESC'),vcards.length);
+				message = message.substr(0,message.indexOf('|'));
+				message = message.substr(message.indexOf(':') + 1 , message.length);
+
+			var span_nick = document.getElementById('span_nickname');
+				span_nick.innerHTML = ( nickname ) ? "<b>&nbsp;" + decodeURI(nickname.substring(0,15)) + "</b>" : "<b>&nbsp;" + IM.get_lang('Nickname') + "</b>";
+			var span_mess = document.getElementById('span_message');
+				span_mess.innerHTML = ( message ) ? "<b>&nbsp;" + decodeURI(message.substring(0,20)) + "</b>" : "<b>&nbsp;" + IM.get_lang('Status') + "</b>";
 		}
 		XMLTools.request('$this.Ujabber.getJid','GET',handler_getId);
-
 	}
 
@@ -349,15 +343,22 @@
 	{
 		var div_jid  = document.getElementById("vcard_" + Jid);
-		var array_el = [];	
+		var strg = div_jid.innerHTML;
 		var elements = div_jid.firstChild;
+		var exp , tag  = '';
+		
 		while ( elements )
 		{			
 			if(elements.tagName != undefined && elements.tagName.substr(0,1) != "/" )
 			{		
-				array_el[array_el.length] = elements.tagName + "|" + elements.innerHTML;
+				tag = elements.tagName;
+				exp = eval('/<'+tag+'>/gi');
+				strg = strg.replace(exp, tag + " : " );
+				exp = eval('/<\\/'+tag+'>/gi');
+				strg = strg.replace(exp, " | ");
 			}
 			elements = elements.nextSibling;
 		}			
-		return array_el;
+
+		return strg;
 	}
 		
@@ -367,16 +368,7 @@
 			alert('Carregando !!');
 		}else{
-
-			Templates.information_user();
-			var vcards = new Array();			
-			vcards = this.vCardLoad(this.jid);
-			
-			for(var i in vcards)
-			{
-				var tag_name = vcards[i].substr(0,vcards[i].indexOf('|'));
-				var tag_value = vcards[i].substr((vcards[i].indexOf('|')+1),vcards[i].length);
-				if(tag_name)				
-					document.getElementById(tag_name).value = decodeURI(tag_value);
-			}
+			var div_jid  = document.getElementById("vcard_" + this.jid);
+			var strg = div_jid.innerHTML;
+			Templates.information_user(strg);
 		}	
 	}
@@ -387,15 +379,6 @@
 			alert('Carregando !!');
 		}else{
-			Templates.information_Contact();
-			var vcards = new Array();			
-			vcards = this.vCardLoad(pJid);
-			
-			for(var i in vcards)
-			{
-				var tag_name = vcards[i].substr(0,vcards[i].indexOf('|'));
-				var tag_value = vcards[i].substr((vcards[i].indexOf('|')+1),vcards[i].length);
-				if(document.getElementById('_lbl_' + tag_name) != null)
-					document.getElementById('_lbl_' + tag_name).innerHTML = tag_value;
-			}
+			var vcards = document.getElementById('vcard_' + pJid).innerHTML;
+			Templates.information_Contact(vcards);
 		}
 	}
