window.addEvent('domready', function(){
	//Hauptnavigation
	var el = $('chapters'),
		color = el.getStyle('backgroundColor');
	var el1 = $('subchapters'),
		color = el1.getStyle('visibility');
	
	// The same as before: adding events
	$('chapters').addEvents({
		'mouseenter': function(){
			this.set('tween', {
				duration: 1000,
				transition: Fx.Transitions.Bounce.easeOut 
			}).tween('height', '140px');
			//Subnavigation ausblenden
				el1.morph({'opacity': 0.05 });
		},
		'mouseleave': function(){
			this.set('tween', {}).tween('height', '50px');
			//Subnavigation einblenden
			el1.morph({'opacity': 1 });
		}
	});
	
	
	
	//Subnavigation
	var el2 = $('subchapters'),
		color = el2.getStyle('backgroundColor');
	
	// The same as before: adding events
	$('subchapters').addEvents({
		'mouseenter': function(){
			this.set('tween', {
				duration: 1000,
				transition: Fx.Transitions.Bounce.easeOut 
			}).tween('height', '85px');
		},
		'mouseleave': function(){
			this.set('tween', {}).tween('height', '20px');
		}
});	

	//Logo
	var el3 = $('logo'),
		color = el3.getStyle('backgroundColor');
	var el4 = $('caption'),
			color = el3.getStyle('backgroundColor');
	
	// The same as before: adding events
	$('logo').addEvents({
		'mouseenter': function(){
			this.set('tween', {
				duration: 1000,
				transition: Fx.Transitions.Bounce.easeOut 
			}).tween('height', '100px');
			 // Beschreibungen ausblenden
						el4.morph({'opacity': 0.1 });
		},
		'mouseleave': function(){
			this.set('tween', {}).tween('height', '17px');
			 // Beschreibungen einblenden
						el4.morph({'opacity': 1 });
		}
});
//Seiten weiterblaettern
	//1
		var el = $('page1'),
			color = el.getStyle('backgroundColor');

		// We are setting the opacity of the element to 0.7 and adding two events
		$('page1').set('opacity', 0.8).addEvents({
			mouseenter: function(){
				// This morphes the opacity and backgroundColor
				this.morph({
					'opacity': 1,
					'background-color': '#77d3fa'
				});
			},
			mouseleave: function(){
				// Morphes back to the original style
				this.morph({
					opacity: 0.7,
					backgroundColor: color
				});
			}
		});
	//2
		var el = $('page2'),
			color = el.getStyle('backgroundColor');

		$('page2').set('opacity', 0.8).addEvents({
			mouseenter: function(){
				this.morph({
					'opacity': 1,
					'background-color': '#77d3fa'
				});
			},
			mouseleave: function(){
				this.morph({
					opacity: 0.7,
					backgroundColor: color
				});
			}
		});
	//3
		var el = $('page3'),
			color = el.getStyle('backgroundColor');

		$('page3').set('opacity', 0.8).addEvents({
			mouseenter: function(){
				this.morph({
					'opacity': 1,
					'background-color': '#77d3fa'
				});
			},
			mouseleave: function(){
				this.morph({
					opacity: 0.7,
					backgroundColor: color
				});
			}
		});
	//4
		var el = $('page4'),
			color = el.getStyle('backgroundColor');

		$('page4').set('opacity', 0.8).addEvents({
			mouseenter: function(){
				this.morph({
					'opacity': 1,
					'background-color': '#77d3fa'
				});
			},
			mouseleave: function(){
				this.morph({
					opacity: 0.7,
					backgroundColor: color
				});
			}
		});
	//5
		var el = $('page5'),
			color = el.getStyle('backgroundColor');

		$('page5').set('opacity', 0.8).addEvents({
			mouseenter: function(){
				this.morph({
					'opacity': 1,
					'background-color': '#77d3fa'
				});
			},
			mouseleave: function(){
				this.morph({
					opacity: 0.7,
					backgroundColor: color
				});
			}
		});

});
// Pop Up Window
var newwindow;
var windW= 450;
var windH= 350;
var screenW= (screen.availWidth - windW) /2;
var screenH= (screen.availHeight - windH) /2;
var features = 'left='+screenW+',top='+screenH+',width='+windW+',height='+windH+',toolbar=0,location=0,status=0,scrollbars= 1,resizable=0';

function moviewindow(url)
//
{
	newwindow=window.open(url,'name',features);
	if (window.focus) {newwindow.focus()}
}


