function areanavobject() {

this.init = function(objid) {
	var submenuObjListe = document.getElementById(objid).getElementsByTagName('LI');
	for(var i=0; i<submenuObjListe.length; i++)
	{
		var subobj = submenuObjListe[i];
		
		if ((subobj.className.replace(/ active/, '') == 'submenu') || (subobj.className.replace(/active/, '') == 'submenu trenner'))
		{
			subobj.onmouseover = function showsubmenu (e) {
				if (!e) e = window.event;
	
				if (this.className.replace(/active/, '') == 'submenu trenner')
				{
					this.style.background = "url('img/submenutrenner_bg.png') no-repeat #be965b";
				}
				else
				{
					this.style.background = "url('img/submenu_bg.png') no-repeat #be965b";
				}
				
				var nexta = this.getElementsByTagName('A');
				nexta[0].style.background = "url('img/submenu_bg_ende.png') no-repeat right top";
	
				var liste = this.getElementsByTagName('DIV');
				for (var i=0; i<liste.length; i++)
				{
					if (liste[i].className == 'submenucontainer')
					{
						liste[i].style.display = 'block';
					}
				}
			}
	
			subobj.onmouseout = function showsubmenu (e) {
				if (!e) e = window.event;
	
	
				//this.className = str;
				if ((this.className != 'submenu active') && (this.className != 'submenu trenneractive'))
				{
					this.style.background = 'none';
					var nexta = this.getElementsByTagName('A');
					nexta[0].style.background = "none";
				}
	
	
				var liste = this.getElementsByTagName('DIV');
				for (var i=0; i<liste.length; i++)
				{
					if (liste[i].className == 'submenucontainer')
					{
						liste[i].style.display = 'none';
					}
				}
			}
		}
		
	}
	
	var menuObjListe = document.getElementById('areanav').getElementsByTagName('LI');
	for(var i=0; i<menuObjListe.length; i++)
	{
		var obj = menuObjListe[i];
		
		
		if ((obj.className == 'menu') || (obj.className == 'menu active'))
		{
		
			obj.onmouseover = function showmenu (e) {
				if (!e) e = window.event;
	
				var liste = this.getElementsByTagName('DIV');
				var aktiveMenu = null;
				for (var i=0; i<liste.length; i++)
				{
					if (liste[i].className == 'unternavi')
					{
						aktiveMenu = liste[i];
					}
				}
				
				var tmp = document.getElementById('areanav').getElementsByTagName('A');
				for (var i=0; i<tmp.length; i++)
				{
					if (tmp[i].className == 'areabutton active')
					{
						tmp[i].className = 'areabutton';
					}
				}

				var nexta = this.getElementsByTagName('A')[0];
				nexta.className += ' active';
	
				var tmp = document.getElementById('areanav').getElementsByTagName('DIV');
				for (var i=0; i<tmp.length; i++)
				{
					if (tmp[i].className == 'unternavi')
					{
						if ((tmp[i] != aktiveMenu) && (tmp[i].style.display != 'none'))
						{
							tmp[i].style.display = 'none';
						}
					}
				}
				
				var tmp = document.getElementById('areanav').getElementsByTagName('li');
				for (var i=0; i<tmp.length; i++)
				{
					if (tmp[i].className == 'menu')
					{
							tmp[i].style.backgroundColor = "#ffffff";
					}
				}
				if (this.className != 'menu active') this.style.backgroundColor = "#d9bea0";
	
				
				if (aktiveMenu)
				{
					if (aktiveMenu.style.display != 'block')
					{
						aktiveMenu.style.display = 'block';
					}
				}
			}
	
		}
	
	}
	
	} // init


} // class









function switch_frame() {
var switch_container = '';
var switch_akt = 0;
var switch_auto = 0;
var switch_time_interval = 0;
var switch_label_arr = new Array();
var switch_content_arr = new Array();
var switch_text_arr = new Array();
var myInstanceName = '';
var fadeAktiv = 0;

this.init = function(DivName,InstanceName, timeIVal) {

 myInstanceName = InstanceName;
 switch_container = DivName;
 switch_akt = 0;
 switch_auto = 1;
 
 var labellist = document.getElementById(switch_container).getElementsByTagName('DIV');
 var lnr = 0;
	for(var i=0; i<labellist.length; i++)
	{
		if ((labellist[i].className == 'switchcontentcontainer') || (labellist[i].className == 'switchcontentcontainer visibleblock'))
		{
			var labelobj = labellist[i].getElementsByTagName('SPAN')[0];
			if (labelobj.className == 'nofade')
			{
				labellist[i].setAttribute('switchfade', 'nofade');
			}
			var labelstr = labelobj.innerHTML;
			switch_label_arr[lnr] = labelstr;
			labellist[i].id = switch_container+lnr;
			lnr++;
		}
	} 
 switch_setLabel(switch_akt);
 if (timeIVal > 0)
 {
 	switch_auto = 1;
	switch_time_interval = timeIVal;
 	window.setTimeout(myInstanceName+'.switch_rotate()', switch_time_interval);
 }
	
}


function switch_setLabel(nr)
{
	var sw_label;
	var sw_list = document.getElementById(switch_container).getElementsByTagName('DIV');
	for(var i=0; i<sw_list.length; i++)
	{
		if (sw_list[i].className == 'switchlabel')
		{
			sw_label = sw_list[i];
		}
	}


	var str = '';
	for(var i=0; i<switch_label_arr.length; i++)
	{
		var li_class = '';
		if (i == nr)
		{
			li_class = " class='aktiv'";
		}
		str += '<li'+li_class+'><a href="javascript:'+myInstanceName+'.switch_click('+i+');">'+switch_label_arr[i]+'</a></li>';
	}	
	sw_label.innerHTML = '<ul>'+str+'</ul>';
}


this.faderDiv = function (divid, fout, w)
{
	var zeit=(new Date()).getTime();
	document.getElementById(divid).style.opacity = w;
	document.getElementById(divid).style.filter = 'alpha(opacity='+(w*100)+')';
	
	document.getElementById(fout).style.opacity = 1-w;
	document.getElementById(fout).style.filter = 'alpha(opacity='+((1-w)*100)+')';
	
	if (w < 1)
	{
		window.setTimeout(myInstanceName+'.faderDiv(\''+divid+'\',\''+fout+'\','+(w+0.20)+')',50);	
	}
	else
	{
		document.getElementById(fout).className = 'switchcontentcontainer';
		fadeAktiv = 0;
	}
}


function switch_update(nr)
{
		var sw_content;
		var sw_text;
		var sw_label;


		if (fadeAktiv == 1)
		{
			return;
		}

		var labellist = document.getElementById(switch_container).getElementsByTagName('DIV');
		var lnr = 0;
		var fadeout = '';
		var fademode = 1;

		for(var i=0; i<labellist.length; i++)
		{
			if (labellist[i].className == 'switchcontentcontainer visibleblock')
			{
				fadeout = labellist[i].id;
				if (labellist[i].getAttribute('switchfade') == 'nofade')
				{
					fademode = 0;
				}
			}
		} 


		for(var i=0; i<labellist.length; i++)
		{
			if ((labellist[i].className == 'switchcontentcontainer') || (labellist[i].className == 'switchcontentcontainer visibleblock'))
			{
				if (lnr == nr)
				{
					if ((labellist[i].id != fadeout) && (fadeAktiv == 0))	{
						labellist[i].className = 'switchcontentcontainer visibleblock';

						if (labellist[i].getAttribute('switchfade') == 'nofade')
						{
							fademode = 0;
						}



						if (fademode == 1)
						{
							labellist[i].style.opacity = 0;
							labellist[i].style.filter = 'alpha(opacity=0)';
							fadeAktiv = 1;
							window.setTimeout(myInstanceName+'.faderDiv(\''+labellist[i].id+'\',\''+fadeout+'\',0.2)',50);
						}
						else
						{
							labellist[i].style.opacity = 100;
							labellist[i].style.filter = 'alpha(opacity=100)';
							document.getElementById(fadeout).className = 'switchcontentcontainer';
						}
					}

				}
				
				lnr++;
				
			}
		} 

		switch_setLabel(nr);
}


this.switch_click = function(nr)
{
	switch_auto = 0;
	switch_akt = nr;
	switch_update(switch_akt);
}


this.switch_rotate = function()
{
	if (switch_auto == 1)
	{
		switch_akt++;
		if (switch_akt >= switch_label_arr.length)
		{
			switch_akt = 0;
		}
		
		switch_update(switch_akt);
		window.setTimeout(myInstanceName+'.switch_rotate()', switch_time_interval);
	}
	else
	{
		
	}
}



} // class



