function hopEvent(s) {self.location=s;}

window.addEvent('domready', function() {
	
				$('nav_rollover').getElements('img[src$=off.png]').addEvents({
						'mouseenter': function() {
							var m = this.src.match(/(.+)_off.png/);
							this.src=m[1]+'_over.png';
							},
						'mouseleave': function() {
							var m = this.src.match(/(.+)_over.png/);
							this.src=m[1]+'_off.png';
							}
						});
						
				});

window.addEvent('domready', function() {
	// You can skip the following two lines of code. We need them to make sure demos
	// are runnable on MooTools demos web page.
	//if (!window.demo_path) window.demo_path = '';
	//var demo_path = window.demo_path;
	// --
	
	$('newsletter').addEvent('submit', function(e) {
		//Prevents the default submit event from loading a new page.
		e.stop();
		//Empty the log and show the spinning indicator.
		
		var pattern=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;
		// email regex
		if(pattern.test(document.newsletter1.email.value)){         
		//	(document.[name form].[name input field].value)
		
		var log = $('bedankt').addClass('ajax-loading');
		//Set the options of the form's Request handler. 
		//("this" refers to the $('myForm') element).
		this.set('send', {onComplete: function(response) { 
			log.removeClass('ajax-loading');
			log.set('html', response);
		}});
		//Send the form.
		this.send();
		$('nieuwsbrief').style.display = "none";
		// makes div invisible
    }else{   
		alert("Een geldig e-mailadres bestaat uit 'naam@domein.tld'"); 
    }
	
	
	});
});


