function MenuData() {

  this.Stack = function() {
    var stackArray = [ ];

    function StackUnit(node, action) {
      this.node = node;
      this.action = action;
    }

    this.stackArray = stackArray;

    this.put = function (node, action) {
      stackArray[stackArray.length] = new StackUnit(node, action);
    }
    this.clear = function (stopNode) {
      for (var i = stackArray.length - 1; i > -1 && stackArray[i].node != stopNode; stackArray[i--].action());
      stackArray.length = ++i;
    }
    this.isPresent = function (node) {
      for (var i = stackArray.length - 1; i > -1 && stackArray[i].node != node; --i);
      return ++i;
    }
  }

  this.Node = function(nodeData, parentNode) {
    var context = this,
        childNodes = [ ],
        i = parentNode ? parentNode.childNodes.length - 1 : -1,
        Node = this.constructor;

    if (i > -1) {
      (this.previousSibling = parentNode.childNodes[i]).nextSibling = this;
    }
    else {
      this.previousSibling = null;
    }

    this.nextSibling = null;

    this.parentNode = parentNode;
    this.childNodes = childNodes;
    this.data = nodeData;
    this.runtimeData = { };

    this.addChildNode = function (nodeData) {
      return childNodes[childNodes.length] = new Node(nodeData, context);
    }
    this.implement = function (Implementation) {
      return context.implementation = new Implementation(context);
    }
  }

}

var menuData = new MenuData();

/* -- User data types -- */

function MenuDataTypes() {

  this.HostMenu = function (baseZIndex) {
    this.baseZIndex = baseZIndex; // Next free zIndex is baseZIndex + 4
    this.hideDelay = 1000;
  }

  this.HostItem = function (id) {
    this.id = id;
    this.childMenuPosition = {
      h: "near", // near | middle | far
      v: "near",
      hParent: "near",
      vParent: "far",
      hOffset: 0, // in px
      vOffset: 0,
      hOptimize: "offset", // none | offset | mirror
      vOptimize: "none"
    }
  }

  this.Menu = function () {
    this.dir = "v"; // menu direction (one under another items), affects kb navigation
  }

  this.Item = function (itemHtml, href, target) {
    this.itemHtml = itemHtml;
    this.href = href == undefined ? "#" : href;
    this.target = target == undefined ? "" : " target='" + target + "'";
    this.childMenuPosition = {
      h: "near", // near | middle | far
      v: "near",
      hParent: "far",
      vParent: "near",
      hOffset: 0, // in px
      vOffset: 0,
      hOptimize: "mirror", // none | offset | mirror
      vOptimize: "offset"
    }
  }

}

var menuDataTypes = new MenuDataTypes();

/* -- End of user data types -- */

var navMenu = new menuData.Node(new menuDataTypes.HostMenu());

with (navMenu) {
  with (addChildNode(new menuDataTypes.HostItem('m2Company'))) {
    with (addChildNode(new menuDataTypes.Menu())) {
      addChildNode(new menuDataTypes.Item('Profile', '/company/corporate.htm'));
      addChildNode(new menuDataTypes.Item('Technology', '/company/technology.htm'));
      addChildNode(new menuDataTypes.Item('Careers', '/company/careers.htm'));
      addChildNode(new menuDataTypes.Item('News', '/company/news2011.htm'));
    }
  }
  with (addChildNode(new menuDataTypes.HostItem('m2Clients'))) {
    with (addChildNode(new menuDataTypes.Menu())) {
      addChildNode(new menuDataTypes.Item('By Industry', '/customers/by_industry.htm'));
      addChildNode(new menuDataTypes.Item('Testimonials', '/customers/testimonials.htm'));
      addChildNode(new menuDataTypes.Item('Clients Support', '/customers/support.htm'));
    }
  }
  with (addChildNode(new menuDataTypes.HostItem('m2Solutions'))) {
    with (addChildNode(new menuDataTypes.Menu())) {
	  addChildNode(new menuDataTypes.Item('Offshore Dedicated Teams', '/solutions/offshore_dedicated_teams.htm'));
	  addChildNode(new menuDataTypes.Item('Web Solutions', 'http://www.futurevision.com.ua', '_blank'));
	  addChildNode(new menuDataTypes.Item('Internet GIS and maps', 'http://www.usflashmap.com', '_blank'));
    }
  }
  with (addChildNode(new menuDataTypes.HostItem('m2Services'))) {
    with (addChildNode(new menuDataTypes.Menu())) {
      addChildNode(new menuDataTypes.Item('Magento Development', '/services/magento_development.htm'));
	  addChildNode(new menuDataTypes.Item('Offshore Dedicated Teams', '/services/offshore_dedicated_teams.htm'));
	  addChildNode(new menuDataTypes.Item('Web development', 'http://www.FutureVision.com.ua', '_blank'));
	  addChildNode(new menuDataTypes.Item('Custom Software Development', '/services/custom_software_development.htm'));
	
    }
  }
  with (addChildNode(new menuDataTypes.HostItem('m2References'))) {
    }
  with (addChildNode(new menuDataTypes.HostItem('m2Products'))) {
   
  }
  with (addChildNode(new menuDataTypes.HostItem('m2Contact'))) {
    with (addChildNode(new menuDataTypes.Menu())) {
      addChildNode(new menuDataTypes.Item('Contact Information', '/contact/contact_information.htm'));
      addChildNode(new menuDataTypes.Item('Get a Quote', '/contact/price_quote/?action=rfp'));
    }
  }
}
