$(function() {

    /* fetch link from image inside tile
     * and open it no matter where clicking on the tile
     *
     * depends on layout defined in "paragraph_kachel.htm"
     */
    $('[id^=kachel] .item')
      .css({cursor:'pointer'})
      .click(function(){
               var location = $(this).find('.img_large a[href]').attr('href');
               window.location = location;
               return false;
             })
      .hover(function(){
               var location = $(this).find('.img_large a[href]').attr('href');
               window.status = location
             },
             function(){
               window.status = '';
             });

    //Pragraphen ein- und ausblenden
    $(".toggle_parent").css("height", "90px");
    $(".toggle, .toggle_klein").css("display", "none");

	$(".toggle_parent").click(function () {
        $(this).siblings(".toggle:first").toggle();
    });
	$(".toggle_button_klein").click(function () {
        $(this).parent(".toggle_parent_klein").siblings(".toggle_klein:first").toggle();
    });	
    
	$(".toggle_parent").toggle(
		function () {
			$(this).css("height", "91px");
			$(this).children(".toggle_button").addClass("active");
			$(this).children(".toggle_button").html("Details ausblenden");
		},
		function () {
			$(this).css("height", "90px");
			$(this).children(".toggle_button").removeClass("active");
			$(this).children(".toggle_button").html("Details einblenden");
		}
	);
	$(".toggle_button_klein").toggle(
		function () {
			$(this).addClass("active");
			$(this).html("Details ausblenden");
		},
		function () {
			$(this).removeClass("active");
			$(this).html("Details einblenden");
		}
	);	
	

	$("#MarketingPlanerLogin").children(":first").next().toggle(
		function(){
          	$(".MarketingPlanerLogin_Form").show("slow")
        	    $(this).removeClass("MarketingPlanerLogin_Image").addClass("MarketingPlanerLogin_Sent")    	
        	  },
	 	function(){
	 		check_register_form() 
            $(".MarketingPlanerLogin_Form").hide("slow")
	        $(this).removeClass("MarketingPlanerLogin_Sent").addClass("MarketingPlanerLogin_Image")   			    		
	    }
    );	
});