/* SpezialNavigation fuer Spital Maennedorf
2007, wwww.backslash.ch
*/
function initBreakNav(){
	var cntLines = 0, maxlength = 24, row = 1;
	$("#navi_3 li").each(function(i){
		var chars = $(this).children("a")[0].innerHTML.length;
		var lastLines = cntLines;
		cntLines ++;
		if(chars > maxlength){
			if(chars > (maxlength * 2)){
				cntLines +=2;
				}
			else{
				cntLines ++;
				}
			}
		if( ((cntLines / perRow) ) > row){
			row++;
			$(this).addClass("reset_"+getResetClass(lastLines));
			}
		$(this).addClass("spalte_" + row);
		}
		);
	dspDiv('navi_3','block');
	}


function getResetClass(lines){
	while(lines > perRow){
		lines -= perRow; 
		}
	return lines; 
	}
	
addLoadEvent(initBreakNav);


function setInfo(){
	var hasInfo = false;
	$("h5").each(function(i){
		hasInfo = true				  
		}
		);
	if(hasInfo){
		dspDiv("info","block");
		}
	}
function toggleInfo(obj){
	$("h5").toggle();
	obj.blur();
	}
addLoadEvent(setInfo);