$(document).ready(function(){
	
	
	
	
	//hauptnav	

	 function addMega(){
        $(this).addClass("hovering");
        }
 
      function removeMega(){
        $(this).removeClass("hovering");
        }
 
    var megaConfig = {
         interval: 0,
         sensitivity: 7,
         over: addMega,
         timeout: 100,
         out: removeMega
    };
 
    $("li.mega").hoverIntent(megaConfig)
	
	//direktanfrage
	
	if (document.getElementById('Fehler')){ 
 		$("#form").show();  
	}
	else {
		$("#form").hide();   
	}	


	$("#form").hide(); 
	
	
	$(".open").click(function(){
		$("#form").slideToggle("medium");
		$(this).toggleClass("close"); 
		return false;
	});
	
	
	//sidebar
	
	$('#sidebar>div.sb_content:first').addClass("blau");	
	
	$('body#objekt #sidebar>div.sb_content:first').removeClass("blau");
	
	/*$('.nb_liste>div:nth-child(5n+2)').css("margin-right", "0");*/
	$('#content>div.teaser_nb:nth-child(4n+6)').addClass("none");	
	$('#content>div.teaser:nth-child(2n+1)').addClass("none_bg");
	$('#content>div.hp_efh>div.teaser_hp:nth-child(3n)').addClass("rand");
	$('#content>div.hp_dhh>div.teaser_hp:nth-child(3n)').addClass("rand");
	$('#content>p.referenz:nth-child(4n+3)').addClass("rand_ref");
	
	$('body#neubaugebiet table td:nth-child(1)').addClass("nr");
	
	
	
	
	
	
	
	// Footer
	$("#footer2").hide(); 
	$(".open_footer2").click(function(){
		$("#footer2").slideToggle("medium");
		$("#footer2").addClass("relative");
		$(this).toggleClass("close_footer2"); 
		return false;
	});
	
	
});



