$(document).ready(function() {
	$("#linkadd h2 a").click(function(e) {
		e.preventDefault();
		if(!$(this).parents("#linkadd").find(".form").is(":visible"))
			$(this).parents("#linkadd").find(".form").slideDown("slow");
		else
			$(this).parents("#linkadd").find(".form").slideUp("slow");
	});
	
	$("#kommentare .kommentar h2").css('cursor','pointer').click(function(e) {
		
		var kommentar = $(this).parents(".kommentar");
		var text = kommentar.find('.detail');
		
		
		
		if(text.is(':visible')) {
			text.stop().slideUp("slow");
		}
		else {
			text.stop().slideDown("slow");
		}
	});
	
	if(self.location.href.indexOf('scrollDown=true')!=-1) {
		var scrollTop = $("#kommentare").offset().top;
		$("body").scrollTop(scrollTop);
	}
});
