
var companyArr = new Array();
var businessArr = new Array();
var careersArr = new Array();
var sustArr = new Array();
var prodArr= new Array();
var investorsArr= new Array();


function Node(id, name, url, children) 
{
  this.id = id;
  this.name = name;
  this.url = url;
  this.children = children;
}

function prodNode(name, url, children) 
{
  this.name = name;
  this.url = url;
  this.children=children;
}

function topNavNode(name, url) 
{
  this.name = name;
  this.url = url;

}

function writeLI(currArray)
{
  arrSize=currArray.length;
  for(var i=0;i<arrSize;i++)
  {
    var node=currArray.pop();
    document.write(" <li><a href='"+node.url+"'>"+node.name+"</a></li>");
  }
}

function writeTopNav(navArray,pageContentType)
{
    navArray.reverse();
    //var node=navArray.pop(); Used to remove the first element, and made the nav banner clickable.. 

    document.write("<ul>");
    writeLI(navArray);
    document.write("</ul>"); 
}

function writeHeaderLink(currNode)
{
  var headerLink=currNode[0].url;
  document.write("<a href="+headerLink+">");
}


//This function will include the ability to write out headers and wrapping in the nav
function writeProductNav()
{
   prodArr.reverse();
   //var node=prodArr.pop(); Used to remove the first element, and made the nav banner clickable.. 
   
   
   while(prodArr.length>0)
   {
     node=prodArr.pop();
     numChildren=node.children;
     document.write("<div><h2>"+node.name+"</h2>");
     document.write("<ul>");
     for(var i=0;i<numChildren;i++)
     {
       node=prodArr.pop();
       document.write(" <li><a href='"+node.url+"'>"+node.name+"</a></li>");
     }
     document.write("</ul></div>");
   }
}

