

var menuHighlighting = {
	
	/* Menu over status: departement menu */
	locationOver : function(event){
		var locationLI = Event.element(event).up(0);
		locationLI.setStyle({
			borderBottom: '3px solid #00407C'
		});
	},
	
	/* Menu out status: departement menu */
	locationOut : function(event){
		var locationLI = Event.element(event).up(0);
		locationLI.setStyle({
			borderBottom: 'none'
		});
	},
	
	/* Menu over status: mainmenu */
	mainOver : function(event){
		var mainLI = Event.element(event).up(0);
		mainLI.setStyle({
			backgroundColor: '#00407C'
		});
	},
	
	/* Menu out status: mainmenu */
	mainOut : function(event){
		var mainLI = Event.element(event).up(0);
		mainLI.setStyle({
			backgroundColor: 'transparent'
		});
	}
	
};


Event.observe(window, 'load', function(){
	
	/* Bind location mouseovers */
	if($('department_menu')){	
		var locations = $('department_menu').childElements();
		locations.each(function(li){
			if(li.hasClassName('active')){
				li.setStyle({
					borderBottom: '3px solid #00407C'
				});
			}else{
				Event.observe($(li).down(0), 'mouseover', menuHighlighting.locationOver.bindAsEventListener(menuHighlighting));
				Event.observe($(li).down(0), 'mouseout', menuHighlighting.locationOut.bindAsEventListener(menuHighlighting));
			}
		});
	}
	
	/* Bind mainmenu mousovers */
	if($('main_menu')){
		var mainItems = $('main_menu').childElements();
		mainItems.each(function(li){
			var isActive = false;
			$w(li.className).each(function(class_name){
				if(class_name.strip() == 'active'){
					isActive = true;
				}
			})
			if(!isActive){
				Event.observe($(li).down(0), 'mouseover', menuHighlighting.mainOver.bindAsEventListener(menuHighlighting));
				Event.observe($(li).down(0), 'mouseout', menuHighlighting.mainOut.bindAsEventListener(menuHighlighting));
			}
		});
	}
	
	/* Firefox height fix */
	if (!Prototype.Browser.IE) {
		var containerHeight = document.viewport.getHeight();
		if($('content_container')){
			$('content_container').setStyle({
				minHeight: containerHeight +'px'
			});
		}
	}
	
	/* Cijferframe height */
	if($('cijferframe')){
		$('cijferframe').setStyle({
			height: $('cijferframe').up(0).getHeight() + 'px'
		});
	}
	
	$$('body').each(function(docbody){
		if(docbody.getStyle('background-color') != '#F3F3F3'){
			docbody.setStyle({
				backgroundColor: '#f3f3f3'
			});
		}
		
	});
	
	
});




