/*******************************************************
 *******************************************************
 
	KHN-Menu
 
 *******************************************************
 */ function ____KHNMenu________() {} /*
 *******************************************************/	
 
 OnLoadFunctions[OnLoadFunctions.length] = "checkForum();";
 
 
 function checkForum() {
	
	if(!document.getElementById('search_for')) return false;
	
	var el_foren = document.getElementById('search_for');
	if(document.getElementById('forum_spec') && document.getElementById('forum_spec').value.length > 0) {
		var reg = 'einzel';
		var contentlocation = location.href;
		var found = contentlocation.match(reg);
		if(found) var act_forum = 'all';
		else var act_forum = document.getElementById('forum_spec').value;
	} else var act_forum = 'all';
	
	ifidx=0;
	if(act_forum == 'all') {
		el_foren.options.length = null;
		el_foren.options[ifidx++] = new Option('In allen Foren','all',true,true);
		if(rm && rm == 'csfu') el_foren.options[ifidx++] = new Option('- nach Autor','user',false,false);
	} else {
		el_foren.options.length = null;
		el_foren.options[ifidx++] = new Option('In allen Foren','all',false,false);
		//el_foren.options[ifidx++] = new Option('- nach Inhalt','all',false,false);
		if(rm && rm == 'csfu') el_foren.options[ifidx++] = new Option('- nach Autor','user',false,false);
		el_foren.options[ifidx++] = new Option('Hier im Forum','here',false,true);
		//el_foren.options[ifidx++] = new Option('- nach Inhalt','here',false,false);
		if(rm && rm == 'csfu') el_foren.options[ifidx++] = new Option('- nach Autor','userhere',false,false);
	}

	document.getElementById('search_forum_sid').value = act_forum;
	addSmartEvent(document.getElementById('search_phrase'),'keypress',forumSearch);
}

function forumSearch(event) {
	// check if return is pressed
	if (event.keyCode != 13) return; 
	//document.forms[0].action = '/suche';
	document.forms[0].target = '_self';
	document.forms[0].action = '/suche';
	document.forms[0].onsubmit(); // workaround browser bugs.
	document.forms[0].submit();	
	//setActionAndSubmit('/suche','_self');
}

r_el = false;
function openSubmenu(event,id,prefix) {
	
	if(!document.getElementById(id)) return false;
	
	//folderTree(id);
	
	if(prefix && prefix.length > 0) prefix = '_'+prefix;
	else prefix = '';

	if(document.getElementById(id).style.display == 'none') {
		document.getElementById(id).style.display = 'block';
		SwapImage("arrow_"+id,"/images/icons/arrow_down"+prefix+".gif");
	} else {
		document.getElementById(id).style.display = 'none';
		SwapImage("arrow_"+id,"/images/icons/arrow_right"+prefix+".gif");
	}

	t_el = getEventTarget(event);
	submenu = document.getElementById(id);
	/*if(submenu.style.display == 'none') t_el.className = '';
	else t_el.className = 'active';*/
	t_el.blur();
}

var activeOverview = "1";
function activateOverview(activate) {
	if (activate == activeOverview) return;
	
	myActiveLink = document.getElementById('link_'+activeOverview);
	myActiveLink.className = '';
	myActiveInfoLayer = document.getElementById('infoid_'+activeOverview);
	myActiveInfoLayer.style.display = 'none';
	
	myLink = document.getElementById('link_'+activate);
	myLink.className = 'highlight';
	myInfoLayer = document.getElementById('infoid_'+activate);
	myInfoLayer.style.display = 'block';

	activeOverview = activate;
}









