// JavaScript Document
window.addEvent('domready',function() {
	// Check if the SPLASH page has been viewed..
	if(!$defined(Cookie.read('viewed'))) {
		
		//Write a cookie to say we've viewed the message
		Cookie.write('viewed', 1,{
					 'duration': 0,
					 'domain':'heartresearch.org.uk'
		});
		
		//If it hasn't been set, cookies are disabled, so don't display the message
		if(!$defined(Cookie.read('viewed'))) {
			return false;
		}

		$$('table').each(function(el) {
			//hide the page...
			el.setStyle('display','none');
			el.setStyle('opacity',0);
			//set up the tween to bring it back in...
			el.set('tween',{'property':'opacity'});
		});
		
		//Set up the statement div
		$('statement').set('tween',{'property':'opacity'});
		$('statement').setStyle('opacity',0);
		$('statement').setStyle('display','block');
		//Tween the statement div in
		$('statement').tween(1);

		//Set up the enter link..
		$$('.enterLink').each(function(el) {
			el.addEvent('click',function(Event) {
			
				$('statement').setStyle('display','none');
				
				$$('table').each(function(el) {
					el.setStyle('display','block');
					el.tween(1);						  
				});
				
				Event.stop();									 
			});
		});
		
	
	}
});
