> $('[name="services-name"]').change(function(){
> if ($(this).prop("checked")){
> $(".service-price").text($(this).data("price") + parseInt($(".service-price").text()));
> $(".total-price").text(numberWithSpaces(parseInt($(".total-price").text().replace(/\s+/g, '')) + $(this).data("price")));
> } else {
> if ($(this).data("price") - parseInt($(".service-price").text()) > 0) {
> $(".service-price").text($(this).data("price") - parseInt($(".service-price").text()));
> } else {
> $(".service-price").text('0');
> }
> $(".total-price").text(numberWithSpaces(parseInt($(".total-price").text().replace(/\s+/g, '')) - $(this).data("price")));
> }
> });