$(document).ready(function () {
    //add and remove vehicle fields
    var addButton = $('#add-field'); //Add button selector
    var wrapper = $('.added-fields'); //Input field wrapper
    var x = 1;
    var fieldHTML = '<div class="">' +
        '<button type="button" id="remove-button"> <i class="fa fa-trash"></i> </button>' +
        '<div class="guestDetails_input">\n' +
        '  <div class="guestDetails_inputLabel">Tax/Levy Name <span class="error">*</span></div>\n' +
        '    <div class="guestDetails_input">\n' +
        '        <input type="text" name="name[]" size="20px">\n' +
        '    </div>\n' +
        '</div>\n' +
        '<div class="guestDetails_input">\n' +
        '  <div class="guestDetails_inputLabel">Tax Rate(%)/Amount</div>\n' +
        '    <div class="guestDetails_input">\n' +
        '        <input type="text" name="rate[]" size="10px">\n' +
        '    </div>\n' +
        '</div>\n' +
        '<div class="guestDetails_input">\n' +
        '  <div class="guestDetails_inputLabel">On Each Item</div>\n' +
        '    <div class="guestDetails_input">\n' +
        '        <input type="checkbox" name="item[]" value="1">\n' +
        '    </div>\n' +
        '</div>\n' +
        '<div class="guestDetails_input">\n' +
        '  <div class="guestDetails_inputLabel">New B/s</div>\n' +
        '    <div class="guestDetails_input">\n' +
        '        <input type="checkbox" name="new[]" value="1">\n' +
        '    </div>\n' +
        '</div>\n' +
        '<div class="guestDetails_input">\n' +
        '  <div class="guestDetails_inputLabel">Renewal</div>\n' +
        '    <div class="guestDetails_input">\n' +
        '        <input type="checkbox" name="renewal[]" value="1">\n' +
        '    </div>\n' +
        '</div>\n' +
        '<div class="guestDetails_input">\n' +
        '  <div class="guestDetails_inputLabel">END</div>\n' +
        '    <div class="guestDetails_input">\n' +
        '        <input type="checkbox" name="endorsement[]" value="1">\n' +
        '    </div>\n' +
        '</div>\n' +
        '<div class="guestDetails_input">\n' +
        '  <div class="guestDetails_inputLabel">Calculations</div>\n' +
        '    <div class="guestDetails_input">\n' +
        '        On Basic<input type="radio" name="calc[]" value="1">&nbsp;&nbsp;\n' +
        '        On Gross<input type="radio" name="calc[]" value="1">&nbsp;&nbsp;\n' +
        '        On Duty<input type="radio" name="calc[]" value="1">\n' +
        '    </div>\n' +
        '</div>\n' +
        '<div class="guestDetails_inputDivider input_divider1"></div>';

    //Once add button is clicked
    $(addButton).click(function(){
        x++; //Increment field counter

        $(wrapper).append(fieldHTML); //Add field html

    });
    //Once remove button is clicked
    $(wrapper).on('click', '#remove-button', function(e){
        e.preventDefault();
        $(this).parent('div').remove(); //Remove field html
        x--; //Decrement field counter
    });
});
