   /* Surface Persona
   *
   * 
   * */
	function RenderSurfacePersona(User, element){
		var container = document.getElementById(element);

		var PersonaPathWuser = "http://" + mdp.basepath + "/" + mdp.communityPath + "/persona.jsp?&plckUserId=" + User.UserKey.Key + "&userId=" + User.UserKey.Key;

		var BlogPathAppend = "&plckPersonaPage=PersonaBlog";
		var MsgPathAppend = "&plckPersonaPage=PersonaMessages";
		var LogoutPath = "http://" + mdp.basepath + "/common/profile/member/logout.jsp?successPage="  + encodeURIComponent(document.location.href);
		var LoginPath = "http://" + mdp.basepath + "/common/profile/login1.jsp?regSource=" + mdp.regSource;
		var RegPath = "http://" + mdp.basepath + "/common/profile/regStep1.jsp?regSource=" + mdp.regSource;

		var spGreeting = "Welcome"

		var MyImageDiv = document.createElement('div');
			MyImageDiv.id = 'PluckAvatar';
			MyImageDiv.innerHTML = '<img src="' + User.AvatarPhotoUrl + '">';
		var MyGreetingDiv = document.createElement('div');
			MyGreetingDiv.id = 'spGreeting';
			MyGreetingDiv.innerHTML = spGreeting;
		var MyDispNameDiv = document.createElement('div');
			MyDispNameDiv.id = 'PluckDisplayName';
		var MyMsgDiv = document.createElement('div');
			MyMsgDiv.id ='PluckMsgNum';
		var MyBlgDiv = document.createElement('div');
			MyBlgDiv.id = 'jsBlog';
		var MyLogDiv = document.createElement('div');
			MyLogDiv.id ='jsLog';

		if (User.UserKey.Key != 'anonymous') {
			/* Regestered User */
            if(User.DisplayName.length >= 18){
                var widgetDisplayName = User.DisplayName.substr(0,15) + '...';
            }else{
                var widgetDisplayName = User.DisplayName;
            }
			MyDispNameDiv.innerHTML = '<a href="' + PersonaPathWuser + '">' + widgetDisplayName + '</a>';
			MyImageDiv.innerHTML = '<a href="' + PersonaPathWuser + '"><img height="60px" src="' + User.AvatarPhotoUrl + '" title="' + User.DisplayName + '"></a>';
			MyMsgDiv.innerHTML = 'You have ' + User.NumberOfMessages + ' ' + '<a href="' + PersonaPathWuser + MsgPathAppend + '">' + ((User.NumberOfMessages = 1) ? ' Messages' : ' Message') + '</a>';
			MyBlgDiv.innerHTML = '<a href="' + PersonaPathWuser + BlogPathAppend + '">' + "Your Blog" + '</a> | ';
			MyLogDiv.innerHTML = '<a href="' + LogoutPath + '">' + "Logout" + '</a>';

		}
		else {
			/* Anon */
			MyDispNameDiv.innerHTML = 'Guest';
			MyLogDiv.innerHTML = '<a href="' + LoginPath + '">' + "Log In" + '</a> or <a href="' + RegPath + '">' + "Register" + '</a>';
			MyMsgDiv.style.display = 'none';
			MyBlgDiv.style.display = 'none';
		}

		container.appendChild(MyImageDiv);
		container.appendChild(MyGreetingDiv);
		container.appendChild(MyDispNameDiv);
		container.appendChild(MyMsgDiv);
		container.appendChild(MyBlgDiv);
		container.appendChild(MyLogDiv);
		container.style.display = "block";

	}

    mdp.subdomain = '';
    mdp.regSource = 3060;
    mdp.communityPath = 'dgroups';

	window.addEvent('domready', function(){
		if((typeof(daapi) == 'function')&& $('SPWrapper')){
			mdp.daapi = new daapi(mdp.subdomain, mdp.regSource,mdp.communityPath,mdp.domain,{
				requests:[
					{object:new UserKey(), elements:[{id:'SPWrapper', render:'SurfacePersona'}]}
				]
			}).request();
		}
	});