if(hidecontrols==null){var hidecontrols=false;};

var count=1;
var DHTMLSupport = false;
var old = null;
var leftstart = 0;
var MLeft=0;
var MWidth=0;
var MBottom=0;

if(document.all){DHTMLSupport = true;};



function CleanMenus(e){
	var x = window.event.clientX;
	var y = window.event.clientY;
	if ((x > MWidth || x < MLeft) && (y>30)) HideMenu();
	else if (y > MBottom) HideMenu();
	return true;
}

function resizemenus(){
	divColl=document.all.tags("DIV");
        leftstart=(document.body.clientWidth-622) / 2;
	for(i=0;i<divColl.length;i++){whichEl=divColl(i);if(whichEl.className=="submenu"){positionmenu(whichEl)};};
	return false;
}; 


function hide_controls(){
	if(DHTMLSupport&&hidecontrols)
	{
		divColl=document.all.tags("DIV");
		for(i=0;i<divColl.length;i++){whichEl=divColl(i);if(whichEl.className=="hideme"){whichEl.style.visibility="hidden";};};
	};
	return false;
};

function show_controls(){
	if(DHTMLSupport)
	{
		divColl=document.all.tags("DIV");
		for(i=0;i<divColl.length;i++){whichEl=divColl(i);if(whichEl.className=="hideme"){whichEl.style.visibility="visible";};};
	};
	return false;
};

function positionmenu(x)
{
	if(DHTMLSupport)
	{
		x.style.pixelLeft=leftstart;
		if(x.id.substr(1)=="1"){leftstart+=150;}else
		if(x.id.substr(1)=="2"){leftstart+=132;}else
		if(x.id.substr(1)=="3"){leftstart+=78;}else
		if(x.id.substr(1)=="4"){leftstart+=133;}else
		if(x.id.substr(1)=="5"){leftstart+=95;};
	};
	return false;
};

function doresize()
{
	resizemenus();
	return false;
}

function show_menu(x)
{
	if(DHTMLSupport){
		document.all[x].style.visibility="visible";
		MLeft  = document.all[x].style.posLeft-5;
		MWidth = MLeft + document.all[x].offsetWidth+10;
		MBottom = document.all[x].style.posTop+document.all[x].offsetHeight+25;
		hide_controls();
	};
	return false;
}

function hide_menu(x)
{
	if(DHTMLSupport){
		document.all[x].style.visibility="hidden";
		MLeft=0;
		MWidth=0;
		MBottom=0;
		show_controls();
	};
return false;
}

function do_check(x)
{
	if(DHTMLSupport){
		if(old!=x)
		{
			if(old){hide_menu(old);}
			show_menu(x);
			old=x;
		}
	};
	return false;
}

function HideMenu()
{
	if(old){hide_menu(old);}
	old=null;
	return false;
}

function beginMenu()
{
	document.write("<div id=\"x"+count+"\" class=\"submenu\">");
	document.write("<table class=\"menupopup\">");			
}

function addSubMenu(Adresse,Titel)
{		
	document.write("<tr><td><a class=\"subpunkt\" href=\""+Adresse+"\">"+Titel+"</a></td></tr>");
}

function endMenu()
{
 document.write("</table></div>");
 count=count+1;
};

if (DHTMLSupport)
{
beginMenu();
addSubMenu("/01/news.php","News");
document.write("<tr><td><hr></td></tr>");
addSubMenu("/01/kalender","Kalender");
endMenu();

beginMenu();
addSubMenu("/02/fsr2011.php","Wer wir sind");
addSubMenu("/02/waswirmachen.php","Was wir machen");
addSubMenu("/02/angebot.php","Unser Angebot");
document.write("<tr><td><hr></td></tr>");
addSubMenu("/02/gallery/","Veranstaltungsrückblick / Bilder");
endMenu();

beginMenu();
addSubMenu("/03/ersti.php","Erstsemester");
addSubMenu("/03/anfaengeruebung.php","Anf&auml;nger&uuml;bung");
addSubMenu("/03/zwischenpruefung.php","Zwischenpr&uuml;fung");
addSubMenu("/03/grosserschein.php","Gro&szlig;er Schein");
addSubMenu("/03/schwerpunkte.php","Schwerpunktbereiche");
addSubMenu("/03/grundlagenschein.php","Grundlagenschein");
addSubMenu("/03/seminarschein.php","Seminarschein");
addSubMenu("/03/schluesselqualifikationen.php","Schl&uuml;sselqualifikationen");
addSubMenu("/03/fremdsprachen.php","Fremdsprachen-Nachweis");
addSubMenu("/03/praktikum.php","Praktikum");
document.write("<tr><td><hr></td></tr>");
addSubMenu("/03/hausarbeit.php","Hausarbeit");
document.write("<tr><td><hr></td></tr>");
addSubMenu("/03/ffa.php","FFA");
document.write("<tr><td><hr></td></tr>");
addSubMenu("/03/examen.php","Examen");
document.write("<tr><td><hr></td></tr>");
addSubMenu("/03/referendariat.php","Referendariat");
document.write("<tr><td><hr></td></tr>");
addSubMenu("/03/promotion.php","Promotion");
document.write("<tr><td><hr></td></tr>");
addSubMenu("/03/reform.php","Reform");
addSubMenu("/03/petition.php","Petition");
document.write("<tr><td><hr></td></tr>");
addSubMenu("/03/japo.php","JAPO");
document.write("<tr><td><hr></td></tr>");
addSubMenu("/03/bib.php","Bibliothek");

endMenu();

beginMenu();
addSubMenu("/04/lpa.php","Landesprüfungsamt");
document.write("<tr><td><hr></td></tr>");
addSubMenu("/04/fb5.php","Prüfungsamt des Fachbereichs V");
document.write("<tr><td><hr></td></tr>");
addSubMenu("/04/gremien.php","Gremien");
endMenu();

beginMenu();
endMenu();

beginMenu();
endMenu();

document.body.onscroll=HideMenu;
document.body.onmousemove=CleanMenus;
resizemenus();
};
document.body.onresize="doresize()"
