/**
 * CommunityCloud component.
 *	
 */

function CommunityCloud($element) {
	CommunityCloud.baseConstructor.call(this, $element, "latestActiveUsers");
    this.getLatestActiveURL = MACEConstants.componentsURL+"communityCloud/php/getLatestActiveUsers.php";
    this.$element=$element;
	this.buildCommunityCloud();
}

CommunityCloud.extend(Component);

CommunityCloud.prototype.buildCommunityCloud = function(){

	var _this = this;
	var o={};
	
	
	this.$element.html('<div class="loadingMessage">Loading...</div>');
	
  	$.getJSON(this.getLatestActiveURL,o,function (communityObj) {
            _this.$element.html("")
				$.each(communityObj, function(i,obj) {
                    
                    var usertile =	"<li class='memListElementSmall'><a class='memberListLinkSmall'  href='"+MACEConstants.rootURL+"user/"+obj.nickName+"' title=\""+obj.introText+"\">"; //
                    usertile    +="<div class='userTile' style='background-image: url("+obj.icon+"); background-repeat:no-repeat; width:94px;  height:90px;'>";
               //     usertile    +="<div class='userTile_nameSmall'>"+obj.fullname+"</div>";
                    usertile    +="</div></a></li>";
					_this.$element.append(  usertile	);
			
				});
		        //tipsy
            	$(".memberListLinkSmall").tipsy({fade: true, gravity:"s"});
		
	});
}




