var slide_1 = function() {
    $( 'slide-1' ).tween( 'opacity','0' );
    $( 'slide-2' ).tween( 'opacity','1' );
    $( 'slide-3' ).tween( 'opacity','1' );    
    $( 'slide-4' ).tween( 'opacity','1' );
    $$( '#first .title' ).tween('opacity', '0');
    $$( '#first .redBox' ).tween('opacity', '1');
    $$( '#second .title' ).tween('opacity', '1');
    $$( '#second .redBox' ).tween('opacity', '0');
    $$( '#third .title' ).tween('opacity', '1');
    $$( '#third .redBox' ).tween('opacity', '0');
    $$( '#last .title' ).tween('opacity', '1');
    $$( '#last .redBox' ).tween('opacity', '0');
    $( 'first' ).tween('left', '0px');
    $( 'second' ).tween('left', '627px');
    $( 'third' ).tween('left', '737px');
    $( 'last' ).tween('left', '847px');
    $( 'first' ).setStyle( 'cursor','default' );
	$( 'second' ).setStyle( 'cursor','pointer' );
	$( 'third' ).setStyle( 'cursor','pointer' );
	$( 'last' ).setStyle( 'cursor','pointer' );
};

var slide_2 = function() {
    $( 'slide-1' ).tween( 'opacity','1' );
    $( 'slide-2' ).tween( 'opacity','0' );
    $( 'slide-3' ).tween( 'opacity','1' );    
    $( 'slide-4' ).tween( 'opacity','1' );
    $$( '#first .title' ).tween('opacity', '1');
    $$( '#first .redBox' ).tween('opacity', '0');
    $$( '#second .title' ).tween('opacity', '0');
    $$( '#second .redBox' ).fade('in');
    $$( '#third .title' ).fade('in');
    $$( '#third .redBox' ).setStyle('opacity', '0');
    $$( '#last .title' ).fade('in');
    $$( '#last .redBox' ).setStyle('opacity', '0');
    $( 'first' ).tween('left', '0px');
    $( 'second' ).tween('left', '127px');
    $( 'third' ).tween('left', '737px');
    $( 'last' ).tween('left', '847px');
	$( 'first' ).setStyle( 'cursor','pointer' );
	$( 'second' ).setStyle( 'cursor','default' );
	$( 'third' ).setStyle( 'cursor','pointer' );
	$( 'last' ).setStyle( 'cursor','pointer' );
};

var slide_3 = function() {
    $( 'slide-1' ).tween( 'opacity','1' );
    $( 'slide-2' ).tween( 'opacity','1' );
    $( 'slide-3' ).tween( 'opacity','0' );    
    $( 'slide-4' ).tween( 'opacity','1' ); 
    $$( '#first .title' ).tween('opacity', '1');
    $$( '#first .redBox' ).tween('opacity', '0');
    $$( '#second .title' ).tween('opacity', '1');
    $$( '#second .redBox' ).tween('opacity', '0');
    $$( '#third .title' ).tween('opacity', '0');
    $$( '#third .redBox' ).tween('opacity', '1');
    $$( '#last .title' ).tween('opacity', '1');
    $$( '#last .redBox' ).tween('opacity', '0');   
    $( 'first' ).tween('left', '0px');
    $( 'second' ).tween('left', '127px');
    $( 'third' ).tween('left', '237px');
    $( 'last' ).tween('left', '847px');
    $( 'first' ).setStyle( 'cursor','default' );
	$( 'second' ).setStyle( 'cursor','pointer' );
	$( 'third' ).setStyle( 'cursor','default' );
	$( 'last' ).setStyle( 'cursor','pointer' );   
};

var slide_4 = function() {
    $( 'slide-1' ).tween( 'opacity','1' );
    $( 'slide-2' ).tween( 'opacity','1' );
    $( 'slide-3' ).tween( 'opacity','1' );    
    $( 'slide-4' ).tween( 'opacity','0' );
    $$( '#first .title' ).tween('opacity', '1');
    $$( '#first .redBox' ).tween('opacity', '0');
    $$( '#second .title' ).tween('opacity', '1');
    $$( '#second .redBox' ).tween('opacity', '0');
    $$( '#third .title' ).tween('opacity', '1');
    $$( '#third .redBox' ).tween('opacity', '0');
    $$( '#last .title' ).tween('opacity', '0');
    $$( '#last .redBox' ).tween('opacity', '1');
    $( 'first' ).tween('left', '0px');
    $( 'second' ).tween('left', '127px');
    $( 'third' ).tween('left', '237px');
    $( 'last' ).tween('left', '347px');   
	$( 'first' ).setStyle( 'cursor','pointer' );
	$( 'second' ).setStyle( 'cursor','pointer' );
	$( 'third' ).setStyle( 'cursor','pointer' );
	$( 'last' ).setStyle( 'cursor','default' );
};

window.addEvent( 'domready', function() {

	Asset.javascript( "http://twitter.com/javascripts/blogger.js", { type: 'text/javascript', language: 'javascript' } );
	Asset.javascript( "http://twitter.com/statuses/user_timeline/tastebaguette.json?callback=twitterCallback2&count=1", { type: 'text/javascript', language: 'javascript' } );

	$( 'first' ).addEvent('click', slide_1);
	$( 'second' ).addEvent('click', slide_2);
	$( 'third' ).addEvent('click', slide_3);
	$( 'last' ).addEvent('click', slide_4);
    $$( '#second .redBox' ).setStyle('opacity', '0');
    $$( '#third .redBox' ).setStyle('opacity', '0');
    $$( '#last .redBox' ).setStyle('opacity', '0');
	
});
