I solved it with this:
$$('.addr').each(function(el){
el.addEvent('blur', function(){
var value = el.get('value');
var directions = [' n ', ' s ', ' e ', ' w ', ' ne ', ' nw ', ' se
', ' sw '];
directions.each(function(direction){
if(value.contains(direction)){
var newstr = value.replace(direction, direction.toUpperCase(),
"gi");
el.set('value', newstr.capitalize());
}
});
});
});
"123 sw third street" now becomes "123 SW Third Street"
If someone has a better solution, I'd like to know :)