function selectText(areaId) {
if (document.selection) {
var range = document.body.createTextRange();
range.moveToElementText(document.getElementById(areaId));
range.select();
} else if (window.getSelection) {
var range = document.createRange();
range.selectNode(document.getElementById(areaId));
window.getSelection().removeAllRanges();
window.getSelection().addRange(range);
}
}