added AJAX and betting