		window.addEvent('domready', function(){	
			//Browserdetection
			check=[
			['window.postMessage',
			 'window.XMLHttpRequest&&(document.postMessage||window.external)',
			 'document.compatMode',
			 '(document.detachEvent||document.contentType)'],
			['window.execScript','window.pkcs11','window.opera',
											  'window.navigator&&window.navigator.vendor'],
			[['IE 8','FF 3','Op 9.5','KDE?'],
			 ['IE 7','FF 2','Op 9','KDE?'],
			 ['IE 6','FF 1.5','Op 8','KDE/Safari 3'],
			 ['IE 5x','NN 7','Op 7','KDE/Konqu. 3']]];
			var j; var b; for(n=0;n<check[1].length;n++){if(!eval(check[1][n])==0)b=n;}
			for(n=check[0].length;n>-1;n--){if(!eval(check[0][n])==0)j=n;}
			var Browser = ((j>-1&&b>-1)?check[2][j][b]:'Älterer Browser o. unbekannt.');		
			
			//get Page and set invisible for loading
			var page = $('container');
			//page.fade('hide');
			
			//set the content to vCenter
			//setContent();
			
			//using Browserdetection to set the Multibox with and height
			if (Browser == 'IE 7')
			{
				$('nav_service').getElements('a').setProperty('rel','width:933,height:280');
			}
			else 
			{
				$('nav_service').getElements('a').setProperty('rel','width:940,height:283');
			}
			
			//get the 4 Elements Content, Hotel, Sauna, Handel
			var content = $('contentText');
			var hotel = $('hotelText');
			var sauna = $('saunaText');
			var handel = $('handelText');
			
			//set  Hotel, Sauna, Handel to invisible
			hotel.fade('hide')
			sauna.fade('hide')
			handel.fade('hide')	
											
			//Hoveranimation
			var getAnker = $$('#content_container a');
				getAnker.addEvent('mouseover', function()
				{
					var box = this.getParent().getParent();
					box.tween('background-color', '#faeae5');
					this.tween('color', '#cc3300');
					getBoxID = box.getProperty('id');
					if (getBoxID == 'hotel' )
						{
						content.get('tween', {property: 'opacity', duration: 'long', wait: true}).start(0);
						sauna.get('tween', {property: 'opacity', duration: 'long', wait: true}).start(0);
						handel.get('tween', {property: 'opacity', duration: 'long', wait: true}).start(0);
						hotel.get('tween', {property: 'opacity', duration: 'long', wait: true}).start(1);
						}
					else if (getBoxID == 'sauna')
						{
						content.get('tween', {property: 'opacity', duration: 'long', wait: true}).start(0);
						sauna.get('tween', {property: 'opacity', duration: 'long', wait: true}).start(1);
						handel.get('tween', {property: 'opacity', duration: 'long', wait: true}).start(0);
						hotel.get('tween', {property: 'opacity', duration: 'long', wait: true}).start(0);
						}	
					else if (getBoxID == 'handel')
						{
						content.get('tween', {property: 'opacity', duration: 'long', wait: true}).start(0);
						sauna.get('tween', {property: 'opacity', duration: 'long', wait: true}).start(0);
						handel.get('tween', {property: 'opacity', duration: 'long', wait: true}).start(1);
						hotel.get('tween', {property: 'opacity', duration: 'long', wait: true}).start(0);
						}										
				});
				getAnker.addEvent('mouseout', function(){
					this.getParent().getParent().tween('background-color', '#f9f4f0');
					this.tween('color', '#a3a3a3');	
						content.get('tween', {property: 'opacity', duration: 'long', wait: true}).start(1);
						sauna.get('tween', {property: 'opacity', duration: 'long', wait: true}).start(0);
						handel.get('tween', {property: 'opacity', duration: 'long', wait: true}).start(0);
						hotel.get('tween', {property: 'opacity', duration: 'long', wait: true}).start(0);					
				});
				
				var hotelImages = $('hotel').getElements('img');
				var saunaImages = $('sauna').getElements('img');
				var handelImages = $('handel').getElements('img');
				
				hotelImages[1].fade('hide');
				hotelImages[2].fade('hide');
				saunaImages[1].fade('hide');
				saunaImages[2].fade('hide');
				handelImages[1].fade('hide');
				handelImages[2].fade('hide');				
					
				var hotelzaehler = 0;
				var saunazaehler = 0;
				var handelzaehler = 0;
				
				hotelImages[0].set('tween', { duration: 2000 });
				hotelImages[1].set('tween', { duration: 2000 });
				hotelImages[2].set('tween', { duration: 2000 });
				
					function hotelFade()
					{	
						if (hotelzaehler == 2)
						{
							myTimer = $clear(myTimer);
							hotelzaehler = 0;
							hotelImages[2].fade('out');		
							hotelImages[0].fade('in');		
							var myTimer = hotelFade.delay(12000);
						}
						else
						{
							hotelImages[hotelzaehler].fade('out');
							hotelzaehler = hotelzaehler+1;
							hotelImages[hotelzaehler].fade('in');
							var myTimer = hotelFade.delay(12000);
						}
					
					}
					var myTimer = hotelFade.delay(4000);

				
				saunaImages[0].set('tween', { duration: 2000 });
				saunaImages[1].set('tween', { duration: 2000 });
				saunaImages[2].set('tween', { duration: 2000 });
				
					function saunaFade()
					{	
						if (saunazaehler == 2)
						{
							myTimer = $clear(myTimer);
							saunazaehler = 0;
							saunaImages[2].fade('out');		
							saunaImages[0].fade('in');		
							var myTimer = saunaFade.delay(12000);
						}
						else
						{
							saunaImages[saunazaehler].fade('out');
							saunazaehler = saunazaehler+1;
							saunaImages[saunazaehler].fade('in');
							var myTimer = saunaFade.delay(12000);
						}
					
					}
					var myTimer = saunaFade.delay(8000);
					
				handelImages[0].set('tween', { duration: 2000 });
				handelImages[1].set('tween', { duration: 2000 });
				handelImages[2].set('tween', { duration: 2000 });
				
					function handelFade()
					{	
						if (handelzaehler == 2)
						{
							myTimer = $clear(myTimer);
							handelzaehler = 0;
							handelImages[2].fade('out');		
							handelImages[0].fade('in');		
							var myTimer = handelFade.delay(12000);
						}
						else
						{
							handelImages[handelzaehler].fade('out');
							handelzaehler = handelzaehler+1;
							handelImages[handelzaehler].fade('in');
							var myTimer = handelFade.delay(12000);
						}
					
					}
					var myTimer = handelFade.delay(12000);					
					

		
							
				
				//$('content_container').getElements('img').hasClass('active').fade('in');
				
				//new Oject of the Multibox
				var box = {};
				window.addEvent('domready', function(){
					box = new MultiBox('mb', {descClassName: 'multiBoxDesc', useOverlay: false});
				});						
								
		});
		

		window.addEvent('load', function(){
				var fading = new Fx.Tween('fader', {property: 'opacity', duration: 800 });
		
			
fading.start(1,0);
			
			$$('a').addEvent('click', function(){
				if (this.hasClass("link") && !this.hasClass("mb") && !this.hasClass("download") && !this.hasClass("operator"))
				{
				var url = this.getProperty("href");
					fading.start(0,1).chain(
						//Notice that "this" refers to the calling object (in this case, the myFx object).
						    function(){ self.location.href=url }
					); //Will fade the Element out and in twice.				
					return false;
				}
			});
		});	
