window.addEvent('domready', function(){
	if($defined($('om_os'))){
		$('om_os').addEvents({
			'mouseover': function (){
			
				$$('.foldout').each(function(element){
					element.removeClass('unfolding');
				});
			
				$('om_os_foldout').addClass('unfolding');
				
			}/*,
			'mouseout': function(){
				$('om_os_foldout').removeClass('unfolding');
				
			}*/
		});
	
	}
	
	if($defined($('generelle_kurser'))){	
		$('generelle_kurser').addEvents({
			'mouseover': function (){
			
				$$('.foldout').each(function(element){
					element.removeClass('unfolding');
				});
				
				$('generelle_kurser_foldout').addClass('unfolding');
			}/*,
			'mouseout': function(){
				$('generelle_kurser_foldout').removeClass('unfolding');
			}*/
		});
	}
	
	if($defined($('beredskabskurser'))){
		$('beredskabskurser').addEvents({
			'mouseover': function (){
			
				$$('.foldout').each(function(element){
					element.removeClass('unfolding');
				});
			
				$('beredskabskurser_foldout').addClass('unfolding');
			}/*,
			'mouseout': function(){
				$('beredskabskurser_foldout').removeClass('unfolding');
			}*/
		});
	}
	
	if($defined($('ovelsesfaciliteter'))){	
		$('ovelsesfaciliteter').addEvents({
			'mouseover': function (){
			
				$$('.foldout').each(function(element){
					element.removeClass('unfolding');
				});
				$('ovelsesfaciliteter_foldout').addClass('unfolding');
			}/*,
			'mouseout': function(){
				$('ovelsesfaciliteter_foldout').removeClass('unfolding');
			}*/
		});
	}	
	
	$$('.foldout').each(function(foldouts){
		foldouts.addEvents({
			'mouseover': function (){
				foldouts.addClass('unfolding');
			},
			'mouseout': function(){
				foldouts.removeClass('unfolding');
			}
		});
	});
	
	/*$$('.menu-names').each(function(names){
		names.addEvents({
		'mouseout': function(){

			$$('.foldout').each(function(element){
				element.removeClass('unfolding');
			});
		}
		});
		
	});
	*/
	/*$$('.hover').each(function(foldouts){
		$$('.foldout').each(function (el){
			el.removeEvents();
		});
	});
	*/
	$$('.menu-names').each(function(el){
	
		el.addEvents({
			'mouseover': function (){
				el.addClass('active');
			},
			'mouseout': function(){
				el.removeClass('active');
			}
		});
	});
	
	// The same as before: adding events
	/*$('om_os').addEvents({
		'mouseenter': function(){
			// Always sets the duration of the tween to 1000 ms and a bouncing transition
			// And then tweens the height of the element
			this.set('tween', {
				duration: 1000,
				transition: Fx.Transitions.Bounce.easeOut // This could have been also 'bounce:out'
			}).tween('height', '250px');
		},
		'mouseleave': function(){
			// Resets the tween and changes the element back to its original size
			this.set('tween', {}).tween('height', '20px');
		}
	});

	
	// The same as before: adding events
	$('ovelsesfaciliteter').addEvents({
		'mouseenter': function(){
			// Always sets the duration of the tween to 1000 ms and a bouncing transition
			// And then tweens the height of the element
			this.set('tween', {
				duration: 1000,
				transition: Fx.Transitions.Bounce.easeOut // This could have been also 'bounce:out'
			}).tween('height', '250px');
		},
		'mouseleave': function(){
			// Resets the tween and changes the element back to its original size
			this.set('tween', {}).tween('height', '20px');
		}
	});
	
		
	// The same as before: adding events
	$('generelle_kurser').addEvents({
		'mouseenter': function(){
			// Always sets the duration of the tween to 1000 ms and a bouncing transition
			// And then tweens the height of the element
			this.set('tween', {
				duration: 1000,
				transition: Fx.Transitions.Bounce.easeOut // This could have been also 'bounce:out'
			}).tween('height', '150px');
		},
		'mouseleave': function(){
			// Resets the tween and changes the element back to its original size
			this.set('tween', {}).tween('height', '20px');
		}
	});
	
		
	// The same as before: adding events
	$('beredskabskurser').addEvents({
		'mouseenter': function(){
			// Always sets the duration of the tween to 1000 ms and a bouncing transition
			// And then tweens the height of the element
			this.set('tween', {
				duration: 1000,
				transition: Fx.Transitions.Bounce.easeOut // This could have been also 'bounce:out'
			}).tween('height', '150px');
		},
		'mouseleave': function(){
			// Resets the tween and changes the element back to its original size
			this.set('tween', {}).tween('height', '20px');
		}
	});*/
});
