//main menu effects
$(document).ready(function(){						   
	
	// disable hover on a tags//
	$("ul#menu a").css("background-image","none");
	
	// set opacity for hover span's to zero
	$("ul#menu span").css("opacity","0");
	
	//overwrite display:none from css for non java enabled browsers
	$("ul#menu span").css("display","block");	

	// on mouse over fade in 
	$("ul#menu span").hover(function () {
		$(this).stop().animate({
			opacity: 1
		}, 'slow');
	},
	// on mouse out fade out
	function () {
		$(this).stop().animate({
			opacity: 0
		}, 'slow');
	});
	
	// use document location to wrap current menu item with span and css class
	var page = document.location.href.replace(/.*\/(.*)\.html?/,"$1");
	
	if(page == "index"){
		var page = "home";
	}	
	var current = ('.' + page);
	//alert(current);
	
	//select current menu item and wrap a tag 
	$(current).children("a").wrap('<span class="current"></span>'); 
	
	//fade in h1 header	
	$("#header h1").css("opacity","0");
	$("#header h1").fadeTo(2000, 1);
	
	$("#main").css("opacity","0");
	$("#main").fadeTo(1000, 1);
	
	//switch page to right english or dutch version
	var pageName = document.location.href.replace(/.*\/(.*)\.html?/,"$1");
	var enPath = ("../en/" + pageName + ".html");
	var nlPath = ("../nl/" + pageName + ".html");	
	
	$("#en").attr({ href: enPath});
	$("#nl").attr({ href: nlPath});
	
	

	
	
	
	
});






