var heads = [
	[ 'default', '<h2>Introducing...</h2>' +
               '<p>NagVis is a visualization addon for the well known network managment system <a href="http://www.nagios.org">Nagios</a>.</p>' +
               '<p>NagVis can be used to visualize Nagios Data, e.g. to display IT processes like a mail system or a network infrastructure.</p>' ],
  [ 'automap', '<h2>NagVis Automap</h2>' +
               '<p>The NagVis Automap automatically creates maps according to the parent/child relations in your Nagios installation.</p>' ],
  [ 'weathermap', '<h2>Weathermap Lines</h2>' +
               '<p>NagVis weathermap lines visualize the traffic in your network in a smart and intuitive way.</p>' +
							 '<p>The weathermap lines give you real knowledge about where the traffic comes from and where it goes to.</p>' ],
  [ 'gadget', '<h2>Gadgets</h2>' +
              '<p>Using NagVis Gadgets you can create impressing graphics out of the performance data of e.g. load or disk usage checks.</p>' ],
  [ 'maps', '<h2>Visualize branches on maps</h2>' +
            '<p>Visualize the overall state of your companies branches using maps within NagVis.</p>' ]
];

var curHead = 'default';
var headTimer = null;

function newHead(basePath) {
	var nextHead = 0;
	var headPath = basePath + '/images/headers/';
	var img  = document.getElementById('desc_img');
	var text = document.getElementById('desc_text');

	for(var i = 0, len = heads.length; i < len; i++)
		if(heads[i][0] == curHead)
			if(i + 1 < len)
				nextHead = i+1;
			else
				nextHead = 0;

	curHead = heads[nextHead][0];
	img.style.backgroundImage = 'url(' + headPath + curHead + '.png)';

	text.innerHTML = heads[nextHead][1];

	text = null;
	img = null;

	if(headTimer !== false) {
		window.clearTimeout(headTimer);
		headTimer = window.setTimeout(function() { newHead(basePath) }, 10000);
	}
}

function stopHead() {
	window.clearTimeout(headTimer);
	headTimer = false;
}

/*
 * Featuritis functions
 */

function action(id) {
    var o = document.getElementById('action_' + id);
    if(o) {
        if(o.style.display == 'none')
            o.style.display = '';
        else
            o.style.display = 'none';
        o = null;
    }
}

