var FavoriteApartment = new Class({
	
	Extends : Apartment, 
	
	
	setUp: function()
	{
		this.bus = new SearchBus();
		

		this.wrapper	= new Element("div", {"class":"apartment"});
		this.id 		= this.data[this.dataProperties.idProperty];
		
		this.title 		= new Element("h1", {text:this.data[this.dataProperties.titleProperty]}).inject(this.wrapper);
		this.image 		= new Element("img", {"src":this.data[this.dataProperties.imageProperty]}).inject(this.wrapper);
		this.total 		= new Element("div", {"class":"total", html:"<strong>Total estancia</strong><span>"+this.data[this.dataProperties.ratesProperty][this.dataProperties.totalProperty]+"&nbsp;&euro;</span>"}).inject(this.wrapper);
		
		this.remove = new Element("a", {href:"#", text:"[x] eliminar de favoritos", "class":"remove"}).inject(this.wrapper);
		this.remove.addEvent("click", function(event){event.stop()});
		this.remove.addEvent("click", this.removeFavorite.bind(this));
		
	},
	
	removeFavorite: function()
	{
		this.bus.trigger("favoriteRemoved", this);
	},
	
	inject: function(container, where)
	{
		this.wrapper.inject(container, where);
	}
	
})