// HOVER FUNKTIONEN
// ------------------------------------------------------------------------------------------------

function img()
{
	this.state  = "off";
	this.active = new Image();
	this.on     = new Image();
	this.off    = new Image();
}

function Iarray(wieviel)
{
	this.length = wieviel + 1;
	for (var i=1; i<=wieviel; i++)
	{
		this[i]            = new img();
		this[i].active.src = "";
		this[i].on.src     = "";
		this[i].off.src    = "";
	}
	return this;
}

function setIsrc(which, off, on, active)
{
	tristate[which].off.src    = off;
	tristate[which].on.src     = on;
	tristate[which].active.src = active;
}

function setIsrcX(which, fname, triple)
{
	var pos, pos2, ext, name;

	pos  = fname.lastIndexOf(".");
	ext  = fname.substring(pos, fname.length);
	name = fname.substring(0, pos);
	pos2 = triple.indexOf(",", (pos = 0));
	tristate[which].off.src = name + triple.substring(pos, pos2) + ext;
	pos2 = triple.indexOf(",", (pos = ++pos2));
	tristate[which].on.src = name + triple.substring(pos, pos2) + ext;
	tristate[which].active.src = name + triple.substring(++pos2, triple.length) + ext;
}

function turnalloff(index)
{
	if (document.images)
	{
		for (var i=1; i<=anzahl; i++)
			if (i != index)
			{
			tristate[i].state = "on";
			changestate(i, "off");
			}
	}
}

function changestate(index, state)
{
	if (document.images) {
		if (index < 1)
			turnalloff(0)
		else {
			if ((tristate[index].state != state) && (tristate[index].state != "active")) {
				if (state == "active")
					turnalloff(index);
				eval("document['i" + index + "'].src = tristate[index]." + state + ".src");
				tristate[index].state = state;
			}
		}
	}
}


// MENÜPUNKT DER NAVIGATION AKTIVIEREN UND HEADLINE SETZEN

function nActivate() {

	// IMAGE-NR SETZEN
	switch(parent.cat) {
		case "about":
			var mtypo	= "1";
			var logo	= parent.cat;
			break;
		case "order":
			var mtypo	= "2";
			var logo	= parent.cat;
			break;
		case "licence":
			var mtypo	= "3";
			var logo	= parent.cat;
			break;
		case "products":
			var mtypo	= "4";
			var logo	= parent.cat;
			break;
		case "download":
			var mtypo	= "5";
			var logo	= parent.cat;
			break;
		case "contact":
			var mtypo	= "6";
			var logo	= parent.cat;
			break;
		default:
			var mtypo	= "0";
			var logo	= "about";
		break;
	}

	// MENÜPUNKT AKTIVIEREN
	if (parent.cat) {
		if ('document.i + mtypo') {
			changestate(mtypo, 'active');
		}
		if (mtypo == 0) {
			if ('document.i1') {
				changestate(mtypo, 'active');
			}
		}
	}

	// LOGO SETZEN
	if (document.logo) {
		document.logo.src = '../../s/header/logo.' + logo + '.gif';
	}
}