


jQuery(function(){
	
	// preloader
	/* nicht benötigt
	var folder = "medien/";
	var arrPreBilder = new Array(
			"ausbildungsstoerer_hover.png"
	);
	
	jQuery.each(arrPreBilder, function(key, value) { 
		var preloaded_image = $('<img />').attr('src', folder + value);
	});
	*/
	

	/* ### taster ### */
	
	var $link = "";
	var $backColor = "#f2f5f6";
	var $hoverBackColor = "#fbfcfc";
	
	
	jQuery("div.taster").css("cursor", "pointer").find("a:last").hide();
		
	jQuery("div.taster").hover(function(){
		var $link = jQuery(this).find("a");
		var $link = $link[$link.length - 1];
		
		var $originBorderColor = jQuery(this).css("color");
		
		// hintergrund animation
		jQuery(this).stop().animate({
		
			backgroundColor: $hoverBackColor

		}, 200);
		
		// balken animation
		jQuery(this).find(".balken:first").stop().animate({
		
			height: "15px"

		}, 200);
		
		// link animation
		jQuery(this).find("a:last").stop().show().animate({
		
			width: "100px"

		}, 200);
		
		//jQuery(this).find(".balken:first").stop().animate({ borderTopColor: "#FFF", }, 1000);

	},function(){
		jQuery(this).stop().animate({
		
			backgroundColor: $backColor

		}, 600);
		
		// balken animation
		jQuery(this).find(".balken:first").stop().animate({
		
			height: "0px"

		}, 600);
		
		// link animation
		jQuery(this).find("a:last").stop().animate({
		
			width: "0"

		}, 600, function() {
			jQuery(this).hide();
		});
		
	}).unbind("click").click(function(event){
	
		var $link = jQuery(this).find("a");
		var $link = $link[$link.length - 1];
		
		// link setzen
		window.location.href = $link;
		event.preventDefault();

	});



	/* ## Höhe angleichen ## */
	
	jQuery(".sh_group").each(function()
	{
		var curElem = jQuery(this);
		curElem.css({"display" : "block"});
		
		var maxheight = 0;
		var lastElem;
		var count = 0;
		curElem.find(".sameheight").each(function() {
			
			if(jQuery(this).height() > maxheight) {
				
				maxheight = jQuery(this).height();
			}
			
		});
		
		curElem.find(".sameheight").css({"height" : maxheight});
		
		// spezielle kaltner-group-site anpassung:
		curElem.find(".sameheight").css({"height" : maxheight});
		
		curElem.removeAttr("style");
	});
	
	
	/* ## störer ## */
	
	jQuery("div.stoerer").hover(function(){
				
		// balken animation
		jQuery(this).find("img.hover").show().stop().animate({
		
			opacity: "1"

		}, 200);
				
	},function(){
		
		// balken animation
		$stoererHover = jQuery(this).find("img.hover");
		$stoererHover.stop().animate({
		
			opacity: "0"

		}, 800, function() {
			$stoererHover.hide();
		});
	});

});


