// 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(mtypo, head) {

	// MENÜPUNKT AKTIVIEREN
	if (parent) {
		if ('parent.document.i + mtypo') {
			parent.changestate(mtypo, 'active');
		}
		if (mtypo == 0) {
			if ('parent.document.i1') {
				parent.changestate(mtypo, 'active');
			}
		}
	}

	// HEADLINE SETZEN
	if (parent) {
		if (parent.document.head) {
			parent.document.head.src = 'de/' + head + '/head.gif';
		}
	}

}
