function Favorite() {
	this.add = function(event) {
		// this er linket der er klikket på.
		// Find hus-IDet
		var target = $(this);
		var module_vacation_house__house_id = parseInt(target.attr('house_id'), 10);

		$.ajax({
			type:		'POST',
			url:		'/index.php',
			data:		{	page_label:							'ajax',
							mode:								'add_to_favorites',
							module_vacation_house__house_id:	module_vacation_house__house_id
						},
			success:	function (data) {
							// this er options fra ajax-kaldet.
							// Herfra kan vi hente det oprindelige target der blev klikket på
							var target = this.__target;

							if (target.is('a')) {
								target.html(texts.addedToFavorites);
							}

							target
								.unbind('click')
								.bind('click', function() { return false; })
								.css({'cursor': 'default'})
								.hover(function () {
									$(this).css({'text-decoration': 'none'});
								}
							)
						},
			__target:	target
		});

		return false;
	}
	
	this.remove = function (module_vacation_house__house_id) {
		var module_vacation_house__house_id = parseInt(module_vacation_house__house_id, 10);
		
		$.post('/index.php',
				{page_label: 'ajax', mode: 'remove_from_favorites', module_vacation_house__house_id: module_vacation_house__house_id},
				function (data, textStatus) {
					// Does nothing for now....
				});
	}
	
	this.compare = function (module_vacation_house__house_id, event) {
		if (event.target.checked == true) {
			this.add(module_vacation_house__house_id, event)
		}
		else {
			this.remove(module_vacation_house__house_id)
		}
	}
}
