
 menu_active= 0;

 function menu_init(nr)
 {
	if (nr != 0)
	{
		menu_active= nr;
		menu(nr);
	}
 }

 function menu(nr)
 {
	for (x=1;x<=3;x++)
	{
		element= _element('menu-'+x);
		element.className= clearClassName(element.className);
		if (x == nr || (nr == 0 && x == menu_active)) element.className+= ' active';
		else if (nr != 0 || (nr == 0 && menu_active != 0)) element.className+= ' small';
	}
 }



 function clearClassName(name)
 {
	new_name= '';
	name_array= name.split(' ');

	bad_array= new Array('',' ','active','small');

	for (i=0;i<name_array.length;i++)
	{
		if (!_in_array(bad_array,name_array[i])) new_name+= ' '+name_array[i];
	}

	return new_name;
 }




 function mail(account)
 {
	document.location.href= 'mailto:'+account+'@'+'familienzentrum-thiess.de';
 }



 function _clean_att(att)
 {
	if (att.substr(att.length-2,2)=='px') return att.substr(0,att.length-2);
	else return att;
 }



 function _element(element)
 {
	return document.getElementById(element);
 }


 function _in_array(a,e)
 {
	for (j=0;j<a.length;j++)
	{
		if (a[j] == e) return true;
	}
	return false
 }
