';
-				echo '
';
-				if (strlen(trim($user_object->picture_uri)) > 0) {
-					$sysdir_array = UserManager::get_user_picture_path_by_id($safe_user_id, 'system');
-					$sysdir = $sysdir_array['dir'];
-					$webdir_array = UserManager::get_user_picture_path_by_id($safe_user_id, 'web');
-					$webdir = $webdir_array['dir'];
-					$fullurl = $webdir.$user_object->picture_uri;
-					$system_image_path = $sysdir.$user_object->picture_uri;
-					list($width, $height, $type, $attr) = @getimagesize($system_image_path);					
-					$height += 30;
-					$width += 30;					
-					// get the path,width and height from original picture
-					$big_image = $webdir.'big_'.$user_object->picture_uri;
-					$big_image_size = api_getimagesize($big_image);
-					$big_image_width = $big_image_size['width'];
-					$big_image_height = $big_image_size['height'];
-					$url_big_image = $big_image.'?rnd='.time();
-					echo '
';
-				} else {
-					echo Display::return_icon('unknown.jpg', get_lang('Unknown'));
-					echo '
';
-				}
-				
-				if (!empty($status)) {
-				    echo '
'.$status.'
';
-				}
-				echo '
';
-
-				echo '
';
-
-				global $user_anonymous;
-				if (api_get_setting('allow_social_tool') == 'true' && api_get_user_id() <> $user_anonymous && api_get_user_id() <> 0) {
-					echo '
'.Display :: return_icon('my_shared_profile.png', get_lang('SocialInvitationToFriends'),array('height'=>'18px')).get_lang('ViewSharedProfile').'
';
-
-					$user_anonymous = api_get_anonymous_id();
-
-					if ($safe_user_id != api_get_user_id() && !api_is_anonymous($safe_user_id)) {
-						$user_relation = SocialManager::get_relation_between_contacts(api_get_user_id(), $safe_user_id);
-						if ($user_relation == 0 || $user_relation == 6) {
-							echo  '
'.Display :: return_icon('invitation.png', get_lang('SocialInvitationToFriends'),array('height'=>'18px')).' '.get_lang('SendInvitation').'
-								   
'.Display :: return_icon('mail_send.png', get_lang('SendAMessage'),array('height'=>'18px')).' '.get_lang('SendAMessage').'
';
-						} else {
-							echo  '
'.Display :: return_icon('mail_send.png', get_lang('SendAMessage'),array('height'=>'18px')).' '.get_lang('SendAMessage').'
';
-						}
-					}
-				}
-				if (api_get_setting('show_email_addresses') == 'true') {
-					echo Display::encrypted_mailto_link($user_object->email,$user_object->email).'
';
-				}
-				echo '
';
-			echo '
';
+            if (strlen(trim($user_object->picture_uri)) > 0) {
+                $sysdir_array = UserManager::get_user_picture_path_by_id($safe_user_id, 'system');
+                $sysdir = $sysdir_array['dir'];
+                $webdir_array = UserManager::get_user_picture_path_by_id($safe_user_id, 'web');
+                $webdir = $webdir_array['dir'];
+                $fullurl = $webdir.$user_object->picture_uri;
+                $system_image_path = $sysdir.$user_object->picture_uri;
+                list($width, $height, $type, $attr) = @getimagesize($system_image_path);					
+                $height += 30;
+                $width += 30;					
+                // get the path,width and height from original picture
+                $big_image = $webdir.'big_'.$user_object->picture_uri;
+                $big_image_size = api_getimagesize($big_image);
+                $big_image_width = $big_image_size['width'];
+                $big_image_height = $big_image_size['height'];
+                $url_big_image = $big_image.'?rnd='.time();
+                //echo '
';
+                echo '
';
+            } else {
+                echo Display::return_icon('unknown.jpg', get_lang('Unknown'));					
+            }            
+            if (!empty($status)) {
+                echo ''.$status.'
';
+            }
 			echo '';
+
+			         
+            if (api_get_setting('show_email_addresses') == 'true') {
+                echo Display::encrypted_mailto_link($user_object->email,$user_object->email).'
';
+            }
+            			
 			if ($user_object->competences) {
-				echo '
'.get_lang('MyCompetences').'
';
-				echo '
'.$user_object->competences.'';
+				echo Display::page_subheader(get_lang('MyCompetences'));
+				echo '
'.$user_object->competences.'
';
 			}
 			if ($user_object->diplomas) {
-				echo '
'.get_lang('MyDiplomas').'
';
-				echo '
'.$user_object->diplomas.'';
+				echo Display::page_subheader(get_lang('MyDiplomas'));
+				echo '
'.$user_object->diplomas.'
';
 			}
 			if ($user_object->teach) {
-				echo '
'.get_lang('MyTeach').'
';
-				echo '
'.$user_object->teach.'';;
+				echo Display::page_subheader(get_lang('MyTeach'));
+				echo '
'.$user_object->teach.'
';
 			}
 			SocialManager::display_productions($user_object->user_id);
 			if ($user_object->openarea) {
-				echo '
'.get_lang('MyPersonalOpenArea').'
';
-				echo '
'.$user_object->openarea.'';
+				echo Display::page_subheader(get_lang('MyPersonalOpenArea'));
+				echo '
'.$user_object->openarea.'
';
 			}
-			echo '
';
+			
 		} else	{
 			Display::display_header(get_lang('UsersOnLineList'));
 			echo '
';
 		}
 	}
+    
 	/**
 	 * Display productions in whoisonline
 	 * @param int $user_id User id
diff --git a/main/social/profile.php b/main/social/profile.php
index 2dab8412d4..b501a8ac43 100644
--- a/main/social/profile.php
+++ b/main/social/profile.php
@@ -61,11 +61,86 @@ require_once api_get_path(SYS_CODE_PATH).'calendar/myagenda.inc.php';
 require_once api_get_path(SYS_CODE_PATH).'announcements/announcements.inc.php';
 
 require_once $libpath.'magpierss/rss_fetch.inc';
-
+$ajax_url = api_get_path(WEB_AJAX_PATH).'message.ajax.php';
 api_block_anonymous_users();
 
-$htmlHeadXtra[] = '
-';
-$htmlHeadXtra[] = '