/**
 * tagCloud component.
 *	
 */

function PopularContents($element) {
	PopularContents.baseConstructor.call(this, $element, "popularContents"); 

	this.getContentsURL = MACEConstants.componentsURL+"popularContents/php/getPopularContents_zeitgeist.php";
	this.initDOMElems();
	

	this.buildPopularContents();
}

PopularContents.extend(Component);

PopularContents.prototype.initDOMElems = function(){
	this.$element.html('<div class="dark loadingMessage">Loading...</div>');

}

PopularContents.prototype.buildPopularContents = function(){
	var _this = this;
	var o={};
	

  	$.getJSON(this.getContentsURL,o,function (contentsObj) {
			if(contentsObj.success==false){
				
			}
			else{
				_this.$element.empty();
				$.each(contentsObj, function(i,obj) {

					_this.$element.append(	"<li><a id='popContent_"+i+"' href='"+MACEConstants.rootURL+"details/"+obj.id+"' > "+obj.title+"</a></li>");
				
				});
			}
	});

}





