    package com.bluefire.flexDemo.view
    {
        import mx.containers.HDividedBox;
        import mx.containers.dividedBoxClasses.BoxDivider;
        import com.bluefire.flexDemo.view.BluBoxDivider;
        import mx.events.DividerEvent;
        import com.adobe.cairngorm.control.CairngormEventDispatcher;
        import com.bluefire.flexDemo.events.AutoCloseSidePanelEvent
        import com.adobe.cairngorm.view.ViewLocator;

        public class BluDividedBox extends HDividedBox
        {

            private var _dividerEnabled:Boolean = true;
            private var _bDragged:Boolean = false;
            private var _bClosed:Boolean = false;

            public function BluDividedBox()
            {
              super();        //super the constructor

              //custom divider class
              dividerClass = com.bluefire.flexDemo.view.BluBoxDivider;

              //add event listeners for the divider
              addEventListener("dividerPress",onDividerPress);
              addEventListener("dividerRelease",onDividerRelease);
              addEventListener("dividerDrag",onDividerDrag);
            }

            public function onDividerPress(e:DividerEvent):void
            {
                _bDragged = false;
            }

            public function onDividerDrag(e:DividerEvent):void
            {
                _bDragged = true;
            }

            public function onDividerRelease(e:DividerEvent):void
            {
                if(!_bDragged)
                {
                    //user clicked boxDivider knob rather than dragging it
                    //disaptch an auto close/open event for the side panel
                    CairngormEventDispatcher.getInstance().dispatchEvent(new AutoCloseSidePanelEvent(_bClosed));

                    //flip the knob graphic on the divider
                    var thisDivider:BoxDivider = getDividerAt(0);
                    if(thisDivider)
                    {
                        BluBoxDivider(thisDivider).flipKnob(!_bClosed);
                    }
                    //toggle closed var
                    _bClosed = ! _bClosed;
                }

            }

            public function set dividerEnabled(value:Boolean):void
            {
              _dividerEnabled = value;
              invalidateDisplayList();
            }

            public function get dividerEnabled():Boolean
            {
              return(_dividerEnabled);
            }

        }

    }