Patients undergoing hip or knee joint replacement at the age of 70 years or above who are cognitively unimpaired will receive donepezil or matching placebo before (over 5-7 days), during and after (over 7 days) surgery. The incidence of delirium will be monitored at 3 days, 7 days, and 49 days following surgery. We hypothesize that the incidence of delirium can be lowered from 20 per cent to 10 per cent by the intervention.