
window.onDomReady(function(){

	/* hide the HTML element- navigation menus - at the initial loading of the page */
	$('nav_aboutus').effect('opacity').set(0);
	$('nav_aboutus').effect('height').set(0);	
	
	$('nav2').effect('opacity').set(0);
	$('nav2').effect('height').set(0);
	
	$('nav_events').effect('opacity').set(0);
	$('nav_events').effect('height').set(0);
	
	/* make all the navigation menus ready for display on certain events */
	var navFx_aboutus = new Fx.Styles('nav_aboutus', {duration: 500});
	var navFx = new Fx.Styles('nav2', {duration: 500});
	var navFx_events = new Fx.Styles('nav_events', {duration: 500});
	
	/* For user friendliness, if a HTMl-element(in this case a link) with classid="navRun" is clicked - 
	   proceed as follows:
	  1) display the main menu related to the specified HTML-Element
      2) hide all other menus and sub-menus(even those belonging to this main menu) so that only the 
	     requested menu is displayed 
	*/

	$ES('.navRun_about_us').addEvent('click', function() {
	navFx_aboutus.start({    
	'height': ['0', '90'],
	'opacity': ['0', '1']
		});
	$('nav2').effect('opacity').set(0);
	$('nav2').effect('height').set(0);	
	$('nav_events').effect('opacity').set(0);
	$('nav_events').effect('height').set(0); 
	});		
	
	$ES('.navRun').addEvent('click', function() {
	navFx.start({    
	'height': ['0', '60'],
	'opacity': ['0', '1']
		});
	$('nav_events').effect('opacity').set(0);
	$('nav_events').effect('height').set(0); 
	$('nav_aboutus').effect('opacity').set(0);
	$('nav_aboutus').effect('height').set(0);		
	});		
	
	$ES('.navRun_Events').addEvent('click', function() {
	navFx_events.start({ 					
	'height': ['0', '60'],
	'opacity': ['0', '1']
		});	
	$('nav2').effect('opacity').set(0);
	$('nav2').effect('height').set(0);	 
	$('nav_aboutus').effect('opacity').set(0);
	$('nav_aboutus').effect('height').set(0);		
	});

});

