Declared variables for buttons and command selector.
Modified variables to use the new global ones.
Fixed errors in jquery selectors variables. Forgot "#" in selector :-(