Javascript cash register and address book