function displayCommunityItems(container){
	if(container != null){
		var cItems = $$("div.community-item");
		var itemSet = new Array();
		for(var i = 0; i < cItems.length; i++){
			var ci = new CommunityItem(cItems[i].select("div.item-title")[0].innerHTML, cItems[i].select("img.community-item-icon")[0].getAttribute("src"), cItems[i].select("div.item-description")[0].innerHTML, cItems[i].select("div.item-link")[0].innerHTML);
			itemSet = itemSet.concat(ci);
		}
		container.id = "random" + Math.floor(Math.random()*100); //IE fixing
		var children = $(container.id).childElements();
		for(var i = 0; i < children.length; i++)
			children[i].remove();
		var float = "right";
		for(var i = 0; i < itemSet.length; i++){
			var ci = itemSet[i];
			var mainLink = document.createElement("A");
			mainLink.setAttribute("href", ci.link);
			mainLink.className = "q-community-item-link";
			mainLink.setAttribute("title", ci.title);
			
			var div = document.createElement("DIV");
			div.className = "q-community-item";
			if(i == 0)
				div.style.backgroundImage = "none";
			
			var header = new Element("DIV");
			header.className = "q-community-item-header";
			header.observe("click", function(event){
				var elem = event.findElement("div.q-community-item-header");
				
			});
			div.appendChild(header);
			
			var icon = document.createElement("DIV");
			icon.className = "q-community-item-icon q-float-" + float;
			icon.innerHTML = "<img src=\"" + ci.icon + "\" border=\"0\" alt=\"" + ci.title + "\" />";
			header.appendChild(icon);
			
			var pDescr = document.createElement("DIV");
			pDescr.className = "q-community-item-header-text q-float-" + float;
			header.appendChild(pDescr);
			
			var title = document.createElement("DIV");
			title.className = "q-community-item-title";
			title.innerHTML = ci.title;
			pDescr.appendChild(title);
			
			var descr = document.createElement("DIV");
			descr.className = "q-community-item-description";
			descr.innerHTML = ci.description;
			pDescr.appendChild(descr);
			
			var clear = document.createElement("DIV");
			clear.className = "q-clear";
			header.appendChild(clear);
			
			mainLink.appendChild(div);
			container.appendChild(mainLink);
						
			float = float == "right" ? "left" : "right";
		}
	}
}
function CommunityItem(title, icon, description, link){
	this.title = title;
	this.icon = icon;
	this.description = description;
	this.link = link;
	
	this.toString = function(){
		var text = "Title = " + this.title + "\n";
		text += "Icon = " + this.icon + "\n";
		text += "Description = " + this.description + "\n";
		text += "Link = " + this.link;
		return text;
	}
}
