// It handles that current's page link.
// It's used to both make the current's page menu link look active and inactive (for internal purposes)
function handle_current_pages_link(add_or_remove) {
	current_page = $$('body').get('id');
	$$('div.bulb.'+current_page).each(function(e){
		switch(add_or_remove){
			case 'add':
				e.addClass('on');
				break;
			case 'remove':
				e.removeClass('on');
				break;
		}
	});
}


window.addEvent('domready', function(){
	// The hover behaviour that 'lights' the green lightbulbs
	$$('ul.menu li a').addEvents({
		mouseenter: function(){
			handle_current_pages_link('remove');
			bulb_klass = this.get('text');
			$$('div.bulb.'+bulb_klass).each(function(e){
				e.addClass('on');
			});			
		},
		mouseleave: function(){
			bulb_klass = this.get('text');
			$$('div.bulb.'+bulb_klass).each(function(e){
				e.removeClass('on');
			});
			handle_current_pages_link('add');
		}
	});
	
	// Make the current section's green lightbulbs lighten up
	handle_current_pages_link('add');
	
	
			
	
});
