$(document).ready(function() {
	r=document.getElementById('submenu').childNodes.length;
	
	//bilder diashow bei mehr als einem bild
	$('#dias').cycle({ 
		fx:	'scrollLeft',
		click:	'#dias',
		timeout:	0,
		easing:	'backinout'
	});

	//subnavi nach timeout verstecken, wenn maus nich ueber der navi hovert
	bindrin=0;
	$('div.subnav').mouseover(function(){bindrin=1;}).mouseout(function(){ });
	window.setTimeout("naviInitial()", 3500);
	 
	//supernav ist der hovercontainer der navi und subnavi umspannt
	if ($('div.supernav').hoverIntent){
		if (r > 3) {
			$('div.supernav').hoverIntent({
				sensitivity: 1,
				interval: 10,
				over: naviRaus,
				timeout: 200,
				out: naviRein
			});
		}else{
			$("div.subnav").hide();
			$('div.supernav').hoverIntent({
				sensitivity: 3,
				interval: 250,
				over: null ,
				timeout: 500,
				out: null
			});
		}
	} 	
	
	//das #spalter div in 2 zeilen spalten
	$(function(){
		$('#spalter').columnize();
	});
});

//die eigentlichen rein und raus Funktionen
function naviRaus() {$('div.subnav').fadeIn(300); }	
function naviRein() {$('div.subnav').fadeOut(500);aktuelles();hideAll();}
function naviInitial() { if (!bindrin){naviRein();}}

