
// Prepare for the dynamic animations

window.addEvent('domready', function() {
    // *** push logo out of view
	var idSplashWrapper = $('idSplashWrapper');
	idSplashWrapper.store('oldheight',idSplashWrapper.getSize().y);
	idSplashWrapper.store('oldwidth',idSplashWrapper.getSize().x);
	idSplashWrapper.setStyle('overflow','hidden'); 
	idSplashWrapper.setStyle('height','0px'); 
	idSplashWrapper.setStyle('width','0px'); 
	
	
	var idSplashImages = idSplashWrapper.getElements('img');
	idSplashImages.setStyle('opacity','0');
	
	idSplashImages.setStyle('position', 'relative');
	idSplashImages.setStyle('top', '0');
	idSplashImages.setStyle('display','none');
});


// Perform animations
window.addEvent('load', function() {
	var idSplashWrapper = $('idSplashWrapper');
	
	var LogoFx = new Fx.Tween(idSplashWrapper, {duration: 2000, transition: Fx.Transitions.Back.easeOut });
	
	LogoFx.start('width', idSplashWrapper.retrieve('oldwidth')).chain(function() {
					var myFx = new Fx.Tween(idSplashWrapper);
					myFx.start('height', idSplashWrapper.retrieve('oldheight')).chain(function() {
						var elsSplashImages = idSplashWrapper.getElements('img');
						elsSplashImages.setStyle('display','inline');
						(function(){ 
						elsSplashImages.setStyle('opacity',0);
						elsSplashImages.tween('opacity', 1);
						}).delay(500);
						
						
					});
				})
	
	
	

	
		
	
						
});


window.addEvent('domready', function() {
	var idSplashWrapper = $('idSplashWrapper');
	var idSplashImages = idSplashWrapper.getElements('img');
	
	idSplashImages.addEvent('mouseover', function() {
		var myFx = new Fx.Tween(this, {duration: 'short', transition: Fx.Transitions.Bounce.easeOut});
		myFx.start('top', 10).chain(function() {
		
		});
	});
	
	idSplashImages.addEvent('mouseout', function() {
		var myFx = new Fx.Tween(this, {duration: 'short', transition: Fx.Transitions.Bounce.easeOut});
		myFx.start('top', 0)
	});
	
	var idLogo1 = $('idLogo1');
	var idLogo2 = $('idLogo2');
	idLogo1.addEvent('click', function() {
		var myFx = new Fx.Tween(idLogo2, {duration: 'short', transition: Fx.Transitions.Bounce.easeOut});
		myFx.start('height', 0);
		
	}
	);
	
	idLogo2.addEvent('click', function() {
		var myFx = new Fx.Tween(idLogo1, {duration: 'short', transition: Fx.Transitions.Bounce.easeOut});
		myFx.start('height', 0).chain(function() {
			
		});
	});
});

