Index: /trunk/htmlarea.js
===================================================================
--- /trunk/htmlarea.js (revision 505)
+++ /trunk/htmlarea.js (revision 510)
@@ -279,4 +279,8 @@
   this.undoTimeout = 500;	// 1/2 sec.
 
+  // set this to true if you want to explicitly right-justify when 
+  // setting the text direction to right-to-left
+  this.changeJustifyWithDirection = false;
+
   // if true then HTMLArea will retrieve the full HTML, starting with the
   // <HTML> tag.
@@ -4358,4 +4362,8 @@
     case "lefttoright":
     case "righttoleft":
+      if (this.config.changeJustifyWithDirection) 
+      {
+        this._doc.execCommand((cmdID == "righttoleft") ? "justifyright" : "justifyleft", UI, param);
+      }
       var dir = (cmdID == "righttoleft") ? "rtl" : "ltr";
       var el = this.getParentElement();
