$(document).ready(function() {
	
	$("#faq-1").fadeIn();
	
   $('a.faq').click(function(event) {
       $("#box-antwort div").hide();
       $($(this).attr("href")).fadeIn(800);
	   event.preventDefault();
    });
	
   $('#alle-fragen').toggle(function() {
		  $("#box-antwort div").fadeIn(800);
		  $('#alle-fragen').text('Fragen schließen');
		}, function() {
		  $("#box-antwort div").hide();
		  $("#faq-1").show();
		  $('#alle-fragen').text('Alle Fragen');		  
	});
	
   $('a.tools').click(function(event) {
	   
	   var tool_selected = $(this).attr('hash');
	   var tool_source = $(this).attr('rel');
	   	   
	   if($(tool_selected + " iframe").attr("src") == "") {
		   $(tool_selected + " iframe").attr("src", tool_source);
	   }
	   	   
       $("div.tools").hide();
	   $("a.tools").removeClass('current');
	   $(this).addClass('current');
       $($(this).attr("href")).fadeIn(800);
	   $('#tools a.close').show();
	   $('html, body').animate({ scrollTop: $("#tools").offset().top }, 500);
	   event.preventDefault();
    });
	
	$('#tools a.close').click(function(event) {
		$(this).hide();
       $("div.tools").hide();
	   $("a.tools").removeClass('current');	   
	   event.preventDefault();
    });	
	
	
   $('#verisign-link').toggle(function() {
		  $("#verisign").fadeIn("fast");
		}, function() {
		  $("#verisign").fadeOut("fast");
	});	

	if($("#fragen-slider").length > 0) {
		$("#fragen-slider").easySlider({
			auto: false,
			continuous: true,
			prevText: 	'',
			nextText: 	''	
		});
	}
	
	// menu
	
	$('#submenu-link').click(function() {
		$('#submenu').toggle();	
	});
	
});
	function openverisign() {
	window.open('https://trustsealinfo.verisign.com/splash?form_file=fdf/splash.fdf&dn=baufinanzierung-vergleich24.de&lang=de', 'Verisign', 'width=540,height=300,resizable=yes');
	}
