     //
     //--------------------------------------------------------------------------
 
+    /**
+     *  @private
+     *  Used to assign the selectorIndex in CSSStyleDeclaration so we can track
+     *  the order they were added to the StyleManager.  
+     *  MatchStyleDeclarations has to return the declarations in the order 
+     *  they were declared
+     */ 
+    private var selectorIndex:int = 0;
+    
     /**
      *  @private
      */

            }
        }

        // NOTE: It's important the the parent declarations come before this style
        // manager's styles because the order here is the order they are added to the 
        // prototype chain.
        var theSubjects:Array = null;

        if (parent)
            theSubjects = parent.getStyleDeclarations(subject);

        if (!theSubjects)
        {
            theSubjects = _subjects[subject] as Array;
        }
        else
        {
            var subjectsArray:Array = _subjects[subject] as Array;
            if (subjectsArray)
                theSubjects = theSubjects.concat(subjectsArray);
        }
        
        return theSubjects;


        if (subject != null)
        {
            // determine the kind of selector and add it to the appropriate 
            // bin of selectors for this subject
            var kind:String = styleDeclaration.selector.conditions ? 
                    styleDeclaration.selector.conditions[0].kind : 
                    "unconditional";
            var declarations:Object = _subjects[subject];
            if (declarations == null)
            {
                declarations = {};
                declarations[kind] = [styleDeclaration];
                _subjects[subject] = declarations;
            }
            else
            {
                var declarationList:Array = declarations[kind] as Array;
                if (declarationList == null)
                    declarations[kind] = [styleDeclaration];   
                else
                    declarationList.push(styleDeclaration);
            }
        }

