
var siteIntroInit = function(){
	// Detect screen size
	
	if (Cookie.read('screenWidth')==null){
		
		if(typeOf(screen.width)=='number'){ 
		
			if(screen.width>1900){
				screenWidth = 1920;
			} else if (screen.width>1500) {
				screenWidth = 1920;
			} else if (screen.width>1200) {
				screenWidth = 1600;	
			} else if (screen.width>1000) {
				screenWidth = 1280;
			} else {
				screenWidth = 1024;	
			}
			
		} else {
		
			screenWidth = 1920;
			
		}
		
		Cookie.write('screenWidth', screenWidth, {duration: 1});
		
	} else {
	
		screenWidth = Cookie.read('screenWidth');
		
	}
	
	// Indicatoren toevoegen aan taal linkjes en ook de events.
	$$('li>a').each(function(el){
		new Element('span', {
			'html': '&nbsp;',
			'class': 'link-indicator'
		}).inject(el, 'top');
		el.addEvents({
			'mouseover': function(){
				el.getFirst().
					set('tween', {'duration': 100}).
					tween('background-color', '#FFF');
			},
			'mouseout': function(){
				el.getFirst().
					set('tween', {'duration': 350}).
					tween('background-color', '#021001');
			},
			'click': function(){
				Cookie.write('language', this.get('href').substr(1,2), {duration:90});
			}
		})
	});
	
	// Zichtbaarheid instellen, overgang starten
	$('container').
		setStyles({
			'opacity': 0,
			'visibility': 'visible'
		}).
		set('tween', {
			duration: 2000
		}).
		tween('opacity', 1);
	
}

var siteIntroResize = function(){
	
	// Container centreren
	topBottomRatio	= 1.5; // 1 staat tot 2 = 1/2 = 0.5
	containerHeight = $('container').getSize().y;
	windowHeight 	= $(document.body).getSize().y;
	
	containerMargin = ( windowHeight - containerHeight ) / ( topBottomRatio + 1 ) * topBottomRatio;	
	
	// Marges toepassen
	$('container').setStyles({
		'margin-top': containerMargin
	});

};
