$(document).ready(function(){
	$("#hauptnavigation > ul > li").hover(function(){
			$("ul.klappbox").not($(this).children("ul.klappbox")).slideUp("fast");
			$(this).stopTime("slideUp");
			$(this).oneTime(250, "slideDown", function() {
				$(this).children("ul.klappbox").slideDown("fast");
			});
		},function(){
			$(this).stopTime("slideDown");
			$(this).oneTime(500, "slideUp", function() {
				$(this).children("ul.klappbox").slideUp("fast");
			});
		}
	);
 
	$("#hauptnavigation > ul > li > a").focus(function(){
			$("ul.klappbox").hide();
			$(this).next("ul.klappbox").show();
		}
	);
	$("#logo > #bildschirm > a").focus(function(){
			$("ul.klappbox").hide();
		}
	);
	
	$(document.body).click(function(){
		$("ul.klappbox").slideUp("fast");
	});
});

function oeffneFenster(adresse,fenster,breite,hoehe,optionen){
	var scrollbars=false;
	if(breite > screen.availWidth){
		breite=screen.availWidth;
		scrollbars=true;
	}
	if(hoehe > screen.availHeight){
		hoehe=screen.availHeight;
		scrollbars=true;
	}	
	if(scrollbars)  optionen+=",scrollbars=yes";
	else  optionen+=",scrollbars=no";
	
	fenster = window.open(adresse,fenster,"width="+breite+",height="+hoehe+","+optionen);
	fenster.focus();
}

