function MapPropertyCompare(bar, properties)
{
	jQuery.extend(
	this, 
	new PropertyCompare(bar, properties),
	{
		addProperty:function(id, cb)
		{
			this.cb = cb;
			var object = this;
			jQuery.getJSON('/ajax/compare.php', {action: 'add', property_id: id}, function(data, textString){ object.addPropertyCB(data, textString);} );
		},
		addPropertyCB: function(data, textString)
		{
			if(data.status == 'error')
			{
				if(this.cb != null)
				{
					this.cb(false);
				}
				return false;
			}
			this.properties[this.properties.length] = data.object;
			this.addRow(data.object);
			this.updateLabel();
			
			if(this.cb != null)
			{
				this.cb(true);
			}
		}
	});
}
