
jQuery(function($){
	$('#anfragebutton a').click(function(){
		$('#contactswindow').toggle();
		$('#anfragebutton a').toggleClass('opened');
	});
	
	if ($('h2.toggle').length > 0) {
		$('h2.toggle').next().hide();
		$('#content h2.toggle:first').addClass('active').next().show();
		$('h2.toggle').prepend('<img src="fileadmin/images/clear.gif" />').css('cursor', 'pointer').click(function(){
			if (!$(this).hasClass('active')) {
				$('h2.active').removeClass('active').next().hide();
				$(this).addClass('active').next().show();
				var top = $(this).offset().top;
				$('html, body').animate({scrollTop:top}, 0);
			} else {
				$('h2.active').removeClass('active').next().hide();
			}
		});
		
	}
	
	if($('table.subnav').html()!='') {
		$('table.subnav td:not(.image) a').each(function(){
			var href = this.href;
			$(this).parent().css('cursor', 'pointer').click(function(){
				window.location = href;
			}).next().css('cursor', 'pointer').click(function(){
				window.location = href;
			});
		});
	}
});
