var updates = updates || {};




updates.showUpdates = function(selectorId,limit,offset,userOnly,listId,userId){

	var divID = "#"+selectorId;
	var url = "/api/getUpdates.php"	
	var dbOffset = limit * offset;
	var params = {"limit": limit, "offset": dbOffset,"userOnly":userOnly,"pageNo":offset};
	
	if(listId != -1){
		params.listId = listId;
	}
	
	if(userId != -1){
		params.userId = userId;
	}
	
	//console.dir(params);
	
	$(".pageBlock").html("");
	
  	var loadingImg = $("<img/>").attr("src","/images/v3/loading.gif");
	$(divID).html("");  	
	$("<div/>").css("padding","10px").css("text-align","center").append(loadingImg).appendTo(divID);
	
	

	$(divID).load(url,params,function(){
		$(".imageIcon").click(function(){
			var theParent = $(this).parent(".postedContentImageContainer");
			var theImageContainer = $(theParent).children(".imageShow");
			var theImage = $(theImageContainer).children("img");
			var theIcon = $(this);
		
		    var imageClone = $(theImageContainer).clone().get(0);
		    $(imageClone).css({"visibility":"hidden","position":"absolute","top":"-300"}).css("display","block").appendTo("body");
		    
			var imgHeight = $(imageClone).children("img").height();

			imgHeight = imgHeight+"px";
			$(imageClone).remove();		
			
			var animateParams = {height: imgHeight};
			
			$(theParent).animate(animateParams,333,function(){
				$(theIcon).fadeOut(333,function(){
					$(theImageContainer).fadeIn(333);
				});
			
			});
						
		});
		
		
		$(".videoIcon").click(function(){
			var animateParams = { width: "370px", height: "350px"};
			var theParent = $(this).parent(".postedContentVideoContainer");
			var theVideo = $(theParent).children(".videoShow");
			var theIcon = $(this);

			$(theParent).animate(animateParams,333,function(){
				$(theIcon).fadeOut(333,function(){
					$(theVideo).fadeIn(333);
				});	
			
			});
		
		
		});
	
		if(circle){
			circle.tabClick = true;		
		}
	});


}