Required library edition: Required library file: dhtmlxtoolbar.js
returns current state of a two-state button
var isPressed = toolbar.getItemState(itemId); // returns true/false