function id_to_button_row_buttons(){
?>
<script>
(function($) {
$('.avia-buttonrow-wrap').each(function(a){
var ButtonRowID = ($(this).attr('id') !== undefined) ? $(this).attr('id') : 'button_row'+(a+1);
var that = this;
$('.avia-button', this).each(function(i){
$(this).attr('id', ButtonRowID+'-button'+(i+1));
});
});
})(jQuery);
</script>
<?php
}
add_action( 'wp_footer', 'id_to_button_row_buttons');