$(document).ready(
	function(){
		/**
		Elemente im Eyecatcher
		*/
			$("#stripe1").show().fadeTo(0, 0.6);
			$("#stripe2").show().fadeTo(0, 0.8);
			
		
		/**
		Leere TD fuellen
		$("td:empty") als Selektor funktioniert nicht (wohl wegen fehlendem trim()?)
		*/
		//$("td").each(function () { if ($(this).html().trim() == "") $(this).html("&nbsp;"); });
	}
);




/**
Allgemeine Funktionen zur Unterstuetzung [START]
*/

var fx = {
	speed: {
		down: 500,
		up: 200,
		fadeOut: 200,
		fadeIn: 200
	},
	
	selector: {
		act: "act"
	},
	
	/**
	Testet, ob eine Zielhoehe unterschritten wird und setzt beim Unterschreiten diese Hoehe
	@param		string	objStr: jQuery-Objekt-String
	@param		number	destHeight: Hoehe
	*/
	minHeight: function (objStr, destHeight) {
		var obj = $(objStr);
		if (obj.length) if (obj.height() < destHeight) obj.height(destHeight);
	},
	
	
	/**
	Beim RollOver wird in ein Ziel-Objekt mit dem Quell-Objekt gefuellt - beim RollOut auf das Original gesetzt.
	*/
	toggleContent_hover: function (objStr, objStr_src, objStr_dest, objStr_org) {
		var obj = $(objStr);
		var src = $(objStr_src);
		var dest = $(objStr_dest);
		var org = $(objStr_org);
		
		if (obj.length && src.length && dest.length && org.length){
			obj.hover(
				function () {
					org.hide();
					dest.html(src.html());
				},
				function () {
					org.show();
					dest.html("");
				}
			);
		}
	},
	
	
	/**
	Beim Klick auf objStr wird objStr_dest mit Slide-Animation geoeffnet oder geschlossen
	*/
	toggleSlideContent: function (objStr, objStr_dest, speedDown, speedUp){
		var obj = $(objStr);
		var dest = $(objStr_dest);
		var sd = (speedDown) ? speedDown : fx.speed.down;
		var su = (speedUp) ? speedUp : fx.speed.up;
		
		if (obj.length){
			obj.click(function () {
				if (obj.hasClass(fx.selector.act)){
					dest.slideUp(su, function () { obj.removeClass(fx.selector.act)});
				} else {
					dest.slideDown(sd, function () { obj.addClass(fx.selector.act)});
				}
				return false;
			});
		}
	},
	
	imageSwitch: function (objStr, backgroundImage, aniOnLoad) {
		$(objStr).css("background", "url("+backgroundImage+")");
		if (aniOnLoad){
			$(objStr+" img").animate({ opacity: 0 }, 1000, function () { $(objStr+" img").animate({ opacity: 1 }, 1000 ); } );
		}
		$(objStr).hover(
			function () {
				$(objStr+" img").animate({ opacity: 0 }, fx.speed.fadeOut);
			},
			function () {
				$(objStr+" img").animate({ opacity: 1 }, fx.speed.fadeIn );
			}
		);
	}
	
};

/**
Allgemeine Funktionen zur Unterstuetzung [START]
*/

