          */
         public function set selected(value:Boolean):void
         {
-            IToggleButtonModel(model).selected = value;
+            COMPILE::AS3
+            {
+                IToggleButtonModel(model).selected = value;                    
+            }
+            COMPILE::JS
+            {
+                if (_selected != value) 
+                {
+                    _selected = value;
+                    
+                    var className:String = this.className;
+                    var typeNames:String = this.typeNames;
+                    if (value) {
+                        if (typeNames.indexOf(SELECTED) == -1) {
+                            typeNames = typeNames + SELECTED;
+                            if (className)
+                                element.className = typeNames + ' ' + className;
+                            else
+                                element.className = typeNames;
+                        }
+                    }
+                    else {
+                        if (typeNames.indexOf(SELECTED) == typeNames.length - SELECTED.length) {
+                            typeNames = typeNames.substring(0, typeNames.length - SELECTED.length);
+                            if (className)
+                                element.className = typeNames + ' ' + className;
+                            else
+                                element.className = typeNames;
+                        }
+                    }
+                }
+            }
         }
         
         /**

                return "toggleTextButton" + (name ? " " + name : "");
        }
        
        
	}
}

		public function ToggleTextButton()
		{
			super();
            COMPILE::JS
            {
                this.typeNames = 'toggleTextButton';
            }
		}
        
        COMPILE::JS
        private var _selected:Boolean;
        
        COMPILE::JS
        private var SELECTED:String = "selected";
        
        /**
         *  <code>true</code> if the Button is selected.
