function Command_Tools(rte,tool){
var oRTE;
if (document.all) {
oRTE = frames[rte];
} else {
oRTE = document.getElementById(rte).contentWindow;
}
try {
oRTE.focus();
oRTE.document.execCommand(tool, true, null);
oRTE.focus();
} catch (e) {
}
}
sample: Command_Tools(object,'undo');