// JavaScript Document
$(document).ready(function(){
	$(document).pngFix(); 
	$.locar=$.loc.split("X");
	
	$('body').css('background','url(ximg/body_bg.jpg) repeat-y #f8f8f8');
	$.mLoc="loc="+$.locar[0]+"X"+$.locar[1];
						   
	$('#menu_wrapper div.mm_ob').each(function(){
		var idUp=$(this).attr('id');
		if($.mLoc==idUp){
			$(this).addClass('mm_on');
		}else{
			$(this).hover(
				function(){
					$(this).addClass('mm_on');
				},
				function(){
					$(this).removeClass('mm_on');
				})
			}			
		});
	
	$('#menu_wrapper div.sm_ob').each(function(){
		var idUp=$(this).attr('id');
		if("loc="+$.loc==idUp){
			$(this).addClass('sm_on');
		}else{
			$(this).hover(
				function(){
					$(this).addClass('sm_on');
				},
				function(){
					$(this).removeClass('sm_on');
				})
			}			
		});
	$('#team_bg').smoothDivScroll({ autoScroll: "always" , autoScrollDirection : "endlessloopright" , autoScrollStep: 2 , autoScrollInterval : 50});




	
	$(window).resize(function(){
		var w=$(document).height();
		var h=$('#header').outerHeight();
		var k=$('#kopfbild').outerHeight();
		var p=$('#content_wrapper').outerHeight();
		var left=w-h-k;
		if(left>=p-20){
			$('#content_wrapper').height(left);
		}else{
			$('#content_wrapper').css('height','auto');
		}
							  });
	$(window).resize();
});

window.onload=function(){$(window).resize();};
