This is because buttons url must be an PHP expression, to call a javascript function, you have to do like,
'buttonID' => array
(
'label'=>'...', //Text label of the button.
'url'=>'...', //A PHP expression for generating the URL of the button.
'imageUrl'=>'...', //Image URL of the button.
'options'=>array(), //HTML options for the button tag.
'click'=>'...', //A JS function to be invoked when the button is clicked.
'visible'=>'...', //A PHP expression for determining whether the button is visible.
)