$(document).ready(function(){
						   
	$('#sidemenu li:not(.active) a').hover(function(){
		$(this).stop().animate({paddingBottom:'25px'}, 200);								
	}, 
	function(){
		$(this).animate({paddingBottom:'0px'}, 200);
	})

/*
	var timeoutreverse = null;
	
	$('#menu > ul > li').hover(function(){
		$(this).addClass('hover');
		if(!$(this).find('.submenu').hasClass('active') || $(this).find('.submenu').length == 0){
			clearTimeout(timeoutreverse);
			$('.submenu.active').stop(true,true).hide('fast');
			$(this).find('.submenu').stop(true,true).show('fast');
		}
	},function(){		
		$(this).removeClass('hover');
		if(!$(this).find('.submenu').hasClass('active') || $(this).find('.submenu').length == 0){
			$(this).find('.submenu').stop(true,true).hide('fast'); 
			clearTimeout(timeoutreverse);
			timeoutreverse = setTimeout(function(){ $('.submenu.active').stop(true,true).show('fast') }, 100);
		}
	});
	
	*/
	$('a.meel').each(function(i) {
        var text = $(this).text();
        var address = text.replace(" op ", "@");
        var address = address.replace(" punt ", ".");
        $(this).attr('href', 'mailto:' + address);
		$(this).text(address);
	});
	
	
	$("#ajaxformulier:not(.jQueried)").addClass('jQueried').unbind('submit').submit(function(){
		var form = $(this);
		var data = $(this).serialize();
		$(this).find('input, textarea, checkbox, radio, select').each(function(){
			if($(this).attr('title')){
				ar = $(this).attr('name').split('[]');
				naam = ar[0];
				data += '&veldnamen['+encodeURIComponent(naam)+']=' + encodeURIComponent($(this).attr('title'))
			}
		});
		$.ajax({
			type: 	$(this).attr('method'),
			url: 	$(this).attr('action'),
			data: 	data,
			success: function(msg){
				if(form.attr('target')){
					$("#"+form.attr('target')).html(msg);
				}
			},
			error: function(xhr, ajaxOptions, thrownError){
				alert(xhr.status);
				alert(thrownError);
			}
		});
		return false;
	});
});
