fires when the user changes the state of a two-state button item
myRibbon.attachEvent("onStateChange", function(id, state){ //your code here });