/***************************************
 * 
 * Walls library to manipulate the walls display
 *  
 ***************************************/ 

function CWalls(){
	
	this.add = function ( uniqueId, addFunc ){
		
		
		jax.loadingFunction = function()
		{
			jQuery('#wall-message').attr('disabled', true);
			jQuery('#wall-submit').attr('disabled', true);
		}
	
		jax.doneLoadingFunction = function()
		{
			jQuery('#wall-message').attr('disabled', false);
			jQuery('#wall-submit').attr('disabled', false);
		};
		
		jax.call('community', addFunc, jQuery('#wall-message').val(), uniqueId );
	}
	
	this.responded = function(){
		
	}

	this.insert = function( html ){
		jQuery('#wall-message').val('');
		jQuery('#wallContent').prepend(html);	
	}

	this.remove	= function( type , wallId , contentId ){
		if(confirm('Are you sure you want to delete this wall?'))
		{
			jax.call('community' , type + ',ajaxRemoveWall' , wallId , contentId );
			jQuery('#wall_' + wallId ).fadeOut('normal', function(){jQuery(this).remove()});
			
			// Process ajax calls
		}
	}
}

cwalls	= new CWalls();