// JavaScript Document
$(document).ready(function()
{
	
	
	$(".listed_menu li.open").attr("isopen","false");
	
	var numsteps=$(".listed_menu").size();
	var numopen=$(".open").size();
	
	
	if( numopen==1){
		return;
	}
		$(".listed_menu").each(				   
			function (){
				var numopen=$(this).find(".open").size();
				if(numopen>0){
					$(this).find(".mp:not(.open)").hide();
				}	
			}
		);
	

	
	var config={
		sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)    
    	interval: 100, // number = milliseconds for onMouseOver polling interval    
     	over: openmenu, // function = onMouseOver callback (REQUIRED)    
     	timeout: 0, // number = milliseconds delay before onMouseOut    
     	out: nofunction // function = onMouseOut callback (REQUIRED)    
	}
	
	$("li.open").hoverIntent(config);
	
	var config={
		sensitivity: 3, // number = sensitivity threshold (must be 1 or higher)    
    	interval: 0, // number = milliseconds for onMouseOver polling interval    
     	over: nofunction, // function = onMouseOver callback (REQUIRED)    
     	timeout: 500, // number = milliseconds delay before onMouseOut    
     	out: closemenu // function = onMouseOut callback (REQUIRED)    
	}
	
	
	$(".listed_menu").hoverIntent(config);
	
	
	function openmenu(e){
		if($(this).attr("isopen")=="true"){
			$(this).attr("isopen", "false");
		
		}else{
	
			e.preventDefault();
			$(this).attr("isopen","true");
			$(this).parents(".listed_menu").find(".mp:not(.open)").show(200);
		}
	}
	
	function closemenu(e){	
		
		$(this).each(				   
			function (){
				var numopen=$(this).find(".open").size();
				if(numopen>0){
					$(this).find(".mp.open").attr("isopen","false");
					$(this).find(".mp:not(.open)").hide(200);
				}	
			});
	
	}
	
	function nofunction(e){
	
	}
	
});


// BILDNAVIGATION FUNKTIONEN

$(document).ready(function()
{
	$('.medianavi_elm').click(function(e)
	{
		e.preventDefault();
		$('.mediabig img').attr('url',$(this).attr('bigurl'));
	
	});
 	
});




$(document).ready(function()
{
  $(".toggle_body").hide();
 // $(".toggle_body_show").show();
  $(".toggle_head" ).click(function(e)
  {
  	e.preventDefault();
	$("body").scrollTo($(this),{duration:500});
	$(this).next(".toggle_body").toggle('blind',{direction:'vertical'},100);		
  }); 
});