var dAmount = document.querySelector('#dAmount')


function openUserSideBar() {
    var menuToggler = document.querySelector('#menuToggler')
    $('#userControlDropdown').show()
    $('.overlayDiv').show()
    menuToggler.onclick = hideUserSideBar;
}

function hideUserSideBar() {
    var menuToggler = document.querySelector('#menuToggler')

    $('#userControlDropdown').hide()
    menuToggler.onclick = openUserSideBar;
    $('.overlayDiv').hide()
}

function openSideBarSm() {
    var toggleDrawer = document.querySelector('#toggleDrawer')

    $('#overlayDiv').show()
    $('#sideBarSm').show('slide', {
        direction: 'left'
    }, 400)
    toggleDrawer.onclick = hideSideBarSm
}

function hideSideBarSm() {
    var toggleDrawer = document.querySelector('#toggleDrawer')

    $('#overlayDiv').hide()
    $('#sideBarSm').hide('slide', {
        direction: 'left'
    }, 400)
    toggleDrawer.onclick = openSideBarSm
}


function setPaymentSystem(e) {
    var paymentOptionValue = document.querySelector('#paymentOption')


    $('.pay-option-container').each(function() {
        $(this).removeClass('pay-option-container-active')

        checked = $(this).find('i')
        checked.removeClass('fi-rr-checkbox')
        checked.addClass('fi-rr-square')
    })
    $(e).addClass('pay-option-container-active')

    nowChecked = $(e).find('i')
    nowChecked.removeClass('fi-rr-square')
    nowChecked.addClass('fi-rr-checkbox')
    // ##
    paymentOptionValue.value = e.id
}