$(document).ready(function(){
	
	// Kontaktseite
	$('a.office').hover(
		function(){
			rel = this.rel;
			$('#contact_info').hover(
				function(){  $('#menu_companies a.' + rel).addClass( rel + '-act' ); }, 
				function(){  $('#menu_companies a.' + rel).removeClass( rel + '-act' ); }
			);			
			
			$('#contact_info').html( $('#contact_' + this.id).html() );
			$('#menu_companies a.' + this.rel).addClass( this.rel + '-act' );
		}, 
		function(){
			$('#menu_companies a.' + this.rel).removeClass( this.rel + '-act' );
		}
	);
	//Assistants
	$('a.assistant').hover(
		function(){
			rel = this.rel.split(' ');
			for(var i=0; i < rel.length; i++) {
				$('#menu_companies a.' + rel[i]).addClass( rel[i] + '-act' );	
			}
			//rel = this.rel;
//			$('#contact_info').hover(
//				function(){  $('#menu_companies a.' + rel).addClass( rel + '-act' ); }, 
//				function(){  $('#menu_companies a.' + rel).removeClass( rel + '-act' ); }
//			);			
			
			$('#assistant_info').html( $('#assistant_' + this.id).html() );
			$('#menu_companies a.' + this.rel).addClass( this.rel + '-act' );
			$('#profile_photo').html( $('#profile_' + this.id).html() );
		}, 
		function(){
			rel = this.rel.split(' ');
			for(var i=0; i < rel.length; i++) {
				$('#menu_companies a.' + rel[i]).removeClass( rel[i] + '-act' );	
			}
			//$('#menu_companies a.' + this.rel).removeClass( this.rel + '-act' );
		}
	);
	//Leistungen
	$('a.leistungen').hover(
		function(){
			$('#leistungen_info').html( $('#leistungen_' + this.id).html() );
		},
		function(){}
	);
	// Jobs
	$('a.job').hover(
		function(){
			rel = this.rel;
			$('#job_info').hover(
				function(){  $('#menu_companies a.' + rel).addClass( rel + '-act' ); }, 
				function(){  $('#menu_companies a.' + rel).removeClass( rel + '-act' ); }
			);			
			
			$('#job_info').html( $('#job_' + this.id).html() );
			$('#menu_companies a.' + this.rel).addClass( this.rel + '-act' );
		}, 
		function(){
			$('#menu_companies a.' + this.rel).removeClass( this.rel + '-act' );
		}
	);
	
	// Profilübersicht
	$('a.employee').hover(
		function(){
			rel = this.rel.split(' ');
			for(var i=0; i < rel.length; i++) {
				$('#menu_companies a.' + rel[i]).addClass( rel[i] + '-act' );	
			}
		}, 
		function(){
			rel = this.rel.split(' ');
			for(var i=0; i < rel.length; i++) {
				$('#menu_companies a.' + rel[i]).removeClass( rel[i] + '-act' );	
			}
		}
	);
	
});
