
var rond_teller = 0;

$(document).ready(function() {
	
	$("#menu ul li:last-child").addClass("last");

	
	$("#menu > ul > li > a").mouseover(function() {
		$('.submenu').hide();
		$('li.hoveractive').removeClass('hoveractive');
		$(this).parent().children('.submenu').show();
		$(this).parent().addClass('hoveractive');
		Cufon.now(); 
	});
	
	$("#menu > ul > li > a").mouseout(function() {
		$(this).parent().removeClass('hoveractive');
		$('.submenu').hide();
		//Cufon.now(); 
	});
	
	$('.submenu').mouseover(function() {
			$(this).parent().addClass('hoveractive');
			$(this).show();
			//Cufon.now(); 
	});
	
	$('.submenu').mouseleave(function() {
		$('li.hoveractive').removeClass('hoveractive');
		$('.submenu').hide();
		 Cufon.replace('#menu a', { fontFamily: 'Sansa', hover: true }); 
	});
	
	$('.submenu a').mouseover(function() {
			$(this).parent().parent().parent().addClass('hoveractive');
			$(this).parent().parent().show;
			//Cufon.now(); 
	});	
	
	$('.cases_afb img, .team_afb img').each(function() {
		var width = $(this).css("width");
		$(this).parent().css("width",width);
		var height = $(this).css("height");
		$(this).parent().css("height",height);
	});
	
	$('body.team .cases_afb img, #cases-overzicht.team .cases_afb img').each(function() {
	    var width = $(this).css("width");
	    $(this).parent().parent().css("width",width);
	    var height = $(this).css("height");
	    $(this).parent().parent().css("height",height);
	  });

	
	$('img.ronde_hoekjes').each(function() {
		rond_teller = rond_teller + 1;
		
		$('<div class="cases_wit_afb rond' + rond_teller + '"></div>').insertBefore(this)
		
		$(this).appendTo(".rond"+rond_teller);
		
		$('<div class="cases_wit_afb_lb"></div>').appendTo(".rond"+rond_teller)
		$('<div class="cases_wit_afb_lo"></div>').appendTo(".rond"+rond_teller)
		$('<div class="cases_wit_afb_rb"></div>').appendTo(".rond"+rond_teller)
		$('<div class="cases_wit_afb_ro"></div>').appendTo(".rond"+rond_teller)
		
		// CSS
		var floattype =  $(this).css("float");
		if (floattype)
		{
			$(".rond"+rond_teller).css("float",floattype);
		}
		
		var width = $(this).css("width");
	    $(this).parent().css("width",width);
	    var height = $(this).css("height");
	    $(this).parent().css("height",height);
	    
	    
	});
	
});



