
$(document).ready( function () {


	// Flashmovies register with the swfobject
	$(".flashmovie").children("object").each( function(index) {
		swfobject.registerObject($(this).attr("id"), "9.0.0", $(this).children("param").attr("value"));
	})

	$("#navigation a").each(function () {
		var offtonav = $(this).position();
		var bpos = offtonav.top -3;
		var endpos = 0 - bpos;
		var usualbild = "bildnavnhighlight.png";
		if ($(this).hasClass('highlight')) {
			usualbild = "bildnavhighlight.png";
		}
		$(this).html("&nbsp;");
		$(this).css({
			'background':'transparent url(\''+ depth +'img/'+ usualbild +'\') no-repeat right '+ endpos +'px'
		});
		
		$(this).mouseover(function () {
			$(this).css({
				'background':'transparent url(\''+ depth +'img/bildnavhighlight.png\') no-repeat right '+ endpos +'px'
			});
		});
		$(this).mouseout(function () {
			$(this).css({
				'background':'transparent url(\''+ depth +'img/'+ usualbild +'\') no-repeat right '+ endpos +'px'
			});
		});
	});
	
	$("#impress a").each(function () {
		var offtonav = $(this).position();
		var bpos = offtonav.top -3;
		var endpos = 0 - bpos;
		var usualbild = "impressum-nav-normal.png";
		if ($(this).hasClass('highlight')) {
			usualbild = "impressum-nav-heighlight.png";
		}
		$(this).html("&nbsp;");
		$(this).css({
			'background':'transparent url(\''+ depth +'img/'+ usualbild +'\') no-repeat right '+ endpos +'px'
		});
		
		$(this).mouseover(function () {
			$(this).css({
				'background':'transparent url(\''+ depth +'img/impressum-nav-heighlight.png\') no-repeat right '+ endpos +'px'
			});
		});
		$(this).mouseout(function () {
			$(this).css({
				'background':'transparent url(\''+ depth +'img/'+ usualbild +'\') no-repeat right '+ endpos +'px'
			});
		});
	});
	
	$("#partnerschaften a").mouseover(function () {
		var offtopartner = $(this).position();
		var xnegate = 0 - offtopartner.left;
		var ynegate = 0 - offtopartner.top;
		
		$(this).css({
			'background':'transparent url(\''+ depth +'img/partner-farbe.jpg\') no-repeat '+ xnegate +'px '+ ynegate +'px'
		});
	});
	
	$("#partnerschaften a").mouseout(function () {
		$(this).css({
			'backgroundImage':'none'
		});
	});

});

