window.addEvent('domready', function() {

var animBallFX = new Fx.Morph('animball', {
    duration: 40
});
var titleBackFX = new Fx.Tween('titlebg', {
	duration: 3000
});
var showTitleFX = new Fx.Elements($$('.lett'), {
	duration: 300
});
var tagLineFX = new Fx.Elements( $$('.tag'), {
	
});
var tagScrollFX = new Fx.Tween( $('dot'), {
	duration: 2000
});
var llScrollFX = new Fx.Tween( $('ll') );
var o1ScrollFX = new Fx.Tween( $('o1') );
var o2ScrollFX = new Fx.Tween( $('o2') );
var b_ScrollFX = new Fx.Tween( $('b_') );

$$('.lett').set('opacity', 0);

	(function(){
		showTitleFX.start({
			'0': { 'opacity': [0,1] }
		}).chain(
			function(){	this.start({ '1': { 'opacity': [0,1] } }); },
			function(){	this.start({ '2': { 'opacity': [0,1] } }); },
			function(){	this.start({ '3': { 'opacity': [0,1] } }); },
			function(){	this.start({ '4': { 'opacity': [0,1] } }); },
			function(){	this.start({ '5': { 'opacity': [0,1] } }); },
			function(){	this.start({ '6': { 'opacity': [0,1] } }); },
			function(){	this.start({ '7': { 'opacity': [0,1] } }); },
			function(){	this.start({ '8': { 'opacity': [0,1] } }); },
			function(){	this.start({ '9': { 'opacity': [0,1] } }); },
			function(){	this.start({'10': { 'opacity': [0,1] } }); },
			function(){}
		);
	}).delay(5000);

	(function(){tagLineFX.start({ '0': { 'background-position': ['0 -37px','0 -4px'] }
		}).chain(
			function(){ this.start({ '1': { 'background-position': ['-7px -37px','-7px -4px'] } }); },
			function(){ this.start({ '2': { 'background-position': ['-35px -37px','-35px -4px'] } }); },
			function(){ this.start({ '5': { 'background-position': ['-107px -37px','-107px -4px'] } }); },
			function(){ tagScrollFX.start('margin-left','288px'); },
			function(){}
		);
	}).delay(6000);
	
	(function(){
		llScrollFX.start('width', '12px').chain(
			function(){ this.start( 'background-position', '-63px -4px' ); },
			function(){}
		);
	}).delay(10000);

	(function(){
		o1ScrollFX.start('width', '32px').chain(
			function(){ this.start( 'background-position', '-75px -4px' ); },
			function(){}
		);
	}).delay(11000);

	(function(){
		o2ScrollFX.start('background-position','-182px -4px');
	}).delay(12000);

	(function(){
		b_ScrollFX.start('width', '30px').chain(
			function(){ this.start('background-position','-152px -4px'); }
		);
	}).delay(13000);

animBallFX.start({
		'-webkit-transform': 'rotate(8.2deg)',
		'-khtml-transform': 'rotate(8.2deg)',
		'-moz-transform': 'rotate(8.2deg)',
		'-o-transform': 'rotate(8.2deg)',
		'transform': 'rotate(8.2deg)',
		'top': '-5px', 'left': '-64px'
	}).chain(
		function(){this.start({ 'top':  '0px','left':'-30px' }); },
		function(){this.start({ 'top':  '5px','left':  '0px' }); },
		function(){this.start({ 'top': '15px','left': '30px' }); },
		function(){this.start({ 'top': '30px','left': '60px' }); },
		function(){this.start({ 'top': '45px','left': '90px' }); },
		function(){this.start({ 'top': '60px','left':'120px' }); },
		function(){this.start({ 'top': '80px','left':'150px' }); },
		function(){this.start({	'top':'100px','left':'180px' }); },
		function(){this.start({ 'top':'133px','left':'220px' }); },
		function(){this.start({	'top':'133px','left':'225px',
			'-webkit-transform': 'rotate(0deg)',
			'-khtml-transform': 'rotate(0deg)',
			'-moz-transform': 'rotate(0deg)',
			'-o-transform': 'rotate(0deg)',
			'transform': 'rotate(0deg)'
		}); },
		function(){this.start({ 'top':'120px','left':'230px' }); },
		function(){this.start({ 'top':'100px','left':'235px' }); },
		function(){this.start({ 'top': '80px','left':'245px' }); },
		function(){this.start({ 'top': '60px','left':'260px' }); },
		function(){this.start({ 'top': '40px','left':'275px' }); },
		function(){this.start({ 'top': '25px','left':'290px' }); },
		function(){this.start({ 'top': '10px','left':'310px' }); },
		function(){this.start({ 'top':  '5px','left':'335px' }); },
		function(){this.start({ 'top': '-5px','left':'365px' }); },
		function(){this.start({ 'top':  '5px','left':'395px' }); },
		function(){this.start({ 'top': '10px','left':'420px' }); },
		function(){this.start({ 'top': '25px','left':'440px' }); },
		function(){this.start({ 'top': '40px','left':'455px' }); },
		function(){this.start({ 'top': '60px','left':'470px' }); },
		function(){this.start({ 'top': '80px','left':'490px' }); },
		function(){this.start({ 'top':'100px','left':'500px' }); },
		function(){this.start({ 'top':'133px','left':'505px' }); },
		function(){this.start({ 'top':'133px','left':'507px' }); },
		function(){this.start({ 'top':'120px','left':'512px' }); },
		function(){this.start({ 'top':'110px','left':'515px' }); },
		function(){this.start({ 'top': '95px','left':'520px' }); },
		function(){this.start({ 'top': '75px','left':'530px' }); },
		function(){this.start({ 'top': '55px','left':'540px' }); },
		function(){this.start({ 'top': '40px','left':'550px' }); },
		function(){this.start({ 'top': '25px','left':'560px' }); },
		function(){this.start({ 'top': '10px','left':'565px' }); },
		function(){this.start({ 'top':  '0px','left':'573px' }); },
		function(){titleBackFX.start('background-position','485px 0', '0 0')},
		function(){}
	);
});
