var widthArray, lengthArray, infoHead, areaHead, weightHead, priceHead, displayArea, displayWeight, displayPrice;
var usingInternetExplorer= document.all;         //Sets identifiier for Internet Explorer
var usingNetscape4x = document.layers;         // Sets identifier for Netscape 4.x

function loadXMLInfo(){

if ( usingInternetExplorer ){
        widthArray  = document.all.widthArray;
        lengthArray = document.all.lengthArray;
        infoHead = document.all.infoHead;
        areaHead = document.all.areaHead;
        weightHead = document.all.weightHead;
        priceHead = document.all.priceHead;
        displayArea = document.all.area;
        displayWeight = document.all.weight;
        displayDecks = document.all.decks;
        displayPrice = document.all.price;
        } else {
           if ( usingNetscape4x ) {
                widthArray = document.dockWidth;
                lengthArray = document.dockLength;
                infoHead = document.infoHead;
                areaHead = document.areaHead;
                weightHead = document.weightHead;
                priceHead = document.priceHead;
                displayArea = document.area;
                displayWeight = document.weight;
                displayDecks = document.decks;
                displayPrice = document.price;
           } else {
                  widthArray = document.getElementById("widthArray");
                  lengthArray = document.getElementById("lengthArray");
                  infoHead = document.getElementById ("infoHead");
                  areaHead = document.getElementById ("areaHead");
                  weightHead = document.getElementById ("weightHead");
                  decksHead = document.getElementById ("decksHead");
                  priceHead = document.getElementById ("priceHead");
                  displayArea = document.getElementById ("area");
                  displayWeight = document.getElementById ("weight");
                  displayDecks = document.getElementById ("decks");
                  displayPrice = document.getElementById ("price");
        }
  }

 var DB = xmlDoc.getElementsByTagName('unit');

        for (j=0;j<DB[0].childNodes.length;j++)        /* Determine the index of each heading */
        {
                if (DB[0].childNodes[j].nodeName == "width") var widthNode = j;
                if (DB[0].childNodes[j].nodeName == "length") var lengthNode = j;
                if (DB[0].childNodes[j].nodeName == "weight") var weightNode = j;
                if (DB[0].childNodes[j].nodeName == "decks") var decksNode = j;
                if (DB[0].childNodes[j].nodeName == "price") var priceNode = j;

        }
        for (i=0;i<DB.length;i++)
                for (j=0;j<DB[i].childNodes.length;j++)        /* Populate the Table */
                {
                        if (DB[i].childNodes[widthNode].firstChild.nodeValue == width && DB[i].childNodes[lengthNode].firstChild.nodeValue == length){
                                infoHead.innerHTML = "Dimensions: " + width + "x" + length;

                                areaHead.innerHTML  = "Area:";
                                weightHead.innerHTML  = "Weight:";
                                decksHead.innerHTML = "Decks:";
                                priceHead.innerHTML  = "Price:";

                                displayArea.innerHTML  = width * length + " sq\'"
                                displayWeight.innerHTML  = DB[i].childNodes[weightNode].firstChild.nodeValue + " lbs."
                                displayDecks.innerHTML = DB[i].childNodes[decksNode].firstChild.nodeValue
                                displayPrice.innerHTML  = "$ " + DB[i].childNodes[priceNode].firstChild.nodeValue
                        }
                }

}