$(document).ready(function(){
	$(".addExc").css('cursor', 'pointer').click(function() { 
		title = $($(this).parents('tr').find('td')[0]).text();
		id = this.id.replace('trip_', '');
		$(this).hide().next().show();
		$('#selected_excursions').append('<div id="booking_'+id+'"><p style="color:#117508; font-size:1.2em;"><input type="hidden" name="additionals[]" value="'+ id + '" /> ' + title +'</p><div>');
		$('div#none').remove();
	});
	$(".removeExc").css('cursor', 'pointer').click(function() { 
		id = this.id.replace('trip2_', '');
		$(this).hide().prev().show();
		$('div#booking_'+id).remove();
		if($('#selected_excursions').text().replace(/^\s+|\s+$/g,"") == '') {
			$('#selected_excursions').append('<div id="none">No additional items selected</div>');
		}
	});
});
