/* 
 Copyright (c) 2007, CYBUILD. 
 All rights reserved.
 */

var dataArr = Array({ label : 'Home Page', parent : null, text : 'Welcome to CYBUILD. CYBUILD is a tightly coupled business organization. We make software.' }, { label : 'Clients', parent : 0, text : 'FAQ\n<ul>\n<li>Do you offer complete solutions? Yes, this is what we do best.</li>\n<li>Do we need to be qualified in software to be your clients? Definitely no - you can trust our professionalism.</li>\n</ul>' }, { label : 'Associates', parent : 0, text : 'If you are experienced in Computer Science, if you are self-managed, trustworthy and value your freedom, you would be welcome in our team. What does not matter is your gender, nationality, religion, location or age.' }, { label : 'Products', parent : 1, text : '<p>We specialize in building distributed, custom-tailored enterprise information systems. </p>\n<p>FAQ</p>\n<ul>\n<li>Do you provide hosting? Yes, we offer hosting for our products.</li>\n<li>Are your applications multi-lingual? Yes, if you need so.</li>\n<li>Are your applications extensible? Yes. You can start small and expand as necessary. Your application will evolve with your business needs. It is not a problem for as, as we use an additive approach in our development.</li>\n<li>What platforms do you support? Your web applications could be used from any platform that is equipped with a modern http agent (web browser).</li>\n<li>What technologies do you use? We use some of the most advanced software technologies.</li>\n<li>Could you be more specific? We make distributed applications that provide high availability of data, security, dependability and a friendly user interface. The applications are based on open standards. We use advanced high-level programming languages.</li>\n</ul>' }, { label : 'Services', parent : 1 }, { label : 'Support', parent : 4, text : '<p>We offer full support of our products not only by ourselves but also with 3rd party companies. </p>\n<p>In addition we offer support of Common Lisp applications.</p>' }, { label : 'Consulting', parent : 4, text : 'We can consult you about your marketing requirements or software architecture and do a system analysis for you.' }, { label : 'Outsourcing', parent : 4, text : 'We can offer plenty of experience in outsourcing. We have worked with French, Canadian and US-based clients.' }, { label : 'Business Process', parent : 1, text : 'Your software needs are analyzed and evaluated and we prepare a marketing requirements document. We tune it with you and present you an initial offer. It contains an approximate time-frame for the implementation and approximate price. When an initial deal is signed we prepare a technical requirements document. The client is presented with a final offer and a contract is signed.' }, { label : 'Location', parent : 1, text : 'The headquarters and most of our associates are in Bulgaria.' }, { label : 'Costs', parent : 1, text : '<p>With us you will know where your money go. We do not have office rents or any related costs as we are working from home. What is more we do not have neither administration nor human resources or marketing departments. All thanks to the natural environment we work in. We invest a substantial part of our profit in groupware and project management software.</p>\n<p>FAQ</p>\n<ul>\n<li>What are your rates? Our rates depend on the job. Beside client and server-side programming the development of a software application requires many kinds of talents such as marketing, management, system administration, etc. All these involve different rates that constantly change depending on the market.</li>\n<li>What would be our additional costs from third party software? Usually these costs are small. It is because we use open source software not only for the operating system, but also for the database management system. Most often this software is free. However, depending on your needs we might propose using a particular commercial piece of software.</li>\n</ul>' }, { label : 'Contact', parent : 1, text : '<p>\nE-mail:\n<a href=\'mailto:&#107&#97&#109&#101&#110@&#99&#121&#98&#117&#105&#108&#100.&#99&#111&#109\'>&#107&#97&#109&#101&#110@&#99&#121&#98&#117&#105&#108&#100.&#99&#111&#109</a>\n</p>' }, { label : 'Demand', parent : 2, text : '<p>Currently there is a demand for the following specialists:</p>\n<ul>\n<li>Client-side specialist skilled in DHTML, JavaScript.</li>\n<li>Art designer. A talented individual skilled in art design and image manipulation software.</li>\n<li>System administrator. Expirianced in Linux, security, networking.</li>\n<li>Server-side developer, well educated in Computer Science and willing to use dynamic languages. Lisp is a great plus.</li>\n</ul>' }, { label : 'Benefits', parent : 2, text : '<ul>\n<li>You would be given the opportunity to work with the best.</li>\n<li>You would be in a natural competitive environment. </li>\n<li>You would use your favourite software tools and operating system. </li>\n<li>You would decide about your working hours.</li>\n<li>You would decide whether to take an assignement or not.</li>\n</ul>' }, { label : 'Obligations', parent : 2, text : 'A contract would be signed with you every time you take an assignment. All we care about is that the assignment that you take is completed in accordance to your contract. This usually means - in time and in details.' }, { label : 'Structure', parent : 2, text : 'Our structure is simple. There is a lead and a pool of associates.' }, { label : 'Process', parent : 2, text : 'With the technical requirements document a small team analyzes the task further and divides it into multiple tasks. Then they are presented to a pool of associates who can bid on them. Contract is signed with an associate upon match. An integration team keeps track for the implementation of the tasks, sets priorities and integrates the modules into the application. Quality is assured firstly on task release and secondly on application release. Eventually the application is deployed in the client\'s environment and tuned. Training and support are provided as agreed.' }, { label : 'Contact', parent : 2, text : '<p>\nE-mail:\n<a href=\'mailto:&#107&#97&#109&#101&#110@&#99&#121&#98&#117&#105&#108&#100.&#99&#111&#109\'>&#107&#97&#109&#101&#110@&#99&#121&#98&#117&#105&#108&#100.&#99&#111&#109</a>\n</p>' });
function findBrothersAndSisters(arr, id) {
    var node = arr[id];
    var resArr = new Array();
    var parent = node.parent;
    for (var ix in arr) {
        if (arr[ix].parent == parent) {
            resArr.push(ix);
        };
    };
    return resArr;
};
function findChildren(arr, id) {
    var resArr = new Array();
    for (var ix in arr) {
        if (arr[ix].parent == id) {
            resArr.push(ix);
        };
    };
    return resArr;
};
function findTreePath(arr, id) {
    var node = arr[id];
    var resArr = new Array();
    while (node) {
        resArr.push(id);
        id = node.parent;
        node = arr[id];
    };
    return resArr;
};
findBrothersAndSisters(dataArr, 5);
findTreePath(dataArr, 110);
function initView(id) {
    var navigator = '';
    var navmonitor = '';
    var children = findChildren(dataArr, id);
    var bros = findBrothersAndSisters(dataArr, id);
    var tree = findTreePath(dataArr, id);
    var kj = children && children[length] > 0 ? children : bros;
    if (!dataArr[id].text) {
        return initView(children[0]);
    };
    for (var ix in tree) {
        var elem = tree[ix];
        navmonitor = '<a href=\'javascript:initView(' + elem + ')\'>' + dataArr[elem].label + '</a> &gt; ' + navmonitor;
    };
    for (var ix in kj) {
        var child = kj[ix];
        if (child == id) {
            continue;
        };
        navigator += '<a href=\'javascript:initView(' + child + ')\'>' + dataArr[child].label + '</a> | ';
    };
    document.getElementById('navmonitor').innerHTML = navmonitor;
    document.getElementById('contentv').innerHTML = dataArr[id].text;
    document.getElementById('navigator').innerHTML = navigator.substr(0, navigator.length - 3);
};
function init() {
    initView(0);
};