Entanglement and decoherence of a micromechanical resonator via coupling to a Cooper-pair box.