var timeout = 500;
var buttonsMargin = new Fx.Morph('buttons', {duration: timeout, transition: Fx.Transitions.Sine.easeInOut});
var clickEvent = function(event) {
	if(this.hasClass('active')) {
		// Er is geklikt op de pagina die al open staat. Hier hoeven we niets te doen.
		return false;
	}
	var theImage = this.getChildren('img')[0].src;
	this.getChildren('img')[0].src = theImage.replace('.png', '-groot.png');
	
	var buttonHeight = new Fx.Morph(this, {duration: timeout, transition: Fx.Transitions.Sine.easeInOut});
	if( (a = $$('#buttons .active')) && (a[0] != null) ) {
		var buttonActiveHeight = new Fx.Morph(a[0], {duration: timeout, transition: Fx.Transitions.Sine.easeInOut});
		buttonActiveHeight.start({height: 67});
	}
	buttonHeight.start({height: 186});
	if( (s = $('slogan')) || (s = $('address')) ) {
		s.set('tween', {duration: timeout}).fade(0);
		buttonsMargin.start({marginTop: [0, -117]});
	}
	var newhref = this.href;
	(function(){window.location.href=newhref;}.delay(timeout));
	return false;
}
$$('#buttons a').each(function(item) {
	item.addEvent('click', clickEvent);
});



