function toggleFavourite(senderId, propertyId)
{
	sender = $(senderId);
	if ( sender.hasClassName('fav-add') ) 
	{
		new Ajax.Request('/search/favourites/add/'+propertyId+'?nocache='+Math.random());
		sender.removeClassName('fav-add');
		sender.addClassName('fav-del');
		sender.update('Remove from Favourites');
		if ( $('fav-count') )
		{
			$('fav-count').update(parseInt($('fav-count').innerHTML) + 1);
			$('fav-count-container').show();

			$('fav-count2').update(parseInt($('fav-count2').innerHTML) + 1);
			$('fav-count2-container').show();
		}
	}
	else if ( sender.hasClassName('fav-del') )
	{
		new Ajax.Request('/search/favourites/delete/'+propertyId+'?nocache='+Math.random());
		sender.removeClassName('fav-del');
		sender.addClassName('fav-add');
		sender.update('Add to Favourites');
		if ( $('fav-count') )
		{
			$('fav-count').update(parseInt($('fav-count').innerHTML) - 1);
			if ( parseInt($('fav-count').innerHTML) == 0 )
			{
				$('fav-count-container').hide();
			}
			
			$('fav-count2').update(parseInt($('fav-count2').innerHTML) - 1);
			if ( parseInt($('fav-count2').innerHTML) == 0 )
			{
				$('fav-count2-container').hide();
			}

		}		
	}
	
}

