/*

ALUT (AssociativeArray)
    ATTRIBUTE_NAME (key)
    ASSOCIATIVEARRAY (value)
    ---->
        VALUE_OF_ATTRIBUTE (key)
        ARRAY_DOMNODES   (value)
    
    then perform a linear search on that returned array to find
    the node, if no node is found which matches, return null
            
        

*/
function ALUT()
{
    
    
    this.LUT = new AssociativeArray();
    
    this.addNode = addNode //runs through attribute list on the node, updateing the LUT
    this.getNodes = getNodes //(AttributeName, AttributeValue) --> follows the diagram at top
    this.LUT.registerObject("tagName",new AssociativeArray)
    function addNode(node)
    {
        for(var i in node.attributes)
        {
            //i == attribute name
            //node.attributes[i] = value
            if(i == "registerObject")
                continue;
            if(this.LUT[i] == null)
            {
                //add this attribute name to the LUT
                this.LUT.registerObject(i,new AssociativeArray());
            }
            if(this.LUT[i][node.attributes[i]] == null)
            {
                //then add this value
                
                
                this.LUT[i].registerObject(node.attributes[i],new Array());
            }
            this.LUT[i][node.attributes[i]].push(node);
        }
        if(this.LUT["tagName"][node.tagName] == null)
        {
            this.LUT["tagName"].registerObject(node.tagName,new Array())
        }
        this.LUT["tagName"][node.tagName].push(node);
    }
    
    function getNodes(Attribute_Name, Attribute_Value)
    {
        return this.LUT[Attribute_Name][Attribute_Value];
    }
    
    
}

