//CLASS - MENU
//{
    function Menu(name, url, newWindow)
    {
        this.name = name;
        this.url = url;
        this.children = new Array();
        this.subMenu = false;
	  if (typeof newWindow == "undefined") newWindow = false;
	  else this.newWindow = true;
    }
    
    Menu.prototype.Add = function(menu)
    {
        this.children.push(menu);
    }
    
    
    Menu.prototype.ToHTML = function()
    {
        var li = document.createElement('li');
        var a = document.createElement('a');
        
        a.setAttribute('href', this.url);
        if (this.subMenu) a.className = 'subMenu';          
	  if (this.newWindow) a.setAttribute('target', '_new');
        a.innerHTML = this.name;
            
        li.onmouseover = function() {this.className += ' menuHover';}
        li.onmouseout = function() {this.className = this.className.replace('menuHover', ''); }
        li.appendChild(a);
        
        if (this.children.length > 0)
        {
            var ul = document.createElement('ul');   
            for (i in this.children)
            {
                ul.appendChild(this.children[i].ToHTML());
            }
            li.appendChild(ul);
        }
        return li;
    }
    Menu.prototype.Root = function(name)
    {
        var ul = document.createElement('ul');
        ul.id = name;
        ul.className = 'menu';
        for (i in this.children)
        {
            var li = this.children[i].ToHTML(name);
            var a = li.firstChild;
            ul.appendChild(li);
        }
        return ul;
    }
    
//}
