$(document).ready(function() {
	
	//png fix
	$("img[src$='.png']").ifixpng();
	
	//store menu item status
	$("li.button_menuChild").each(function(i){
		var status = "deselected";
		if($(this).hasClass("button_selected")){
			status = "selected"
		}
		$(this).data("menuitem",{item:i, status: status});
	});
	
	//start menu animation
	$("li.button_menuChild").bind("mouseenter", function(){
		
		//topmenu button change into selected
		$("img.button_deselected", this).attr("class","button_selected");
		
	}).bind("mouseleave", function(){
		
		//topmenu button change into selected
		if($(this).data("menuitem").status == "deselected"){
			$("img.button_selected", this).attr("class","button_deselected");
		}
		
	});
	
	//click trigger menu item
	$("li.button_menuChild").click(function(){
		location.href=$(this).children("a").attr("href");
	});
	
	//projecten trigger
	$(".projectListItem").click(function(){
		location.href=$("a.title", this).attr("href");
	});
	
});
