
function showSubcontent(cont) {
	cont = cont.replace(/#/,'');
	$('#sub_menu a').removeClass('active');
	$('#sub_menu a[href=#'+cont+']').addClass('active');
	$('#content a[name!='+cont+']').next().hide();
	$('#content a[name='+cont+']').next().show();
	$('#content a[name='+cont+'_p]').next().show();
	$('#profile img').eq(0).attr('src', 'img/'+cont+'.png');
}

$(document).ready(function() {

	/*
	var frameWidth = $('#frame').width();
	
	for(i=15;i>0;i--) {
		var color = '' + parseInt(255-(250/(i+1)))
   		$("#frame").wrap('<div style="width:'+(frameWidth+2*i)+'px;border:solid rgb('+color+','+color+','+color+') 1px; margin: 0 auto;"></div>');
 	}
 	*/
 	$("#frame").wrap('<div id="shadow"></div>');
 	$('<div id="shadow_top"></div>').insertBefore('#frame');
 	$('<div id="shadow_bottom"></div>').insertAfter('#frame');
 	
	$('.hidden').hide();
	
	$('#map').lightBox();
	
	if(location.hash) {
		showSubcontent(location.hash);
	}
	
	$('#sub_menu a').click(function() {
		showSubcontent($(this).attr('href'));
		return false;
	});
	
	if($('#anwaelte')) {
		$('#anwaelte a').mouseover(function() {		
			$('#names span').stop(true, true).hide();
			var who = $(this).attr('href').split('#')[1].substring(0,3);			
			$('#'+who+' span').fadeIn();
			return false;
		});

		$('#anwaelte a').mouseout(function() {
			$('#names span').stop(true, true).fadeOut();
		});
	}
	
	
	

});



