$(document).ready(function(){
	
	
	

	//hauptnav	

	 function addMega(){
        $(this).addClass("hovering");
        }
 
      function removeMega(){
        $(this).removeClass("hovering");
        }
 
    var megaConfig = {
         interval: 0,
         sensitivity: 4,
         over: addMega,
         timeout: 0,
         out: removeMega
    };
 
    $("li.mega").hoverIntent(megaConfig)

 //teaser tabelle
 
 	//$("div.teaser:odd").css("background-color", "#f0f0f0");
 
 	$("div.teaser tr:first").addClass("zimmer");
	$("div.teaser tr:nth-child(2)").addClass("flaeche");
	$("div.teaser tr:nth-child(3)").addClass("preis");
	//Objektsortierung
	 $(".dropdown img.flag").addClass("flagvisibility");

            $(".dropdown dt a").click(function() {
                $(".dropdown dd ul").toggle();
            });
                        
            $(".dropdown dd ul li a").click(function() {
                var text = $(this).html();
                $(".dropdown dt a span").html(text);
                $(".dropdown dd ul").hide();
                //$("#result").html("Selected value is: " + getSelectedValue("sample"));
            });
                        
            function getSelectedValue(id) {
                return $("#" + id).find("dt a span.value").html();
            }

            $(document).bind('click', function(e) {
                var $clicked = $(e.target);
                if (! $clicked.parents().hasClass("dropdown"))
                    $(".dropdown dd ul").hide();
            });

	//direktanfrage
	
	if (document.getElementById('Fehler')){ 
 		$("#form").show();  
	}
	else {
		$("#form").hide();   
	}	


	//$("#form").show(); 
	
	
	$(".open").click(function(){
		$("#form").slideToggle("fast");
		$(this).toggleClass("close"); 
		return false;
	});
		
		
		$(".teaser_st:first").css('margin-left', '20px');
		$(".fcol:first").addClass("footer_bw");
		$(".fcol:last").addClass("right");
	
	
	
	
	
	
});
