Try this:
$.scrollTo('#'+id+'_anchor', 500, {
easing : 'easeInCubic',
onAfter : function(){
alert('test');
}
});
According to the doco you have two ways to call it:
$(...).scrollTo( target, duration, settings );
$(...).scrollTo( target, settings );
...but not with the easing as a separate parameter like you had:
$(...).scrollTo( target, duration, easing, settings );
You need to make the easing one of the properties of the settings object.