(function ($) {
    $(function () {
        $('#contact-form-send').click(function () {
            $.ajax({
                url: 'contactme/webform.php',
                method: 'POST',
                datatype: 'JSON',
                data: {
                    name: $('#contact-form-name').val(),
                    email: $('#contact-form-email').val(),
                    message: $('#contact-form-message').val()
                },
                success: function () {
                    console.log( 'I ran the ajax request successfully' ); // debug purposes
                }
            });
        });
        $("#scrolldown-button").click(function() {
            $('html,body').animate({
                scrollTop: $("#contact-form").offset().top
            }, 'slow');
        });
        $("#contact-form-message").css('overflow', 'hidden').autogrow({vertical: true, horizontal: false, flickering: false});
    });
})(jQuery);