var straatCheck = false;
document.observe ("dom:loaded", function()
{
	if ($('straat')) {
		$('straat').observe('change', function(event) {
			if (!straatCheck) {
				var alphaExp = /^[a-z A-Z]+$/;
				if (!($('straat').value.match(alphaExp))) {
					var check = new Element('div', {'id':'straat_error', 'class':'formfielderror'}).insert(new Element('strong').update('Controleer of u geen huisnummer in de straat heeft staan!'));
					$('straat').insert({'before':check});
					straatCheck = true;
				}
			} else if ($('straat_error')) {
				$('straat_error').remove();
			}
		});
	}
});

var brugman = {};
brugman.redirect = function(event) {
	event.stop();
	$('aanbieding').setAttribute('action', event.element().getAttribute('href'));
	$('aanbieding').submit();
}