window.addEvent('load', function(){
	if($('hoofditem') == null || (navigator.appName == 'Microsoft Internet Explorer' && !navigator.appVersion.match('MSIE 9'))) 
	{
		$('main').setStyles({display: ''});
		return;
	}
	$$('#zoeken, #hoofditem, #item1, #item2, #item3').setStyles({opacity: 0, display: 'inline'});
	$('main').setStyles({ display: ''});
	show_main.delay(1000);
});

function show_main()
{
	new Fx.Tween($('item1'), {duration: 2000}).start('opacity', 1);
	new Fx.Tween($('item2'), {duration: 2000}).start('opacity', 1);
	new Fx.Tween($('item3'), {duration: 2000}).start('opacity', 1);
	new Fx.Tween($('zoeken'), {duration: 2000}).start('opacity', 1);
	new Fx.Tween($('hoofditem'), {duration: 2000, onComplete: tween_done}).start('opacity', 1);
}
function tween_done()
{
	$$('h1').setStyle('display', 'block');	
}

window.addEvent('domready', function(){
	// new Calendar({ aankomst: 'd-m-Y' }, { direction: 1, tweak: { x: 6, y: 0 }});
	if($('info-form') != null && false)
	{
		var myForm = $('info-form'),
		myResult = $('form-result');
		var validator = new Form.Validator(myForm, {
			onFormValidate: function(valid, form, event){
				if(!valid)
				{
					alert('De velden met een rode rand zijn niet goed ingevuld.');
				}
			}
		});
		
		new Form.Request(myForm, myResult, {
			onSuccess: function(r){
				myForm.setStyle('display', 'none');
				myResult.setStyle('display', '');
			}
		});
	}
});
